Repository navigation
feat(rules): prove the kit's state machines with gdp-wired and fix the laws the bash broke (SPEC-430) - #1210
Open
monotykamary wants to merge 3 commits into
Open
monotykamary wants to merge 3 commits into
monotykamary wants to merge 3 commits into
Conversation
…e laws the bash broke (SPEC-430) Every implicit state machine and decision the kit runs is now a native gdp-wired rule in lib/rules/<area>/, written from what the code does, with the laws the docs promise. Laws over state reloaded from disk are proven from any state and kernel-checked; each rule keeps the bug it rules out as a broken variant that must be refused; each rule backed by runnable bash has a bridge that runs the real script beside it. - verify-loop: the two-retry fix cap lived only as prose in commands/execute.md. It is now a proven rule that bin/verify-loop steps; /kit:execute reports each verdict to it and does what it prints. - 100 rules across gates, goals/queue, specs/board, wrap/land and hooks; `node lib/rules/prove.ts` proves them all (tests/test-rules.sh), `--bridges` runs every bridge against the real scripts. - 30 promised laws the bash broke, each reproduced by its bridge, fixed, re-proven, kept as a refused variant and covered by a regression test, among them: 17 destructive commands past safety-gate; anti-rationalization reading a field Claude Code never sends; lane lowering through the plain override verb; dispatch-gate proving ./** and a/** disjoint; two queue conductors on one slug; a goal claim taking over another session; a missing merge state read as CLEAN; a non-numeric retry cap looping forever; board work crashing on jq 1.7. - Promises the code knowingly does not keep are recorded per area in FINDINGS.md, asserted to stay refuted.
…rd the proof of done master took SPEC-430 while this branch was open. tests/test-rules.sh now uses a named mktemp template. docs/verification/gdp-wired-proof.md records the proofs, the bridges, the full suite against master on the same box, and the eight negative controls.
Collaborator
PR 1210 review (head 0a1ac00)Verdict: split
Hook behaviour changes
No new env switch in any hook. Input read changes only in anti-rationalization. anti-rationalization claim confirmed. The Claude Code 2.1.332 Stop schema has Reproduced bugs (master, sandboxed)D = direct hook/script input. T = the PR's regression test run against master code.
Also red on master: ledger root escape and torn line, orchestrate B8/B9, spec-task-done unwritable log. Supply chain and fail-open
Scope
Tests on the PR head (sandboxed)
Kept findings
Could not check
|
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
Every implicit state machine and decision the kit runs is now a native gdp-wired rule in
lib/rules/<area>/. Each rule is written from what the code does, with the laws the docs promise, proven and kernel-checked, and held to the real bash by a bridge. Where the code broke a promised law, the bash is fixed.Spec:
docs/specs/SPEC-430-gdp-wired-rules.md. Module:lib/rules/README.md. Per-area findings:lib/rules/{gates,goals,specs,wrap,hooks}/FINDINGS.md.The retry loop is now code
The two-retry fix cap ("a fix loop stops after two tries and asks you") existed only as pseudocode in
commands/execute.md. It is now a proven rule (lib/rules/verify-loop.ts, 8 laws: at most 2 fix cycles, FAIL:escalate never retried, a known failure spends nothing, a finished run never reopens, …).bin/verify-loopruns the compiled rule, and/kit:executereports each verdict to it and does what it prints.How each rule is held
{from: 'any'}. A proof counts only whenproven && checked && !assumes.node lib/rules/prove.tsruns every proof in about a minute (tests/test-rules.sh).--bridgesalso runs every bridge.30 broken laws, fixed
Each was found by a faithful rule refuting a documented promise, reproduced by its bridge on the real bash, fixed minimally in the kit's style, re-proven, kept as a refused variant, and covered by a regression test. Highlights:
FOO="a b" rm -rf src,git reset --har,git push --branches, a tag pushed ontomain, andkubectl -v 6 delete..assistant_response, but Claude Code sendslast_assistant_message, so it never fired.overrideverb.| GATE | impl-notes | override |cleared the missing-notes block../**vsa/**andb/../a/**vsa/**were "proven" disjoint, so overlapping sub-goals could run in one wave.mergeStateStatuswas read as CLEAN;WRAP_MERGE_RETRY_MAXretried forever;["merge"]table name fell back to a plain squash.config getread the wrong layer for keys with two dots.FINDINGS.md.Kept findings: design calls for the maintainer
These promises the code knowingly does not keep. Each is recorded, and the prover asserts it stays refuted, so a change is noticed:
stop_hook_active), which contradicts "the four hard stops are never waived".mega statusshows PENDING for an existing branch measured against a missing base.nextpath are silent.Prose-only machines that could be wired the way
bin/verify-loopwires the retry loop: the autonomy dial, the/kit:debug3-fix wall, the quiescence round cap, and the/kit:docs2-round stop.Verification
lib/gate/negctl.shon a disposable copy, Linux box): each fixed file was put back tomaster, its regression suite went RED, then GREEN once restored. All 8 controls passed:run-all.sh --all, 353 suites, Linux, jq 1.7, against amasterbaseline on the same box):board-work,mega-box,mega-merge,mega-reconcile,mega-tickandmerge-command, which fail onmasterthere.wrap-*,board-hermes,harvest-sweep,shared-lookupsandui-acceptance-verifier.test-rules12/12test-meta934/934test-hooksalltest-bin-forwarders53/53test-kit-contract25/25test-known-failures,test-board-work113/113,test-precedent83/83,test-whole-spec-dispatch39/39docs/verification/gdp-wired-proof.mdin a follow-up commit on this branch.Notes
bin/verify-loopand the provers need Node 22+ and the pinnedgdp-wired(install.shrunsnpm ciinlib/rules). Hooks stay bash and never load these files.hooks/codex-hooks.jsonis repinned for the edited hooks.