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>
This commit is contained in:
parent
c188a0c749
commit
59703699a5
10 changed files with 50 additions and 17 deletions
|
|
@ -177,9 +177,9 @@ heading-only body gains one line, `Enclosing section: [title](/path)`, in the
|
|||
bundle-relative form SPEC § 6.1 recommends. `okf consume --follow-parent`
|
||||
carries the enclosing section's text inside `parent` as well, with that
|
||||
concept's own `sha256`, and only from the room the cut left — so it never
|
||||
displaces an excerpt. Whether either default moves is measured separately. One cost is known and not repaired: the index projects
|
||||
`parent` as a document number, so a segment id always renders there as
|
||||
unresolved (`parent: p1?`), even though the concept it names is in the bundle.
|
||||
displaces an excerpt. Whether either default moves is measured separately. The index resolves the pointer too: a segment id is looked up among the
|
||||
concepts of its own document, so it renders `parent: p1` when the concept it
|
||||
names is in the bundle and keeps the `?` only when nothing answers to it.
|
||||
|
||||
### The segmentation flags
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue