Skip to content

Make SchemaNode one wire type that the store fills, with extends and relationships #3442

Closed

Description

@malibio

Overview

Make SchemaNode one wire type that the store fills in, carrying relationships, extends, abstract and the structural rules, and type the schema operation parameters (ADR-086 §1).

Problem Statement

  • Two SchemaNode structs.
    • Core's packages/core/src/models/schema_node.rs arrives with empty relationships after from_node; the store loads them from the relationship table separately, and handle_update_schema re-attaches them by hand.
    • The wire SchemaNode (packages/nodespace-types/src/schema.rs) reads relationships from properties. The daemon smuggles them there to make that work.
  • extends is lost. Neither struct carries it, so extends (ADR-078) drops out of the typed schema conversion. TypeScript's SchemaNode has neither relationships nor extends.
  • A field that's always empty. The wire SchemaNode.description is always empty; the description is the schema node's child subtree.
  • Untyped parameters. The schema operation parameters travel as raw JSON on the RPC (handle_*_schema(Value)).

Proposed Solution

  1. One SchemaNode in nodespace-types, with fields, relationships, extends, abstract, the structural rules (ADR-089) and the envelope. Delete core's struct.
  2. The store fills relationships and extends from the relationship table on read and writes them back on save. Nothing is smuggled through properties.
  3. Drop SchemaNode.description.
  4. CreateSchemaParams / UpdateSchemaParams become wire types in nodespace-types; the RPCs carry them typed.
  5. The daemon returns the typed SchemaNode.

Architecture Impact

Implements decisions/086-core-node-types-defined-once-typed-by-category.md §1 ("SchemaNode is the case this settles") and §6 (abstract), with ADR-070 (relationship declarations are edges) and ADR-078 (extends).

Acceptance Criteria

  • One SchemaNode type exists, in nodespace-types; packages/core/src/models/schema_node.rs holds no struct
  • Reading a schema returns its relationships and extends populated, on every surface: core, daemon, Tauri, dev-proxy and TypeScript (tests)
  • No schema relationship is written to or read from properties
  • SchemaNode.description is gone
  • The schema operation parameters are typed end to end
  • Follows development/node-type-sequence.md; the node-types.md schema sheet updated in the same PR
  • bun run test:changed passes; bun run quality:fix clean
  • schema get and schema update agree on where title_template lives: the typed SchemaNode carries it as one field, read and written in the same place (today update takes title_template and get returns properties.titleTemplate)

Technical Specifications

Reference Files

  • packages/nodespace-types/src/schema.rs
  • packages/core/src/models/schema_node.rs, packages/core/src/models/schema.rs
  • packages/core/src/services/node_service/schema.rs (handle_*_schema)
  • packages/core/src/db/sqlite_store/relationships.rs (declaration edges)
  • packages/daemon/src/services/node_service.rs, packages/proto/proto/node_service.proto

Dependencies

Non-Goals

  • Changing what a schema can declare, beyond abstract and the structural rules

Activity

  1. malibio commented on Oct 2, 2026

    @malibio
    CollaboratorAuthor

    Baseline — Frontend: 303 test files passed, 5559 tests passed

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

    @malibio
    CollaboratorAuthor

    Node-type sequence classification: schema is a concrete core type (the meta-type), category Structured (nested SchemaField / SchemaRelationship). State placement: the fields, abstract, the structural rules and the templates stay on the schema node's row; relationships and extends stay declaration edges in the relationship table (ADR-070, ADR-078) and are filled into the one wire SchemaNode by the store. No new field, relationship or rule is added; SchemaNode.description is removed.

  4. added 2 commits that reference this issue on Oct 2, 2026
    811a1de
    e5c99a0
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