Repository navigation
Define the task types once and route the typed task update through the shared pipeline (closes #3441) - #3470
Conversation
Pragmatic Code Review: PR #3470 (issue #3441)Review Type: Initial Review (no prior reviews or comments on the PR; head SummaryThe change does what the issue asks. Core's One leftover on the frontend contradicts the new contract and should be fixed before merge (finding 1). Everything else is optional. What I checked beyond the diff:
Requirements Check
Code Review Findings1. 🟡 Important: the frontend typed write path still accepts
|
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Address reviewAddressed
The helper's new test caught a bug in my first version of it: Skipped
Verification: Re-Review DecisionDecision: RE-REVIEW NEEDED Rationale: Finding 2 added behaviour the first review did not see: person and project typed updates now refuse unknown keys in the Tauri command and the dev-proxy, across Rust, the dev-proxy and the shared helper. The helper also had a bug in its first version. The changes are small, but they are new refusals on two more write routes, so a second look at the new commits is cheaper than a failed merge gate. |
Pragmatic Code Review: PR #3470 (issue #3441)Review Type: Re-Review (commits Previous Review Summary
What I verified
Code Review FindingsNo critical or important findings. 1. 🟢 Suggestion: two lists now name the same writable keys, with nothing holding them together📁 The store decides what to send from Recommendation. Add one assertion to Principle. DRY: when a fact has to live in two places, a test should fail when they disagree. 2. 🟢 Suggestion: the person and project sheets don't state the refusal📁 nodespace-docs The task sheet says a typed update naming Recommendation. Move the sentence to §1.2 as a rule for every typed update, or repeat it on the two sheets. Principle. Nitpicks
Security / Performance
RecommendationAPPROVE. The one Important finding is fixed, the two Suggestions and two of the nits are addressed, and the reasons for the two skipped nits hold. The new refusals on the person and project routes break no existing producer. Both suggestions above are optional and need no further review. |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Address review (re-review)Addressed: all three items; nothing skipped.
Verification: Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: One new test, one exported type alias and accessor with no logic change, and a docs sentence. No behaviour changed since the re-review's APPROVE. |
…e through the shared pipeline (core)
…uri, dev-proxy and frontend
- The frontend typed write path no longer accepts content for task - PersonNodeUpdate and ProjectNodeUpdate deny unknown fields, and the dev-proxy refuses them on the person and project routes as it does for task - The per-type update field lists are exhaustive at compile time - TaskStatus and Priority have one string conversion (from_value) Skipped: a shared task_status(&Node) reader (one caller today) and a transport-level refusal test (the refusal is at deserialization, which the struct tests cover). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…store sends Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
89982e2 to
0256824
Compare
Closes #3441
What changed
taskis a flat concrete core type (ADR-086 §4). This PR gives it one definition and one write path, and makesprojectshare its priority scale.One definition.
packages/core/src/models/task_node.rs, its test file andmodels/priority.rsare deleted.TaskNode,TaskNodeUpdate,TaskStatusand the sharedPriorityenum live only innodespace-types; core re-exportsTaskNodeUpdate,TaskStatusandPriority.TaskPriorityis gone:Priority(with its rank andNODE_TYPES) moved tonodespace-typesand backs bothTaskNode.priorityandProjectNode.priority.One write path.
NodeService::update_task_nodenow lowers the typed update into the generic update pipeline, the same wayupdate_person_nodeandupdate_project_nodedo, and returns the storedNode. Removed with it:update_task_node_in_tx,validate_task_status,get_task_node, and the store'supdate_task_node_with_version_check_in_tx/node_to_task_node. Status and priority are validated by the pipeline's enum check.The response is the stored node. The daemon's
update_task_nodeanswers withnode_response(node)instead of rebuilding a node from core's copy, solifecycle_statusand extension properties survive.The typed update carries the task schema's fields only.
prioritynull= clearcontentTaskNodeUpdate, the proto request and the TypeScript typepropertiesUpdateTaskNodeRequest(the daemon ignored it)For
propertiesthe issue asked to choose between dropping it and honouring it. I dropped it: extension fields go through the generic update, which is the one write path they already have. Namingcontentorpropertiesin a typed task update is refused rather than dropped:TaskNodeUpdateisdeny_unknown_fields(the Tauri command), and the dev-proxy'sPATCH /api/tasks/:idreturns 400.No fields, relationships or structural rules were added or changed. No migration.
Behaviour to know about
A cleared field is now stored as
nullin thetaskbucket instead of having its key removed. This is what the shared pipeline already does for person, project, the CLI and the agent, and every reader treatsnullas absent. The new daemon test pins the stored shape.Tests
nodespace-types:priority: nullclears, absent leaves unchanged,content/propertiesare rejected, the patch carries only named fields; project priority is the shared enum.typed_update_tests): writes fields and leaves others;nullclears priority and dates; an archived task with acustom:field keeps both in the response; a priority outside the vocabulary is rejected; stale version conflicts; another type and an empty update are refused.title_templateand invariant-rule / event tests forupdate_task_nodenow run against the shared pipeline.Run locally:
nodespace-types+nodespace-core+nodespace-daemonunder nextest (2982 passed),bun run test(301 files, 5559 tests),bun run quality:fixclean.Docs
components/node-types.mdtask and project sheets: NodeSpaceAI/nodespace-docs@c19fec0🤖 Generated with Claude Code