llm-ingestion-okf/examples
Kjell Tore Guttormsen 59703699a5 fix(structure): the index resolves a parent naming a segment of its own document
K3-21 C. `resolve_structure` asks `_segment_lookup` first for a `parent`
edge: `(source_file, segment_id)` -> concept name, keyed off each concept's
own frontmatter (`DocumentStructure.declared`, no file read again), so a
pointer lands only inside the pointing concept's document -- `p1` exists in
every document of a multi-document bundle. A value no segment answers to is a
document number and is looked up exactly as before; a pointer naming nothing
keeps `UNRESOLVED_MARKER`. The rendering rule is untouched: a resolved
relation renders as its subject, so `parent: p1977?` becomes `parent: p1977`.

Moved on purpose, each named: both segmented goldens' index files
(`examples/ingest-golden-segmented{,-okf-v0-2}/expected-bundle/krav/1-{1,2}/
index.md`), whose declared parents s1 and s2 -> s0 rendered `parent: s0?`
while s0 stood in the bundle -- four lines, `?` removed. The four goldens
`test_the_four_existing_goldens_are_untouched` guards are not among them.
`skills/okf-consume/` regenerated, because the golden's index bytes -- and so
its ref -- moved. `test_shell_parent`'s byte test now expects the resolved
facet. README and CLAUDE.md no longer say the index renders it unresolved.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 13:55:03 +02:00
..
ingest-golden-file feat(profiles): DEFAULT stamps commons' O2 generated, V1 executed 2026-08-09 12:29:05 +02:00
ingest-golden-http feat(profiles): DEFAULT stamps commons' O2 generated, V1 executed 2026-08-09 12:29:05 +02:00
ingest-golden-okf-v0-2 fix(okf-v0.2): generated.by is process:okf-ingest — the id commons decided 2026-07-31 20:50:21 +02:00
ingest-golden-segmented fix(structure): the index resolves a parent naming a segment of its own document 2026-09-11 13:55:03 +02:00
ingest-golden-segmented-okf-v0-2 fix(structure): the index resolves a parent naming a segment of its own document 2026-09-11 13:55:03 +02:00
ingest-golden-sql feat(profiles): DEFAULT stamps commons' O2 generated, V1 executed 2026-08-09 12:29:05 +02:00
README.md feat(examples): ship the §11 golden fixtures with byte-exact conformance 2026-07-16 20:09:03 +02:00

Golden extractions (ingest-spec §11)

One directory per case, ingest-golden-{source type}/, each containing:

Entry Meaning
manifest.json The manifest under test.
fixture/ The source content (CSV catalogue, sqlite database, or mock payloads).
ingested-at.txt The fixed timestamp, one line, §5 format.
expected-bundle/ The expected materialized bundle, compared byte for byte.

ingest-golden-file and ingest-golden-sql are the conformance MUSTs. The http source type is an OPTIONAL extension point (spec §1); this repository implements it, and ingest-golden-http exercises it against the mock payloads in its fixture/ directory — the conformance suite never opens a socket and runs without credentials (§11). For the sql case, the test sets the OKF_GOLDEN_SQL_DB environment variable to the fixture database path; for the http case, the injected mock transport serves fixture/{query path}.

The suite (tests/test_golden.py) re-materializes each case into a fresh directory and compares the result against expected-bundle/ file by file, byte for byte — the load-bearing golden-regression seam (§11).