Wire Design Contract Checker lenses into a structural registry - #261
Merged
Conversation
The INV-016 workflow-effectiveness fixture used hardcoded absolute dates (2026-04-10/-21/-27). PMB-001's 2026-04-10 crossed the intel script's 90-day recency window on ~2026-07-09, so any CI run after that date silently filtered the audit entry and reddened INV-016e. Generate the fixture dates relative to today so they never drift again. Pre-existing bug, unrelated to the design-contract-lens-sync feature this branch implements; fixed here to keep the branch's CI green.
Add agents/design-contract-lenses.tsv as the single source of truth for the eight PMB-derived Design Contract Checker lenses (DCL-001..008), expand agents/review-spec-design-contract.md with a DCL-tagged, condition-bearing bullet per lens, and bind registry<->agent by set-equality in tests/test-design-contract-lens-sync.sh so a documented lens can never again exist only as CLAUDE.md prose. This closes the DA-001/AP-036 gap where PMB-017's authoring-affordance lens was documented but wired to neither the agent nor the original seed. Also add the /cpostmortem Step-3 convention note (a PMB documenting a new lens must add a registry row), sync both distribution mirrors, add the registry path and lens keywords to the typos ignore-list, and bump the test-file count to 112.
Document agents/design-contract-lenses.tsv as a new primary-SSOT abstraction: the registry is the source of truth and the review-spec-design-contract agent is derived from it via set-equality (opposite authority direction to the ABS-047 sole-writer family, DD-005). Index line in .correctless/ARCHITECTURE.md, full body in docs/architecture/abstractions.md (fragmented-doc layout).
Feature doc (docs/features/), AGENT_CONTEXT.md ABS-050 entry, workflow-history and dev-journal entries, and the /cverify verification report.
joshft
added a commit
that referenced
this pull request
Jul 11, 2026
After PR #261 (design-contract-lens-sync) closed the DA-001 gap, capture the generalized convention: a prose-documented enforcement addition to an agent must ship with a structural SSOT registry + set-equality test in the same feature, or it is AP-036 by construction (documented but never reaching the enforcer). Human-approved post-merge.
joshft
added a commit
that referenced
this pull request
Jul 11, 2026
Minor release: /cchores protected-file affordance (#255), Design Contract Checker lens registry (#261), sanctioned meta sole-writer (#246), InstructionsLoaded/PAT-001 (#221), plus fixes for the affordance capability probe (#264), audit-trail/workflow-gate repo attribution (#244, #243), two ARG_MAX overflows (#212, #211), and the workflow-gate fail-open (#208). Bumps .claude-plugin/marketplace.json plugins[0].version 3.1.1 -> 3.2.0 so the plugin cache picks up the affordance and its capability-probe fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the DA-001 / AP-036 gap: the eight documented
/creview-specDesign Contract Checker lenses (from postmortems PMB-013 to PMB-020) existed only asCLAUDE.mdprose and never reached the enforcing agent — a "corrective-action described but not implemented" instance in the contract mechanism itself. This makes the lens set a first-class, structurally-enforced artifact.agents/design-contract-lenses.tsv— the single source of truth (SSOT) for the 8 PMB-derived lenses (DCL-001cardinality throughDCL-008mechanism-capability-mismatch).agents/review-spec-design-contract.mdexpanded with a## PMB-derived lensessection — oneDCL-tagged, condition-bearing bullet per registry row (keyword +{BLOCKING,flag}directive +{when,if}condition + body floor), plus a template/runbook intro. The generic lens is retained.tests/test-design-contract-lens-sync.shbinds registry to agent by set-equality (completeness + no-orphans), validates registry well-formedness (15-case malformed-fixture rejection suite), enforces the anti-gaming body floor over the live registry (not a hard-coded seed), and self-scans to prevent re-coupling toCLAUDE.md.skills/cpostmortem/SKILL.mdStep 3 convention: a PMB documenting a new Design Contract Checker lens must add a registry row.ABS-050architecture entry — a new primary-SSOT abstraction (opposite authority direction to the ABS-047 sole-writer family: here the registry is the source of truth and the agent is derived from it).The registry is source-only (
sync.shmirrors onlyagents/*.md); user installs receive the lens bodies inline in the shipped agent.md.Incidental fix (separate commit)
A pre-existing, unrelated date-drift in
tests/test-cross-feature-intel.sh: a hardcodedPMB-001fixture date (2026-04-10) crossed the intel script's 90-day recency window on ~2026-07-09, so any CI run after that date silently filtered the "audit" entry and reddenedINV-016e. Fixed by generating the fixture dates relative to today (date -d 'N days ago') so they never drift again — fittingly, the exact bound-drift class the newDCL-001/DCL-007lenses guard against.Test plan
tests/test-design-contract-lens-sync.sh— 73 assertions, all pass (set-equality via two shared-regex extractors, 8 anchored seed rows, live-registry substance loop, 15-case malformed-registry rejection suite, PRH-001 self-scan whitelist, mirror parity, source-only find-check, plus test-the-test cases proving the two extractor scopes differ and the rejection branches are live).sync.shverify clean;shellcheck --severity=warningclean.QA findings
DCL-004/DCL-005lens-body narrowing vs. their source PMBs, andINV-005substance checks iterating only the hard-coded seed array. All fixed.grep+ the single-quoted needle without pinning the trailing file argument, so a prohibitedgrep '<needle>' CLAUDE.md(readingCLAUDE.md) would have passed. Tightened to strip the needle and reject any residual guidance-file token, with 3 new test-the-test assertions.MA-001LOW (the exactly-once uniqueness leg has no dedicated duplicate-token negative fixture — exercised indirectly).Verification status
PASS — all 13 rules (
INV-001..010,PRH-001/002,BND-001) satisfied with real-file evidence and live test enforcement; codex cross-model verification confirmed convergence with no BLOCKING/HIGH outstanding.