Repository navigation
Align project.priority to the shared 5-level scale and rank it in sorts (closes #2694) - #3253
Conversation
Pragmatic Code Review — PR #3253 (closes #2694)Review Type: Initial Review SummaryA clean, well-scoped change. Requirements Check
Docs note: Code Review Findings1. The The comment explains that Recommendation: add 2. Stale function reference in the moved "see 3. Over-long doc line
4. The daemon helper name It is still only called on the task path, so the name is accurate for its caller. No change needed unless a project typed-update path starts using it. Mentioned only so the rename scope is a conscious decision, like the kept wire Things verified (no action)
RecommendationAPPROVE. This is a clear net improvement. Finding 1 is worth folding in before merge: it is a one-line DDL plus a comment reword and makes the documented index rationale true for both types. The rest are optional nits. Update |
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.
Review addressed (89fb647)
Re-review: not needed. One DDL line, pinned by the existing schema test, plus doc-comment edits. No logic changes.
|
…ts (closes #2694) project.priority carried the old low/medium/high values while task.priority moved to highest/high/medium/low/lowest, and nothing guarded it against drift. It also sorted as text, so a project list sorted by priority came back high, low, medium. - Move core's TaskPriority to models/priority.rs as Priority, now backing both task and project. Priority::NODE_TYPES names the types sharing the scale; the SQL ORDER BY and the Rust re-sort both rank priority for exactly those targets (wildcard and user-defined types still sort as text). - project.priority core_values and description match task's. - The drift guard runs for every NODE_TYPES schema and pins rank order; a reverse check fails if a core schema declares priority without being listed. - The LIMIT sort tests used LIMIT 2, whose alphabetical top-2 equals the rank top-2, so they passed against a text-sorting SQL layer. Now LIMIT 3, mutation-checked for task and project. - Frontend project schema fixture updated in lockstep. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add idx_project_priority (project.priority is declared indexed and now shares task's filter/sort paths, but only task had an index); pin it in schema_test's expected index list. - resolve_order_field's doc now names both types' priority indexes, and the over-long line is reflowed. - Priority::rank's doc pointed at compare_json_values for the rank+value tie-break; it is compare_priority_values. Skipped: renaming the daemon's parse_task_priority — it only serves the task path, so the name is still accurate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
89fb647 to
8b492a6
Compare
Summary
Decision: align.
project.prioritynow uses the samehighest/high/medium/low/lowestscale astask.priority, and it sorts by rank.Sort bug folded in: before this change, project priority sorted as plain text (
high, low, medium). The query service ranked priority only when the target wastask.Changes
Priorityenum (packages/core/src/models/priority.rs): core'sTaskPrioritymoved here and renamed, since it now backs both types.Priority::NODE_TYPES = ["task", "project"]names the types that share the scale. The wire-levelnodespace_types::TaskPriorityand project's plain-string wire field are unchanged.ORDER BYCASE and the in-Rust re-sort both rank viaPriority::applies_to(target_type). They must stay in lockstep. Wildcard queries and user-defined types' barepriorityfields still sort as text, as before.project.priority'score_valuesand description now match task's.test_priority_variants_match_core_values_bidirectionallyruns for everyNODE_TYPESschema and pins the rank order.test_every_core_priority_field_uses_the_shared_scalefails if a core schema declaresprioritywithout being listed inNODE_TYPES.LIMIT 2. The alphabetical top 2 (high, highest) are the same rows as the rank top 2, so the test passed even against a text-sorting SQL layer. Both the task and project LIMIT tests now useLIMIT 3.Verification
projectdropped fromNODE_TYPES→ the reverse guard and the project sort tests fail.bun run test:changed: frontend, browser, scripts and Rust tiers all pass.Docs
nodespace-docswill be updated on main after this PR merges:node-types.md: the enum name.data-layer.md: the sort-scope paragraph.There is no project schema section in
node-types.mdto update, contrary to the issue's acceptance criteria.🤖 Generated with Claude Code