Implemented narratio publish as a shortcut to run the archive stage only

This commit is contained in:
2026-05-22 11:28:38 -05:00
parent 782d0cf3b9
commit 2aa074c5cf
5 changed files with 186 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ Implemented commands:
- `status`: read an existing manifest or inspect local/remote state for a session.
- `run-stage`: execute exactly one stage.
- `analyze`: force-rerun the analyze stage.
- `publish`: force-rerun the archive stage.
- `restore`: restore durable local session state from the committed remote archive state.
- `session validate`: run read-only preflight checks for a session.
- `session init`: create local or remote `session.yml`.
@@ -84,6 +85,16 @@ For config semantics, see [docs/config.md](./config.md). For operator lifecycle
`analyze` is force-by-design and does not accept `--force`.
### `publish`
- `--config <path>`
- `--campaign <path>`
- `--session <path>`
- `--session-id <value>`
- `--previous-session-id <value>`
`publish` is force-by-design and does not accept `--force`, `--artifacts`, or a stage positional argument.
Valid stage names:
- `prepare`
@@ -387,6 +398,27 @@ Common failure cases:
- `--force`, because force is implicit.
- unknown configured artifact keys.
### `publish`
Purpose:
- Force-rerun the archive stage.
- Provide a shorter equivalent for `narratio run-stage --force archive`.
Syntax:
```bash
narratio publish [--config <pipeline.yml>] [--campaign <campaign.yml>] [--session <session.yml>] [--session-id <id>] [--previous-session-id <id>]
```
Success output:
- `narratio publish: executed=<n> skipped=<n> force=true; manifest=<path>`
Common failure cases:
- positional arguments.
- `--force`, because force is implicit.
- `--artifacts`, because artifact selection only applies to analyze.
- archive-stage failures such as missing required promotion sources or locked storage errors.
### `restore`
Purpose:
@@ -486,6 +518,12 @@ Force-rerun analyze with selected artifacts:
narratio analyze --session-id 2026-04-04 --artifacts player_handout
```
Force-rerun archive publishing:
```bash
narratio publish --session-id 2026-04-04
```
Preview restore actions without writes:
```bash
@@ -528,7 +566,7 @@ narratio status --manifest <manifest.json>
```
Get manifest path from previous output:
- `run`, `resume`, `run-stage`, and `analyze` print `manifest=<path>` on success.
- `run`, `resume`, `run-stage`, `analyze`, and `publish` print `manifest=<path>` on success.
## `--artifacts` and `--force`

View File

@@ -129,6 +129,7 @@ Configured artifact source reuse:
- accepted on `run`, `resume`, `run-stage analyze`, and `analyze`.
- filters analyze execution only.
- does not imply force on `run`, `resume`, or `run-stage`; `narratio analyze` is force-by-design.
- `publish` does not accept `--artifacts`; it is a force-by-design archive rerun.
Canonical previous-session input behavior:
- canonical sources use `narratio.previous_session.artifact.<artifact_key>`.
@@ -139,6 +140,14 @@ Canonical previous-session input behavior:
## Remote archive layout and publish contract
Preferred manual publish command:
```bash
narratio publish --session-id <id>
```
`publish` is equivalent to `narratio run-stage --force archive`; use `run-stage` when you need the general single-stage command form.
When archive is enabled and run upload is enabled, archive publishes under:
- session prefix: `{root_prefix}/campaigns/{campaign}/sessions/{session_id}/`