0.5.0: prefixed task IDs, priorities and journal-tracked feedback
Applicability and exclusions
This is the single migration for the whole 0.5.0 release (Codex adapters #24, task structure #25, unattended feedback #37). It is a breaking pre-1.0 update to the existing catalog, released as 0.4.1 → 0.5.0. It runs after the verified 0.4.1 step of the sequential upgrade. A project several versions behind completes every earlier step first, including the 0.4.0 storage move. Legacy .factory/ records or factory-task-ids/ reservations that the 0.4.0 checkpoint in migration.md does not list as verified historical copies mean an earlier step is incomplete: stop. Listed copies that still match their recorded hashes are history: they keep their old IDs, are not renamed, and are not blockers.
What changes in records, by developer decision:
- Identities. Every task and reservation with a numeric ID is renumbered by kind, keeping its suffix:
003withkind: code(or no kind) becomesDEV-003;kind: designbecomesDSGN-003. The old ID is kept aslegacy_id. - Priority. Every task without a
prioritygetspriority: normal, whatever its status. An existing valid priority is kept. - Feedback reports. Journal entries covered by an old
reports/YYYY-MM-DD.mdreport get a- **Reported**: <report date>, <issue URL>line. Thenreports/is archived with the external backup and removed from the catalog.
What does not need migration: Codex support (installed separately with /factory:codex; installing it never migrates records), new skills, and lock names (locks/task-<full-id>, locks/journal) because no lock may be held while migrating.
Outcomes:
- Fresh project (no catalog and no legacy records): nothing to migrate; record nothing.
- Already applied (checkpoint for
release-0-5-0verified, no numeric IDs, noreports/): read-only check, no new log entries. - Partially applied (checkpoint marked partial, or a mix of numeric and prefixed records): resume as in Repeat runs.
- A catalog that already has prefixed tasks (for example created by a pre-release 0.5.0 build) is migrated the same way; its prefixed records only need the priority check.
Artifacts and preservation
| Artifact | Change | Kept byte-identical |
|---|---|---|
tasks/NNN-slug.md |
Renamed to tasks/<PREFIX>-NNN-slug.md. Frontmatter id becomes the prefixed ID; legacy_id: "NNN" is added after it; kind: code is added when kind is missing; priority: normal is added when priority is missing. One log line is appended. Approved forward references (below) are rewritten. |
Title, status, every other frontmatter field, all section text except approved references, every existing log line, approval and review evidence. |
task-ids/NNN/ |
Renamed to task-ids/<PREFIX>-NNN/; a new file legacy-id containing NNN is added. Its existing metadata, which may name the old ID, is not edited; allocation accepts it when legacy-id matches. |
Every existing file in the reservation, including abandoned reservations without a task file. |
journal.md |
- **Reported**: … lines are inserted under the Context line (or under the last metadata bullet when there is none) of entries covered by old reports. |
Every existing line, including task NNN contexts, which stay as history. |
reports/ |
Copied into the external backup, verified, then removed from the catalog. | The archived copy. |
designs/, migration.md, other custom files |
Unchanged, except the migration checkpoint appended to migration.md. |
File names such as designs/003-review.md stay; tasks keep pointing at them. |
| Product checkouts and branches | Not touched. Branch names such as factory/003-login stay; the task's recorded delivery reference still locates them. |
Everything. |
Suffix. The suffix keeps its numeric value and is written in the new format: three digits below 1000, no extra leading zeros (7 → DEV-007, 0042 → DEV-042, 1000 → DEV-1000). The preview marks every ID whose digits change so the developer can confirm it. An old ID of 0 cannot be mapped and needs a developer decision.
Forward references. Text outside the Log section that names another task by its old ID as a current relationship (the code task's Design reference task ID, a design task's Linked development task, a dependency or blocker) is rewritten to the new ID. File paths are not rewritten, because the files keep their names. Each rewrite is listed in the preview; an ambiguous mention (for example a number that may not be a task) is left unchanged unless the developer decides otherwise. Log lines, journal entries and approval evidence are history and are never rewritten.
Appended log line, one per task:
- YYYY-MM-DD: renumbered from 003 to DEV-003; priority set to normal (0.5.0 release migration, developer decision)
Omit the part that did not apply (for example "priority set to normal" when the task already had one). The date is the rehearsal date shown in the approved preview, not the day of the live run, so the live files match the rehearsed content exactly.
Preconditions and read-only preview
- The installed plugin reports
0.5.0or later, and the project's last verified checkpoint is0.4.1(or an incompleterelease-0-5-0step). Codex users first refresh the project copy with/factory:codexso$factory-migratereads these instructions. - Every record writer is paused: other sessions, linked worktrees, scheduled
feedbackautomations and allocators in other clones. Never run a 0.4.1 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.ghsigned in is optional. It is used only for read-only issue lookups by title (step 4 below). Without it, those reports are listed as unresolved.
Build the inventory read-only, without fetching, creating directories or taking locks:
- Every file in
tasks/: parseid,kind,priority; derive the new ID and file name. Stop for a developer decision on: an unknownkind; a malformedid; a file name that disagrees with itsid; two tasks with the same old ID; a target name or reservation that already exists for a different task; an invalidpriorityvalue. - Every directory in
task-ids/: match it to its task (same old ID). A reservation without a task takes its kind from its own metadata. If neither exists, the developer chooses code or design; the reservation is never deleted or reused. - Forward references to rewrite, per task, as old text → new text.
- Every report in
reports/. Its period runs from the day after the previous report's file date (or the first journal entry) through its own file date. Its issue is the URL in the report; otherwise look up an issue titled exactlyFeedback: <project> <start> to <end>withgh issue list --repo je3yk/software-factory --state all --search "\"<title>\" in:title" --json title,urland compare titles exactly. List the journal entries in the period without a Reported line. A report with no issue found leaves its entries unmarked, so the nextfeedbackrun reports them; show this and let the developer supply a URL instead. - Show the identity mapping table (old ID, new ID, kind, old and new file name, status, priority before and after), the reservation renames, the reference rewrites, the journal entries to mark, the
reports/archive, and any blocker.
Then rehearse the whole migration in a sandbox as the migrate command requires, and show the rehearsal's changes list with the preview.
Approval and backup
The developer approves the exact preview and the rehearsal result: the identity mapping, priorities, reference rewrites, journal marks and the reports/ removal. Approval of an earlier preview does not carry over if the inventory changed.
Before any live write, copy the whole catalog (tasks/, task-ids/, journal.md, reports/, designs/, migration.md and anything else in it) 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. This backup is also the reports/ archive.
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. Then apply the phases in order, each on live paths, re-reading every source before writing it. Record each phase as done in the checkpoint only after its check passes.
- Tasks. For each task in the approved mapping, take its lock
locks/task-<new-id>(recording this migration session as owner), write the new content to a temporary file intasks/, rename it to the new file name (refusing to replace an existing file), confirm it matches the rehearsed content, then delete the old file and release the lock. Check: no numericidremains intasks/, and every new file matches the rehearsal. - Reservations. Rename each
task-ids/NNN/totask-ids/<PREFIX>-NNN/(refusing an existing destination) and add itslegacy-idfile. Check: no numeric reservation remains, and their count is unchanged. - Journal. Under
locks/journal, re-readjournal.md, insert the approved Reported lines, write the result to a temporary file in the same directory and rename it overjournal.md. Check: the only difference from the backup is the inserted lines. - Reports. Confirm the backup's copy of
reports/matches the live directory by hash, then delete$FACTORY_ROOT/reports/. Check:reports/is absent and the archived copy is complete. - Checkpoint. Append to
migration.md: migration IDrelease-0-5-0, target0.5.0, descriptor SHA-256, date, the identity mapping table, marked entries, backup location and hashes, and the checks below. Mark the0.5.0target verified only after every check passes.
If a check fails, stop. Do not run later phases. Record the phase as partial in the checkpoint with what was done, and report.
Verification and completion
- Every task file is named
<id>-slug.mdwith anidmatchingDEV-NNNorDSGN-NNN, akindagreeing with its prefix and a validpriority. Every task that had a numeric ID has a matchinglegacy_id; alllegacy_idvalues are unique. - The task and reservation counts equal the inventory. Every reservation has a prefixed name and the old reservation's files unchanged.
- Compared with the backup, each task differs only by the approved frontmatter changes, reference rewrites and one appended log line; the journal only by the inserted Reported lines.
reports/is absent from the catalog and present, unchanged, in the backup.- The overview script, run without
--prs, lists every task with its new ID and no unmigrated entry. Don't use/factory:taskshere: from 0.6.1 it may settle merged tasks. - The live result matches the rehearsal's
changeslist.
Report the mapping, 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.
- Locks left by the interrupted migration: a
locks/task-<new-id>orlocks/journallock whose recorded owner is this migration session (named in the checkpoint) is released after the affected file has been checked as below. Any other lock still needs its owner's or the developer's decision. - Interrupted phase 1: for each task, if only the old file exists, it is pending. If both exist, compare the new file with the rehearsed content: when it matches, delete the old file; otherwise stop for reconciliation. If only the new file exists, check it against the rehearsal.
- Interrupted phase 2: a reservation present under both names is reconciled the same way; never delete one whose contents differ.
- Interrupted phase 3: entries already carrying the expected Reported line are not marked twice.
- Interrupted phase 4: if
reports/is partly deleted, confirm the backup holds every file before finishing. - Records changed since the approved inventory (new tasks, edited files) need 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 DEV-/DSGN- tasks, journal entries) before restoring. Restore the catalog from the verified backup only for the paths this migration changed, then reinstall plugin 0.4.1: the 0.5.0 workflows refuse unmigrated numeric records, and the 0.4.1 workflows do not understand prefixed IDs, so never run both versions against one catalog. Re-apply exported newer work by hand with the developer. Mark the release-0-5-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.2.0-style project with.factory/records, a0.4.0catalog and a0.4.1catalog, each upgraded through every intervening step to0.5.0. - Mixed content: code, design and kind-less tasks in every status; an abandoned reservation with and without metadata; a design task linked to a code task; old reports with and without a URL; a journal with entries outside any report period.
- Blockers: duplicate old IDs, an unknown kind, an existing target file, a held lock.
- Repeat on a verified project; interruption after each phase and resume; rollback restoring the backup.
node --test tests/*.test.mjs covers the sandbox helper and the migration index. 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-5-0 target_version: "0.5.0" target_layout: "Same <absolute git-common-dir>/factory/ catalog; every task and reservation uses a DEV-NNN or DSGN-NNN identity with legacy_id and a priority; journal entries covered by old reports carry Reported lines; no reports/ directory" --- # 0.5.0: prefixed task IDs, priorities and journal-tracked feedback ## Applicability and exclusions This is the single migration for the whole 0.5.0 release (Codex adapters #24, task structure #25, unattended feedback #37). It is a **breaking** pre-1.0 update to the existing catalog, released as `0.4.1 → 0.5.0`. It runs after the verified `0.4.1` step of the [sequential upgrade](../updating.md#select-version-scoped-migration-instructions). A project several versions behind completes every earlier step first, including the `0.4.0` storage move. Legacy `.factory/` records or `factory-task-ids/` reservations that the `0.4.0` checkpoint in `migration.md` does not list as verified historical copies mean an earlier step is incomplete: stop. Listed copies that still match their recorded hashes are history: they keep their old IDs, are not renamed, and are not blockers. What changes in records, by developer decision: 1. **Identities.** Every task and reservation with a numeric ID is renumbered by kind, keeping its suffix: `003` with `kind: code` (or no kind) becomes `DEV-003`; `kind: design` becomes `DSGN-003`. The old ID is kept as `legacy_id`. 2. **Priority.** Every task without a `priority` gets `priority: normal`, whatever its status. An existing valid priority is kept. 3. **Feedback reports.** Journal entries covered by an old `reports/YYYY-MM-DD.md` report get a `- **Reported**: <report date>, <issue URL>` line. Then `reports/` is archived with the external backup and removed from the catalog. What does not need migration: Codex support (installed separately with `/factory:codex`; installing it never migrates records), new skills, and lock names (`locks/task-<full-id>`, `locks/journal`) because no lock may be held while migrating. Outcomes: - **Fresh project** (no catalog and no legacy records): nothing to migrate; record nothing. - **Already applied** (checkpoint for `release-0-5-0` verified, no numeric IDs, no `reports/`): read-only check, no new log entries. - **Partially applied** (checkpoint marked partial, or a mix of numeric and prefixed records): resume as in [Repeat runs](#repeat-runs-and-interrupted-migration). - A catalog that already has prefixed tasks (for example created by a pre-release 0.5.0 build) is migrated the same way; its prefixed records only need the priority check. ## Artifacts and preservation | Artifact | Change | Kept byte-identical | | --- | --- | --- | | `tasks/NNN-slug.md` | Renamed to `tasks/<PREFIX>-NNN-slug.md`. Frontmatter `id` becomes the prefixed ID; `legacy_id: "NNN"` is added after it; `kind: code` is added when `kind` is missing; `priority: normal` is added when `priority` is missing. One log line is appended. Approved forward references (below) are rewritten. | Title, status, every other frontmatter field, all section text except approved references, every existing log line, approval and review evidence. | | `task-ids/NNN/` | Renamed to `task-ids/<PREFIX>-NNN/`; a new file `legacy-id` containing `NNN` is added. Its existing metadata, which may name the old ID, is not edited; [allocation](../../skills/task-ids.md) accepts it when `legacy-id` matches. | Every existing file in the reservation, including abandoned reservations without a task file. | | `journal.md` | `- **Reported**: …` lines are inserted under the **Context** line (or under the last metadata bullet when there is none) of entries covered by old reports. | Every existing line, including `task NNN` contexts, which stay as history. | | `reports/` | Copied into the external backup, verified, then removed from the catalog. | The archived copy. | | `designs/`, `migration.md`, other custom files | Unchanged, except the migration checkpoint appended to `migration.md`. | File names such as `designs/003-review.md` stay; tasks keep pointing at them. | | Product checkouts and branches | Not touched. Branch names such as `factory/003-login` stay; the task's recorded delivery reference still locates them. | Everything. | **Suffix.** The suffix keeps its numeric value and is written in the new format: three digits below 1000, no extra leading zeros (`7` → `DEV-007`, `0042` → `DEV-042`, `1000` → `DEV-1000`). The preview marks every ID whose digits change so the developer can confirm it. An old ID of `0` cannot be mapped and needs a developer decision. **Forward references.** Text outside the **Log** section that names another task by its old ID as a current relationship (the code task's **Design reference** task ID, a design task's **Linked development task**, a dependency or blocker) is rewritten to the new ID. File paths are not rewritten, because the files keep their names. Each rewrite is listed in the preview; an ambiguous mention (for example a number that may not be a task) is left unchanged unless the developer decides otherwise. Log lines, journal entries and approval evidence are history and are never rewritten. **Appended log line**, one per task: ```markdown - YYYY-MM-DD: renumbered from 003 to DEV-003; priority set to normal (0.5.0 release migration, developer decision) ``` Omit the part that did not apply (for example "priority set to normal" when the task already had one). The date is the rehearsal date shown in the approved preview, not the day of the live run, so the live files match the rehearsed content exactly. ## Preconditions and read-only preview - The installed plugin reports `0.5.0` or later, and the project's last verified checkpoint is `0.4.1` (or an incomplete `release-0-5-0` step). Codex users first refresh the project copy with `/factory:codex` so `$factory-migrate` reads these instructions. - Every record writer is paused: other sessions, linked worktrees, scheduled `feedback` automations and allocators in other clones. Never run a 0.4.1 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. - `gh` signed in is optional. It is used only for read-only issue lookups by title (step 4 below). Without it, those reports are listed as unresolved. Build the inventory read-only, without fetching, creating directories or taking locks: 1. Every file in `tasks/`: parse `id`, `kind`, `priority`; derive the new ID and file name. Stop for a developer decision on: an unknown `kind`; a malformed `id`; a file name that disagrees with its `id`; two tasks with the same old ID; a target name or reservation that already exists for a different task; an invalid `priority` value. 2. Every directory in `task-ids/`: match it to its task (same old ID). A reservation without a task takes its kind from its own metadata. If neither exists, the developer chooses code or design; the reservation is never deleted or reused. 3. Forward references to rewrite, per task, as old text → new text. 4. Every report in `reports/`. Its period runs from the day after the previous report's file date (or the first journal entry) through its own file date. Its issue is the URL in the report; otherwise look up an issue titled exactly `Feedback: <project> <start> to <end>` with `gh issue list --repo je3yk/software-factory --state all --search "\"<title>\" in:title" --json title,url` and compare titles exactly. List the journal entries in the period without a **Reported** line. A report with no issue found leaves its entries unmarked, so the next `feedback` run reports them; show this and let the developer supply a URL instead. 5. Show the identity mapping table (old ID, new ID, kind, old and new file name, status, priority before and after), the reservation renames, the reference rewrites, the journal entries to mark, the `reports/` archive, and any blocker. 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. ## Approval and backup The developer approves the exact preview and the rehearsal result: the identity mapping, priorities, reference rewrites, journal marks and the `reports/` removal. Approval of an earlier preview does not carry over if the inventory changed. Before any live write, copy the whole catalog (`tasks/`, `task-ids/`, `journal.md`, `reports/`, `designs/`, `migration.md` and anything else in it) 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. This backup is also the `reports/` archive. 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. Then apply the phases in order, each on live paths, re-reading every source before writing it. Record each phase as done in the checkpoint only after its check passes. 1. **Tasks.** For each task in the approved mapping, take its lock `locks/task-<new-id>` (recording this migration session as owner), write the new content to a temporary file in `tasks/`, rename it to the new file name (refusing to replace an existing file), confirm it matches the rehearsed content, then delete the old file and release the lock. Check: no numeric `id` remains in `tasks/`, and every new file matches the rehearsal. 2. **Reservations.** Rename each `task-ids/NNN/` to `task-ids/<PREFIX>-NNN/` (refusing an existing destination) and add its `legacy-id` file. Check: no numeric reservation remains, and their count is unchanged. 3. **Journal.** Under `locks/journal`, re-read `journal.md`, insert the approved **Reported** lines, write the result to a temporary file in the same directory and rename it over `journal.md`. Check: the only difference from the backup is the inserted lines. 4. **Reports.** Confirm the backup's copy of `reports/` matches the live directory by hash, then delete `$FACTORY_ROOT/reports/`. Check: `reports/` is absent and the archived copy is complete. 5. **Checkpoint.** Append to `migration.md`: migration ID `release-0-5-0`, target `0.5.0`, descriptor SHA-256, date, the identity mapping table, marked entries, backup location and hashes, and the checks below. Mark the `0.5.0` target verified only after every check passes. If a check fails, stop. Do not run later phases. Record the phase as partial in the checkpoint with what was done, and report. ## Verification and completion - Every task file is named `<id>-slug.md` with an `id` matching `DEV-NNN` or `DSGN-NNN`, a `kind` agreeing with its prefix and a valid `priority`. Every task that had a numeric ID has a matching `legacy_id`; all `legacy_id` values are unique. - The task and reservation counts equal the inventory. Every reservation has a prefixed name and the old reservation's files unchanged. - Compared with the backup, each task differs only by the approved frontmatter changes, reference rewrites and one appended log line; the journal only by the inserted **Reported** lines. - `reports/` is absent from the catalog and present, unchanged, in the backup. - The [overview script](../../skills/tasks/overview.mjs), run without `--prs`, lists every task with its new ID and no unmigrated entry. 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 mapping, 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. - **Locks left by the interrupted migration:** a `locks/task-<new-id>` or `locks/journal` lock whose recorded owner is this migration session (named in the checkpoint) is released after the affected file has been checked as below. Any other lock still needs its owner's or the developer's decision. - **Interrupted phase 1:** for each task, if only the old file exists, it is pending. If both exist, compare the new file with the rehearsed content: when it matches, delete the old file; otherwise stop for reconciliation. If only the new file exists, check it against the rehearsal. - **Interrupted phase 2:** a reservation present under both names is reconciled the same way; never delete one whose contents differ. - **Interrupted phase 3:** entries already carrying the expected **Reported** line are not marked twice. - **Interrupted phase 4:** if `reports/` is partly deleted, confirm the backup holds every file before finishing. - Records changed since the approved inventory (new tasks, edited files) need 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 `DEV-`/`DSGN-` tasks, journal entries) before restoring. Restore the catalog from the verified backup only for the paths this migration changed, then reinstall plugin `0.4.1`: the 0.5.0 workflows refuse unmigrated numeric records, and the 0.4.1 workflows do not understand prefixed IDs, so never run both versions against one catalog. Re-apply exported newer work by hand with the developer. Mark the `release-0-5-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.2.0`-style project with `.factory/` records, a `0.4.0` catalog and a `0.4.1` catalog, each upgraded through every intervening step to `0.5.0`. - Mixed content: code, design and kind-less tasks in every status; an abandoned reservation with and without metadata; a design task linked to a code task; old reports with and without a URL; a journal with entries outside any report period. - Blockers: duplicate old IDs, an unknown kind, an existing target file, a held lock. - Repeat on a verified project; interruption after each phase and resume; rollback restoring the backup. `node --test tests/*.test.mjs` covers the sandbox helper and the migration index. 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.