Repository navigation
Add create_task; let Stage 1 finish and name the procedure (refs #3784) - #3838
Conversation
malibio
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: APPROVE (net positive), with two test-coverage gaps and one parsing bug worth fixing before merge.
The change is cohesive. create_task mirrors create_question_task in every exhaustive match (Tool::ALL, count walk, ordinal assert, id, name, write semantics, written-node, schema-scoped in decisions.rs, the skill-pipeline CLI-exemption list, daemon write summary). It validates input and resolves the project before the first write. The seeded rule swap is consistent: no stale task-create-node/-brief/-project-link references remain, PROCEDURE_RULES is updated, and SKILL.md is 13,997 chars (cap 20,000). No node-type, field or relationship is added, so node-types.md is unaffected. No issue numbers, lint suppression or compat code in the diff.
Findings
Critical Issues
None.
Suggested Improvements
packages/agent/tests/it/create_task.rs: The rollback path has no test. Rollback is the headline atomicity claim ofexec_create_task(the doc comment says the call "leaves the graph as it found it"), and the only tests cover the happy path and pre-write refusals. A failure injected after the task is created (a brief/checklist child write, or thetasksedge) should assert that no task, text or checkbox node remains and that the error says "Nothing was created." Worth also covering the second branch (delete itself fails, so the message names the orphan URI), or noting why it cannot be reached. Untested compensation logic is the code most likely to rot.packages/agent/src/local_agent/agent_loop.rs(~6368-6410) androuting.rsnamed_capability: The new naming path has no tests. Edge cases that deserve a test, since the name is explicitly "a claim": unknown name leaves ranked candidates unchanged; a name matching a non-Procedure skill is ignored; name differing in case/whitespace; name not inmergedhits the extraretrieve_skills(&name, 8)fallback; a pinned skill still joins the named procedure;route_querywithoutcapability, andcapability: ""/null/non-string (the last makes the wholeRouteQueryParamsparse fail, so a stray non-stringcapabilitywould drop the query too; consider tolerating it, sincedeny_unknown_fieldsis on that struct and the model is the author).named_capabilityis a pure function and is trivially unit-testable inrouting.rs.packages/agent/src/local_agent/tools.rs, checklist normalisation (trim_start_matches(['-', '*', ' '])): this strips any leading-/*, so a condition beginning with emphasis (**Exports** keep order) becomesExports** keep order, and-1 is rejectedloses its sign.[X](uppercase) is also not handled, and the[ ]/[x]strips run in sequence without re-trimming, so[ ] [x] foois only half-cleaned. Strip a single list marker followed by whitespace, then one optional[ ]/[x]/[X]followed by whitespace, instead of char-set trimming. Add the cases toa_brief_and_checklist_sent_as_text_are_split_and_unmarked.agent_loop.rsnamed-procedure lookup: the fallbackretrieve_skills(...).await.ok()swallows the error silently, whereas the sibling retrieval loop logstracing::warn!on failure. Log it so a misnamed/failed lookup is diagnosable from a trace. Also,procedure.score.max(top_score).max(1.0)forces the score gate open; the comment explains why, but the1.0literal reads as a magic number. Name the gate threshold it is meant to clear (or reuse the constant fromselect_candidates).- Behavioural note, not a blocker: a named procedure replaces the whole candidate set with one skill, so the "read-only skill alongside a write skill" behaviour of
select_candidatesdoes not apply. This is fine for Creating a Task (its tool list includessearch_nodes), but for any future Procedure whose Stage 2 turn needs a skill it does not carry, the model loses it with no fallback. Worth a sentence in the comment so the next reader knows it is deliberate. The measured effect is "neutral on Haiku, +1.3 on E4B over 3 reps"; the summary rightly calls that weak, so this is a behaviour change riding on thin evidence. The gain from the token cap andcreate_task(8.0 -> 11.3) is the real win, and the naming path is the part to keep an eye on. exec_create_taskis not transactional across the multiplenode_opscalls, so a UI/event consumer can briefly see a task with a partial brief or no checklist (it would appear in "Needs shaping"). Acceptable given compensation, but say so in the doc comment rather than "one write".
Nitpicks
- Nit:
create_task.rsa_project_that_does_not_exist_or_is_not_one...: thelet ... else { if matches!(InvalidArguments) { continue } panic! }accepts either error kind, so the test cannot say which refusal each input produces. Assert the expected variant per input (table of(project, expected)). - Nit:
tools.rsCreateTaskParamsaccepts many aliases (content,name,description,paragraphs,checklist_items,checkboxes,acceptance_criteria,type). Each is a chance for a silent mis-mapping and widens the schema surface; keep only the ones observed from real model output. - Nit:
ok_resultreports"created": truealongside the id; the id alone already conveys it. - Nit: the 1024
STAGE1_MAX_TOKENScomment cites "three calls in four" for a hosted model; fine as rationale, but it will go stale. Prefer the mechanism ("reasoning consumes the ceiling before the tool call") over the one measurement.
Review addressedFixed
Skipped
1194 agent tests, clippy Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: Small, local changes (a string helper with a unit test, a more tolerant parse, a log line, a constant, comments). No new behavior. |
… project link (refs #3784) The Creating a Task procedure was a task, a text node per brief paragraph, a checkbox per item and a project link: seven or more calls the model had to chain, and a model that stopped after the task left it with no brief. The tool takes the title, the brief paragraphs, the checklist items and the project (by id or exact title), refuses before writing when the project or either list is missing, and removes the task and everything under it when a later write fails. Creating a Task and Diagnosing a Bug end in it, and the confusion matrix gains the eval scenarios' prompts. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…3784) Stage 1 describes the capability a request needs and retrieval embeds that description, so a request heavy with domain nouns ranks a neighbour that shares them above the procedure whose verb it asks for. route_query takes an optional capability, the exact name of a listed one; when it names a procedure that procedure governs the turn alone, with its own text and tools. A name that matches no procedure changes nothing. Stage 1's token ceiling goes from 256 to 1024: a model that reasons before calling a tool spent all 256 on reasoning in three calls of four, so no routing tool was called and the turn went on with the raw message. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…refs #3784) - Checklist items lose one list marker and one checkbox, not emphasis or a leading sign; unit test covers the cases the reviewer named. - A non-string capability no longer drops the whole route_query; tests for named_capability. - A failed capability lookup is logged; the score floor is a named constant; comments say why a named procedure governs alone and that create_task is compensated, not transactional; the Stage 1 cap comment states the mechanism rather than one measurement. - Bad-project test asserts the expected error per input. Skipped: a rollback-failure test (the services expose no way to fail a child write without a mock the crate does not have; revisit if one is added), the agent-loop naming-path test (needs a full engine fixture; the pure parts are covered), trimming CreateTaskParams aliases and the redundant created flag (harmless, nothing measured). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
e0fad88 to
e70af2f
Compare
Refs #3784 (does not close it: the bug-task scenarios still fail on E4B).
What changes
create_tasktool: one call writes a task or issue with its brief paragraphs,- [ ]checklist andtaskslink from the project; validates the project first and rolls back on failure. Mirrorscreate_question_task. Replaces the three-steptask-create-node/-brief/-project-linkrules withtask-create-whole; Creating a Task and Diagnosing a Bug procedures updated.STAGE1_MAX_TOKENS256 → 1024. A model that reasons before calling a tool spent all 256 on reasoning in 12 of 16 calls, so no routing tool was called and the turn fell back to the raw message.route_querytakes an optionalcapability; when it names a Procedure-role skill, that procedure governs the turn alone. Unknown or non-procedure names are ignored.Measured (16 scenarios in
scripts/eval/fixtures/tasks.ts, held-out phrasings included)Haiku 5.5, 3 reps: old cap 8.0 → create_task + cap 1024 11.3; adding naming 11.3 (neutral).
E4B (the shipping model), 3 reps: naming 7.0 vs 5.7 without it (4 reps each pooled: 7.0 vs 5.5); baseline 6/16. Small, consistent, not proof. Bug-task scenarios are 0/3 on E4B in every arm.
Test plan
nodespace-agent1191 tests, clippy-D warnings, fmtcreate_taskintegration tests (5)🤖 Generated with Claude Code