Skip to content

fix(scaffold): close holes in the seeded gate ratchet config checks - #203

Merged
cljiahao merged 8 commits into
mainfrom
claude/ratchet-config-holes
Dec 2, 2026
Merged

cljiahao merged 8 commits into
mainfrom
claude/ratchet-config-holes

Conversation

@cljiahao

@cljiahao cljiahao commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Threat model

An agent weakens a quality gate inside its own change by editing linter, type-checker or test config. The ratchet must report that as WEAKENED, or fail closed. A config the ratchet cannot read never passes. No threshold, timeout, pin or budget moves.

Allow-list design

Closed list of files and keys the ratchet reads (anything outside it is not judged; anything inside it that cannot be parsed is UNREADABLE, exit 2, never a skip):

  • pnpm-workspace.yaml: blockExoticSubdeps must not become false (new)
  • tsconfig*.json: strictness flags as before, plus files must not become [] (new); unquoted key or unclosed object is UNREADABLE (new)
  • pyrightconfig.json: same strict parse (new)
  • ESLint config (eslint.config.*): no-empty with allowEmptyCatch is WEAKENED (new)
  • vitest*.config.*: now ratcheted like vitest.config.*; a new second file that competes is WEAKENED (new)
  • Unchanged: ruff select, coverage thresholds, Sonar scope, package.json scripts, and the rest of the existing list.

Legit changes still pass: tightening, adding a rule, unchanged config, a normal first push.

Reproduction against origin/main (per item)

  • Item 1 (UNREADABLE '-eval', DID NOT RUN exit 0): already fixed on origin/main, not reproducible. .mjs, .js, .cjs, .ts configs read correctly; unreadable fails closed.
  • Item 2 (ruff select removed or narrowed): already fixed. A zero-configs-checked run cannot happen on the base route; a defensive guard was added (unreachable, no probe).
  • Item 3: still happened and fixed: blockExoticSubdeps: false, allowEmptyCatch, files: [], second vitest config. Malformed pyright { bad already failed closed; an unquoted key or unclosed object still passed and is now UNREADABLE.

Probe list

GR_ONLY=holes bash scripts/gate-ratchet.test.sh: 41 checks, each weakening case with a clean control, plus "unchanged passes" and "tightened passes" controls for TS and Python. Reverting gate-ratchet.sh to origin/main makes 20 of the 41 fail (every weakening probe); the controls pass either way.

Residuals

  • With the effective-eslint helper and node_modules present, a tightened ESLint option value is still reported as WEAKENED (pre-existing, not touched here).
  • Open PRs 175 and 201 also edit gate-ratchet.sh: expect a text merge.

🤖 Generated with Claude Code

🤖 Generated with Claude Code

Kelerence and others added 8 commits December 2, 2026 10:05
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…pty options, files strings

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t*.config arm

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ty severity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s, strict npmrc quotes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@cljiahao
cljiahao merged commit 0ce80b5 into main Dec 2, 2026
47 checks passed
@cljiahao
cljiahao deleted the claude/ratchet-config-holes branch December 2, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants