test(memory): inventory guard for the protocol-mandated update_memory_md tool - #4631
test(memory): inventory guard for the protocol-mandated update_memory_md tool#4631M3gA-Mind wants to merge 1 commit into
Conversation
…is registered The memory read→dedupe→write→update-index protocol appends a "call update_memory_md" reminder after every durable write and only that tool can close the cycle (MemoryOp::IndexUpdate). If it is missing from the production registry the model hits a permanent, unsatisfiable nag loop. Registration, atomic+locked writes, and remember_preference/save_preference classification already landed on main; the missing piece from tinyhumansai#4458 was an inventory assertion. Name the mandated tool via a MEMORY_INDEX_UPDATE_TOOL constant (used by classify_memory_op) and add a test that builds all_tools and asserts the constant is registered, so a mandated tool absent from the registry fails a test instead of production.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA new public constant ChangesMemory Index-Update Tool Constant
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Poem
Comment |
Closes #4458
On current
main, the substantive parts of #4458 are already in place:UpdateMemoryMdToolis registered inall_tools_with_runtime, its write is atomic (temp-file + rename) and serialized behind a per-workspace async lock + inter-process flock, andremember_preference/save_preferenceare an explicitMemoryOp::Otherarm. The one remaining gap from the fix plan was the registry inventory assertion.This adds a
MEMORY_INDEX_UPDATE_TOOLconstant inmemory_protocol.rs(the single nameclassify_memory_opmatches on) and a test that builds the realall_toolsregistry and asserts the protocol-mandated tool is registered. If the protocol ever mandates a tool that isn't in the registry, this test fails instead of the model hitting a permanent unsatisfiable "call update_memory_md" nag loop in production.Summary by CodeRabbit