ratchet(ts-persona): forbidden-strings monotonic-decrease gate (Lane F PR-2)#1094
Merged
Conversation
…F PR-2) Per-pattern ratchet on src/system/user/server/, mirroring PR #1091's LOC ratchet shape. Tracks three anti-patterns under the persona surface: - fallback_mention (case-insensitive, baseline 83): Joel 2026-04-22 — "fallbacks have ruined this project ... they are ILLEGAL." The WORD count proxies conceptual presence; comments saying "no fallback here" count too. - direct_adapter_instantiation (baseline 12): matches `new <Name>Adapter(`. TS surface should request providers via the ModelRequirement → ResolvedModel resolver shipped in #1066/#1074, not instantiate adapters directly. - direct_api_key_env_read (baseline 0): matches `process.env.*API_KEY`. Cloud key lookup belongs in the Rust provider registry per Codex's #1077 boundary. Locks 0 in. Per-pattern monotonic-decrease (any pattern growing fails CI; shrinkage allowed and surfaces a hint to --update-baseline post-merge). Same 3-mode shape as PR #1091: default check / --update-baseline / --verbose. Validated locally: clean tree passes (3 patterns hold), intentional +2 fallback growth fails with named pattern + delta + actionable Rust target paths. Lane F (PR #1084 alpha workstreams). Companion to #1091 — extends docs/architecture/TS-PERSONA-COGNITION-RATCHET.md with the new gate. Independent CI workflow (~5s, shell + python only). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Mac peer review — LGTM, ship. Strengths:
One observation (intentional per rationale, NOT a blocker): LGTM. Ship. |
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
Per-pattern monotonic-decrease ratchet on
src/system/user/server/,mirroring PR #1091's LOC ratchet shape. Companion gate to #1091 — same
shell+python implementation, same independent CI workflow (~5s).
Tracked patterns
fallback_mention(case-insensitive)direct_adapter_instantiation(new <Name>Adapter()direct_api_key_env_read(process.env.*API_KEY)Any pattern growing fails CI; shrinkage allowed and surfaces a hint to
--update-baselinepost-merge.Files
scripts/ratchets/check-ts-persona-forbidden-strings.sh(~180 LOC, bash + python only — 3 modes: default check /--update-baseline/--verbose)scripts/ratchets/ts-persona-forbidden-strings-baseline.json(per-pattern config + rationale, anchored at canary 83513e6).github/workflows/ts-persona-forbidden-strings-ratchet.yml(mirrors ratchet(ts-cognition): add TS persona-cognition deletion ratchet (Lane F) #1091's workflow shape; PR + push triggers on canary/main)docs/architecture/TS-PERSONA-COGNITION-RATCHET.md(extends ratchet(ts-cognition): add TS persona-cognition deletion ratchet (Lane F) #1091's doc with the new gate)Local validation
// fallback fallbackin UserEntityCache.ts❌ fallback_mention: baseline=83 current=85 delta=+2+ actionable Rust target paths--update-baselinemode--verbosemodeOut of scope (followups, named in #1091)
Test plan
--update-baselineand--verbosemodes validatedsrc/system/user/server/should fail this gate🤖 Generated with Claude Code