chore(quality): add scoped verification workflow - #801
Open
beruro wants to merge 1 commit into
Open
Conversation
Pre-commit hook ran. Total eslint: 0, total circular: 0
This was referenced Aug 14, 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.
Problem
Repository agents currently choose between repeatedly scanning the full frontend and skipping verification altogether. The existing
typecheckcommand has no duplicate-run protection or exact-state reuse, and there is no guarded quick path that limits lint/tests to the files owned by the current task. Large dirty worktrees can therefore consume unnecessary CPU and can accidentally sweep unrelated user work.Solution
Add two repository-owned verification entry points:
pnpm verify:quick -- <exact files...>lints only supported changed files undersrc/, runs only explicitly suppliedsrc/**/*.test.tsVitest files, requires an explicit--no-testsdecision when changed frontend code has no focused test, and refuses automatic discovery above 80 dirty files.pnpm verify:finalruns the full TypeScript check once per exact code state.pnpm typechecknow uses this guarded path, whilepnpm typecheck:rawremains available for explicit release/debug workflows.The final-check lifecycle is
fingerprint -> cached|lock -> checking -> success-cached|failed, with lock cleanup infinally. The fingerprint includes Git HEAD, changed TypeScript-relevant file contents, Node/platform, and TypeScript version. The cache overwrites one ignored JSON record; CI always bypasses it. AGENTS.md documents the required usage and evidence contract.Performance guard:
finally; stale dead-PID locks recoverPotential risks
Local full checks can now be skipped when the exact fingerprint already passed; an omitted fingerprint input would make that unsafe, so the implementation includes source/dependency-relevant files, compiler/runtime identity, platform, and HEAD, while CI never trusts the cache. PID reuse can conservatively block a local duplicate check until the unrelated process exits, but cannot create a false successful result. Quick verification intentionally recognizes the repository-supported
*.test.tssurface only; other test shapes still require their direct project command.--no-testsrecords an explicit decision but cannot mechanically verify the written justification. Rollback is to restoretypecheckto the rawtsccommand and remove the four tooling files and three added package scripts; no application data or public API changes are involved.Verification
pnpm verify:quick -- AGENTS.md package.json scripts/quality/verification-policy.mjs scripts/quality/verification-policy.test.mjs scripts/quality/verify-changed.mjs scripts/quality/verify-final.mjs— passed; correctly skipped frontend lint/tests for a tooling-and-documentation-only scope.node --test scripts/quality/verification-policy.test.mjs— passed 4/4 tests covering fingerprint invalidation, file-scope rules, one-record cache replacement, duplicate locking, and stale-lock recovery.pnpm verify:final— executed the real full TypeScript check for the committed branch state and passed; no cache result was reused.git diff --check origin/develop...HEAD— passed.No screenshot is useful because this change has no user-visible UI.