Skip to content

Skill exclusion text: penalize retrieval score when a query matches what a skill is not for #2268

Closed

Description

@malibio

Give a skill an optional exclusion text, meaning a description of what it is not for. Embed it as its own vector and use it to lower the skill's retrieval score when a query matches it.

Status: undeferred. This was filed as deferred pending evidence that description wording can't fix a real overlap and that per-skill scores could be measured. #3076 supplied both (measurements below), and it is the first case this fixes.

Why a separate vector

Skill descriptions are embedded for retrieval (SkillNodeBehavior::get_embeddable_content, packages/core/src/behaviors/mod.rs), and an embedding can't represent negation. A description that says "not for X" embeds closer to X. That's why the scoping rules live in the guidance markdown today. An exclusion turns the unwanted region into a positive vector of its own and subtracts it. This is the same idea as hard-negative scoring in two-tower retrieval.

Evidence (#3076)

All figures come from the locked nomic-embed-text-v1.5 over the full seeded registry.

"remove the resolved tickets" ranks Graph Editing 0.855 > Node Deletion 0.841. delete_node is admitted only from the winning candidate, so it is silently withheld.

Rewording can't separate the two requests. About 30 description and title variants were tried. On every Graph Editing variant, its score on "remove the resolved tickets" moved nearly 1:1 with its score on "mark incident resolved". The two queries differ only in the verb, and the embedding barely weights it. The best variant (dropping "resolved") fixed the target by +0.020, but it left "mark incident resolved" and the Rowan prompt only 0.003 above rank 4. Retitling Node Deletion ("Deletion and Removal") won every deletion query, but it pulled Node Deletion back into the top 3 on "mark the task as done", which is the attractor failure #2240 removed.

An exclusion does separate them. Graph Editing's exclusion was "Delete, remove, erase, purge, discard, or get rid of records so they no longer exist.", scored with the margin form below at λ=1.0:

query Graph Editing before → after effect
remove the resolved tickets 0.855 → 0.810 Node Deletion #1 by +0.031 (was −0.014)
remove the closed tickets 0.789 → 0.720 Graph Editing leaves the top 3
delete the incident, it's resolved 0.870 → 0.806 leaves the top 3
remove the done tasks / completed items 0.884 / 0.877 → 0.834 / 0.816 wider Node Deletion margin
mark incident resolved / Rowan / mark invoice paid / mark task done unchanged the penalty never fires
remove the due date from the launch task (an update) 0.800 → 0.788 the one cost: still top 3, but "remove a field" and "remove a record" look alike

Every other guard in live_skill_retrieval_stability.rs is unchanged (Conflict Journal rank 1, Schema Creation, Relationship Management, Node Creation, Organization).

Exclusions must be measured per skill. Giving Node Deletion the exclusion "mark a record resolved, done, or paid, or set or change a field…" hurt it: real deletion requests contain "resolved" and "paid", so it lost rank 1 on 4 deletion guards.

Design decisions (answering this issue's open questions)

  • Penalty form: margin, not plain subtraction. score' = score − λ · max(0, sim(q, exclusion) − score). Plain score − λ·sim(q, exclusion) lowers the skill on every query, because all similarities sit around 0.8. That shifts its level against skills that have no exclusion and pushes it through the absolute score bars. The margin form only acts on queries that are closer to the exclusion than to the description, which is why the completion-state rows above don't move.
  • Score bars apply after the penalty. Under the margin form, the penalty only lowers a skill on queries that match its exclusion better than its description, so it can't push a skill below its bar on its own intended requests.
  • λ = 1.0, measured. At λ=0.5 the target margin is only +0.009.
  • Maintenance cost. Only skills with a measured overlap carry an exclusion (one, to start). Each exclusion ships with a guard test showing it doesn't suppress a legitimate use.

Prerequisites (original list)

Acceptance criteria

  • Optional exclusion property on skill nodes, embedded as a separate vector
  • Retrieval applies the margin penalty; score bars read the adjusted score
  • Graph Editing seeded with the deletion-verb exclusion; no other skill gets one without a measured case
  • "remove the resolved tickets" routes to Graph Editing, silently withholding delete_node #3076's phrasings rank Node Deletion first on every rep ("remove the resolved tickets" plus similar "remove … resolved/closed/done" phrasings)
  • Guard: "remove the due date from the launch task" keeps Graph Editing in the top 3
  • All existing tests in live_skill_retrieval_stability.rs pass
  • Test that the exclusion changes no completion-state score (penalty inert on non-matching queries)

Related: #3076 (the failing case), #2240 (why delete_node is admitted only from the winner), #2265.

Activity

  1. changed the title [-]Deferred: negative-relevance property on skills, subtracted from retrieval score[/-] [+]Skill exclusion text: penalize retrieval score when a query matches what a skill is not for[/+] on Sep 26, 2026
  2. added a commit that references this issue on Sep 27, 2026
    53ad655
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