Skip to content

create_node discards user-supplied schema field values: instances persist as bare shells (guidance/prose, not tool schema) #1841

Closed

Description

@malibio

Overview

create_node persists a bare shell — content and type only — discarding every schema field value the user supplied in the same message. Split from #1839, where it was found while fixing that issue's 3→4→6 fixture chain.

Evidence

Reproduced directly, isolated daemon (NODESPACE_HOME=/tmp/ns-dump-test), gemma-4-e4b-q4km, n_ctx 32768, purged DB, freshly built daemon.

Schema created from "...equipment my team checks out, whether it's been returned, and what each item costs to replace":

schema get equipment_item
  fields: [ is_returned (boolean), replacement_cost (number) ]

Then "Log a laser cutter checked out on the 12th, replacement cost 2400":

Tool executed tool=create_schema is_error=false result_field_count=2
Tool executed tool=create_node   is_error=false result_field_count=0
  args_preview={"content":"Laser Cutter Check Out Record","node_type":"equipment_item"}

The persisted node:

{ "node_type": "equipment_item",
  "properties": { "equipment_item": { "_schema_version": 1 } } }

No cost, no date, no status. The call succeeds and reports no error.

Mechanism — it is a prose/guidance problem, not tool schema or context

Ruled out by reading the verbatim prompt via NODESPACE_PROMPT_DUMP, rather than inferring:

1. The tool schema is correct. properties is offered, typed, and documented, with an example value:

"properties": { "description": "Schema field values (e.g. {\"status\": \"active\"}). ...", "type": "object" }
"required": ["node_type", "content"]

2. The field names reached the model. The system prompt for that exact turn contained:

RELEVANT ENTITY TYPES:
- equipment_item: Equipment Item (is_returned, replacement_cost)

So replacement_cost was in the prompt, and "replacement cost 2400" was in the user message, in the same context window.

3. The guidance instructing it is present and emphatic. skill_pipeline.rs:300-325 ("Node Creation Guidance") says "Call create_node NOW with all values from the user message", "REQUIRED FIELDS: ... MUST be included in the properties map. Optional fields should be included if the user provided a value", and carries a worked example with a fully populated properties map. The [routed skills] marker added in #1839 confirms this skill routes on these turns (routed_skills=Organization, Research & Search, Node Creation).

So the model had the parameter, the field names, the values, and an explicit instruction with an example — and still omitted properties. Under ADR-064 that places this at rule 5 (prose), not rule 1 (tool schema): nothing about the call surface is missing or wrong. Two candidate directions, both prose-shaped:

  • properties is optional in the schema and hedged in the tool description ("Optionally pass 'properties' if the schema type has fields"), which reads as permission to skip it. The skill guidance's stronger instruction is competing with a weaker one on the tool itself.
  • The Node Creation skill's own instruction is dominated by its opening "IMMEDIATE ACTION REQUIRED ... do not output any planning text" framing, which optimizes for firing the call fast. Worth testing whether the urgency framing is crowding out the field-population instruction — cf. Reduce the resident prompt to identity and policy (measured 50% vs 73% for identity-only) #1827's finding that a long resident prompt measurably diluted its own rules.

Worth checking the two against each other before changing anything, same as the rest of this workstream.

Why this matters more than one scenario

Scenario 4 is not the only site. Scenario 8c does the same thing — "Put down Kind of Blue, it's by Miles Davis" creates an album_tracker node with no artist property.

8c/8d/8e may be one bug, not three. In the agent-matrix eval, scenarios 8d and 8e run after 8c in the same chat and both fail with zero tool calls. 6's failure is downstream of 4's property loss in exactly this way: the value 6 keys on was never stored, so no correct action exists. If 8d/8e are downstream of 8c the same way, fixing this single bug could clear three scenarios at once (6, 8d, 8e) — worth weighing in prioritization, and worth confirming before assuming the 8-series failures are independent.

What #1839 already did about it

#1839 added minProperties to the matrix fixture's toolOnce expectation and set it on scenario 4, so a zero-property create_node now fails loudly instead of scoring green. That is detection only — the eval drops 9/12 → 8/12, honestly reporting a break it was previously hiding. It also added property_count to create_node's tool result and folded it into result_field_count, so the persisted count is observable per call.

This issue is the fix.

Acceptance Criteria

  • Determine which of the two prose candidates (or another cause) is responsible, measured rather than assumed
  • create_node populates properties with the schema field values present in the user's message, verified against the persisted node and not just the tool call
  • Confirm whether 8d/8e failures are downstream of 8c's property loss
  • Re-run bun run eval:agent; scenario 4 passes its minProperties assertion, and report the resulting score

Architecture Impact

Likely ADR-064 rule 5 (prose) — tool description and/or seeded skill guidance. No tool-surface or storage change expected; exec_create_node already merges both nested properties and flat top-level extras correctly.

Activity

  1. malibio commented on Jul 31, 2026

    @malibio
    CollaboratorAuthor

    Baseline (fresh worktree, issue-1841-create-node-properties): Frontend: 171 test files passed, 4112 tests passed, 0 failed.

  2. self-assigned this
    on Jul 31, 2026
  3. malibio commented on Jul 31, 2026

    @malibio
    CollaboratorAuthor

    Investigation note: the checked-in eval trace is stale evidence for this issue — do not use it

    Before designing arms I checked scripts/results-e4b.json / .trace.jsonl for scenario 4. That trace does not show this bug, and would mislead anyone reproducing from it.

    In that run the model replied:

    "I used a placeholder for the year and day in checkout_date... this schema does not currently support logging replacement costs; we can add it if needed!"

    Scenario 3 in that same run created Equipment Inventory with fields status, checkout_date, due_date — and genuinely no cost field. So the model's statement was factually correct: there was no replacement_cost to populate. That is the fixture gap #1843 fixed, not a prose failure.

    Cause: results-e4b.json was last written by #1831 (905c5fc3), three commits before #1843 (756243a4) added the "and what each item costs to replace" clause to scenario 3. Scenario 3 builds its schema from natural language, so its field set is model-chosen per run, not fixed — which is exactly why a stale results file can look like a different bug entirely.

    This does not invalidate the issue. The repro in the description used the current schema (is_returned, replacement_cost), had replacement_cost in the prompt's RELEVANT ENTITY TYPES block, and still persisted zero properties. That remains the bug to fix.

    What it does change:

    1. The stale trace must not be cited as evidence of property-dropping, and any re-run must regenerate results after the Fixture: agent-matrix scenarios 3->4->6 key on a value the chain never persists; trace doesn't record offered tools/routed skill #1843 fixture.
    2. Scenario 4's minProperties: 1 can fail for two distinct reasons — the model dropping values it could have stored (this bug), or scenario 3 not creating a field to store them in (a fixture-variance artifact). A measurement that doesn't separate these will mis-attribute. I'll capture the scenario-3 field set alongside each scenario-4 result so the two are distinguishable.

    Both prose candidates from the description are confirmed present in source: tools.rs:498 ("Optionally pass 'properties'") and skill_pipeline.rs Node Creation guidance. Proceeding to measure them against each other, unless redirected.

  4. malibio commented on Jul 31, 2026

    @malibio
    CollaboratorAuthor

    Root cause found — and it is not either prose candidate

    Reproduced on the current build (freshly built daemon, purged DB, NODESPACE_HOME isolation verified via served_db_path, E4B, n_ctx 32768). Schema came out as the issue describes — equipment_item (is_returned: boolean, replacement_cost: number) — and the instance turn produced:

    [tool] create_node [fields=0]
    persisted: { "node_type": "equipment_item", "properties": { "equipment_item": { "_schema_version": 1 } } }
    

    Emitted call, verbatim from NODESPACE_PROMPT_DUMP:

    {"content":"Laser Cutter Check Out Record","node_type":"equipment_item"}

    No properties key at all — not an empty one.

    The guidance tells the model to read a structure that is not in its context

    The Node Creation guidance refers to schema_metadata six times:

    • "Read the fields array from schema_metadata"
    • "Required fields (required=true) MUST be included"
    • "the field name exactly as it appears in schema_metadata fields[].name"
    • "take every value from schema_metadata" (×2, in the worked example)
    • "your node_type is the type_id from schema_metadata"

    I grepped the verbatim prompt for that turn. All six occurrences are the guidance mentioning the name. Not one is an actual payload. There is no schema_metadata object, no fields array, no required flag anywhere in the model's context.

    What the model actually gets is one line:

    RELEVANT ENTITY TYPES:
    - equipment_item: Equipment Item (is_returned, replacement_cost)
    

    Source — packages/core/src/ops/context_ops.rs:246-247:

    let field_names: Vec<&str> = schema.fields.iter().map(|f| f.name.as_str()).collect();
    let fields_str = format!(" ({})", field_names.join(", "));

    Field names only. Type and required-ness are dropped on the floor.

    So every field-population instruction in the skill is unsatisfiable as written: it directs the model to a fields array that does not exist, and conditions inclusion on required=true, which is never rendered. The model is not ignoring the instruction — it cannot follow it, and falls back to the two params it can ground (content, node_type), which are exactly the two it emitted.

    This reclassifies the issue

    The description places this at ADR-064 rule 5 (prose), on the reasoning that "nothing about the call surface is missing or wrong." That holds for the tool schema — properties is offered and correctly typed, and I confirmed the grammar from #1844 permits it (it is derived from the tool schemas and constrains syntax, not which optional fields are chosen). But it does not hold for the context surface: the guidance's named input is absent. That is rule 1, and it explains the failure without needing either prose candidate.

    Both prose candidates are real and still worth cleaning up, but on this evidence neither is the cause — rewording an instruction cannot fix an instruction whose referent does not exist.

    Proposed fix

    Render the field metadata the guidance already assumes: emit type and required-ness in the entity-types block, so schema_metadata fields[].name/required=true have a referent. Cheapest correct version is extending context_ops.rs to render e.g. - equipment_item: Equipment Item (is_returned: boolean, replacement_cost: number), and aligning the guidance's wording to whatever that block is actually called.

    Measuring that against the current baseline next, plus a prose-only arm as a control so the attribution is tested rather than assumed. Proceeding unless redirected.

  5. malibio commented on Jul 31, 2026

    @malibio
    CollaboratorAuthor

    Fix verified against the persisted node

    Same isolated environment, purged DB, daemon rebuilt from the fix (3902a742), same two prompts.

    Before — entity block (is_returned, replacement_cost):

    create_node [fields=0]
    emitted:   {"content":"Laser Cutter Check Out Record","node_type":"equipment_item"}
    persisted: { "equipment_item": { "_schema_version": 1 } }
    

    After — entity block (is_returned: boolean; replacement_cost: number):

    create_node [fields=1]
    emitted:   {"content":"laser cutter checked out on the 12th","node_type":"equipment_item","properties":{"replacement_cost":2400}}
    persisted: { "equipment_item": { "_schema_version": 1, "replacement_cost": 2400 } }
    

    The value the user supplied now reaches storage, confirmed by reading the node back rather than trusting the tool call.

    What changed (commit 3902a742)

    1. context_ops.rs — the real fix. Renders each field's name, type, and required-ness, so the guidance's fields[].name / required=true instructions have a referent. Type and required-ness were already on SchemaField; the renderer was discarding both.
    2. skill_pipeline.rs — repointed the guidance's five schema_metadata references at RELEVANT ENTITY TYPES, the block that actually exists, and made the omission consequence explicit ("properties is the ONLY way any field value is stored").
    3. tools.rs — de-hedged the description (candidate 1 from the issue): "Optionally pass 'properties'" → "Always pass 'properties' with every schema field value the user supplied."

    Also corrected the stale module doc on context_ops.rs that claimed entity types are discovered via search_skills returning schema_metadata — the claim that made the guidance's phantom referent look correct.

    Attribution caveat, stated honestly

    I shipped all three changes together and measured them together, so this single repro does not isolate which one carries the effect. I consider the rendering change primary on mechanism (it supplies a referent that was absent; rewording alone cannot fix an instruction whose target does not exist), but that is reasoning, not measurement, and n=1 on a nondeterministic model.

    Scenario 4 stores one of the two values (cost, not the date/return-status), which satisfies minProperties: 1 and the fixture's stated intent — asserting "the particulars reached storage" rather than pinning which field.

    Next: full bun run eval:agent for the score, and checking whether 8d/8e are downstream of 8c.

  6. malibio commented on Jul 31, 2026

    @malibio
    CollaboratorAuthor

    Eval result: 9/12, and the 8d/8e question answered — they are not downstream of 8c

    bun run eval:agent, commit 3902a742, E4B, n_ctx 32768, purged DB, daemon rebuilt.

    Passed: 9/12
    ✓ 1 ✓ 2 ✓ 3 ✓ 4 ✓ 5 ✗ 6 ✓ 7 ✓ 8a ✓ 8b ✓ 8c ✗ 8d ✗ 8e
    

    Scenario 4 passes its minProperties assertion — 8/12 → 9/12 against the honest post-#1839 baseline.

    AC3: are 8d/8e downstream of 8c's property loss? No — three separate causes.

    The issue proposed that fixing this bug could clear 6, 8d and 8e at once. Measured, it does not, and each fails differently:

    Why 8c can't store the artist: a separate, pre-existing bug in schema creation

    album_tracker and venue_tracker were both created with fields is_returned and replacement_cost — the equipment fields, copied verbatim. From the daemon log, all three create_schema calls emitted byte-identical fields arrays:

    {"fields":[{"name":"is_returned",...},{"name":"replacement_cost",...}],"name":"Equipment Item"}
    {"fields":[{"name":"is_returned",...},{"name":"replacement_cost",...}],"name":"Album Tracker"}
    {"fields":[{"name":"is_returned",...},{"name":"replacement_cost",...}],"name":"Venue Tracker"}
    

    So 8c had no artist field to populate — the same shape as the stale-trace artifact I flagged earlier, and unwinnable by construction.

    I tested whether my change caused this, since rendering types could plausibly make the retrieved schema a more copyable template:

    condition "Start tracking albums" produces
    clean DB, no equipment schema, with fix genre ✅
    equipment schema present, with fix is_returned, replacement_cost ❌
    equipment schema present, pre-fix (bd29598f) is_returned, replacement_cost ❌

    Identical pre- and post-fix — the contamination is pre-existing and my change is not responsible. It also reproduces across separate chat nodes, so it travels via semantic schema retrieval (the RELEVANT ENTITY TYPES block), not conversation history: a retrieved schema is being copied as a template for a new, unrelated type.

    That is its own bug and out of scope here. I'll file it separately unless you'd rather it fold into this issue.

    Recommendation

    Add minProperties: 1 to 8c so it stops scoring green on this bug — but only once the schema-contamination bug is fixed, since 8c is currently unwinnable and the assertion would just convert a false pass into a blocked failure. Flagging rather than doing it here.

  7. malibio commented on Jul 31, 2026

    @malibio
    CollaboratorAuthor

    Filed the schema-contamination bug as #1846 — including the pre-/post-fix control showing it is not caused by this change, and the recommendation to add minProperties to 8c once it is winnable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions