Repository navigation
Description
Problem Statement
packages/core/src/behaviors/mod.rs (~line 696-703) contains a validation block that rejects any non-integer priority value:
// Validate priority type (must be integer if present)
if let Some(priority) = props.get("priority") {
if !priority.is_i64() && !priority.is_null() {
return Err(NodeValidationError::InvalidProperties(
"Priority must be an integer".to_string(),
));
}
}This directly contradicts the current definition of the field. task.priority is a string enum (highest/high/medium/low/lowest as of #2651, and low/medium/high before it) — the code would reject exactly the values the schema declares as valid.
It does not currently fire because it sits in the Err arm of TaskNode::from_node, which only errors when node_type != "task" — unreachable from TaskNodeBehavior::validate. So this is dead code that is also wrong, rather than a live bug.
Surrounding comments compound the problem by describing a legacy integer→string conversion (1 = high, 2 = medium, 3-4 = low) that does not exist anywhere in the codebase. Comments in the same area reference "BACKWARD COMPATIBILITY … during transition" and values that "will be auto-migrated", which contradicts the project's stated pre-release policy in CLAUDE.md (no backward compatibility, no migrations, no transition periods).
Proposed Solution
Delete the unreachable priority-type validation block and the stale legacy-integer comments describing the nonexistent conversion. Per CLAUDE.md, delete rather than deprecate or suppress.
While in the area, audit nearby comments in behaviors/mod.rs for other references to the phantom integer priority format so the file stops documenting behavior the code does not have.
Acceptance Criteria
- The unreachable "Priority must be an integer" validation block is deleted
- Stale comments describing the
1 = high, 2 = medium, 3-4 = lowlegacy conversion are removed - "backward compatibility" / "auto-migrated" / "during transition" comments in this area are removed, consistent with CLAUDE.md
- Existing task validation tests still pass; the test asserting a legacy integer priority validates (
behaviors/mod.rs~line 3190) is updated or removed to reflect that integer priorities are not a supported format -
bun run quality:fixclean
Reference Files
packages/core/src/behaviors/mod.rs— validation block ~line 696-703; stale comments ~line 3189-3196
Related Issues
- Expand core task.priority to a 5-level scale (Highest/High/Medium/Low/Lowest) #2651 (expanded
task.priorityto 5 levels; surfaced this during review, deferred as out of scope)
Activity
Address review: guard the wire-type priority copy against drift
Expand core task.priority to a 5-level scale (closes #2651) (#2687)
malibio commentedon Sep 17, 2026
Baseline (worktree issue-2693-priority-validation-cleanup): Frontend: 254 test files passed, 5183 tests passed.