0.4.0: shared local factory records
Applicability and exclusions
This is a breaking shipped-workflow change, released as the approved pre-1.0 0.3.1 → 0.4.0 update, not an internal-tooling patch. The old branch-tracked .factory/ catalog becomes local, unversioned shared-Git storage. Task IDs, kinds, statuses, history and approval evidence remain valid, but record locations, backup/sharing and delivery-resume contracts change. Main's repository-local .agents/skills/work-issue* stages remain internal tooling: they use the conversation/PR handoff and do not require a consumer catalog or get shipped as /factory: commands.
This is the 0.4.0 step of the sequential upgrade. A project several versions behind first completes every intervening release's migration instructions; this descriptor has no source-version allowlist. Earlier schema conversions, including any transition from the archived pre-restart workflow, belong to those earlier steps. Storage migration preserves file contents except explicitly approved link repairs; task-schema changes and new approvals are separate decisions.
Start after verifying completion of earlier required release steps against the project's checkpoint and records. The installed plugin version alone is not that evidence. Unknown progress or missing earlier instructions stops the upgrade for read-only reconstruction, not a guessed direct jump. Unexpected/custom records require reconciliation in the preview rather than overwrite. Verify the declared target layout and preserved records before marking this step complete or starting a later release's migration.
A fresh project with no legacy records/reservations or existing catalog needs no migration. An already verified migration is a read-only completion check; use its recorded inventory, target-version checkpoint and migration ID. An existing or partial catalog without completion evidence is not proof of success: reconcile it against the approved inventory before writes. Mixed record variants require source-ref/checkout identification and conflict decisions, not source-version matching. Retained verified historical branch copies are not new inputs; unexpected changes require reconciliation.
Artifacts and preservation
Move all .factory/ tasks, journals, reports, design handoffs, screenshots, audit evidence and custom files into corresponding paths under $FACTORY_ROOT. Consolidate legacy <git-common-dir>/factory-task-ids/ and current catalog reservations, including IDs without task files and all metadata. Resolve the absolute destination using the storage contract. docs/factory/ and .agents/skills/ remain product-owned and versioned; do not relocate them.
Preserve IDs, filenames, statuses, custom fields, requirements, history and exact approval/artifact evidence byte-for-byte except approved storage-link repairs. Task-schema edits, design reclassification, new reviews/approvals and status transitions are outside this storage migration. Building/reviewing tasks remain paused until checkout/branch/base/shared-directory and review-submission references are reconciled against the code resume contract or design delivery contract; never invent missing references or resume from an unrelated checkout.
Preconditions and read-only preview
usable Git access and complete agreed ref/worktree coverage, all record writers and allocators paused, a designated coordinator for independent clones, and an external backup destination. Keep the prior installed plugin version and source branch/commit inventory with the backup. Do not resume mixed old/new allocators or remove legacy sources before verified copying. Installing the plugin never supplies migration approval.
The inventory/preview itself must not fetch, create directories, write records or journal entries, execute task verification commands, or start delivery. Any remote refresh requires authorization before inventory; missing coverage stops with a precise report. Preview source refs/checkouts and hashes, every destination and proposed link repair, reservation metadata, divergent variants and separate product-baseline cleanup. Unknown decisions block mutation.
Approval and backup
Obtain the developer's explicit approval of the exact project-specific preview, not merely this release or descriptor. Back up every source variant, uncommitted/untracked record, reservation directory and existing destination outside the product checkout before copying. Verify backup bytes and inventory coverage; retain the prior plugin version, source refs/commits, checkout identities, migration ID and approved inventory. Keep execution evidence in the backup/catalog, not tracked product files. Product cleanup needs separate approval; neither this descriptor nor migration approval authorizes a commit, push, branch switch or loss of another session's work.
Ordered migration instructions
The migrate command loads these target-specific instructions. Follow its preview/approval and paused-writer/migration-lock gates before mutations below; this is agent-assisted execution, not an unattended script. Earlier step checkpoints stay with the external backup until this step establishes the catalog. Do not invoke the retired task-only command.
- Pause record writers and ID allocators in all linked worktrees. With authorization, refresh configured remotes before the read-only preview; inventory
.factory/in every local and remote-tracking branch (git for-each-ref,git ls-tree), every checkout fromgit worktree list --porcelain, and any existing catalog. Include uncommitted/untracked files, non-task artifacts, legacy<common-dir>/factory-task-ids/, and current$FACTORY_ROOT/task-ids/reservations with all metadata, including abandoned IDs without tasks. If fetch/inventory coverage is unavailable, stop and report it. Identify other clones and agree the coordinator and backup destination. - Preview source branch/commit or checkout, destination and content differences for every record and reservation. Consolidate legacy reservations into
$FACTORY_ROOT/task-ids/NNN, preserving their IDs and metadata. Deduplicate identical copies; divergent reservation metadata, duplicate task IDs and journal ordering require a developer decision, never last-write-wins or automatic ID reuse/renumbering. Preserve custom files, history, approval evidence and exact artifact revisions. Preview link rewrites to catalog-relative references (resolved against$FACTORY_ROOT) or external artifact URLs; retain prototype branch/commit references. Do not infer approval from migration. - After approval, back up all source variants, reservation directories and the existing catalog outside the checkout, then copy only reconciled records and reservations into the shared catalog without overwriting unexpected destinations. Re-read sources before copying; if changed, refresh the preview. Compare copied bytes and reservation metadata with approved sources, apart from explicitly approved link edits. Verify every legacy ID is reserved in the new catalog, even without a task. Do not delete sources until verified. Record imported reservation identities in
migration.md; retained identical source copies are historical, and unexpected later source changes require reconciliation. Retire old allocators before resuming; only the catalog allocator may write new reservations. A partially completed migration resumes from verified copies; identical records need no further edits. - Separately preview removing tracked
.factory/from the product baseline and adding/.factory/to its.gitignoreto prevent reintroduction. These are product changes requiring the developer's authorization and normal project review/commit rules; migration does not authorize a commit, push, checkout switch, stash, or loss of uncommitted work. Move remaining untracked legacy records only after backup and verification. Do not rewrite old branches/history. Record imported source refs in the catalog'smigration.md, including resolved variants, so archived copies are distinguishable from new unmigrated work. Old branches containing records must be cleaned before resuming product delivery there; never import their stale copies over the catalog. - Report the catalog location, backup, verified copies, unresolved variants and remaining product cleanup. Resume only after reconciliation and required baseline cleanup. Existing building/reviewing tasks require an explicit pause/resume decision, not an automatic restart. Task-schema migration is a separate reviewed operation; completed tasks keep their historical contents except approved storage-link repairs.
Verification and completion
After the approved storage copy and separately approved baseline cleanup, verify:
- Every reconciled task, custom record, journal, report and handoff is present; compare bytes against the approved source inventory, with only approved link repairs differing. IDs, completed-task history and exact human-approved artifact revisions must survive unchanged.
- Every legacy reservation and its metadata, including abandoned IDs without a task file, exists under the new catalog's
task-ids/. The next allocation is above the highest task or reservation ID. Catalog export/restore must retain these reservations. - Linked worktrees resolve the same absolute catalog; records are absent from the product baseline/diff after cleanup. Design links still resolve to the same approved artifacts. Active tasks remain paused until checkout/branch/base references are explicitly reconciled and validated; missing references block resume, not evidence of a fresh task.
- Repeat the same storage inventory/copy: identical imported records and reservations cause no writes or duplicate journal/task-log entries. Interrupt after some verified copies, then resume using the approved inventory; changed sources or conflicting destinations must stop for reconciliation rather than overwrite either variant.
Record this descriptor's migration_id, verified target_version/target_layout, source refs/hashes, resolved variants, reservation identities, backup location and completed/remaining steps in catalog migration.md after approval. Advance the project's migration checkpoint only after record verification and required baseline cleanup; a partial/failed step blocks later release migrations. Report-only checks add no entries. Delivery and human approval are separate actions.
Repeat runs and interrupted migration
Match the recorded migration ID, target-version checkpoint and approved inventory before resuming. Skip verified identical records/reservations without writes or duplicate log/checkpoint entries. Changed sources, conflicting destinations, missing inventory or unverified earlier steps require reconciliation and a refreshed preview/approval before writes. Never replace newer catalog records with historical branch copies. A partial catalog is not a completed migration; retain sources/backups until all checks pass.
Rollback and recovery
Pause all writers and allocators before recovery. If copying stopped before product cleanup, keep the original records and the partial new catalog, compare them with the source/backup inventory, refresh approval for changed inputs and resume only missing verified copies. Do not recopy over a different destination or interpret a partially populated catalog as a completed migration.
For an approved rollback, first export the current catalog and reservations so work created since migration is not lost; reconcile any newer records with the developer before restoring older snapshots. Restore the prior plugin using the project's normal installation procedure and restore legacy records/reservations from the agreed backup. Uncommitted cleanup requires a reviewed file restoration; committed cleanup requires a separately authorized revert through the project's normal Git workflow, never a destructive reset or history rewrite. Keep both exports until the restored records, links, statuses, approval evidence and next available ID are verified. Restore the migration checkpoint only to the last verified restored target; retain the failed/newer checkpoint evidence with the exports so a retry cannot skip reverted steps. Resume only one agreed old or new coordinator/allocator, not both. A later retry starts with a fresh read-only inventory and approval, not an assumption that the previous preview is still current.
Maintainer verification
For maintainer validation, use isolated copies of representative 0.2.0 code and 0.3.x code/design records, including a divergent branch copy, uncommitted record, approved design handoff, abandoned reservation and interrupted copy. Verify the read-only preview leaves sources unchanged, then exercise only explicitly agreed fixture mutations and the checks above. These are procedure checks for an instruction-only plugin, not evidence that every agent execution is automated. Never use a live consumer project as an upgrade fixture without its owner's approval.
Historical fixture sources: 0.2.0 at 9cb2a37, 0.3.0 at a874277 (then-shared define template for design), and 0.3.1 at 471afe5. Use this descriptor's applicability rules as well as copy/backup primitives; test sequential multi-version ordering, missing/unknown checkpoint handling, target-layout verification, fresh/already-migrated read-only outcomes, partial progress, conflicts, repeats and preservation of post-upgrade work on rollback. Record actual evidence and limitations in the issue PR. The reusable descriptor follows the internal migration template; that authoring skill does not execute consumer migrations.
Original Markdown, including metadata
--- schema_version: 1 migration_id: shared-record-storage target_version: "0.4.0" target_layout: "Local unversioned <absolute git-common-dir>/factory/ catalog, including task-ids/" --- # 0.4.0: shared local factory records ## Applicability and exclusions This is a **breaking shipped-workflow change**, released as the approved pre-1.0 `0.3.1 → 0.4.0` update, not an internal-tooling patch. The old branch-tracked `.factory/` catalog becomes local, unversioned shared-Git storage. Task IDs, kinds, statuses, history and approval evidence remain valid, but record locations, backup/sharing and delivery-resume contracts change. Main's repository-local `.agents/skills/work-issue*` stages remain internal tooling: they use the conversation/PR handoff and do not require a consumer catalog or get shipped as `/factory:` commands. This is the `0.4.0` step of the [sequential upgrade](../updating.md#select-version-scoped-migration-instructions). A project several versions behind first completes every intervening release's migration instructions; this descriptor has no source-version allowlist. Earlier schema conversions, including any transition from the archived pre-restart workflow, belong to those earlier steps. Storage migration preserves file contents except explicitly approved link repairs; task-schema changes and new approvals are separate decisions. Start after verifying completion of earlier required release steps against the project's checkpoint and records. The installed plugin version alone is not that evidence. Unknown progress or missing earlier instructions stops the upgrade for read-only reconstruction, not a guessed direct jump. Unexpected/custom records require reconciliation in the preview rather than overwrite. Verify the declared target layout and preserved records before marking this step complete or starting a later release's migration. A fresh project with no legacy records/reservations or existing catalog needs no migration. An already verified migration is a read-only completion check; use its recorded inventory, target-version checkpoint and migration ID. An existing or partial catalog without completion evidence is not proof of success: reconcile it against the approved inventory before writes. Mixed record variants require source-ref/checkout identification and conflict decisions, not source-version matching. Retained verified historical branch copies are not new inputs; unexpected changes require reconciliation. ## Artifacts and preservation Move all `.factory/` tasks, journals, reports, design handoffs, screenshots, audit evidence and custom files into corresponding paths under `$FACTORY_ROOT`. Consolidate legacy `<git-common-dir>/factory-task-ids/` and current catalog reservations, including IDs without task files and all metadata. Resolve the absolute destination using the [storage contract](../../skills/storage.md). `docs/factory/` and `.agents/skills/` remain product-owned and versioned; do not relocate them. Preserve IDs, filenames, statuses, custom fields, requirements, history and exact approval/artifact evidence byte-for-byte except approved storage-link repairs. Task-schema edits, design reclassification, new reviews/approvals and status transitions are outside this storage migration. Building/reviewing tasks remain paused until checkout/branch/base/shared-directory and review-submission references are reconciled against the [code resume contract](../../skills/deliver/SKILL.md) or [design delivery contract](../../skills/design/delivery.md); never invent missing references or resume from an unrelated checkout. ## Preconditions and read-only preview usable Git access and complete agreed ref/worktree coverage, all record writers and allocators paused, a designated coordinator for independent clones, and an external backup destination. Keep the prior installed plugin version and source branch/commit inventory with the backup. Do not resume mixed old/new allocators or remove legacy sources before verified copying. Installing the plugin never supplies migration approval. The inventory/preview itself must not fetch, create directories, write records or journal entries, execute task verification commands, or start delivery. Any remote refresh requires authorization before inventory; missing coverage stops with a precise report. Preview source refs/checkouts and hashes, every destination and proposed link repair, reservation metadata, divergent variants and separate product-baseline cleanup. Unknown decisions block mutation. ## Approval and backup Obtain the developer's explicit approval of the exact project-specific preview, not merely this release or descriptor. Back up every source variant, uncommitted/untracked record, reservation directory and existing destination outside the product checkout before copying. Verify backup bytes and inventory coverage; retain the prior plugin version, source refs/commits, checkout identities, migration ID and approved inventory. Keep execution evidence in the backup/catalog, not tracked product files. Product cleanup needs separate approval; neither this descriptor nor migration approval authorizes a commit, push, branch switch or loss of another session's work. ## Ordered migration instructions The [migrate command](../../skills/migrate/SKILL.md) loads these target-specific instructions. Follow its preview/approval and paused-writer/migration-lock gates before mutations below; this is agent-assisted execution, not an unattended script. Earlier step checkpoints stay with the external backup until this step establishes the catalog. Do not invoke the retired task-only command. 1. Pause record writers and ID allocators in all linked worktrees. With authorization, refresh configured remotes before the read-only preview; inventory `.factory/` in every local and remote-tracking branch (`git for-each-ref`, `git ls-tree`), every checkout from `git worktree list --porcelain`, and any existing catalog. Include uncommitted/untracked files, non-task artifacts, legacy `<common-dir>/factory-task-ids/`, and current `$FACTORY_ROOT/task-ids/` reservations with all metadata, including abandoned IDs without tasks. If fetch/inventory coverage is unavailable, stop and report it. Identify other clones and agree the coordinator and backup destination. 2. Preview source branch/commit or checkout, destination and content differences for every record and reservation. Consolidate legacy reservations into `$FACTORY_ROOT/task-ids/NNN`, preserving their IDs and metadata. Deduplicate identical copies; divergent reservation metadata, duplicate task IDs and journal ordering require a developer decision, never last-write-wins or automatic ID reuse/renumbering. Preserve custom files, history, approval evidence and exact artifact revisions. Preview link rewrites to catalog-relative references (resolved against `$FACTORY_ROOT`) or external artifact URLs; retain prototype branch/commit references. Do not infer approval from migration. 3. After approval, back up all source variants, reservation directories and the existing catalog outside the checkout, then copy only reconciled records and reservations into the shared catalog without overwriting unexpected destinations. Re-read sources before copying; if changed, refresh the preview. Compare copied bytes and reservation metadata with approved sources, apart from explicitly approved link edits. Verify every legacy ID is reserved in the new catalog, even without a task. Do not delete sources until verified. Record imported reservation identities in `migration.md`; retained identical source copies are historical, and unexpected later source changes require reconciliation. Retire old allocators before resuming; only the catalog allocator may write new reservations. A partially completed migration resumes from verified copies; identical records need no further edits. 4. Separately preview removing tracked `.factory/` from the product baseline and adding `/.factory/` to its `.gitignore` to prevent reintroduction. These are product changes requiring the developer's authorization and normal project review/commit rules; migration does not authorize a commit, push, checkout switch, stash, or loss of uncommitted work. Move remaining untracked legacy records only after backup and verification. Do not rewrite old branches/history. Record imported source refs in the catalog's `migration.md`, including resolved variants, so archived copies are distinguishable from new unmigrated work. Old branches containing records must be cleaned before resuming product delivery there; never import their stale copies over the catalog. 5. Report the catalog location, backup, verified copies, unresolved variants and remaining product cleanup. Resume only after reconciliation and required baseline cleanup. Existing building/reviewing tasks require an explicit pause/resume decision, not an automatic restart. Task-schema migration is a separate reviewed operation; completed tasks keep their historical contents except approved storage-link repairs. ## Verification and completion After the approved storage copy and separately approved baseline cleanup, verify: - Every reconciled task, custom record, journal, report and handoff is present; compare bytes against the approved source inventory, with only approved link repairs differing. IDs, completed-task history and exact human-approved artifact revisions must survive unchanged. - Every legacy reservation and its metadata, including abandoned IDs without a task file, exists under the new catalog's `task-ids/`. The next allocation is above the highest task or reservation ID. Catalog export/restore must retain these reservations. - Linked worktrees resolve the same absolute catalog; records are absent from the product baseline/diff after cleanup. Design links still resolve to the same approved artifacts. Active tasks remain paused until checkout/branch/base references are explicitly reconciled and validated; missing references block resume, not evidence of a fresh task. - Repeat the same storage inventory/copy: identical imported records and reservations cause no writes or duplicate journal/task-log entries. Interrupt after some verified copies, then resume using the approved inventory; changed sources or conflicting destinations must stop for reconciliation rather than overwrite either variant. Record this descriptor's `migration_id`, verified `target_version`/`target_layout`, source refs/hashes, resolved variants, reservation identities, backup location and completed/remaining steps in catalog `migration.md` after approval. Advance the project's migration checkpoint only after record verification and required baseline cleanup; a partial/failed step blocks later release migrations. Report-only checks add no entries. Delivery and human approval are separate actions. ## Repeat runs and interrupted migration Match the recorded migration ID, target-version checkpoint and approved inventory before resuming. Skip verified identical records/reservations without writes or duplicate log/checkpoint entries. Changed sources, conflicting destinations, missing inventory or unverified earlier steps require reconciliation and a refreshed preview/approval before writes. Never replace newer catalog records with historical branch copies. A partial catalog is not a completed migration; retain sources/backups until all checks pass. ## Rollback and recovery Pause all writers and allocators before recovery. If copying stopped before product cleanup, keep the original records and the partial new catalog, compare them with the source/backup inventory, refresh approval for changed inputs and resume only missing verified copies. Do not recopy over a different destination or interpret a partially populated catalog as a completed migration. For an approved rollback, first export the **current** catalog and reservations so work created since migration is not lost; reconcile any newer records with the developer before restoring older snapshots. Restore the prior plugin using the project's normal installation procedure and restore legacy records/reservations from the agreed backup. Uncommitted cleanup requires a reviewed file restoration; committed cleanup requires a separately authorized revert through the project's normal Git workflow, never a destructive reset or history rewrite. Keep both exports until the restored records, links, statuses, approval evidence and next available ID are verified. Restore the migration checkpoint only to the last verified restored target; retain the failed/newer checkpoint evidence with the exports so a retry cannot skip reverted steps. Resume only one agreed old or new coordinator/allocator, not both. A later retry starts with a fresh read-only inventory and approval, not an assumption that the previous preview is still current. ## Maintainer verification For maintainer validation, use isolated copies of representative `0.2.0` code and `0.3.x` code/design records, including a divergent branch copy, uncommitted record, approved design handoff, abandoned reservation and interrupted copy. Verify the read-only preview leaves sources unchanged, then exercise only explicitly agreed fixture mutations and the checks above. These are procedure checks for an instruction-only plugin, not evidence that every agent execution is automated. Never use a live consumer project as an upgrade fixture without its owner's approval. Historical fixture sources: `0.2.0` at `9cb2a37`, `0.3.0` at `a874277` (then-shared define template for design), and `0.3.1` at `471afe5`. Use this descriptor's applicability rules as well as copy/backup primitives; test sequential multi-version ordering, missing/unknown checkpoint handling, target-layout verification, fresh/already-migrated read-only outcomes, partial progress, conflicts, repeats and preservation of post-upgrade work on rollback. Record actual evidence and limitations in the issue PR. The reusable descriptor follows the [internal migration template](../../.agents/skills/work-issue-migrations/migration-template.md); that authoring skill does not execute consumer migrations.