Skip to content

Commit 2792612

Browse files
hyperpolymathclaude
andcommitted
feat(hypatia-rules): add HYP-S005 crg-overclaim-detector
Pairs with HYP-S001 to enforce CRG grade-honesty in both directions: S001 catches backwards moves; S005 catches forwards-overshoots where a repo self-declares C (or higher) without the v2.0 evidence artefacts (per-directory orientation, dogfood log, per-unit README coverage, external-target trail). Evidence thresholds derive from the boj-server 2026-04-18 CRG audit, the first worked example of v2.0 STRICT grading. README bumped to v0.2.0; S001 header gains a sibling cross-reference. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c8a6f8c commit 2792612

3 files changed

Lines changed: 154 additions & 5 deletions

File tree

hypatia-rules/README.adoc

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPDX-License-Identifier: PMPL-1.0-or-later
22
= Standards-Specific Hypatia Rules
3-
:status: Draft v0.1.0
4-
:updated: 2026-04-05
3+
:status: Draft v0.2.0
4+
:updated: 2026-04-18
55

6-
Four Hypatia rules specific to the standards-repo dogfooding loop.
6+
Five Hypatia rules specific to the standards-repo dogfooding loop.
77
Each rule is defined in A2ML, consumes VeriSimDB octads, and emits
88
Groove `compliance.finding.new` signals.
99

@@ -15,6 +15,12 @@ Groove `compliance.finding.new` signals.
1515
| HYP-S002 | `k9-orphan-detector` | Find K9 components not referenced in any Justfile |
1616
| HYP-S003 | `proof-freshness` | Alert when a proof hasn't been re-verified in > 30 days |
1717
| HYP-S004 | `rsr-self-compliance` | Validate standards repo against its own RSR definition |
18+
| HYP-S005 | `crg-overclaim-detector` | Alert when a self-declared CRG grade lacks v2.0 evidence artefacts |
19+
20+
The CRG rule pair (S001 + S005) together enforce grade-honesty: S001
21+
catches backwards moves, S005 catches forwards-overshoots. Both read from
22+
`crg-grade` octads in VeriSimDB, but S005 also scans the repo file tree for
23+
evidence artefacts required by CRG v2.0 (STRICT).
1824

1925
== Implementation
2026

@@ -34,10 +40,11 @@ enabled = true
3440
== Dependencies
3541

3642
Rules read from:
37-
- VeriSimDB `crg-grade` octads (HYP-S001)
38-
- Repo file tree via Hypatia's scanner (HYP-S002, HYP-S004)
43+
- VeriSimDB `crg-grade` octads (HYP-S001, HYP-S005)
44+
- Repo file tree via Hypatia's scanner (HYP-S002, HYP-S004, HYP-S005)
3945
- VeriSimDB `proof-status` octads (HYP-S003)
4046
- `rhodium-standard-repositories/RSR.adoc` (HYP-S004)
47+
- `rsr-template-repo/docs/governance/CRG-AUDIT-TEMPLATE.adoc` (HYP-S005 reference)
4148

4249
And emit:
4350
- Groove `compliance.finding.new` signals with the rule's ID

hypatia-rules/crg-demotion-detector.a2ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# SPDX-License-Identifier: PMPL-1.0-or-later
22
# HYP-S001 — CRG Demotion Detector
33
# Fires when a component's CRG grade moves backwards (e.g. B → C).
4+
#
5+
# Sibling: HYP-S005 crg-overclaim-detector fires on forwards-overshoots
6+
# (self-declared grade without v2.0 evidence artefacts). Together the pair
7+
# enforces grade-honesty in both directions.
48

59
@rule(version="1.0"):
610
id: HYP-S001
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# HYP-S005 — CRG Overclaim Detector
3+
# Flags repos self-declaring a CRG grade that lacks the evidence artefacts
4+
# required by CRG v2.0 (STRICT). Sibling rule to HYP-S001 (demotion detector):
5+
# HYP-S001 catches backwards moves; HYP-S005 catches forwards-overshoots.
6+
#
7+
# Evidence thresholds are derived from the boj-server 2026-04-18 audit,
8+
# which became the first worked example of a v2.0 grade read. See:
9+
# boj-server/docs/governance/CRG-AUDIT-2026-04-18.adoc
10+
# rsr-template-repo/docs/governance/CRG-AUDIT-TEMPLATE.adoc
11+
12+
@rule(version="1.0"):
13+
id: HYP-S005
14+
name: "CRG overclaim detector"
15+
description: "Alert when a self-declared CRG grade in STATE.a2ml is not backed by the v2.0 evidence artefacts required for that grade"
16+
severity: high
17+
category: StandardsCompliance
18+
auto_fixable: false
19+
source: standards/hypatia-rules
20+
21+
@scanner(type="file-tree"):
22+
# Ingest the declared grade from every repo with machine-readable state.
23+
find:
24+
- glob: "**/.machine_readable/STATE.a2ml"
25+
- glob: "**/.machine_readable/6a2/STATE.a2ml"
26+
- glob: "**/.machine_readable/**/STATE.scm"
27+
@end
28+
29+
@logic(engine="built-in"):
30+
# Parse the declared grade, then check evidence thresholds per grade.
31+
# A repo is *overclaimed* if its declared grade exceeds what the evidence
32+
# supports under v2.0.
33+
steps:
34+
- parse_state: "STATE.a2ml"
35+
extract:
36+
- key: "crg-grade"
37+
as: declared
38+
- key: "crg-grade-achieved"
39+
as: declared_date
40+
- classify_repo: "by declared grade"
41+
- run_evidence_checks: "per grade threshold below"
42+
- emit_if_gap
43+
@end
44+
45+
@evidence_thresholds:
46+
# What each grade REQUIRES, as file-tree signals the scanner can verify.
47+
# If the declared grade is >= the row and any `requires` item is missing,
48+
# the repo is overclaimed and a finding is emitted.
49+
50+
D:
51+
requires:
52+
# RSR D-floor (mandatory for D and above)
53+
- file: ".machine_readable/6a2/STATE.a2ml"
54+
or_file: ".machine_readable/STATE.a2ml"
55+
reason: "RSR R-040 (A2ML metadata)"
56+
- file: "README.adoc"
57+
or_file: "README.md"
58+
reason: "RSR R-001 (orientation)"
59+
- file: "LICENSE"
60+
reason: "RSR R-004"
61+
- file: "Justfile"
62+
or_file: "justfile"
63+
reason: "RSR R-020 (no Makefiles)"
64+
- path: "tests/"
65+
or_path: "test/"
66+
or_path: "spec/"
67+
reason: "v2.0 D needs a test matrix"
68+
- path: ".github/workflows/"
69+
reason: "CI evidence of D"
70+
evidence_of:
71+
- "test matrix documented in STATE.a2ml ([test-matrix] or total-tests)"
72+
- "scope documented in STATE.a2ml, ROADMAP.adoc or TOPOLOGY.md"
73+
74+
C:
75+
requires_all_of: "D"
76+
requires:
77+
# v2.0 C adds: dogfooding, CI green, deep per-file + per-directory annotation
78+
- path: "docs/architecture/"
79+
reason: "C requires per-directory orientation — architecture subtree"
80+
- file: "docs/READINESS.md"
81+
or_file: "docs/READINESS.adoc"
82+
reason: "C needs a per-component readiness assessment"
83+
- file: "docs/EXPLAINME.adoc"
84+
reason: "RSR C annotation floor"
85+
- state_key: "dogfooding-status"
86+
in_file: ".machine_readable/6a2/STATE.a2ml"
87+
reason: "C requires documented dogfooding evidence"
88+
evidence_of:
89+
- "CI green in last 7 days (workflow run log)"
90+
- "per-<<unit>> README coverage >= 90% (cartridges, panels, plugins, modules)"
91+
- "per-directory orientation README in every non-trivial source subtree"
92+
- "non-axiomatic believe_me / Admitted / sorry / assert_total = 0"
93+
94+
B:
95+
requires_all_of: "C"
96+
requires:
97+
- state_key: "external-targets"
98+
in_file: ".machine_readable/6a2/STATE.a2ml"
99+
reason: "B requires 6+ diverse external targets tested"
100+
- state_key: "issues-fed-back"
101+
in_file: ".machine_readable/6a2/STATE.a2ml"
102+
reason: "B requires an issues-fed-back pipeline"
103+
evidence_of:
104+
- "6+ diverse external-target entries, each with identity + date + outcome"
105+
- "external-issue label in the repo's issue tracker with >=1 closed issue"
106+
- "feedback log or changelog entry attributing a change to an external target"
107+
negative_signal:
108+
- "internal-capability items (QUIC, multinode, etc.) do NOT count as external targets"
109+
110+
A:
111+
requires_all_of: "B"
112+
requires:
113+
- state_key: "field-signal"
114+
in_file: ".machine_readable/6a2/STATE.a2ml"
115+
reason: "A requires real-world external feedback confirming value"
116+
evidence_of:
117+
- "multi-source external usage confirmation (testimonials, third-party writeups, papers citing)"
118+
- "no harm signal: no unresolved safety / correctness incidents in last 90 days"
119+
@end
120+
121+
@action:
122+
emit_signal: compliance.finding.new
123+
message_template: >-
124+
CRG overclaim: {component} self-declares {declared} but fails {missing_requirement}
125+
(reason: {reason}). Per CRG v2.0 "honest D > dishonest B" — demote or provide
126+
evidence. See rsr-template-repo/docs/governance/CRG-AUDIT-TEMPLATE.adoc.
127+
recipe: none
128+
halt_on_violation: false
129+
dedupe_window_days: 7
130+
@end
131+
132+
@sibling_rules:
133+
- HYP-S001 crg-demotion-detector — fires on backwards moves
134+
- HYP-S003 proof-freshness — fires on stale proof artefacts (C evidence)
135+
- HYP-S004 rsr-self-compliance — RSR D-floor verifier
136+
@end
137+
138+
@end

0 commit comments

Comments
 (0)