feat(ratchet): enforce R3 'no learning without a constraint' as a script gate (ag-maaa #r3-constraint-gate)#768
Open
boshu2 wants to merge 1 commit into
Open
feat(ratchet): enforce R3 'no learning without a constraint' as a script gate (ag-maaa #r3-constraint-gate)#768boshu2 wants to merge 1 commit into
boshu2 wants to merge 1 commit into
Conversation
…ipt gate (ag-maaa #r3-constraint-gate) The promotion-ratchet rung "Must never regress -> add a validation gate" (docs/architecture/operating-loop.md) was prose only: a learning could be promoted to a durable maturity tier without ever compiling into a gate/test/rule. R3 itself was never enforced. Add scripts/check-ratchet-r3-constraint.sh: scans the learnings corpus and flags any durable-tier learning (candidate/established/canonical/stable/ promoted) that cites no constraint -- a scripts//.github/workflows/ gate, a _test.go/tests/ reference, a skills/**/SKILL.md step, or a constraint:/enforced_by: frontmatter field. Warn-only by default; --strict (or RATCHET_R3_BLOCKING=true) makes it blocking, mirroring the ratchet's own warn-then-fail promotion ladder. A CI path-filter gate is intentionally NOT used: .agents/learnings/** is gitignored, so such a gate would be dead-by-design (the same reason the learning-coherence CI job was retired). The script runs at ratchet/flywheel time against the live local corpus; its own correctness is gated in CI by the committed bats test. - scripts/check-ratchet-r3-constraint.sh: the gate (shellcheck-clean) - tests/scripts/check-ratchet-r3-constraint.bats: 11 hermetic tests on a synthetic fixture (CI runs tests/scripts/*.bats) - docs/architecture/operating-loop.md: enforcement pointer under the promotion-ratchet table (prose -> referenced gate) Closes-scenario: ag-maaa#r3-constraint-gate Bounded-context: BC1-Corpus Evidence: tests/scripts/check-ratchet-r3-constraint.bats
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.
What
Makes the Brownian-Ratchet rule R3 — "no learning without a constraint" self-enforcing. Previously it was prose only (
docs/architecture/operating-loop.mdpromotion table: "Must never regress → add a validation gate"): a learning could be promoted to a durable maturity tier without ever compiling into a gate/test/rule. The mechanism existed (cli/internal/ratchet/) but R3 was a manual operator decision with no check.How
scripts/check-ratchet-r3-constraint.shscans the learnings corpus and flags any durable-tier learning (candidate/established/canonical/stable/promoted) that cites no constraint — ascripts//.github/workflows/gate, a_test.go/tests/reference, askills/**/SKILL.mdstep, or aconstraint:/enforced_by:frontmatter field. Provisional learnings are exempt (still forming).--strictorRATCHET_R3_BLOCKING=truemakes the same gaps blocking (exit 1).Why a script, not a CI path-filter gate
.agents/learnings/**is gitignored (0 tracked). A CI path-filter gate on it would be dead-by-design — the exact reason thelearning-coherenceCI job was retired (2026-05-19). So R3 runs at ratchet/flywheel time against the live local corpus; the script's own correctness is gated in CI by the committed bats test (tests/scripts/*.batsruns invalidate.yml).Verification
tests/scripts/check-ratchet-r3-constraint.bats— 11 hermetic tests on a synthetic fixture (warn-first, --strict, env-var parity, provisional exemption, empty-field rejection, gate/test/SKILL citation forms, count accuracy). All pass.shellcheckclean.Closes-scenario: ag-maaa#r3-constraint-gate
Bounded-context: BC1-Corpus
Evidence: tests/scripts/check-ratchet-r3-constraint.bats