Skip to content

feat(retrieval): agent surface Batch D — multi_hop_context connection recipe - #200

Merged
fazpu merged 1 commit into
mainfrom
feat/retrieval-batch-d
Aug 3, 2026
Merged

feat(retrieval): agent surface Batch D — multi_hop_context connection recipe#200
fazpu merged 1 commit into
mainfrom
feat/retrieval-batch-d

Conversation

@fazpu

@fazpu fazpu commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

Batch D of the agent retrieval surface wave, implemented against the merged binding design (#196, plan/designs/agent_retrieval_surface_design.md §3.3):

  • multi_hop_context — one-call connection context as a compound engine op (the design explicitly rejects multi-step recipe-chain composition): principle-9 T0 resolution on both entity params (EntityCandidate + BOUNDARY on ambiguity, unknown_entity on failure) → graph_path (two entities) or bounded graph_neighborhood (one) with the hops bound and top-N=k edge fan-out → one batched SQL statement re-confirms every nominated edge and hydrates two-stance source-diverse evidence with exact per-stance totals (D48 current-testimony + lineage-liveness, fail-closed) → question-context retrieval unioned in, deduplicated by id.
  • Flat Grain.EVIDENCE envelope: top-level evidence[] + chunks[] + paths[]/edges[], fact_evidence[] mapping edge relation ids to backing claims, evidence_totals[] exact. RecipeAnswerIntent.ASSERTION_HISTORY.
  • GraphEdge D54 marker: support: FactSupport = CURRENT (model addition, default keeps stored envelopes parsing) — withdrawn-support edges are kept and flagged, never silently dropped; ordinary structurally unsupported projection edges are not blanket-kept beyond what D54 requires.
  • Hard 60-record claim/chunk budget, edges backed first (rank-0 coverage = 30 edges × 2 stances ≤ 60, so no ordinary edge starves), then deduplicated question context fills the rest — disclosed in the descriptor, which also instructs that edges are structure and quotable answers come from evidence[]. Typed no-path negative; resolution negatives take precedence. Linter grain registration; catalog hash rolled with no protocol key bump; no benchmark-specific logic; no migration.

Review trail

  • Implemented by Codex (gpt-5.6-sol, xhigh) from the design as spec; the run was externally stopped at the final reporting stage with all deliverables complete and zero ambiguities in the transcript.
  • My review: line-by-line §3.3 fidelity; fixed 5 Pyright errors the stopped run hadn't reached (Sequence annotation + test kwargs typing); full DB-backed suite 169 passed, 0 skipped, pyright 0 errors, ruff clean.
  • Grok (grok-4.5) adversarial review: APPROVE WITH NOTES — D54/D48/budget/dedup/negative-precedence angles all verified; non-blocking follow-ups noted (same-entity policy, partial-resolution honesty, two extra negative-path tests).

Test plan

  • Full DB-backed suite — 169 passed, 0 skipped (16 new Batch D proofs: two-entity path both stances + exact totals, neighborhood form, hops bound, D54 withdrawn kept+flagged, D48 tombstone exclusion, ambiguity/unknown negatives, no-path negative, dedup, stored-envelope compat)

  • uv run pyright src/ benchmarks/ — 0 errors

  • ruff format --check / ruff check — clean

  • I have read and agree to the RememberStack Contributor License Agreement v1.0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GKENhTLJg1HqhbdwCmmkbc

Design §3.3: one-call connection context — principle-9 resolution on
both entity params, graph_path/graph_neighborhood traversal with the
hops bound, batched two-stance D48 edge-evidence hydration with exact
totals, question-context union deduplicated by id, flat EVIDENCE-grain
envelope with top-level paths/edges, GraphEdge D54 withdrawn-support
marker (kept and flagged, never silently dropped), ASSERTION_HISTORY
intent, catalog hash roll with no protocol key bump.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GKENhTLJg1HqhbdwCmmkbc
@fazpu
fazpu enabled auto-merge (squash) August 3, 2026 13:35
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/rememberstack/model
  envelope.py
  src/rememberstack/spine
  recipes.py
  src/rememberstack/surfaces
  graph_queries.py 107-108
  query_engine.py 679, 736, 817, 825, 862
  recipe_executor.py 108, 110, 113, 122
Project Total  

This report was generated by python-coverage-comment-action

@fazpu
fazpu merged commit 2b5abca into main Aug 3, 2026
7 of 8 checks passed
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