Skip to content

feat: DAWN_Exxxx error-code registry — linkable, self-documenting failures#357

Merged
blove merged 7 commits into
mainfrom
feat/error-code-registry
Jul 13, 2026
Merged

feat: DAWN_Exxxx error-code registry — linkable, self-documenting failures#357
blove merged 7 commits into
mainfrom
feat/error-code-registry

Conversation

@blove

@blove blove commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Errors carried only a free-text message + exitCode — nothing stable to search or link, and one site already hardcoded a Docs: URL inconsistently. This adds a central numeric error-code registry surfaced on all three error channels.

What's new

  • Registry in @dawn-ai/sdk (errors.ts) — the leaf everyone depends on: DAWN_Exxxx codes in ranges (E1xxx config · E2xxx sandbox · E3xxx permissions · E4xxx model/provider · E5xxx runtime/import), each { code, title, docsPath? }. Codes are a literal union, so producers can't invent them.
  • Three surfaces: CliError gains an optional code and the CLI prints [CODE] See <docs>; HTTP/SSE error bodies gain code/docsUrl; permission denials returned as tool results are prefixed [DAWN_E3001].
  • ~10 high-value families wired (invalid tool scope / sandbox config / build target, sandbox-unavailable, permission-denied, provider-package-missing, unknown-model, import/export mismatch, tool-file shape) — the hardcoded Docs: URL in tool-discovery.ts is now centralized through the registry.
  • Generated /docs/errors reference page + a drift guard in check-docs.mjs: every docsPath must resolve to a real page and /docs/errors must list exactly the registry's codes (negative-tested).

Every message change is additive (an appended [CODE] line or prefix), so no existing message assertion broke. docsPaths were reconciled to real pages — DAWN_E5001 has no docs page yet, so its docsPath is omitted (a code without docs is valid).

Full local verify green: build · typecheck (24/24) · lint (20/20) · test (1173 passed) · check-docs (+ new guard) · pack-check (8/8); /docs/errors renders. Changeset: patch for @dawn-ai/{sdk,cli,core,sandbox,langchain}.

Foundation for dawn verify's preflight to emit codes (separate PR).

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dawnai Ready Ready Preview, Comment Jul 13, 2026 8:11pm

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Claude finished @blove's task in 0s —— View job


I'll analyze this and get back to you.

@blove
blove merged commit 18df470 into main Jul 13, 2026
14 checks passed
@blove
blove deleted the feat/error-code-registry branch July 13, 2026 22:02
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