Repository navigation
Description
Overview
Implement PersonNode as a core node type: the person schema entry + PersonNodeBehavior (validation, computed display name). PersonNode is the identity primitive the ADR-037 access model builds on.
This issue owns PersonNode the type (schema + behavior). It does not create any PersonNode instance — see Scope.
Updated to reflect the revised data model: PersonNode is pure identity (
name,rolemoves to thehas_roleedge between PersonNode and DatabaseSettingsNode (see #[#1398]).auth_statusmoves to DatabaseSettingsNode. Supersedes the original pre-Universal-Graph body.
Read first
components/node-behavior-system.md— Core (hardcoded) vs Extension (schema-driven) behavior architecturecomponents/schema-management.md— protection levels, namespace enforcementdecisions/037-collection-access-model.md— why PersonNode matters
Data model (Universal Graph)
PersonNode is a node with node_type = 'person'; its data lives under properties (namespaced properties.person.*). There is no persons table.
PersonNode is pure identity — it carries no auth or role state. Those live on relationships:
| Field | Type | Notes |
|---|---|---|
name |
string? |
Display name. Optional — must not block instantiation. Used by compute_content. |
email |
string? |
Optional; basic format validation (@ + .) when present. |
Not on PersonNode:
role— lives on thehas_roleedge between PersonNode and DatabaseSettingsNode (tenant-level authority)auth_status— lives on DatabaseSettingsNode (database sync state)
Implementation Tasks
- Add a
personSchemaNodetopackages/core/src/models/core_schemas.rswithnameandemail(both optional). - Implement
PersonNodeBehaviorimplementing theNodeBehaviortrait. - Register it in
NodeBehaviorRegistry::new()(packages/core/src/behaviors/mod.rs), alongside the existing behaviors. -
validate: validateemailformat if present; do not requirename. -
compute_contenthelper for a display name (fall back gracefully whennameis empty). -
can_have_children()→false(person is a leaf). - Unit tests: schema present; behavior registered; email format validation; empty-name is valid;
compute_contentwith and without a name.
Acceptance Criteria
-
personschema entry exists with optionalnameandemailonly. -
PersonNodeBehaviorimplements allNodeBehaviormethods and is registered. -
emailformat-checked when present; emptynameis accepted. - Unit tests cover validation, computed content, and the empty-name path.
- Passes
cargo clippy; no lint suppression.
Scope
In scope: PersonNode the type — schema + behavior + validation.
NOT in scope (deliberately):
role/auth_status— see Implement DatabaseSettingsNode (database-settings schema + behavior) #1398- Instantiation — no PersonNode instance is seeded at first launch in this issue
- Membership/permission plumbing —
restrictedToMembers,member_ofedgepermission, collection ops: see ADR-037: Collection access model — core data plane (restrictedToMembers, member_of permission, PersonNode seeding) #1372 - RLS enforcement, auth_identities, auto-admin bootstrap — pro/sync
Relationships
- Implement DatabaseSettingsNode (database-settings schema + behavior) #1398 —
roleandauth_statuslive there; implement that first or in parallel - ADR-037: Collection access model — core data plane (restrictedToMembers, member_of permission, PersonNode seeding) #1372 (ADR-037 collection access data plane) depends on this for the PersonNode type
Activity
malibio commentedon Jun 8, 2026
Coordination: this is now a dependency of #1372 (ADR-037 access model)
PersonNodeBehavior became load-bearing for the ADR-037 collection access model — "members of a restricted collection = person nodes only." #1372 (core data plane for ADR-037) depends on this issue for Task C (person schema + behavior), Task D (seed the single local PersonNode), and Task E (person-only membership check).
Written pre–Universal-Graph; several references no longer match the codebase:
docs/architecture/business-logic/node-behavior-system.mdand.../database-schema.mddon't exist. Current refs:components/node-behavior-system.md,components/schema-management.md.node_type = 'person'); data lives underproperties(namespacedproperties.person.*), not a dedicated table ormetadata.NodeBehaviorRegistry::new()(packages/core/src/behaviors/mod.rs~L2089), alongside the existing behaviors; mirror the validation/type-check pattern used byTaskNodeBehavior.first_name/last_namerequired — reconsider. ADR-037's local-seeded singleton (the local user) may exist before a name is set; required name fields would block seeding. Suggest name optional, or default from the local user.New fields ADR-037 needs on the
personschema (fold into this issue)role— enumowner/admin/editor/viewer. This is the tenant-level authority axis, explicitly distinct from the collection-edgepermission(admin/modify/readOnly) which lives on themember_ofedge, not the person. Don't conflate them (ADR-037 § "Collection-Edge Permissions vs. Tenant Role").auth_status— enumlocal/bound(defaultlocal, Core-protected). The local user seeds aslocal; cloud upgrade binds it to a Supabase identity (bound). The bind itself is pro/sync — out of scope here; this issue only lands the field + the seededlocalinstance.Scope split
personcore schema entry (incl.role,auth_status), validation.auth_identitiesbind, RLS person-only enforcement.Recommend updating this body (paths, table→node, optional name, new fields) before picking it up, then implementing as Task C of #1372.
#133: seed one local PersonNode on every install (ADR-037)
Implement PersonNodeBehavior (#1401)
#1372: restrictedToMembers Core field on the collection schema (ADR-0…
Implement PersonNodeBehavior (#1401)
#1372: restrictedToMembers Core field on the collection schema (ADR-0…