docs: CLAUDE.md becomes a constitution; current truth gets one owner each - #215
Open
adrianwedd wants to merge 2 commits into
Open
docs: CLAUDE.md becomes a constitution; current truth gets one owner each#215adrianwedd wants to merge 2 commits into
adrianwedd wants to merge 2 commits into
Conversation
CLAUDE.md had grown to 495 lines holding rules, subsystem detail, tuning constants and incident history in the same voice, so nothing in it could be trimmed safely and several claims had outlived the code. It now holds only the cross-cutting invariants and a map (212 lines); every subsystem gets one canonical doc that separates `## Invariant` from `## Why it looks like this`. Stale claims corrected against code rather than carried forward: - test count ~1235 -> 1460 collected - provenance "six kinds" -> seven; `model_perception` (ceiling 0.75, added by #177) was undocumented. The same off-by-one is still in `src/pxh/provenance.py`'s docstring and is filed separately. - `DESCRIBE_SCENE_TIMEOUT` 150s -> 165s, raised with `CLAUDE_TIMEOUT` by #202 - the self-evolution blacklist omitted `policy.py` and `test_policy_invariants.py`, which are in `BLACKLIST_FILES` - `runtime_paths.py`'s `/run/spark` tmpfs class was absent entirely, though it is what ended the px-alive watchdog storm Verified as still true and left alone: SIGUSR1/`yield_alive`, the GPIO lease, and the three policy enforcement points all match master. `docs/SCRIPTS.md` already owned px-race's PD sign convention more accurately than CLAUDE.md did, so wander-safety links to it rather than duplicating it. Specs, plans and superseded notes get a banner saying they are decision fossils; HANDOFF.md and ALL_DOCS_REVIEW.md move under docs/historical/. AGENTS.md described a Codex-only voice loop that no longer exists and becomes a pointer. `tests/test_docs.py` pins the three things that can rot silently: relative links resolve, the blanket-staging prohibition is present, and the fossil banner exists. Each check was confirmed to fail when broken. Docs only. No behaviour change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TTC3fktSvjQNSShHyj7ATt
The 21 failures on a full run are not one thing. Eleven need hardware, six sample the live session (#210), two are decided by the wall clock (#213, filed from this audit) and one or two are fixed waits under load (#211). Reading that list as "the suite is flaky" is how a real regression gets waved through. Also cites #214 for the provenance docstring's stale count, so the note in provenance.md has somewhere to go when it lands. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TTC3fktSvjQNSShHyj7ATt
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.
Documentation architecture only. No behaviour change — no file under
src/orbin/is touched.The problem
CLAUDE.mdwas 495 lines mixing four genres in one voice: binding rules, subsystem detail, tuning constants, and incident narrative. Nothing in it could be trimmed safely, and because none of it was checkable, several claims had quietly outlived the code they described.What changed
CLAUDE.md→ 212 lines, holding only what a fresh agent must never break and where current truth lives: ten cross-cutting invariants, a "where current truth lives" table, a "read this before touching that" table, and the tool-addition checklist.16 canonical docs, each separating
## Invariant(current, testable, citing the code and the test that pins it) from## Why it looks like this(history, explicitly labelled as rationale rather than rule).Stale claims corrected against code
Each was verified by reading the source, not by trusting the old text:
mastermodel_perception(ceiling 0.75, added by #177) was undocumentedDESCRIBE_SCENE_TIMEOUT150sCLAUDE_TIMEOUT45→60 by #202policy.py+test_policy_invariants.py, both inBLACKLIST_FILESstate/is where state livesruntime_paths.py's/run/sparktmpfs class was absent entirely, though it is what ended the px-alive watchdog stormAlso verified and left alone because they are still true: SIGUSR1/
yield_alive, the GPIO lease andPX_GPIO_LEASE_IDborrowing, and the three-enforcement-point policy description. Every numeric claim carried forward — the Claude budget table, PIN lockout, consolidation window,STALE_AFTER_S, relay address — was re-read from source.Fossils
docs/superpowers/README.mdanddocs/historical/README.mdcarry a banner making clear those documents are decision fossils, not current truth.HANDOFF.mdanddocs/ALL_DOCS_REVIEW.mdmove underdocs/historical/(pure renames).AGENTS.mddescribed a Codex-only voice loop that no longer exists and becomes a pointer toCLAUDE.md.Preserved rather than duplicated
docs/SCRIPTS.mdalready ownedpx-race's PD sign convention and safety-layer ordering more accurately thanCLAUDE.mddid — it correctly explains the negative gains.wander-safety.mdlinks to it. Same forsystemd/README.md, whose back-reference into aCLAUDE.mdsection that no longer exists is repointed todocs/operations/deployment.md.Tests
tests/test_docs.py— 25 tests, deliberately small. Relative links resolve; the blanket-staging prohibition is present inCLAUDE.md; the fossil banner exists; every canonical doc separates invariant from history.Each check was confirmed to fail when broken (broke a link, removed the staging rule, removed the banner, removed an
## Invariantheading — one red each, then restored). A doc test that cannot fail is worse than none.Verification
Full suite run on this branch: 1459 passed, 21 failed, 1 skipped in 23m52s. All 21 accounted for and none caused by this branch:
test_tools_live.py— needssudoand free hardwaretest_mind_utils— live session sampling, #210 (fixed by #212, not onmaster)TestBudgetSummary— new finding, filed as #213TestRaceEndpoint— fixed thread waits under load, #211The
TestBudgetSummarypair was reproduced on a pristineorigin/masterworktree before being attributed elsewhere.Defects found and filed, not absorbed
TestBudgetSummaryfails deterministically between midnight and ~08:20 Hobart: fixtures use fixed offsets (_ts_ago(30000)) while_today_entries()filters by Hobart calendar day.src/pxh/provenance.py's docstring says "Six kinds" above a table of seven. This is the root of theCLAUDE.mderror, so fixing it needs asrc/change and is out of this PR's scope.yield_alive's 5s poll has no failure branch; cited indocs/hardware/gpio-and-alive.md.Noted, not fixed
docs/SCRIPTS.mdclaims to document every script but has no entry forpx-post,px-blog,mcp-server, ortool-announce. Out of scope here.Base is
origin/master(825c253c), not the#212branch —#212is still open, so documenting its fixture as current would have been wrong.docs/testing.mdmarks session isolation as pending.🤖 Generated with Claude Code
https://claude.ai/code/session_01TTC3fktSvjQNSShHyj7ATt