Skip to content

docs: list every import warning and GitHub error code in CONTRACT (#1124732) - #82

Merged
ea-open-source merged 4 commits into
mainfrom
chore/1124732-contract-codes
Oct 13, 2026
Merged

ea-open-source merged 4 commits into
mainfrom
chore/1124732-contract-codes

Conversation

@ea-open-source

@ea-open-source ea-open-source commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

CONTRACT.md named one import warning code (history_floor_clamped) where the server defines five, and two import_github_* error codes where the server defines eight. It also said a bad token answers 400 import_github_auth. On agile-tracker origin/main 79f2240e4, that code arrives as the error_code of a failed job, not as a 400.

This PR adds two tables to CONTRACT.md and pins both with tests. No src/ change: warningLine already renders all five server shapes correctly.

After the review panel, CONTRACT.md also does these things:

  • It scopes the job-code rows to the listing queries and lists the exceptions verified on the server: the blockedBy rule (#384801), the first-error rule, a blockedBy follow-up page error, and a comment follow-up NOT_FOUND.
  • It states the exact rate-limit retry behaviour. The server retries an HTTP refusal up to 3 times and never retries a GraphQL RATE_LIMITED.
  • It quotes the stderr lines that the user sees, including the doubled import failed: prefix of a failed job. Another story covers that prefix.

Story: https://eastagiletracker.com/s/zewsdmja (#1124732)

Warning codes (ImportResult.warnings)

Code Added by GitHub import can raise it?
history_floor_clamped #32239 Yes, any source with imported stories; the only code that carries floor_year
cross_reference_links_failed #55746 Yes, GitHub only, only with include_pull_requests, committing run only (matches the dry-run paragraph from #81)
dependencies_fetch_failed #163271 Yes, GitHub only, only with include_dependencies
dependencies_truncated #146020 Yes, GitHub only, only with include_dependencies
estimates_unpointed_dropped #558598 No. The GitHub connector sets no estimate on any row, and the server ignores check_unpointed_estimates for github

GitHub error codes

Code Added by Arrives as
import_github_no_token #26479 400 response to the POST
import_github_shared_quota_low #47448 400 response to the POST
import_github_auth #14628 error_code of a failed job
import_github_forbidden #14628 error_code of a failed job
import_github_not_found #14628 error_code of a failed job
import_github_rate_limited #14628 error_code of a failed job
import_github_rate_limited_platform #47445 error_code of a failed job
import_github_unavailable #1087819 error_code of a failed job

CONTRACT.md also says when the server raises each code. Every row was read from agile-tracker origin/main 79f2240e4 (validate_github_request, ensure_shared_pat_budget, github_fetch_error, job_error_parts, From<GithubImportError> for AppError, http_status_error, classify_gql_errors).

Amended acceptance criteria

The user widened the error list from four codes to all eight import_github_* codes on agile-tracker origin/main.

Tests

  • history_floor_clamped renders its count and its floor year: one exact note: line.
  • <code> renders its count and no floor year, once for each of the other four codes: one exact note: line, and the output contains no floor year.
  • CONTRACT.md lists exactly the warning codes the renderer tests cover: set equality between the CONTRACT table and the five tested codes.
  • CONTRACT.md marks estimates_unpointed_dropped as the one code a GitHub import cannot raise: the Yes/No column.
  • CONTRACT.md's error-code table lists eight import_github_* codes and where each arrives: row count, sorted code column, then the arrival cell of each row. A duplicated row fails it.
  • CONTRACT.md's warning counts match its warning table and CONTRACT.md's error-code counts match its error-code table: the prose counts come from the parsed tables.
  • contractTable asserts the separator row and the cell count of every row.
  • a warning with neither count nor floor_year renders the bare code.
  • a 400 <code> refusal names its code on stderr, once for each of the two pre-job codes, with the server's own message. The quota body is 243 characters, so it runs past the client's 200-character cut.
  • a failed job prints its error under a doubled import-failed prefix.

Red first:

  • The three CONTRACT tests failed against the old CONTRACT.md (CONTRACT.md has no table headed ...).
  • The five renderer tests passed on the first run, because the renderer already handles each shape. I proved that they can fail with three temporary mutations of warningLine:
    • Always print floor year: the four count-only tests fail.
    • Drop floor_year: the floor test fails.
    • Drop count: all five fail.
  • I also mutated CONTRACT.md: removing a row, flipping No to Yes, and changing an arrival cell each turn the matching test red.
  • Review round: each new or changed test failed against a mutation and passed after I restored the file. The mutations were a duplicated row in each table, each prose count, a broken separator, an extra cell, a 20-character body cut in the client, an always-parenthesized note, and a single error: prefix. The previous fromEntries test stayed green against the duplicated error row.

Gates:

  • npm test: # tests 1300, # pass 1299, # fail 0, # skipped 1 (the opt-in e2e), rc 0
  • npm run lint: Found 1 warning. Found 1 info. (both pre-existing: src/mockserver.js, biome.json), rc 0
  • npm run typecheck: rc 0

🤖 Generated with Claude Code

ea-open-source and others added 4 commits October 13, 2026 11:03
…124732)

CONTRACT named one warning code where the server defines five, and two
import_github_* codes where the server defines eight. It also said a bad
token answers 400 import_github_auth; on agile-tracker origin/main
79f2240e4 that code arrives as a failed job's error_code.

- Add a warning table: each code, the story that added it, and whether a
  GitHub import can raise it. estimates_unpointed_dropped cannot: the
  GitHub connector sets no estimate, and the pre-check ignores github.
- Add a GitHub error table: each code, its story, where it arrives (400
  on the POST or a failed job's error_code), and when the server raises it.
- Test warningLine against each of the five server shapes; the floor-year
  test is separate from the four count-only tests.
- Test that both CONTRACT tables list exactly the codes the tests cover.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…view)

- Guard both tables against a duplicated row: assert the row count and
  the sorted code column before Object.fromEntries.
- Assert each table's separator row and the cell count of every row.
- Derive the prose counts from the parsed tables and assert that
  CONTRACT states the matching numbers.
- Pin the bare `note: <code>` line for an entry with no count and no
  floor_year.
- Pin the stderr line of a coded 400 refusal for both pre-job codes; the
  shared-quota body runs past the client's 200-character cut.
- Pin the stderr line of a failed job, with today's doubled prefix.
- Rename the error-code test so it claims CONTRACT only.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…review)

Checked against agile-tracker origin/main 79f2240e4.

- Rate limits: send_retrying retries an HTTP 429 or rate-limited 403 up
  to 3 times and skips the retries when GitHub asks for a wait over 120 s.
  It never retries a GraphQL RATE_LIMITED, which arrives in a 200 body.
- rate_limited_platform: the shared PAT hit a primary or secondary limit.
- Scope the job-code rows to the listing queries and list the verified
  exceptions: the blockedBy rule (#384801), the first-error rule, a
  blockedBy follow-up page error (dependencies_truncated), and a comment
  follow-up NOT_FOUND (import_github_unavailable).
- unavailable: add an unclassified GraphQL error type and a schema field
  that the server cannot drop.
- Quote the stderr lines the user sees, including the doubled
  "import failed:" prefix of a failed job and the --token hint.
- cross_reference_links_failed needs include_pull_requests.
- A malformed token is 400 invalid_parameter before a job exists; only a
  token that GitHub rejects fails the job with import_github_auth.
- State the note template for a count of 1 and for an entry with neither
  field.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@ea-open-source
ea-open-source merged commit 859111b into main Oct 13, 2026
2 checks passed
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