Skip to content

Create the record on an add that names another skill's subject, and the type on a bare 'start tracking' (closes #3533) - #3604

Merged
malibio merged 4 commits into
mainfrom
issue-3533-add-and-tracking-create
Oct 5, 2026
Merged

malibio merged 4 commits into
mainfrom
issue-3533-add-and-tracking-create

Conversation

@malibio

@malibio malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Closes #3533.

Two plain requests in the local AI chat ended with nothing created, and the routing eval passed one of them. All three parts are fixed and measured on gemma-4-e4b-q4km, isolated daemon, purged database per rep.

What changed

1. An add whose record is named after another skill's subject

"Add the cache invalidation decision to our architecture decisions." was retrieved as a deletion: Node Deletion led, delete_node was offered and create_node was not.

A retrieval query that opens with an adding verb (add, create, log, record, file, insert, register, capture, jot) is now ranked differently (routing::retrieve_candidates):

  • no skill that can remove user data is a candidate, so none can lead and no destructive tool is offered;
  • when none of the candidates Stage 2 would judge holds create_node, retrieval runs once more with the capability named first ("create a new record: …", the shape a lookup's query has), and the best match that holds create_node joins the ranking.

No seeded skill description changed. This extends ADR-038; the amendment is in nodespace-docs (2026-10-05, "a request to add something").

2. A bare "start tracking"

The model sends create_schema an enum field with no values. The refusal said the field needed a value "in core_values or user_values", and the model answered by calling update_schema.add_field_values on the type that was never created.

create_schema and update_schema's add_fields now create such a field as text and say so in the result (notes). The tool descriptions state that and no longer point at update_schema. Only the local agent's tool boundary is lenient: the CLI and the stored schema's validation still refuse it, and that refusal now names coreValues, the key callers send. Recorded in ADR-064 (amendment of 2026-10-05).

3. The routing eval

Scenarios that ask for a new type (createsType) are scored on a create_schema call the tool accepted. Each result records passedOnRoutingAlone and typeCreated, and the summary counts scenarios that routed to type creation and created nothing.

Measurements

Part 1, live, 3 reps: 0 of 3 created the record before; 3 of 3 after, with create_node offered and delete_node not.

Part 1, retrieval (locked embedding model): eleven developer-domain adds, ten naming another skill's subject (invalidation, merge, conflict, import, removal, drop, duplicate, purge, delete). On retrieval alone seven were led by a skill that removes user data and four reached Stage 2 with no skill that can create. With the rule all eleven have a skill holding create_node in their first three candidates and no destructive candidate. The second search runs for three. Five add-shaped requests that belong to another skill keep their leader.

Part 2, live, 3 reps per arm (each arm's reps identical):

Change Type created
none 0 of 3
refusal reworded to name coreValues 0 of 3
the tool creates the field as text and says so 3 of 3

Part 3, eval:routing, 3 reps:

Scenario Before the fix, new scoring After
direct-schema-create 3/3 3/3
indirect-schema-money-owed 3/3 3/3
indirect-schema-freelance ("start tracking our planning cycles") 0/3: routed, every create_schema refused. This is the one that was passing on a failed create. 3/3
indirect-schema-expenses ("I need a way to log production incidents") 0/3: Schema Creation was not among its candidates, so it failed on routing under the old scoring too 3/3
multi-schema-and-search 3/3 3/3

After the fix, the nine scenarios this change touches (those five plus direct-node-create, instance-not-schema-invoice, multi-task-and-search, single-intent-long-task) pass 9/9 in all 3 reps with no flips. One full run of the fixture as a smoke test: 19 of 19.

Description wording

No seeded skill description changed, so there is no leader movement to report from wording. All 29 live retrieval guards pass, including every deletion guard, with Node Deletion at rank 1 on every request they list. Two tool-schema descriptions changed (coreValues on create_schema and on update_schema.add_fields); the tool-surface golden is regenerated.

Tests

  • routing.rs: the verb reading, and retrieve_candidates against a retrieval double (destructive skills dropped, wider fetch, second search, its failure, no second search when a creating skill is reached).
  • agent_loop.rs: a routed add issues the second retrieval and is not offered delete_node.
  • tools.rs: the enum-to-text change, its note, and an end-to-end create_schema that used to be refused.
  • live_skill_retrieval_stability.rs: three new guards. One of them asserts that retrieval alone still leads the two failing wordings with a destructive skill and no creating skill, so it fails if a description change ever makes the rule unnecessary.
  • routing.test.ts: the new scoring.

bun run test:changed and bun run quality:fix pass.

Costs and limits

  • The verb reading is English only and the verb has to open the query. "put", "make" and "set" are left out because they also start requests to change a record. A request worded another way is routed as before.
  • The model still invents a status field on a bare "start tracking"; the type is created with it as text, and the reply says so and asks for the values.
  • The skill added by the second search carries that search's score, so it leads the turn it is added to.

Found and not changed here

🤖 Generated with Claude Code

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Pragmatic Code Review: PR #3604

Review Type: Initial Review (no prior review or comment on the PR; one commit, 5a36a470)

Summary

A net improvement. The three parts are cohesive, each maps to one part of the issue, and the layering is right: the add rule lives in one function (routing::retrieve_candidates) that both route() and the live guards call, the enum leniency sits at the local agent's tool boundary only, and the eval change separates the routing verdict from the outcome verdict. No CLAUDE.md violations in the Rust diff (no issue numbers in comments, no lint suppressions, no raw logging, no node-type or lifecycle literals).

What I ran: the 14 new unit tests (pass), bun test scripts/eval/fixtures/routing.test.ts (22 pass), and all 29 live retrieval guards against the locked embedding model (29 pass; the printed rankings confirm the model was loaded and the guards did not return early).

Two findings are worth fixing before merge. Both are places where the code does not hold a property its own doc comment and the ADR amendment state. Neither affects the seeded registry on a single-query turn.


Requirements Check

# Acceptance criterion Status Note
1 "Add the cache invalidation decision…" creates the record 3 of 3, delete_node not offered ⚠️ Not verifiable from code: it is a live model measurement the PR body reports (0/3 before, 3/3 after). The code supports it: the live guard shows Node Creation leading both wordings at 0.925 / 0.908 with no destructive candidate.
2 Live guard over at least five colliding developer-domain adds: a create_node skill in the top 3, no destructive leader ✅ adds_naming_another_skills_subject_reach_a_skill_that_can_create covers 11 requests and is stricter than asked (no destructive candidate at all). Ran it: pass.
3 Deletion guards still pass, Node Deletion at rank 1 unchanged ✅ Ran all 29 guards: pass. No seeded description changed and non-add queries take the unchanged single-search path, so there is no mechanism for a deletion's ranking to move.
4 "start tracking our planning cycles" creates one type 3 of 3 ⚠️ Live measurement from the PR body (3/3). create_schema_with_a_valueless_enum_field_creates_the_type pins the mechanism end to end against a real store.
5 A create_schema refused for a valueless enum is followed by a call that can succeed or a question ✅ Met by removing the refusal at this boundary instead of repairing the recovery. The ADR-064 amendment records the two result-wording arms that were measured and failed first, which justifies it.
6 eval:routing schema scenarios fail when no type exists; a 3-rep run reports which passed on a failed create ✅ createsType on all five; a test asserts every scenario expecting Schema Creation carries it. The PR body's table names indirect-schema-freelance as the one passing on a failed create. mutating-gate-borderline-schema expects a clarification, so it is correctly left out. See finding 4 for one false-pass path.
7 Seeded description wording changes measured against main ✅ None changed. Two tool-schema descriptions changed and the golden is regenerated.
8 quality:fix and test:changed pass ⚠️ Claimed in the PR body; I did not re-run them.

Documentation: ADR-038 and ADR-064 amendments and the agent-eval.md update are in the docs repo at 750feb9. Note that the local docs checkout has an uncommitted one-line change to decisions/038-skill-mediated-tool-routing.md.


Code Review Findings

🟡 Important 1: the second search can put a destructive skill back, in the lead

📁 packages/agent/src/local_agent/routing.rs:379-394

The first search is filtered with without_destructive_skills. The second is not:

let creating = second
    .into_iter()
    .find(|c| clears_score_gate(c) && skill_can_create_a_record(c));

A skill that whitelists both create_node and delete_node (or merge_conflict) is dropped from the first ranking, then matches this find, joins with the second search's score (measured at 0.91 to 0.93, against roughly 0.80 for everything else) and leads the turn. stage2_permitted_names offers destructive tools from the leader, so delete_node is on the surface of an add. No seeded skill holds both tools, so today's registry is unaffected, but user-authored and playbook skills carry their own whitelists, and the function doc and the ADR state the property without qualification ("no skill that removes user data is among them").

Recommendation: add && !skill_is_destructive(c) to the find, plus a unit test with a mixed skill leading the second ranking. One line.

Related, same root: dropping the whole skill also withholds its create_node. A chat pinned to a mixed skill loses it on every add-shaped turn: it is absent from retrieved_scores, so with_pinned_skills re-adds it at 0.0, and a pinned destructive skill needs a score to clear the gate. If that is intended, say so in without_destructive_skills' doc; stripping the destructive tools from the candidate instead of removing it would avoid the case.

Principle: a safety invariant must hold on every path into the set it guards, not only the first one written.

🟡 Important 2: the added skill's cross-scale score can cost a compound request its delete_node

📁 packages/agent/src/local_agent/routing.rs:346-352, 391-393; packages/agent/src/local_agent/agent_loop.rs:5414-5446

The ADR amendment says: "Each query of a compound request is read by itself, so 'add a task, and delete the old notes' still offers delete_node for its second half." Retrieval is per query, but the tool surface is not. route() merges all queries into one list and stage2_permitted_names admits destructive tools only from the single global top score. When the second search fires for the add half, Node Creation arrives at about 0.92 on a different query's scale and outranks Node Deletion's score for the delete half, so delete_node is withheld. "Add the cache invalidation decision, then delete the old draft" is the shape. The failure is in the safe direction (a tool withheld), and without the second search the outcome already depended on which half scored higher, but this PR makes it systematic and the ADR promises the opposite. No test covers a compound add plus delete.

Recommendation: either cap the added skill's score so it cannot outrank candidates of other queries (for example at the top score of its own first ranking, which still leads its own query), or keep the behaviour, correct the ADR sentence and add an agent_loop test that pins what a compound add plus delete is offered. The doc comment already describes leading as a side effect ("usually leads"), not a requirement.

Principle: scores from different queries are not comparable; a rule that ranks on them should not let one query's scale decide another's capability.

🟡 Important 3: the enum-to-text conversion reads only coreValues, and treats a malformed value list as no values

📁 packages/agent/src/local_agent/tools.rs:3566-3577

let has_values = field.get("coreValues").and_then(Value::as_array)
    .is_some_and(|values| !values.is_empty());

Two input shapes are mis-handled:

  • {"type": "enum", "userValues": [...]} is valid to the stored validator (validate_schema_field accepts core_values or user_values). Here it becomes a text field that still carries userValues, and the note says it "was sent as an enum with no values", which is false.
  • "coreValues": "open, closed" (or any non-array) used to produce a decode error naming the key. Now as_array is None, the field becomes text, coreValues is removed and the values the user asked for are dropped behind the same note. That hides a real error.

Both are unlikely from the locked model (the tool schema does not advertise userValues), but the function's contract is "carries no values".

Recommendation: convert only when coreValues is absent, null or [], and userValues is absent or empty; leave every other shape to the handler's own error. Add both cases to an_enum_field_sent_without_values_becomes_a_text_field.

Checked and fine: non-object entries are skipped (filter_map(as_object_mut)), a missing or non-array fields is untouched, edge fields are not touched and their description still says values are required, and nested fields still get the core refusal.

Principle: a lenient boundary should be lenient about exactly the one shape it was measured on, and pass everything else through.

🟡 Important 4: createdAType falls back to the old scoring when toolCalls is absent

📁 scripts/eval/fixtures/routing.ts:439-445; scripts/eval/fixtures/routing.test.ts ("a turn recorded without per-call outcomes is read by tool name")

t.toolCalls
  ? t.toolCalls.some((c) => c.name === "create_schema" && !c.isError)
  : t.toolsCalled.includes("create_schema"),

The runner always sets toolCalls (runner.ts:281-282), and score() runs only on fresh turns, so the fallback has no live reader. It is the defect this PR fixes, kept as a branch: a turn without per-call outcomes passes on the call alone, and a test pins that. It also contradicts types.ts, which says absence must be read as unknown. This is compatibility code for an older record shape, which CLAUDE.md rules out.

Recommendation: drop the fallback (t.toolCalls?.some(...) ?? false) and the test, or make absence fail with a "no per-call outcomes recorded" message.

Principle: YAGNI, and an eval's unknown must never score as a pass.

🟢 Suggestion 5: the second search fetches four and takes one

📁 packages/agent/src/local_agent/routing.rs:379

Only the best creating match is kept, so a wider fetch costs nothing in prompt size. With RETRIEVAL_FETCH, a workspace whose custom types match the request (tool-less candidates the lexical backstop sorts first) plus Schema Creation can fill all four places and the search adds nothing. ADD_RETRIEVAL_FETCH here makes the rescue more robust on larger registries, the case the PR body's last note describes.

🟢 Suggestion 6: "whose only reading" overstates the verb list

📁 packages/agent/src/local_agent/routing.rs:259-279

"add a priority field to the ticket type", "add this note to my reading list", "record that the bug is fixed" and "file this under Projects" open with a listed verb and create no record; the cost-side guard exists because of that. The consequence is benign (a destructive skill withheld, possibly one extra search), so the list is sound, but the comment and the ADR should say "a verb that does not ask for removal" or similar, not "only reading". The same applies to lacks_a_creating_skill on a request to create a type: it has a creating skill in every sense but create_node.

🟢 Suggestion 7: notes beside an existing warnings channel

📁 packages/agent/src/local_agent/tools.rs:3583-3597

CreateSchemaOutput already carries warnings: Option<Vec<String>>. A second advisory array under another key gives the model two places to read caveats. Appending to warnings would keep one channel. Keep notes if it was the measured wording; then a one-line comment saying why it is separate.

Nitpicks

  • Nit: routing.rs:367 requires E: Display only for the warn log; fine, but the live guard has to name Infallible because of it.
  • Nit: agent_loop.rs test edits ("create a schema" to "find billing notes", "log an expense" to "track an expense") are correct, since those tests assert a single retrieval. A short comment on why the query avoids an adding verb would stop the next edit from reintroducing one.
  • Nit: every live guard returns early when the model is missing, so a machine without the GGUF reports 29 passes having measured nothing. Pre-existing pattern, not introduced here.

Tests

Each new test would fail without its fix: the routing tests call functions that do not exist on main, create_schema_with_a_valueless_enum_field_creates_the_type exercises the previously refused call against a real store, and without_the_add_rule_those_adds_lead_with_a_skill_that_removes pins the reason for the rule so that it fails if the rule becomes unnecessary. That last one is a good pattern. The gaps are the three above: a mixed destructive and creating skill, a compound add plus delete, and the userValues and non-array shapes.

Recommendation

APPROVE, with findings 1 to 4 strongly recommended before merge. Findings 1 and 4 are one-line changes; 2 needs a decision between capping the score and correcting the ADR sentence; 3 is a narrowed condition plus two test rows.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Review addressed (e9dfa32a)

Addressed: 6 of 7.

  1. Second search could re-admit a destructive skill — fixed. The second ranking goes through without_destructive_skills like the first. New test the_second_search_does_not_bring_back_a_skill_that_removes; I removed the filter and watched it fail before restoring it. without_destructive_skills now says the skill is left out whole, including for a pinned skill that can both create and remove.
  2. Compound request and the cross-scale score — behaviour kept, claim corrected. Capping the added skill's score would change the single-request ranking that was measured live (3 of 3). The ADR-038 amendment now says the deletion skill stays a candidate through the other half and its tool is offered when it leads the merged ranking, and lists the tilt toward the add as a cost. New test each_query_of_a_compound_request_is_read_by_itself pins the per-query reading.
  3. Enum-to-text too broad — fixed. A field is changed only when coreValues and userValues are both absent, null or empty. A user-values-only enum and a malformed list are left for the handler. New test an_enum_field_with_any_other_value_list_is_left_for_the_handler.
  4. createdAType fallback to tool names — removed. A turn with no per-call outcomes created nothing that can be shown; the test now asserts that.
  5. Second search fetch width — it asks for ADD_RETRIEVAL_FETCH.
  6. "whose only reading" overstates the verb list — reworded in is_add_shaped's doc and in the ADR, with the add-a-field and add-to-a-list cases named.

Skipped: 1.

  1. notes beside warnings — kept. notes is the key and wording the 3-of-3 measurement was taken with, and warnings on this result is about a field name where this says what the tool did. A comment on with_created_as_text_note records that.

Nits: the two test queries that avoid an adding verb now say why.

Checks: agent lib 1001 pass; routing fixture tests 22 pass; all 29 live retrieval guards pass; bun run test:changed and bun run quality:fix pass. The ADR wording is pushed to nodespace-docs.

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Pragmatic Code Review: PR #3604

Review Type: Re-Review (first review covered 5a36a470; this covers e9dfa32a only)

Previous Review Summary: 7 recommendations. 5 addressed, 1 partially addressed (acceptable), 1 skipped with an acceptable justification, 0 not addressed. New issues found: 0 critical, 0 important, 3 suggestions, 2 nits.

What I ran: 15 targeted nodespace-agent lib tests covering every test the commit added or edited (15 pass), and bun test scripts/eval/fixtures/routing.test.ts (22 pass). I did not run the live guards, any eval or test:all; the 29-guard and test:changed results are the author's.

Previous findings

# Finding Status Note
1 Second search could re-admit a destructive skill, in the lead Addressed The second ranking goes through without_destructive_skills before the find. the_second_search_does_not_bring_back_a_skill_that_removes fails without the filter: the mixed skill at 0.95 is the first match and all three assertions break. The pinned-skill note on without_destructive_skills matches the code (with_pinned_skills gives an unretrieved pin 0.0, and clears_score_gate holds a destructive pin to its 0.45 bar).
2 Cross-scale score can cost a compound request its delete_node Partially addressed, acceptable Behaviour kept; the ADR-038 amendment no longer promises the tool and lists the tilt as a cost. The reason for not capping (it would change the ranking measured live) is sound. The new test pins the per-query reading, not the tilt. See new finding 1.
3 Enum-to-text read only coreValues and took a malformed list as no values Addressed Changed only when both keys are absent, null or []. I walked the shapes: user-values-only, a non-array under either key, [] plus a malformed other key, and a non-empty array are all left untouched; non-object entries and a missing field list are skipped as before. The new test asserts the three left alone are byte-identical.
4 createdAType fell back to tool names Addressed Fallback removed; the test now asserts routing passes and the fixture fails. No false FAIL for a turn the runner produces: see "Checked and fine".
5 Second search fetched four and took one Addressed Asks for ADD_RETRIEVAL_FETCH. The asked() assertion pins the width, so reverting it fails a test.
6 "whose only reading" overstated the verb list Addressed Reworded in is_add_shaped and the ADR, with the add-a-field and add-to-a-list cases named. One clause of the new text overstates in the other direction: new finding 2.
7 notes beside warnings Skipped, acceptable notes is the key and wording the 3-of-3 measurement used, and the comment on with_created_as_text_note records why it is separate. That is the alternative the first review offered.

Nits from the first review: the two test queries that avoid an adding verb now say why. The other two were observations with nothing to change.

Checked and fine

  • Widening the second fetch cannot change which skill is picked, only whether one is. In find_skills the skill ranking is cut from a fixed rerank pool (SKILL_RERANK_POOL.max(limit), 20), so the relative order of skills does not depend on limit. The first creating skill of a four-candidate fetch is still the first of an eight-candidate one.
  • Filtering the second search cannot remove a skill that was previously picked on the seeded registry: no seeded skill holds both create_node and a removing tool. On a registry that has one, the next creating skill is picked, which the new test pins.
  • Removing the eval fallback produces no false FAIL. parseTurnOutput always sets toolCalls, as [] for a turn that called no tool, so ?.some(...) is false and the ?? false arm is never reached there. The only TurnRecord built without toolCalls is the send-failed one (runner.ts:108-116), whose toolsCalled is [], so the old fallback read it as no type created too.
  • field.remove("userValues") only runs when the key is absent, null or [], so it drops nothing a user asked for.

New Findings

🟢 Suggestion 1: the compound test pins the case the cost is not about

📁 packages/agent/src/local_agent/agent_loop.rs:14634-14685

each_query_of_a_compound_request_is_read_by_itself gives the add half a creating skill on its first search (it asserts exactly two retrievals), so the second search never runs and the deletion skill leads at 0.9. It does pin something real: applying the add rule to the delete half, or to the merged list, would fail it. The behaviour the ADR now lists as a cost is the other case: the second search fires, the added skill arrives on the second query's scale, outranks the deletion skill and delete_node is withheld. Nothing pins that, so a later change to it in either direction (a cap, or a rule that offers the tool anyway) lands with no test noticing.

Recommendation: one more agent_loop case whose add half reaches no creating skill, asserting three retrievals and delete_node absent from Stage 2's tools. RoutingToolExecutor returns one ranking for every query, so it needs a per-query ranking or a second double.

Principle: a documented trade-off is behaviour; pin it so it changes on purpose.

🟢 Suggestion 2: "the skill they belong to keeps its place" is not what the code guarantees

📁 packages/agent/src/local_agent/routing.rs:277-280 (and the last Costs bullet of the ADR-038 amendment)

The new paragraph says both rules are safe on "add a priority field to the ticket type" because "the skill they belong to keeps its place". The first rule holds that. The second does not, on the path where it fires: no schema skill holds create_node, so when neither creating skill is in the first three, the second search runs, the added skill takes rank 1 on a higher scale, and select_candidates then keeps three. A skill that was third is no longer judged, and its tools leave the surface. "The second search adds one skill and removes none" is true of ranked and not of what Stage 2 sees.

The five requests the live guard measures keep their leader, so this is a statement about the general case, and the behaviour predates this commit. Only the sentence is new.

Recommendation: say what holds: neither request is offered a removing tool, and on the five measured the leading skill is unchanged; when the second search fires, the added skill leads and can take the third place. Same edit to the ADR bullet.

Principle: a comment that states a safety property should state the one the code enforces.

🟢 Suggestion 3: types.ts still tells scorers to treat a missing toolCalls as unknown

📁 scripts/eval/types.ts:97-103; scripts/eval/fixtures/routing.ts:475-483

The field's doc says it is optional for results files recorded before it existed and that "a scoring function must treat absence as 'unknown', not 'failed'". createdAType now reads absence as nothing created, and assertFixture then reports "every create_schema call was refused", which is not what happened on such a turn. No turn the runner scores reaches that message, so nothing is mis-scored today.

Recommendation: make toolCalls required on TurnRecord (the send-failed record gets []) and drop the optional chaining, or reword the types.ts doc to match. Requiring it is the smaller total: the "recorded before this field existed" case is an older record shape that nothing reads.

Principle: one contract per field; no shape kept for records that are never loaded.

Nitpicks

  • Nit: packages/agent/src/local_agent/routing.rs:363: the edited doc line now runs to 93 columns where its neighbours wrap at 80.
  • Nit: packages/agent/src/local_agent/routing.rs:335: "it has none here" holds for a single add. In a compound request a pinned skill that can both create and remove can carry a score from the other half and be offered. Consistent with the ADR's per-query reading; "none from this query" would be exact.

Recommendation

APPROVE. Findings 1, 3, 4 and 5 are fixed with tests that fail without their fixes, 6 is reworded, 7 is justified in a comment, and 2 is resolved by correcting the claim. The three new suggestions are a missing pin on a documented cost and two places where prose is ahead of the code; none changes behaviour on the seeded registry or blocks merge.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Re-review addressed (7acb39b3)

Addressed: 2 of 3 suggestions, both nits.

  1. Compound-request cost not pinned — added in_a_compound_request_the_added_skill_can_outrank_the_other_halfs_deletion in routing.rs: the second search fires for the add half, the added skill outranks the deletion skill the other half retrieved, and delete_node is withheld. It builds the merge route makes from the real retrieve_candidates results, since the loop's retrieval double returns one ranking for every query.
  2. "keeps its place" overstated — is_add_shaped and retrieve_candidates now say what holds: no removing tool is offered, and when the second search runs the skill it adds leads and can take the last judged place. Same edit in the ADR-038 amendment (pushed).

Nits: the over-long doc line is rewrapped, and the pinned-skill note says "none from this query".

Skipped: 1.

  1. Make TurnRecord.toolCalls required — not here. It is the shared record contract the matrix fixture and its tests also read, and no turn the runner scores reaches the case (the re-review confirmed that).

Checks: agent lib tests pass (one unrelated PTY timing test failed once under machine load and passes on re-run), clippy clean. This round is one test and comment wording; no production logic changed.

Re-Review Decision

NO RE-REVIEW NEEDED. The commit adds a test and corrects comments; nothing a reviewer approved has changed behaviour.

@malibio
malibio force-pushed the issue-3533-add-and-tracking-create branch from 7acb39b to 5b57b00 Compare October 5, 2026 12:34
@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Merge queue: #3604 was taken out of the queue — the merge gate failed on it, on top of main. Reproduce by merging or rebasing origin/main and running bun run test:changed, fix, push, and re-run bun run merge 3604.

93 |     expect(runWrapper(devRustcWrapper(tools, "/repo/wt-a"), ["echo", "compiled", "directly"], { TMPDIR: deep })).toBe(
                                                                                                                      ^
error: expect(received).toBe(expected)
Expected: "compiled directly"
Received: ""
      at <anonymous> (/Users/malibio/nodespace/nodespace-core/.claude/worktrees/_gate/scripts/gate-sccache.test.ts:93:114)
(fail) the development builds' wrapper > with a TMPDIR too deep for a unix socket, it compiles uncached rather than failing the build [5002.96ms]
  ^ this test timed out after 5000ms.
killed 1 dangling process
 95 |     );
 96 |   });
 97 | 
 98 |   test("with sccache gone, it runs the compiler itself rather than failing the build", () => {
 99 |     const script = devRustcWrapper(join(dir, "no-such-tools"), "/repo/wt-a");
100 |     expect(runWrapper(script, ["echo", "compiled", "directly"])).toBe("compiled directly");
                                                                       ^
error: expect(received).toBe(expected)
Expected: "compiled directly"
Received: ""
      at <anonymous> (/Users/malibio/nodespace/nodespace-core/.claude/worktrees/_gate/scripts/gate-sccache.test.ts:100:66)
(fail) the development builds' wrapper > with sccache gone, it runs the compiler itself rather than failing the build [5002.68ms]
  ^ this test timed out after 5000ms.
scripts/eval/preflight.test.ts:
[preflight] Skill index not ready (0/8 retrievable). Embeddings run on a ~30s debounce; waiting so turns are not scored against an empty index.
[preflight] Skill index ready (8/8) after 0s.
[preflight] Skill index not ready (0/8 retrievable). Embeddings run on a ~30s debounce; waiting so turns are not scored against an empty index.
[preflight] Skill index not ready (8/9 retrievable). Embeddings run on a ~30s debounce; waiting so turns are not scored against an empty index.
[preflight] Skill index not ready (7/8 retrievable). Embeddings run on a ~30s debounce; waiting so turns are not scored against an empty index.
 1404 pass
 4 fail
 8806 expect() calls
Ran 1408 tests across 46 files. [103.31s]
error: script "test:scripts" exited with code 1
[stage exited with code 1]

  full output: /var/folders/yj/_2dcl_l16cl6dr1bp7h1j6hw0000gn/T/nodespace-gate-logs/_gate-merge-2026-10-05T12-35-14-374Z/test-scripts-tooling.log

✗ test:scripts (tooling) failed — merge blocked.
  Fix the failure, push, and re-run: bun run merge <PR#>

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Merge queue: #3604 was taken out of the queue — the merge gate failed on it, on top of main. Reproduce by merging or rebasing origin/main and running bun run test:changed, fix, push, and re-run bun run merge 3604.

▶ test (frontend, Happy-DOM) (timeout 15m)
  ✓ types:check (generated TypeScript drift) 5s
▶ rust:lint (clippy, whole workspace) (timeout 60m)
  ✓ test (frontend, Happy-DOM) 358s
▶ test:scripts (tooling) (timeout 10m)
  ✓ test:scripts (tooling) 134s
▶ test:skill (skill package) (timeout 5m)
  ✓ test:skill (skill package) 6s
  ✓ rust:lint (clippy, whole workspace) 547s
▶ compile Rust test binaries (timeout 60m)
  ✓ compile Rust test binaries 1067s
▶ compile nodespaced and the Tauri-seam test binary (timeout 45m)
  ✓ compile nodespaced and the Tauri-seam test binary 203s
▶ skill:check (SKILL.md drift) (timeout 20m)
  ✓ skill:check (SKILL.md drift) 1s
▶ node-types:check (published node-types.md vs. the core schemas) (timeout 20m)

$ bun run scripts/check-node-types-doc.ts --at "cdaa9ecfd15792f4061b26720fec9bba67cba7b5"
❌ components/node-types.md at cdaa9ec in /Users/malibio/nodespace/nodespace-docs and the core node types disagree (10):
  - line 168: the Type cell "link" opens with no known type
  - line 169: the Type cell "link[]" opens with no known type
  - line 188: the Type cell "link" opens with no known type
  - line 111: the registry table lists `spec` under "Concrete core types", and the code registers no such type of that kind
  - line 111: the registry table lists `plan` under "Concrete core types", and the code registers no such type of that kind
  - line 111: the registry table lists `decision` under "Concrete core types", and the code registers no such type of that kind
  - line 198: `spec` has a field table, and the code registers no such core type
  - line 216: `plan` has a field table, and the code registers no such core type
  - line 233: `decision` has a field table, and the code registers no such core type
  - line 163: `task.status` has the values open, in_progress, done, cancelled, and the sheet lists open, in_progress, in_review, done, cancelled
A change to a core type updates its sheet in the same change (the node type sequence). Fix whichever side is wrong.
If this merge changes no core type, it did not cause the difference: the published sheet is ahead of main
while a type change lands. Change neither side, and re-run `bun run merge` once that change has merged.
error: script "node-types:check" exited with code 1
[stage exited with code 1]

  full output: /var/folders/yj/_2dcl_l16cl6dr1bp7h1j6hw0000gn/T/nodespace-gate-logs/_gate-merge-2026-10-05T12-44-17-862Z/node-types-check-published-node-types-md-vs-the-core-schemas.log

✗ node-types:check (published node-types.md vs. the core schemas) failed — merge blocked.
  Fix the failure, push, and re-run: bun run merge <PR#>

@malibio
malibio force-pushed the issue-3533-add-and-tracking-create branch from 5b57b00 to fde0b13 Compare October 5, 2026 14:03
@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Merge queue: #3604 was taken out of the queue — the merge gate failed on it, on top of main. Reproduce by merging or rebasing origin/main and running bun run test:changed, fix, push, and re-run bun run merge 3604.

FAIL [   0.343s] ( 512/5026) nodespace-agent local_agent::model_manager::tests::perform_download_reports_progress_events
  stdout ───
    running 1 test
    test local_agent::model_manager::tests::perform_download_reports_progress_events ... FAILED
    failures:
    failures:
        local_agent::model_manager::tests::perform_download_reports_progress_events
    test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 1009 filtered out; finished in 0.30s
  stderr ───
    thread 'local_agent::model_manager::tests::perform_download_reports_progress_events' (93413579) panicked at packages/agent/src/local_agent/model_manager.rs:1054:9:
    at least one progress event must be reported for a multi-chunk download
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  Cancelling due to test failure: 13 tests still running
        PASS [   0.092s] ( 513/5026) nodespace-agent local_agent::openai_compat_inference::tests::response_type_field_does_not_leak_into_provider_extra
        PASS [   0.073s] ( 514/5026) nodespace-agent local_agent::openai_compat_inference::tests::test_is_openai_compat_prefix
        PASS [   0.119s] ( 515/5026) nodespace-agent local_agent::openai_compat_inference::tests::response_tool_call_captures_thought_signature_as_provider_extra
        PASS [   0.077s] ( 516/5026) nodespace-agent local_agent::openai_compat_inference::tests::test_parse_non_streaming_response_with_tool_calls
        PASS [   0.076s] ( 517/5026) nodespace-agent local_agent::openai_compat_inference::tests::test_parse_streaming_delta_token
        PASS [   0.042s] ( 518/5026) nodespace-agent local_agent::openai_compat_inference::tests::test_token_count_estimate
        PASS [   0.088s] ( 519/5026) nodespace-agent local_agent::openai_compat_inference::tests::retry_policy_is_bounded
        PASS [   0.116s] ( 520/5026) nodespace-agent local_agent::openai_compat_inference::tests::response_tool_call_without_extra_fields_yields_none
        PASS [   0.062s] ( 521/5026) nodespace-agent local_agent::openai_compat_inference::tests::test_strip_openai_compat_prefix
        PASS [   0.848s] ( 522/5026) nodespace-agent local_agent::deletion_confirmation::tests::preview_counts_the_subtree_and_deletes_nothing
        PASS [   0.875s] ( 523/5026) nodespace-agent local_agent::deletion_confirmation::tests::ancestor_ids_walk_up_to_the_root_nearest_first
        PASS [   0.377s] ( 524/5026) nodespace-agent local_agent::ndjson::tests::drip_fed_line_is_not_rescanned
        PASS [   3.238s] ( 525/5026) nodespace-agent local_agent::model_manager::tests::check_disk_space_passes_for_small_requirement
────────────
     Summary [   7.920s] 525/5026 tests run: 524 passed, 1 failed, 102 skipped
        FAIL [   0.343s] ( 512/5026) nodespace-agent local_agent::model_manager::tests::perform_download_reports_progress_events
warning: 4501/5026 tests were not run due to test failure (run with --no-fail-fast to run all tests, or run with --max-fail)
error: test run failed
error: script "rust:test:workspace" exited with code 100
error: script "rust:test" exited with code 100
[stage exited with code 100]

  full output: /var/folders/yj/_2dcl_l16cl6dr1bp7h1j6hw0000gn/T/nodespace-gate-logs/_gate-merge-2026-10-05T14-04-11-480Z/rust-test-rust-workspace-nextest.log

✗ rust:test (Rust workspace, nextest) failed — merge blocked.
  Fix the failure, push, and re-run: bun run merge <PR#>

malibio and others added 4 commits October 5, 2026 16:25
…he type on a bare 'start tracking' (closes #3533)

An add whose record is named after another skill's subject was retrieved as
that skill's request: the deletion skill led, delete_node was offered and
create_node was not. A retrieval query that opens with an adding verb is now
ranked without the skills that remove user data, and when no remaining
candidate can create a record a second, capability-first search adds one
(ADR-038, amendment of 2026-10-05).

create_schema refused an enum field sent with no values, and the model
answered the refusal by calling update_schema on the type that was never
created. The tool now creates such a field as text and says so in its result
(ADR-064, amendment of 2026-10-05). The stored schema's refusal names
coreValues, the key callers send.

eval:routing scores a scenario that asks for a new type on a create_schema
call the tool accepted, not on the call being made.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…row the enum-to-text change, score type creation on recorded outcomes only

- The second search for a creating skill is filtered like the first, so a skill that can both create and remove cannot return through it and lead an add. Regression test added and checked to fail without the filter.
- The second search asks for as many candidates as the first.
- An enum field becomes text only when coreValues and userValues are both absent, null or empty; a malformed or user-values-only list is left for the handler.
- createdAType no longer falls back to tool names when a turn has no per-call outcomes.
- A compound request's queries are each read by themselves (pinned by a test); comments say what the adding verbs do and do not imply.
- Kept the result's notes key beside warnings: it is the wording the change was measured with.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… rule guarantees

- New test: in a compound request the skill the second search adds can outrank the other half's deletion skill, and delete_node is then withheld (the cost ADR-038's amendment lists).
- is_add_shaped and retrieve_candidates no longer say an add-shaped request for another skill keeps its place: the second search, when it runs, can take the last judged place.
- Skipped: making TurnRecord.toolCalls required. It is the shared record contract the matrix fixture reads, and no scored turn reaches the case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…dding verb

The test asserts a query decided in context is retrieved on as written. Its query opens with 'add' and its candidates hold no skill that can create, so the search for one follows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@malibio
malibio force-pushed the issue-3533-add-and-tracking-create branch from fde0b13 to e879646 Compare October 5, 2026 14:25
@malibio
malibio merged commit 0b69d3e into main Oct 5, 2026
@malibio
malibio deleted the issue-3533-add-and-tracking-create branch October 5, 2026 14:25
@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Post-review note: after the review cycle closed, #3621 landed with a test (a_query_decided_in_context_is_not_read_as_a_lookup) whose mocked Stage-1 query opens with "add" and whose candidates hold no skill that can create. With the add rule that turn issues a second, capability-first search, so the test's expectation was updated in fde0b132 to list both retrievals. No production code changed after the re-review. All 29 live retrieval guards were re-run on the final rebased code and pass, and both live requests were re-checked once each on the final code (record created with create_node offered and no delete_node; type created).

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

Labels

None yet

Projects

None yet

1 participant