Repository navigation
Description
Overview
Split out of #1896. PR #1904 fixed the routing/retrieval symptom in #1896 — the Schema Creation skill wasn't being surfaced by semantic retrieval for "keep a record of X" phrasing, so create_schema was unreachable and the model fell back to a bare create_node or split the request across two schemas trying to recover. That's now verified fixed via two independent purged-DB/rebuilt-daemon eval:agent matrix runs (scenario 3 passes cleanly with exactly one create_schema call; the matrix went 4/12 → 7/12 passing).
However, #1896's second acceptance criterion is untouched by that fix: "If a split is ever correct, the resulting types are actually linked and both are populated — no silently empty half."
Problem Statement
Now that routing correctly reaches the Schema Creation skill for these prompts, nothing stops the model from still creating two schemas within one skill invocation and only populating one:
- Schema Creation's
tool_whitelistallowscreate_schemato be called up to 3 times (max_iterations: 3) within a single skill invocation — nothing structurally prevents a second call. - Nothing checks that a
create_relationshipbetween two newly-created schemas actually succeeded before the skill reports success to the user. In the original Model splits one tracking request into two schemas, populates one, and leaves the other empty and unlinked #1896 measurement,create_relationshiperrored (the target type didn't exist yet when the call was formed) and the model proceeded anyway, reporting success while leaving the second type empty and unlinked. - The existing
ONE_SCHEMA_PER_REQUESTprose rule (packages/agent/src/skill_rules.rs) already covers this correctly in words — "Create exactly the type the user named... Do NOT proactively invent or create related types... omit the relationship rather than creating the other type" — but as with create_node accepts a nonexistent node_type (display name instead of schema id) and silently persists zero properties #1895 and create_node succeeds but persists zero properties: matrix scenario 4 drops the user's supplied values #1866, an existing correct prose rule being silently violated by the model is not fixed by restating it harder.
Proposed Solution
Add a structural backstop for when the model doesn't follow ONE_SCHEMA_PER_REQUEST, following the pattern used in #1895 (PR #1902 added NodeServiceError::UnknownNodeType — a code-level guard that fails loudly instead of silently persisting a broken state) and #1866 (PR #1897 added persisted-value guidance backed by new tests).
One approach to evaluate (not prescriptive — the actual mechanism needs its own investigation before a fix is settled): if a skill invocation's trace shows 2+ create_schema calls without an intervening successful create_relationship, either surface a stronger warning in the next tool result, or reject the second create_schema call outright and require an explicit relationship step before allowing a second schema in the same request.
Acceptance Criteria
- A second
create_schemacall within one skill invocation is either rejected with an actionable error, or requires the model to first successfully link the prior schema viacreate_relationship - If a
create_relationshipbetween two just-created schemas fails, the failure is surfaced to the user rather than silently reported as success - Regression test coverage for both cases
- Code passes
bun run quality:fix - Tests pass (
bun run test:all)
Technical Specifications
Reference Files
packages/agent/src/skill_rules.rs:ONE_SCHEMA_PER_REQUEST— the existing prose rule this issue backstopspackages/agent/src/skill_pipeline.rs: Schema Creation skill definition (tool_whitelist,max_iterations: 3)packages/agent/src/local_agent/tools.rs:exec_create_schema,exec_create_relationship— where a structural guard would likely livepackages/core/src/services/error.rs: pattern for a new loud, code-level error type, perNodeServiceError::UnknownNodeTypeadded in create_node accepts a nonexistent node_type (display name instead of schema id) and silently persists zero properties #1895 (PR Reject create_node against a nonexistent node_type (closes #1895) #1902)
Dependencies
- Model splits one tracking request into two schemas, populates one, and leaves the other empty and unlinked #1896 (parent — this issue covers its unaddressed second acceptance criterion)
Related Issues
- Model splits one tracking request into two schemas, populates one, and leaves the other empty and unlinked #1896 (parent)
- create_node accepts a nonexistent node_type (display name instead of schema id) and silently persists zero properties #1895 (prior issue establishing the code-level-guard-over-prose pattern this follows)
- create_node succeeds but persists zero properties: matrix scenario 4 drops the user's supplied values #1866 (prior issue establishing the guidance-backed-by-tests pattern this follows)
PR #1904 fixes #1896's routing symptom (criteria 1 and 3); this issue covers criterion 2.
Activity
malibio commentedon Aug 2, 2026
Frontend baseline: 171 test files passed, 4108 tests passed (49.10s).