Research resources

Layer 2 Build Report — 2026-04-29

Built

1. ../../provenance/source-321b7e58ea730227.html

2. ../../provenance/source-dc2a01a119a6a4a7.html

3. ../../provenance/source-1027fadcaa986d08.html

Run Status

Interior matcher run

v3 attestation run

Stub Vs Production

Production enough for next-cycle testing

Stub / fallback

Honest Limitations

How To Run

HTR/OCR runner

python3 ../../provenance/source-321b7e58ea730227.html
python3 ../../provenance/source-321b7e58ea730227.html --witness-filter 'MSS_Pal.lat.1268' --limit 10
python3 ../../provenance/source-321b7e58ea730227.html --witness-filter 'Pal_lat_1221' --limit 20 --overwrite

Interior substring matcher

python3 ../../provenance/source-dc2a01a119a6a4a7.html

Combined v3 attestation

python3 ../../provenance/source-1027fadcaa986d08.html

Estimated Work To Productionize Stub Portions

Complete public source text and line addresses
# Layer 2 Build Report — 2026-04-29

## Built

### 1. `../../provenance/source-321b7e58ea730227.html`
- Purpose: page-level re-OCR/HTR runner over `MSS_Pal.lat.1268/` and `extracted/PADUA_COHORT/`.
- Runtime behavior: detects local engine availability and writes page artifacts to `../../provenance/source-75d85e78bd07cdb9.html<witness>_<folio>.txt` plus `.json` sidecars.
- Current host status: no `kraken`, `calamari`, `loghi`, `torch`, `transformers`, or local VLM stack detected. `auto` therefore resolves to explicit `tesseract` fallback and tags output as `LAYER1_OCR_FLOOR`.
- Confidence support: word-level confidence from Tesseract TSV is recorded; character-level confidence is unavailable in the current fallback path.
- Smoke artifacts written:
  - `../../../../assets/tools/source-items/afa8959f7777e7d80115e98a.txt`
  - `../../../../assets/tools/source-items/146bd9eeaa1779eab46b3ead.txt`

### 2. `../../provenance/source-dc2a01a119a6a4a7.html`
- Purpose: recover prefix, suffix, and interior-substring matches for attested reconstructed HAGEVA stems.
- Scoring shipped:
  - prefix `1.0`
  - interior with explicit separator marker (`-`, `/`, apostrophe) `0.7`
  - interior without marker `0.3`
  - suffix `0.5`
- Variant policy: no blanket orthographic generation; uses `hageva_predicted_stems.json` only.
- Outputs written:
  - `interior_substring_matches_pharma_baseline_2026-04-29.json`
  - `../../provenance/source-2666d9180d080047.html`
  - `../../provenance/source-fd573543c9908f72.html`

### 3. `../../provenance/source-1027fadcaa986d08.html`
- Purpose: combine source-provenance-aware OCR/HTR selection, interior-substring recovery scoring, and the matched-frequency null discipline from Phase B fix #4.
- HTR/OCR provenance rule: HTR page output is only substituted if coverage is high enough; partial page dumps do not replace the full baseline text silently.
- Output written:
  - `../../provenance/source-1eb909b95451633e.html`

## Run Status

### Interior matcher run
- Completed on the 4 baseline pharma corpora and 6 non-pharma controls.
- Comparison summary from `operator_pharma_vs_nonpharma_interior_2026-04-29.json`:
  - `1/13` operators at `>=5x`
  - `3/13` operators at `>=2x`
  - median ratio `1.36x`
- Notable first-cut shifts:
  - `y` remains strongest by rate (`9.0x`)
  - `a` rises to `4.4x`
  - `l` remains enriched (`2.9x`)
  - `o`, `m`, `p` stay below `2x`

### v3 attestation run
- Completed on the pharma baseline using fallback OCR text for all four sources.
- Source manifest in `hageva_attestation_v3_2026-04-29.json` records:
  - `Montagnana_1476`: fallback OCR file
  - `Pal.lat.1268`: fallback OCR file, sample HTR-page coverage present but only `0.27%`
  - `Pal.lat.1268_Heid`: fallback OCR file
  - `Pal.lat.1221`: fallback OCR file, sample HTR-page coverage present but only `2%`
- Layer-2 recovery verdicts:
  - robust multi-source: `a`, `m`, `p`
  - mixed: `t`
  - Layer-1-only after recovery: `y`, `l`, `o`
- Important comparison to Phase B fix #4:
  - `m` and `p` stay robust
  - `a` improves from `1/4` significant sources in v2 to `4/4` in v3
  - `l` and `t` do not improve cleanly; interior recovery is not uniformly helpful

## Stub Vs Production

### Production enough for next-cycle testing
- `interior_substring_search.py`: yes, first-cut production artifact
- `hageva_attestation_v3.py`: yes, first-cut production artifact on OCR-floor inputs

### Stub / fallback
- `htr_recog.py`: fallback-only on this host
- Reason: no usable local HTR engine/model was available, so the script honestly emits OCR-floor artifacts instead of pretending to do HTR

## Honest Limitations

- No true HTR model is installed locally, so the current `htr_recog.py` output is still Layer 1 extraction floor.
- Tesseract fallback exposes word-level confidence only, not character-level confidence.
- The interior matcher's morpheme-boundary logic is narrow: it only treats explicit separators as boundary markers. Compound morphology without separators is scored as plain interior.
- Interior matching is noisier than prefix-only for some operators. In this first run it clearly helps `a`, but it does not rescue `y`, `l`, or `o` under the matched null.
- No attested per-stem variant table was added in this build. The pipeline still relies on the reconstructed stem list only.

## How To Run

### HTR/OCR runner
```bash
python3 ../../provenance/source-321b7e58ea730227.html
python3 ../../provenance/source-321b7e58ea730227.html --witness-filter 'MSS_Pal.lat.1268' --limit 10
python3 ../../provenance/source-321b7e58ea730227.html --witness-filter 'Pal_lat_1221' --limit 20 --overwrite
```

### Interior substring matcher
```bash
python3 ../../provenance/source-dc2a01a119a6a4a7.html
```

### Combined v3 attestation
```bash
python3 ../../provenance/source-1027fadcaa986d08.html
```

## Estimated Work To Productionize Stub Portions

- Real HTR path on this host: `0.5-1 day` if a working Kraken/Calamari stack plus pretrained medieval-Latin model can be installed cleanly; `1-2 days` if model hunt and CLI wiring are both needed.
- Attested per-stem variant curation: `1-2 days` of authority-driven manual work.
- Interior-score calibration against Ed's visual gold set: `0.5-1 day`.
- Re-run v3 on actual high-coverage HTR output after the above: `0.5 day`.