Move native request capture into a shared framework package

This commit is contained in:
2026-11-26 01:46:29 +00:00
parent 73023f6397
commit d0cc20c539
12 changed files with 318 additions and 215 deletions

View File

@@ -147,7 +147,7 @@ Other callers may attach their own native observer. See the
[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
[Native capture](../../internal/framework/capture/native.go) composes
observers/preparation callbacks rather than replacing them. Retain prepared
details cheaply during callbacks, then write at normal boundaries. Cache paths
reuse existing details; debug never triggers a second preparation or model call.

View File

@@ -31,7 +31,7 @@ streams or roots. Standard inspection/preflight paths do not become runs.
| Semantic reconciliation | [internal/framework/semanticreconcile](../../internal/framework/semanticreconcile/) | Prepared reconciliation operations, bounded candidate/window inputs, request-local proposal safety, typed fresh application, and evaluation-scoped details. |
| Embedded content | [assets](../../assets/) | Content-only native prompt/profile/schema/message files imported with filesystem contexts; no behavioral registry. |
| Accepted-result cache | [internal/framework/artifactcache](../../internal/framework/artifactcache/) | Raw accepted artifact/plan bytes under native content keys, confined atomic publication, and deployment-owned creation permissions. |
| Capture and file placement | [internal/core/fileio](../../internal/core/fileio/), [internal/core/debugbundle](../../internal/core/debugbundle/), [internal/framework/debug](../../internal/framework/debug/) | Confined writes, run capture allocation/start-time latest link, incremental evidence, one terminalization, and retained causes. |
| Capture and file placement | [internal/core/fileio](../../internal/core/fileio/), [internal/core/debugbundle](../../internal/core/debugbundle/), [internal/framework/debug](../../internal/framework/debug/), [internal/framework/capture](../../internal/framework/capture/) | Confined writes, run capture allocation/start-time latest link, native request evidence, one terminalization, and retained causes. |
| Source auxiliaries | [internal/framework/chunkmap](../../internal/framework/chunkmap/), [internal/framework/evidencecontext](../../internal/framework/evidencecontext/) | Materialized chunk-map and selected citation/source-unit artifacts with intrinsic contracts. |
| Production extensions | [internal/modules/generic](../../internal/modules/generic/), [internal/modules/seriatim](../../internal/modules/seriatim/), [internal/modules/dnd](../../internal/modules/dnd/) | Domain-neutral operations, Seriatim input, D&D typed artifact families/validators/codecs/projections, and registrar policy. |

View File

@@ -146,7 +146,7 @@ records source/reference/incoming artifacts, normalization originals/mappings/
proposals, candidates, complete findings/guidance, fallback/deterministic outcomes,
and cache selection/current artifact bytes.
[NativeCapture](../../internal/framework/pipeline/native_capture.go) composes
[NativeCapture](../../internal/framework/capture/native.go) composes
existing observers and preparation callbacks. Preparation callbacks retain
detached details cheaply; ordinary boundaries write prepared contracts, native
results, raw response text, and full readable exchanges. Events are written
@@ -185,7 +185,8 @@ owns handling.
- [Recorder](../../internal/framework/debug/recorder_test.go) and
[allocation](../../internal/core/debugbundle/bundle_test.go) cover incremental
failure retention, concurrent starts, and one terminalization.
- [Native evidence](../../internal/framework/pipeline/native_capture_test.go) and
- [Native capture](../../internal/framework/capture/native_test.go),
[native evidence integration](../../internal/framework/pipeline/native_capture_test.go), and
[configuration capture](../../internal/cli/run_capture_test.go) cover available
content, exact sensitivity, observer composition, and no duplicate preparation.
- [Output writes](../../internal/cli/run_id_test.go) and

View File

@@ -20,8 +20,8 @@ The [Core And Integration API Roadmap](../core-integration-api.md) established
the core/integration boundary. The reassessment below distinguishes its completed
work from the remaining audit remediation.
The **45 original finding entries** reduce to **22 outstanding catalog entries
and twelve resolved entries**. Repeated responsibility findings are
The **45 original finding entries** reduce to **21 outstanding catalog entries
and thirteen resolved entries**. Repeated responsibility findings are
merged. Regression gaps are attached to the defects they protect rather than
counted as additional runtime bugs. In particular, TEST-001, TEST-002, and
TEST-004 each cover several distinct defects; TEST-003's native-fixture oracle
@@ -66,7 +66,7 @@ context; they are not one universal severity scale. No audit establishes a P1
incident or a measured end-to-end production speedup.
CAT-001, CAT-002, CAT-004, CAT-005, CAT-007, CAT-011, CAT-012, CAT-013, CAT-015,
CAT-016, CAT-027, and CAT-034 are resolved;
CAT-016, CAT-027, CAT-032, and CAT-034 are resolved;
the other entries remain outstanding. The original reports and their baseline
observations are historical.
"Refactoring" denotes a maintenance opportunity, not a confirmed runtime
@@ -601,10 +601,13 @@ Existing focused tests suffice; declaration-only deletion needs no new test.
**Subsequent decision:** [Discussion Item 9](discussion.md#9-cleanup-scope-and-optional-improvements)
selects package extraction as required ownership remediation, independent of
performance benefit. Implementation remains pending.
performance benefit.
**Assessment:** Low-priority package-cohesion opportunity, not an import violation.
**Status:** Resolved. Native request evidence is owned by framework/capture;
pipeline retains operation scoping and CLI retains physical capture lifecycle.
**Source:** [BND-004](11-boundaries.md#bnd-004--native-capture-and-pipeline-scoping-share-one-implementation-home).
Request-level native evidence lifecycle is reusable by producers and validators,

View File

@@ -366,6 +366,14 @@ run affected pipeline tests under `-race` once.
## Stage 11 — Extract Native Capture Ownership
**Completed.** Request hooks, snapshot ownership, events, results, and retained
capture errors moved to framework/capture; pipeline retains operation scoping and
the validator uses the shared owner. Direct capture tests cover hook composition,
snapshot ownership, and write errors; pipeline integration retains cache,
provider/cancellation, continuation, and evidence tests. The specified normal
and race suites pass, as do focused CLI capture tests. No representation change
or follow-up remains for this ownership move.
**Coverage:** CAT-032. **Prerequisites:** Stage 10.
Move request-level code/tests from pipeline/native_capture.go into framework/capture.