feat(lane-f): persona-ts cognition deletion ratchet — PR-1 script#1401
Merged
Conversation
Lane F PR-1 per ALPHA-GAP-ANALYSIS §"Lane F: TS Cognition Deletion
Ratchet". Mechanical local gate that prevents the persona-cognition
TypeScript layer from growing while Rust takes over runtime behavior.
Two ratchets, both enforced together:
1. LOC ratchet — total .ts LOC under each watched cognition directory
must not exceed its committed baseline (`persona-ts-baseline.txt`).
2. New-file ratchet — new .ts files appearing under watched dirs must
either be in the baseline file-set OR match a glob in the allowlist
(`persona-ts-allowlist.txt` — generated artifacts, type-only files,
schemas; explicitly NOT new cognition modules).
The ratchet only moves down. After legitimate TS deletion lands, run
`scripts/ratchet/persona-ts-ratchet.sh refresh` to tighten the baseline.
Current baseline (locks the existing deletion gains):
34 files, 8583 LOC across 6 watched cognition directories.
Test suite (`test-persona-ts-ratchet.sh`) — 8 cases, all passing:
clean baseline · LOC growth fails · new unallowed file fails ·
new allowlisted generated passes · new types.ts passes · deletion
after refresh passes · missing baseline returns exit 2 (usage error,
not silent pass) · refresh is idempotent.
Why Bash and not Rust: this is build infrastructure, not runtime
behavior. Lane F's mandate is RUNTIME cognition migration. Build
tooling lives in shell (peer to git-prepush.sh, main-promotion-gate.sh).
The thing being enforced — that runtime logic must be Rust — is
separate from the enforcer's language.
PR-2 (`persona-ts-ratchet-ci`) wires this into pre-push + CI.
PR-3 (`forbidden-provider-scan`) adds the deprecated-provider scan.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Codex review/validation before merge:\n- scripts/ratchet/test-persona-ts-ratchet.sh: 8/8 passed\n- scripts/ratchet/persona-ts-ratchet.sh check: passed at 8583 LOC across 6 watched dirs\n- Scope is build ratchet only; no runtime TS/Node path added.\n\nMerging to canary to keep Lane F cadence moving. |
This was referenced May 18, 2026
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
Lane F PR-1 per ALPHA-GAP-ANALYSIS §"Lane F: TS Cognition Deletion Ratchet". Mechanical local gate preventing the persona-cognition TypeScript layer from growing while the Rust runtime takes over.
.tsLOC under each watched cognition dir must not exceed its committed baseline..tsfiles in watched dirs must be in the baseline OR match a glob in the allowlist (generated,.types.ts,.schema.ts— NOT new cognition modules).refreshregenerates the baseline after legitimate deletion.PR-2 (
persona-ts-ratchet-ci) wires this into pre-push + CI. PR-3 (forbidden-provider-scan) adds deprecated-provider scanning.Test plan
8/8 test cases pass in
scripts/ratchet/test-persona-ts-ratchet.sh:.tsfile fails (exit 1).types.tsfile passes when total LOC fitsRun locally:
scripts/ratchet/test-persona-ts-ratchet.shDesign notes
Why Bash, not Rust: this is build infrastructure, not runtime behavior. Lane F's mandate is RUNTIME cognition migration. Build tooling lives in shell (peer to
git-prepush.sh,main-promotion-gate.sh). The thing being enforced — that runtime logic must be Rust — is separate from the enforcer's language.Why both LOC + new-file ratchets: new-file detection is easy and clean. LOC ratchet catches the "I just added 200 lines of cognition logic to an existing file" failure mode, which the new-file ratchet misses. Together they're complete.
Why allowlist via path-globs, not content classification: content classification is fragile (regexing for "verb-shaped class names" rots fast). Path discipline scales: generated goes in
generated/, types end in.types.ts, schemas inschemas/. The allowlist file is small and reviewable.🤖 Generated with Claude Code