# Stage 16: CAS & Byte-Slice Store (aq16_cas_merkle_store / DB-UNIT-01)

Content-addresses immutable files once in R2 and serves exact AST symbol byte slices without reloading whole repositories.

- Atomic micro-queue: `aq16_cas_merkle_store` (visibility: `public_commons`)
- Backing database unit: `DB-UNIT-01` (`Content-Addressed Entities & Merkle Payload Core`)
- Database cell: `entities-db.teleon.dev` (`teleon_core.teleon_entities`, `teleon_core.teleon_executable_payloads`, `teleon_core.teleon_annotation_revisions`)
- Claim row hydration: `single_self_contained_flat_task_row` (100% context inline, normalized writeback)
- Track 2 Sister queue (`SISTER-01`): `sq01-improve-cas-queue.teleon.dev` (Tune chunk boundaries, add AST language grammars, and shrink byte-slice token overhead.)
- Lanes: Merkle swh:1:cnt, FastCDC Chunks, <=64 KiB Stream

## Execution engines & AI Agent freedom contract

- **Deterministic (0 model calls)**: `cas_fastcdc_swhid_ingestor_v1` (FastCDC chunker & SWHID verifier)
- **Hybrid (<=1 model call)**: `cas_license_boundary_disambiguator_v1`
- **AI Agent & Bot Fleet (1..6 calls)**: `cas_unstructured_bundle_extractor_v1` (Multi-file bundle & facet curator)
  - Contract: **Instructions + Resources + Freedom to search for new resources and new ways not bound by instructions**

## Database invariants

- Never rewrite immutable swh:1:cnt digests; append bitemporal annotation revisions instead.
- Prefer HTTP Range slices (<= 64 KiB) over full repository downloads.

## External & internal bot fleet actions

- Deduplicate identical implementations across harnesses via swh:1:cnt digests
- Attach bitemporal annotation facets without mutating underlying bytes
- Serve surgical symbol slices to keep agent context windows lean

## Sister self-tuning areas

- Tune FastCDC chunk target size per language grammar
- Add AST symbol-slicing code_blocks for new file formats (WGSL, USD, Typst)
- Expand provenance and license synonym mappings
