2.8 KiB
2.8 KiB
Adapter Error Taxonomy
Status: Draft Scope: Canonical error mapping for ASL and TGK adapters and derived projections, used by conformance tests to prevent drift.
1. Purpose
This taxonomy defines a canonical internal error set. Adapters MUST map backend-specific errors into these categories so that conformance tests remain stable across backends.
2. Canonical Error Set
2.1 ASL Store Errors
Canonical enum (from include/amduat/asl/store.h):
AMDUAT_ASL_STORE_ERR_INTEGRITYAMDUAT_ASL_STORE_ERR_UNSUPPORTEDAMDUAT_ASL_STORE_ERR_NOT_FOUNDAMDUAT_ASL_STORE_ERR_IO
2.2 TGK Graph Store Errors
Canonical enum (from include/amduat/tgk/store.h):
GS_ERR_NOT_EDGEGS_ERR_ARTIFACT_ERRORGS_ERR_UNSUPPORTEDGS_ERR_INTEGRITY
2.3 Projection Errors (Derived Indexers)
Canonical categories:
- NotFound
- PermissionDenied
- TransientIO
- InvalidDocument
- InternalError
Projection errors must never be surfaced as authoritative ASL or TGK errors.
3. Mapping Rules
3.1 ASL/1-STORE Mapping
ERR_NOT_FOUND→AMDUAT_ASL_STORE_ERR_NOT_FOUNDERR_INTEGRITY→AMDUAT_ASL_STORE_ERR_INTEGRITYERR_UNSUPPORTED→AMDUAT_ASL_STORE_ERR_UNSUPPORTED- Backend I/O or transport failure →
AMDUAT_ASL_STORE_ERR_IO
Notes:
ASL/1-STOREdoes not standardize I/O or auth errors; those must map toERR_IOfor conformance tests.- A
putcollision on identical reference with different bytes MUST map toERR_INTEGRITY.
3.2 TGK/STORE/1 Mapping
- Reference resolves to non-edge artifact →
GS_ERR_NOT_EDGE - Artifact-layer integrity failure during resolve →
GS_ERR_ARTIFACT_ERROR - Unsupported profile/encoding →
GS_ERR_UNSUPPORTED - Detected graph-level corruption →
GS_ERR_INTEGRITY
Notes:
GS_ERR_ARTIFACT_ERRORis required for artifact-level conflicts; do not useGS_ERR_INTEGRITY.- Backend-specific errors must be normalized to the canonical TGK error set.
3.3 Projection Adapter Mapping
- Index missing doc → NotFound
- Authorization failure → PermissionDenied
- Timeout, transport, or retryable failure → TransientIO
- Schema or decode failure → InvalidDocument
- Unknown failure → InternalError
Projection errors are operational only and must not be treated as ASL/TGK semantic failures.
4. Test Requirements
Conformance tests MUST include:
- ASL:
geton missing ref →ERR_NOT_FOUND. - ASL:
putcollision →ERR_INTEGRITY. - ASL: unsupported config →
ERR_UNSUPPORTED. - ASL: I/O failure path →
ERR_IO. - TGK:
resolve_edgeon non-edge →GS_ERR_NOT_EDGE. - TGK: artifact integrity conflict →
GS_ERR_ARTIFACT_ERROR. - TGK: unsupported encoding/profile →
GS_ERR_UNSUPPORTED.
5. Non-Goals
- Backend-specific error codes.
- Retry policy definitions.
- Human-readable error messaging conventions.