Skip to content

Stop create_node from silently discarding user values with no matching schema field (#1866) - #1897

Merged
malibio merged 2 commits into
mainfrom
issue-1866-create-node-empty-props
Aug 1, 2026
Merged

malibio merged 2 commits into
mainfrom
issue-1866-create-node-empty-props

Conversation

@malibio

@malibio malibio commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Closes #1866.

What this fixes

Agent-matrix scenario 4 ("Log a laser cutter checked out on the 12th, replacement cost 2400") called create_node, succeeded, and persisted zero properties — while telling the user the record was saved. 9/9 failures across three builds.

Root cause — not where the issue expected

The issue's leading hypothesis was that storage or the tool exec path was dropping values. It isn't. exec_create_node derives property_count by re-fetching the stored node, and normalize_flat_properties_to_namespace namespaces unknown keys rather than filtering them.

The model was discarding the value before the call, and said so out loud:

"…this schema does not currently support logging replacement costs; we can add it if needed!"

The Node Creation guidance covered only values matching a listed field and was silent on a supplied value with no field to hold it. Discarding was a defensible reading of the instructions as written.

Changes

  • skill_pipeline.rs — new VALUES WITH NO MATCHING FIELD section: record the value under a key of your own, never drop it, never reply that the type "doesn't support" it, and don't detour through create_schema (the skill's whitelist doesn't offer it, so that path dead-ends).
  • tools.rs — the create_node tool schema's properties description now states extra keys are allowed. Both surfaces, because the traces show routing varying across arms while the empty-call outcome stayed identical.
  • create_node_property_persistence_test.rs (new, 3 tests) — pins that a declared field's value persists, an undeclared field's value also persists, and zero is reported only when arguments were genuinely empty. That pairing is what makes fieldCount diagnostic in both directions.
  • Two guidance regression tests pinning the rule and the tool whitelist together.

Examples are deliberately neutral (weight: 40kg, not the scenario's own replacement_cost: 2400) so the fix can't be measured by the model pattern-matching the example — guidance_is_not_contaminated_by_eval_prompts enforces this and passes.

Measurement — scenario 4 is 2/3, criterion not met

3 runs, E4B @ n_ctx 32768, purged DB, daemon+CLI rebuilt from this commit, NODESPACE_HOME-isolated, guidance provenance verified before scoring.

Run Total Scenario 4 fieldCount
1 6/12 PASS 1
2 7/12 FAIL 0
3 7/12 PASS 2

Against 0/9 before. The diagnosed mechanism did not recur in any run, but 2/3 does not meet "passes across repeated runs," and the remaining failures are two different defects, filed separately:

Totals (mean 6.7) sit inside the documented 6–7 noise band, as expected for a single-scenario fix.

Testing

  • bun run test:all — no new failures vs baseline (170 files / 4097 tests).
  • Full pre-push gate green, including the Tauri-seam suite.
  • One pre-existing flake unrelated to this change: core-plugins.test.ts > should resolve viewer components times out at the 5s default under load; passes in 2.7s with headroom, and passes on the pristine primary checkout. This change is Rust-only.

🤖 Generated with Claude Code

…g schema field (#1866)

Agent-matrix scenario 4 ("Log a laser cutter checked out on the 12th,
replacement cost 2400") called create_node, succeeded, and persisted zero
properties while telling the user the record was saved.

The storage path was not at fault. `exec_create_node` derives its reported
property_count by re-fetching the stored node, so the zero was a truthful
reading, and `normalize_flat_properties_to_namespace` namespaces unknown keys
rather than filtering them. The new core test pins all three cases: a declared
field's value persists, an UNDECLARED field's value also persists, and zero is
reported only when the arguments were genuinely empty. That last pairing is
what makes the count diagnostic — "schema omitted the field" and "model
omitted the value" no longer collapse into the same reading.

The gap was in what the model was told. The Node Creation guidance covered
only values MATCHING a listed field and was silent on a supplied value with no
field to hold it. Faced with that silence the model discarded the value and
said the schema "does not currently support logging replacement costs" — a
defensible reading of the instructions as written, and silent data loss.

Both surfaces now state the rule, because scenario 4's traces show routing
varying across arms while the empty-call outcome stayed identical: guidance
alone would leave the gap open on exactly the paths that were failing.

Examples in both are deliberately neutral ("weight: 40kg") rather than the
scenario's own value, so the fix cannot be measured by the model
pattern-matching the example it was given.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01AvsJJC6NgtJuNz8fTYA163
@malibio

malibio commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

Pragmatic Code Review — PR #1897

Review Type: Initial Review

Requirements Check

# Criterion Status Notes
1 Determine why create_node persists no properties when the prompt supplies two ✅ Met, and met the right way — hypothesis space split, storage half closed with executable evidence rather than assertion. Independently verified: flatten_properties_for_api (convert.rs:69-94) strips only _-prefixed keys; normalize_flat_properties_to_namespace (crud.rs:1681) hoists unknown flat keys rather than filtering. Storage is not the culprit.
2 Fix so supplied particulars reach storage ✅ (caveat, see 🟡-1) Causal claim sound; fix targets both surfaces the model sees. Caveat: it changes where the value lands, and on core types that landing spot is contested.
3 Scenario 4 passes across repeated runs ❌ — correctly not claimed 0/9 → 2/3 is real signal (not plausibly noise), but n=3 does not clear the band #1862 established. Declining to check this box is the correct call.

Is closing #1866 on 1+2 with 3 delegated to #1895/#1896 scope-dodging? No. Those are genuinely different mechanisms (#1895 wrong node_type reaching storage unvalidated; #1896 request split across two schemas), neither fixable by this guidance edit. Bundling them would violate atomic-change.

But criterion 3 is the criterion that says the bug is fixed. Closing with it unchecked means #1866's own success condition is unverified — either leave it open pending an adequately-powered run, or restate its scope as "criteria 1+2" so the unmeasured claim isn't inherited as settled.

Findings

🔴 Critical: guidance instructs bare keys on core types — contradicts ADR-063 and bypasses the one place it's enforced

📁 packages/agent/src/skill_pipeline.rs:311

VALUES WITH NO MATCHING FIELD: ... still put it in properties under a short descriptive snake_case key of your own

Unconditional about key format; never distinguishes user-defined from core types (text, task, date). The motivating failure was a text node — a core type — so this is the default path, not an edge case. ADR-063:

Extending a core type (task, text, date, …) requires a prefix: custom:, org:, or plugin:. This is where a future core property can collide.

Confirmed empirically via a probe through real node_ops::create_node:

TEXT NODE  properties: { "email": "[email protected]" }
TASK NODE  properties: { "effort": "high", "replacement_cost": 2400, "status": "open" }

Both persisted bare. Note effort — the literal example ADR-063 cites for the collision it exists to prevent.

The cause is a validator asymmetry:

  • update_schema enforces the prefix rule (schema/mod.rs:675-714, rejects bare names when schema_is_core(...))
  • create_node enforces nothing — normalize_flat_properties_to_namespace hoists any key regardless of shape

The guidance explicitly closes the guarded door — "Do NOT call create_schema or update_schema to add the field first" — routing the model away from the validated path toward the unvalidated one. That inversion is what makes this critical: the PR doesn't merely fail to enforce ADR-063, it instructs the model to bypass the one place it is enforced. An agent following this can write {"status": "on loan"} onto a text node; status is in RESERVED_CORE_PROPERTIES (schema/mod.rs:16-29) — create_schema warns on it, create_node accepts silently.

Recommendation — scope the rule to type ownership, mirroring ADR-063's own conditional:

…under a short descriptive snake_case key of your own. If the node_type is a type the user defined (it appears in RELEVANT ENTITY TYPES), use a bare key (weight). If it is a built-in type (text, task, date), prefix with custom: (custom:weight) — bare names on built-in types are reserved.

Plus a test asserting both cases are named. Stronger option worth a follow-up issue: enforce in code, not prose. normalize_flat_properties_to_namespace knows node_type and schema_fields — it can auto-prefix or reject. Principle: enforce invariants at the boundary that owns them; guidance shapes preference, it shouldn't be the sole guarantor of a data contract.

🔴 Critical: internal contradiction with PROPERTY KEYS

📁 packages/agent/src/skill_pipeline.rs:311 vs :315

Four lines apart the model is told to invent a short descriptive snake_case key of your own (L311) and PROPERTY KEYS: ... Do NOT add namespace prefixes for schema-defined fields (L315). L315's qualifier ("schema-defined") technically spares L311's case, but its heading is the unqualified PROPERTY KEYS — a model reading it as the general key-format rule will take "Do NOT add namespace prefixes" as forbidding the exact custom: prefix ADR-063 requires. As written the two paragraphs jointly steer toward the violation. Principle: prompt sections are read as a set; a qualified rule adjacent to an unqualified heading resolves toward the heading. Reword in the same pass.

🟡-1 Key-drift risk, real and unmitigated

📁 packages/agent/src/skill_pipeline.rs:311

Inviting invented keys means one concept lands under several (weight / weight_kg / mass). ADR-063 is explicit that stored names are user-visible keys — titleTemplate tokens, CEL selectors, query filters — so drift degrades the very downstream resolution this issue cares about.

In fairness: drift is strictly better than silent loss — an inconsistently-keyed value is recoverable, a discarded one isn't. Net improvement, not a blocker on its own. But one cheap sentence would reduce it: instruct the model to prefer the user's own noun, verbatim and singular. Principle: prefer deterministic derivation over free generation when the output is a stable identifier.

🟡-2 Guidance may be unreachable on the arms that were actually failing

📁 packages/agent/src/skill_pipeline.rs:311

create_node appears in exactly one skill whitelist (Node Creation, skill_pipeline.rs:295). But #1866 records routing landing on Schema Creation, Relationship Management, Organization with the identical empty-call outcome. On those arms the Node Creation markdown is never in the prompt — only the tool-schema description does any work, and a schema description competes for far less attention than a routed skill body. Likely explains 2/3 rather than 3/3, and is a residual mechanism distinct from #1895/#1896.

🟡-3 Duplicated rule with no consistency pin

📁 skill_pipeline.rs:311 + tools.rs:512

The duplication is justified (🟡-2 is exactly why). But neither test pins the surfaces to each other — one asserts "Not limited to the listed fields", the other asserts different substrings entirely. Either can be reworded into contradiction with both tests green. Given the 🔴 requires adding the prefix rule to both, this hazard is about to get more expensive. Add one test asserting the shared semantic invariant. Principle: intentional duplication needs a consistency test, or it becomes unintentional divergence.

🟡-4 Guidance changes never reach an existing install

📁 packages/agent/src/skill_pipeline.rs (both new tests)

Seeded guidance is skipped by node type, so a reworded skill body does not propagate to an already-seeded DB. The measurement used a purged DB + rebuilt daemon — it validates the new-install path only. Half this fix (skill guidance) is inert for existing installs; only the compiled-in tool-schema half ships. Not this PR's job to fix, but it materially qualifies "fixed" and belongs in the closing comment.

🟢-1 persisted_count diverges from production, harmlessly; doc comment overstates the match

📁 packages/core/tests/create_node_property_persistence_test.rs:44-51

Doc claims it mirrors exec_create_node "with underscore-prefixed internals excluded". Production (tools.rs:1826-1831) uses plain o.len() with no filter — flatten_properties_for_api already stripped them upstream. The two agree in practice, so the extra filter is a redundant no-op, not a bug. But a reader chasing a count discrepancy would be misled. Drop the filter or reword to "belt-and-braces".

🟢-2 >= assertions under-constrain

📁 create_node_property_persistence_test.rs:96, 129

>= 2 / >= 1 would pass if storage injected extra keys; the third test correctly uses assert_eq!(…, 0). Since these exist to make a zero count diagnostic, exact counts prove more at no cost. Storage does inject defaults on core types (status: "open"), so if >= is defensive against that, say so — on a user-defined equipment schema with no defaults the count is deterministic.

🟢-3 Prose-substring assertions: brittle-but-justified, one exception

📁 packages/agent/src/skill_pipeline.rs:544, 549

Normally a smell; defensible here — the prose is the artifact under change and the alternative is an expensive nondeterministic eval. Keep most. Reconsider md.contains("doesn't support"): it pins a quoted symptom, not a rule, so an equally good reword ("never claim the type cannot store it") would fail it. The other three pin rules and are well-chosen — the whitelist cross-check especially, verifying the guidance doesn't forbid an escape hatch the skill could actually reach.

Standards Compliance ✅

No issue numbers in code/doc comments (the "agent-matrix scenario-4" framing describes behavior without a ticket ref — correct), no #[allow(dead_code)], no lint suppression, no #[deprecated], no backward-compat shims. Worktree clean; primary checkout unaffected.

Verification Performed

  • cargo test -p nodespace-core --test create_node_property_persistence_test → 3 passed
  • cargo test -p nodespace-agent --lib skill_pipeline → 14 passed (both new tests included)
  • Independent probe through real node_ops::create_node confirming bare-key persistence on core text/task (probe removed; tree clean)

Recommendation: REQUEST CHANGES

On proportionality: this is well-investigated, honestly-reported, correctly-scoped work, and the diagnostic discipline is above the bar — hypothesis split, storage exonerated with executable evidence, residual mechanisms filed separately rather than absorbed, criterion 3 left unchecked rather than fudged. The direction is right and most of it should merge close to as-is.

The blocker is narrow: the guidance tells the model to write bare property keys onto core types — the exact configuration ADR-063 prohibits and update_schema rejects — while routing the model away from update_schema, the one place the rule is enforced. The motivating failure was a text node, so this is the default path. Fixing "value silently discarded" by creating "value silently written under a key the schema layer would have refused" trades one quiet correctness problem for another, and the second is harder to detect because the value looks stored.

The fix is small: make the key rule conditional on type ownership in both surfaces, reword PROPERTY KEYS so they don't contradict, pin both with one shared test.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review status: REQUEST CHANGES (posting as a comment — GitHub does not permit request-changes on one's own PR).

Blocker: the new guidance instructs bare property keys on core types, contradicting ADR-063 while routing the model away from update_schema — the one place that rule is enforced. Motivating failure was a text node, so this is the default path, not an edge case.

Full findings in the review comment above. Addressing now.

…063)

The guidance told the model to key an undeclared value bare, unconditionally.
On a core type (text/task/date) that is the exact configuration ADR-063
prohibits and update_schema rejects — and the guidance simultaneously routed
the model away from update_schema, the one place the rule is enforced. The
motivating failure was a text node, so this was the default path, not an edge
case. Fixing "value silently discarded" that way would have traded it for
"value silently written under a key the schema layer would have refused",
which is harder to spot because the value looks stored.

Both surfaces now state the same conditional: bare on a user-defined type,
`custom:`-prefixed on a built-in one, with the reason (unprefixed names are
reserved — status, priority, due_date are real examples that would collide).

PROPERTY KEYS is renamed to PROPERTY KEYS FOR LISTED FIELDS. Its unqualified
heading sat four lines below the new rule and read as a general prohibition on
prefixes, so the two paragraphs jointly steered toward the ADR violation.

Key drift: the rule now derives the key from the user's own noun rather than
leaving it to free invention, so the same fact lands under the same key across
turns instead of weight/weight_kg/mass.

Adds both_surfaces_agree_on_the_undeclared_key_rule. The duplication across
skill guidance and tool schema is deliberate — routing does not always reach
Node Creation — but nothing pinned the two together. The first version of this
test was toothless: it asserted contains("custom:"), which the worked example
satisfies on its own, so flipping the tool schema to "bare on a built-in type"
still passed. It now asserts the prefix is tied to built-in types, verified by
mutating each surface in turn and confirming both fail.

Also from review: the "doesn't support" assertion pinned a quoted symptom
rather than a rule, so an equally good reword would have broken it; it now
pins the prohibition itself. persisted_count's doc claimed to mirror
exec_create_node's filter, but production uses a plain len() because
flatten_properties_for_api already stripped internals upstream — reworded as
belt-and-braces. The two >= assertions are now exact: equipment is
user-defined with no defaults, so a looser bound would also pass if storage
started injecting keys, which is what these tests exist to catch.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01AvsJJC6NgtJuNz8fTYA163
@malibio

malibio commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

Review addressed — 8b5a00f9

✅ Addressed (7 of 9)

🔴 Bare keys on core types (ADR-063) — the blocker

skill_pipeline.rs + tools.rs. Both surfaces now state the same conditional instead of an unconditional "snake_case key of your own":

  • node_type from RELEVANT ENTITY TYPES (user-defined) → bare key
  • node_type is built-in (text, task, date) → custom: prefix, because unprefixed names are reserved

Verified the reviewer's claim before acting on it: RESERVED_CORE_PROPERTIES (schema/mod.rs:16-29) does contain status, priority, due_date, so a bare key there is a real collision, not a theoretical one. The point about the guidance routing the model away from update_schema — the one place the rule is enforced — is what made this worth blocking on.

🔴 PROPERTY KEYS contradiction

Renamed to PROPERTY KEYS FOR LISTED FIELDS and scoped explicitly, with a pointer to the new rule. The unqualified heading sat four lines below the new paragraph and read as a blanket prohibition on prefixes — exactly the reading that would steer toward the ADR violation.

🟡-1 Key drift

The rule now derives the key from the user's own noun (lowercase, singular, snake_case) rather than leaving it to free invention, so the same fact lands under the same key across turns instead of weight / weight_kg / mass. Cheap, and turns an unconstrained generation into a near-deterministic function of the user's wording.

🟡-3 Consistency pin

Added both_surfaces_agree_on_the_undeclared_key_rule.

Worth flagging: my first version of this test was toothless. It asserted contains("custom:") — which the worked example satisfies on its own — so mutating the tool schema to "bare on a built-in type" still passed. Caught it by mutation-testing rather than trusting a green run. It now asserts the prefix is tied to built-in types, and I verified by mutating each surface in turn that both fail:

tool schema      mutated -> FAILED (good)
skill guidance   mutated -> FAILED (good)

🟢-1 / 🟢-2 / 🟢-3

  • persisted_count doc no longer claims to mirror production's filter (production uses a plain len(); flatten_properties_for_api already stripped internals upstream) — reworded as belt-and-braces.
  • Both >= assertions are now exact (== 2, == 1). equipment is user-defined with no defaults, so the count is deterministic; the reviewer's point that >= would also pass if storage started injecting keys is right, and that is what these tests exist to catch.
  • The contains("doesn't support") assertion pinned a quoted symptom; it now pins the prohibition itself, so an equally good reword no longer breaks it.

⏭️ Not addressed (2) — both deliberate

🟡-2 Guidance may be unreachable on the failing arms

Skipped as out of scope, but I think this is the most valuable finding in the review. The observation is correct: create_node is whitelisted only on Node Creation, yet #1866 records the empty call happening on arms routed elsewhere — so on those turns the tool schema is the only surface carrying the rule, and it is the weaker one. That plausibly explains 2/3 rather than 3/3.

Fixing it means changing routing or skill whitelists, which is a different change with its own blast radius and needs its own measurement. Filing separately rather than smuggling it in here.

🟡-4 Guidance never reaches an existing install

Skipped — not fixable in this PR, and partly already false. Seeding is now content-versioned (_seed.key/_seed.version, SeedTier::System = "always replaced when the template's content hash changes"), so a reworded skill body does propagate on daemon restart. The real residual constraint is that seeding only runs at startup, so a long-running daemon serves stale guidance until restarted.

Either way it qualifies the measurement rather than the code, and belongs in the issue's closing notes — which I'll add.

On requirements

The reviewer's framing is right and I've adopted it: criterion 3 is the criterion that says the bug is fixed, and it is unmet at 2/3. Nothing in this commit changes that — these are correctness fixes to the fix, not new measurement. #1866 was already closed; I'll note there that its scope was criteria 1+2, so the unverified claim isn't inherited as settled.

Verification

  • cargo test -p nodespace-agent --lib → 404 passed (was 403; +1 consistency test)
  • cargo test -p nodespace-core --test create_node_property_persistence_test → 3 passed
  • guidance_is_not_contaminated_by_eval_prompts → passes (the reworded prose still doesn't leak eval fixtures)
  • Mutation-tested the new consistency test against both surfaces (above)
  • bun run quality:fix — reverted its unrelated reformat of person_seed_test.rs; diff is only the 3 intended files
  • Full pre-push gate green: test:all + Rust workspace + Tauri-seam e2e

Re-Review Decision

Decision: RE-REVIEW NEEDED

Rationale: Both 🔴 findings were addressed by rewriting the guidance text on two surfaces — and the guidance text is the deliverable here, so these are substantive changes to the thing under review, not cosmetic edits. A new test was added, and one existing assertion changed semantics. The toothless-first-attempt on the consistency test is itself a reason for another pass: it shows this area is easy to get subtly wrong in a way a green suite doesn't catch. Worth verifying the new prose actually reads as intended and that the ADR-063 conditional is stated correctly on both surfaces.

@malibio

malibio commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator Author

Pragmatic Code Review — PR #1897 (Re-Review)

Review Type: Re-Review — 1 prior review, one new commit 8b5a00f9

Previous Review Summary

Prior finding Status
🔴-1 Bare keys on core types (ADR-063) ADDRESSED — conditional stated correctly on both surfaces
🔴-2 PROPERTY KEYS contradiction ADDRESSED — renamed + scoped, pointer to the new rule
🟡-1 Key drift ADDRESSED — key derived from the user's own noun
🟡-2 Guidance unreachable on other-routed arms DEFENSIBLY SKIPPED → #1899
🟡-3 No consistency pin across surfaces ADDRESSED — mutations independently re-run, both fail correctly
🟡-4 Guidance never reaches existing installs DEFENSIBLY SKIPPED — my original claim was stale; seeding is content-versioned. Author's correction accepted
🟢-1 persisted_count doc overstated match ADDRESSED
🟢-2 >= under-constrains ADDRESSED — now exact
🟢-3 Symptom-pinning assertion ADDRESSED — pins the prohibition

On 🟡-3: I re-ran the mutation test myself rather than trusting the reported result — given a toothless first version had already shipped, the author's own green run was not sufficient evidence. Mutating each surface in turn makes both_surfaces_agree_on_the_undeclared_key_rule fail as claimed; files restored, both checkouts clean.

Requirements Check

# Criterion Status
1 Determine why create_node persists no properties ✅
2 Fix so supplied particulars reach storage ✅
3 Scenario 4 passes across repeated runs ❌ — 2/3, explicitly not claimed

Scoping the closed #1866 to criteria 1+2 and delegating 3 to #1895/#1896/#1899 is correct and clearly recorded.

New Finding

🟠 The "in the block ⇒ user-defined ⇒ bare key" inference is unsound by construction

📁 packages/core/src/ops/context_ops.rs:296-299

let schemas: Vec<SchemaNode> = results
    .into_iter()
    .filter_map(|(node, _score)| SchemaNode::from_node(node).ok())
    .collect();          // ← no is_core filter

Retrieval is scoped only by node_type == "schema". text/task/date are stored schema nodes, SchemaNodeBehavior doesn't override get_embeddable_content, and results are rendered unfiltered under the same RELEVANT ENTITY TYPES header. So nothing structurally prevents a core type appearing in the block the new guidance treats as proof of user-definition — which would send the model back to a bare key on a core type, the exact ADR-063 violation this commit fixes.

The decisive tell is the sibling branch writing to the same relevant_schemas vector:

📁 packages/daemon/src/services/local_agent_service.rs:1878-1880

if schema.is_core {
    continue; // skip built-in types
}

One branch guards; the branch it augments doesn't. That asymmetry reads as oversight, not intent.

Why 🟠 and not a blocker: seeding uses raw store.create_node, which (unlike NodeService::create_node) does not queue_root_for_embedding, and backfill_schema_description_subtrees skips schemas lacking a legacy description — which core schemas lack. So core schema nodes are probably un-embedded on a fresh DB and cannot currently be retrieved. Latent, not live. Confirming would need a runtime check of the embedding table, which I did not run.

Recommendation: add .filter(|s| !s.is_core) at context_ops.rs:296, mirroring local_agent_service.rs:1878; same guard on skill_ops.rs:172 as defence-in-depth.

Principle: a correctness property should be enforced where it is relied upon, not left to an accident of which code path happens to populate the data.

A correction to my own prior review: I previously traced only skill_ops.rs, concluded the proxy was safe, and stated core types "cannot currently leak into RELEVANT ENTITY TYPES." That was wrong as stated — there are two producers of the block and I checked one. The finding above is the corrected version.

Assessment of the fix itself

The two-branch conditional is stated correctly and names the core types explicitly on both surfaces. The added length is justified: the guidance is a routed skill body, not the resident prompt, so the documented prompt-bloat penalty (10,493 chars scoring 50% vs 73% for 445) does not apply the same way — it is only assembled on turns that route to Node Creation. I looked for a mis-branching risk from the new conditional and don't consider it material: both branches name their trigger concretely.

Standards: no issue numbers in code/doc comments, no lint suppression, no dead code. All requested tests green (agent lib 404 passed, core persistence 3 passed, contamination guard passes).

Recommendation: APPROVE

The blocker from the prior review is genuinely fixed on both surfaces, and the fix was verified rather than taken on trust.

On the 🟠: it is pre-existing — present in context_ops.rs before this PR and untouched by it. The PR does not create it; what it does is start depending on it, turning a latent retrieval-hygiene gap into a correctness premise. That is a real increase in coupling and worth fixing, but the PR still leaves the codebase strictly better than it found it — values are no longer silently discarded, and the prefix rule is now stated on both surfaces where previously it was stated nowhere and actively contradicted.

I would not block the merge, but I'd raise the follow-up above a nit: it is the difference between the new guidance being correct by construction and correct by coincidence.

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review complete: APPROVE (posting as comment — GitHub blocks self-approval).

Both 🔴 blockers fixed on both surfaces and independently verified (mutation test re-run rather than trusted). 7/9 prior findings addressed, 2 defensibly skipped.

One new 🟠, pre-existing and latent: context_ops.rs:296 lacks the !is_core filter its sibling branch at local_agent_service.rs:1878 has, so the new guidance's "in RELEVANT ENTITY TYPES ⇒ user-defined" premise is correct by coincidence rather than construction. Not created by this PR; tracked as hardening on #1899.

@malibio
malibio merged commit db2f243 into main Aug 1, 2026
2 checks passed
@malibio
malibio deleted the issue-1866-create-node-empty-props branch August 1, 2026 18:19
malibio added a commit that referenced this pull request Aug 1, 2026
…ue refs from comments

- related_one_hop_schemas now filters is_core, closing the same class of
  gap on the incoming/outgoing relationship traversal: a user-defined
  schema relating to a core type (e.g. project -> task) could otherwise
  place that core type in related_schemas. It renders under a different
  heading than RELEVANT ENTITY TYPES so this wasn't the ADR-063 hazard
  itself, but there's no reason for a core type in either block, and
  fixing it removes reliance on core schemas happening to declare no
  relationships of their own.
- Removed #1897/#1900 references from doc comments per the documentation
  standard (describe behavior directly, cite ADRs not tickets).

Co-Authored-By: Claude <[email protected]>
malibio added a commit that referenced this pull request Aug 1, 2026
* Filter is_core schemas out of semantic schema retrieval (closes #1900)

workspace_context's semantic schema search was scoped only by
node_type == "schema", so core types (text/task/date) were retrievable
alongside user-defined ones -- unlike the sibling recently-created-schema
injection in local_agent_service.rs, which already guards on is_core.
A core type reaching RELEVANT ENTITY TYPES would make the #1897
create_node guidance read it as user-defined and write a bare property
key onto it, the ADR-063 violation that guidance exists to prevent.

Co-Authored-By: Claude <[email protected]>

* Address review: exclude core types from related_schemas too, drop issue refs from comments

- related_one_hop_schemas now filters is_core, closing the same class of
  gap on the incoming/outgoing relationship traversal: a user-defined
  schema relating to a core type (e.g. project -> task) could otherwise
  place that core type in related_schemas. It renders under a different
  heading than RELEVANT ENTITY TYPES so this wasn't the ADR-063 hazard
  itself, but there's no reason for a core type in either block, and
  fixing it removes reliance on core schemas happening to declare no
  relationships of their own.
- Removed #1897/#1900 references from doc comments per the documentation
  standard (describe behavior directly, cite ADRs not tickets).

Co-Authored-By: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

create_node succeeds but persists zero properties: matrix scenario 4 drops the user's supplied values

1 participant