Repository navigation
chore: wire selfHealingManager tests + quota contract CI enforcement - #536
Conversation
Three breadth governance improvements: 1. vitest.config.ts: added src/lib/resilience/__tests__/**/*.test.ts to the include list. The selfHealingManager.test.ts file was already in vitest format but was never picked up by the test runner (no glob match). Now runs as part of `npm run test`. 2. src/lib/resilience/__tests__/selfHealingManager.test.ts: fixed a latent bug in the "updateSettings returns true when threshold changes" test. It used `zScoreThreshold: 4` which is not a real config field — the test was a draft from earlier work. Changed to `criticalThreshold: 0.99` (which IS tracked by updateSettings). Before this PR, this test was unreachable (vitest didn't pick up the path). When wired up, the bug would have caused 1 of 5 tests to fail. Now all 5 pass. 3. scripts/check/quota-contract.ts (NEW): runs the QuotaStore contract test (from PR #505, the type-drift fix that prompted this whole governance pass) via vitest and propagates the exit code. Added npm script `check:quota-contract` and added to the combined `check:governance` chain. TSC: 0 errors (was 0 baseline).
🤖 CodeAnt AI — Review Status
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Review limit reached
Next review available in: 54 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Note
|
| [ | ||
| "node_modules/.bin/vitest", | ||
| "run", | ||
| CONTRACT_TEST, |
There was a problem hiding this comment.
Suggestion: The invoked Vitest run transpiles and executes the contract test but does not perform TypeScript type-checking, so the type-level assertions in quotaStore.contract.test.ts are removed before runtime and a broken QuotaStore implementation can still pass this governance check. Run the contract file through the relevant tsc configuration, or otherwise add an explicit type-check step before reporting success. [api mismatch]
Severity Level: Major ⚠️
- ❌ Governance CI can pass after QuotaStore interface drift.
- ⚠️ Broken quota implementations may reach runtime consumers.
- ⚠️ `typecheck:core` omits the contract test file.(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** scripts/check/quota-contract.ts
**Line:** 24:27
**Comment:**
*Api Mismatch: The invoked Vitest run transpiles and executes the contract test but does not perform TypeScript type-checking, so the type-level assertions in `quotaStore.contract.test.ts` are removed before runtime and a broken `QuotaStore` implementation can still pass this governance check. Run the contract file through the relevant `tsc` configuration, or otherwise add an explicit type-check step before reporting success.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
L17 Latency Regression ReportThreshold: 10% p99 regression. |
L17 Latency Budget ReportChecked against: budgets/rest-endpoints.yaml. |
|
| const result = spawnSync( | ||
| process.execPath, | ||
| [ | ||
| "node_modules/.bin/vitest", |
There was a problem hiding this comment.
CRITICAL: node_modules/.bin/vitest is a shell-script wrapper, not a Node entry point. spawnSync(process.execPath, ["node_modules/.bin/vitest", ...]) will throw a SyntaxError on Unix and fail on Windows because .cmd files cannot be executed by node directly. Use the actual entry point ./node_modules/vitest/vitest.mjs (as done elsewhere in this repo, e.g. scripts/dev/run-ecosystem-tests.mjs:77).
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Reviewed by step-3.7-flash · Input: 88.3K · Output: 16.5K · Cached: 1.3M |



User description
Three breadth governance improvements:
vitest.config.ts: added
src/lib/resilience/__tests__/**/*.test.tsto the include list. The selfHealingManager.test.ts file was already in vitest format but was never picked up by the test runner (no glob match).src/lib/resilience/tests/selfHealingManager.test.ts: fixed a latent bug in the "updateSettings returns true when threshold changes" test. It used
zScoreThreshold: 4which is not a real config field — the test was a draft from earlier work. Changed tocriticalThreshold: 0.99(which IS tracked by updateSettings). Now all 5 selfHealingManager tests pass.scripts/check/quota-contract.ts (NEW) + npm
check:quota-contract: runs the QuotaStore contract test (from PR fix(quota): rewrite KeyvQuotaStore to satisfy QuotaStore interface (P0 type-drift) #505) via vitest and propagates exit code. Added to combinedcheck:governancechain.Note on ProcessManager darwin branch: per the audit followup, the darwin branch catch in
src/lib/versionManager/processManager.ts:131-155was already fixed in PR #507 (logs the error and returns{pid, alive: false}). No additional change needed.TSC: 0 errors (was 0 baseline).
CodeAnt-AI Description
Wire resilience tests into the test suite and enforce quota contract checks in governance CI
What Changed
Impact
✅ Resilience regressions caught during standard test runs✅ Quota store compatibility checked in governance CI✅ Failed contract checks stop the governance pipeline💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.