Repository navigation
Description
Change
Replace person's single name field with first_name and last_name. Final field set:
| Field | Type | Notes |
|---|---|---|
first_name |
string | replaces name |
last_name |
string | new |
email |
string | unchanged — indexed, unique, uniqueCaseInsensitive |
Current schema (packages/core/src/models/core_schemas.rs:1129-1182) has only name + email, both optional, isCore: true, no relationships, no titleTemplate.
Pre-release: no migration, no compat shim — reset the database.
Display name is the real work
name is not just a field; it is the person's display identity, and three separate mechanisms depend on it. Splitting it into two fields means each needs an explicit rule for composing a display string.
1. compute_display_name — packages/core/src/behaviors/mod.rs:2233-2255
// current fallback chain
properties.person.name → properties.person.email → "Unknown"Needs a new chain over two fields. Decisions required: how to join ("{first} {last}"), and what to do when only one is present. Suggested: join the non-empty parts with a space; if both are empty fall back to email, then "Unknown". Keep the existing behaviour that a person with no name at all is valid — the schema deliberately allows a person to exist before a name is set, and tests person_empty_name_is_valid / person_absent_name_is_valid (behaviors/mod.rs:5405,5412) assert it.
2. Name→content sync — person-schema-form.svelte:41-44
The form writes name into the node's content so the person renders inline (documented at person-node.svelte:4 and person-schema-form.svelte:5). With two fields this must sync the composed string, and must recompose when either field changes.
3. titleTemplate — currently None
Person has no title template. This is the natural mechanism for a composed display string ("{first_name} {last_name}") and would keep the rule in the schema rather than in three code paths. Worth deciding whether to adopt it here rather than hand-composing in each consumer — but note the template would need to degrade sensibly when one or both fields are empty, which templates may not express today. Implementer should check before committing to it.
The three mechanisms must agree. Today they can drift; this change is a good point to converge them on one composition rule.
Other call sites
seed_local_person_if_needed(node_service/mod.rs:1061-1069) creates the local owner PersonNode with empty properties — noname— so it is unaffected mechanically, but it is the node most likely to display as "Unknown". Worth confirming that is still the intended first-run state.person-schema-form.svelte:62-93hardcodes exactly two inputs readingproperties.person.{name,email}— becomes three fields. Note Add typed property forms for packaged schemas person and project, following the task form pattern #2102 replaces this form entirely; coordinate so the work is not done twice.- Fixtures/examples embedding
{"person":{"name":"Alice"}}:behaviors/mod.rs:2437,5449,5475,daemon/src/services/node_service.rs:2016. packages/skill/SKILL.md:335usesnodespace schema get personas an example — harmless, but check the output shown is not stale after this change.
Seeding caveat
seed_core_schemas_if_needed (node_service/mod.rs:1344) creates only schemas missing from the database and leaves existing ones untouched. The revised person schema will not reach any existing install without a database reset. Same trap recorded in #2101 — resolve consistently.
Field descriptions
The current descriptions are genuine prose ("Display name; optional — a person may exist before a name is set"), which is why they leak into table column headers today. Under #2101 these become LLM-facing and gain a separate friendly_name for display. When authoring first_name / last_name, write descriptions in that spirit rather than as terse labels — see #2101 for which field the UI will read.
Acceptance criteria
- Person schema defines
first_name,last_name,email;nameremoved - One documented composition rule for the display string, applied consistently by
compute_display_name, the content sync, and any title mechanism - Composition degrades sensibly when only one name field is set, and when neither is
- A person with no name remains valid;
person_empty_name_is_valid/person_absent_name_is_validupdated and passing -
emailretainsunique+uniqueCaseInsensitive - Local owner person seed still produces a valid node and a sensible display string
- All
{"person":{"name":…}}fixtures updated - Decision recorded on whether person adopts a
titleTemplate - Coordinated with Add typed property forms for packaged schemas person and project, following the task form pattern #2102 so the person form is built once against the new field set
Activity
malibio commentedon Aug 17, 2026
Additions and corrections
1. Adopt a
titleTemplate— with corrected syntaxDecided: person gets a title template composing the display string.
The syntax is single braces, not double.
interpolate_title_template_with_schema(packages/core/src/utils/markdown.rs:132-183) scans for{…}. A{{first_name}}template would emit a literal{first_name}plus a stray brace.Empty-value behaviour needs a decision. A missing/null field interpolates to nothing, but surrounding literal text is preserved (only whitespace is collapsed and trimmed,
markdown.rs:181-182). With all three person fields optional, that yields:Jane Doe ([email protected])Jane Doe ()← dangling parens([email protected])The parenthesised-email form is only safe if email is effectively always present, which the schema explicitly does not guarantee. Options: (a) accept the dangling parens; (b) drop email from the template —
{first_name} {last_name}; (c) extend the interpolator to drop literal text adjacent to an empty placeholder. (c) is the only one that renders correctly in every state but is a change to shared template behaviour affecting all schemas.Recommend (b) for the template plus keeping
compute_display_name's email fallback for the nameless case — that covers every state without a dangling-punctuation edge and without changing shared interpolation. Proceeding on that basis unless redirected.Whichever is chosen, the template and
compute_display_name(behaviors/mod.rs:2233-2255) must agree, or the title and the inline display will disagree for the same person.2. Add a
tasksrelationship to personPerson currently has
relationships: []. Add a task relationship mirroring project's (core_schemas.rs:318-329):Reverse-name collision to resolve. Project's
tasksrelationship usesreverse_name: "project", sotaskalready gets a reverse edge namedproject. Person's needs a distinct reverse name —assigneeis the natural choice and matches task's existingassigneefield. That collision must be settled deliberately: either name the reverse edge something else (assigned_to), or decide the relationship supersedes the scalarassigneefield on task. Do not ship both a field and an edge with the same name.Note task's own
relationshipslist is empty (core_schemas.rs:190) and a test asserts exactly that (core_schemas.rs:1426-1443) — reverse edges are declared from the far side. That test will need updating.Project's
tasksrelationship already exists and needs no change.3.
friendly_nameis now required on every field#2101 shipped (PR #2105,
5c4b437f).SchemaFieldnow carriesfriendly_nameas a non-optionalString— person's existingnamefield readsfriendly_name: "Name". The new fields must supply it:first_name→friendly_name: "First name"last_name→friendly_name: "Last name"Descriptions are now LLM-facing semantic content, not labels — write them accordingly rather than restating the friendly name.
4. Ordering note
#1998also landed (e57af24a, "Classify node types by frontend integration, not core-list membership"), which touches the node-type classification #2102 depends on. Worth re-checking #2102's premises against current main before starting it.malibio commentedon Aug 17, 2026
Decided — template keeps all three fields
Single braces, per
interpolate_title_template_with_schema(packages/core/src/utils/markdown.rs:132-183). Email stays in the template — the earlier recommendation to drop it is overruled.Consequence: the interpolator must handle empty placeholders
With all three person fields optional and literal text currently preserved verbatim (only whitespace collapsed/trimmed,
markdown.rs:181-182), the template as written produces:Jane Doe ([email protected])Jane Doe ()Jane Doe([email protected])([email protected])Jane ()JaneSo keeping email in the template requires extending the interpolator to drop literal text adjacent to an empty placeholder, rather than emitting orphaned punctuation.
This is a change to shared template behaviour used by every schema, not a person-specific tweak — but it is the correct general fix: any user- or AI-authored template with optional fields and surrounding punctuation hits the same problem today. There is exactly one production call site (
packages/core/src/services/node_service/crud.rs:2033), so the blast radius is contained.Implementation note: the rule should be "an empty placeholder consumes immediately-adjacent literal punctuation/whitespace", not "drop the whole segment" —
([email protected])with no name must still render its parens, since those literals are adjacent to a non-empty placeholder.Also decided: person gets the task relationship
Both person and project carry a task relationship. Project's already exists (
core_schemas.rs:318-329); person's is new.The reverse-name collision flagged earlier still needs settling before implementation: project's
tasksusesreverse_name: "project", and person's natural reverse nameassigneecollides with task's existingassigneefield. Pick one — rename the reverse edge (e.g.assigned_to), or have the edge supersede the scalar field. Do not ship a field and an edge sharing a name.Open question — does person still sync its name into
content?Project and task take their display name from the node's built-in
contentand define nonamefield. Person is now the exception: structured name parts plus a title template.The existing person form syncs
nameintocontent(person-schema-form.svelte:41-44) so person renders inline like every other type. With a title template there would be two mechanisms producing a display string, which must agree or the same person renders differently in different places.Decide explicitly:
content— the template is the composition rule,contentstays the universal display source, every consumer keeps working unchanged.content— cleaner, but makes person special in every consumer that readscontentfor a display string.Recommend (a): it keeps one display-source contract across all node types and confines the change to how the string is composed.
compute_display_name(behaviors/mod.rs:2233-2255) must produce the same result as the template either way.Added acceptance criteria
{first_name} {last_name} ({email})with single bracesassigneefield resolvedrelationshipsassertion (core_schemas.rs:1426-1443) updatedcontentsync (option a or b), andcompute_display_nameagrees with the template in every statemalibio commentedon Aug 17, 2026
Coordination — #2115 just landed in the file this issue changes
a23226cd(PR #2115, ADR-065) shipped adopt-existing duplicate suggestion, and it lives inperson-schema-form.svelte— the same file this issue'sname→first_name/last_namesplit has to touch.What shipped:
person-schema-form.svelte: 116 → 255 lines. On email blur it callsfind_duplicate_forand offers "use existing" (navigate to the match) / "keep as new" (dismiss). The save is never gated on the lookup — suggest-don't-block.find_duplicateTauri command wrapping theFindDuplicategRPC RPC;backendAdapter.findDuplicateForon Tauri + HTTP transports; MockAdapter stub.NodeService::mark_possible_duplicatesstamping a non-blocking marker via OCC-bypassingset_property_bool.Consequences for this issue:
:41-44) is almost certainly stale.emailfield, which this issue leaves unchanged, so the two should not conflict. Worth verifying that holds oncefirst_name/last_nameland — particularly if the title template later composes a display string used in the duplicate-suggestion UI.No change to this issue's decisions; this is a coordination note so the work is not planned against a stale reading of the file.
malibio commentedon Sep 8, 2026
Frontend baseline: 238 test files passed, 4925 tests passed
Person schema: replace name with first_name and last_name (#2508)