K3-21 B. The second form of `parent`: `okf consume --follow-parent` (`consume.attach_parent_text`) puts the enclosing concept's text inside an excerpt's `parent`, with that concept's own `sha256` so a claim resting on it is cited as that concept. It runs AFTER the cut, on the room the cut left, in rank order, so the delivered set, its order, the withheld list and the denominators are the same with the flag as without it -- inherited text cannot displace an excerpt, the mechanism a consumer measured when copied-in ancestor text pushed the right section to withheld place 504 and 1 069. A text that does not fit is cut to the longest prefix that does and marked `truncated`; a parent the payload already holds, or one a higher-ranked excerpt already carried, travels once. OFF; the defaults are chosen on the measurement that follows this commit. `delivered_text` is the one normalisation an excerpt's `text` and a parent's share. Contract SS 8 point 6 gains the MAY; the template tells the reader what `text`, `sha256` and `truncated` mean. README and CLAUDE.md name the flag. Moved on purpose: the SS 7.4 known-positive again (14 455 / 14 083 / 372 -> 14 721 / 14 346 / 375), and `skills/okf-consume/` regenerated with it. `tests/test_parent_text.py::test_no_room_means_no_text_and_no_lost_excerpt` changed from its red form: it asked through `build_payload` at `limit == spent`, where the knapsack's 500 B buckets admit nothing at all (`budget_admits_nothing`); it now holds the rule at `attach_parent_text`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| example-payload.json | ||
| README.md | ||
References
example-payload.json is a real payload, not an illustration, and
../SKILL.md is the skill generated for the same bundle. Both come from the
three-concept golden bundle that ships in this repository,
examples/ingest-golden-segmented-okf-v0-2/expected-bundle, so anyone reading
this file can regenerate them byte for byte and compare. Neither carries content
from any corpus.
Regenerate them from the repository root rather than editing either file, with
okf being this checkout's own install (for example .venv/bin/okf):
okf skill examples/ingest-golden-segmented-okf-v0-2/expected-bundle \
--out skills/okf-consume --force --example-question "Hva sier veiledningen om krav?"
python3 -c 'import os, pathlib; p = pathlib.Path("skills/okf-consume/SKILL.md"); p.write_text(p.read_text(encoding="utf-8").replace(os.path.realpath(".") + "/", ""), encoding="utf-8")'
okf check --skill skills/okf-consume/SKILL.md \
--payload skills/okf-consume/references/example-payload.json
Why each part is there:
--force: the generator refuses to replace an existingSKILL.md(refused (target_occupied)), because a silent overwrite would destroy a hand-edited copy.--example-question: without it the question is derived from the bundle's own titles and the payload is a different one.tests/test_okf_consume.pyasserts this payload byte for byte against the pre-pass for exactlyHva sier veiledningen om krav?, so the question is part of what the file is.- The
python3line:okf skillwrites the bundle root and the skill's own path absolute when--outis not under.claude/skills/, and this directory is not. Shipped as generated, the two commands inSKILL.mdwould name one checkout on one machine. The line strips that checkout's prefix and nothing else, and a test holds the shippedSKILL.mdto the generator's output with exactly that prefix removed. okf checkshould reportconformant: 17 rules over 3 excerpts and 0 withheld entries, 0 findingsand exit 0.
The generated name is b-golden-segmented-okf-v0-2-consume while this
directory stays skills/okf-consume/. Claude Code takes a project or personal
skill's command from its directory name and uses name as a display label, so
a copy placed at .claude/skills/okf-consume/ is still /okf-consume.
The payload is here so that its shape can be read without running anything, and
so that a reader can see what the members the contract does not name look like in
practice: text and text_sha256 on every excerpt (§ 8 permits additional
members; § 1 defines an excerpt as delivered content, and without a body the
budget gate would measure a skeleton), rank, bundle_id_inherited, and the
raw_bytes/encoding_delta pair that gives the known-positive a second,
independent check.