Skip to content

Fix project/task schema field descriptions and add the missing project-task relationship #1999

Closed

Description

@malibio

Overview

Two small, independently-motivated but co-located fixes to the project and task core schemas in packages/core/src/models/core_schemas.rs, bundled because they touch the same file and the same two schema definitions:

  1. Several field description values are redundantly prefixed with the owning type's name (e.g. project.status → "Project status"), even though description is rendered as the field's own label inside a form already scoped to that type.
  2. project and task have no relationship between them despite being an obvious, expected pairing (a project's tasks / a task's project) — project.relationships is currently [].

Neither requires a data migration: (1) is a text-only change with no data-shape impact, and (2) is purely additive schema metadata — no existing project/task node needs to change, and no relationship table rows are created by declaring the schema relationship (see clarification below).

Problem Statement

Part 1 — Redundant description prefixes

description is used directly as the form field label, not as a secondary tooltip/hint:

<!-- packages/desktop-app/src/lib/components/schema/generic-schema-form.svelte:160 -->
{field.description || formatFieldLabel(field.name)}
<!-- same pattern in task-schema-form.svelte:633 and schema-property-form.svelte:399 -->

So a redundant type-name prefix in description shows up verbatim as the visible label, e.g. "Project Status" instead of "Status" inside a form that is already contextually a Project.

Confirmed inconsistent, queried live from core_schemas.rs / the running database:

  • project (packages/core/src/models/core_schemas.rs:236,267,285,303) — all 4 fields prefixed: "Project status", "Project priority", "Project start date", "Project end date"
  • task — inconsistent within the same schema: status → "Task status", priority → "Task priority" (prefixed), but due_date → "Due date", started_at → "Started at", completed_at → "Completed at", assignee → "Assignee" (not prefixed)
  • person — no prefix on either field; both are genuinely descriptive prose (e.g. "Display name; optional — a person may exist before a name is set")
  • skill — no prefix on any field; same, genuinely descriptive (e.g. "What this skill does (drives semantic search discovery)")

The task/project prefixed fields (status/priority) share an identical enum-field shape (core protection, coreValues/userValues, extensible), suggesting the prefix was introduced once and copy-pasted for structurally similar fields across the two schemas, while other fields were written independently without it. person and skill show the intended, unprefixed convention already exists in the codebase — it's just not applied consistently.

Part 2 — Missing project ↔ task relationship

project's schema declares relationships: vec![] (packages/core/src/models/core_schemas.rs, ~line 311). No relationship exists between project and task in either direction, despite this being an expected, obvious pairing — a project should be able to show/manage its tasks, and a task should show which project it belongs to.

Clarification on what "adding a relationship" means here, since it's easy to conflate with the relationship table: declaring a SchemaRelationship on a schema node (stored in that schema node's own properties.relationships JSON, the same way properties.fields stores field definitions) is pure metadata — it does not create any row in the relationship table (packages/core/src/db/schema.sql:43-56), which stores concrete in_node/out_node edges between actual node instances. Declaring project.relationships = [{name: "tasks", targetType: "task", ...}] does not touch any existing project or task node's data. A relationship table row only appears later, when a user or agent actually links a specific project to a specific task (via create_relationship / rel_ops::create_relationship, the same write path #1918's relationship viewer and its backend command surface already use). This is why Part 2 needs no data migration — it's purely additive schema declaration, exactly like adding a new field would be.

This part is a domain/product decision (the relationship's name, direction, and cardinality), independent of how it's physically stored. #2008 is an open, not-yet-decided architecture discussion about moving SchemaRelationship storage from JSON-in-properties to relationship-table edges. That storage question does not change what's being decided here — whether it lands as JSON now or as a table edge later (per whatever #2008 concludes), project still has many tasks and task still has one project. If #2008's redesign lands first, implement Part 2 directly in the new format instead of JSON; if this issue lands first, #2008's migration (if it proceeds) will need to carry this declaration forward like any other.

Proposed Solution

Part 1 — Remove redundant prefixes

  • project.status: "Project status" → "Status"
  • project.priority: "Project priority" → "Priority"
  • project.start_date: "Project start date" → "Start date"
  • project.end_date: "Project end date" → "End date"
  • task.status: "Task status" → "Status"
  • task.priority: "Task priority" → "Priority"

person and skill need no change — already following the correct convention. Audit any other core schema in core_schemas.rs not explicitly checked above for the same pattern before considering this complete.

Part 2 — Add the project ↔ task relationship

Add a SchemaRelationship to project's schema definition, e.g. name: "tasks", targetType: "task", cardinality: Many — a project has many tasks. The inverse (reverseName, e.g. "project", reverseCardinality: One) makes it show correctly from the task side via RelationshipCache::get_inbound_relationships, per #1918's bi-directional relationship design — task's own schema does not need its own relationships entry for this; the inbound side is derived automatically from project's declaration.

Implement this in whichever storage format is current at implementation time — JSON-in-properties (today's model) unless #2008 has landed first, in which case implement directly as a relationship-table edge per that issue's resolved design.

Acceptance Criteria

  • project's 4 field descriptions no longer include the word "Project" as a redundant prefix
  • task's status/priority descriptions no longer include the word "Task" as a redundant prefix
  • Remaining task fields (due_date, started_at, completed_at, assignee) are unchanged — already correct
  • person and skill are unchanged — already correct
  • Every other core schema in core_schemas.rs audited for the same description-prefix pattern; any found are fixed in this same PR (small, mechanical — same fix, no new investigation needed)
  • project schema gains a tasks (or similarly named) relationship targeting task, with an appropriate cardinality and reverse name/cardinality for the task side — implemented in whichever storage format (Store SchemaRelationship declarations as relationship-table edges instead of schema-node JSON #2008-pending JSON, or the resolved table-edge design) is current at implementation time
  • Existing tests referencing the old description strings (if any) are updated
  • Schema enumeration/count tests (if any assert a fixed relationship or field count for project) are updated to reflect the new relationship
  • No new test failures (bun run test:all)
  • Code passes bun run quality:fix

Technical Specifications

Reference Files

  • packages/core/src/models/core_schemas.rs — source of truth for all core schema field/relationship definitions; project's 4 fields are at lines 236, 267, 285, 303, relationships: vec![] at ~line 311; task's status/priority are the analogous enum fields earlier in the same file (search for "Task status" / "Task priority")
  • packages/desktop-app/src/lib/components/schema/generic-schema-form.svelte:160, packages/desktop-app/src/lib/components/property-forms/task-schema-form.svelte:633, packages/desktop-app/src/lib/components/property-forms/schema-property-form.svelte:399 — the three render sites confirming description is used directly as the visible field label, which is why the prefix is user-visible redundancy and not just an internal string
  • packages/nodespace-types/src/schema.rs — SchemaRelationship, RelationshipCardinality, RelationshipDirection struct/enum definitions for Part 2
  • packages/core/src/services/relationship_cache.rs:128 — get_inbound_relationships, confirms the inbound (task-side) view is derived automatically from project's declaration alone, no task-side schema change needed
  • packages/core/src/db/schema.sql:43-56 — the relationship table itself, confirming schema-level relationship declarations are independent of it under the current model (see Problem Statement clarification; Store SchemaRelationship declarations as relationship-table edges instead of schema-node JSON #2008 proposes changing this)

Non-Goals

Related Issues

Activity

  1. changed the title [-]Remove redundant type-name prefix from schema field descriptions (project, task status/priority)[/-] [+]Fix project/task schema field descriptions and add the missing project-task relationship[/+] on Aug 7, 2026
  2. added a commit that references this issue on Aug 10, 2026
    78524ad
  3. mstomar125 commented on Aug 10, 2026

    @mstomar125
    Contributor

    Resolved by PR #2016 (merged, main d579459d).

    Part 1 — removed the redundant owning-type prefix from the 6 project/task field descriptions (they render directly as the form label). Audited every core schema; person/skill/query/ai-chat use descriptive prose, so none other changed.

    Part 2 — declared the project → tasks relationship (Many; task-side inverse project/One derived automatically, so task carries no entry). Implemented against the #2008 storage model (rebased mid-flight when #2008 landed): the declaration in get_core_schemas() is seeded as a relationship-table edge via set_schema_declarations.

    Live-validated: new test_project_declares_tasks_relationship unit test + green against #2008's schema_relationship_declarations_test.rs suite and the full core Rust suite; pre-push gate passed. Unblocks #2007.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions