Skip to content

Review remediation: teach the dependency graph about archive #8

Description

@andreiRS

From the three-lens deep review (review-remediation). Theme: teach the dep graph about archive. Conforms to ADR-0010/0011.

Problem

ADR-0010 says archived tasks "still count as Complete for blocking purposes" and ADR-0011 that the graph is "never dangling." But validateGraph (src/validation.ts:103-117) and the resolver maps in editTask/linkTask/unlinkTask only see live tasks (findAllTasks never scans archive/).

  • Archiving a depended-on task then permanently bricks link/unlink/edit on its dependents with UNKNOWN_UUID, with no in-tool recovery.
  • removeTask --force has the mirror gap: it strips deps only from live dependents, leaving archived ones dangling.

Slices

4. Archiving a depended-on task keeps dependents editable (finding #1)

Make the dependency graph archive-aware: validateGraph and the short-id/uuid resolver maps in editTask/linkTask/unlinkTask resolve against live ∪ archived tasks.

  • After mv A done; archive A where a live task B depends on A, link, unlink, and edit on B all succeed.
  • show/next/export still treat the archived dependency as complete (no regression).
  • A genuinely unknown UUID still fails UNKNOWN_UUID.

5. rm --force cleans archived dependents (finding #6)

Have removeTask --force strip the removed task's UUID from archived dependents as well as live ones, in the same commit. Blocked by #4.

  • After archiving A (which depends on T) then rm T --force, no archived task references T's UUID.
  • rm T without --force still fails DEP_EXISTS when a live dependent exists.

Method

TDD outside-in at the CLI boundary. One commit per green.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreview-remediationConformance fixes from the three-lens deep review

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions