Skip to content

Add the frontier confirmer: lsp.live checks grep.live's top-k hops (K26-1) - #197

Merged
nevermemo merged 5 commits into
mainfrom
feat/k26-1-frontier-confirm
Oct 22, 2026
Merged

nevermemo merged 5 commits into
mainfrom
feat/k26-1-frontier-confirm

Conversation

@nevermemo

Copy link
Copy Markdown
Owner

The engine half of roadmap row K26 (G1): grep.live proposes and lsp.live confirms the top-k frontier. This PR is lci-maps only. Nothing calls it until K26-2 adds the [run_profile.walk] confirm key and the app wiring, so no answer, golden or handle changes.

  • Where it runs. traverse/confirm.rs adds FrontierConfirmer, Proposal, Verdict and Confirmation. The hook in expand runs after the gate and the beam, before the reranker frontier.

  • What is proposed. Kept hops whose only witnesses are grep.live text proposals with a site, in hop-value order and cut at the call's top_k. They go to the confirmer in one call.

  • Verdicts:

    • Confirmed: the hop gets the witness Lsp and its confidence rises to at least 90.
    • Refuted: the hop is dropped, and it still corroborates at 0.
    • Unknown: the hop is unchanged (fail-open); a walk never ends on the confirmer.
  • Call charging. The confirmer reports the calls it used. The engine clamps that to the pop's remaining max_external_calls and charges it to the pop.

    • A call cut by the deadline is charged min(max_calls, proposals), because what it made is unknown.
    • A deadline cut counts as unknown, not as a failure, and the event says failed: "deadline".
  • Reporting. Totals confirm_* and confirm_ms, the expand event's confirm field, and start.confirm.

  • Handles. A handle records confirm {top_k, identity} only when the confirmer is on, so a default handle's bytes and hash are unchanged. A resume under the other value is refused.

  • The lsp.live confirmer. LspLive::confirmer sends definition at each site:

    • the answer is the source symbol: confirmed;
    • another node: refuted;
    • nothing or an error: unknown.

    It records nothing in the map's cost log, so hop pricing does not move.

Tests (7) cover:

  • a confirmed mention and a refuted one;
  • unknown and failed calls;
  • the top_k and call caps;
  • compiler- and lsp-witnessed hops never being proposed;
  • the handle check;
  • the lsp.live confirmer over a fake backend.

Eight mutations each fail a test.

Checks:

  • cargo test -p lci-maps with the traverse:: and lsp_live:: filters: 261 passed.
  • Unit, clippy -D warnings and fmt.

Narrow slice, so per d520 CI's test (windows-latest) is the Full gate. A Fable review runs alongside.

🤖 Generated with Claude Code

nevermemo and others added 5 commits October 22, 2026 13:55
…26-1)

The engine half of K26 (G1), unreachable until K26-2 wires a key: after
the gate and the beam, and before the reranker frontier, the kept hops
whose only witnesses are grep.live text proposals with a site are taken
in hop-value order, cut at the call's top_k, and sent in one call to a
FrontierConfirmer:
- Confirmed (the definition at the site is the source node): the hop
  keeps its value, its witness becomes Lsp and conf rises to at least 90.
- Refuted (a definition that is another node): the hop is dropped and
  still corroborates at 0.
- Unknown (no answer, an error, the deadline, the call cap): unchanged,
  fail-open; a walk never ends on the confirmer.
Calls: the confirmer reports what it used (Confirmation { verdicts,
calls }); the engine clamps it to the pop's remaining external calls and
charges it there. Totals confirm_*, confirm_ms, the expand event's
confirm field, start.confirm; a handle records the setting only when it
is on (a default handle's bytes and hash are unchanged), and a resume
under the other value is refused. LspLive::confirmer asks definition at
each site.

Tests (7): a confirmed mention, a refuted one, unknown and failed calls,
the top_k and call caps, compiler- and lsp-witnessed hops never proposed,
the handle check, and the lsp.live confirmer over a fake backend. Eight
mutations (relabel, refuted kept, no top_k, no clamp, verdict count,
witness filters, the confirmer's cap) each fail a test.

Checks: lci-maps traverse:: and lsp_live:: 261, Unit, clippy -D
warnings, fmt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k test

- The lsp.live confirmer refutes only when an answered place is held by a
  different symbol. An answer that only its file can hold (an import or
  re-export line, a symbol the index lacks, an id-scheme mismatch) is
  Unknown, not Refuted; a file node as the source is confirmed by a
  place in that file.
- confirm.rs doc: relabel changes the witness, the grep.live offer, the
  witness list and the confidences, not the claims, so corroboration
  grouping still reads a mentions claim, and fusion and the hop value are
  computed before the hook (K26-2 decides the grouping).
- The deadline case runs on a paused tokio clock with a 60 s walk
  deadline instead of a real 100 ms wait.

Tests: an_answer_only_the_file_holds_is_unknown_not_refuted (5 cases),
a_confirmer_the_deadline_cuts_changes_nothing; two mutations fail the
new test. lci-maps traverse:: and lsp_live:: 263, Unit, clippy -D
warnings, fmt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nevermemo
nevermemo merged commit a1fe140 into main Oct 22, 2026
8 checks passed
@nevermemo
nevermemo deleted the feat/k26-1-frontier-confirm branch October 23, 2026 21:36
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