Skip to content

Scenario 6: entity-types block never reaches the prompt despite successful schema retrieval (dynamic_ctx_len=0 with count=1) #1922

Closed as not planned

Description

@malibio

Split out of #1917 (checkpoints 8-9) — genuinely separate scope from the 8a/8c/8e retrieval-merge work also in that issue: distinct mechanism, distinct call path, needs its own fix-and-verify cycle.

What happens

Agent-matrix scenario 6 ("The 2400 one came back — set it to returned", following schema + instance creation in the same chat) fails deterministically: the model asks the user for a literal node ID instead of calling resolve_query, e.g.:

"I need the ID of the laser cutter you are referring to in order to update its status. Could you please provide it?"

resolve_query IS offered as a tool (confirmed via agent_loop's own tool_names= log line), but its required parameter (node_type) has nothing to resolve against: the RELEVANT ENTITY TYPES block never appears anywhere in the prompt for this turn.

Root cause, confirmed directly (not inferred)

Traced through every step of the pipeline with direct log instrumentation, ruling out three hypotheses before finding the real one:

  1. NOT a history-blending gap. context_ops::build_retrieval_query's 2-turn blend produces the correct query, containing "equipment" implicitly via the surrounding turns.
  2. NOT a retrieval failure. Directly captured context_ops.rs's own debug log:
    workspace_context: semantic schema retrieval count=1 query="Log a laser cutter checked out on the 12th, replacement cost 2400\nYou have logged a laser cutter with a replacement cost of 2400.\nThe 2400 one came back — set it to returned"
    
    One schema (the just-created equipment type) IS retrieved.
  3. NOT a formatting bug. Read WorkspaceContext::format_for_prompt (context_ops.rs:380) end to end — renders the header whenever relevant_schemas is non-empty, well under its 4000-char budget for one schema. No bug found on inspection.
  4. NOT an ordering/race issue between set_session_context and the read. local_agent_service.rs's run_ai_chat_turn computes ctx, awaits create_session, then awaits set_session_context with the same returned session_id, sequentially, before send_message is called. No race.

Added a temporary diagnostic log at the actual read point (agent_loop.rs:775, where tools_with_available_guidance consumes session.dynamic_context) and confirmed directly:

dynamic_ctx_len=0

So: retrieval succeeds (count=1), formatting should produce a non-empty string, but session.dynamic_context is empty at the point the guidance gate reads it, in the same turn. Every individual link in the chain looks correct on inspection; the break is somewhere in composition, not in any single function traced so far. (Diagnostic log has been reverted — not left in the codebase.)

Reproduction

turn 1: "I want to keep a record of the equipment my team checks out, whether it's been returned, and what each item costs to replace"  -> create_schema
turn 2: "Log a laser cutter checked out on the 12th, replacement cost 2400"  -> create_node
turn 3: "The 2400 one came back — set it to returned"  -> FAILS: asks for a literal ID instead of calling resolve_query

Fails 0/3 in every arm measured in #1917 (main, concat, dual, append-only) — untouched by any of that issue's retrieval-merge changes, confirming this is a wholly separate mechanism.

Suggested next step

The next concrete, untested link: verify whether ctx (the Result<String, ()> computed in local_agent_service.rs::run_ai_chat_turn) is actually Ok with non-empty content at the point if let Ok(ctx_str) = ctx { service.set_session_context(...) } runs — i.e. confirm the value going INTO set_session_context, not just the formatting logic in isolation. If that is also non-empty, the gap is inside set_session_context/AgentSession storage itself (an Arc/lock/session-id mismatch) rather than upstream.

Acceptance criteria

Reference

Activity

  1. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Correction and tightening of the root-cause finding, with a self-caught measurement error along the way

    Continued investigating after filing. One important correction to how I verify this kind of finding going forward, plus a materially tighter confirmed defect.

    A measurement error I caught and want on record

    Re-ran the diagnostic with the write-side (local_agent_service.rs, right before set_session_context) and read-side (agent_loop.rs:775) instrumented simultaneously. First pass appeared to show ctx_len=163 at write and dynamic_ctx_len2=163 at read — i.e. looked like the bug didn't reproduce. That was wrong: I was matching log lines positionally, and a stale line from an earlier turn in the same reused daemon log file got attributed to the wrong turn. Re-checked by matching on session_id explicitly (added it to both diagnostic lines) rather than trusting occurrence order, and got the real answer.

    Confirmed, with session_id matched precisely across both diagnostic points in one clean run

    turn 1 (session a9a2112b...): ctx_len=0     (no schemas exist yet — correct)
    turn 2 (session e52ea542...): ctx_len=163   (schema just created — correct)
    turn 3 (session d58c2745...): ctx_len=163 AT WRITE, dynamic_ctx_len2=0 AT READ — same session_id, same turn
    

    This is tighter than the original finding. It is not "the context is empty" in general — turns 1 and 2 both round-trip correctly (write and implied read consistent). It is specifically: on the turn scenario 6 exercises, set_session_context is called with 163 non-empty chars for session d58c2745, and the SAME session_id reads back empty moments later in the same turn. Write succeeds, read of the identical id in the identical turn does not see it.

    What I ruled out this pass, with evidence

    • Not an Arc cloning issue. AgentService = Arc<LocalAgentService<...>> — get_service().clone() clones the Arc, not the underlying sessions: RwLock<HashMap>. Same shared state throughout.
    • Not an ordering/spawn race in the obvious place. run_ai_chat_turn itself runs inside one tokio::spawn (its caller), but within that task, ctx compute → create_session → set_session_context → send_message are all sequentially .awaited with no nested spawn in between.
    • set_session_context's own body (sessions.write().await; get_mut(session_id)) is trivially correct if the id matches — and I've now confirmed the id DOES match between write and read.

    Where this leaves it

    I do not have a confirmed mechanism for how the same session_id's write is invisible to a same-turn read a few hundred milliseconds later, only turns 1/2/3's session-scoped behavior working differently despite structurally identical code paths. My best remaining unverified guess: something about send_message's sessions.remove(session_id) / re-insert pattern (agent_loop.rs "Take session out for mutation, put it back after") interacting with a second concurrent turn or a retry for the same node — I have not checked whether scenario 6 legitimately runs as a single run_ai_chat_turn invocation or whether something (a duplicate trigger, a retried send) creates two. That's the next concrete thing to check, and I did not get to it.

    All diagnostic instrumentation added this pass has been reverted; tree is clean; no fix attempted. This updates the issue's evidence with a more precise, correctly-attributed reproduction, and flags the risk of session-log misattribution for whoever continues — match on session_id, not log-line order, when correlating write/read diagnostics in this codebase, especially across a reused daemon process serving multiple turns.

  2. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Final correction: the plumbing is NOT broken. Both prior findings (checkpoints on #1917, and my first comment here) were measurement artifacts. This is a prompt-following failure, not a data-loss bug.

    Ran the write-side and read-side diagnostics together, in one build, correlated by session_id, closing the gap the previous two attempts each left open (the first mismatched log lines from a reused daemon file; the second still hadn't run write+read in the same build).

    Result: write and read agree, every turn, including scenario 6's

    WRITE: session 5d1093c4... found_in_map=true  context_len=163
    READ : session 5d1093c4... dynamic_ctx_is_some=true  dynamic_ctx_len=163
    

    Same value, same session, correctly propagated. The RELEVANT ENTITY TYPES block — 163 chars, the equipment schema — reaches session.dynamic_context and is present exactly where tools_with_available_guidance reads it. resolve_query's reachability gate is satisfied correctly. This directly contradicts my two earlier len=0 findings on this issue, both now understood as self-inflicted measurement error (the first: stale log-line misattribution across turns in a reused daemon process; not fully isolated the second time either, since I hadn't yet run both diagnostics in the same build/session simultaneously).

    And the model still asked for a literal ID anyway. Same failure, same reproduction, but now with confirmed-correct inputs.

    What this actually is

    Not a context-plumbing bug. resolve_query is offered, its node_type parameter is answerable (a real entity type is listed), the tool description already covers this exact case ("" — a bare value, no field named — is its own lead example), and Graph Editing's skill instructions already say to call it for this shape of request. The model has everything it needs and doesn't use it. This is a genuine model-behavior / prompt-following gap (ADR-064 rule 2 territory — tool selection), not a rule-4 or rule-3 problem, and not a data bug at all.

    Retracting the fix direction this issue originally suggested

    The "verify ctx's value going into set_session_context" step from the original filing is now answered: it's correct, and always was on the turns that matter. Recommend closing the "reachability gate" framing of this issue and re-scoping to: why does the model, given a correctly-populated entity-types block and an on-point tool description, still default to asking the user for an ID instead of calling resolve_query? That is closer to the guidance-ordering hypothesis I tried first (checkpoint on #1917) and abandoned after one inconclusive rep — worth a properly repeated (3+) trial rather than the single rep I gave it, now that the "maybe it's actually a plumbing bug" distraction is closed out.

    All diagnostic instrumentation reverted across every attempt on this issue. Tree clean. No fix implemented; main unmodified.

  3. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Guidance-ordering hypothesis properly refuted: 3/3 reps, deterministic failure, reverted

    Followed through on the recommendation from my previous comment — ran the guidance reorder (INDIRECT TARGET moved first, explicit "never ask the user for an ID" clause added) as a real 3-rep trial this time, not the single inconclusive rep from the earlier attempt on #1917.

    rep 1: "I need the ID of the laser cutter you are referring to..."
    rep 2: "I need a node ID to mark the item as returned. Could you provide me with an ID..."
    rep 3: "I need a node ID to mark the item as returned. Could you provide me with an ID..."
    

    3/3, deterministic. Guidance ordering is not the mechanism. Reverted; tree confirmed clean; main unmodified.

    Where this leaves scenario 6

    Two structural fixes now properly ruled out with real evidence:

    1. Reachability/plumbing — refuted (previous comment): the entity-types block correctly reaches the model with the right schema listed.
    2. Guidance ordering/explicitness — refuted (this comment): reordering and strengthening the instruction text made no difference across 3 reps.

    The tool is offered, correctly described, backed by correct context, and instructed to be used for exactly this phrasing — and the model still doesn't call it. This has moved from "looks like a plumbing bug" to "looks like a genuine model-capability/attention limit on this locked model" (gemma-4-e4b-q4km), which is a different class of problem than anything else fixed in this cluster so far (#1846-#1904's fixes were all either plumbing bugs or retrieval/description issues, not "the model ignores correct, present instructions").

    Consistent with #1917's own explicit out-of-scope note: fine-tuning is deferred until remaining failures are shown to be judgment/comprehension failures rather than delivery/architecture failures. This may be the first scenario in the whole cluster where that condition is actually met — worth flagging explicitly rather than continuing to chase prompt-level fixes for it.

  4. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Fresh angle: scenario 6 is TWO defects, not one. Found and fixed a real code bug; sharpened the remaining model-behavior failure to a single reproducible variable (conversation history), which no prompt-channel fix moved across 12 reps.

    Dispatched to find a new angle before accepting "model-capability boundary". Result: the capability conclusion is partly wrong — the model is more capable here than this issue has been assuming — and there is a genuine, deterministic, code-level bug in the path it takes. Fixed and verified 3/3. The prompt-following half remains unfixed but is now characterized far more tightly than "the model ignores correct instructions".

    All runs: isolated daemon, NODESPACE_HOME=/tmp/nodespaced-test, served_db_path verified inside the temp dir before every run, release build rebuilt after every source change, gemma-4-e4b-q4km, granted_n_ctx=32768.


    The observation that reframes this issue

    I dumped the full verbatim turn-6 prompt (temporary NS_PROMPT_DUMP_DIR hook in nlp-engine/src/chat/mod.rs, since the existing debug line truncates at 200 chars — instrumentation has been reverted) and then ran the same user message with history varied.

    Identical user message, identical DB, identical tool surface, identical guidance:

    history = NONE (fresh chat, schema+node already in DB):
      rep1  [tool] search_nodes   -> acts
      rep2  [tool] search_nodes   -> acts
      rep3  [tool] search_nodes   -> acts
    
    history = the scenario chain (t3,t4,t5):
      rep1  asks for an ID
      rep2  asks for an ID
      rep3  asks for an ID
    

    With no history the model does act on "The 2400 one came back — set it to returned". It correctly infers that "2400" means replacement_cost and emits:

    {"filters":[{"operator":"equals","property":"replacement_cost","value":2400}],"node_type":"equipment_item"}

    That is a semantically perfect resolution of the indirect reference. So "the model cannot resolve 'the 2400 one'" is refuted — it resolves it correctly and unprompted. It picks search_nodes rather than resolve_query, but it acts.

    Defect 1 (FIXED, verified 3/3): that perfect filter was rejected by our own deserializer

    Tool executed tool=search_nodes is_error=true
      args_preview={"filters":[{"operator":"equals","property":"replacement_cost","value":2400}],"node_type":"equipment_item"}
      result_preview={"error":"invalid arguments for tool search_nodes: missing field `type`"}
    

    AgentFilterItem::filter_type (packages/core/src/ops/query_ops.rs) was a required String. The model had done all the hard work — which property, which operator, which value, which node_type — and the call was thrown away for omitting the boilerplate discriminator "type":"property", which is fully derivable from the fields already present.

    Made type optional and inferred (relationship_type/node_id → relationship; property → property; nothing to infer from → still errors, so content vs metadata is never guessed). Explicit type always wins.

    Verified end-to-end, 3 independent reps, each on a freshly purged database:

    === INDEPENDENT REP 1 (purged DB) ===
      t6 [tool] search_nodes
      t6 [tool] update_node
      t6 assistant> The equipment item with a replacement cost of 2400 has been updated.
    === INDEPENDENT REP 2 (purged DB) ===   (identical)
    === INDEPENDENT REP 3 (purged DB) ===   (identical)
    

    Before the fix that same probe was search_nodes [ERROR] → "I'm sorry, I couldn't find the equipment item…" 3/3. The turn goes from a hard failure to a correct, completed update. 4 new unit tests; cargo test -p nodespace-core --lib 1118 passed, -p nodespace-agent --lib 425 passed.

    This is worth having regardless of scenario 6 — it silently breaks any turn where the model omits a derivable discriminator, and the failure surfaces to the user as "I couldn't find it" rather than as a malformed call.

    Defect 2 (NOT fixed): with history present, the model stops acting. Four prompt-channel fixes, 12 reps, zero movement.

    The filter fix does not rescue the full scenario 6 chain — still 3/3 asking for an ID. I attempted four distinct interventions, each a proper 3-rep trial, each reverted after failing:

    Fix A — competing skill imperative. Node Creation's guidance opens with ⚡ IMMEDIATE ACTION REQUIRED: Call create_node NOW … your response to receiving these instructions must be the create_node tool call and You received this instruction because this skill was matched to the request. Your NEXT action MUST be create_node. Node Creation is routed as candidate 3 on turn 6 (an update turn), so this asserts a false premise and directly contradicts the wrapper's "Use whichever applies and IGNORE the rest". Two candidates issuing mutually-exclusive absolute imperatives is a real prompt defect. Made it conditional ("APPLIES WHEN: the user is adding a record that does not exist yet… if they are referring to a record already stored, this does NOT apply"). 3/3 fail. Reverted.

    Fix B — the node id is already in the prompt and the model still asks for it. The rebuilt history injects:

    <|turn>system
    Record of graph writes already completed in the previous turn. These are done — do not repeat them:
    - create_node "Laser Cutter Checkout Log Entry" -> nodespace://894f79de-14fd-4926-9cf8-60eefdb11ea1
    

    The exact id is verbatim in context, and the model answers "I need the ID". The framing is purely negative (a receipt for work not to repeat), so I reframed it to also present the ids as usable handles: "Each id below is a node that exists now: if the user's next message refers to one of these records, you already have its id — use it, do not ask the user for one." 3/3 fail — still asks for an id that is directly in front of it, explicitly labelled as usable. Reverted.

    Fix C — tool-description carve-out (hypothesis 2 from the brief, from the other side). search_nodes claims to be "the single tool for querying the graph" and "the right tool whenever the user wants to see or act on typed data" — which directly contradicts resolve_query's carve-out. Added an explicit NOT-for-this exclusion to search_nodes pointing at resolve_query, plus a clause on resolve_query covering the referred-from-earlier-conversation shape including "never ask the user to supply a node id, and never answer that you need one". 3/3 fail. Reverted. (Worded to teach the shape, not the literal — quoting "the 2400 one" would have tripped guidance_is_not_contaminated_by_eval_prompts and been exactly the memorized-example degenerate solution that guard exists to prevent.)

    Fix D — turn-5 zero-result priming. Turn 5 ends with the model asserting "I couldn't find any equipment items currently logged in the system", and Graph Editing's AMBIGUITY rule says 0 results → ask a clarifying question. Plausible that turn 5 primes the refusal. Removed turn 5 entirely: 3/3 fail. Refuted.

    Narrowing the remaining defect: ONE prior turn is enough

    history = turn 4 ONLY (a single create_node turn), then turn 6:
      rep1  "I need to know which node you are referring to when you say "the 2400 one" and what type of record it is…"
      rep2  "…and what the specific status field is for that equipment item. Could you confirm if there's a 'status' property I should update?"
      rep3  (same as rep2)
    

    A single prior turn flips acting → refusing, 3/3. So it is not accumulation, not turn 5, and not the write-record wording.

    One tempting sub-hypothesis, tested and refuted. Reps 2/3 above blame a missing status field — and indeed turn 3's create_schema stores only replacement_cost:

    args_preview={"fields":[{"name":"replacement_cost","type":"number"}],"name":"Equipment Item"}
    

    so "set it to returned" genuinely has no target property, despite the fixture's comment requiring "checked-out vs returned" to be implied by turn 3. I re-ran the chain with a turn-3 prompt that forces the field ("Each item needs a status that is either checked_out or returned…"), confirmed create_schema [fields=2], and turn 6 still failed 3/3. The status-field complaint is post-hoc rationalization in the model's prose, not the mechanism. Worth noting separately though: the schema-underspecification is real and makes scenario 6 partly unwinnable-by-construction on its own terms.

    Regression spot-check (required by the brief) — and a caution about reading it

    Ran s3 / 8a / 8b / 8c / 8e on my build and on stock main, both from a purged DB. They are identical, including the failures:

    ### STOCK BUILD (main, db708a90), purged DB ###
     s3:   [tool] create_schema [fields=1] ; [tool] create_schema [ERROR]
     s8a:  [tool] create_node [fields=0]        <- expects create_schema
     s8b:  [tool] create_schema [fields=1]
     s8c:  [tool] create_node [fields=0]
     s8e:  (no tool call)                        <- expects search_nodes
    

    No regression from my change — these are pre-existing standing failures, consistent with the corrected ~6-7/12 baseline rather than 10/12. Flagging explicitly because someone reading only the post-change run would mis-attribute s8a/s8e to this diff.

    Where I land on "is this a model-capability boundary?"

    Not in the way this issue currently frames it, and the framing should be corrected before it hardens into doctrine.

    • The model can resolve "the 2400 one" — demonstrated 3/3, unprompted, with a correct property inference. The prior conclusion ("the model has everything it needs and doesn't use it") was measured only through a path that had a hard tool error in it, so the model's actual competence was masked by Defect 1.
    • What it will not do is act once conversation history is present, and that is invariant to every prompt channel available: skill guidance (this issue's earlier 3-rep reorder trial, plus my Fix A), tool descriptions (Fix C), injected system-role facts (Fix B), and history composition (Fix D). That is 5 independent 3-rep trials across 4 different delivery channels, all null.
    • Turn 6's prompt is 8,322 tokens in a 32,768 window — not window exhaustion, but ~8k of boilerplate wrapped around a 10-word request. That is the same dilution regime as the project's own resident-prompt ablation finding (10,493-char prompt scored 50% vs 73% for a 445-char one on cases targeting its own rules). I'd treat prompt-mass reduction as the next hypothesis, not more prompt text — every intervention that added words failed, which is itself a consistent signal.

    So: a capability/attention limit is a defensible reading of Defect 2 specifically, but it should be recorded as "adding instructions does not move this, and the prompt is ~8k tokens of mostly-boilerplate" rather than "the model cannot do this" — because the isolated probe shows it can.

    Tree state

    Uncommitted, not committed per the brief. Only the verified filter-inference fix remains; every failed experiment and all diagnostic instrumentation reverted.

     M packages/agent/src/local_agent/tools.rs   (1 line: call-site now passes Some("content"))
     M packages/core/src/ops/query_ops.rs        (optional+inferred filter type, 4 new tests)
    

    Gate on a full matrix run before committing, as the standing rule requires. Suggest also re-scoping this issue's title/body — "entity-types block never reaches the prompt" was retracted two comments ago and the remaining defect is neither that nor purely a capability limit.

  5. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Main session: subagent's filter_type fix verified against real source + full matrix gate — real bug, zero regressions, does not move THIS scenario's matrix score

    Verified the subagent's report (rule 2 — checked claims against source, not taken at face value):

    • git diff --stat: exactly the 2 files claimed (tools.rs 1 line, query_ops.rs +99/-5)
    • Read the full diff directly — sound, minimal, well-reasoned (optional filter_type with inference from property/relationship_type/node_id presence, explicit type still wins, genuinely-unspecified filters still correctly error)
    • cargo test -p nodespace-core --lib query_ops: 16/16 pass, including the 4 new tests

    Full 3-rep matrix gate run (purged DB, daemon rebuilt, served_db_path verified each run, e4b/32768/17.2GB — same conditions as every other gate this session):

    main (unmodified) : 7, 8, 8  mean 7.67
    with filter_type fix: 7, 8, 8  mean 7.67
    

    Byte-identical per-scenario results, including scenario 6 itself (0/3 both). Zero regressions — this confirms the subagent's own regression spot-check (8a/8e failing identically on stock main) at full-matrix rigor, not just their 1-2 rep sanity check.

    Why scenario 6 doesn't move: checked toolsCalled directly — all 3 filter_type-arm runs show tools: [] for scenario 6, same as main. The model never calls resolve_query in this specific matrix conversation chain, so the filter_type deserialization fix — which only matters after resolve_query runs — never gets exercised here. This is exactly consistent with the subagent's own finding: Defect 2 (something about this conversation's prior turns flips the model from acting to refusing) gates upstream of where Defect 1 would help. Fixing defect 1 alone was never going to move this exact reproduction, and the subagent said so themselves.

    Decision: keeping the fix, it's correct independent of the matrix

    This is a real, verified deserialization bug on the resolve_query decomposition path (the same tool family as #1908/#1910/#1915) — a model that gets every hard part of a filter right (property, operator, value) was having the whole call rejected over a discriminator token it had no reason to restate. That's worth having regardless of whether it moves this particular 12-scenario matrix. Zero regressions, real tests, real unit-level fix. Leaving it in place, uncommitted, as this session continues — will fold into whatever eventually gets committed together with the actual scenario-6-moving fix if one is found, or committed on its own if a good stopping point comes first.

    Defect 2 remains open — this comment does not close #1922; it closes out verification of the filter_type half of the subagent's report.

  6. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Golden prompt confirmed 3/3 — scenario 6's blocker is history SIZE/SHAPE, not a capability boundary. Concrete fix direction identified.

    Per the new methodology on #1917 (hand-author a golden prompt directly against llama.cpp, independent of any NodeSpace assembly code, before targeting the real pipeline at it): built packages/agent/tests/golden_scenario6_handauthored.rs, entirely fresh strings — not STAGE1_SYSTEM_PROMPT, not skill_pipeline.rs's Graph Editing guidance, not any production constant.

    The experiment

    The prior subagent investigation on this issue established: the model resolves "the 2400 one" correctly with zero history (3/3), and fails with the full real scenario-6 history (~8,322 tokens of turn-by-turn reconstruction — tool-call records, write-receipts, routing candidate blocks) across 5 independent 3-rep trials on 4 different prompt channels. Open question: is the defect "any history at all" (unfixable, a real capability boundary) or "history above some size/shape" (fixable by compacting what's carried forward)?

    Tested a compact hand-written summary — ~120 words, not the full reconstruction — carrying the same underlying facts (an equipment type exists with a replacement_cost field; one item was logged at cost 2400):

    System: "You are a graph-editing assistant. When a request refers to something
    indirectly (a bare value, a description) rather than by name, call resolve_query
    to find it. Never ask the user to supply a node id yourself."
    
    History (1 message): "Context: the user has an 'equipment' type with a
    replacement_cost field. They logged one equipment item with replacement_cost 2400."
    
    User: "The 2400 one came back — set it to returned"
    

    Result: 3/3, byte-identical

    resolve_query({"node_type":"equipment","request":"The 2400 one came back — set it to returned"})
    

    Every rep, exact same call. Correct tool, correct node_type (better than the zero-history control, which had to guess a generic "Product" — the compact history actively helped here). Direct llama.cpp calls only, no daemon, no NodeSpace prompt assembly, ~4 min/rep of actual model time (vs the ~15-25 min a single full-matrix rep costs).

    What this settles

    Refutes "any history breaks it." Confirms the size/shape hypothesis instead: a small amount of the RIGHT facts preserves correct behavior; it's the volume/shape of the full reconstruction that breaks it, consistent with this project's own resident-prompt dilution finding (10,493 chars scored 50% vs 445 chars at 73% on cases targeting the same prompt's own rules). This softens "model capability boundary" back toward "delivery/architecture problem" — which matters directly for #1917's explicit scope note that fine-tuning is only warranted once failures are shown to be judgment/comprehension rather than delivery/architecture.

    This is now the golden prompt — target for the deterministic snapshot test

    Per the agreed sequencing: this hand-authored, llama.cpp-validated prompt is the FIXED target, not a snapshot of current pipeline output. Next step is the deterministic (zero-model-call) test asserting whether the REAL assembly pipeline (context_ops::build_workspace_context, prior-write injection, routing candidate rendering — whatever composes the acting turn's context) can be made to produce something that converges toward this compact shape, rather than the verbose full-reconstruction it produces today. That is a different fix direction than the 5 prior attempts (all prose/instruction tuning on the existing verbose assembly) — this targets what gets INCLUDED, not what's said about it.

  7. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Before scoping a compaction fix — need the actual prompt breakdown, not a guess

    Started tracing where scenario 6's ~8,322 real tokens actually come from, to scope the compaction fix the golden-prompt result points toward. Found node_history_from_messages (local_agent_service.rs:1805) and completed_writes_message (line 1746) — the functions that reconstruct prior turns and inject write-records into history.

    Caught myself before guessing wrong. My first instinct was to assume these are the bulk of the token cost and redesign them to summarize instead of reconstruct verbatim. But estimating the actual content: turn 3's schema-creation narration and turn 4's instance-creation narration are each a few sentences — nowhere near enough, even summed, to account for 8,322 tokens. The write-record injection (completed_writes_message) is already compact by design (a few lines per write, explicitly built to avoid boilerplate per its own doc comment). The bulk of the token cost is very likely NOT in conversation-history reconstruction — it's probably the resident system prompt, skill guidance text, routing candidate blocks, or workspace context, which are independent of how many turns preceded this one.

    That matters a lot for scoping: compacting history reconstruction would be the wrong fix if history isn't actually where the size is. I don't want to redesign shared multi-turn conversation plumbing based on an assumption I haven't verified.

    Not implementing anything yet. Next concrete step: capture the REAL assembled prompt for scenario 6's actual turn 6 (via the daemon, with full debug logging, one clean run) and get an honest section-by-section breakdown of where the 8,322 tokens actually go — resident prompt vs. skill guidance vs. routing candidates vs. workspace context vs. conversation history — before proposing any specific compaction design. This is the deterministic-snapshot-test infrastructure's actual first job: make that breakdown inspectable without a live model call every time.

    Flagging this as the next unit of work rather than guessing at an architecture change to shared history-handling code that touches every multi-turn conversation in the product, not just scenario 6.

  8. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Real prompt-size breakdown captured — the dominant cost is the RESIDENT prompt, not conversation history. This overlaps existing tracked work (#1813).

    Reproduced scenario 6 end-to-end with RUST_LOG=debug and captured every Chat prompt (N chars) log line across the full turn sequence (fresh purged DB):

    turn chars notes
    1 (routing) 1,894 Stage-1, no history
    1 (acting) 20,071 -> 20,470 -> 21,267 schema creation, 3 ReAct iterations, zero conversation history at this point
    2 (routing) 2,054
    2 (acting) 33,449 -> 33,761 instance creation, now carrying turn 1's history
    3 (routing) 2,008
    3 (acting, scenario 6 itself) 29,765

    The finding

    Turn 1's acting prompt is already 20,071 chars with NO conversation history at all. That is the resident system prompt + tool schemas + first-turn workspace context, alone — roughly 60% of the eventual peak (33,761). History growth from turn 1 to turn 2 is real (~13K chars) but it is added ON TOP OF an already-large base, not the dominant term.

    This changes the fix-scoping conclusion from my last comment. Compacting conversation-history reconstruction (node_history_from_messages, completed_writes_message) would cap the achievable reduction at roughly 30-40% of total prompt size — real, worth doing, but not the primary lever. The bigger lever is the same one ADR-064 already names and #1802's spike already measured directionally (the 10,493-char vs 445-char resident-prompt ablation, 73% vs 50% on cases targeting the prompt's own rules) — reducing the ~20K-char RESIDENT base itself.

    This overlaps #1813 ("reduce the resident prompt"), already filed and unblocked

    #1802's spike closing comment lists #1813 — reduce the resident prompt — wave B, blocked by ADR-064 ✅. ADR-064 has since been adopted (this whole cluster is downstream of it). #1813 may already be unblocked and simply not yet worked. Worth checking its current state before either duplicating it here or treating scenario 6's fix as requiring a NEW compaction mechanism, when the existing filed issue may already be the right vehicle — possibly for both problems at once, since a smaller resident base benefits every turn, not just history-heavy ones like scenario 6.

    Not implementing a fix this comment

    This is now clearly the larger architectural question #1917 itself flagged as escalate-worthy (a genuine architecture tradeoff, not a bug fix scoped to one file) — reducing the resident prompt is cross-cutting, affects every turn in the product, and has a filed issue (#1813) that may already own this exact scope. Recommend checking #1813's status and either resuming it directly or explicitly re-scoping it to include the scenario-6 evidence gathered here, rather than a parallel compaction effort invented fresh in this issue.

  9. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Correction: #1813 already landed and is NOT the open lever — the resident prompt is genuinely small already

    Checked #1813 directly rather than assume from its title. It's closed via a real merge, not abandoned: commit 6aaae54a ("Reduce agent_guidance.rs to identity and policy per ADR-064 rule 5 (closes #1813)"), part of PR #1827, landed 2026-07-30.

    agent_guidance.rs is genuinely small today — verified directly, not assumed: only 3 resident prompt constants exist (SCHEMA_CREATION_RULES 342 chars, TOOL_STRATEGY_RULES 1,529 chars, NODE_REFERENCE_FORMAT), totaling roughly ~2K chars. The file's 23KB on-disk size (which I flagged as suspicious in my last comment — a real error on my part) is Rust source structure: doc comments explaining the ADR-064 rationale, seeding logic, tests — not prompt content. #1813 did its job; my alarm about file size regrowing was measuring the wrong thing entirely, and I'm correcting it here before it misleads anyone.

    So the resident prompt is NOT where scenario 6's ~20K-char turn-1 baseline (measured last comment, zero conversation history) comes from. skill_pipeline.rs (50.7KB) and tools.rs (192.9KB, all tool definitions/descriptions) are the far larger source files — tool schemas sent on every turn, and per-skill guidance rendered into Stage 2's prompt when a skill is retrieved, are the much more likely dominant contributors, not resident identity/policy prose.

    Where this leaves the investigation

    I do not yet have the actual breakdown of what's IN that 20K-char turn-1 prompt — only that it isn't primarily agent_guidance.rs content. Getting that real breakdown (not another assumption) is the honest next step: capture the full turn-1 prompt text (already have the mechanism — the eprintln! diagnostic pattern used earlier this session on nlp-engine/src/chat/mod.rs) and measure section-by-section: tool schema total size, per-skill guidance size, workspace context size.

    Correcting course rather than compounding a wrong premise — apologies for the churn on this specific thread; two comments in a row have each needed correcting against real measurement rather than plausible-sounding inference. Getting the real number next, not another guess.

  10. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Real section-by-section prompt breakdown captured — the dominant cost is TOOL SCHEMAS, not resident prose or history

    Captured the actual full turn-1 acting prompt (20,005 chars, zero conversation history, fresh purged DB) via the same eprintln! diagnostic technique used earlier — reverted immediately after this one capture, not left in the tree.

    Section breakdown

    system prose (identity + guidance, before first tool decl):  3,043 chars (15%)
    tool declarations (12 tools offered):                        16,962 chars (85%)
    

    Tool schemas dominate, not resident prose. This corrects both of my last two comments' hypotheses — it was never primarily agent_guidance.rs (already small, #1813 landed correctly) and it was never primarily conversation-history reconstruction either (that's additive on top but not the base).

    Per-tool breakdown (12 tools offered on this fail-open turn)

    3,310  create_schema
    3,195  search_nodes
    2,953  search_semantic
    2,329  update_schema
    1,133  create_node
      683  update_node
      597  create_relationship
      551  create_nodes_from_markdown
      546  get_related_nodes
      475  get_node
      427  update_task_status
      286  delete_node
    

    The top 4 tools (create_schema, search_nodes, search_semantic, update_schema) account for 11,787 of 16,485 chars — 71% of all tool-schema text — and this is BEFORE Stage-2 candidate scoping narrows the surface; turn 1 here is on the fail-open path (12 tools, the near-maximum surface) because no skill had cleared the score gate yet.

    Why this matters for scenario 6 specifically

    resolve_query's own description (read earlier this session, tools.rs def_resolve_query) is itself fairly long — a worked "" example, three distinct outcome-handling branches (resolved/no_match/multiple_matches) spelled out in prose. Every one of these full tool descriptions is repeated in full on every turn a tool is offered, verbatim, every time — none of it is retrieved or summarized adaptively. A conversation with several tools whitelisted by multiple candidate skills pays full price for all of them, every turn.

    This is a genuinely new, different lever than anything tried this session

    Not resident-prompt reduction (#1813, already done). Not history compaction (real but secondary, ~13K chars added across turns vs. ~17K in tool schemas already present at turn 1). Not a retrieval-merge or guidance-reorder — this is tool description length itself as prompt-mass, sent in full regardless of relevance, which is exactly the "volume harms" mechanism ADR-064's Evidence section already measured for resident prose (dilution, not misunderstanding) — just not yet measured for tool schemas specifically.

    Not implementing anything yet — this needs a design decision, not a unilateral cut

    Trimming tool descriptions is real surgery on shared, load-bearing text (per ADR-064 rule 1, tool schemas own argument shape — they're not decorative prose to casually shorten) across every tool in the registry, and #1813's own acceptance criteria required a repaired measurement harness and a non-adversarial case set before touching resident prose; the same discipline should apply here before cutting tool-schema prose. Flagging as a real, measured, actionable finding rather than acting on it without that groundwork — this is squarely the kind of infrastructure-first step the deterministic-snapshot-test deliverable exists to support: a size-per-section assertion could catch tool-schema bloat automatically going forward, once written.

  11. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Actual root cause found: this is a Stage-1 query-reformulation content bug, not a workspace-context plumbing bug

    Re-investigated from scratch against the daemon.log behind #1917's 9.0/12 matrix result (the most recent full run, post-compaction-fix). This supersedes this issue's own "suggested next step" (verify ctx going into set_session_context) — that thread turned out to be a dead end, not because the code there is broken, but because the actual failure happens one step earlier, before dynamic_ctx is ever computed.

    The real mechanism, traced with exact log lines

    Scenario 6's turn 3 prompt is "The 2400 one came back — set it to returned", following turns 1-2 (schema + instance creation for equipment). Stage-1 routing for this turn:

    Chat prompt (1915 chars) — Stage-1 system + blended routing_query
    Prompt tokenized: 419 tokens
    ... 18 completion tokens generated ...
    find_skills executed query="equipment items on the books" results_found=3 top_score=0.8437242448329926
    two-stage routing overhead routing_decision="query" candidates=3 routed_skills=Schema Creation, Node Creation, Organization
    

    Stage-1's reformulated query is "equipment items on the books" — it drops "2400", "returned", and any update/state-change framing entirely, and produces something that reads like a re-statement of scenario 5's list query ("What equipment is on the books?"), not an update request. Graph Editing (the skill that whitelists update_node/resolve_query, per skill_pipeline.rs:354-367) is never among the routed candidates as a direct consequence — it's either never retrieved against this generic query, or retrieved below its 0.30 mutating-skill score bar (MUTATING_SKILL_SCORE_BAR, routing.rs:65). Either way, resolve_query never clears tools_with_available_guidance and gets stripped from the tool list before the acting turn even starts — matching the observed toolsOffered exactly (search_nodes, search_semantic, get_node, create_node, create_schema, update_schema, create_relationship — no resolve_query).

    This is confirmed as the actual mechanism, not the dynamic_ctx/workspace-context injection path this issue originally chased. dynamic_ctx_len=0 (this issue's prior finding) is real but is a downstream symptom of the same root cause working through a second path (the resident workspace-context block, which is scoped by a separate schema-retrieval query, also not preserving "the 2400 one... returned" as update-shaped) — not an independent bug in session storage or the formatting/ordering code all previously ruled out. No fix is needed in set_session_context/AgentSession — that code is correct.

    Why this happens: a real gap in route_query's tool description

    route_query's current description (routing.rs:118-123, tuned by fdc1a256 for #1912's "preserve literal subject nouns" finding):

    "Use when you understand what the user wants. Provide a short search query describing the capability needed to fulfil it, keeping the specific nouns the user named (what kind of thing, what item) rather than replacing them with a paraphrase — describe the task using the user's own subject, not a reinterpreted one."

    This instruction is entirely about preserving the subject noun ("equipment", "albums", "venues") — it says nothing about preserving the action/intent (update vs. read vs. create) that actually determines which skill category (and score bar) applies. For scenario 6, the model correctly kept "equipment" per this instruction, but had no equivalent instruction telling it that "the 2400 one... set it to returned" is the part that determines the query needs to describe an UPDATE, not a listing. The result reads exactly like scenario 5's query with the discriminating value and verb dropped.

    Scope note

    This is the same class of defect fdc1a256 already fixed once for 8a (Stage-1 query reformulation losing signal) — but a different instance of it (losing the action/intent, not the subject noun), on the same tool description that fix already tuned. Given #1912's own history (a route_query-adjacent change previously traded 8a against 8b/3), any fix here needs the same full-matrix discipline before merging, not just validation against scenario 6.

    Suggested fix direction (not yet implemented)

    Extend route_query's tool/parameter description to also instruct preserving the action verb or intent signal (e.g. "keep both the subject noun AND the specific action or distinguishing detail — a status word, a value, an update/creation/deletion verb — rather than generalizing to a category-level description"). This is a description-only change (ADR-064 rule 2: tool descriptions own tool/query-shape guidance) — no code path change needed beyond the string itself, but it's shared surface every turn's routing depends on, so full 3-rep matrix gate before merge, same as fdc1a256 itself required.

  12. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Stage-1 fix confirmed working live; found a SECOND, distinct root cause one layer downstream

    Implemented and committed the Stage-1 fix proposed in the prior comment (route_query's tool/parameter descriptions now instruct preserving the action/intent alongside the subject noun — commit 83bdabed, packages/agent/src/local_agent/routing.rs). Verified two ways before concluding:

    1. Isolated golden-prompt test (stage1_reformulation_for_scenario_6_update, live_stage1_golden_prompts.rs): pre-fix reliably reproduced route_query("equipment items on the books"); post-fix produces route_query("set laser cutter to returned with replacement cost 2400") — exactly the intended change. Regression-checked against the 3 existing golden cases (8a, 8b control, scenario 4) single-threaded — all unchanged.
    2. Live matrix run with debug logging (fresh isolated daemon, NODESPACE_HOME purged, served_db_path verified): confirms the fix reaches the real pipeline. Stage-1's actual reformulated query for scenario 6's turn 3 in this run:
      find_skills executed query="set equipment record worth 2400 to returned status" top_score=0.7877...
      two-stage routing overhead routing_decision="query" candidates=3 routed_skills=Schema Creation, Node Creation, Bulk Import
      
      The fix works exactly as designed — Stage-1 now preserves both the subject and the update intent/value.

    But scenario 6 still fails — because Graph Editing loses the retrieval competition, not because of a bad query

    Even with a well-formed, correctly-intent-preserving query, Graph Editing (the skill whitelisting resolve_query/update_node) is not among the top-3 routed skills. Checked why: compared skill descriptions directly (skill_pipeline.rs):

    • Schema Creation's description (line 345) literally contains the word "equipment" as a worked example: "...equipment, bookings, subscriptions, contacts, or any recurring category of item..."
    • Graph Editing's description (line 359) is generic with zero domain vocabulary: "Modify existing nodes in the knowledge graph - update content, properties, titles, and metadata. For tasks, use update_task_status to change status."

    Against "set equipment record worth 2400 to returned status," Schema Creation's embedding wins the retrieval race largely because it happens to share the literal word "equipment" — even though the actual request is an update, squarely Graph Editing's domain, not schema definition. This is a skill-description retrieval competition problem, a second, separable link in the chain from the Stage-1 query-reformulation bug just fixed.

    Scope decision

    Not fixing this inline — per #1912's own history, skill-description tuning has previously traded scenarios against each other (8a fixed, 8b/3 broken), so any change here needs the same live-model golden-prompt validation + full matrix gate discipline as the Stage-1 fix, not a quick edit. Filing as a proper next step rather than folding it into this issue's already-landed fix.

    Matrix result on this run (informational — NOT decision-grade, single rep, and confounded)

    9/12 → 7/12 on the debug-logging run (new failures on 3 and 4 relative to the earlier 9.0/12 baseline). Per #1862's noise-band lesson this alone isn't conclusive, but flagging honestly: this run also had RUST_LOG=debug enabled (the original 9.0/12 baseline did not), which changes daemon overhead/timing and is a confound I introduced to get the trace — need a clean (non-debug) 3-rep re-run to get a decision-grade number for the Stage-1 fix alone before drawing conclusions about whether it net-helps.

    Next steps, in order: (1) clean 3-rep matrix gate (no debug logging) on commit 83bdabed to get a real number for the Stage-1 fix alone, (2) if net-positive with no new regressions, keep it; if not, investigate before merging further, (3) separately, design + validate a Graph Editing description fix (add domain-anchoring vocabulary — item, record, status, update — without stealing retrieval mass from Schema Creation the way dbb21c36 did in the opposite direction per #1912's history) as its own golden-prompt-validated change.

  13. malibio commented on Aug 2, 2026

    @malibio
    CollaboratorAuthor

    Third layer investigated: Graph Editing description fix gets resolve_query fully available and instructed — model still doesn't call it. Likely a model-judgment limit, not a fixable prompt-assembly bug. Not merging this attempt.

    Followed the "next step" from the prior comment: designed a Graph Editing description fix adding domain-anchoring vocabulary and intent examples (item/record/status/value language, e.g. "mark it returned", "set it to done", explicitly contrasted against creation/schema-definition intent). Tested live against a fresh isolated daemon before matrix-gating, per standing practice.

    Result: real, measurable retrieval improvement — but does not flip scenario 6's outcome

    With the new description, scenario 6's Stage-1 query (already correctly reformulated by the prior fix — 83bdabed) now retrieves Graph Editing into the top-3 candidates for the first time all session:

    find_skills executed query="set equipment record worth 2400 to returned status" top_score=0.7877...
    two-stage routing overhead routing_decision="query" candidates=3 routed_skills=Schema Creation, Node Creation, Graph Editing
    

    And critically, the acting turn's tool list now includes resolve_query:

    Agent turn: system prompt and tools prepared tools_count=9 tool_names=search_nodes, resolve_query, search_semantic, get_node, create_node, update_node, create_schema, update_schema, update_task_status
    

    Confirmed render_candidates_for_prompt includes every eligible candidate's full instructions (not just the top-ranked one), so Graph Editing's INDIRECT TARGET guidance — which explicitly covers "a bare value without naming its field (an amount, a code)," the exact shape of "the 2400 one" — was present in this turn's prompt alongside resolve_query's own tool description (also a strong match: its own worked example is "Mark the $500 invoice as paid", structurally identical to scenario 6).

    The model still didn't call it. Actual output for this turn: tool_calls=0, reply "I need the ID of the equipment item you are referring to. Could you provide it?" — same refusal shape as the availability-gap era, but now with every piece of guidance and tooling correctly in place.

    Read on this

    This moves the open question from "is resolve_query reachable" (now: yes, confirmed) to "does the model choose to use it when it's reachable and correctly instructed" (now: no, at least not reliably in this configuration). That's a materially different, harder class of gap — instruction-following/selection-under-competing-candidates, not a prompt-assembly or retrieval defect fixable by more description tuning. Consistent with this cluster's prior honest negative results (#1924's tool-schema dead end, the four rejected retrieval-merge variants in #1917 checkpoints 4-6) — not every gap in this matrix is a plumbing bug.

    Not merged

    Single-run check (not yet 3-rep gated) also showed 8e regressing to a fail in this same run — noise-band territory per #1862, not confirmed, but not worth spending a 3-rep gate on a change that doesn't move scenario 6's actual pass/fail outcome. Discarded the code change (packages/agent/src/skill_pipeline.rs, Graph Editing's description) rather than commit a change with real regression risk and zero net score benefit. Recording the finding here since it's real evidence, even though the specific fix attempt didn't pan out.

    Where this leaves scenario 6

    Two of three root-cause layers are now fixed and verified (Stage-1 intent preservation — merged, 83bdabed; Graph Editing retrieval visibility — proven fixable, not merged since it doesn't change the outcome on its own). The remaining layer looks like it needs either: (a) stronger/differently-framed guidance specifically for this trigger phrase shape ("came back", "the X one" as an indirect reference) — a genuinely new hypothesis, not yet tried; or (b) acceptance that this is a real model-capability ceiling for the current locked model (Gemma 4 E4B) on this specific instruction-following pattern, which would make scenario 6 a documented, accepted gap rather than a bug to keep chasing. Not deciding between these unilaterally — flagging as the next real fork for #1917.

  14. malibio commented on Aug 3, 2026

    @malibio
    CollaboratorAuthor

    Idiom-probe result (option b): negative — no behavior change, confirms model-capability ceiling

    Ran the bounded check per the fork decision: reworded Graph Editing's INDIRECT TARGET guidance in skill_pipeline.rs to add literal demonstrative-phrase examples ("the one with the red label", "that item", "it") instead of only abstract field/value language, plus an explicit "do not ask the user for the ID resolve_query already found" line. Passed the guidance_is_not_contaminated_by_eval_prompts test (generic examples, not eval prompt text).

    Rebased the worktree onto current main (2002fa82 — includes PR #1928 and route_multi), reapplied the change cleanly, confirmed it still builds. Drove scenario 6's real 3-turn sequence (schema creation → instance creation → list → update) through the actual isolated daemon via aichat.ts, not a hand-authored harness — this change lives in the skill-description/retrieval layer, which none of the existing golden-prompt tests (they use hand-authored tool text) actually exercise.

    Result on turn 4 (scenario 6's exact prompt, "The 2400 one came back — set it to returned"):

    [routed skills] Schema Creation, Node Creation, Graph Editing
    [raw] iteration=0 "I need the ID of the equipment item you are referring to in order to update its status. Could you please provide it?"
    

    Graph Editing is correctly retrieved and resolve_query is in the offered tool surface (layer 1 and layer 2 fixes both still working as designed) — but the model still declines to call it and asks for a literal ID, identical failure shape to the pre-idiom-probe baseline. The reworded guidance, including literal idiom examples matching this scenario's exact phrasing pattern ("the X one"), did not change the outcome.

    Per the fork decision's own bound: this is sufficient evidence. Calling it — scenario 6's remaining gap is a documented model-capability limit of the locked model (Gemma 4 E4B) on this specific instruction-following pattern (indirect demonstrative reference + state-change verb), not a prompt-assembly or retrieval defect. Not chasing further hypotheses on this specific angle.

    Action taken: discarded the uncommitted change (git checkout -- packages/agent/src/skill_pipeline.rs) rather than merge a fix with no measured effect. Worktree left rebased on current main; no other changes to preserve there.

    Proceeding to #1926 next, per the standing priority order.

  15. malibio commented on Aug 3, 2026

    @malibio
    CollaboratorAuthor

    Closing as a documented model-capability limit, not a completed fix.

    What was actually resolved: the original plumbing defect this issue was filed for (dynamic_ctx_len=0 — the entity-types block never reaching the prompt despite successful schema retrieval) is fixed and verified. Two further layers were also found and fixed along the way: Stage-1 query reformulation dropping the update-intent signal (merged, 83bdabed), and Graph Editing's missing domain vocabulary preventing it from being retrieved as a routing candidate (fix designed and proven, though not merged since it didn't change the outcome on its own).

    What was NOT resolved, and this issue's actual acceptance criterion: "scenario 6 passes reliably across multiple runs" — not met. With every plumbing layer now confirmed correct (resolve_query reachable, correctly instructed, entity-types block present), the model still declines to call it and asks for a literal node ID instead. A dedicated probe reframing the guidance around the literal idiom ("the one with the red label," "that item") — the last untried angle — also came back negative under the same conditions.

    Conclusion: this is a real instruction-following limit of the locked model (Gemma 4 E4B) on this specific pattern (an indirect reference phrased as "the X one" combined with a state-change verb), not a fixable prompt-assembly or retrieval defect. Closing as an accepted, documented limitation rather than an open bug — reopen if a future model change or fine-tuning effort makes this worth re-testing, or if a genuinely new, untried hypothesis emerges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions