test(examples): byte-pinned golden for SEGMENTED_OKF_V0_2

A sixth golden directory, never an edit to the five that exist. Its only
difference from the SEGMENTED_V1 golden is the added `okf_version` root key --
measured by diffing the two -- which is exactly what the profile is for and
nothing else moved.

Modelled on tests/test_segmented_golden.py rather than test_golden.py's
`materialize_case`, which is Door A only: it drives materialize_bundle from a
manifest and this bundle comes through Door B's inbox. The plan's pointer to an
"existing goldens list" in test_golden.py is stale -- that file holds only the
Door A parametrize, and `ingest-golden-segmented` is not in it either. Door B
goldens carrying their own test file is the established pattern, and this one
asserts the five priors are untouched from its own side.

CROSS-BUNDLE IDENTITY (PM decision B1) is settled BEFORE this pin, not after.
Byte-pinning a bundle carrying `okf_version` is where its concept IDs stop
being adjustable: a concept ID is bundle-local and stable, identity across
bundles is the tuple (bundle_id, concept_id), and there is no cross-bundle link
form in v0.2. Asserted -- every concept carries its bundle id, so the tuple is
readable from one document, and no foreign bundle id appears anywhere.

Two defects in these tests, both found by running them:

- `parse_frontmatter` takes a Path and returns the dict; three call sites had
  it wrong.
- The cross-bundle check used `b-golden-segmented` as the foreign id, which is
  a PREFIX of this bundle's own id. It failed on every file for the wrong
  reason and would have read as "a cross-bundle reference was emitted". Now a
  foreign id that is not a prefix, with a known-positive half asserting the
  bundle does name its own id -- so the check is looking at content that could
  have carried one.

Negative control: changing one byte of the golden's `okf_version` turns the pin
red.

`okf_version` and `bundle_id` are fixture DATA read from the case, never
constants in the test -- the value belongs to catalog (E1).

Suite 931 -> 941.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-02 14:24:05 +02:00
commit 6dce4355be
13 changed files with 301 additions and 0 deletions

View file

@ -0,0 +1 @@
b-golden-segmented-okf-v0-2

View file

@ -0,0 +1,7 @@
---
okf_version: 0.2
bundle_id: b-golden-segmented-okf-v0-2
---
- [Veiledning for eksempelbundel](veiledning.md)
- [krav (index)](krav/index.md)

View file

@ -0,0 +1,16 @@
---
type: reference
title: Foerste krav
source_file: veiledning.md
source_sha256: 6906ec0acbcfc246e825bda9863c716eb5611b465020e8204eeb448c32343f7d
ingested_at: 2026-08-30T09:00:00Z
generated: true
bundle_id: b-golden-segmented-okf-v0-2
parent: s0
segment_id: s1
source_offset: [94, 176]
---
## 1.1 Foerste krav
Et krav som beskriver den foerste betingelsen i eksempelet.

View file

@ -0,0 +1 @@
- [Foerste krav](foerste-krav.md) — parent: s0?

View file

@ -0,0 +1,16 @@
---
type: reference
title: Andre krav
source_file: veiledning.md
source_sha256: 6906ec0acbcfc246e825bda9863c716eb5611b465020e8204eeb448c32343f7d
ingested_at: 2026-08-30T09:00:00Z
generated: true
bundle_id: b-golden-segmented-okf-v0-2
parent: s0
segment_id: s2
source_offset: [176, 253]
---
## 1.2 Andre krav
Et krav som beskriver den andre betingelsen i eksempelet.

View file

@ -0,0 +1 @@
- [Andre krav](andre-krav.md) — parent: s0?

View file

@ -0,0 +1,2 @@
- [1-1 (index)](1-1/index.md)
- [1-2 (index)](1-2/index.md)

View file

@ -0,0 +1,15 @@
---
type: reference
title: Veiledning for eksempelbundel
source_file: veiledning.md
source_sha256: 6906ec0acbcfc246e825bda9863c716eb5611b465020e8204eeb448c32343f7d
ingested_at: 2026-08-30T09:00:00Z
generated: true
bundle_id: b-golden-segmented-okf-v0-2
segment_id: s0
source_offset: [0, 94]
---
# Veiledning for eksempelbundel
Denne teksten er syntetisk og finnes kun for a pinne bytes.

View file

@ -0,0 +1,11 @@
# Veiledning for eksempelbundel
Denne teksten er syntetisk og finnes kun for a pinne bytes.
## 1.1 Foerste krav
Et krav som beskriver den foerste betingelsen i eksempelet.
## 1.2 Andre krav
Et krav som beskriver den andre betingelsen i eksempelet.

View file

@ -0,0 +1 @@
2026-08-30T09:00:00Z

View file

@ -0,0 +1 @@
0.2

View file

@ -0,0 +1,44 @@
{
"version": "1",
"source_sha256": "6906ec0acbcfc246e825bda9863c716eb5611b465020e8204eeb448c32343f7d",
"extractor_id": "md",
"extractor_version": "1",
"adjudicated_at": "2026-08-30T08:00:00Z",
"entries": [
{
"segment_id": "s0",
"path": "veiledning.md",
"title": "Veiledning for eksempelbundel",
"okf_type": "reference",
"span": [
0,
94
],
"ingested_at": "2026-08-30T09:00:00Z"
},
{
"segment_id": "s1",
"path": "krav/1-1/foerste-krav.md",
"title": "Foerste krav",
"okf_type": "reference",
"span": [
94,
176
],
"ingested_at": "2026-08-30T09:00:00Z",
"parent_id": "s0"
},
{
"segment_id": "s2",
"path": "krav/1-2/andre-krav.md",
"title": "Andre krav",
"okf_type": "reference",
"span": [
176,
253
],
"ingested_at": "2026-08-30T09:00:00Z",
"parent_id": "s0"
}
]
}