Merge imported products into local session state

This commit is contained in:
2026-12-02 16:24:33 +00:00
parent ad8a5df97b
commit e7fada4372
26 changed files with 638 additions and 1254 deletions

View File

@@ -579,9 +579,7 @@ Publish commit model:
`current/commit-pointer.json` is the remote current-state commit marker. It
selects exactly one immutable commit, which declares the complete object set.
The current restore implementation still expects a published execution ledger;
new publications cannot be restored until the inventory-based restore cutover
described in the [implementation roadmap](roadmap/implementation.md) lands.
Restore reads that inventory without fetching an execution ledger.
## Remote Commit Migration
@@ -641,7 +639,8 @@ narratio session locks remove 2026-04-04 narratio.artifact.session_recap
## Restore Workflow
Use restore when local durable session state is missing or stale and remote committed current state is authoritative.
Use restore to import products from the selected publication into a local session.
Existing local progress is retained where its evidence remains valid.
Dry run:
@@ -665,8 +664,8 @@ content verification. It does not certify that an import or pipeline run occurre
Default restore scope:
- the committed session manifest, prepared inputs, and transcript/artifact
objects declared by the selected remote commit
- prepared inputs and currently recognized transcript/artifact products declared
by the selected remote commit
- `inputs/previous/**` when needed by enabled targets or their configured
prerequisites, including disabled prerequisites; each is selected from its
exact committed `published_output` declaration
@@ -677,6 +676,12 @@ Optional:
- `--force` to overwrite eligible conflicting regular files; it never replaces
directories, symlinks, or other non-regular local targets
Verified products without valid local execution evidence receive local supplied
product records. Identical files preserve valid local execution evidence. Changed
products invalidate dependent local work; unrelated checkpoints are preserved.
This import does not claim that the remote execution occurred locally, and
`--force` here authorizes replacement rather than pipeline regeneration.
Restore treats a local leaf symlink or any symlinked ancestor beneath the
selected session root as a conflict, even when the linked content matches the
selected remote object. `--force` does not override that conflict.
@@ -692,7 +697,7 @@ If restore fails after beginning installation, it leaves a durable
`.restore-incomplete.json` marker in the session root. Pipeline runs will stop
until you rerun the same restore command and it completes. Restore intentionally
does not try to roll back files already installed; retrying the selected remote
snapshot is the recovery procedure.
publication is the recovery procedure.
## Local State Layout

View File

@@ -313,9 +313,8 @@ Validation: `go test ./internal/artifacts ./internal/app`.
Status: Complete
Cutover note: `TestPreparedSessionPublishAndRemoteLoad` currently fails because
new publication omits the execution snapshot still required by restore. Stage 11
replaces that restore reader and must resolve this expected integration failure.
Cutover note: the prepared-session round trip now uses inventory-based restore;
the temporary snapshot-reader failure was resolved in Stage 11.
Read `internal/previouscache`, `stage/prepare_previous.go`,
`publish*.go`, and consumers of remote manifest fields.
@@ -343,8 +342,7 @@ Validation: `go test ./internal/previouscache ./internal/stage ./internal/artifa
Status: Complete
Cutover note: the Stage 9 integration failure remains pending Stage 11; dry-run
uses inventory planning while installation still uses the transitional reader.
Cutover note: inventory planning now serves both dry-run and installation.
Read `internal/app/restore_plan.go`, product-path mapping, restore reports,
and the source registries/current concrete artifact catalog.
@@ -371,7 +369,7 @@ Validation: `go test ./internal/app ./internal/artifacts`.
## Stage 11: Install and merge local baselines under the existing lock
Status: Pending
Status: Complete
Read `restore_execute.go`, restore recovery/marker code, manifest persistence,
and the existing shared workspace-lock lifecycle.