Repository navigation
Description
Done 2026-08-10. Log2n-io/Typhon#749 → c011a7f9 · Log2n-io/Typhon-Claude#75 → b22c3151. rules/ is on Typhon main.
Follow-up split out: #751 (revoke TYPHON_CLAUDE_TOKEN) — kept as its own Task so a live credential does not close with this issue.
Parent epic: #418
Why
claude/rules/ is a code artifact that happens to be written in markdown, and it was stored in the private docs repo (Log2n-io/Typhon-Claude):
| Direction | Count |
|---|---|
scope: lines naming C# symbols |
~185 (of 191 rules) |
[VerifiesRule] attributes in test/ |
70 |
Source/test files citing a rule id in comments (RB-01, LOG-06, CP-04…) |
75 files |
Markdown links from rules/ → rest of claude/ |
4 (3 design, 1 adr) |
Markdown links from rest of claude/ → rules/ |
32 sites across 64 files |
Rules point at code ~330 times and at the rest of the knowledge base four times. claude/ holds prose about code; rules/ was the only directory in it that is mechanically checked against code. Its correct home is wherever its verifier lives.
What the split cost
- A PAT in a public repo's CI. Two jobs checked out the private repo with
secrets.TYPHON_CLAUDE_TOKEN.merge-gate.yml's own comment: "a capability, not a fence." - 19 forks got no audit — secrets are withheld from fork PRs, so
--skip-if-no-rulesskipped. - The path filter could not see rule edits, with the admission in-file that the database lived elsewhere. Editing a rule ran no audit at all.
- Two ~15-line steps guessed the companion docs branch by matching its NAME.
- A merge deadlock — Test suite as a defect detector #702, Bug bash: eight defects fixed, two filed with measurements #717, #631 #662 #582 #710 #569 #672 #688 Bug bash round two: seven fixes, and the view bug underneath one of them #719; main red for twelve hours, two runs never re-run.
- Two workarounds built to survive it: a docs-first human protocol, and
--baseline-rules, which materialised a git worktree in CI to tell "drifted" from "hasn't landed yet".
Publishing the rules was a deliberate decision taken 2026-08-10: the code is already public, and 191 machine-checked invariants are the best contributor documentation the project has.
Acceptance criteria
-
rules/(six domain files +README.md+tla/) at the Typhon repo root, deleted fromTyphon-Claude. History stays reachable inTyphon-Claude; afilter-repograft over the public DAG for 21 files was not worth it. -
check-rule-scopes.pyand its self-tests move here;--repo-rootand--baseline-rulesdeleted. -
audit-rule-coverage.pyloses--skip-if-no-rulesand can no longer skip. Amended:--rules-diris kept but retargeted — it is the fixture hook the self-tests use, like--tests-dir/--baseline/--matrix, not cross-repo plumbing. -
merge-gate.yml: both cross-repo checkouts, both "companion docs branch" steps, and every use ofsecrets.TYPHON_CLAUDE_TOKENare gone. -
changes.rulesincludesrules/**;tlagainsrules/tla/**. - Rule-scope checking is a blocking PR job, in
invariants, unconditional — deliberately not gated onrules/**, since an unresolvedscope:symbol is a source-side defect a rules-path gate would never see. - Exactly one TLA+ workflow, path-gated on
rules/tla/**, inheriting the docs-repo*.cfgglob and jar cache in place of a hardcoded three-spec list. -
doc-drift.ymlkeeps only the doc-drift half;tla-check.ymldeleted. - 32 inbound links repointed to absolute URLs;
check-doc-drift.pyreports no drift in enforced docs. Stale prose rewritten inoverview/+design/(55 across 29 files), left alone inadr/(immutable),research/,scratch/,blog/(dated snapshots). - Root
CLAUDE.mdandclaude/CLAUDE.mddescribe the new location and why. - Partially demonstrated, honestly. The rebase produced the real case: docs main had added IXW-03 to
rules/indexing.mdwhile this branch deleted it, and the naive resolution would have dropped a[fatal]rule silently. IXW-03 and therules_total191→192 bump it causes landed in one commit — PR #740 Compare the insert lower-bound guard against the previous leaf's HighKey, not the leaf's own first key #745 could not touch the rule, PR Epoch Phase 3: Caller Migration — B+Tree, Transaction, CRUD to epoch-based API #73 could not touch the counter, and this was the first change that could hold both. What is not yet demonstrated is the full shape: a rule plus its[VerifiesRule]test plus the code it scopes in one commit. That awaits a natural PR; nothing structural stands in its way now. - → #747 Revoke TYPHON_CLAUDE_TOKEN — a live cross-repo credential with no consumer #751 Revoke
TYPHON_CLAUDE_TOKEN. Nothing references it (git grepon main returns nothing), which is exactly why it must not be left.
Found while doing it (both fixed)
- A guard that would have been silently dropped.
check-doc-drift.pyhadENFORCED_DIRS = {"overview", "rules"}— it validated thesrc/…paths and links inside rule files, which is not whatcheck-rule-scopes.pydoes.scripts/check-doc-links.pynow coversrules/, withbuild-docs.ymlgated onrules/**. - Latent bug in
check-doc-drift.py: its link checker never skipped absolute URLs while its regex matches any.mdtarget, so everyhttps://…/rules/durability.mdread as a missing file.
Verification at merge
Scopes 186 lines, all resolve · audit 0 blocking · doc-links 335 files / 1865 links, PASS · doc-drift no drift in enforced docs · 100 script self-tests OK · build 0 warnings, 0 errors · suite 5117 passed, 3 failed.
The 3 failures (PayloadAxes_SurviveACrash, DirtyCounter_IsConservedAtQuiesce, ParallelOperations_AreLinearizable) fail identically on unmodified 3958c154 and on main head a464cf75, baselined in a throwaway worktree. The C# diff was thirteen comment lines.
Only rules_total moved in the ratchet baseline; the three figures it protects are unchanged.
Activity
#747 Move the correctness-rule database into this repo
#747 Carry IXW-03 across, and bump the count it changes in the same c…
#747 Move the correctness-rule database into this repo (#749)
#614 #615 Restore the three schema invariants that the rule-database …
#614 #615 Restore the three schema invariants that the rule-database …
CI: tla runs on a spec change only, not on every Durability code edit…