Skip to content

Fix project/task schema field descriptions and add project→task relationship - #2016

Merged
mstomar125 merged 1 commit into
mainfrom
issue-1999-schema-descriptions
Aug 10, 2026
Merged

mstomar125 merged 1 commit into
mainfrom
issue-1999-schema-descriptions

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Summary

Two co-located schema fixes in packages/core/src/models/core_schemas.rs (closes #1999).

Part 1 — remove redundant type-name prefixes from field descriptions

description renders directly as the form field label, so a type-name prefix showed up as visible redundancy ("Project Status" inside a form already scoped to Project):

  • project.status/priority/start_date/end_date: dropped the "Project " prefix → Status / Priority / Start date / End date
  • task.status/priority: dropped the "Task " prefix → Status / Priority

Audited every core schema. person, skill, query, and ai-chat use genuinely descriptive prose (e.g. "Conversation status" is domain prose — the schema id is ai-chat, not "conversation"), so no other schema needed changing. task's already-unprefixed fields (due_date, started_at, completed_at, assignee) are untouched.

Part 2 — add the project → task relationship

project now declares a tasks relationship (targetType: task, cardinality: Many). The task-side inverse (project, One) is derived automatically via RelationshipCache::get_inbound_relationships, so task needs no entry of its own. Purely additive schema metadata — no data migration, no relationship-table rows created.

Tests

  • Updated two relationship_cache_test.rs integration tests that asserted an empty inbound cache when seeded with core schemas — now that project→task exists they assert the one seeded relationship (target type task, source project, name tasks; target_types == 1, total_relationships == 1).
  • Full core Rust suite green; the 16 core_schemas tests and all 14 relationship-cache tests pass. Frontend unaffected (no test asserts core-schema relationship shape).
  • Pre-push gate (test:all + cargo build --bin nodespaced + test:e2e) passed.

Notes

Storage format is today's JSON-in-properties model; if #2008's storage redesign lands later it carries this declaration forward like any other. Unblocks #2007 (Relationships-button visibility gate needs a real relationship to test against).

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

Pragmatic Code Review — Initial Review

Independent review of the diff against #1999's acceptance criteria.

Requirements Check — all ✅

  • project's 4 descriptions de-prefixed (Status/Priority/Start date/End date); task status/priority de-prefixed
  • remaining task fields + person/skill correctly unchanged
  • every core schema audited: ai-chat ("Conversation status"), query, person, skill use descriptive prose, not the owning type name — no other prefix exists, none missed
  • project.tasks SchemaRelationship well-formed (target task, Out, Many, reverse project/One); inbound side derived correctly — cache indexes it under target task with source project, exactly what the updated test asserts
  • the two relationship_cache_test.rs tests strengthened (not weakened): project is the sole populated relationships vec, so target_types==1 / total_relationships==1 is exact
  • broader sweep: no other Rust or frontend test seeds core schemas and asserts relationship emptiness/count

Findings: 🟢 none substantive. No lint suppression, no dead code, no backward-compat scaffolding; comments describe behavior directly with no embedded issue numbers (CLAUDE.md-compliant).

Verdict: APPROVE. Validated live: full cargo test -p nodespace-core green (15 binaries) and the pre-push gate (test:all + cargo build --bin nodespaced + test:e2e) passed.

@mstomar125 mstomar125 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.

@mstomar125

Copy link
Copy Markdown
Contributor Author

/address-review

Reviewer recommendations: APPROVE with zero 🔴/🟡 findings. The single 🟢 note was to run the test suite as the outstanding gate.

  • ✅ Addressed: 0 code changes required — no critical or important findings were raised.
  • ⏭️ Skipped: none actionable.
  • 🧪 Tests: the 🟢 note is already satisfied — cargo test -p nodespace-core is green (15 binaries) and the pre-push gate (test:all + cargo build --bin nodespaced + test:e2e) passed on the pushed commit.

Re-Review Decision

Decision: NO RE-REVIEW NEEDED

Rationale: No code was changed in response to the review (the only recommendation — run the suite — was already satisfied and required no edit). There are no new commits to re-review. The PR is ready for merge.

…ionship

Part 1: remove the redundant owning-type prefix from field descriptions,
which render directly as the form field label (a Project form showed
"Project Status" instead of "Status"):
- project.status/priority/start_date/end_date: drop the "Project " prefix
- task.status/priority: drop the "Task " prefix
Audited every core schema; person/skill/query/ai-chat use descriptive prose
(e.g. "Conversation status" — the schema id is ai-chat, not "conversation"),
so no other schema needed changing.

Part 2: declare the project→task relationship (a project has many tasks,
"tasks"; the task-side inverse "project"/One is derived, so task needs no
entry). Seeding persists this declaration as a relationship-table edge under
the #2008 storage model (SchemaNode.relationships is the declaration source;
set_schema_declarations writes the edge). No data migration.

Adds a unit test asserting the project→task declaration; the pre-#2008
inbound-cache tests that would have covered the count were removed with that
cache in #2008.

Closes #1999.

Co-Authored-By: Claude <[email protected]>
@mstomar125
mstomar125 force-pushed the issue-1999-schema-descriptions branch from 4104b83 to 78524ad Compare August 10, 2026 09:07
@mstomar125

Copy link
Copy Markdown
Contributor Author

Rebased onto main (#2008 landed) — re-verified

After the review, this PR conflicted with main because #2008 ("Store SchemaRelationship declarations as relationship-table edges", #2010) merged. Rebased onto latest main and adapted:

Re-verified green against the new storage model: #2008's own schema_relationship_declarations_test.rs (11 tests) all pass with the core project→task relationship present (they assert via .any(), not fixed counts); core_schemas unit tests (17) pass; full cargo test -p nodespace-core green (15 binaries); fmt + clippy clean; pre-push gate passed on 78524adf.

Re-review decision: NO RE-REVIEW NEEDED — the reviewed logic (descriptions + the project→task declaration) is byte-for-byte the same intent; the delta is a purely mechanical adaptation to #2008's storage model, validated against #2008's own suite. Prior verdict APPROVE stands.

@mstomar125
mstomar125 merged commit d579459 into main Aug 10, 2026
@mstomar125
mstomar125 deleted the issue-1999-schema-descriptions branch August 10, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant