Skip to content

feat(errors): register database suspension error codes - #1814

Merged
pyramation merged 1 commit into
mainfrom
feat/database-suspension-error-codes
Sep 8, 2026
Merged

pyramation merged 1 commit into
mainfrom
feat/database-suspension-error-codes

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Companion to constructive-io/constructive-db#3701 (database access standing). Registers the codes that PR raises so gateways/proxy can map them to canonical public errors:

ACCESS_SUSPENDED          // 403 — "Access to this database is suspended."   (raised by the serving lanes / proxy in PR 1)
SUSPENSION_FORBIDDEN      // 403 — tenant tried to move database.suspended_*  (tg_guard_database_suspension)
SUSPENSION_REASON_INVALID // 400 — reason not in ('billing','admin')          (suspend_database)

ACCESS_SUSPENDED is curated in registry.ts; the other two came in through the normal audit-db-errors.pygenerate-registry.py refresh against constructive-db, which also picked up other DB codes added since the last snapshot (MODULE_ENTRY_MALFORMED, CREDENTIAL_NOT_EXTENDABLE, …). Existing FORBIDDEN / NOT_FOUND are reused by the SQL, not duplicated.

Link to Devin session: https://app.devin.ai/sessions/86a73d903b3546c1afbf5361bfa384b6
Open in Devin Desktop: https://app.devin.ai/desktop/session/86a73d903b3546c1afbf5361bfa384b6?variant=devin
Requested by: @pyramation

…USPENSION_*)

Refreshes the constructive-db audit snapshot and generated registry; adds
curated public copy for the three suspension codes.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@tenki-reviewer

tenki-reviewer Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review complete. No blocking issues — approved ✅; 1 nitpick below.

🧹 Nitpicks (1) — 🟢 1 low
  • 🟢 ACCESS_SUSPENDED missing from audit snapshot (registry.ts:262) — ACCESS_SUSPENDED is registered in the curated registry (packages/errors/src/registry.ts:262) but is absent from the audit snapshot packages/errors/scripts/db-error-inventory.json and the regenerated packages/errors/src/generated/registry.generated.ts, even though the same commit added the sibling SUSPENSION_FORBIDDEN and SUSPENSION_REASON_INVALID to all three.

The change extends packages/errors/src/registry.ts with three curated error codes (ACCESS_SUSPENDED, SUSPENSION_FORBIDDEN, SUSPENSION_REASON_INVALID) carrying optional context fields, and updates packages/errors/scripts/db-error-inventory.json with refreshed counts and new entries.

Files Change
packages/errors/src/registry.ts Registers three suspension error codes with optional reason/database_id context and static message templates
packages/errors/scripts/db-error-inventory.json Refreshes error counts and adds new inventory entries, but omits the new ACCESS_SUSPENDED code

One low-severity consistency gap: ACCESS_SUSPENDED is curated but absent from the audit snapshot and generated registry, unlike its two siblings.

Reviewed commit: fe752ed

@pyramation
pyramation merged commit 44462f8 into main Sep 8, 2026
21 checks passed
@pyramation
pyramation deleted the feat/database-suspension-error-codes branch September 8, 2026 07:04
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