Skip to content

docs(guide/06): show a segmented answer, state the cost model, drop the template question - #27

Merged
ancsingabor merged 1 commit into
mainfrom
docs/guide-06-review
Sep 28, 2026
Merged

ancsingabor merged 1 commit into
mainfrom
docs/guide-06-review

Conversation

@ancsingabor

Copy link
Copy Markdown
Owner

Review of docs/guide/06-query-path.md. Five reader questions, and the restatement behind them.

1. The segment vocabulary had no example

claim, connective and quotation were defined in prose three separate times and shown zero times. The chapter now prints one:

{
  "language": "hu",
  "segments": [
    { "kind": "claim", "text": "A Katekizmus szerint Isten gondot visel minden teremtményére.", "citations": ["ccc:309"] },
    { "kind": "connective", "text": "A kérdés éppen ezért éles:" },
    { "kind": "quotation", "locator": "ccc:309", "text": "miért van mégis a rossz?" }
  ]
}

Built from verify.test.ts's own fixtures, and checked rather than eyeballed — the quoted span really is a byte-exact substring of the fixture unit, and the claim really cites a locator in context, so the example would pass the gate as written:

unit : A jó és rendezett világ Teremtője gondot visel minden teremtményére; miért van mégis a rossz?
quote: miért van mégis a rossz?
byte-exact substring of the unit -> True

The Hungarian is invented and the chapter says so, because an example using the real wording would be an example that shipped corpus text (ADR-003).

2. The cost model, which was nowhere

What a question costs. Two paid calls, in this order: one to embed the question, one to generate the answer. Both sit after the limiter and after the cache […] The model is called once: it returns the whole segmented answer in one response, because there is no chat and no agent loop.

So: yes, the question is embedded (that's the E participant in the diagram), and one round trip to the LLM, not two — the segments come back with the answer, not in a second pass. Also noted that an open-weights winner turns the embedding into our own compute rather than a bill, and is still work an attacker can make us do.

3. "There is no anonymous LLM endpoint to abuse" read as "so no guard needed"

Both are true at once, and the chapter never reconciled them. Review removes the abuse of consuming model output — nobody can use this as a free proxy, because the caller never sees the text. It does nothing about the cost of producing it. That argument existed only in architecture.md; it's now on the bullet that raises the question.

4. The gate table was incomplete and, in one row, vague

It omitted quotation_unknown_locator entirely, abbreviated two real codes into …_ratio, and resolved the proportionality row to "per ADR-017" instead of an outcome.

Replaced with what verify.ts implements, which is a sharper idea than the prose had:

Fabrication is fatal; disproportion is repaired. A span the source never wrote cannot be fixed by deleting it — it means the model invented text, and nothing else it said is trustworthy either. A quotation that is merely too long can be dropped, because "the answer's own prose carries the claim regardless" (verify.ts). That asymmetry is the whole design of repaired.

5. The template question

Why does the rate limiter fail closed here, when the template's failed open?

Unanswerable for anyone who has never seen the starter template — and this is the second template reference the review has pulled out of the guide. Replaced with one that stands alone: "The limiter's backing store is down. Does the next question go through?"

On the restatement you suspected — you were right

"The context is the whole universe" appeared three times in one chapter: a table row, a numbered point, and a Check-yourself. The numbered point is gone; the question form teaches it better and the table states the rule. A paragraph about which language goes where also went, because there is a whole section on ADR-014 four headings later.

Net effect: the chapter gained a worked example and a cost model and is still 149 prose lines, down from 153 at its widest.

Also

Dropped the State column from the code table (✅ built, unwired, 📐) — status outside status.md, the same pattern the code map lost in #24. The banner at the top of the chapter already says which parts exist.

Verification

  • Example JSON parses, and its quotation verified byte-exact against the fixture
  • All three Mermaid diagrams rendered
  • npm run docs:lint — clean
  • Chapter 06: 149 prose lines

🤖 Generated with Claude Code

…he template question

Five things a reader asked for, and the restatement they suspected.

**The segment vocabulary had no example.** `claim`, `connective` and
`quotation` were defined in prose three times over and shown once, never. The
chapter now prints a three-segment answer as JSON and annotates each kind. The
example is built from `verify.test.ts`'s own fixtures and checked: the quoted
span really is a byte-exact substring of the unit, and the claim really cites
a locator in context — it would pass the gate as written. The Hungarian is
invented, like the fixtures, and says so, because an example using the real
wording would be an example that shipped corpus text (ADR-003).

**The cost model was never stated.** Two paid calls per novel question — embed,
then generate — both after the limiter and after the cache, and exactly ONE
round trip to the model, since the segments come back in a single response.
Also noted that an open-weights winner turns the embedding into our compute
rather than a bill, and is still work an attacker can make us do.

**"There is no anonymous LLM endpoint to abuse" read as "so no guard needed".**
It removes the abuse of *consuming* output and nothing about the cost of
*producing* it, which is why the limiter is load-bearing anyway. That argument
was in `architecture.md` only.

**The gate table was incomplete and vague.** It omitted
`quotation_unknown_locator` entirely, abbreviated two real codes into
`…_ratio`, and resolved the proportionality row to "per ADR-017" rather than an
outcome. Replaced with the rule the code actually implements, which is sharper
than the prose was: **fabrication is fatal, disproportion is repaired.** A span
the source never wrote cannot be fixed by deletion; a quotation that is merely
too long can be dropped, because the answer's own prose carries the claim.

**Two removals for the restatement.** "The context is the whole universe"
appeared as a table row, a numbered point and a Check-yourself; the numbered
point went, since the question form teaches it better. A paragraph on which
language goes where went too — there is a whole section on ADR-014 four
headings later.

**The template question is replaced.** "Why does the rate limiter fail closed
here, when the template's failed open?" cannot be answered by a reader who has
never seen the template. Now: "The limiter's backing store is down. Does the
next question go through?"

Also dropped the State column from the code table — status outside status.md,
the same pattern the code map lost in #24. The banner at the top of the chapter
already says which parts are built.

Chapter 06: 149 prose lines. Diagrams rendered, example JSON parses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ancsingabor
ancsingabor merged commit 14c6252 into main Sep 28, 2026
2 checks passed
@ancsingabor
ancsingabor deleted the docs/guide-06-review branch September 28, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant