Repository navigation
Rename skill retrieval fields to use_for/not_for and audit them against a recorded confusion matrix - #3630
Conversation
Pragmatic Code Review (part 1 of 2: summary and requirements)Review Type: Initial Review Reviewed the net change against What I ran: Code Review SummaryA clean, complete rename plus a well-argued retrieval audit. The rename reaches every layer the node type sequence names (closed schema, promoted fields, wire type, generated TypeScript, proto, CLI, typed write path, tests) with no alias, no fallback read and no migration. No unrelated Nothing blocks the merge. Three findings are worth fixing here because each is small and each weakens a guarantee the PR’s own comments claim: the ratchet excuses more than it says, the trial-wording hook can mismeasure silently, and one model-facing tool description still names the old key. Requirements Check
Scope: removing Recommendation: APPROVE (findings follow in part 2) |
Pragmatic Code Review (part 2 of 2: findings)Code Review Findings 🟡 Important:
|
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressed (commit cc66367)Addressed
Not changed
Correction to the PR description: "128 requests" is 128 recorded rows over 113 distinct requests; 15 appear both as an owner case and as a confusion. Verification
Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: every change is confined to test tooling, comments and one tool-description string. No product code path changed, the review's verdict was already APPROVE, and each new check was run in both its passing and failing direction. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Pragmatic Code Review (re-review)Review Type: Re-Review Reviewed What I ran: Previous Review Summary
How each fix checks out:
Merge resolution ( Requirements Check (only what the new commits touch)
Code Review Findings 🟡 Important: the PR description still reports the pre-merge result📁 PR description: "New wording: 18 of 128 miss", "The 18 remaining misses…", "All 34 live tests" The wording change in Recommendation: update the three numbers and add one sentence on the trade (the edge phrase kept for the guard that arrived with main; one window place given back; linking leads lowered). The PR is squash-merged, so the description is the record that outlives the branch. 🟡 Important: the seed comment accounts for the costs of the
|
| Request | Before the phrase | With it |
|---|---|---|
| which tasks depend on the API migration? | first, +0.009 | fourth, -0.022 |
| connect the retro notes to the sprint they belong to | first, +0.025 over Node Merge | first, +0.004 |
| attach the contract to the Harbor Freight account | first, +0.087 | first, +0.047 |
| link this invoice to the Acme account | first, +0.108 | first, +0.083 |
| mark the outage report done (a Graph Editing request) | Graph Editing first, +0.002 | Relationship Management first; Graph Editing second, -0.002 |
Two things follow.
- The comment says the question drops "by 0.009, from third to fourth" under the
not_for. True, and the smaller half: the phrase had already taken it from first at 0.805 to third at 0.783. A reader of the comment alone would not learn that this request was won one commit earlier. - "mark the outage report done" is now led by Relationship Management. On main Graph Editing led it by 0.026. No guard fails, because
completion_state_updates_route_graph_editingasks only for the window, andresearch_and_search_does_not_displace_write_skillscompares only against Research & Search (its doc comment says "must still lead with its own skill", which is not what it asserts). It is a window case, so this is within the rules the PR set; it is still a cost to another skill that nothing mentions.
Three results now rest on 0.004 or less: "connect the retro notes…" (+0.004, rank 1 asserted on every rep), "record an edge between the rebuild task and the storage decision" (+0.002, by the comment; asserted as leader by add_shaped_requests_for_another_skill_keep_their_leader), and the outage report the other way. The first review called +0.009 thin for a must-lead guard and that request was taken out of the guard; these are thinner. They fail loudly if they flip, which is the right failure, but the next rewording of Node Merge or Graph Editing is likely to hit them.
Recommendation: add the three omitted lines to the comment (the question's fall from first, the retro-notes margin, the outage-report lead), and add "record an edge between the rebuild task and the storage decision" to the matrix as a First case so its 0.002 is in current.tsv and not only in a comment. No wording change asked for: with the guard from main in place, the comment's measurement (Graph Editing at 0.895 and this skill outside the top three without the phrase) justifies keeping it.
Principle: a comment that accounts for a trade-off should account for all of it; a margin a guard depends on belongs in the recording.
🟢 Suggestion: say what the not-yet-won dependency question costs, not only why it is excused
📁 packages/agent/tests/it/skill_confusion_matrix.rs:338-342; packages/agent/src/skill_pipeline.rs:448-449
Recording "which tasks depend on the API migration?" as not yet won is honest, not a hidden regression. baseline.tsv has Relationship Management unranked on it, so against main the request moved from nowhere to fourth; the row is in current.tsv; the list entry gives a reason; and the merge commit says it in plain words. The ratchet's "the list only shrinks" was bent once, in the open, inside the PR that introduces the list.
The reason given is thinner than it reads. "The question is a lookup once Stage 1 has routed it" is supported by the lookup row (Research & Search first at 1.061). But get_related_nodes is held by Relationship Management alone, and Research & Search does not list it. So on either route this question is answered without the traversal tool: routed as a lookup it leads with a skill that cannot traverse, and as the raw message its only traversal skill is fourth. The use_for still ends with "Show which records depend on or are linked to one.", a sentence aimed at exactly this request.
Recommendation: note in the list comment that the question is then served by search and not by get_related_nodes; and, in a later change, measure whether that last sentence still earns its place (if removing it changes no rank in the matrix, it is cost without benefit).
Principle: an excused miss should name its consequence, so the excuse can be judged again later.
🟢 Suggestion: the digest covers the seed text only
📁 packages/agent/tests/it/skill_confusion_matrix.rs:392-424
The gate test does what it claims: a reworded use_for or not_for fails until current.tsv is recorded again. Two things it does not cover:
- The request lists (
SKILL_CASES,CASES,REQUESTS_ANOTHER_SKILL_MUST_NOT_LEAD) are not in the digest, so a request added to the matrix leavescurrent.tsva row short with the gate green. Feeding the three lists into the same hasher closes it. - It shows the recording was made from this text, not that the live guards were run. The failure message says to run them, which is as far as a no-model test can go; one line in the doc comment would say so.
Principle: a check's doc comment should claim exactly what the check holds.
Nitpicks
- Nit:
packages/agent/tests/it/live_skill_retrieval_stability.rs:115-117—"not_for": 5(any value that is neither a string nornull) clears thenot_forsilently, where a non-stringuse_forpanics. Same class of silent mismeasure the fix closed; accept only a string ornull. - Nit:
packages/agent/tests/it/live_skill_retrieval_stability.rs:60-72— under a trial, every guard other than the matrix still passes or fails on the trial text with only a hiddeneprintln!. Now documented, which is acceptable; a variable left exported is caught only when the matrix is run. - Nit:
packages/agent/tests/it/live_skill_retrieval_stability.rs:1690— "Relationship Management 0.843 against Schema Creation's 0.805" was measured on the wording before the edge phrase came back. The seed comment dropped that figure in this commit; this doc comment kept it.
Recommendation: APPROVE
Every finding of the first review is fixed, and each fix does what it says. The merge keeps both sides. The post-review wording change is forced by a guard that arrived with main, is measured, and is recorded without hiding anything. What remains is reporting: the PR description is one commit behind, and the seed comment accounts for the costs of the not_for but not for those of the phrase. Both are text-only fixes and neither changes behaviour.
Re-review addressed (commit 7efe6a9)Addressed
Not changed
Verification
Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: the one behavioural change is a sentence added to one skill's |
…st a recorded confusion matrix
7efe6a9 to
78c2b8e
Compare
Closes #3522.
What changes
The skill fields are renamed.
skill.descriptionbecomesskill.use_forandskill.exclusionbecomesskill.not_for, with no alias and no fallback read: reset the database. The app labels them "What it's for" and "What it's NOT for", and each schema field's description carries the authoring guidance. The rename reaches the wire type (useFor/notFor), generated TypeScript, theSkillGuidanceEntryproto field, CLI output (use_forinskill guidance --jsonand in human output), the model-facing candidate summary and the skill references. The in-app prompt'sPurpose:label is unchanged. TheSKILL.mdfrontmatterdescriptionis unchanged.Three built-in skills are reworded or gain a
not_for, each measured:not_for: "Add one record of a kind that already exists. Save a view, a filter or a query."use_forleads with the linking verbs and keeps "record an edge between two nodes";not_for: "Start keeping track of a kind of thing. Mark it done, resolved or paid."use_fornames folders, filing and moving;not_for: "Start keeping track of a kind of thing. Explain how something works."A confusion matrix is kept with the live suite (
packages/agent/tests/it/skill_confusion_matrix.rs): 129 recorded rows over 114 distinct requests: each request with the skill that owns it, plus the requests a neighbouring skill must not lead.tests/golden/skill_retrieval/baseline.tsvholds the scores before the audit,current.tsvthe scores now, andcurrent.sha256a digest of the text they were measured from, which a gate test holds the seed table to.The single-list pin test is replaced.
only_measured_skills_carry_an_exclusionis gone;every_not_for_names_its_live_guardsruns in the gate and requires every seeded skill with anot_forto name live guards that exist.Measured result
On the locked
nomic-embed-text-v1.5model, against this branch merged withmain:main) pass with noSKIP. The gate does not run them: they are#[ignore]d and need the model on disk.The 18 remaining misses are listed in
NOT_YET_WONas a ratchet: a wording that wins one fails the matrix until the request is taken off the list, and a request that newly misses is a failure.Measured costs, recorded on the seed rows:
not_formoves "create a record of who made which architecture decision" from first (0.897) to third (0.844).not_forlowers two of its own requests by 0.048 and 0.024; both keep their place.mainroutes a request Stage 1 words that way to it (it leads by 0.001 with the phrase; Graph Editing leads without). The phrase narrows the skill's lead on "connect the retro notes to the sprint they belong to" to 0.004 and takes "which tasks depend on the API migration?" from first to third.not_forgives Graph Editing back the lead on "mark the outage report done" (0.032), which the rewordeduse_forhad taken by 0.002. It lowers three linking requests: "link this invoice…" by 0.006 (still first), "point rebuild task at the decision it has to respect" by 0.024 (second to third, in the window) and "this task depends on the API migration" by 0.020 (not won either way).Tried and not kept, because each broke more than it fixed: dropping the tool sentence from Graph Editing, three rewordings of Node Creation, and two other wordings of Schema Creation's
not_for.Beyond the issue text
mainremoved the installable methodologies while this was in progress, so the acceptance criteria about Playbook seeds and Playbooknot_forentries have nothing left to apply to. The Spec-drivennot_forentries measured earlier went with them.SkillUpdateris removed. It rewrote Node Creation's retrieval text at runtime with a second, unmeasured wording and was never started outside its own tests.SKILL_TEXT_OVERRIDESnames a JSON file of trialuse_for/not_fortext, so wording can be measured against the whole live suite without a rebuild.Node type sequence
skillis an existing flat core type. Two fields are renamed (use_for, required text;not_for, optional text). No field, relationship or rule is added.Docs
The companion
nodespace-docschange is committed locally and is pushed just beforebun run merge, as the node type sequence requires: theskillsheet incomponents/node-types.md,architecture/prompt-skill-system.md, ADR-064 rule 3, ADR-093,components/participation.md,development/agent-eval.mdandarchitecture/write-atomicity-inventory.md.Verification
bun run test:changedpasses with every tier in scope (frontend, scripts, skill, browser,types:check,node-types:check, Rust workspace).friendly_namethrough the generic schema form, whichtest_skill_schema_has_fieldsand the form tests cover.🤖 Generated with Claude Code