Reject unsupported session state before execution and restore

This commit is contained in:
2026-11-29 23:57:16 +00:00
parent 8bc3ae56cb
commit 816453b444
16 changed files with 172 additions and 49 deletions

View File

@@ -178,7 +178,7 @@ Artifacts package owns shared remote current-state loading mechanics used by
restore, status and validation checks, and previous-cache planning.
The selected session manifest is accepted only with
`schema_version: narratio.session-manifest.v1` and complete stage identity.
`schema_version: narratio.session-manifest.v2` and complete stage identity.
An unsupported local or downloaded manifest must be replaced by regeneration,
verified restore, or republication; artifact resolution never fills in missing
authority markers.

View File

@@ -10,7 +10,7 @@ manifest placement belongs in
`manifest.Manifest` records:
- required `schema_version: narratio.session-manifest.v1`
- required `schema_version: narratio.session-manifest.v2`
- identity (`session_id`, `campaign`, `run_id`)
- local path metadata (`local_workdir`, `local_spool_dir`)
- remote identity metadata (`s3_bucket`, `s3_session_prefix`, `s3_run_prefix`)
@@ -24,17 +24,17 @@ guidance rather than being normalized into a different workspace or remote
namespace.
Decoding rejects unknown typed fields, including informational fields inside
`effective_config` and its nested selection. The schema version remains
`narratio.session-manifest.v1`; there is no compatibility reader that silently
drops retired fields. See [overlay migration](../operations.md#migrating-manifest-overlay-provenance)
for deliberate migration of retired selection provenance. Cleanup progress uses
only the cleanup entry in `stages`.
`effective_config` and its nested selection. The schema version is
`narratio.session-manifest.v2`; there is no compatibility reader that silently
drops retired fields. See [overlay provenance](../operations.md#migrating-manifest-overlay-provenance)
for handling retired selection provenance. Cleanup progress uses only the
cleanup entry in `stages`.
Every persisted session manifest has a non-nil `stages` map. Each entry is
non-nil and its embedded `name` exactly matches its map key; loading never
invents either marker. A missing or unsupported schema version, or incomplete
stage identity, is unsupported local state: move it aside and regenerate it,
or restore a verified current committed snapshot when that is authoritative.
stage identity, is unsupported local state: move it aside before regenerating it
or restoring a supported committed snapshot when that is authoritative.
Prepare records independent `party` and `players` input checksums. In canonical
party mode, the party record retains its campaign source identity while the
@@ -86,10 +86,8 @@ from reviving pre-force results.
Older aggregate-only transcribe success is conservatively regenerated once
when transcribe is selected because it does not bind individual outputs to the
audio bytes used. The session-manifest schema identifier remains
`narratio.session-manifest.v1`; this additive state is accepted by current
Narratio, but older strict-decoding binaries may reject manifests after these
fields have been written.
audio bytes used. The transcribe subcollection has its own version independent
of the session-manifest marker.
### Analyze-owned artifact state

View File

@@ -465,27 +465,10 @@ later extraction actually runs.
## Migrating Manifest Overlay Provenance
The pipeline-selection rename is a clean cutover. Manifests containing
`effective_config.selected_profile` are rejected by strict decoding; Narratio
does not silently discard or translate that retired field.
Before using an affected local session with the new version:
1. Stop Narratio activity for the session and back up its manifest.
2. Rename only `effective_config.selected_profile` to `selected_overlay`, keeping
its `name` and `source`, or remove the retired informational member. If a
current `selected_overlay` member already exists, retain it and remove the
retired member rather than creating duplicate keys.
3. Preserve the schema version, digest, stage records, checkpoint evidence,
output references, and other session state. Retry the intended command.
This metadata is informational, not resume authority. Do not delete session
progress or force all stages merely to perform this migration. Other unknown
fields still require investigation rather than blanket removal.
Do not edit immutable remote committed snapshots. Restoring an older snapshot
with retired provenance requires a compatible previous Narratio version, followed
by migration of the restored local manifest before using the new version.
Manifests containing `effective_config.selected_profile` are rejected by strict
decoding. Historical session state is not converted in place; move it aside and
regenerate the session using the supported format. Do not edit immutable remote
snapshots.
## Migrating Audita and Provider Credentials
@@ -732,10 +715,10 @@ Durable session paths:
- `cache/notarius/references/<sha256>/<prepared-basename>`
`manifest.json` is the versioned session-progress document. Narratio accepts
only `narratio.session-manifest.v1`. Do not edit unsupported session state to
add missing markers. Move it aside and regenerate it, restore a verified
current committed snapshot, or republish healthy regenerated state as the
relevant workflow requires.
only `narratio.session-manifest.v2`. Do not edit unsupported session state to
add missing markers. Move unsupported local state aside before regenerating it
or restoring a supported committed snapshot. Republish regenerated state when
the remote snapshot is unsupported.
Validated Notarius bundles live below `artifacts/notarius/{run_id}/`; receipt,
stderr, and pre-promotion output remain in the producing run's `extract`

View File

@@ -120,6 +120,12 @@ Use local synthetic fixtures; no sibling checkout is needed by default tests.
## Stage 2 — Establish the supported-state boundary
**Complete.** Commit: `Reject unsupported session state before execution and restore`.
Verification: `go test ./internal/app ./internal/manifest ./internal/artifacts
./internal/doccheck` with Go 1.27.4 passed, including forced local and remote
rejection without session-file mutation. Remote discovery uses the existing
strict manifest loader before planning.
**Read:** roadmap “One cutover and durable-state boundary”;
[Manifest Internals](../internal/manifest.md) and
[Restore Internals](../internal/command-restore.md). Entry points: