Skip to content

v3 V3-05: observe reach rungs from the response, never the request - #60

Merged
githubscum merged 3 commits into
mainfrom
lotor-lane/v3-05-reach-observe
Oct 22, 2026
Merged

githubscum merged 3 commits into
mainfrom
lotor-lane/v3-05-reach-observe

Conversation

@githubscum

@githubscum githubscum commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

V3-05: observe reach from what came back, not what was asked

WO: V3-05 of the Lotor v3 spec (granularity), the R4 rung for local Ollama models. Not core.
Spec sections: "The reach certificate", risk "Reach overclaimed", and the V3-01 measurement (2026-10-18) that found Ollama cloud models drop logprobs silently.

What it adds

  • src/reach/index.js: pure functions, no I/O.
    • observeRungs(body) reads a parsed Ollama /api/chat response and reports R0 (content), R1 (tool calls), R3 (reasoning, from the thinking field and/or <think> markers in content), R4 (logprobs). Logprobs are kept as count, min, mean and a sha256 digest; token text never leaves the function.
    • reachReport(request, body) pairs what was requested with what was observed and names the gap as silentlyDropped. An error body is loud, so it never counts as a silent drop.
  • test/reach-observe.test.js: 20 tests, synthetic fixtures (the 12 WO cases, the RUNG_ORDER guard, A-D from V3-05b, E-G from review).
  • test/core-classification.test.js: src/reach recorded as grantable, with the reason and the condition that moves it to core.

Tested

  • npm test: 1077/1077 green on the branch head after the review fixes (1074 before them).
  • The classification guard failed first on the new directory, as it should. The decision is recorded in the test, not guessed.
  • Probe: all 14 real response bodies from the V3-01 measurement run through reachReport. Every cloud body (glm-5.3-flash, minimax-m3) reports R4 in silentlyDropped. glm-5.3-flash with think off reports R3 from content-markers, the stray </think> leak. Local qwen2.5, llama3.1 and deepseek-r1 report R4 with 10 to 279 logprob entries. Error bodies report nothing observed and nothing dropped.

Evals

  • E1 (reach): serves it. This turns the V3-01 measurement into code a certificate can call. The two measured surprises are now test cases.
  • E6 (canary): partly. A planted ghp_ token in the logprobs does not appear in the serialized report.
  • E2 (chain fidelity): not yet. Nothing writes these reports to the chain; that is V3-02 (core, signing sitting).

What a reviewer should doubt

  1. requested still lists R0 (and R1 when tools are offered), but since V3-05b silentlyDropped counts only the capability rungs, R3 and R4. A tool-call response with empty content no longer reports R0 dropped (test A), and a text answer when tools were offered no longer reports R1 dropped (test B). Whether R0 belongs in requested at all is now cosmetic.
  2. Not wired to anything. No adapter calls Ollama yet and no receipt carries the report. This is the measuring half of V3-05; the capture half lands with V3-02.
  3. The <think> marker check is literal. Other reasoning tags (<reasoning>, model-specific channels) would be misfiled as R0. It is the only leak measured so far.
  4. R2, R5, R6 are absent from RUNG_ORDER on purpose: a chat response body cannot show them.
  5. Digest covers tokens and logprobs, not the bytes arrays. Two token strings that differ only in byte encoding would hash the same.
  6. think levels. Ollama accepts think: "low" | "medium" | "high" as well as true. Any truthy think now requests R3 (tests E, F). A truthy value outside those levels also counts; Ollama would reject it, so this errs toward reporting a drop.
  7. Malformed top_logprobs. A null element no longer throws; it hashes as null and its position is listed in logprobs.malformedTopLogprobs. R4 still depends only on each entry's own logprob (test G).

How it was made

Executor: glm-5.3-flash:cloud via Ollama, three sessions, session.model confirmed on the receipt chain (seqs 36123, 36129, 36139). One run stopped before writing tests; a follow-up WO finished them and added the error-body precedence fix. The orchestrator edited one test title (a garbled marker) and the classification entry.

🤖 Generated with Claude Code

githubscum and others added 3 commits October 18, 2026 20:38
src/reach reports which rungs (R0, R1, R3, R4) an Ollama chat response
actually carried, digests logprobs without keeping token text, and names
requested rungs that came back missing as silentlyDropped. Covers the two
V3-01 findings: cloud models drop logprobs silently, and think:false can
leak reasoning into content. src/reach is classified grantable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR #60 flagged its own doubt: requested always held R0 (and R1 when tools
were offered), so a pure tool call with empty content reported R0 as
"silently dropped", and a text answer with tools offered reported R1.
Neither is a drop: R0 and R1 are the model's behavior. Only R3 (think) and
R4 (logprobs) are switched on by the caller and can be withheld by the
runtime. requested is unchanged; silentlyDropped filters on the new
CAPABILITY_RUNGS constant.

Probe over the 14 V3-01 raw bodies: glm-5.3-flash think-true (tool call,
no content) no longer reports R0 dropped; every cloud body still reports
the silent R4 drop. 4 new tests, npm test 1074/1074.

Executor glm-5.3-flash (chain seq 36184); orchestrator ran the tests and
the probe, the executor's sandbox could not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…prob, null top_logprobs recorded

- reachReport: any truthy think (true, "low", "medium", "high") requests R3,
  so a withheld reasoning channel lands in silentlyDropped. Tests E, F.
- Test 6 changes only the first logprob by 0.001 and keeps its top_logprobs,
  so the digest shift is attributable to the logprob alone.
- canonicalTopLogprobs: a non-object element (null) hashes as null instead of
  throwing; logprobs.malformedTopLogprobs lists its { entry, index }. Test G.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@githubscum

Copy link
Copy Markdown
Owner Author

Review fixes pushed in 2a711ac.

  1. reachReport: any truthy think (true, "low", "medium", "high") now requests R3, so a withheld reasoning channel lands in silentlyDropped. Tests E and F; E fails on the previous head.
  2. Test 6 (digest tamper) now changes only the first entry's logprob by 0.001 and carries its top_logprobs over intact, so the digest shift is attributable to the logprob alone.
  3. canonicalTopLogprobs: a null (any non-object) inside top_logprobs hashes as null instead of throwing a TypeError, and logprobs.malformedTopLogprobs records each { entry, index }. Test G; it threw on the previous head.
  4. PR body refreshed: doubt 1 was stale since V3-05b (R0/R1 never count as dropped); test counts updated; doubts 6 and 7 added.

npm test: 1077/1077 pass on 2a711ac.

For the owner, not fixed here:

  • The GRANTABLE classification of src/reach in test/core-classification.test.js needs your affirmation. The lane recorded it; it is not decided until you say so.
  • The core-paths mirror (src/grant/core-paths.js, core) was not touched. Any change there for src/reach needs a signing sitting.

githubscum added a commit that referenced this pull request Oct 22, 2026
The KNOWN-LIMITS numbering test requires contiguous entries, so numbers
follow the merge order #65, #66, #64, #63, #60, #62, #61, #67, #68, #69,
#70, #71: #62 takes 75, #61 takes 76, this PR takes 77. Every citation on
this branch moves with it (KNOWN-LIMITS.md heading and the limit 53 note,
src/views/matcher-history.js header, test/matcher-history.test.js comment).

On this branch alone the numbering test reports 75 and 76 missing; that
clears once #62 and #61 are on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
githubscum added a commit that referenced this pull request Oct 22, 2026
The KNOWN-LIMITS numbering test requires contiguous entries, so numbers
follow the merge order #65, #66, #64, #63, #60, #62, #61, #67, #68, #69,
#70, #71: #62 takes 75, #61 takes 76, #67 takes 77, this PR takes 78.
Every citation on this branch moves with it: KNOWN-LIMITS.md heading,
CHANGELOG.md, docs/receipt-coverage.md, and the V3-03 proposal note. The
staged .patch carries no limit number and is unchanged.

On this branch alone the numbering test reports 75, 76 and 77 missing;
that clears once #62, #61 and #67 are on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
githubscum added a commit that referenced this pull request Oct 22, 2026
#60 (V3-05) creates src/reach/index.js for observeRungs and reachReport
and merges first, so this branch no longer claims that file. The
certificate module moves to src/reach/certificate.js unchanged apart from
its header, and every import follows it: src/ingest/index.js,
test/reach-certificate.test.js, and the staged session-start wiring in
proposals/v3-02-session-open-reach.patch (same line counts, so the hunk
headers stand; `git apply --check` passes on the committed blob, against
the working tree and the index). The proposal table names the new path
and notes that #60's GRANTABLE line for `reach` settles the
classification test once #60 is on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@githubscum
githubscum merged commit 83ee690 into main Oct 22, 2026
githubscum added a commit that referenced this pull request Oct 22, 2026
The KNOWN-LIMITS numbering test requires contiguous entries, so numbers
follow the merge order #65, #66, #64, #63, #60, #62, #61, #67, #68, #69,
this branch moves with it (KNOWN-LIMITS.md heading and the limit 53 note,
src/views/matcher-history.js header, test/matcher-history.test.js comment).

On this branch alone the numbering test reports 75 and 76 missing; that
clears once #62 and #61 are on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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