Repository navigation
Description
Problem
A new SchemaRule can be registered in SCHEMA_RULES and never reach the in-app agent's prompt. Nothing catches it.
This is not hypothetical — it happened during review of PR #2435. DELETE_A_SCHEMA was written, registered, and rendered into the shipped SKILL.md, but was never interpolated into schema_creation_guidance(). The result: the external shell agent got the new guidance, and the in-app local agent — the surface holding both create_schema and delete_node — did not. The rule existed and did not fire.
Why the existing guards miss it
SchemaRule carries two renderings (packages/agent/src/skill_rules.rs:25-32), consumed by two different renderers, as the module doc at :14-18 states:
prose→ the shippedSKILL.md, viagen_skill_mdimperative→ the in-app agent prompt, viaschema_creation_guidance()(packages/agent/src/skill_pipeline.rs:75-84)
Two tests exist, and neither closes this:
every_schema_rule_reaches_the_skill(packages/cli/tests/skill_md_generation.rs:541) iteratesSCHEMA_RULESbut asserts onlyrule.prose. Its own doc comment describes this bug class — "registering a rule in theSCHEMA_RULESarray is NOT enough to publish it" — so it is half-guarded by construction.- The
prompt_assembly_snapshotgolden cannot catch it. An unwired rule never enters the rendered prompt, so the golden never changes. It detects modifications to rules already wired in, and stays silent on exactly the omission that matters.
Current state
SCHEMA_RULES has 15 entries (skill_rules.rs:161-177). 10 are interpolated into schema_creation_guidance() (skill_pipeline.rs:75-84). The 5 that are not:
NO_NAME_TITLE_FIELDFIELDS_FROM_REQUEST_ONLYNAME_PLACEHOLDER_EXCEPTIONENUM_FORMATENUM_EDGE_FIELDS
All five are field/enum shape rules — the category ADR-064 deliberately moved onto create_schema's tool schema rather than the prompt. So the omissions are correct today; what is missing is anything recording that they are deliberate.
Fix
A test over SCHEMA_RULES asserting each rule is either interpolated into schema_creation_guidance() or present in an explicit prose-only exclusion list.
The exclusion list is the substance, not the boilerplate: it must name the five rules above and record the ADR-064 rationale inline, so a future reader can tell a deliberate omission from a forgotten one. That is the fact currently written down nowhere.
Trade-off, considered and accepted
This was raised during review and deliberately deferred, on the argument that a hand-maintained exclusion list is itself a drift source. That is a fair objection, and it is why this is a separate issue rather than a change bolted onto PR #2435.
The counter-argument: an exclusion list drifts loudly — a rule added to the list without justification is visible in review. The status quo drifts silently, and has already produced one shipped defect. A list of 5 entries against 15 rules is a manageable surface.
Acceptance criteria
- A test asserts every
SCHEMA_RULESentry is either interpolated intoschema_creation_guidance()or explicitly listed as prose-only - The exclusion list names the 5 rules above and records the ADR-064 rationale inline
- The test fails when a new rule is added to
SCHEMA_RULESwithout being wired or excluded — verify by temporarily adding one - The failure message says what to do (wire it, or add it to the list with a reason), not just that a count mismatched
Activity
malibio commentedon Sep 8, 2026
Frontend: 4895 passed