0.6.0: task record header and lean definition
Applicability and exclusions
This is the single migration for the whole 0.6.0 release. It is a breaking pre-1.0 update to existing task files, released as 0.5.0 → 0.6.0. It runs after the verified 0.5.0 step (release-0-5-0) of the sequential upgrade. A project several versions behind completes every earlier step first. A task that still has a numeric id means the 0.5.0 step is incomplete: stop.
Only two of the release's issues change records:
- Lean task record (#51): workflow references move from body sections into the header, and the body becomes the same four sections for both tracks. See the task record.
- Task overview (#57): every task needs
depends_on, and design tasks needapproach, so the overview and automatic selection read only the header. Code tasks gain the statusescheckingandwaiting-for-approval.
What does not need migration, by developer decision:
- The deliver changes (#48, #49, #50, #18). Their new header sub-keys (
delivery.base_ref,baseline,manual_checks,approved,pr) are optional, and records without them stay valid. This migration never adds them. settings.mdandevidence/in the catalog. Delivery creates them on first use.- Reservations, the journal,
designs/, locks andmigration.md(except the checkpoint). No lock may be held while migrating.
Outcomes:
- Fresh project (no catalog): nothing to migrate; record nothing.
- Already applied (verified
release-0-6-0checkpoint, and every task meets the target invariants): read-only check, no new log entries. - Partially applied (checkpoint marked partial, or a mix of migrated and unmigrated tasks): resume as in Repeat runs.
- Pre-release 0.6.0 catalog (tasks created by a 0.6.0 build before release): a task already in the new shape only gets missing header fields, the status mapping below and the two renamed fields: a
designheader field is the earlier name ofimplementsand is renamed to it (a task with both needs a developer decision), and ablockerfield is removed, with its value kept in the checkpoint. A task mixing old and new sections needs a developer decision.
Artifacts and preservation
| Artifact | Change | Kept byte-identical |
|---|---|---|
tasks/<id>-slug.md |
Header fields added from old body sections (and pre-release design/blocker fields handled as above), old reference sections removed, body reshaped into the four sections, status mapped for pre-release blocked code tasks, one or two log lines appended. The file name stays. |
id, legacy_id, title, kind, priority, every other header field, every existing log line, and all definition text, apart from the changes listed in the preview. |
migration.md |
The release-0-6-0 checkpoint is appended. It keeps the full original text of every removed ## Design reference, ## Delivery reference and ## Design section, including design decisions other than an approval, and of a removed pre-release blocker field. |
Every existing line. |
task-ids/, journal.md, designs/, locks/, other files |
Unchanged. | Everything. |
| Product checkouts and branches | Not touched. | Everything. |
Header
Add each field the track's template (code, design) lists and the task lacks, in template order. Keep existing fields where they are, including legacy_id after id. Never overwrite an existing value. Use the values below, or null ([] for depends_on) when there is nothing to record.
| Field | Track | Value |
|---|---|---|
depends_on |
both | []. If the body of a task that isn't done names a prerequisite task, the IDs are a developer decision in the preview; never infer them. |
implements |
code | From ## Design reference: task (the DSGN-NNN it names), exact revision, and approval with reviewer and date. null when the section is None or absent. |
delivery |
code | From ## Delivery reference: branch, full base SHA, absolute checkout and git_dir. null when delivery hasn't started. |
delivery |
design | The prototype branch and full base SHA from ## Approach or ## Design. null for Figma or when delivery hasn't started. |
submitted |
both | The full commit SHA (code), or the exact Figma version or prototype commit (design), named as submitted for review. null otherwise. |
reviewer |
design | The human reviewer named in ## Design. |
approach |
design | figma or prototype, from ## Approach. null for a draft task that names neither; for a design task past draft it's a developer decision. |
handoff |
design | The catalog-relative review handoff from ## Design, for example designs/DSGN-003-review.md. File names are not rewritten. |
approval |
design | reviewer, date and revision of a recorded human approval in ## Design. null when the decision is pending or requested changes. |
dev_task |
design | The linked DEV-NNN from ## Design, or null. |
A short SHA is expanded with read-only git rev-parse --verify <sha>^{commit}, run with the task's recorded git_dir, or the product checkout's shared Git directory when the task has none (design tasks, and code tasks that haven't started delivery). A Figma version is kept as written. When a code task's implements and its design task's approval name the same revision, both get the same canonical string, so the overview's exact match holds. A value that can't be parsed or resolved, or an implements.revision that differs from the design task's approved revision, needs a developer decision in the preview; for done tasks, see done tasks.
Body
The new body is ## General description, ## Goals, ## Scope of work, ## Acceptance criteria, then ## Log, as in the task record.
| Old section | New home |
|---|---|
## Problem |
## General description, word for word. |
| (none) | ## Goals: None. The migration never writes goals. |
## Approach (code), ## Brief (design) |
Start of ## Scope of work, word for word. |
## Approach (design) |
Its approach becomes the approach field, and its artifact location follows the Brief text in ## Scope of work. Capability, access and fallback notes are session history and are dropped. |
## Out of scope |
End of ## Scope of work as an Out of scope: list, word for word. None or an empty section is dropped. |
## Acceptance criteria |
Kept word for word, with checkbox states. The design criterion "explicit final human approval of the submitted visual/UI revision" is removed; the workflow still requires that approval. |
## Verification |
Task-specific checks become acceptance criteria items. Generic project commands (for example a plain npm test) and how-to-verify procedure are dropped. In a done task the new items are checked (- [x]), because 0.5.0 delivery marked a task done only after its verification passed; otherwise they are unchecked. |
## Design reference, ## Delivery reference, ## Design |
Removed once their values are in the header; their full text is kept in the checkpoint. Design or Figma links from ## Design reference follow in ## Scope of work. Evidence locations are dropped: 0.6.0 stores no evidence in the task. |
## Out of scope, then any other section |
In that order at the end of ## Scope of work; another section goes under its old heading as a bold label, word for word. |
## Log |
Last, every existing line kept. |
Every dropped line is listed in the preview and stays in the backup.
Status
Only for pre-release 0.6.0 catalogs. For each blocked code task, read the reason in its latest → blocked log line: "awaiting manual checks" becomes checking, "awaiting re-approval" becomes waiting-for-approval, anything else stays blocked. Projects coming from released 0.5.0 never wrote these reasons, so their tasks keep blocked. Design tasks keep their status.
A mapped waiting-for-approval task resumes as the deliver rule for side states says: its blocked → waiting-for-approval line names a side state, so delivery follows the log back to the <from> → blocked line and continues from that status. A mapped checking task resumes at Finish and doesn't need the earlier status.
Appended log lines
One line per task, plus one per status change, dated with the rehearsal date shown in the approved preview, so the live files match the rehearsal exactly:
- YYYY-MM-DD: edited (migrate, 0.6.0 task record: header references and sections, developer decision)
- YYYY-MM-DD: blocked → checking (migrate, awaiting manual checks)
A task already in the new shape that only gains header fields logs edited (migrate, 0.6.0 task record: header fields, developer decision).
Done tasks
done tasks get the same rewrite, but the developer reviews them in bulk, not one by one:
depends_onis always[]: the task has finished, so prerequisites no longer gate anything.- A value that can't be parsed or resolved (an incomplete design reference, a short SHA that no longer resolves, an unclear approach) becomes
nullinstead of a question. The original section text is kept in the checkpoint. - Text with no clear home goes into
## Scope of work, as above.
Exception: a done design task named in the implements of a code task that isn't done gets the per-task review for its approval and submitted, because that approval still gates the code task.
Tasks in every other status get the per-task review in the preview.
Preconditions and read-only preview
- The installed plugin reports
0.6.0or later, and the project's last verified checkpoint is0.5.0, reached earlier or by the 0.5.0 step in this same run (or there is an incompleterelease-0-6-0step). Codex users first refresh the project copy with/factory:codexso$factory-migratereads these instructions and the new overview script. - Every record writer is paused: other sessions, linked worktrees, scheduled
feedbackruns and allocators in other clones. Never run a 0.5.0 session against the catalog during or after this migration. $FACTORY_ROOT/locks/holds no lock. An existing lock is reported with its owner; removing a possibly stale lock is a developer decision.
Build the inventory read-only, without fetching, creating directories or taking locks. For every file in tasks/:
- Parse the header and the
##sections. Stop for a developer decision on: a numericid; an unknownkind; a design task with a code-only status; a task mixing old and new sections; a section that appears twice; a header with bothdesignandimplements. - Derive the new header values, body and status, and the log lines to append.
- Collect the questions: prerequisites, unparseable references, revision mismatches and unclear approaches in tasks that aren't
done, and indonedesign tasks that a non-done code task implements.
Show:
- Tasks that aren't done, one at a time: header before and after, each moved and dropped part of the body, status change, log lines, and open questions.
- Done tasks, as one table: ID, track, header fields set, fields left
nullwith the reason, sections moved, lines dropped. The developer may open any of them, but approves them as a group. - Blockers, and the checkpoint content.
Then rehearse the whole migration in a sandbox as the migrate command requires, and show the rehearsal's changes list with the preview. Only tasks/*.md and migration.md may appear in it.
Approval and backup
The developer answers the open questions, then approves the per-task previews, the done-task table and the rehearsal result. Approval of an earlier preview does not carry over if the inventory changed.
Before any live write, copy the whole catalog to the agreed external backup location, outside the product checkout and its Git directory. Verify the copy file by file against SHA-256 hashes. Record the backup location, the hashes and the approved inventory with the checkpoint.
Product cleanup, commits and pushes are not part of this migration.
Ordered migration instructions
Hold the migration lock (<git-common-dir>/factory-migration.lock) throughout. When this is the first live step of the upgrade, run verify on the sandbox snapshot first; any drift invalidates the rehearsal and the approval. When earlier steps ran live in the same session, compare the live catalog with the rehearsal's recorded state after those steps instead.
- Tasks. For each task in the approved inventory, take its lock
locks/task-<id>(recording this migration session as owner), re-read the file and confirm it still matches the backup hash, write the rehearsed content to a temporary file intasks/, rename it over the task file, confirm the result matches the rehearsal, then release the lock. Check: every task meets the target invariants below. - Checkpoint. Append to
migration.md: migration IDrelease-0-6-0, target0.6.0, descriptor SHA-256, date, the per-task summary (header fields set, fields leftnullwith the reason, status changes, dropped lines), the full text of every removed reference section andblockerfield, backup location and hashes, and the checks below. Mark the0.6.0target verified only after every check passes.
If a check fails, stop. Record the step as partial in the checkpoint with the tasks done, and report.
Verification and completion
- Every task's header has every field of its track's template, and
depends_onis a list. Every design task pastdraftthat isn'tdonehas areviewerand anapproachoffigmaorprototype. - Every task's body has exactly
## General description,## Goals,## Scope of work,## Acceptance criteriaand## Log, in that order, and no removed section. - Compared with the backup,
id,legacy_id,title,kind,priorityand every other header field are unchanged, apart from the approveddesign→implementsrename andblockerremoval; status changed only as approved; the log section starts with the old log lines, byte for byte, followed only by the approved new lines. - Every non-empty body line of the backup, apart from its
##heading, is in the new body with the same text, or listed as moved, reformatted or dropped in the approved preview, or kept in the checkpoint as removed reference text. Only the list and checkbox markers the migration adds, and a custom heading turned into a bold label, may differ. - For every code task that isn't
doneand has a non-nullimplements, the named design task'sapproval.revisionequalsimplements.revision, unless the mismatch is a developer decision listed in the approved preview. - The task count equals the inventory. Nothing outside
tasks/*.mdandmigration.mdchanged. - The overview script, run without
--prs, reports norun /factory:migrate 0.6.0note for any task, and no blocker that the preview didn't list. Don't use/factory:taskshere: from 0.6.1 it may settle merged tasks. - The live result matches the rehearsal's
changeslist.
Report the per-task summary, the checks and the backup location. Migration makes no task ready, approved or delivered, and starts nothing.
Repeat runs and interrupted migration
- Verified checkpoint present: check the invariants above read-only and stop. Write nothing.
- Interrupted step 1: a task that matches its rehearsed content is done; one that matches its backup hash is pending. Any other content means it changed since the preview: stop for reconciliation. Never apply the rehearsed content over it.
- Locks left by the interrupted migration: a
locks/task-<id>lock whose recorded owner is this migration session (named in the checkpoint) is released after its task has been checked as above. Any other lock still needs its owner's or the developer's decision. - A new task created since the inventory needs a new preview, rehearsal and approval. Never overwrite newer work with a copy from the rehearsal or the backup.
Rollback and recovery
Pause writers. Export anything created or changed after the migration (new tasks, status changes, log lines, journal entries) before restoring. Restore tasks/ from the verified backup, then reinstall plugin 0.5.0: 0.6.0 workflows can't resume an unmigrated in-progress task, and 0.5.0 workflows don't read the 0.6.0 header, so never run both versions against one catalog. Re-apply exported newer work by hand with the developer. Mark the release-0-6-0 checkpoint as rolled back rather than deleting it. Recovery never rewrites product history or deletes the backup.
Maintainer verification
Before release, rehearse with the sandbox helper on disposable fixture projects, never live consumer records:
- Historical paths: a
0.5.0catalog, and a0.4.1catalog upgraded through0.5.0to0.6.0. - Mixed content: code tasks in every status, with and without a design reference and a delivery reference; a code task in review implementing a
donedesign task, with matching revisions; design tasks with Figma and prototype approaches, pending, changes-requested and approved decisions, and a linked development task; a custom section; a ready task naming a prerequisite; a done task with an unresolvable reference. - Pre-release 0.6.0 records:
blockedcode tasks waiting for manual checks and for re-approval, a task with the earlierdesignorblockerheader field, and a task already in the new shape. - Blockers: a held lock, a task mixing old and new sections, a numeric ID.
- Repeat on a verified project; interruption during step 1 and resume; rollback restoring the backup.
node --test tests/*.test.mjs covers the sandbox helper, the migration index and the overview script. The agent-run rehearsal is recorded in the release PR with its fixtures, commands and results; instruction tests do not prove an agent follows them.
Original Markdown, including metadata
---
schema_version: 1
migration_id: release-0-6-0
target_version: "0.6.0"
target_layout: "Same <absolute git-common-dir>/factory/ catalog; every task file uses the 0.6.0 task record: a header with every field of its track's template (depends_on, implements, delivery, submitted for code; depends_on, reviewer, approach, delivery, submitted, handoff, approval, dev_task for design) and a body of General description, Goals, Scope of work, Acceptance criteria and Log"
---
# 0.6.0: task record header and lean definition
## Applicability and exclusions
This is the single migration for the whole 0.6.0 release. It is a **breaking** pre-1.0 update to existing task files, released as `0.5.0 → 0.6.0`. It runs after the verified `0.5.0` step (`release-0-5-0`) of the [sequential upgrade](../updating.md#select-version-scoped-migration-instructions). A project several versions behind completes every earlier step first. A task that still has a numeric `id` means the `0.5.0` step is incomplete: stop.
Only two of the release's issues change records:
- **Lean task record** (#51): workflow references move from body sections into the header, and the body becomes the same four sections for both tracks. See the [task record](../../skills/task-record.md).
- **Task overview** (#57): every task needs `depends_on`, and design tasks need `approach`, so the overview and automatic selection read only the header. Code tasks gain the statuses `checking` and `waiting-for-approval`.
What does not need migration, by developer decision:
- The deliver changes (#48, #49, #50, #18). Their new header sub-keys (`delivery.base_ref`, `baseline`, `manual_checks`, `approved`, `pr`) are optional, and records without them stay valid. This migration never adds them.
- `settings.md` and `evidence/` in the catalog. Delivery creates them on first use.
- Reservations, the journal, `designs/`, locks and `migration.md` (except the checkpoint). No lock may be held while migrating.
Outcomes:
- **Fresh project** (no catalog): nothing to migrate; record nothing.
- **Already applied** (verified `release-0-6-0` checkpoint, and every task meets the [target invariants](#verification-and-completion)): read-only check, no new log entries.
- **Partially applied** (checkpoint marked partial, or a mix of migrated and unmigrated tasks): resume as in [Repeat runs](#repeat-runs-and-interrupted-migration).
- **Pre-release 0.6.0 catalog** (tasks created by a 0.6.0 build before release): a task already in the new shape only gets missing header fields, the status mapping below and the two renamed fields: a `design` header field is the earlier name of `implements` and is renamed to it (a task with both needs a developer decision), and a `blocker` field is removed, with its value kept in the checkpoint. A task mixing old and new sections needs a developer decision.
## Artifacts and preservation
| Artifact | Change | Kept byte-identical |
| --- | --- | --- |
| `tasks/<id>-slug.md` | Header fields added from old body sections (and pre-release `design`/`blocker` fields handled as above), old reference sections removed, body reshaped into the four sections, status mapped for pre-release `blocked` code tasks, one or two log lines appended. The file name stays. | `id`, `legacy_id`, `title`, `kind`, `priority`, every other header field, every existing log line, and all definition text, apart from the changes listed in the preview. |
| `migration.md` | The `release-0-6-0` checkpoint is appended. It keeps the full original text of every removed `## Design reference`, `## Delivery reference` and `## Design` section, including design decisions other than an approval, and of a removed pre-release `blocker` field. | Every existing line. |
| `task-ids/`, `journal.md`, `designs/`, `locks/`, other files | Unchanged. | Everything. |
| Product checkouts and branches | Not touched. | Everything. |
### Header
Add each field the track's template ([code](../../skills/define/task-template.md), [design](../../skills/design/task-template.md)) lists and the task lacks, in template order. Keep existing fields where they are, including `legacy_id` after `id`. Never overwrite an existing value. Use the values below, or `null` (`[]` for `depends_on`) when there is nothing to record.
| Field | Track | Value |
| --- | --- | --- |
| `depends_on` | both | `[]`. If the body of a task that isn't `done` names a prerequisite task, the IDs are a developer decision in the preview; never infer them. |
| `implements` | code | From `## Design reference`: `task` (the `DSGN-NNN` it names), exact `revision`, and `approval` with `reviewer` and `date`. `null` when the section is `None` or absent. |
| `delivery` | code | From `## Delivery reference`: `branch`, full `base` SHA, absolute `checkout` and `git_dir`. `null` when delivery hasn't started. |
| `delivery` | design | The prototype `branch` and full `base` SHA from `## Approach` or `## Design`. `null` for Figma or when delivery hasn't started. |
| `submitted` | both | The full commit SHA (code), or the exact Figma version or prototype commit (design), named as submitted for review. `null` otherwise. |
| `reviewer` | design | The human reviewer named in `## Design`. |
| `approach` | design | `figma` or `prototype`, from `## Approach`. `null` for a `draft` task that names neither; for a design task past `draft` it's a developer decision. |
| `handoff` | design | The catalog-relative review handoff from `## Design`, for example `designs/DSGN-003-review.md`. File names are not rewritten. |
| `approval` | design | `reviewer`, `date` and `revision` of a recorded human approval in `## Design`. `null` when the decision is pending or requested changes. |
| `dev_task` | design | The linked `DEV-NNN` from `## Design`, or `null`. |
A short SHA is expanded with read-only `git rev-parse --verify <sha>^{commit}`, run with the task's recorded `git_dir`, or the product checkout's shared Git directory when the task has none (design tasks, and code tasks that haven't started delivery). A Figma version is kept as written. When a code task's `implements` and its design task's `approval` name the same revision, both get the same canonical string, so the overview's exact match holds. A value that can't be parsed or resolved, or an `implements.revision` that differs from the design task's approved revision, needs a developer decision in the preview; for `done` tasks, see [done tasks](#done-tasks).
### Body
The new body is `## General description`, `## Goals`, `## Scope of work`, `## Acceptance criteria`, then `## Log`, as in the [task record](../../skills/task-record.md#definition).
| Old section | New home |
| --- | --- |
| `## Problem` | `## General description`, word for word. |
| (none) | `## Goals`: `None`. The migration never writes goals. |
| `## Approach` (code), `## Brief` (design) | Start of `## Scope of work`, word for word. |
| `## Approach` (design) | Its approach becomes the `approach` field, and its artifact location follows the Brief text in `## Scope of work`. Capability, access and fallback notes are session history and are dropped. |
| `## Out of scope` | End of `## Scope of work` as an `Out of scope:` list, word for word. `None` or an empty section is dropped. |
| `## Acceptance criteria` | Kept word for word, with checkbox states. The design criterion "explicit final human approval of the submitted visual/UI revision" is removed; the workflow still requires that approval. |
| `## Verification` | Task-specific checks become acceptance criteria items. Generic project commands (for example a plain `npm test`) and how-to-verify procedure are dropped. In a `done` task the new items are checked (`- [x]`), because 0.5.0 delivery marked a task done only after its verification passed; otherwise they are unchecked. |
| `## Design reference`, `## Delivery reference`, `## Design` | Removed once their values are in the header; their full text is kept in the checkpoint. Design or Figma links from `## Design reference` follow in `## Scope of work`. Evidence locations are dropped: 0.6.0 stores no evidence in the task. |
| `## Out of scope`, then any other section | In that order at the end of `## Scope of work`; another section goes under its old heading as a bold label, word for word. |
| `## Log` | Last, every existing line kept. |
Every dropped line is listed in the preview and stays in the backup.
### Status
Only for pre-release 0.6.0 catalogs. For each `blocked` code task, read the reason in its latest `→ blocked` log line: "awaiting manual checks" becomes `checking`, "awaiting re-approval" becomes `waiting-for-approval`, anything else stays `blocked`. Projects coming from released 0.5.0 never wrote these reasons, so their tasks keep `blocked`. Design tasks keep their status.
A mapped `waiting-for-approval` task resumes as the [deliver rule](../../skills/deliver/SKILL.md#resume-existing-delivery) for side states says: its `blocked → waiting-for-approval` line names a side state, so delivery follows the log back to the `<from> → blocked` line and continues from that status. A mapped `checking` task resumes at Finish and doesn't need the earlier status.
### Appended log lines
One line per task, plus one per status change, dated with the rehearsal date shown in the approved preview, so the live files match the rehearsal exactly:
```text
- YYYY-MM-DD: edited (migrate, 0.6.0 task record: header references and sections, developer decision)
- YYYY-MM-DD: blocked → checking (migrate, awaiting manual checks)
```
A task already in the new shape that only gains header fields logs `edited (migrate, 0.6.0 task record: header fields, developer decision)`.
### Done tasks
`done` tasks get the same rewrite, but the developer reviews them in bulk, not one by one:
- `depends_on` is always `[]`: the task has finished, so prerequisites no longer gate anything.
- A value that can't be parsed or resolved (an incomplete design reference, a short SHA that no longer resolves, an unclear approach) becomes `null` instead of a question. The original section text is kept in the checkpoint.
- Text with no clear home goes into `## Scope of work`, as above.
Exception: a `done` design task named in the `implements` of a code task that isn't `done` gets the per-task review for its `approval` and `submitted`, because that approval still gates the code task.
Tasks in every other status get the per-task review in the preview.
## Preconditions and read-only preview
- The installed plugin reports `0.6.0` or later, and the project's last verified checkpoint is `0.5.0`, reached earlier or by the 0.5.0 step in this same run (or there is an incomplete `release-0-6-0` step). Codex users first refresh the project copy with `/factory:codex` so `$factory-migrate` reads these instructions and the new overview script.
- Every record writer is paused: other sessions, linked worktrees, scheduled `feedback` runs and allocators in other clones. Never run a 0.5.0 session against the catalog during or after this migration.
- `$FACTORY_ROOT/locks/` holds no lock. An existing lock is reported with its owner; removing a possibly stale lock is a developer decision.
Build the inventory read-only, without fetching, creating directories or taking locks. For every file in `tasks/`:
1. Parse the header and the `##` sections. Stop for a developer decision on: a numeric `id`; an unknown `kind`; a design task with a code-only status; a task mixing old and new sections; a section that appears twice; a header with both `design` and `implements`.
2. Derive the new header values, body and status, and the log lines to append.
3. Collect the questions: prerequisites, unparseable references, revision mismatches and unclear approaches in tasks that aren't `done`, and in `done` design tasks that a non-done code task implements.
Show:
- **Tasks that aren't done**, one at a time: header before and after, each moved and dropped part of the body, status change, log lines, and open questions.
- **Done tasks**, as one table: ID, track, header fields set, fields left `null` with the reason, sections moved, lines dropped. The developer may open any of them, but approves them as a group.
- Blockers, and the checkpoint content.
Then rehearse the whole migration in a sandbox as the [migrate command](../../skills/migrate/SKILL.md#rehearse-in-a-sandbox-first) requires, and show the rehearsal's `changes` list with the preview. Only `tasks/*.md` and `migration.md` may appear in it.
## Approval and backup
The developer answers the open questions, then approves the per-task previews, the done-task table and the rehearsal result. Approval of an earlier preview does not carry over if the inventory changed.
Before any live write, copy the whole catalog to the agreed external backup location, outside the product checkout and its Git directory. Verify the copy file by file against SHA-256 hashes. Record the backup location, the hashes and the approved inventory with the checkpoint.
Product cleanup, commits and pushes are not part of this migration.
## Ordered migration instructions
Hold the migration lock (`<git-common-dir>/factory-migration.lock`) throughout. When this is the first live step of the upgrade, run `verify` on the sandbox snapshot first; any drift invalidates the rehearsal and the approval. When earlier steps ran live in the same session, compare the live catalog with the rehearsal's recorded state after those steps instead.
1. **Tasks.** For each task in the approved inventory, take its lock `locks/task-<id>` (recording this migration session as owner), re-read the file and confirm it still matches the backup hash, write the rehearsed content to a temporary file in `tasks/`, rename it over the task file, confirm the result matches the rehearsal, then release the lock. Check: every task meets the target invariants below.
2. **Checkpoint.** Append to `migration.md`: migration ID `release-0-6-0`, target `0.6.0`, descriptor SHA-256, date, the per-task summary (header fields set, fields left `null` with the reason, status changes, dropped lines), the full text of every removed reference section and `blocker` field, backup location and hashes, and the checks below. Mark the `0.6.0` target verified only after every check passes.
If a check fails, stop. Record the step as partial in the checkpoint with the tasks done, and report.
## Verification and completion
- Every task's header has every field of its track's template, and `depends_on` is a list. Every design task past `draft` that isn't `done` has a `reviewer` and an `approach` of `figma` or `prototype`.
- Every task's body has exactly `## General description`, `## Goals`, `## Scope of work`, `## Acceptance criteria` and `## Log`, in that order, and no removed section.
- Compared with the backup, `id`, `legacy_id`, `title`, `kind`, `priority` and every other header field are unchanged, apart from the approved `design` → `implements` rename and `blocker` removal; status changed only as approved; the log section starts with the old log lines, byte for byte, followed only by the approved new lines.
- Every non-empty body line of the backup, apart from its `##` heading, is in the new body with the same text, or listed as moved, reformatted or dropped in the approved preview, or kept in the checkpoint as removed reference text. Only the list and checkbox markers the migration adds, and a custom heading turned into a bold label, may differ.
- For every code task that isn't `done` and has a non-null `implements`, the named design task's `approval.revision` equals `implements.revision`, unless the mismatch is a developer decision listed in the approved preview.
- The task count equals the inventory. Nothing outside `tasks/*.md` and `migration.md` changed.
- The [overview script](../../skills/tasks/overview.mjs), run without `--prs`, reports no `run /factory:migrate 0.6.0` note for any task, and no blocker that the preview didn't list. Don't use `/factory:tasks` here: from 0.6.1 it may settle merged tasks.
- The live result matches the rehearsal's `changes` list.
Report the per-task summary, the checks and the backup location. Migration makes no task ready, approved or delivered, and starts nothing.
## Repeat runs and interrupted migration
- **Verified checkpoint present:** check the invariants above read-only and stop. Write nothing.
- **Interrupted step 1:** a task that matches its rehearsed content is done; one that matches its backup hash is pending. Any other content means it changed since the preview: stop for reconciliation. Never apply the rehearsed content over it.
- **Locks left by the interrupted migration:** a `locks/task-<id>` lock whose recorded owner is this migration session (named in the checkpoint) is released after its task has been checked as above. Any other lock still needs its owner's or the developer's decision.
- A new task created since the inventory needs a new preview, rehearsal and approval. Never overwrite newer work with a copy from the rehearsal or the backup.
## Rollback and recovery
Pause writers. Export anything created or changed after the migration (new tasks, status changes, log lines, journal entries) before restoring. Restore `tasks/` from the verified backup, then reinstall plugin `0.5.0`: 0.6.0 workflows can't resume an unmigrated in-progress task, and 0.5.0 workflows don't read the 0.6.0 header, so never run both versions against one catalog. Re-apply exported newer work by hand with the developer. Mark the `release-0-6-0` checkpoint as rolled back rather than deleting it. Recovery never rewrites product history or deletes the backup.
## Maintainer verification
Before release, rehearse with the [sandbox helper](../../scripts/migration-sandbox.mjs) on disposable fixture projects, never live consumer records:
- Historical paths: a `0.5.0` catalog, and a `0.4.1` catalog upgraded through `0.5.0` to `0.6.0`.
- Mixed content: code tasks in every status, with and without a design reference and a delivery reference; a code task in review implementing a `done` design task, with matching revisions; design tasks with Figma and prototype approaches, pending, changes-requested and approved decisions, and a linked development task; a custom section; a ready task naming a prerequisite; a done task with an unresolvable reference.
- Pre-release 0.6.0 records: `blocked` code tasks waiting for manual checks and for re-approval, a task with the earlier `design` or `blocker` header field, and a task already in the new shape.
- Blockers: a held lock, a task mixing old and new sections, a numeric ID.
- Repeat on a verified project; interruption during step 1 and resume; rollback restoring the backup.
`node --test tests/*.test.mjs` covers the sandbox helper, the migration index and the overview script. The agent-run rehearsal is recorded in the release PR with its fixtures, commands and results; instruction tests do not prove an agent follows them.