Repository navigation
fix: prevent task audit CI flake under load - #123686
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 10:32 AM ET / 14:32 UTC. ClawSweeper reviewWhat this changesThe PR replaces a fixed one-second task-audit age tolerance with elapsed-time bounds captured around the audit command. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep this maintainer-owned protected PR open: it is a correct, narrow test repair, pending a branch refresh and completed exact-head checks before landing. Priority: P3 Review scores
Verification
How this fits togetherThe task-audit command reads task and TaskFlow registry state, derives stale findings, and emits terminal or JSON diagnostics. This change only stabilizes the command-level test of the reported TaskFlow age. flowchart LR
A[Task and TaskFlow registry] --> B[Audit finding calculation]
B --> C[Task audit command]
C --> D{Output format}
D --> E[JSON diagnostics]
D --> F[Terminal report]
C --> G[Command-level test]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +2. Total +2 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the elapsed-time bounds, then rebase or refresh the branch and land once the required exact-head checks pass. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: the audit computes age from Date.now() while the current test imposes an arbitrary one-second upper bound after prior setup work. Is this the best way to solve the issue? Yes. Bracketing the command call tests the authoritative elapsed-time behavior without weakening production checks; the fake-timer JSON sibling retains exact deterministic coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 530b33e4e372. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for
The optional behind-branch refresh move is intentionally skipped: repository policy treats non-conflicting behind-main drift as advisory, and the native prepare/merge path verifies the current-main test merge. Production LOC is +0/-0; tests are +4/-2. Provenance: the fixed one-second tolerance was introduced by direct commit |
|
Merged via squash.
|
What Problem This Solves
Fixes a reproducible CI flake where the task-audit command test failed on a loaded shard once setup took slightly more than an arbitrary one-second allowance. The observed failure was
2701057ms versus a hard upper bound of2701000ms in run 31807211070, job 94789319983; the other 764 tests in the shard passed.Why This Change Was Made
The assertion now brackets
tasksAuditCommandwith wall-clock readings and verifies that the reported age falls within that exact interval relative to the flow's authoritativeupdatedAt. This preserves the existing production behavior and removes the guessed tolerance without widening a timeout.User Impact
No user-visible runtime behavior changes. Maintainers get deterministic task-audit CI proof even when the command shard is under load.
Evidence
src/commands/tasks.test.ts:228withexpected 2701057 to be less than 2701000; 764 sibling tests passed.corepack pnpm test src/commands/tasks.test.tspassed 25/25 tests onprovider=blacksmith-testbox,tbx_01m009vctzfsvgj4mcrarr9jww, run 31808345807.node scripts/check-changed.mjs -- src/commands/tasks.test.tspassed core test typecheck, lint, formatting, and repository guards onprovider=blacksmith-testbox,tbx_01m009y982crweeq2h8kh2syka, run 31808475252.git diff --checkAI-assisted: yes. The change and its test invariant were manually inspected and verified.