Skip to content

Delete unreachable integer-priority validation and phantom legacy-conversion comments #2693

Closed

Description

@malibio

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 = low legacy 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:fix clean

Reference Files

  • packages/core/src/behaviors/mod.rs — validation block ~line 696-703; stale comments ~line 3189-3196

Related Issues

Activity

  1. self-assigned this
    on Sep 17, 2026
  2. malibio commented on Sep 17, 2026

    @malibio
    CollaboratorAuthor

    Baseline (worktree issue-2693-priority-validation-cleanup): Frontend: 254 test files passed, 5183 tests passed.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions