vole-document 0.1.0-alpha.36

Persistent procedural document runtime: byte-exact reconstruction plus a content-addressed procedural seed DAG, queryable observations with provenance, and selective late materialization.
Documentation
# DOC (legacy Word 97–2003)

Legacy Word (`.doc`, MS-DOC) is a **CFBF-based legacy semantic model** built on
the shared compound-document physical layer (Phase 21.35): the exact leaf is the
**whole source** (a RAW-like `DocumentExact`) and every derived observation is a
bounded, span-preserving (`Q_gen`) projection. The adapter is gated behind the
**non-default** `doc = ["cfbf"]` feature (it reuses the `cfbf` physical layer).

The model is deliberately **partial and honest**: it claims a bounded Word 97–2003
FIB/piece-table subset, declines everything else **typed**, and never guesses and
never panics.

## Authority boundary

The exact physical source is the whole compound file — the 512-byte header,
DIFAT/FAT/MiniFAT, the directory tree, and every stream resolved to an exact byte
span. No un-OLE/re-OLE is performed: exactness is the whole source, and the DOC
model is derived (`Q_gen`), never on the exactness path (ADR-0060: the model node
depends on the `sha256(source)` root).

## Detection boundary

The DOC detector is built **on top of** the CFBF detector and runs **after** the
generic CFBF physical layer and **before** the generic `Cfbf` claim. So:

- a `.doc` whose `WordDocument` stream opens with the Word FIB magic `0xA5EC` and
  a plausible Word 97–2003 `nFib`, with the selected table stream present, becomes
  `Doc`;
- a generic compound file, a `.doc` with a bad `wIdent`, and a `.doc` with an
  implausible `nFib` (Word 6/95) stay `Cfbf` (a msg/xls/ppt/msg detector also runs
  in this chain; see [Detection order]../reference/format-support.md);
- prose stays `Opaque`;
- **`.docx` is an OPC ZIP** and never reaches the CFBF detector at all — it is
  detected as [DOCX]docx.md in the ZIP family.

## Native inverse representation

A bounded MS-DOC subset:

- the Word FIB: `wIdent`, `nFib`/version, the `fWhichTblStm` table selection,
  `fcMin`/`fcMac`, `cbMac`, the `ccp*` section counts, `fcClx`/`lcbClx`;
- the piece table (the `Prc` records and the `Pcdt` `PlcPcd`: the CP array and the
  8-byte PCDs), each piece's resolved `fc`, compressed flag, and exact
  `WordDocument`-stream byte span, and its decoded text — a mix of a compressed
  (CP1252) and an uncompressed (UTF-16LE) piece is exercised in both a `0Table`
  and a `1Table` document;
- the main document text over `[0, ccpText)`.

## Supported observations

Common selectors: `metadata`, `text`, `search-match`. Native: `doc-fib`,
`doc-piece`, `doc-text`, `doc-find`.

## Declined (typed, never guessed)

A bad `wIdent`, an implausible `nFib`, a missing selected table stream, an
out-of-range `fcClx`/`lcbClx` or `fcMin`/`fcMac`, a CLX past the table stream, an
absent `Pcdt` or an `lcb` that is not `12n+4`, a CP array that is not monotonic
(or does not start at 0), a PCD `fc` whose piece falls outside the
`WordDocument` stream, and a piece-table last CP that disagrees with the declared
`ccp*` totals are typed declines (`InvalidDocStructure`, exit 52).

A `.doc` with a plausible FIB but a malformed body **is admitted** (its
whole-source exact leaf is unaffected) and its model then declines typed.

## Exact reconstruction

`materialize == original_bytes` (length + SHA-256 + `cmp`) for any admitted `.doc`,
including those the adapter declines to interpret natively, and after the source
**and** descriptor are deleted in a fresh process.

**Adapter-court H1 (byte-exactness):** **2/2** normal fixtures byte-exact
(`doc_0table`, `doc_1table`, each with both a compressed and an uncompressed
piece); 4/4 structural declines `InvalidDocStructure`; 3/3 CFBF controls stay
`Cfbf`; 1/1 opaque control stays `Opaque`.

## Honest negatives

- **No separate economic court.** There is no faithful conventional decoder for
  legacy binary Office, so — exactly as for HDF5/CFBF — an economic comparison
  would be `comparator_absent`. The validation is the adapter court plus the
  stratified real-world population (Phase 26.5), not an economic court.
- **Not claimed:** Word 6/95 (an older FIB), Word 2007+ `.docx` (an OPC ZIP), and
  the other legacy CFBF semantic models (see [XLS]xls.md, [PPT]ppt.md,
  [MSG]msg.md).
- **Real-world declines are expected.** In the Phase 26.5 population two genuine
  Apache POI `.doc` compound files (`poi-document-Bug60942b.doc`,
  `poi-document-testRangeDelete.doc`) have a `WordDocument` stream whose FIB
  variant this bounded detector does not claim, so they stay at the generic
  `Cfbf` layer — a **recorded** boundary, not a failure of byte authority.

## Relevant ADRs

[0029](../adr/0029-multi-format-authority-model.md),
[0031](../adr/0031-common-observation-model.md),
[0054](../adr/0054-repeatability-and-paired-measurement.md),
[0060](../adr/0060-source-scoped-node-identity.md).

## Evidence

- Phase 26.1.1 legacy Word adapter court (H1 exactness 2/2):
  [2026-10-11-phase26-1-1-doc-966c3fd4]../../evidence/campaigns/2026-10-11-phase26-1-1-doc-966c3fd4/.
- Stratified real-world population v2 (Phase 26.5):
  [2026-10-11-realformats-stratified-v2-703ca5ac]../../evidence/campaigns/2026-10-11-realformats-stratified-v2-703ca5ac/.
- Results: [phase-26-results.md]../phases/phase-26-results.md.