Skip to content

data-model.md drift: prune's abandoned deletions, the released 2→3 migration, abandon/land actor authority #29

Description

@dichovsky

Three passages in docs/design/data-model.md no longer match the Store:

  • Prune scope: the doc says prune "deletes only completed Tasks older than the cutoff" (and docs/design/cli-contract.md says "tasks_deleted counts the deleted completed Tasks"), but src/store/maintenance.ts:155-180 deletes (status = 'completed' AND completed_at < ?) OR (status = 'abandoned' AND abandoned_at < ?). The contract even contradicts itself — its crew prune command section correctly says "completed or abandoned", as does the src/cli.ts help text.
  • Migration catalogue: the released-migrations narrative covers 1→2 then jumps to 3→4, omitting the released fromVersion: 2, toVersion: 3 migration in src/store/schema.ts:647-755 (the destructive rebuild of tasks/task_events for the abandoned status), even though the doc's own overview mentions what v3 added.
  • Actor authority: the Tasks invariants state requeue authority but not abandon/land authority. Code enforces both: land requires creator or reviewer (src/store/tasks.ts:724-726); abandon requires creator/reviewer or — when both are archived — the active plain operator identity (src/store/tasks.ts:652-660).

Impact: the doc that must move "together" with schema changes understates what a destructive command deletes, skips a released migration's mechanics, and hides a store-level authorization invariant.

Acceptance: the prune passages (data-model.md and the cli-contract.md tasks_deleted line) include abandoned Tasks by abandoned_at; the 2→3 step joins the migration narrative; the abandon/land actor rules (including the operator fallback) join the invariants.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions