Document consumer-owned execution observation and its architecture decision

This commit is contained in:
2026-11-23 02:48:37 +00:00
parent 00fc11360e
commit 9825ee75fd
8 changed files with 110 additions and 20 deletions

View File

@@ -92,17 +92,19 @@ Framework/model code transports it rather than deriving another session.
[pipeline_run.go](../../internal/cli/pipeline_run.go) performs the ordered handoff:
1. Load/validate the selected application result and derive runtime configuration.
2. Generate a safe run identity and allocate requested capture.
2. Generate a safe run identity and allocate requested capture. If enabled,
attach its local native execution group to the inherited invocation context.
3. Capture selected configuration, compose registries, expand reference actions,
and resolve the effective pipeline.
4. Obtain the shared engine when needed and perform offline preflight.
5. Materialize references, construct prepared typed modules, read input bytes,
and resolve the effective session.
6. Construct the accepted-result cache and optional recorder collaborator,
create one native execution group, and invoke the runner with independent
worker and execution selections.
and invoke the runner with the context and independent worker/execution
selections. Disabled capture adds no debug group.
7. Report process diagnostics, publish returned logical files only after runner
success, finalize requested capture, then submit the native completion report.
success, write the debug group's snapshot immediately before capture
finalization, then submit the native completion report.
Modules receive the shared engine, operation data, and explicit collaborators,
not physical roots or CommandKit reporters. Detailed worker, assessment,
@@ -110,6 +112,8 @@ eligibility, and cache algorithms belong in [Pipeline Internals](pipeline.md);
physical publication/capture collaborators belong in [Run State Internals](state.md).
Requested capture allocates before engine/preflight and finalizes once.
The runner has joined its work before returning; it owns neither this group nor
the summary write. Snapshot write errors use the recorder's sticky error handling.
Primary operation causes and additional capture failures remain available.
Later report delivery failure does not rerun model work, remove valid artifacts,
or terminalize capture again.
@@ -121,6 +125,12 @@ value with a native text template. Native serializers render that same value.
Domain files, not a persisted report or ledger, are the deliverables.
Fallback qualification is independent of optional diagnostic visibility.
The installed ckprompt feature owns optional invocation usage presentation.
The handler preserves its contextual observer, including when debug attaches
an independent group; it does not add overlapping totals or supply a final usage
callback. See [native usage reporting][usage] and
[consumer-owned observation](../adr/0025-use-consumer-owned-execution-observation.md).
Warnings/advisories keep their domain classification and use the reporter's
diagnostic channel. Outcome helpers retain native configuration/preflight causes
and distinguish identifiable invalid input from operational/mixed failures.
@@ -154,4 +164,5 @@ behavior. There is no universal Notarius envelope or parallel serializer.
Use focused CLI tests and pair with configuration/preflight tests when those
boundaries change. [Development](../development.md#validation) owns wider checks.
[native-cli]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.7.0/docs/cli.md
[native-cli]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md
[usage]: https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#promptkit-usage-reporting