Repository navigation
Description
Overview
Two independent, both-required fixes are needed for title-templated nodes (e.g. person) to behave correctly end-to-end:
(A) Backend wire-protocol bug: title is computed correctly by NodeService and persisted correctly to SQLite, but is silently dropped at the daemon's gRPC serialization layer — no client (CLI, Tauri desktop app, MCP) ever receives it, for any node type that uses a title_template.
(B) Missing client-side reactive computation: per ADR-077, the editing client is supposed to compute its own title locally and instantly (no network round trip), independent of the backend. This was never wired up — an existing, tested utility (evaluateTitleTemplate) sits unused. This applies to every title-templated node type, not just person.
This was originally investigated and partially fixed as a person-node-specific frontend bug (PR #2552, which routed person-schema-form.svelte's save through sharedNodeStore.updateNode). That fix was real, necessary, and should not be reverted — but it addressed neither (A) nor (B), so the underlying bug persisted on a fresh install.
Problem Statement
User Experience:
- User edits a person node's first/last name (or any other titled entity type's fields)
- Nothing updates instantly in the editing client's UI (no client-side computation exists — gap B)
- Backend correctly computes and stores the title (verified directly in SQLite:
title = "Michael Libio",version = 4) — but no client the daemon serves ever receives it, because it's never included in the wire payload (gap A)
Evidence (verified against a live fresh-install v0.2.10 daemon, 2026-09-13):
$ nodespace node get 8b87f496-ef93-40a5-b005-9f6cacad52c1 --json
{
"content": "",
"id": "8b87f496-ef93-40a5-b005-9f6cacad52c1",
"node_type": "person",
"properties": { "first_name": "Michael", "last_name": "Libio" },
"version": 4
// no "title" field at all
}
$ sqlite3 ~/.nodespace/database/nodespace.db \
"SELECT id, title, version FROM node WHERE id='8b87f496-ef93-40a5-b005-9f6cacad52c1';"
8b87f496-ef93-40a5-b005-9f6cacad52c1|Michael Libio|4
The title is correct and current in storage. The CLI (and every other gRPC client) simply never receives it.
Architecture Impact
ADR-077 (Client-Computed Title Template, No Self-Echo Required) was written during this investigation to formally capture a previously-undocumented decision. It establishes:
- The editing client computes its own title locally, instantly, from the schema's
titleTemplateand in-progress field values — no dependency on a network round trip or a domain-event broadcast. - The backend still independently computes and persists its own authoritative title (
compute_title()), which every other reader of the node (other panes/windows/devices, CLI, MCP tools) depends on. - No domain-event echo is required or expected for the editing client to reflect its own change — extending the existing self-echo handling for content writes (ADR-026) one layer up.
- A server-provided title is never ignored on a normal read (first open, pane switch, app launch) — only the self-echo-of-my-own-edit case is skipped.
components/schema-management.md's Title Templates section was updated in the same change to reflect this (previously described title computation as backend-only).
This issue implements both halves of ADR-077 plus the independent proto bug that ADR-077 explicitly calls out as a non-goal (necessary regardless, not a substitute for the ADR's client-side computation).
Root Cause — (A) Proto/Wire Bug
Location: packages/daemon/src/services/node_service.rs:2170-2182 (node_to_proto)
pub(crate) fn node_to_proto(node: Node) -> NodeData {
NodeData {
id: node.id,
node_type: node.node_type,
content: node.content,
properties: node.properties.to_string(),
version: node.version,
lifecycle_status: node.lifecycle_status,
created_at: node.created_at.to_rfc3339(),
modified_at: node.modified_at.to_rfc3339(),
markdown: String::new(),
// title is never set — NodeData has no `title` field to set it on
}
}The NodeData proto message (packages/proto/proto/node_service.proto:147-167) has no title field at all — it was apparently never added when server-side title computation was introduced. title only exists in the unrelated NodeReference message (line 821-826, used by get_mentioning_containers()), not in NodeData, which is what every node read/query/event actually uses. NodeEvent.updated/NodeEvent.created (line 466-485) also carry NodeData, so the same gap applies to the Tauri desktop app's domain-event-driven re-hydration path (TauriSyncListener → fetchAndUpdateNode → sharedNodeStore.setNode), not just direct fetches.
Why it happens:
- The backend chain —
NodeService::compute_title,update_with_version_check_returning_node, and the SQLUPDATE ... SET title = ?4insqlite_store/nodes.rs— is fully correct and was verified directly against live data node_to_protois a hand-written field-by-field mapping betweenNode(the internal struct, which does havetitle) andNodeData(the wire struct, which does not); nothing enforces that the two stay in sync when a field is added to one but not the other- This affects every node type with a
title_templateconfigured (not justperson) and every client that reads nodes over gRPC (CLI, Tauri app, MCP) — it is not a person-specific or frontend-specific bug
Root Cause — (B) Missing Client-Side Computation
Location: packages/desktop-app/src/lib/components/property-forms/person-schema-form.svelte and equivalent schema-driven property forms
packages/desktop-app/src/lib/utils/title-template.ts already implements evaluateTitleTemplate(template, fieldValues) and evaluateSummaryTemplate(template, fieldValues, fields) — genuine client-side {field} token interpolation, explicitly written to mirror the backend's interpolate_title_template_with_schema, with its own unit tests. Zero production components import it.
Confirmed general, not person-specific:
person-schema-form.svelte: inputs useonblurhandlers, notoninput/bind:value— no reactive computation fires on keystroke at all.updateField()writes viasharedNodeStore.updateNode, and title is expected to arrive "once persistence resolves" — i.e. only via round trip.task-schema-form.svelteandgeneric-schema-form.svelte: zero references totitleat all; neither callsevaluateTitleTemplate/evaluateSummaryTemplateor usesoninput.node-display-title.ts'sresolveTitleOrContentonly decides whether to displaynode.titlevsnode.content— no interpolation, just reads whateversharedNodeStorealready has.shared-node-store.svelte.tsonly ever setstitlefrom a backend response, never computes one locally.
So today, title display for every schema-driven type is 100% backend-round-trip-dependent, with no client-side fallback or instant preview. This is very likely the direct cause of the specific "field shows placeholder text, appears blank on blur" symptom observed: nothing recomputes a preview locally on input, so there's no local echo of what was just typed while any round trip is in flight.
Why This Wasn't Caught By Existing Tests
(A) There is an existing regression test for title-template-driven title recompute (packages/core/src/services/node_service/mod.rs:7451-7488, guarding a past issue, using the task schema) — but it calls NodeService methods directly, in-process, and asserts against the Node struct returned from the service/store layer. That struct does have title populated correctly; the test passes because it never crosses the daemon's gRPC boundary where the field is actually dropped. The gap is a missing layer of coverage (nothing exercises node_to_proto → the actual proto wire format → client-side deserialization), not a missing test case for a specific type.
(B) packages/desktop-app/src/tests/components/property-forms/person-schema-form.test.ts:375-415 is the only frontend test asserting on .title after a save flow (relied on by PR #2552). It mocks backendAdapter.updateNode to return a hand-fabricated response where the test itself computes title: \${first_name} ${last_name}`.trim() || 'Untitled', explicitly commented as "standing in for a backend that correctly recomputes the title" — an assumption that was false on two counts (the backend doesn't send it at all, per (A); and even if it did, the client isn't supposed to depend on the round trip for this, per ADR-077). The test proves sharedNodeStore's propagation logic works once it receives a title; it cannot detect either gap because the mock always hands it exactly the field it expects. More broadly, no frontend test tier exercises the real Tauri IPC/gRPC layer at all (invokeis always stubbed viamock-tauri-core.ts`), so no frontend test tier is structurally capable of catching (A).
Proposed Solution
(A) Proto/wire fix
- Add a
titlefield to theNodeDataproto message (packages/proto/proto/node_service.proto) — likelyoptional string title = 12;(next available field number;4and10are reserved), consistent withtitlebeing computed but not always present (e.g.date/schemanodes never get one, percompute_title's early return). - Update
node_to_proto(packages/daemon/src/services/node_service.rs:2170-2182) to mapnode.titleinto the new field. - Regenerate/vendor the proto per this repo's proto-sharing mechanism (see
architecture/daemon-cli-protocol.md#proto-sharing-across-the-open-core-boundary). - Update every client-side consumer that deserializes
NodeDatato read and use the newtitlefield: the CLI's node/query output formatting (packages/cli/src/output.rs,packages/cli/src/commands/node.rs), and the Tauri desktop app's node deserialization.
(B) Client-side computation fix (per ADR-077)
- Wire
evaluateTitleTemplateinto schema-driven property forms generally (person-schema-form.svelteat minimum;task-schema-form.svelte/generic-schema-form.svelteif/when they carry title-templated schemas) as a reactive computation (e.g.$derived) over in-progress field values, so the editing client's own UI updates instantly with no network round trip in the critical path. - Ensure the editing client does not depend on its own
NodeUpdatedevent or RPC response to display the correct title (ADR-077 point 4) — no active suppression needed, just no dependency. - Ensure a server-provided title is still used correctly on a normal fetch/first-load, unchanged (ADR-077 point 6).
Both
- Correct
person-schema-form.test.ts's mock so it no longer fabricates atitlefield the real backend doesn't provide — either tighten it to only return fieldsnode_to_proto(post-fix) actually sends, and/or extend coverage to assert the client-side computation from (B) independently of any mock. - Add a round-trip test: create/update a node with a
title_template-bearing schema (not justperson— cover at least one more type), go through the actual gRPC serialization path (node_to_protoat minimum; ideally a real client round trip), and asserttitleis present and correct in the deserialized result.
Acceptance Criteria
(A) Backend wire protocol
-
NodeDataproto message includes atitlefield -
node_to_protomapsnode.titleinto the new proto field -
nodespace node get <id> --jsonandnodespace query --jsonreturn the correcttitlefor a node with a resolved title template - A test exists that exercises the actual
node_to_proto(or full gRPC round-trip) serialization path and assertstitlesurvives — not just a service/store-layer assertion
(B) Client-side reactive computation
- Editing a title-templated node's fields (person and at least one other type) updates the title shown in the editing client's own UI (header, tab, inline view) instantly, with no dependency on a completed round trip
- The editing client does not require its own
NodeUpdatedevent to reflect its own change - A server-provided title is correctly displayed on a normal fetch/first-load (regression check — this must not break)
Both
- Tauri desktop app receives and displays the correct title immediately after editing a title-templated node's properties (verify person node specifically, plus at least one other title-templated type)
-
person-schema-form.test.ts's mock corrected to stop fabricating atitlefield the real backend doesn't provide - Re-verify PR Route person-schema-form saves through sharedNodeStore.updateNode #2552's frontend fix remains correct/necessary now that both (A) and (B) are addressed
- Code passes
bun run quality:fix - Tests pass (
bun run test:all)
Technical Specifications
Reference Files — (A)
packages/daemon/src/services/node_service.rs(lines 2170-2182,node_to_proto) — the actual bug: hand-written mapping that omitstitlepackages/proto/proto/node_service.proto(lines 147-167,message NodeData; lines 466-485,message NodeEvent; lines 821-826,message NodeReferencefor contrast — this message DOES havetitle,NodeDatadoes not) — wire contract needing the new fieldpackages/core/src/services/node_service/crud.rs(lines 994-1090,update_with_version_check_returning_node; lines 2237-2297,compute_title) — confirmed correct, no changes expectedpackages/core/src/db/sqlite_store/nodes.rs(lines 756-809,update_node_with_version_check) — confirmed correct (title is written to the DB), no changes expectedpackages/cli/src/output.rs,packages/cli/src/commands/node.rs— CLI-side consumers ofNodeDatathat need to read/print the newtitlefieldpackages/desktop-app/src/lib/services/tauri-sync-listener.ts(lines 369-383) — Tauri-side consumer ofNodeEvent/NodeDatapackages/core/src/services/node_service/mod.rs(lines 7451-7488) — existing service-layer title test, an example of the layer of coverage that exists today but doesn't catch this class of bug
Reference Files — (B)
packages/desktop-app/src/lib/utils/title-template.ts— existing, currently-unwiredevaluateTitleTemplate/evaluateSummaryTemplatepackages/desktop-app/src/lib/components/property-forms/person-schema-form.svelte— primary wiring target; currentlyonblur-only, no reactive computationpackages/desktop-app/src/lib/components/property-forms/task-schema-form.svelte,generic-schema-form.svelte— other schema-driven forms with no title logic at allpackages/desktop-app/src/lib/utils/node-display-title.ts— display-selection only (resolveTitleOrContent), no interpolation; consumes whatever title is available from either sourcepackages/desktop-app/src/lib/stores/shared-node-store.svelte.ts— currently only setstitlefrom backend responsespackages/desktop-app/src/tests/components/property-forms/person-schema-form.test.ts(lines 375-415) — the mock that fabricatestitle, needs correcting
Test Requirements
- Round-trip test through
node_to_proto(or a real client call) assertingtitleis present in the serializedNodeDatafor a node with a resolved title template - Test asserting the editing client's own UI reflects a locally-computed title instantly, independent of any backend response
- Coverage for at least one non-
persontitle-templated type in both (A) and (B)'s tests
Related Issues
- Person schema: replace name with first_name and last_name #2508 (introduced
person-schema-form.svelte's current save path — "Person schema: replace name with first_name and last_name") - Person node view: revisit _possible_duplicate, plus system-field column leak, raw-type-id titles, and hardcoded placeholders #2374 / PR Fix entity-noun title gate and person placeholders (#2374 items 2-4) #2533 (adjacent, recently-touched person-node code — cosmetic fixes only, not causally related)
Superseded Diagnosis (kept for history)
The issue was originally diagnosed as: person-schema-form.svelte bypassing sharedNodeStore.updateNode in favor of a direct backendAdapter.updateNode call, breaking the optimistic-update/store-read pattern other property forms use. That diagnosis was correct as far as it went — PR #2552 fixed a real bug and should not be reverted — but it was incomplete on two counts: (A) fixing the frontend store-routing does not help if the backend never sends title over the wire in the first place, and (B) even with the wire fixed, the intended design (per ADR-077) does not have the editing client depend on that round trip at all for its own display. Both fixes above are required in addition to PR #2552, not instead of it.
Activity
mstomar125 commentedon Sep 10, 2026
Investigated and fixed in PR #2552.
Hypothesis confirmed via runtime repro (not just static reading): rendered the real PersonSchemaForm against the real sharedNodeStore singleton, stubbing only the backend network boundary to return a correctly recomputed title (exactly what the backend does). Result: after editing first/last name, the store's cached node (title, and even its own first_name/last_name properties) stayed completely untouched. Nothing writes the change back into the store from this save path.
Went a bit further than the original hypothesis: the implicit fallback (an async NodeUpdated domain-event round trip re-hydrating the store) doesn't exist at all outside a live Tauri runtime, and even when it does fire, sharedNodeStore's cache-first read (ensureNode) keeps serving the stale in-memory copy indefinitely once populated - recovery within a running session needed more than "wait a moment." The backend's persistence itself was always correct; this was a pure frontend store-staleness bug, not data loss.
Fix: updateField() now routes through sharedNodeStore.updateNode (ADR-049 pattern), matching generic-schema-form.svelte and task-schema-form.svelte, so the title updates reliably and immediately without depending on the event race.
Added regression coverage (including a test against the real, unmocked store proving the title resolves correctly with no reload) and mutation-tested all new/changed assertions against the pre-fix component to confirm they actually catch the regression. Full test:all plus the pre-push gate are green.
[-]Person node title does not update after editing first/last name[/-][+]NodeData proto (daemon) never sends title field — dropped for every client and title-templated node type[/+]malibio commentedon Sep 13, 2026
Frontend test coverage — confirmed gap, and an actively misleading mock
Checked whether any frontend test would have caught this. No — and the one test closest to doing so actively masks the bug.
packages/desktop-app/src/tests/components/property-forms/person-schema-form.test.ts:375-415is the only frontend test asserting on.titleafter a save flow (the test PR #2552 relied on). It mocksbackendAdapter.updateNode(line 392) to return a hand-fabricated response where the test itself computestitle: \${first_name} ${last_name}`.trim() || 'Untitled'. The surrounding comment (lines 379-382) explicitly frames this as "standing in for a backend that correctly recomputes the title" — an assumption that turned out to be false. The test correctly provessharedNodeStore's propagation logic works once it receives atitle`; it cannot detect that the real backend never sends one, because the mock always hands it exactly the field it expects.More broadly: no frontend test tier exercises the real Tauri IPC / gRPC layer at all.
mock-tauri-core.tsstubs@tauri-apps/api/core'sinvokein every test tier (Happy-DOM,test:browser,test:webkit) because the realinvokerequireswindow.__TAURI_INTERNALS__, which none of those environments have.test:db(TEST_USE_DATABASE=true) only swaps which SQLite-backed mock answers the call — it never routes through the daemon's gRPC server or the actualNodeDataproto. Structurally, there is currently no frontend test tier capable of catching a bug that lives specifically in the daemon's proto serialization layer.Added to scope: fixing this bug requires not just the proto/
node_to_protofix, but also correcting (or replacing)person-schema-form.test.ts's mock so it no longer fabricates atitlefield the real backend doesn't provide — otherwise this exact class of bug (a mock quietly diverging from backend reality) can recur silently. Whether that becomes a frontend integration test against a real local daemon, or the mock is tightened to only return fieldsnode_to_protoactually sends, is an implementation decision for whoever picks this up — but the mock must stop asserting an idealized contract.malibio commentedon Sep 13, 2026
Second, independent gap: client-side title-template preview never wired up (general, all types)
In addition to the backend proto bug (title dropped from
NodeData, see issue body), there is a separate, pre-existing frontend gap: the UI has no instant/reactive client-side title preview while a user is typing into a title-templated node's fields. This is not person-specific — it applies to every schema-driven type with atitleTemplate(person, and any user-defined type with one configured).What exists but is unused:
packages/desktop-app/src/lib/utils/title-template.tsalready implementsevaluateTitleTemplate(template, fieldValues)andevaluateSummaryTemplate(template, fieldValues, fields)— genuine client-side{field}token interpolation, explicitly written to mirror the backend'sinterpolate_title_template_with_schema(packages/core/src/utils/markdown.rs), with its own unit tests (tests/unit/title-template.test.ts). Zero production components import it.Confirmed general (checked per explicit request, not assuming person is representative):
person-schema-form.svelte: inputs useonblurhandlers (lines 230-243), notoninput/bind:value— no reactive computation fires on keystroke at all.updateField()(lines 116-127) writes viasharedNodeStore.updateNode, and the form's own comment states title "reaches every reader ... immediately once persistence resolves" — title is expected to depend on a round trip, not local computation.task-schema-form.svelteandgeneric-schema-form.svelte: zero references totitleat all; neither callsevaluateTitleTemplate/evaluateSummaryTemplateor usesoninput.node-display-title.ts'sresolveTitleOrContentonly decides whether to displaynode.titlevsnode.content— it performs no interpolation itself, it just reads whateversharedNodeStorealready has.shared-node-store.svelte.tsonly ever setstitlefrom a backend response (updatedNodeFromBackend.title), never computes one locally.So today, title display for every schema-driven type is 100% backend-round-trip-dependent, with no client-side fallback or instant preview — even independent of the proto bug in this issue. This is very likely also the direct cause of the specific "field shows placeholder text, appears blank" symptom reported against
person-schema-form.svelte: since nothing recomputes a preview locally ononinput, and the field only reflects a committed/persisted value on blur, there's no local echo of what was just typed while the round trip is in flight.Widened scope for this issue
evaluateTitleTemplate(orevaluateSummaryTemplate, as appropriate) into schema-driven property forms generally — not justperson-schema-form.svelte— so title updates reactively/instantly from in-progress field values, independent of any backend round triptitleTemplate+ current field values); backend computation is for persistence only, running async in the background — we are the origin of the change, so noNodeUpdatedecho is expected or needed to reflect it in the UIpersonand one other title-templated type in whatever test coverage is added, consistent with the "not person-specific" framing throughout this issuemalibio commentedon Sep 13, 2026
Design formalized: ADR-077
The intended architecture has been captured as ADR-077: Client-Computed Title Template, No Self-Echo Required, committed to
nodespace-docs. This supersedes the earlier framing in this issue's comments (which treated client-side interpolation as optional UX polish) — it is not optional, it is the decided design.Summary of the decision:
evaluateTitleTemplate, currently unwired) the instant field values change — no dependency on any network round trip.compute_title()) — the durable value every other reader (other panes/windows/devices, CLI, MCP) relies on.Final scope for this issue (superseding prior "widened scope" comments)
This issue now covers both required, non-optional fixes:
A. Backend wire-protocol fix (original diagnosis, still correct and required)
NodeDataproto message includes atitlefieldnode_to_protomapsnode.titleinto itB. Client-side title computation (per ADR-077, now the decided design — not optional polish)
evaluateTitleTemplate(lib/utils/title-template.ts) into schema-driven property forms generally (person-schema-form.svelteand equivalents —task-schema-form.svelte,generic-schema-form.svelteif/when they gain title-templated schemas) so the editing client's own UI reflects the new title instantly, with no round-trip dependencyNodeUpdatedevent or RPC response to display the correct title (per ADR-077 point 4) — this doesn't require actively suppressing the event, just not being wired to need it for the title-display casepersonand one other title-templated type in test coverage, consistent with the "not person-specific" framing throughout this issueBoth
person-schema-form.test.ts's mock (currently fabricates atitlefield the real backend doesn't send) corrected to reflect (A)'s fix once landed, and/or extended to cover (B)'s client-side computationbun run quality:fixbun run test:all)Both (A) and (B) are required — neither alone fully resolves the original bug report. (A) without (B) means the editing client still shows no title until a round trip completes (better than today, but not the intended instant-reactivity UX). (B) without (A) means the editing client looks correct but every other reader of the node still sees no title at all.
malibio commentedon Sep 13, 2026
Test coverage — made explicit
Per request, spelling out what "adequate" means concretely for both sides, so this isn't left to interpretation by whoever implements it:
Backend (Rust):
node_to_proto()given aNodewith a non-emptytitleproduces aNodeDatawhosetitlefield matches — the direct, cheapest test for the actual bug (already listed as an acceptance criterion above)NodeServicelayer that today's#2014-style test uses) for atitle_template-bearing schema, asserting the returnedNodeData.titleis correct — this is the round-trip test that closes the actual coverage gap described in "Why This Wasn't Caught"personplus one other), not justperson, to guard against a type-specific regressionFrontend (TypeScript/Svelte):
titleTemplate, the property form's reactive title output matchesevaluateTitleTemplate's result — independent of any backend mockbackendAdapter/sharedNodeStore.updateNodemocked to NOT return atitle(simulating current real backend behavior pre-fix, and also correct post-fix behavior since the client shouldn't need it) — this specifically prevents a regression back to "test passes only because the mock hands back a title the real backend doesn't provide"titlecorrectly — covers ADR-077 point 6, must not breakperson-schema-form.test.ts's existing mock (line ~392) must be corrected as part of this work, not left as a parallel/legacy test — the fabricatedtitlein itsbackendAdapter.updateNodemock response should be removed or replaced with what the real backend will actually send once (A) lands, so this test can't silently mask a future regression the way it masked this oneThis detail is now folded into the issue body's "Proposed Solution" (items 8-9) and "Test Requirements" section — flagging here as well since it's easy to under-scope "add tests" into a single smoke test per side.
Add title to NodeData proto and wire client-side title preview (#2645)