feat(errors): register verified-only identifier claim error codes - #1849
Conversation
…ER_VERIFIED_ELSEWHERE, IDENTIFIER_UNVERIFIED_AMBIGUOUS, IDENTIFIER_CLAIM_LIMIT, MFA_IDENTIFIER_UNVERIFIED) Re-audited constructive-db main (post #3830) and regenerated the registry; curated public copy for the identifier/MFA/SMS codes and the new public billing-provider codes picked up by the same audit.
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review complete. No issues found — approved ✅. This change extends the error registry in
Reviewed commit: c2bc7a6 |
Summary
Registers the application error codes introduced by constructive-io/constructive-db#3830 (verified-only uniqueness for emails/phone_numbers) in
@constructive-io/errors, so clients get typed, human copy instead of raw codes.Workflow followed:
audit-db-errors.pyagainst constructive-dbmain(post-#3830) →generate-registry.py→ curated overlay insrc/registry.ts. The generated file is untouched by hand; the inventory contains no constructive-db paths (verified with a grep).Codes from #3830 (curated, class
public)IDENTIFIER_VERIFIED_ELSEWHEREIDENTIFIER_UNVERIFIED_AMBIGUOUSIDENTIFIER_CLAIM_LIMIT{ limit?: number }(SQL passesjsonb_build_object('limit', …))MFA_IDENTIFIER_UNVERIFIEDSMS_VERIFICATION_DISABLEDTOO_MANY_REQUESTSwas already curated and is unchanged.Unrelated new codes picked up by the re-audit (from other recent constructive-db merges)
Billing provider / metering (
ast-plpgsqlbilling helpers):BILLING_ENTITY_BUSY,BILLING_NOT_READY,BILLING_OPERATION_CONFLICT,BILLING_OPERATION_INVALID,UNKNOWN_METERare raised aspublicin SQL, so they get curated copy + typed context (entity_id,operation_id,meter_slug, …). The remaining ones are internal/generated-only and rely on the generated registry:BILLING_HEALTH_INVALID,BILLING_OBSERVATION_INVALID,BILLING_OPERATION_NOT_FOUND,BILLING_OPERATION_SETTLED,BILLING_OPERATION_STATE_INVALID,BILLING_RECONCILE_BOUNDS_REQUIRED,BILLING_SCHEDULED_CHANGE_INVALID,AST_OPTIONS_NOT_OBJECT,AST_OPTION_REQUIRED,AST_OPTION_UNKNOWN.Note on the inventory
The fresh audit no longer finds the seven
STORAGE_*lifecycle codes (they are not in the constructive-db corpus the script scans), but__tests__/storage-lifecycle.test.tspins them as a package contract, so their existing inventory records were preserved rather than dropped. Flagging in case that contract should instead be revisited.Tests
New
__tests__/identifier-claims.test.tsasserts the five identifier/MFA/SMS codes are audited, generated,public, carry the expected HTTP status and human copy, and thatlimitflows throughtoErrorDETAIL context.pnpm build,pnpm lint,pnpm test(51 tests) pass inpackages/errors. No version bump.Link to Devin session: https://app.devin.ai/sessions/89010f9efacf4d4e904f838a55bec28c
Open in Devin Desktop: https://app.devin.ai/desktop/session/89010f9efacf4d4e904f838a55bec28c?variant=devin
Requested by: @pyramation