Repository navigation
Description
Overview
On the eval:tasks baseline (E4B, 3 reps) four of the five scenarios fail every rep, and the fifth passes only because its write was refused. A prompt dump of the Stage 2 turn shows the Creating a Task and Answering a Question procedures are not among the skills the model is shown, so the failures are a retrieval or routing question first and a model-behaviour question second.
Problem Statement
For all five prompts the routed skills led with generic Graph Editing, Node Creation or Schema Creation, with Creating a Task or Answering a Question only a lower-ranked candidate (or absent: the bug report routed to Implementing a Task). The agent then does ad-hoc graph edits instead of the procedure:
- A declined request is created anyway. One
create_node, no search for a decision. - A question that stops work is never made a task. It calls
create_relationshipwith no question task to link, or changes the stopped task. - A waiting question is not found. It runs
search_semanticand asks the user for context, so the question is never put to them. - A visible bug is not shaped. It reads the task and stops, or runs to the turn limit with a stray property written to the project.
Evidence: the procedure was never loaded
Captured with NODESPACE_PROMPT_DUMP on main, E4B, one rep each of bug-created-ready and question-blocks-task:
bug-created-ready |
question-blocks-task |
|
|---|---|---|
| User request | "Something is off in Query engine rewrite: Cut the release branch is marked done but one box on its checklist is still unticked. Get that tracked as work." | a question that stops the migration-guide task, waiting on a person |
Stage 1 route_query the model emitted |
"mark checklist item as work for Query engine rewrite release branch that is marked done but has an unticked box on its checklist" | "put Anoop's question down to wait for him regarding v1 export format or only v2 coverage of the migration guide" |
| Candidates in the Stage 2 prompt | Graph Editing, Schema Creation, Play Workflow State, Node Creation, Completing a Task | Bulk Import, Schema Creation, Organization, Building and Changing a View |
| Creating a Task / Answering a Question in the prompt | 0 occurrences | 0 occurrences |
- The verbs that name the procedure are gone before retrieval. "Get that tracked as work" became "mark checklist item as work", which matches Graph Editing's own purpose line.
- Stage 2 is large for what it is doing. About 74k chars (36k system including nine active playbooks and a full "CREATING A SCHEMA" block, 38k for 12 tool declarations) for a request of about 150 chars, with Schema Creation a candidate in both scenarios and no schema asked for.
- Some scenarios pass for the wrong reason.
bug-not-reproduciblepasses when itscreate_nodeof a nonexistent type "Issue" is refused, so nothing was written. - The agent's behaviour follows what it was shown. It reverts the done task through
update_task_statusor invents awaits_forrelationship, which is what the loaded skills told it to do.
Counts on main (E4B, --runs 3, database purged between reps): per-rep 2/5, 1/5, 2/5; bug-created-ready 0/3, question-blocks-task 0/3, answer-asks-user 0/3. Reviewing a Task appears in neither prompt, so the review-procedure changes do not account for them. Single rep dumped, two scenarios, one model: a lead, not a conclusion. The procedure text itself is not the suspected cause, and rewording it to win these prompts would be tuning to the eval.
Proposed Solution
Find, with evidence at each hop, where the procedure drops out, then fix it at the level that causes it, measured against the whole confusion matrix and not these prompts alone. Work down the path in order and stop at the first hop that loses it:
- The Stage 1 query. Does the paraphrase lose the intent, and is that the model's choice or something in the Stage 1 prompt (its instruction to keep the subject noun and the action, the mentioned-entity block, the examples) that pulls it toward the resolved entities?
- The retrieval step. For the model's query and for the user's own sentence, where do Creating a Task and Answering a Question rank, with what scores, and what do the score gate, the trust filter and K do to them? Compare how the skill's description and purpose line read against both queries.
- Candidate injection. What decides which candidates are injected and in what order, and does anything demote a procedure skill (role
procedure) against the generic skills? - The surrounding context. With the right procedure injected by hand into these prompts, does E4B follow it? That separates a retrieval failure from a context-size failure, and says whether the nine playbooks and the schema block matter. Run the same scenarios on a larger model to see whether a bigger model follows the procedures.
Answer plainly at the end whether the plumbing is flawed or the query and description wording is, since the fix differs: an ordering or gating defect is code, while a query or description defect is wording, measured against the confusion matrix.
Documentation
- ADR-038 - the flow under test: the model emits a query, a system step retrieves top-K skills, then Stage 2 judges them. The model forming the query is by design, so a lossy query is a defect in how it is asked, not in the flow's shape
- ADR-018 - the two-stage classification this runs inside
- agent-eval.md - the dump recipe (
NODESPACE_PROMPT_DUMP) and isolation withNODESPACE_HOME - No ADR is expected to change; if the finding is that the flow itself must change, say so in the PR and write the superseding ADR first.
Acceptance Criteria
- For each of the five
eval:tasksscenarios the hop at which the right procedure is lost is stated with evidence (the Stage 1 query, its rank and score, and what was injected) - It is stated whether the retrieval code (gating, ordering, injection) is at fault, or the query and description wording, or neither
- The Stage 2 prompt is measured by section for these scenarios, and the effect of injecting the right procedure by hand is recorded
- Whether a larger model follows the procedures on the same scenarios is recorded
-
bun run eval:taskspasses every scenario over 3 reps, or each remaining failure is recorded with its reason - No regression on the skill-retrieval confusion matrix or the
eval:agentsmoke run - No skill description is reworded to match an eval prompt; a wording change is justified by the cost-side controls
- Code passes
bun run quality:fix
Technical Specifications
Reference Files
packages/agent/src/local_agent/routing.rs- Stage 1 routing and the retrieval steppackages/agent/src/local_agent/agent_loop.rs- Stage 1 system prompt and candidate injectionpackages/agent/src/local_agent/prompt_templates.rs- the Stage 2 prompt templatepackages/agent/src/seeds/skills/creating-a-task.md,answering-a-question.md- the procedures that were not retrievedpackages/agent/tests/it/skill_confusion_matrix.rs- the offline retrieval measurementscripts/eval/fixtures/tasks.ts- the five scenarios
Implementation Details
- Reproduce with the isolated-daemon recipe in agent-eval.md,
NODESPACE_PROMPT_DUMPset,--only bug-created-ready,question-blocks-task. The dump holds{"kind":"prompt","sent":...}and{"kind":"response","raw_response":...}lines byseq; Stage 1 is the small prompt that ends in aroute_querycall. - Purge the database and rebuild the daemon before measuring, since seeded guidance does not update in an existing database.
- Run nothing else on the machine's GPU during a run.
Related Issues
- Shape a standalone task when it is created, and let a task wait on a person (waiting status and waiting_on) #3722 (shipped the procedures)
- Agent eval scenarios for Creating a Task and Answering a Question, on a fixture current with the entity tier #3763 (the evals this follows from)
- Proportionality in the review loop: severity tiers, delta re-review and a re-review recommendation #3795 (the review-loop change measured beside this; not affected)
Non-Goals
- Rewording Creating a Task or Answering a Question to win these prompts
- Changing the model or the context window
Activity
malibio commentedon Oct 13, 2026
Related: six more procedures are being added to the built-in method (the review-loop, shared verification block, bug diagnosis / prototype / research, deprecation, and release-side issues). Each adds routing candidates and the shared block lengthens four existing procedures, so this issue's measurement is the check on whether that is safe. Each of those issues requires the skill-retrieval confusion matrix to show no regression.
malibio commentedon Oct 13, 2026
Investigation findings (E4B, production stack in-process on a temp DB with the seeded skills; one run per prompt, so directional, not decision-grade). Stage 1 queries and Stage 2 prompts were read from NODESPACE_PROMPT_DUMP.
What the model was offered, per scenario:
So in four of five scenarios the procedure is not in front of the model. Two retrieval/routing causes: the lane's single procedure is chosen from Stage 1's rewritten query and is often a different procedure, and the lookup path drops the lane.
Two experiments on declined-request, where the procedure IS offered:
So the order and the competing skills are not the cause there. E4B performs the write steps of a multi-step procedure and skips its look-first steps. A larger model was not testable here (the 12B does not fit the 16 GB machine at this context).
Nothing was changed in the product. A fix needs a design decision (staging a procedure's reads before its writes, or letting the lane offer more than one procedure and keep it on the lookup path) and is not a wording change.
Address review: let the retry of a held create run (refs #3784)
Hold a task create while a recorded decision may settle it (refs #3784)
Address review: let the retry of a held create run (refs #3784)
Hold a task create while a recorded decision may settle it (refs #3784)…
malibio commentedon Oct 13, 2026
PR #3807 landed: a create held for a recorded decision, with a turn-end question to the user (declined-request scenario). Verified in-process on E4B;
eval:tasksand the confusion matrix were not re-run.Remaining scope for this issue, from the findings above:
route_lookupkeeps only read-only skills, so Answering a Question never reaches the model for "take the question waiting on me and get it answered".create_relationshipwith"Anoop's ID here". A write whose ids do not resolve could put the question to the user (the same backstop pattern) instead of ending on a tool error.malibio commentedon Oct 14, 2026
Prompt-dump evidence and run numbers are now in the issue body (investigation plan folded in from #3810, which is closed as a duplicate).
Run record on main (E4B, isolated daemon, database purged between reps, Metal OOM count 0 in every run):
--runs 1: 2/5--runs 3: per-rep 2/5, 1/5, 2/5; pass^3 1/5.bug-created-ready0/3,bug-not-reproducible2/3,declined-request3/3,question-blocks-task0/3,answer-asks-user0/3.--runs 3run aborted with "ENVIRONMENT NOT USABLE" (a rep scored 0/5, no results file), so it is not a usable comparison. Its visible reps failed the same way as main, anddeclined-requestcreated the task there but passed on main; unexplained and likely noise at one rep.declined-requestpass on main is an empty reply after acreate_node, so treat it as unreliable until the hops above are answered.malibio commentedon Oct 14, 2026
Hop-by-hop record (E4B, locked embedding model; ranks are the retrieval scores of the lane, user sentence / Stage 1 paraphrase). PR #3821 carries the one code fix.
answer-asks-userread_only_candidatesdrops any write-tool skill when a read-only one clears the gatebug-created-readybug-not-reproduciblenot_foron Addressing Review Findings moved it 0.03 on the paraphrase only. Not keptquestion-blocks-taskuse_forlowered its score on its own prompt (0.924 → 0.915). Not kept. Model also writes placeholder ids (create_relationship)declined-requestAnswers to the issue's questions:
create_node).question-blocks-taskis a wording/coverage gap that no description change tried here closed.eval:agentsmoke not re-run.Remaining, as a design decision and not a wording change: stage a procedure's reads before its writes (so a model that skips look-first steps cannot reach the write), and decide how a request that is about waiting on a person reaches Creating a Task. Left open for that.
Address review: narrow the answer trigger, keep a pinned procedure's …
Address re-review: 'get it answered' needs an object (refs #3784)
Keep the procedure lane on a lookup that names a change (refs #3784)
1 remaining item
Address re-review: 'get it answered' needs an object (refs #3784)
Keep the procedure lane on a lookup that names a change (refs #3784) (#…
Address review: refuse a bad nested parent_id, bound the pinned reque…
Address re-review: tighten the nested parent_id refusal test (refs #3784
malibio commentedon Oct 15, 2026
Close-out record for #3784. PR #3824 carries the last code change; #3807 and #3821 carried the earlier ones.
Method. E4B (
gemma-4-e4b-q4km,n_ctx32768), isolated daemon (NODESPACE_HOME), database purged between reps,NODESPACE_PROMPT_DUMPand daemon debug log read per turn, GPU sampled while each run was going.eval:tasksnow asks each intent in two or three phrasings (16 scenarios), so a result has to hold off the five sentences the procedures were first measured on.Where each procedure is lost
route_lookupdrops every skill that writes, so Answering a Question never reached the model for "get it answered".answer-asks-user0/3 → 3/3)parent_idnested infield_values), then replies. A one-shot re-prompt after the first write did not change it (the model repeated its reply).Numbers
eval:tasks, 16 scenarios, one rep per configuration:The five passes are the negative-assertion scenarios (declined, answer-asks-user, not-reproducible). None of the ten positive-write scenarios (ready task, diagnosis, question task, original and held-out) passes in any configuration. The earlier six-scenario runs (3 reps each, three configurations) agree.
eval:agent: baseline 13/17, #3824 13/16 (one scenario unscored for routing); the 8-series chat group over 3 reps each: baseline 8a 3/3 and 8b/8c/8d 0/3; #3824 8a 3/3, 8b 0/3, 8c and 8d pass in every scored rep. The confusion matrix is unchanged at 14 of 186 (no retrieval change since the last run).Contention: the GPU was sampled for every run; no other user's inference process was seen. One check during setup found 99% from another user's test binary, and the run was held until it was clear.
Acceptance criteria
eval:taskspasses every scenario over 3 reps: no. The remaining failures are the model's, recorded above.eval:agentquality:fixWhat is left, and whose decision it is
The failures that remain are E4B's behaviour on multi-step write procedures, not a defect in retrieval, routing or context. The options, none of which is a wording change:
I'd recommend closing #3784 on this record and taking option 2 or 3 as its own decision.
Hoist a nested parent_id in create_node; add held-out task-procedure …
Hoist a nested parent_id in create_node; add held-out task-procedure …
Address review: checklist item cleaning, tolerant capability, tests (…
Add create_task: one call writes a task with its brief, checklist and…
Let Stage 1 name the procedure a request is, and let it finish (refs #…
Fix clippy and formatting in create_task (refs #3784)
Address review: checklist item cleaning, tolerant capability, tests (…
Add create_task; let Stage 1 finish and name the procedure (refs #3784)…
malibio commentedon Nov 16, 2026
Closing on the close-out record above. Code landed in #3807, #3821, #3824 and #3838. Two criteria were not met and are not tracked here: the larger-model comparison was not run (the 12B and 26B models do not fit the 16 GB machine), and
eval:tasksdoes not pass every scenario on E4B. #3838 (create_task) merged after the last measurement and was not re-measured against these scenarios.