# Source Document Compiler Canary

## Outcome

A raw artifact plus its UTF-8 extraction and manifest can now become a
deterministic, hash-bound `pending_review` proposal bundle without connecting
to Postgres. This is the first concrete source-to-database build step; it does
not stage, approve, or apply the packet.

## Command

```bash
.venv/bin/python scripts/compile_kb_source_packet.py \
  --artifact fixtures/working-leo/document-ingestion-v1.json \
  --text fixtures/working-leo/document-ingestion-v1.json \
  --manifest fixtures/working-leo/source-compiler-manifest-v1.json \
  --output /tmp/working-leo-source-packet-v1.json
```

## Receipt

- two independent CLI runs produced byte-identical JSON;
- bundle SHA-256: `8162cbd67cc8847d803b788874e0ab5cfcac9f4f859797958807f9622f683338`;
- output status: `pending_review`;
- strict child contract: `approve_claim` v2;
- declared artifact sources: `1`;
- `database_write_performed: false`;
- `stage_preview.executed: false`;
- focused compiler tests: `21 passed`;
- compiler plus normalizer, staging, and apply contract tests: `69 passed`;
- Ruff check and format check: passed.

## Boundary

This proves deterministic packet construction, not autonomous ingestion in the
live Leo profile and not a canonical database update. The next runtime slice is
to expose the compiler through a bounded Leo command, retain the generated
packet, stage it for review, and prove the same packet on a disposable database
before any production apply.
