docs(consume): the Claude Code recipe, measured end to end on two bundles

Four questions, two bundles, one run each, in a scratch project outside this
repository with a generated skill per bundle. All four passed, and zero numbers
or identifiers appeared in any answer that were not in the delivered set or in
the payload's own identities (62, 45 and 35 unique numeric tokens checked).

The skill triggered WITHOUT being named in the prompt and selected the right one
of two installed skills from the question alone, so no special invocation syntax
is needed: the generated `description`, which carries the bundle id, the concept
count and the ref, is enough to route on.

One defect the runs found, and it was in the prose rather than the payload. The
citation guidance listed the four locator keys this library writes, so on the
270-concept third-party bundle the model reported "no page locator, the address
is at document level" while the excerpt in front of it carried
`source_element_id` - that bundle's own locator, correctly delivered by the
prefix rule. The guidance now tells the reader to cite whichever `source_*` keys
are present. On the re-run the same question returned the element id. Two runs
of one question, the second measuring a changed artefact and not retrying the
first.

One finding that is not a defect in this chain: the first attempt at a
known-negative was not one. The bundle covers water and frost protection on 17
of its 270 concepts and the ranker put none of them in the cut. The consumer
behaved exactly as the contract asks - refused, named its denominator, reported
its own zero as unmeasured because `withheld` entries carry no titles, and did
not go around the cut. Recorded as a retrieval miss rather than replaced, and
it is the same shape as the open fusion finding.

A correction to this session's own measurement is in the record too: a first
sweep used `grep -rhoE "^source_[a-z_]+:"`, whose character class excludes
digits, and so missed `source_sha256` on 270 of 270 concepts. A pattern that
cannot match what it is looking for returns a zero that reads like a fact.

README gains "Consume in Claude Code": folder to answer in three commands, every
one of them run in this session. A test holds that the recipe invokes only
scripts this repository ships, at the paths it names.

Suite 1373 (1339 at the session baseline), ruff clean, mypy src clean. No
version bump, no tag, no push.

Co-Authored-By: Claude <claude-opus-5>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-08 15:32:32 +02:00
commit 171798ed32
5 changed files with 477 additions and 15 deletions

View file

@ -55,13 +55,18 @@ excerpt it rests on — `(bundle_id, concept_id)` and the excerpt's `sha256`.
**Name the document, do not merely point at it.** Each excerpt also carries
`title`, and — when the producer wrote them — `req_number`, the § 5.1 address
`sources`, and a locator into that address (`source_pages`, `source_sheet` with
`source_rows`, or `source_lines`). Quote those values as they stand; they are the
difference between "the bundle says X" and "X, from `<title>` `<req_number>`,
`<resource>` at `<locator>`". Absent keys are absent because the producer wrote
none — never because the source has none, and never something to fill in. An
excerpt carrying `sources_unreadable` has an address this reader could not
decode: say so rather than reporting no address.
`sources`, and **every key whose name begins with `source_`**. That last one is a
prefix and not a list: which locator a bundle uses is its producer's choice, so
one bundle locates by `source_pages`, another by `source_sheet` plus
`source_rows` or by `source_lines`, and another by a key this library never
writes, such as `source_element_id`. **Read the excerpt's own keys and cite
whichever ones are there** — do not look for a fixed set and report "no locator"
when the one present is simply named something else. Quote the values as they
stand; they are the difference between "the bundle says X" and "X, from
`<title>` `<req_number>`, `<resource>` at `<locator>`". Absent keys are absent
because the producer wrote none — never because the source has none, and never
something to fill in. An excerpt carrying `sources_unreadable` has an address
this reader could not decode: say so rather than reporting no address.
| Marking | Use when |
|---|---|

View file

@ -83,13 +83,18 @@ excerpt it rests on — `(bundle_id, concept_id)` and the excerpt's `sha256`.
**Name the document, do not merely point at it.** Each excerpt also carries
`title`, and — when the producer wrote them — `req_number`, the § 5.1 address
`sources`, and a locator into that address (`source_pages`, `source_sheet` with
`source_rows`, or `source_lines`). Quote those values as they stand; they are the
difference between "the bundle says X" and "X, from `<title>` `<req_number>`,
`<resource>` at `<locator>`". Absent keys are absent because the producer wrote
none — never because the source has none, and never something to fill in. An
excerpt carrying `sources_unreadable` has an address this reader could not
decode: say so rather than reporting no address.
`sources`, and **every key whose name begins with `source_`**. That last one is a
prefix and not a list: which locator a bundle uses is its producer's choice, so
one bundle locates by `source_pages`, another by `source_sheet` plus
`source_rows` or by `source_lines`, and another by a key this library never
writes, such as `source_element_id`. **Read the excerpt's own keys and cite
whichever ones are there** — do not look for a fixed set and report "no locator"
when the one present is simply named something else. Quote the values as they
stand; they are the difference between "the bundle says X" and "X, from
`<title>` `<req_number>`, `<resource>` at `<locator>`". Absent keys are absent
because the producer wrote none — never because the source has none, and never
something to fill in. An excerpt carrying `sources_unreadable` has an address
this reader could not decode: say so rather than reporting no address.
| Marking | Use when |
|---|---|