Give each CLI run its own invocation lifecycle

This commit is contained in:
2026-11-26 02:19:32 +00:00
parent b85467cc3c
commit add2811a64
6 changed files with 218 additions and 149 deletions

View File

@@ -90,7 +90,9 @@ Framework/model code transports it rather than deriving another session.
## Run Orchestration
[pipeline_run.go](../../internal/cli/pipeline_run.go) performs the ordered handoff:
The native command declaration in [pipeline_run.go](../../internal/cli/pipeline_run.go)
creates a private owner for each invocation. That owner performs the ordered
handoff and keeps capture and publication state local to that run:
1. Load/validate the selected application result and derive runtime configuration.
2. Generate a safe run identity and allocate requested capture. If enabled,

View File

@@ -106,7 +106,7 @@ writes files with confined atomic helpers. This is per-file publication, not
an all-files transaction. A later write can leave a partial new directory;
existing siblings are preserved. No rollback deletes available artifacts.
After complete publication, the run handler finalizes requested capture before
After complete publication, the private invocation owner finalizes requested capture before
[reportRunResult](../../internal/cli/run_result.go) submits the small native
completion value. The report is not automatically persisted or required to decode
domain files. No index, manifest, receipt, or process-diagnostic sidecar is emitted.

View File

@@ -488,6 +488,11 @@ remain independently verifiable; avoid a generic string-named stage dispatcher.
### CAT-023 — CLI Declaration And Invocation Lifecycle Are Entangled
**Status:** Resolved. The native declaration creates a per-invocation owner for
execution, capture finalization, publication state, and reporting. Regressions
cover combined causes and published versus unpublished locations; existing CLI
and integration checks and affected CLI race checks pass.
**Assessment:** Local maintainability opportunity; original medium.
**Source:** [CPLX-006](03-complexity.md#cplx-006--the-run-command-owns-declaration-and-the-whole-invocation-lifecycle).

View File

@@ -591,6 +591,12 @@ full tests/vet/build at this milestone. Update pipeline/state internals.
## Stage 20 — Give CLI Invocation A Private Lifecycle Owner
**Completed.** The native declaration creates a private invocation owner for
configuration, execution, publication, capture finalization, and reporting;
mutable lifecycle state is no longer captured by the declaration. Regressions
cover combined causes and publication locations. CLI and integration suites and
affected CLI race tests pass; existing delivery and allocation coverage remains.
**Coverage:** CAT-023. **Prerequisites:** Stages 13, 17–19.
Reduce pipelineRunCommand in internal/cli/pipeline_run.go to native declaration