Repository navigation
Description
Summary
skill_rules.rs:51-52 ("one schema per request") packs two rules of different kinds into one paragraph — a policy about restraint and a mechanical ordering constraint — with the policy leading and supplying all the examples. An agent asked for two explicitly-linked types read the policy, correctly judged it didn't apply, and skimmed past the constraint that did.
Like #2788 and #2790, the prose emits into references/cli.md under BEGIN GENERATED markers, so the fix belongs in skill_rules.rs.
The current text
skill_rules.rs:52 (prose; :51 imperative is equivalent):
One schema per request. Create exactly the type asked for, in a single
schema createcall, then stop and report it. Don't proactively create related types the user didn't ask for (e.g. asked for "ADR" — don't also create "Ticket" or "Sprint"), and don't follow up withschema updateto wire relationships unless explicitly asked. A relationship'stargetTypemust already exist (checknodespace schema list) or be the type this call is creating; if it is neither, omit the relationship rather than creating the other type as a side effect.
Two distinct rules:
- Policy — don't invent unrequested types. Leads the paragraph, owns both examples ("Ticket", "Sprint"), and is what "then stop and report it" attaches to.
- Ordering constraint —
targetTypemust pre-exist or be self-referential. Arrives last, in a subordinate clause, framed as a side-effect prohibition.
How it failed
A user asked for "Customer + Invoice, linked" — both types explicitly requested, so the policy plainly did not apply. The agent planned a single call creating Customer with an invoices relationship pointing at a not-yet-existent invoice type. That is illegal regardless of what the user asked for, but nothing in the paragraph says so in a way that survives the policy reading: the agent reported reading the rule as being about unrequested types, which "didn't feel like our case."
It caught the error only by re-reading cli.md for unrelated syntax.
Why the framing misleads
- The two rules fail differently. The policy is about restraint — the answer is "don't." The constraint is about ordering — the answer is "sequence the calls." The paragraph only ever supplies the first answer.
- The correct action for a legitimately-requested pair is never stated. Two sequential calls:
Customerfirst, thenInvoicedeclaringbilled_to → customer, whose requiredreverseName: "invoices"gives the Customer end its accessor for free. One stored edge, readable from both ends, noschema updateneeded. The rules already contain every piece of this (:176coversreverseName;:52covers self-reference) but never assemble it for the two-type case. - "Omit the relationship" is the only escape offered, and it's the wrong one here — it silently produces two unlinked types when the user asked for linked ones.
:175repeats this ("If the target type doesn't exist yet, omit the relationship entirely"), so both places point away from sequencing. - "Then stop and report it" implies a hard stop after one call, which sits awkwardly against a user who asked for two types in one breath.
Suggested fix
Split the paragraph so the ordering constraint stands on its own with its own worked example, rather than reading as a supporting detail of the policy. The constraint needs to state the sequencing remedy explicitly:
Creating two linked types. When the user asks for a pair (e.g. "Customer and Invoice, linked"), that is two
schema createcalls, not one. Create the target type first, then the type that references it, declaring the relationship on the referencing side:Customer, thenInvoicewithbilled_to → customerandreverseName: "invoices". One stored edge, readable from both ends — noschema updatefollow-up. Declaringinvoices → invoiceon Customer first is rejected: the target does not exist yet.
Keep the policy rule intact and separate — it is correct and load-bearing.
Found via
External agent session using the nodespace skill (same session as #2788, #2790, #2791). The agent was explicit that it had read the rule and planned around it anyway, and identified the packaging as the reason — this is a framing problem, not a missing rule.
Activity
malibio commentedon Sep 22, 2026
Frontend baseline: 260 test files passed, 5240 tests passed (63.18s)
malibio commentedon Sep 22, 2026
Correction on the file path in the description: the rules live in
packages/agent/src/skill_rules.rs, notpackages/skill/src/skill_rules.rs. The line numbers cited (:51/:52, :175/:176) are correct for that file.This matters beyond a typo —
packages/agentis where the prompt golden snapshot lives, so editing these strings changes the in-app agent's system prompt and requires regeneratingstage2_candidate_block.golden. Thepackages/skill/path would have implied a markdown-only change.Also worth recording for the next reader: the rules reach two renderers, and the registry alone wires neither.
schema_creation_guidance()inpackages/agent/src/skill_pipeline.rs— the in-app agent prompt (imperative)render_schema_rules_block()inpackages/cli/examples/gen_skill_md.rs— the generatedreferences/cli.md(prose)Both use explicit named-substitution templates, so a new rule added to
SCHEMA_RULESrenders nowhere until it is interpolated into each. Aschema_rules_are_wired_or_explicitly_excludedtest catches the prompt half; nothing catches the markdown half, which is how a first pass here produced two cross-references pointing at a section that didn't exist.Relax the second-create_schema guard to permit types the user named