Skip to content

test(harness): lock the exception-classification contract as a regression matrix (INT-2521)#268

Merged
unohee merged 1 commit into
mainfrom
test/INT-2521-contract-matrix
Jul 5, 2026
Merged

test(harness): lock the exception-classification contract as a regression matrix (INT-2521)#268
unohee merged 1 commit into
mainfrom
test/INT-2521-contract-matrix

Conversation

@unohee

@unohee unohee commented Jul 5, 2026

Copy link
Copy Markdown
Owner

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:

bucket scheduler effect STUCK counting
rate_limited pause until reset no
infra_error backoff retry no
task_failure real verdict yes

The individual classifiers (detectRateLimit, isInfraError) were tested piecemeal across rateLimitError.test.ts and errorClassification.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:

  • a rate/usage limit or infra hiccup masquerading as a task_failurefalse STUCK
  • a genuine bad edit slipping into infra_errornever counted

Coverage

  • rate/usage limits — every provider (codex-responses 300min window, codex CLI usage limit, claude out_of_credits, OpenAI rate_limit_exceeded/insufficient_quota, OpenRouter 402, local 429)
  • infra — CLI non-zero exit, stage/git timeout, conn refused, undici cause.code, adapter 5xx, auth 401, git-tracker:/reviewer-stage: markers, scheduler hard watchdog
  • task failures — TypeError, assertion, edit-not-applied, reviewer quality reject
  • prose false-positive guards — text that merely mentions usage/credits/limit words or bare status numbers stays task_failure
  • exhaustive/disjoint invariant over the whole table

Test-only; no production code changed.

Verification

  • npx vitest run src/adapters/errorClassificationContract.test.ts → 23 passed
  • full suite: 147 files, 1741 passed / 1 skipped
  • tsc clean, oxlint clean
  • openswarm review → APPROVE

🤖 Generated with Claude Code

…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.
@cursor

cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown

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.

@unohee unohee merged commit c3239cc into main Jul 5, 2026
5 checks passed
@unohee unohee deleted the test/INT-2521-contract-matrix branch July 5, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant