Repository navigation
test(kiro): read cooldown after verdict observation - #5993
Conversation
The #5967 identity/freshness guard rightly rejects a verdict whose observedAt is later than the supplied read clock. Cooldown tests captured that clock before seeding the verdict, so a millisecond tick in a multi-file run made them read their own fixture as future evidence. Capture the read time after the seed, and compare the in-window reset against that read time. Red: usage-restart plus pool-rank failed the distant-reset assertion with a forced 2ms boundary. Green: the same two-file run passes all 31 tests; account-state-disk plus pool-rank passes 43.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe exhaustion-cooldown tests seed verdicts before capturing comparison times. The distant-reset case adds a brief wait, and the exact-reset assertion uses the calculated remaining time. ChangesKiro cooldown test timing
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Other Merge Risk: ⚪ Minimal · up to This PR adjusts only Kiro cooldown tests, aligning their fixtures and expectations with the evidence-time guard. No actionable merge-blocking risk remains. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
리뷰 · 우선순위 28 / 80이 PR은 키로 계정을 고르는 동작을 바꾸지 않습니다. 쿨다운 테스트만 고칩니다. 바탕은 한도를 다 썼다는 기록을 남기면, 그 기록을 본 시각도 같이 적힙니다. 쿨다운을 계산할 때 본 시각이 읽기 시각보다 뒤면 그 기록은 버립니다. 아직 오지 않은 시각을 믿지 않으려는 규칙이고, #5967에서 들어온 검사입니다. 이 규칙은 이번 PR에서 그대로입니다. 테스트는 시계를 먼저 적어 두고 그다음에 기록을 썼습니다. 기록을 쓰는 사이에 시간이 1밀리초만 흘러도, 방금 쓴 기록이 미래가 됩니다. 그러면 하루로 줄여야 할 쿨다운이 빈 값( 고친 뒤의 순서는 기록을 먼저 쓰고, 시계는 그 뒤에 읽습니다. 한 시간 안쪽 리셋은 "정확히 한 시간" 대신 tests/providers/kiro/kiro-pool-rank.test.ts:134 - 메인테이너의 판단이 필요한 지점 너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Summary
The Kiro cooldown tests captured
nowbefore recording an exhaustion verdict. The usage-evidence guard introduced ondevcorrectly rejects a verdict withobservedAt > now, so a millisecond tick during a multi-file Bun run turned the test's own new verdict intonull. The production freshness rule is unchanged. The tests now read the clock after writing the verdict, compare the in-window reset against that read time, and force a 2 ms boundary in one case so the ordering cannot silently regress.Verification
origin/dev:bun test tests/providers/kiro/kiro-usage-restart.test.ts tests/providers/kiro/kiro-pool-rank.test.tsproduced 30 pass / 1 fail. With the explicit 2 ms boundary and old read ordering, the same command reliably failed the distant-reset assertion (86400000expected,nullreceived).bun test tests/providers/kiro/kiro-account-state-disk.test.ts tests/providers/kiro/kiro-pool-rank.test.tspassed 43/43.bun test tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/file-size-ratchet.test.ts— 27 passed.bun x tsc --noEmit,bun run structure:check,bun run privacy:scan, andgit diff --check— passed.dev.Checklist
Summary by CodeRabbit