test(harness): lock the exception-classification contract as a regression matrix (INT-2521)#268
Merged
Merged
Conversation
…sion matrix (INT-2521)
Every daemon error must land in exactly one of {rate_limited (pause),
infra_error (backoff, not STUCK), task_failure (real verdict)}, in that
precedence. The individual classifiers were tested piecemeal; this adds one
table-driven matrix that pins the whole contract so a future change that
re-buckets any signal — a rate/usage limit or infra hiccup masquerading as a
task_failure (false STUCK), or a genuine bad edit slipping to infra — fails
loudly here.
Covers all providers' rate/usage limits, the infra class (CLI exit, timeout,
conn drop, undici cause.code, 5xx, auth, git-tracker/reviewer-stage markers,
scheduler watchdog), genuine task failures, and prose-false-positive guards;
plus an exhaustive/disjoint invariant over the table. Test-only.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
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.
Summary
Capstone (⑧) of the INT-2521 exception-handling epic: a single table-driven matrix that pins the whole classification contract in one place.
Every daemon error must land in exactly one of three buckets, in this precedence:
rate_limitedinfra_errortask_failureThe individual classifiers (
detectRateLimit,isInfraError) were tested piecemeal acrossrateLimitError.test.tsanderrorClassification.test.ts. This adds the consolidated regression guard so a future change that re-buckets any signal fails loudly here — the two failure modes this epic closed are exactly:task_failure→ false STUCKinfra_error→ never countedCoverage
out_of_credits, OpenAIrate_limit_exceeded/insufficient_quota, OpenRouter 402, local 429)cause.code, adapter 5xx, auth 401,git-tracker:/reviewer-stage:markers, scheduler hard watchdogtask_failureTest-only; no production code changed.
Verification
npx vitest run src/adapters/errorClassificationContract.test.ts→ 23 passedopenswarm review→ APPROVE🤖 Generated with Claude Code