Skip to content

Commit ce45b4b

Browse files
hyperpolymathclaude
andcommitted
feat(hypatia-rules): HYP-S005 self-consistency heuristics (2026-04-18)
Add three cheap pre-filter heuristics to the CRG overclaim detector that fire BEFORE the file-tree evidence scan: 1. grade_ge_c_but_early_stage — flags repos claiming C/B/A with version < 0.5.0 AND completion-percentage < 50 AND no populated [dogfooding-status]. Catches the civic-connect / bofig / januskey shape where STATE.a2ml contradicts itself on its own face. 2. grade_b_but_no_external_targets — flags B/A claims without any [external-targets] or legacy [grade-b-status] entries. 3. grade_a_but_no_field_signal — flags A claims without any [field-signal] entries. Reduces full scan cost by whatever fraction of the estate is overclaimed on its own metadata alone. 2026-04-18 Phase 3 bulk-triage found 17 of 46 self-declared-C repos (~37%) fail the cheapest heuristic without any file-tree inspection; the full evidence scan now runs only on those that pass self-consistency. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a26393e commit ce45b4b

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

hypatia-rules/crg-overclaim-detector.a2ml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,64 @@ sections:
154154
notes: "superseded by [external-targets]; entries need re-classification per audit"
155155
@end
156156

157+
@self_consistency_heuristic:
158+
# Added 2026-04-18 after the Phase 3 random sample (civic-connect, bofig,
159+
# januskey) produced 3/3 demote with a shared shape: STATE.a2ml self-declares
160+
# a grade that its own adjacent fields contradict. This heuristic catches the
161+
# worst offenders at zero file-tree cost — it reads only STATE.a2ml.
162+
#
163+
# Contradiction rule: a repo cannot self-consistently claim C (or higher) if
164+
# its own metadata says it is <50% complete and pre-0.5.0. Either the grade
165+
# is wrong, the version is wrong, or the completion-percentage is wrong.
166+
# The audit convention is: trust version + completion, demote the grade.
167+
#
168+
# This fires BEFORE the file-tree evidence checks; if it fires, a full audit
169+
# may not be needed — the repo is self-inconsistent on the face of it.
170+
171+
grade_ge_c_but_early_stage:
172+
condition: >-
173+
parse_state.crg-grade IN {"C", "B", "A"}
174+
AND parse_state.version < "0.5.0"
175+
AND parse_state.completion-percentage < 50
176+
AND parse_state.dogfooding-status IS empty_or_absent
177+
severity: high
178+
finding_kind: self-inconsistent-claim
179+
exempt_if:
180+
- "[dogfooding-status] is populated (explains why C is plausible despite the numbers)"
181+
- "crg-grade-demoted is set to a recent date (repo is already in a correction cycle)"
182+
message: >-
183+
{component} claims {declared} with version={version}, completion={completion}%,
184+
no [dogfooding-status]. Under v2.0 this is an overclaim on the face of
185+
STATE.a2ml — demote to E (or D if structural-policy compliant), or populate
186+
[dogfooding-status] with evidence.
187+
188+
grade_b_but_no_external_targets:
189+
condition: >-
190+
parse_state.crg-grade IN {"B", "A"}
191+
AND parse_state.external-targets IS empty_or_absent
192+
AND parse_state.grade-b-status IS empty_or_absent
193+
severity: high
194+
finding_kind: self-inconsistent-claim
195+
message: >-
196+
{component} claims {declared} without any [external-targets] or legacy
197+
[grade-b-status] entries. B requires 6+ diverse external targets — this is
198+
a structural overclaim. Demote to C until targets are documented.
199+
200+
grade_a_but_no_field_signal:
201+
condition: >-
202+
parse_state.crg-grade == "A"
203+
AND parse_state.field-signal IS empty_or_absent
204+
severity: high
205+
finding_kind: self-inconsistent-claim
206+
message: >-
207+
{component} claims A without any [field-signal] entries. A requires
208+
real-world external feedback — demote to B.
209+
210+
# Cheap pre-filter order: run heuristics first, THEN the file-tree evidence
211+
# scan only on repos that pass self-consistency. This reduces scan cost by
212+
# whatever fraction of the estate is overclaimed on its own state alone.
213+
@end
214+
157215
@action:
158216
emit_signal: compliance.finding.new
159217
message_template: >-

0 commit comments

Comments
 (0)