Skip to content

Recipe ergonomics v4: hydrated hybrid RRF, tool guidance, agent loop guards - #152

Merged
fazpu merged 2 commits into
mainfrom
feat/recipe-ergonomics-v4
Jul 27, 2026
Merged

Recipe ergonomics v4: hydrated hybrid RRF, tool guidance, agent loop guards#152
fazpu merged 2 commits into
mainfrom
feat/recipe-ergonomics-v4

Conversation

@fazpu

@fazpu fazpu commented Jul 27, 2026

Copy link
Copy Markdown
Member

Closes #149. Protocol RS-LoCoMo-Full-v3RS-LoCoMo-Full-v4.

Why

Live benchmark traces (2/8 run, 2026-07-27): the commodity agent called identity_as_of five times with identical arguments and died; called claims_verbatim eight times and exhausted its budget; never once chose claims_hybrid_rrf — whose envelope carried only claim UUIDs with no text; answered a WHEN-question without trying entity_timeline. Five of six remaining failures were agent-policy against an unhelpful tool surface.

What

  • claims_hybrid_rrf is now usable: new hydrate_claims primitive (query engine + executor dispatch + linter registration) appended to its chain — the envelope carries hydrated evidence text plus the RRF ranking. Same _confirm_claims currency path as claims_verbatim.
  • Chain-wide D48 honesty: the recipe's answer now reports the whole chain's dropped_by_hydration, not just the final step's (upstream drops were silently discarded with the intermediate envelopes).
  • When-to-use guidance on 8 recipe descriptions — stated honestly: no advertised "lexical" or "phrase-anchored" channels that don't exist. A real lexical channel is future work.
  • Agent loop guards in the answer prompt: never repeat identical tool+arguments; change arguments meaningfully or switch tools after a useless result; try a claims search before answering "Unknown".
  • Recipe version bumps on every changed row (seed-idempotent; ORDER BY version DESC rollout verified). Catalog pin recomputed twice — after Grok's changes and again after the honesty edits — final f0492ced…, derived, never guessed.
  • Design §2/§7 updated with a dated v3→v4 note; D78 amendment; phase-8 and analysis references current.

Process

Implemented by Grok from a written brief → Codex review (2 major, 4 minor — all reproduced with evidence, including recomputing the catalog hash independently) → Fable final review resolving all six findings with tests (drop accumulation across a chain; two-input hydrate lint rejection; honest-wording guidance assertions).

Validation

pyright 0 errors; 614 passed, 311 skipped; ruff clean. Break-then-restore proof on the hydration behaviour test.

Contributor agreement

fazpu and others added 2 commits July 27, 2026 10:25
…guards

Issue #149: claims_hybrid_rrf now ends with hydrate_claims so the envelope
carries claim text plus RRF ranking scores (not bare UUIDs). Descriptor
when-to-use sentences steer tool choice; recipe versions bumped for
ON CONFLICT DO NOTHING rollout. Answer-agent prompt forbids identical
tool+arguments retries and requires a claims search before Unknown.
Protocol RS-LoCoMo-Full-v3 → v4 with recomputed tool catalog hash.
…x findings)

Fable's final pass over the Grok implementation, resolving all six Codex
findings.

Major 1: the recipe's answer now carries the WHOLE chain's hydration drops.
The executor returned only the final step's envelope, so stale nominations
dropped by the search passes feeding fuse -> hydrate vanished from the
caller-visible denominator -- Codex reproduced two upstream drops reported as
zero. Accumulation lives in a pure _chain_answer helper with a direct test.

Major 2: the new tool-choice descriptions advertised channels that do not
exist -- "phrase-anchored" for a purely semantic search, "semantic+lexical"
for a chain that runs the same semantic search twice. Both descriptions now
state exactly what runs. The catalog pin is recomputed accordingly
(f0492ced...). A real lexical channel remains future work.

Minor 3: hydrate_claims now lints at exactly one input (new max_inputs cap in
the linter) and the executor refuses ambiguous inputs instead of silently
consuming the first -- a lint-clean chain runs exactly as written.

Minor 4: the loop guard no longer forbids legitimate query refinement --
"change the arguments meaningfully or switch tools" replaces the hard switch
instruction; the identical tool+arguments prohibition already prevents loops.

Minor 5: the two current v3 references in locomo_benchmark_analysis.md now
say v4.

Minor 6: the hydration tests asserted set-equality on pre-ordered zero-drop
mocks; the new tests exercise drop accumulation across a chain and the
two-input lint rejection. Grok's guidance test now asserts the honest wording.

Validation: pyright 0 errors, 614 passed, 311 skipped, ruff clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GKENhTLJg1HqhbdwCmmkbc
@github-actions

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/rememberstack/core
  recipe_linter.py 113
  src/rememberstack/surfaces
  query_engine.py
  recipe_executor.py 72, 111, 131, 144, 150
Project Total  

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

@fazpu
fazpu merged commit 0c1d1f2 into main Jul 27, 2026
6 checks passed
@fazpu
fazpu deleted the feat/recipe-ergonomics-v4 branch July 27, 2026 08:50
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.

Recipe ergonomics for commodity agents: hybrid RRF returns unhydrated ids; descriptors lack when-to-use guidance

1 participant