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

View File

@@ -139,10 +139,14 @@ handle lifetime and admission behavior.
## Native Evidence And Sensitive Data
The runner supplies one invocation execution group. Actual initial, continuation,
and nested validator executions enroll once; group observations preserve native
identity, terminal coverage, and unknown usage without copied totals or a
durable profile inventory.
Execution carries the caller's context through producers, prepared misses,
coordination, validators, and workers. The runner owns no invocation group or
observer forwarding option. ckprompt owns optional reporting; requested CLI
capture independently attaches a debug group and retains it for finalization.
Other callers may attach their own native observer. See the
[native observation contract][observations] and
[ownership decision](../adr/0025-use-consumer-owned-execution-observation.md);
do not add overlapping totals or a durable profile inventory.
[Native capture](../../internal/framework/pipeline/native_capture.go) composes
observers/preparation callbacks rather than replacing them. Retain prepared
@@ -181,6 +185,7 @@ override propagation, cancellation/admission, reuse, and evidence. They do not
claim production model quality. Wider checks belong in
[Development](../development.md#validation).
[consumer]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.24.0/docs/consumers/pkg-promptkit.md
[formats]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.24.0/docs/formats.md
[prepared]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.24.0/docs/consumers/pkg-promptkit.md#prepare-now-and-execute-the-same-snapshot-later
[consumer]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/consumers/pkg-promptkit.md
[formats]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/formats.md
[prepared]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/consumers/pkg-promptkit.md#prepare-now-and-execute-the-same-snapshot-later
[observations]: https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/consumers/pkg-promptkit.md#observe-an-ordinary-run

View File

@@ -171,8 +171,10 @@ It does not choose a directory, publish a report, or serialize execution ledgers
[State Internals](state.md) owns physical publication and failure retention.
Optional scoped evidence records inputs, candidates, findings, outcomes, and
cache decisions. Native observers enroll actual executions once in one invocation
group, preserving unknown usage and terminal coverage. Capture failures are
cache decisions. Workers and native calls preserve the supplied context, including
consumer-owned observers. The runner allocates no invocation group or accounting
summary; [CLI internals](cli.md#run-orchestration) owns optional debug grouping
and ckprompt reporting integration. Capture failures are
ordinary boundary failures, never semantic feedback or reasons to rerun a model.
Debug layout is private; it is not a recovery source or consumer protocol.

View File

@@ -153,9 +153,15 @@ results, raw response text, and full readable exchanges. Events are written
incrementally. Scope includes operation/step/lane/chunk/validator identity to
avoid concurrent evidence collisions.
One invocation `ExecutionGroup` enrolls actual initial, continuation, and nested
validator executions once. Native identity, terminal coverage, and unknown usage
remain native facts, not a copied profile/attempt accounting model.
When capture is enabled, the CLI attaches its own native execution group to
the inherited invocation context after allocation. Its finish path writes one
snapshot immediately before `Finalize`, after runner work has joined and any
successful domain publication. Snapshot errors remain sticky capture failures.
The runner owns no group or summary write. ckprompt's optional reporting group
is independent; overlapping totals are never added. See
[consumer-owned observation](../adr/0025-use-consumer-owned-execution-observation.md)
and the [native contract](https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/consumers/pkg-promptkit.md#observe-an-ordinary-run).
Native identity, terminal coverage, and unknown usage remain native facts.
Hits can retain prepared evidence without execution or usage. Result-less failures
retain availability/cause evidence; undelivered responses are explicitly unassessed.