fix(contracts): drop unread error registry fields and pin the createFailure effect rule (07-04)
Nothing read severity, telemetryEvent or redaction, yet FE-REG-ERROR guarded them as policy. They are removed and the registry baseline is re-approved. A new test fails if createFailure stops clearing retryable for MAYBE_APPLIED (M1). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c9360638fd
commit
aff5f43652
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"snapshotDigest": "96b95ef1d50cce36e9fca8a98776a9e2e9e3a5dca24a6288ad83bf29c94aebd8",
|
||||
"snapshotDigest": "83d11f848b8b2f67bcb657403f112d4baaf05481ab6bcee94ebc6851c32e2159",
|
||||
"owner": "frontend-platform",
|
||||
"reason": "Baseline canonical invalidation graph and topic-version contracts after FE-REG-QUERY retirement",
|
||||
"approvedAt": "2026-08-01T15:15:45.537Z"
|
||||
"reason": "07-04: FE-REG-ERROR drops severity, telemetryEvent and redaction, which nothing read",
|
||||
"approvedAt": "2026-09-25T15:11:58.763Z"
|
||||
}
|
||||
|
||||
@@ -640,7 +640,7 @@
|
||||
"registryId": "FE-REG-ENV",
|
||||
"owner": "feature-frontend-env-runtime-config-contract",
|
||||
"source": "src/contracts/env.ts",
|
||||
"rowCount": 14,
|
||||
"rowCount": 16,
|
||||
"contract": {
|
||||
"requiredFields": [
|
||||
"phase",
|
||||
@@ -706,6 +706,12 @@
|
||||
"phase": "runtime",
|
||||
"required": true
|
||||
},
|
||||
"FEATURE_OVERRIDES": {
|
||||
"classification": "public",
|
||||
"defaultValue": null,
|
||||
"phase": "runtime",
|
||||
"required": false
|
||||
},
|
||||
"MAX_RETRY_ATTEMPTS": {
|
||||
"classification": "public",
|
||||
"defaultValue": 2,
|
||||
@@ -748,6 +754,12 @@
|
||||
"phase": "build",
|
||||
"required": false
|
||||
},
|
||||
"VITE_PRODUCT_FEATURES": {
|
||||
"classification": "compile-time",
|
||||
"defaultValue": null,
|
||||
"phase": "build",
|
||||
"required": false
|
||||
},
|
||||
"VITE_ROUTER_BASE_PATH": {
|
||||
"classification": "compile-time",
|
||||
"defaultValue": "/",
|
||||
@@ -766,7 +778,7 @@
|
||||
"registryId": "FE-REG-STORAGE",
|
||||
"owner": "feature-frontend-storage-registry-contract",
|
||||
"source": "src/contracts/storage-keys.ts",
|
||||
"rowCount": 4,
|
||||
"rowCount": 7,
|
||||
"contract": {
|
||||
"requiredFields": [
|
||||
"logicalName",
|
||||
@@ -847,6 +859,19 @@
|
||||
"ttl": null,
|
||||
"valueCodec": "none"
|
||||
},
|
||||
"CACHE_INVALIDATION_PULSE": {
|
||||
"backend": "localStorage",
|
||||
"classification": "opaque-cache",
|
||||
"logicalName": "CACHE_INVALIDATION_PULSE",
|
||||
"migration": "discard",
|
||||
"name": "pulse",
|
||||
"physicalKey": "ca-frontend:cache-invalidation:v1:pulse",
|
||||
"quotaFallback": "no-persist",
|
||||
"schemaVersion": 1,
|
||||
"scope": "cache-invalidation",
|
||||
"ttl": null,
|
||||
"valueCodec": "opaque-string-v1"
|
||||
},
|
||||
"CHUNK_RELOAD_GUARD": {
|
||||
"backend": "sessionStorage",
|
||||
"classification": "opaque-cache",
|
||||
@@ -873,6 +898,19 @@
|
||||
"ttl": null,
|
||||
"valueCodec": "color-scheme-v1"
|
||||
},
|
||||
"LOCALE": {
|
||||
"backend": "localStorage",
|
||||
"classification": "public-preference",
|
||||
"logicalName": "LOCALE",
|
||||
"migration": "discard",
|
||||
"name": "locale",
|
||||
"physicalKey": "ca-frontend:preference:v1:locale",
|
||||
"quotaFallback": "memory",
|
||||
"schemaVersion": 1,
|
||||
"scope": "preference",
|
||||
"ttl": null,
|
||||
"valueCodec": "opaque-string-v1"
|
||||
},
|
||||
"QUERY_PERSISTENCE": {
|
||||
"backend": "disabled",
|
||||
"classification": "sensitive-forbidden",
|
||||
@@ -885,6 +923,19 @@
|
||||
"scope": "cache",
|
||||
"ttl": null,
|
||||
"valueCodec": "none"
|
||||
},
|
||||
"RELEASE_MISMATCH_RECOVERY": {
|
||||
"backend": "sessionStorage",
|
||||
"classification": "opaque-cache",
|
||||
"logicalName": "RELEASE_MISMATCH_RECOVERY",
|
||||
"migration": "discard",
|
||||
"name": "boot-mismatch-recovery",
|
||||
"physicalKey": "ca-frontend:release:v1:boot-mismatch-recovery",
|
||||
"quotaFallback": "no-persist",
|
||||
"schemaVersion": 1,
|
||||
"scope": "release",
|
||||
"ttl": "session",
|
||||
"valueCodec": "opaque-string-v1"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -897,30 +948,19 @@
|
||||
"requiredFields": [
|
||||
"kind",
|
||||
"defaultRetryable",
|
||||
"severity",
|
||||
"userMessageKey",
|
||||
"action",
|
||||
"telemetryEvent",
|
||||
"redaction"
|
||||
"action"
|
||||
],
|
||||
"fieldTypes": {
|
||||
"kind": "string",
|
||||
"defaultRetryable": "boolean",
|
||||
"severity": "string",
|
||||
"userMessageKey": "string",
|
||||
"action": "string",
|
||||
"telemetryEvent": "string",
|
||||
"redaction": "array"
|
||||
"action": "string"
|
||||
},
|
||||
"uniqueFields": [
|
||||
"kind"
|
||||
],
|
||||
"allowedValues": {
|
||||
"severity": [
|
||||
"info",
|
||||
"warning",
|
||||
"error"
|
||||
],
|
||||
"action": [
|
||||
"retry",
|
||||
"reauth",
|
||||
@@ -935,8 +975,7 @@
|
||||
"breakingFields": [
|
||||
"kind",
|
||||
"userMessageKey",
|
||||
"action",
|
||||
"telemetryEvent"
|
||||
"action"
|
||||
]
|
||||
},
|
||||
"rows": {
|
||||
@@ -944,684 +983,228 @@
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "API_CONTRACT_MISMATCH",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "app.boot.failed",
|
||||
"userMessageKey": "error.api_contract_mismatch"
|
||||
},
|
||||
"ASSET_MISMATCH": {
|
||||
"action": "reload-once",
|
||||
"defaultRetryable": false,
|
||||
"kind": "ASSET_MISMATCH",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "release.mismatch.detected",
|
||||
"userMessageKey": "error.asset_mismatch"
|
||||
},
|
||||
"AUTH_INTEGRATION_FAILURE": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "AUTH_INTEGRATION_FAILURE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.auth_integration_failure"
|
||||
},
|
||||
"AUTH_REQUIRED": {
|
||||
"action": "reauth",
|
||||
"defaultRetryable": false,
|
||||
"kind": "AUTH_REQUIRED",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "info",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.auth_required"
|
||||
},
|
||||
"BOOT_CONFIG_FAILURE": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "BOOT_CONFIG_FAILURE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "app.boot.failed",
|
||||
"userMessageKey": "error.boot_config_failure"
|
||||
},
|
||||
"BUILD_MISMATCH": {
|
||||
"action": "reload-once",
|
||||
"defaultRetryable": false,
|
||||
"kind": "BUILD_MISMATCH",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "release.mismatch.detected",
|
||||
"userMessageKey": "error.build_mismatch"
|
||||
},
|
||||
"CHUNK_LOAD_FAILURE": {
|
||||
"action": "reload-once",
|
||||
"defaultRetryable": false,
|
||||
"kind": "CHUNK_LOAD_FAILURE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "release.mismatch.detected",
|
||||
"userMessageKey": "error.chunk_load_failure"
|
||||
},
|
||||
"CONFIG_MISMATCH": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "CONFIG_MISMATCH",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "app.boot.failed",
|
||||
"userMessageKey": "error.config_mismatch"
|
||||
},
|
||||
"CONFLICT": {
|
||||
"action": "retry",
|
||||
"defaultRetryable": false,
|
||||
"kind": "CONFLICT",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "warning",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.conflict"
|
||||
},
|
||||
"CONTENT_TYPE_MISMATCH": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "CONTENT_TYPE_MISMATCH",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.content_type_mismatch"
|
||||
},
|
||||
"DEPLOY_MISMATCH": {
|
||||
"action": "reload-once",
|
||||
"defaultRetryable": false,
|
||||
"kind": "DEPLOY_MISMATCH",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "release.mismatch.detected",
|
||||
"userMessageKey": "error.deploy_mismatch"
|
||||
},
|
||||
"DUPLICATE_IN_FLIGHT": {
|
||||
"action": "none",
|
||||
"defaultRetryable": false,
|
||||
"kind": "DUPLICATE_IN_FLIGHT",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "info",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.duplicate_in_flight"
|
||||
},
|
||||
"ENVELOPE_MISMATCH": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "ENVELOPE_MISMATCH",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.envelope_mismatch"
|
||||
},
|
||||
"FORBIDDEN": {
|
||||
"action": "navigate",
|
||||
"defaultRetryable": false,
|
||||
"kind": "FORBIDDEN",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "warning",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.forbidden"
|
||||
},
|
||||
"IDENTITY_INTERN_LIMIT_EXCEEDED": {
|
||||
"action": "retry",
|
||||
"defaultRetryable": false,
|
||||
"kind": "IDENTITY_INTERN_LIMIT_EXCEEDED",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "warning",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.identity_intern_limit_exceeded"
|
||||
},
|
||||
"MALFORMED_JSON": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "MALFORMED_JSON",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.malformed_json"
|
||||
},
|
||||
"MAPPING_CONTRACT_VIOLATION": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "MAPPING_CONTRACT_VIOLATION",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.mapping_contract_violation"
|
||||
},
|
||||
"NETWORK_UNREACHABLE": {
|
||||
"action": "retry",
|
||||
"defaultRetryable": true,
|
||||
"kind": "NETWORK_UNREACHABLE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "warning",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.network_unreachable"
|
||||
},
|
||||
"NOT_FOUND": {
|
||||
"action": "navigate",
|
||||
"defaultRetryable": false,
|
||||
"kind": "NOT_FOUND",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "info",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.not_found"
|
||||
},
|
||||
"PAGINATION_CONTRACT_VIOLATION": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "PAGINATION_CONTRACT_VIOLATION",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.pagination_contract_violation"
|
||||
},
|
||||
"QUERY_CACHE_FAILURE": {
|
||||
"action": "retry",
|
||||
"defaultRetryable": false,
|
||||
"kind": "QUERY_CACHE_FAILURE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "query.cache.failed",
|
||||
"userMessageKey": "error.query_cache_failure"
|
||||
},
|
||||
"RATE_LIMITED": {
|
||||
"action": "retry",
|
||||
"defaultRetryable": true,
|
||||
"kind": "RATE_LIMITED",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "warning",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.rate_limited"
|
||||
},
|
||||
"RELEASE_MANIFEST_FAILURE": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "RELEASE_MANIFEST_FAILURE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "app.boot.failed",
|
||||
"userMessageKey": "error.release_manifest_failure"
|
||||
},
|
||||
"RELEASE_MISMATCH": {
|
||||
"action": "reload-once",
|
||||
"defaultRetryable": false,
|
||||
"kind": "RELEASE_MISMATCH",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "release.mismatch.detected",
|
||||
"userMessageKey": "error.release_mismatch"
|
||||
},
|
||||
"RENDER_FAILURE": {
|
||||
"action": "reload-once",
|
||||
"defaultRetryable": false,
|
||||
"kind": "RENDER_FAILURE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "ui.render.failed",
|
||||
"userMessageKey": "error.render_failure"
|
||||
},
|
||||
"REQUEST_ABORTED": {
|
||||
"action": "none",
|
||||
"defaultRetryable": false,
|
||||
"kind": "REQUEST_ABORTED",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "info",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.request_aborted"
|
||||
},
|
||||
"REQUEST_TIMEOUT": {
|
||||
"action": "retry",
|
||||
"defaultRetryable": true,
|
||||
"kind": "REQUEST_TIMEOUT",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "warning",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.request_timeout"
|
||||
},
|
||||
"RESPONSE_BODY_LIMIT": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "RESPONSE_BODY_LIMIT",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.response_body_limit"
|
||||
},
|
||||
"RESULT_LIMIT_EXCEEDED": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "RESULT_LIMIT_EXCEEDED",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.result_limit_exceeded"
|
||||
},
|
||||
"SCHEMA_MISMATCH": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "SCHEMA_MISMATCH",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.schema_mismatch"
|
||||
},
|
||||
"SCOPE_GENERATION_CHANGED": {
|
||||
"action": "none",
|
||||
"defaultRetryable": false,
|
||||
"kind": "SCOPE_GENERATION_CHANGED",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "info",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.scope_generation_changed"
|
||||
},
|
||||
"SERVER_FAILURE": {
|
||||
"action": "retry",
|
||||
"defaultRetryable": true,
|
||||
"kind": "SERVER_FAILURE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.server_failure"
|
||||
},
|
||||
"STORAGE_QUOTA_EXCEEDED": {
|
||||
"action": "none",
|
||||
"defaultRetryable": false,
|
||||
"kind": "STORAGE_QUOTA_EXCEEDED",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "warning",
|
||||
"telemetryEvent": "storage.operation.failed",
|
||||
"userMessageKey": "error.storage_quota_exceeded"
|
||||
},
|
||||
"STORAGE_UNAVAILABLE": {
|
||||
"action": "none",
|
||||
"defaultRetryable": false,
|
||||
"kind": "STORAGE_UNAVAILABLE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "warning",
|
||||
"telemetryEvent": "storage.operation.failed",
|
||||
"userMessageKey": "error.storage_unavailable"
|
||||
},
|
||||
"TELEMETRY_FAILURE": {
|
||||
"action": "none",
|
||||
"defaultRetryable": false,
|
||||
"kind": "TELEMETRY_FAILURE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "info",
|
||||
"telemetryEvent": "telemetry.delivery.dropped",
|
||||
"userMessageKey": "error.telemetry_failure"
|
||||
},
|
||||
"UNKNOWN_CLIENT_FAILURE": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "UNKNOWN_CLIENT_FAILURE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "warning",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.unknown_client_failure"
|
||||
},
|
||||
"UNKNOWN_FAILURE": {
|
||||
"action": "contact-support",
|
||||
"defaultRetryable": false,
|
||||
"kind": "UNKNOWN_FAILURE",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "error",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.unknown_failure"
|
||||
},
|
||||
"VALIDATION_REJECTED": {
|
||||
"action": "none",
|
||||
"defaultRetryable": false,
|
||||
"kind": "VALIDATION_REJECTED",
|
||||
"redaction": [
|
||||
"authorization",
|
||||
"body",
|
||||
"cause",
|
||||
"headers",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
"url"
|
||||
],
|
||||
"severity": "info",
|
||||
"telemetryEvent": "api.request.failed",
|
||||
"userMessageKey": "error.validation_rejected"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,24 +344,17 @@
|
||||
"requiredFields": [
|
||||
"kind",
|
||||
"defaultRetryable",
|
||||
"severity",
|
||||
"userMessageKey",
|
||||
"action",
|
||||
"telemetryEvent",
|
||||
"redaction"
|
||||
"action"
|
||||
],
|
||||
"fieldTypes": {
|
||||
"kind": "string",
|
||||
"defaultRetryable": "boolean",
|
||||
"severity": "string",
|
||||
"userMessageKey": "string",
|
||||
"action": "string",
|
||||
"telemetryEvent": "string",
|
||||
"redaction": "array"
|
||||
"action": "string"
|
||||
},
|
||||
"uniqueFields": ["kind"],
|
||||
"allowedValues": {
|
||||
"severity": ["info", "warning", "error"],
|
||||
"action": [
|
||||
"retry",
|
||||
"reauth",
|
||||
@@ -377,7 +370,7 @@
|
||||
"token": "failure("
|
||||
}
|
||||
],
|
||||
"breakingFields": ["kind", "userMessageKey", "action", "telemetryEvent"]
|
||||
"breakingFields": ["kind", "userMessageKey", "action"]
|
||||
},
|
||||
{
|
||||
"registryId": "FE-REG-QUERY-INVALIDATION",
|
||||
|
||||
+38
-165
@@ -1,5 +1,3 @@
|
||||
import type { DiagnosticEventId } from "./diagnostics.ts";
|
||||
import type { TelemetryEventName } from "./telemetry.ts";
|
||||
import {
|
||||
projectValidationIssues,
|
||||
type ValidationIssue,
|
||||
@@ -7,17 +5,6 @@ import {
|
||||
|
||||
export type { ValidationIssue } from "./validation-issues.ts";
|
||||
|
||||
const DROP_SENSITIVE = Object.freeze([
|
||||
"cause",
|
||||
"body",
|
||||
"headers",
|
||||
"authorization",
|
||||
"url",
|
||||
"query",
|
||||
"stack",
|
||||
"storageValue",
|
||||
] as const);
|
||||
|
||||
export type ErrorAction =
|
||||
| "retry"
|
||||
| "reauth"
|
||||
@@ -26,208 +13,94 @@ export type ErrorAction =
|
||||
| "contact-support"
|
||||
| "none";
|
||||
|
||||
export type ErrorObservationEvent = DiagnosticEventId | TelemetryEventName;
|
||||
|
||||
/**
|
||||
* 07-04. Every field has a reader: `createFailure` copies `defaultRetryable`,
|
||||
* `userMessageKey` and `action`. Severity, telemetry event and redaction
|
||||
* fields were removed because nothing read them — telemetry names its own
|
||||
* events and `createFailure` drops sensitive details by copying an allowlist.
|
||||
*/
|
||||
export type ErrorDefinition<Kind extends string> = Readonly<{
|
||||
kind: Kind;
|
||||
defaultRetryable: boolean;
|
||||
severity: string;
|
||||
userMessageKey: string;
|
||||
action: ErrorAction;
|
||||
telemetryEvent: ErrorObservationEvent;
|
||||
redaction: readonly string[];
|
||||
}>;
|
||||
|
||||
const row = <Kind extends string>(
|
||||
kind: Kind,
|
||||
defaultRetryable: boolean,
|
||||
severity: string,
|
||||
action: ErrorAction,
|
||||
telemetryEvent: ErrorObservationEvent = "api.request.failed",
|
||||
): ErrorDefinition<Kind> =>
|
||||
Object.freeze({
|
||||
kind,
|
||||
defaultRetryable,
|
||||
severity,
|
||||
userMessageKey: `error.${kind.toLowerCase()}`,
|
||||
action,
|
||||
telemetryEvent,
|
||||
redaction: DROP_SENSITIVE,
|
||||
});
|
||||
|
||||
export const ERROR_REGISTRY = Object.freeze({
|
||||
NETWORK_UNREACHABLE: row("NETWORK_UNREACHABLE", true, "warning", "retry"),
|
||||
REQUEST_TIMEOUT: row("REQUEST_TIMEOUT", true, "warning", "retry"),
|
||||
REQUEST_ABORTED: row("REQUEST_ABORTED", false, "info", "none"),
|
||||
CONTENT_TYPE_MISMATCH: row(
|
||||
"CONTENT_TYPE_MISMATCH",
|
||||
false,
|
||||
"error",
|
||||
"contact-support",
|
||||
),
|
||||
MALFORMED_JSON: row("MALFORMED_JSON", false, "error", "contact-support"),
|
||||
RESPONSE_BODY_LIMIT: row(
|
||||
"RESPONSE_BODY_LIMIT",
|
||||
false,
|
||||
"error",
|
||||
"contact-support",
|
||||
),
|
||||
ENVELOPE_MISMATCH: row("ENVELOPE_MISMATCH", false, "error", "contact-support"),
|
||||
SCHEMA_MISMATCH: row("SCHEMA_MISMATCH", false, "error", "contact-support"),
|
||||
NETWORK_UNREACHABLE: row("NETWORK_UNREACHABLE", true, "retry"),
|
||||
REQUEST_TIMEOUT: row("REQUEST_TIMEOUT", true, "retry"),
|
||||
REQUEST_ABORTED: row("REQUEST_ABORTED", false, "none"),
|
||||
CONTENT_TYPE_MISMATCH: row("CONTENT_TYPE_MISMATCH", false, "contact-support"),
|
||||
MALFORMED_JSON: row("MALFORMED_JSON", false, "contact-support"),
|
||||
RESPONSE_BODY_LIMIT: row("RESPONSE_BODY_LIMIT", false, "contact-support"),
|
||||
ENVELOPE_MISMATCH: row("ENVELOPE_MISMATCH", false, "contact-support"),
|
||||
SCHEMA_MISMATCH: row("SCHEMA_MISMATCH", false, "contact-support"),
|
||||
MAPPING_CONTRACT_VIOLATION: row(
|
||||
"MAPPING_CONTRACT_VIOLATION",
|
||||
false,
|
||||
"error",
|
||||
"contact-support",
|
||||
),
|
||||
RESULT_LIMIT_EXCEEDED: row(
|
||||
"RESULT_LIMIT_EXCEEDED",
|
||||
false,
|
||||
"error",
|
||||
"contact-support",
|
||||
),
|
||||
SCOPE_GENERATION_CHANGED: row(
|
||||
"SCOPE_GENERATION_CHANGED",
|
||||
false,
|
||||
"info",
|
||||
"none",
|
||||
),
|
||||
RESULT_LIMIT_EXCEEDED: row("RESULT_LIMIT_EXCEEDED", false, "contact-support"),
|
||||
SCOPE_GENERATION_CHANGED: row("SCOPE_GENERATION_CHANGED", false, "none"),
|
||||
IDENTITY_INTERN_LIMIT_EXCEEDED: row(
|
||||
"IDENTITY_INTERN_LIMIT_EXCEEDED",
|
||||
false,
|
||||
"warning",
|
||||
"retry",
|
||||
),
|
||||
DUPLICATE_IN_FLIGHT: row(
|
||||
"DUPLICATE_IN_FLIGHT",
|
||||
false,
|
||||
"info",
|
||||
"none",
|
||||
),
|
||||
DUPLICATE_IN_FLIGHT: row("DUPLICATE_IN_FLIGHT", false, "none"),
|
||||
PAGINATION_CONTRACT_VIOLATION: row(
|
||||
"PAGINATION_CONTRACT_VIOLATION",
|
||||
false,
|
||||
"error",
|
||||
"contact-support",
|
||||
),
|
||||
AUTH_REQUIRED: row("AUTH_REQUIRED", false, "info", "reauth"),
|
||||
AUTH_REQUIRED: row("AUTH_REQUIRED", false, "reauth"),
|
||||
AUTH_INTEGRATION_FAILURE: row(
|
||||
"AUTH_INTEGRATION_FAILURE",
|
||||
false,
|
||||
"error",
|
||||
"contact-support",
|
||||
),
|
||||
FORBIDDEN: row("FORBIDDEN", false, "warning", "navigate"),
|
||||
NOT_FOUND: row("NOT_FOUND", false, "info", "navigate"),
|
||||
CONFLICT: row("CONFLICT", false, "warning", "retry"),
|
||||
VALIDATION_REJECTED: row("VALIDATION_REJECTED", false, "info", "none"),
|
||||
FORBIDDEN: row("FORBIDDEN", false, "navigate"),
|
||||
NOT_FOUND: row("NOT_FOUND", false, "navigate"),
|
||||
CONFLICT: row("CONFLICT", false, "retry"),
|
||||
VALIDATION_REJECTED: row("VALIDATION_REJECTED", false, "none"),
|
||||
UNKNOWN_CLIENT_FAILURE: row(
|
||||
"UNKNOWN_CLIENT_FAILURE",
|
||||
false,
|
||||
"warning",
|
||||
"contact-support",
|
||||
),
|
||||
RATE_LIMITED: row("RATE_LIMITED", true, "warning", "retry"),
|
||||
SERVER_FAILURE: row("SERVER_FAILURE", true, "error", "retry"),
|
||||
CHUNK_LOAD_FAILURE: row(
|
||||
"CHUNK_LOAD_FAILURE",
|
||||
false,
|
||||
"error",
|
||||
"reload-once",
|
||||
"release.mismatch.detected",
|
||||
),
|
||||
BOOT_CONFIG_FAILURE: row(
|
||||
"BOOT_CONFIG_FAILURE",
|
||||
false,
|
||||
"error",
|
||||
"contact-support",
|
||||
"app.boot.failed",
|
||||
),
|
||||
RATE_LIMITED: row("RATE_LIMITED", true, "retry"),
|
||||
SERVER_FAILURE: row("SERVER_FAILURE", true, "retry"),
|
||||
CHUNK_LOAD_FAILURE: row("CHUNK_LOAD_FAILURE", false, "reload-once"),
|
||||
BOOT_CONFIG_FAILURE: row("BOOT_CONFIG_FAILURE", false, "contact-support"),
|
||||
RELEASE_MANIFEST_FAILURE: row(
|
||||
"RELEASE_MANIFEST_FAILURE",
|
||||
false,
|
||||
"error",
|
||||
"contact-support",
|
||||
"app.boot.failed",
|
||||
),
|
||||
DEPLOY_MISMATCH: row(
|
||||
"DEPLOY_MISMATCH",
|
||||
false,
|
||||
"error",
|
||||
"reload-once",
|
||||
"release.mismatch.detected",
|
||||
),
|
||||
BUILD_MISMATCH: row(
|
||||
"BUILD_MISMATCH",
|
||||
false,
|
||||
"error",
|
||||
"reload-once",
|
||||
"release.mismatch.detected",
|
||||
),
|
||||
CONFIG_MISMATCH: row(
|
||||
"CONFIG_MISMATCH",
|
||||
false,
|
||||
"error",
|
||||
"contact-support",
|
||||
"app.boot.failed",
|
||||
),
|
||||
API_CONTRACT_MISMATCH: row(
|
||||
"API_CONTRACT_MISMATCH",
|
||||
false,
|
||||
"error",
|
||||
"contact-support",
|
||||
"app.boot.failed",
|
||||
),
|
||||
RELEASE_MISMATCH: row(
|
||||
"RELEASE_MISMATCH",
|
||||
false,
|
||||
"error",
|
||||
"reload-once",
|
||||
"release.mismatch.detected",
|
||||
),
|
||||
ASSET_MISMATCH: row(
|
||||
"ASSET_MISMATCH",
|
||||
false,
|
||||
"error",
|
||||
"reload-once",
|
||||
"release.mismatch.detected",
|
||||
),
|
||||
STORAGE_UNAVAILABLE: row(
|
||||
"STORAGE_UNAVAILABLE",
|
||||
false,
|
||||
"warning",
|
||||
"none",
|
||||
"storage.operation.failed",
|
||||
),
|
||||
STORAGE_QUOTA_EXCEEDED: row(
|
||||
"STORAGE_QUOTA_EXCEEDED",
|
||||
false,
|
||||
"warning",
|
||||
"none",
|
||||
"storage.operation.failed",
|
||||
),
|
||||
RENDER_FAILURE: row(
|
||||
"RENDER_FAILURE",
|
||||
false,
|
||||
"error",
|
||||
"reload-once",
|
||||
"ui.render.failed",
|
||||
),
|
||||
TELEMETRY_FAILURE: row(
|
||||
"TELEMETRY_FAILURE",
|
||||
false,
|
||||
"info",
|
||||
"none",
|
||||
"telemetry.delivery.dropped",
|
||||
),
|
||||
QUERY_CACHE_FAILURE: row(
|
||||
"QUERY_CACHE_FAILURE",
|
||||
false,
|
||||
"error",
|
||||
"retry",
|
||||
"cache.operation.failed",
|
||||
),
|
||||
UNKNOWN_FAILURE: row("UNKNOWN_FAILURE", false, "error", "contact-support"),
|
||||
DEPLOY_MISMATCH: row("DEPLOY_MISMATCH", false, "reload-once"),
|
||||
BUILD_MISMATCH: row("BUILD_MISMATCH", false, "reload-once"),
|
||||
CONFIG_MISMATCH: row("CONFIG_MISMATCH", false, "contact-support"),
|
||||
API_CONTRACT_MISMATCH: row("API_CONTRACT_MISMATCH", false, "contact-support"),
|
||||
RELEASE_MISMATCH: row("RELEASE_MISMATCH", false, "reload-once"),
|
||||
ASSET_MISMATCH: row("ASSET_MISMATCH", false, "reload-once"),
|
||||
STORAGE_UNAVAILABLE: row("STORAGE_UNAVAILABLE", false, "none"),
|
||||
STORAGE_QUOTA_EXCEEDED: row("STORAGE_QUOTA_EXCEEDED", false, "none"),
|
||||
RENDER_FAILURE: row("RENDER_FAILURE", false, "reload-once"),
|
||||
TELEMETRY_FAILURE: row("TELEMETRY_FAILURE", false, "none"),
|
||||
QUERY_CACHE_FAILURE: row("QUERY_CACHE_FAILURE", false, "retry"),
|
||||
UNKNOWN_FAILURE: row("UNKNOWN_FAILURE", false, "contact-support"),
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,35 +7,17 @@ import {
|
||||
normalizeUnknownFailure,
|
||||
withFailureEffect,
|
||||
} from "../../src/contracts/errors.ts";
|
||||
import { DIAGNOSTIC_EVENT_REGISTRY } from "../../src/contracts/diagnostics.ts";
|
||||
import { TELEMETRY_REGISTRY } from "../../src/contracts/telemetry.ts";
|
||||
|
||||
describe("frontend failure classification", () => {
|
||||
it("defines all stable error kinds with the seven contract fields", () => {
|
||||
it("defines all stable error kinds with the four contract fields", () => {
|
||||
expect(Object.keys(ERROR_REGISTRY)).toHaveLength(38);
|
||||
for (const definition of Object.values(ERROR_REGISTRY)) {
|
||||
expect(definition).toEqual(
|
||||
expect.objectContaining({
|
||||
kind: expect.any(String),
|
||||
defaultRetryable: expect.any(Boolean),
|
||||
severity: expect.any(String),
|
||||
userMessageKey: expect.any(String),
|
||||
action: expect.any(String),
|
||||
telemetryEvent: expect.any(String),
|
||||
redaction: expect.any(Array),
|
||||
}),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
it("references only registered observability events", () => {
|
||||
const registeredEvents = new Set([
|
||||
...Object.keys(DIAGNOSTIC_EVENT_REGISTRY),
|
||||
...Object.keys(TELEMETRY_REGISTRY),
|
||||
]);
|
||||
|
||||
for (const definition of Object.values(ERROR_REGISTRY)) {
|
||||
expect(registeredEvents.has(definition.telemetryEvent)).toBe(true);
|
||||
expect(Object.keys(definition).sort()).toEqual([
|
||||
"action",
|
||||
"defaultRetryable",
|
||||
"kind",
|
||||
"userMessageKey",
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -65,6 +47,23 @@ describe("frontend failure classification", () => {
|
||||
).toMatchObject({ action: "contact-support" });
|
||||
});
|
||||
|
||||
it("never marks a failure retryable once the write may or did take effect (07-04)", () => {
|
||||
expect(ERROR_REGISTRY.SERVER_FAILURE.defaultRetryable).toBe(true);
|
||||
expect(createFailure("SERVER_FAILURE", "CREATE", 0).retryable).toBe(true);
|
||||
expect(
|
||||
createFailure("SERVER_FAILURE", "CREATE", 0, { effect: "MAYBE_APPLIED" }),
|
||||
).toMatchObject({ retryable: false, action: "contact-support" });
|
||||
expect(
|
||||
createFailure("SERVER_FAILURE", "CREATE", 0, {
|
||||
effect: "APPLIED_CONFIRMED",
|
||||
}),
|
||||
).toMatchObject({ retryable: false, action: "none" });
|
||||
expect(
|
||||
createFailure("SERVER_FAILURE", "CREATE", 0, { effect: "NOT_APPLIED" })
|
||||
.retryable,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("projects only allowlisted safe fields", () => {
|
||||
const untrustedDetails = {
|
||||
code: "TEMPORARY",
|
||||
|
||||
Reference in New Issue
Block a user