Skip to content

Run the Pro-boundary ratchet in the push check and before the merge slot #3300

Closed

Description

@mstomar125

Summary

Run scripts/check-pro-boundary.ts in the lint section of scripts/test-gate.ts. This does two things:

  • Frontend-only and .md-only changes, which is where most Pro drift happens, meet the Pro-boundary ratchet at git push.
  • In merge mode, an exceeded or stale baseline fails in seconds, before the gate takes the machine slot.

Context

  • After Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299, the ratchet runs only as a bun test, inside bun run test:scripts.
  • bun run test:changed never runs that tier for a frontend-only diff. In classify (scripts/gate-scope.ts):
    • a packages/desktop-app/ path outside src-tauri/ sets only frontend;
    • .md files are inert, including README.md, which the ratchet scans;
    • scripts is set only for scripts/, Rust or packages/skill changes.
  • The push check runs lint only. .husky/pre-push runs bun run scripts/test-gate.ts. Its // ── Lint (both modes) section runs three stages:
    • quality:scripts:check;
    • quality:design-tokens;
    • check-version-sync. This one is already a drift check that runs at push time on purpose ("so this runs at push time, not only in the merge gate").
  • Lint runs before the slot, the scripts tier after. In merge mode, the lint section runs before acquireGateLock. TIERS.scripts runs later, in the lane after TIERS.frontend.
  • Exact baselines make this worth doing. Every migration PR has to lower numbers. Today a forgotten baseline surfaces only as a failed merge gate, a few minutes into a run that holds the machine slot.
  • The stage's own text must not add a marker.
    • scripts/test-gate.ts is in the scan, and proWording counts the capitalised word "Pro", including in "Pro-boundary".
    • A label such as "check-pro-boundary (Pro code in core)", plus a comment starting "Pro code in core", would raise proWording by 2 and fail the very ratchet this PR wires in.
    • The wording below names the rule by its ADR instead. check-pro-boundary in lower case matches no marker.

Scope

  • scripts/test-gate.ts:
    • Add one run({...}) stage directly after the check-version-sync stage and before if (!merge). That is around lines 186-194 at af8ddb6.
    • In the header doc comment, update the push bullet, which says "lint and the app-version drift check only", to name the new check.
  • CLAUDE.md:
    • In the gate callout under Implementation Workflow step 4, the bullet "git push runs lint only — scripts lint/typecheck, the design-token check and the app-version drift check" adds the Pro-boundary ratchet to that list.
    • In the ## Pro / Sync Boundary section that Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299 added, the last bullet (run bun run scripts/check-pro-boundary.ts before pushing) becomes "the push check runs it".

Out of scope

  • Any change to the tier scoping in scripts/gate-scope.ts.
  • Any change to the check itself.
  • Any product code.

Steps

  1. Add the stage to the lint section of scripts/test-gate.ts:

    // The code-boundary ratchet (ADR-081). test:changed skips the scripts tier for
    // frontend-only and .md-only diffs, which is where most out-of-place code
    // lands, so a push is the first automated check such a change gets. In merge
    // mode this runs before the machine slot, so a stale baseline fails in seconds.
    await run({
      label: "check-pro-boundary (ADR-081 code-boundary ratchet)",
      command: "bun run scripts/check-pro-boundary.ts",
      timeoutMs: 5 * MINUTE,
      nice: !merge,
    });
  2. In the header comment, change the push bullet to "lint, the app-version drift check and the code-boundary ratchet only".

  3. Make the two CLAUDE.md edits.

  4. Run bun run scripts/check-pro-boundary.ts. It must exit 0 with BASELINES unchanged. If it reports a raise, your new text contains a marker: reword it rather than raising the baseline.

Acceptance criteria

  • Pushing a branch that adds a Pro marker line to a Svelte file is blocked at the check-pro-boundary stage, and the stage log names the line.
  • Pushing a branch that removes a Pro marker without lowering the baseline is blocked with the lower-it message and the paste block.
  • Pushing a README-only change that deletes the nodespaced-pro sentence is blocked the same way.
  • A clean branch pushes. The stage adds about a second, since the scan reads about 1,400 files.
  • This PR's own merge-gate log shows the stage in the lint section, before the machine-slot wait.
  • The test-gate.ts header comment and CLAUDE.md's push bullet both list the new check.
  • Ran bun run scripts/check-pro-boundary.ts and pasted the printed BASELINES block. This change moves no count, so BASELINES is unchanged, and the check exits 0.

Tests and verification

  • bun run quality:scripts:check
  • bun run test:changed. scripts/test-gate.ts is in GATE_FILES in scripts/gate-scope.ts, so this runs every tier, including Rust. Start it when the shared dev machine is free.
  • Push-mode checks. In a scratch worktree, run bun run scripts/test-gate.ts (push mode) three times, reverting each change afterwards:
    1. On a clean tree, it passes.
    2. With invoke('pro_example') added to a non-Pro Svelte file, it fails at the new stage.
    3. With the README's nodespaced-pro sentence deleted, it fails with the lower-it message.
  • Merge mode. The stage appears in this PR's own merge-gate log before the machine slot is taken. bun run merge <PR#> --dry-run would show the same thing, but it runs the full pyramid, so don't run it separately.

Dependencies

Risks and rollback

  • A WIP push in the middle of a migration is blocked until its baselines are lowered. The failure prints the paste block. Per CLAUDE.md, --no-verify is reserved for WIP Handoff Commits.
  • The check runs on every push. It reads about 1,400 files once, which took about 0.6 s at af8ddb6. The 5-minute stage timeout bounds a hang.
  • Rollback. Revert the stage. Add the Pro-boundary ratchet check and the CLAUDE.md Pro/sync placement rule #3299's enforcement through test:scripts and the merge gate stays in place.

Plan key: C1.2 (pro-boundary DAG).

🤖 Generated with Claude Code

Activity

  1. added
    pro-boundary
    on Sep 30, 2026
  2. self-assigned this
    on Sep 30, 2026
  3. mstomar125 commented on Sep 30, 2026

    @mstomar125
    ContributorAuthor

    Completed in #3390 (merged). Auto-close did not fire; closing manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

pro-boundary

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions