5.8 KiB
OSS Backend Adapter Boundary
Status: Draft Purpose: Define architectural boundaries, responsibilities, and conformance requirements for implementing the OSS backend stack (MinIO, JanusGraph, Cassandra, Elasticsearch, etc.) as spec-compliant adapters.
1. Architectural Position
The OSS backend is an implementation of store/query surfaces, not a semantic extension.
It implements:
- ASL/1-STORE.
- TGK/STORE/1.
- Optional: TGK/PROV/1.
- Optional: derived projections (ES, lakehouse).
It does not redefine:
- Core semantics (ASL/1-CORE, PEL/1-CORE, TGK/1-CORE).
- Canonical encoding (ENC/ASL1-CORE).
- Identity derivation (ASL/1-CORE and HASH/ASL1).
2. Authority and Responsibility Model
2.1 Authoritative Components
Authoritative state resides in:
- Deployed ASL/1-STORE implementation.
- Deterministic TGK projection derived from ASL state.
Adapters must preserve this.
2.2 Derived Components
The following are derived projections:
- Elasticsearch.
- IPFS.
- Lakehouse snapshots.
- AI outputs.
Derived components must:
- Be replayable.
- Be observationally equivalent.
- Never redefine semantics.
3. Adapter Modules
This document defines four adapter classes.
3.1 ASL Store Adapter (MinIO or S3)
Purpose
Implements ASL/1-STORE.
Responsibilities
- Accept
put(Artifact) -> Reference. - Enforce canonical encoding validation.
- Persist artifact bytes under canonical identity.
- Implement
get(Reference) -> Artifact | NotFound. - Map backend errors to canonical error model.
Non-Responsibilities
- Computing identity (handled by core logic).
- Interpreting artifact contents.
- Modifying encoding.
- Adding metadata not declared by spec.
Determinism Requirements
- Same Artifact → same Reference.
- Same Reference → identical bytes returned.
- No backend-specific mutation.
Configuration Surface
- Endpoint.
- Credentials.
- Bucket name.
- Retry policy.
- Multipart threshold.
- Timeout policy.
3.2 TGK Store Adapter (JanusGraph plus Cassandra)
Purpose
Implements TGK/STORE/1.
Responsibilities
- Provide required query operations defined in TGK/STORE/1.
- Enforce canonical
(hash_id, digest)ordering. - Maintain deterministic projection behavior.
- Map errors to spec-defined error model.
Non-Responsibilities
- Creating semantic edges (done via EdgeArtifacts).
- Redefining graph semantics.
- Implicitly inferring relationships.
- Providing authoritative ordering outside spec.
Determinism Requirements
- Same ASL state → same TGK answers.
- Same queries → same ordered results.
- Ordering must not depend on Janus internal traversal order.
Ordering Enforcement Point
Ordering MUST be applied:
- Explicitly in the adapter layer, or
- In a canonical result transformation layer.
Never rely on backend default sort semantics.
3.3 Projection Adapter (Elasticsearch)
Purpose
Accelerate search and filtering.
Responsibilities
- Project canonical artifact metadata.
- Optionally project EdgeArtifacts.
- Maintain replayable checkpoint.
- Expose lag metric.
- Enforce schema versioning.
Non-Responsibilities
- Authoritative artifact reads.
- Authoritative graph queries.
- Deterministic ordering.
Verification Requirement
Any ES-derived candidate results must be:
- Confirmed via ASL/1-STORE.
- Ordered via TGK/STORE/1 logic before returning to clients.
3.4 Snapshot or Lakehouse Adapter (Future)
Purpose
Batch export and audit workflows.
Responsibilities
- Snapshot export from authoritative state.
- Versioned dataset generation.
- Replay equivalence validation.
Non-Responsibilities
- Live semantic authority.
- Mutation of ASL state.
4. Adapter Error Taxonomy
All adapters must map backend-specific errors into a canonical internal taxonomy:
- NotFound.
- InvalidArtifact.
- PermissionDenied.
- TransientIO.
- InternalError.
No backend-specific error types may leak across the adapter boundary.
5. Conformance Gates
No adapter may be merged or promoted unless:
5.1 ASL Adapter
- Passes ASL/1-STORE conformance suite.
- Passes replay equivalence test.
- Passes cross-backend equivalence test.
5.2 TGK Adapter
- Passes TGK/STORE/1 required query suite.
- Passes deterministic ordering test.
- Passes cross-backend equivalence test.
5.3 Projection Adapter
- System passes integration tests with projection disabled.
- Rebuild equivalence test passes.
- Lag metric exposed and validated.
6. Observability Contract
All adapters must expose:
- Health endpoint.
- Error metrics.
- Operation latency metrics.
- Determinism assertion failures.
- Projection lag, if applicable.
7. Security Boundary
Adapters must:
- Not embed secrets in artifacts.
- Respect per-TypeTag redaction policies before indexing.
- Enforce explicit credential configuration.
- Avoid implicit trust of backend defaults.
8. Interaction with Conformance Harness
Adapter design is subordinate to the Phase 0 harness.
Implementation order:
- Conformance harness operational.
- Adapter scaffold.
- Adapter passes harness.
- Integration and load testing.
No adapter bypasses this sequence.
9. Design Outcome
This boundary ensures:
- Thin adapters.
- Zero semantic drift.
- Deterministic reproducibility.
- Backend substitutability.
- Operational scalability without semantic mutation.
The OSS backend becomes:
An infrastructure implementation of store/query surfaces, not an evolution of the semantic core.
Where You Are Now (Strategic Position)
You now have:
- Semantic core locked.
- Execution boundary defined.
- Indexing contract defined.
- Backend boundary defined.
- Implementation phases defined.
You are ready to:
- Design adapter scaffolds.
- Build Phase 0 conformance harness.
- Begin MinIO adapter implementation safely.