diff --git a/docs/roadmap/implementation.md b/docs/roadmap/implementation.md deleted file mode 100644 index 825ba416..00000000 --- a/docs/roadmap/implementation.md +++ /dev/null @@ -1,536 +0,0 @@ -# Native Kit Observability Implementation Plan - -## Objective And Working Rules - -Implement the selected end state in [upgrade-kit.md](upgrade-kit.md). That -roadmap owns scope and policy choices; this document owns execution order. -The inspected baseline is `1483e8e`: configuration version 6, PromptKit v0.24.0, -CommandKit v0.7.0, ckconfig v0.10.0, ckprompt v0.11.0, and ConfigKit v1.4.0. - -All eight stages are complete. Their markers record the implementation and -verification; Stage 8 records the final assembled checks. - -Each numbered stage is one bounded Luna implementation prompt. Execute them in -order as one end-to-end sprint. Intermediate stages may leave compile errors or -temporarily outdated documentation; do not add compatibility fields, temporary -adapters, or duplicated accounting merely to make an intermediate checkpoint -green. Resolve the affected callers in the assigned subsequent stage. The final -tree must compile, pass the checks below, and match the complete target. - -Start with [development guidance](../development.md) and read applicable -[agent](../policy/agents.md), [architecture](../policy/architecture.md), -[testing](../policy/testing.md), [documentation](../policy/documentation.md), and -[OSS](../policy/oss.md) policies. The approved roadmap authorizes replacing the -exact-one-group clause through the narrow ADR process in Stage 6. Preserve -accepted ADR bodies while that documentation work is pending. - -Implementation decisions already settled: - -- Use the exact released dependency set in Stage 1. The feature roadmap records - its source commits. Do not expand the sprint to a later release without review. -- ckprompt owns ordinary invocation reporting. Debug and other callers attach - native contextual observers only when they need evidence. The runner owns - neither a group nor invocation accounting. -- Remove `RunInput.Executions` and `ExecutionOptions.Observer`; retain native - per-request capture observers, `OnPrepared`, and operation evidence. Independent - native groups are fine; no shared-group registry or application totals service. -- Keep application configuration version, model/profile choices, prompt content, - artifact schemas/paths, cache identity/eligibility, assessment, producer budgets, - worker/admission policy, and completion-report fields unchanged. -- Missing accounting details are not new warnings or errors. No automatic - `zero_cost`, provider inference, pricing estimates, credential probes, or - billing guarantees. Library-owned behavior is documented by upstream links. - -Use real kits, temporary files, fake native clients, and local HTTP servers for -tests. Reuse meaningful existing coverage; each acceptance item is not a demand -for a separate test or a copy of upstream's parser/provider test matrix. - -## Stage 1 — Upgrade The Published Dependency Set - -**Status:** Complete. Selected the four reviewed releases together, retaining -ConfigKit v1.4.0 and Go 1.27.0. Tidy changes only the selected kit checksums; -there are no replacements or application compatibility changes. Published tags -resolve to the reviewed source commits. Updated the four attribution entries -after comparing unchanged COPYRIGHT/LICENSE contents. The existing nonempty -ckprompt declarations install `--show-tokens` without local plumbing or collision. -Focused CLI/config/preflight tests, native run help and bare config-explain help, -module selection, and `git diff --check` pass. Context ownership and new accounting -coverage remain in the following stages. - -**Goal:** Adopt the coordinated releases through the existing composition root. - -**Inspect/change:** `go.mod`, `go.sum`, `internal/cli/application.go`, and the -four changed kit entries in `docs/oss/attribution.md`. Inspect the release notes -linked in the feature roadmap and the selected modules' actual manifests/notices. - -1. With `GOWORK=off`, select PromptKit v0.25.0, CommandKit v0.8.0, ckconfig - v0.11.0, and ckprompt v0.12.0 together; retain ConfigKit v1.4.0 and Go 1.27.0. - Run ordinary module tidy and review its resulting changes. No local replaces - or upstream compatibility patch is needed. -2. Retain the nonempty `ckprompt.Declarations` installation in `NewApplication`. - Its update installs native `--show-tokens`; add no local flag, result wrapper, - final usage callback, or manual counting. Fix a real installation collision if - discovered, without changing native spelling or normal input semantics. -3. Review expanded public structs/decoders if compilation identifies an issue. - Native result/event serialization should naturally retain reasoning/cost; - do not introduce a parallel Notarius accounting DTO. -4. Update changed attribution versions and commit-specific source/COPYRIGHT/ - LICENSE links using the feature roadmap's distinct commits for root and - integration modules. Compare notice/license contents; retain unchanged local - license texts and ConfigKit/policy entries. Upstream maintainer tools alone - do not become Notarius runtime dependencies or attribution entries. - -**Acceptance:** The selected graph contains all five target versions. Native -reporting installs through the existing command assembly. No model, prompt, -schema, configuration-version, or budget change accompanies the upgrade. - -**Checks:** - -```sh -GOWORK=off go get go.maximumdirect.net/promptkit@v0.25.0 go.maximumdirect.net/commandkit@v0.8.0 go.maximumdirect.net/ckconfig@v0.11.0 go.maximumdirect.net/ckprompt@v0.12.0 -GOWORK=off go mod tidy -GOWORK=off go list -m go.maximumdirect.net/configkit go.maximumdirect.net/promptkit go.maximumdirect.net/commandkit go.maximumdirect.net/ckconfig go.maximumdirect.net/ckprompt -GOWORK=off go test ./internal/cli ./internal/core/config ./internal/preflight -``` - -## Stage 2 — Move Debug Accounting To Its CLI Consumer - -**Status:** Complete. Removed the runner group input, allocation, enrollment, -and implicit summary write. Requested CLI capture decorates the inherited -execution context with its own native group after allocation and writes one -snapshot immediately before finalization. The recorder's sticky errors preserve -operation causes and published artifacts. Direct runner reuse coverage now owns -its context/group and confirms no implicit summary file. Focused pipeline -capture, CLI recovery/run/debug tests pass, including summary-write failure after -publication and combined provider/capture/diagnostic failures; whitespace passes. -General option forwarding remains until the next stage. - -**Goal:** Remove runner-owned groups and give requested debug capture ownership -of its native summary, without changing operation evidence. - -**Inspect/change:** `internal/cli/pipeline_run.go`, `run_capture.go` if useful, -`internal/framework/pipeline/runner.go`, `operation_capture_test.go`, and CLI -capture/recovery/completion tests. Inspect `internal/framework/debug/recorder.go` -before changing error/finalization flow; reuse its existing sticky write errors. - -1. Remove `RunInput.Executions`, the runner's unconditional group allocation, - enrollment into execution options, and deferred group snapshot write. - Remove now-unused imports. Do not move that allocation into another generic - framework constructor. -2. In the run handler, retain a local context derived from `invocation.Context`. - After requested capture has been allocated successfully, create a native - `ExecutionGroup` only if `capture.Enabled()`, and decorate this context using - `promptkit.WithExecutionObserver`. Pass the decorated context through the - remaining engine/preflight/run work. Without capture, keep the original - invocation context, including any ckprompt or external caller observer. -3. Keep the debug group local to this consumer. Write its native snapshot once - in the existing `finish` path immediately before `capture.Finalize`, after - started pipeline work has been joined. Use the existing private - `executions.json` filename to avoid needless fixture churn, not as a new - public contract. Early failures with no allocated group need no snapshot. -4. Let the recorder retain snapshot write failures and finalize with the primary - operation cause. Preserve nonzero failure, available locations, and any - already published artifacts. Do not retry models, turn capture failure into - permissive fallback, finalize twice, or move publication into a CommandKit - invocation feature. Snapshot placement is private; it need not remain inside - the runner or precede publication. -5. Migrate direct runner test/caller group inputs to caller-owned decorated - contexts and `group.Snapshot()`. A framework test may explicitly write its own - summary if it actually needs that file; the runner must not do it implicitly. - Keep operation input/result/exchange/cache evidence tests otherwise intact. - -**Acceptance:** A runner with no interested caller allocates no accounting -group. Captured CLI runs retain actual native execution summaries on success -and returned failure, and cache-only runs retain no historical execution. -Debug summary writes participate in existing capture failure handling. - -**Checks:** Run focused pipeline operation-capture tests and CLI recovery, -preflight-capture, completion, and capture-failure tests. General observer -forwarding still exists from the baseline until Stage 3; do not add a temporary -replacement for the removed group input. - -## Stage 3 — Remove General Observer Forwarding - -**Status:** Complete. Removed the general execution-option observer and all -producer/coordination/validator forwarding, including the accounting-only -request-builder Boolean. Native contexts now carry caller observers; direct -request observers, preparation hooks, and operation capture remain intact. -Migrated callers/tests and checked remaining observer names semantically. -Raw start/terminal counts and independent run IDs cover initial/correction/nested -execution without relying on group de-duplication; synchronized concurrent -coverage, event-free cache preparation/hits, frozen prepared misses, cancellation, -and undelivered-response checks pass. Pipeline, concrete combat-validator, CLI, -focused prepared-cache tests, full pipeline race tests, and whitespace pass. - -**Goal:** Make native context propagation the only invocation-accounting path. - -**Inspect/change:** `internal/framework/contracts/producer.go`, -`internal/framework/pipeline/producer.go`, -`internal/modules/dnd/validate/scenedescriptions/combat_semantics/validator.go`, -and affected tests. Current migration sites include `producer_test.go`, -`producer_cache_test.go`, `native_capture_test.go`, -`typed_registry_request_test.go`, and `internal/cli/pipeline_run_test.go`. -Search the entire current tree for remaining field uses rather than assuming -this list is exhaustive. - -1. Delete `ExecutionOptions.Observer` and its obsolete comment. Keep execution - target overrides, transient retries, `OnPrepared`, and `Capture` unchanged. -2. Remove enrollment from initial `producerRequest`, `CoordinateRequest`, and - the scene semantic validator. Remove the `initial` Boolean argument from - `producerRequest` if, as in the baseline, accounting was its only purpose; - update its initial/correction callers and comments. -3. Keep direct `RunRequest.Observer` callbacks belonging to a request or - `CaptureNativeRequest`. Preserve capture's observer/`OnPrepared` composition, - synchronization, error checks, and native result/exchange recording. Do not - blindly delete all uses of the word `Observer`. -4. Migrate test observers to `WithExecutionObserver` on the actual execution - context. Update typed-option tests to check the remaining request overrides - and preparation callback; contextual observation is not another option field. -5. Reuse/extend existing producer/native-capture tests to prove one contextual - observer sees initial execution, semantic correction, and nested validator - executions exactly once, with independent run IDs and terminal coverage. - Retain the concurrent-operation test with synchronized observer state. - Keep cancellation and undelivered-response behavior covered. -6. Update the frozen-prepared-handle/cache tests to exercise contextual - observation on a prepared miss and no events on a hit. Where an application - boundary actually separates preparation/execution, assert that execution's - context owns observation. Do not introduce new split-preparation machinery - solely to retest PromptKit's own prepared-context contract. - -**Acceptance:** Neither removed field nor a forwarding alias remains. Context -reaches `Run`, `RunPrepared`, coordination, and LLM validation. Request capture -continues to work independently; native group de-duplication is not concealing -duplicate registration of the same observer. - -**Checks:** - -```sh -GOWORK=off go test ./internal/framework/pipeline ./internal/modules/dnd/validate/scenedescriptions/combat_semantics ./internal/cli -GOWORK=off go test -race ./internal/framework/pipeline -``` - -Inspect remaining `Observer`/`Executions` occurrences semantically: native -request observers and unrelated names remain legitimate. - -## Stage 4 — Verify Native Reporting Through Assembled Pipeline Runs - -**Status:** Complete. Extended the existing recovery fixture with optional flags -and explicit native usage/cost. Its concurrent corrected/nested-validator run, -returned failure, selective recovery, and full hit compare actual calls with -debug facts and selected diagnostic values, without copied production totals. -Completion formats, alias routing, quiet, cancellation, bare config-explain help, -and diagnostic-only delivery failure retain their contracts. Installed real -ckprompt declarations in the reduced run fixture after the new tests exposed -its missing feature. Upstream omission/explicit-false handling remains native. -The focused checks, full CLI suite, touched concurrent/failure race checks, and -whitespace pass. All providers in these checks are fakes. - -**Goal:** Prove the application uses native invocation reporting without lost or -duplicated accounting, including failure and accepted-result reuse. - -**Inspect/change:** CLI tests, primarily `recovery_contract_test.go`, -`run_result_command_test.go`, `pipeline_run_test.go`, and `application_test.go`. -Use a focused `usage_reporting_test.go` only if it keeps the tests clearer. -Reuse `newRecoveryFixture`, `recoveryClient`, and `runFixture` rather than -building a second miniature application/framework. - -1. Allow the recovery fixture to accept additional CLI flags if needed, keeping - its existing default behavior. Use an invocation with `--show-tokens`, JSON - main output, requested capture, a corrected scene, and nested combat - assessment. Use more than one worker in this representative observation - case if needed to exercise concurrent context propagation; synchronize fake - counters and do not assert completion order. -2. Give the native fake explicit token presence and known test-controlled - usage/cost where numerical assertions are needed. Compare expected native - execution totals with actual fixture calls/debug group facts, not with a - new production accumulator. This fixture has no structural repair unless - explicitly arranged, so a semantic correction is a separate execution, not - a repair count. -3. Assert stdout still decodes as the ordinary completion report and artifacts - remain correct. Requested usage appears only on diagnostics. Assert only - selected numeric/semantic fragments of native text; do not snapshot its - entire wording or clone its renderer into a test helper. -4. Reuse the accepted-result recovery/full-hit path with `--show-tokens`: - accepted predecessors are reused, a full hit makes no new provider calls, - and the new invocation reports no historical executions/tokens/cost. -5. Exercise the same installed feature with a returned producer failure, and - reuse a controlled cancellation boundary where necessary to show observed - work survives. Preserve the original operation cause, no false success - report, and ordinary artifact/capture behavior. A final summary is not - permission to catch a panic or manufacture terminal facts. -6. Extend existing help/report-delivery tests with representative usage-enabled - cases: a run alias, quiet suppression, bare `config explain` help without - loading, and diagnostic-write failure with retained publication/native - delivery evidence. Omission/explicit false and repeated flags inherit native - semantics; inspect existing/upstream coverage rather than adding a Cartesian - parser matrix. Native reporting failure must not rerun pipeline work. - -**Acceptance:** Native reporting observes real application work and leaves -stdout/domain deliverables unchanged. Requested debug and CLI reporting can -coexist without adding their overlapping totals. Real failures remain visible; -missing measurement is not promoted to a warning. - -**Checks:** Run the touched CLI tests and `GOWORK=off go test ./internal/cli`. -Use focused `-race` runs for the new concurrent fixture. No production API calls. - -## Stage 5 — Verify Provider Accounting And Native Smoke Exposure - -**Status:** Complete. A real native HTTP client and one local server fixture -cover explicit OpenRouter selection on an arbitrary backend ID, reasoning/cache -details, positive and reported-zero cost, unchanged domain/completion output, -and native result/debug/diagnostic propagation. Installed smoke commands retain -reasoning and nullable ratio values in JSON, native default text, and separate -ordinary accounting; help does not load configuration. Recorded the published -smoke API's target-only prompt selection rather than inventing input flags. -Unknown-cost capture coverage and complete-example inherited-provider inspection -pass. Focused CLI/pipeline checks and whitespace pass; fixtures use no real -credentials and all HTTP calls stay local. Example configurations are unchanged. - -**Goal:** Cover the new provider/accounting boundary once through the real HTTP -client and installed native commands. - -**Inspect/change:** CLI integration tests near `production_contract_test.go` or -`native_process_test.go`; a focused new provider-accounting test file is fine. -Inspect PromptKit v0.25.0's response contract and ckprompt v0.12.0's smoke report -contract linked from the feature roadmap. - -1. Use one `httptest.Server` fixture with the production application loader and - no injected `LLMClient`. Declare a test backend with `provider: openrouter`, - an arbitrary non-OpenRouter ID, the local endpoint, and a fake model/profile - that needs no real credentials. This proves convention selection comes from - configuration rather than hostname or ID. -2. Return valid minimal spell output and a valid OpenRouter envelope with - prompt/completion/total tokens, cached tokens, nested cache-write and reasoning - tokens, and a small test-controlled `usage.cost`. Verify those values reach - native debug evidence and the requested diagnostic report. Reasoning/cache - details must not inflate totals. Select simple values that avoid brittle - floating-point or exact text-format expectations. -3. Retain unavailable-versus-known-zero coverage from the fake/native evidence - tests. Add a missing-optional-details case to this same fixture only if that - application boundary remains unprotected. Do not retest every malformed - provider field, add custom response parsing, or add a second vLLM decoder - suite; upstream owns those contracts. -4. Through the installed ckprompt suite, use the same local fixture for explicit - `promptkit test text_inference` with a concrete prompt and profile. The selected - native smoke API uses the prompt only for target selection; it does not execute - its body or accept prompt inputs. Request structured JSON (and YAML only if - an existing test covers it) and check reasoning and nullable cache-hit-ratio propagation. - Smoke usage is in its own report, not an added smoke cost field or duplicate - ordinary accounting. Check default smoke output/help against native behavior - without a full-format golden file. -5. Inspect the complete example's `limited-openrouter` through the real loader: - it inherits the bundled `provider: openrouter`. Keep both example source - configurations unchanged unless a real incompatibility is found. Leave - `zero_cost` unset; do not add implicit local-backend or authentication policy. - -**Acceptance:** Native provider selection, expanded accounting evidence, and -the existing smoke interface are usable through Notarius. No application-side -provider adapter, default cost, unsolicited probe, or additional reporting -schema is introduced. - -**Checks:** Run the focused CLI provider/smoke tests offline and review fixture -URLs/credentials to confirm all calls stay local. - -## Stage 6 — Align Architecture, The ADR, And Internal Ownership Docs - -**Status:** Complete. Added ADR-0025 for consumer-owned contextual observation -and narrowly updated ADR-0024's status; its accepted body is unchanged. Replaced -the architecture group-count clause and aligned CLI/LLM/pipeline/state ownership -with conditional CLI capture, inherited context, native optional reporting, and -publication-aware finalization. Native mechanics link to selected upstream -contracts. Policy provenance and its current implementation-date metadata are -retained. All 178 local links in the seven affected documents resolve; selected -upstream anchors, stale ownership searches, ADR status-only diff, and whitespace -pass. Reused passing runtime checks for unchanged code. - -**Goal:** Record the implemented ownership change without rewriting accepted -history or preserving a redundant exact-one-group requirement. - -**Inspect/change:** `docs/policy/architecture.md`, ADR-0024, a new successor ADR, -and the affected passages in `docs/internal/{cli,llm,pipeline,state}.md`. - -1. Add `docs/adr/0025-use-consumer-owned-execution-observation.md` if 0025 is - still available; otherwise use the next sequential number and update links. - Use the repository's concise Nygard sections and the actual implementation - date. The approved decision is consumer-owned native contextual observation, - with independent native groups when separate consumers need them. -2. Supersede only ADR-0024's requirement for one native invocation group. Preserve - native identity/coverage/unknown-state accounting, no fabricated historical - executions, and all other artifact/report/capture/failure decisions. Explain - briefly why shared-group discovery and application accounting services are - unnecessary; do not establish a new rule for an exact number of consumers. -3. Change ADR-0024's status to accepted with that narrowly identified partial - supersession and a link to the successor. Leave its accepted body unchanged. -4. Replace architecture's exact-one-group sentence with the implemented consumer - ownership/context boundary and link the successor decision. Preserve native - fact handling and event-free cache hits. Update its local `Last Updated` date, - retaining its upstream source/version because this is a local adaptation, - not another upstream policy adoption. -5. Update the concrete ownership passages: the CLI owns optional debug grouping - and summary capture, ckprompt owns optional presentation, and the runner - simply propagates context. Keep operation-specific `NativeCapture` evidence, - secret handling, cancellation/draining, and publication/finalization ownership - accurate. Replace affected library-mechanics explanations with upstream links - rather than expanding them. - -**Acceptance:** Current policy, decision status, and internals describe the -implemented consumer boundary consistently. No unrelated ADR decision or -application invariant changes. ADR-0024's body is unchanged from the baseline. - -**Checks:** Review the ADR body diff explicitly; verify local links/anchors and -search current ownership docs for stale runner-owned/exact-one-group claims. -Historical accepted text remains historical and need not be erased. - -## Stage 7 — Refresh Operator Links And Adoption Documentation - -**Status:** Complete. Updated affected selected-release and independent -integration links, replaced the old group claim, linked upstream usage/provider/ -inspection/smoke contracts, and added one usage-enabled Notarius invocation. -Consumer guidance retains stdout/artifact ownership without a durable usage API; -smoke callers are directed to explicit structured formats. Repaired the adjacent -configuration-internals handoff pin. Unchanged ConfigKit v1.4.0 guidance, migration -guidance without a stale smoke-default claim, examples, license texts, and policy -attribution were reviewed and retained. All 189 local links in ten affected/reviewed -documents and 70 selected upstream destinations/anchors resolve. Declared versions -and five notice hashes match; native help, both offline example preflights with -usage enabled, inherited provider inspection, a temporary build, and whitespace -pass. No inference or new documentation gate was introduced. - -**Goal:** Make the adopted capabilities discoverable without maintaining copies -of upstream feature documentation. - -**Inspect/change:** Affected passages in `docs/cli.md`, `docs/config.md`, -`docs/operations.md`, the three `docs/integrations/pkg-*.md` kit documents, -and `docs/consumers/{subprocess,dnd-pipeline}.md`. Check -`docs/consumers/native-migration.md` for an affected default-smoke-output claim. -Review maintained examples; no new example collection is required. - -1. Update changed dependency versions and upstream links to the selected releases - or their exact commits. The independently tagged ckconfig/ckprompt sources - are not the CommandKit core tag. Keep unchanged ConfigKit v1.4.0 references. -2. State which native interfaces Notarius imports; link directly to canonical - upstream usage reporting, provider configuration, inspection, and smoke - contracts. Remove/replace affected duplicated explanations instead of adding - new flag tables, accounting manuals, provider-field references, or tutorials. -3. Keep local application choices: source/embedded collection assembly, - invocation alias and pipeline inputs, domain publication/completion reports, - requested debug lifecycle, and accepted-result reuse. One short concrete - Notarius invocation can show `--show-tokens`; link upstream for its semantics. - Explain locally that accepted-artifact hits perform no current model work, - rather than copying upstream accounting definitions. -4. Keep subprocess callers focused on successful stdout decoding and artifact - retrieval; link optional diagnostics without inventing a durable usage API. - Where a script/example consumes smoke output, select JSON or YAML explicitly - rather than assuming the old native default. Do not rewrite historical - release notes or conduct a repository-wide documentation overhaul. -5. Recheck Stage 1's attribution against the final selected graph and license - texts. Preserve unrelated policy provenance/attribution and the project's - existing license grant. - -**Acceptance:** Operators can reach applicable upstream documentation from -Notarius, and local docs accurately describe only the relevant application -integration/workflows. Examples remain valid, secret-free, and no stronger -behavioral guarantees have been introduced. - -**Checks:** Review local links/anchors, pinned upstream source paths, affected -commands against built help, and examples against offline preflight. No new -permanent documentation checker or network-dependent test is required. - -## Stage 8 — Verify The End-To-End Sprint - -**Status:** Complete. Reviewed the final tree against all seven feature -verification items and the selected scope, not just its completion markers: - -| Requirement | Current evidence | -| --- | --- | -| Shared composition and examples | Existing native load/configuration/preflight coverage passes; both maintained examples pass direct offline preflight with usage enabled. ConfigKit v1.4.0 and Go 1.27.0 are retained. | -| Actual corrected/concurrent/nested work | [Assembled recovery](../../internal/cli/recovery_contract_test.go) compares actual fake calls with native debug facts and requested usage, including returned failure, selective recovery, and a full hit. No overlapping totals are added. | -| Streams, input modes, and failures | [Completion/delivery coverage](../../internal/cli/run_result_command_test.go) and [built-in help](../../internal/cli/application_test.go) cover unchanged report values, native alias/quiet behavior, cancellation, help-only startup, and diagnostic-write failure with retained publication. Executable checks also cover omission, explicit false, and last repeated selection. | -| Context, prepared reuse, and evidence | [Native capture](../../internal/framework/pipeline/native_capture_test.go), [prepared cache](../../internal/framework/pipeline/producer_cache_test.go), and [runner capture](../../internal/framework/pipeline/operation_capture_test.go) cover raw once-only contextual events, independent IDs, concurrency, preparation/hit silence, frozen misses, unknown evidence, and no implicit runner summary. | -| Real provider boundary | [Local HTTP coverage](../../internal/cli/provider_accounting_test.go) uses the production loader/client with an arbitrary explicit OpenRouter backend, verifying reasoning/cache details, positive and known-zero cost, native result/debug/diagnostic propagation, and unchanged artifacts. Missing cost remains unknown in capture coverage. | -| Native smoke interface | The same HTTP fixture checks explicit JSON, native default text/help, reasoning and nullable cache ratio, no added smoke cost, and no duplicate ordinary accounting. The selected API uses prompts for target selection, not prompt-input execution, as clarified above. Examples retain native provider inheritance and omit zero-cost defaults. | -| Architecture and documentation | [ADR-0025](../adr/0025-use-consumer-owned-execution-observation.md), the status-only ADR-0024 diff, current policy/internals, selected integration links, and operator/consumer guidance agree with implemented ownership. | - -Final `GOWORK=off` checks pass: `go test ./...`, `go vet ./...`, -`go test -race ./internal/framework/pipeline ./internal/cli`, `go mod verify`, -and a fresh build in an explicitly allocated temporary directory. All seven -listed executable commands pass with the OpenRouter credential unset; three -additional offline invocation-selection checks pass with separate valid JSON -stdout and native diagnostics. No model call is required by these commands. - -Removal review finds no removed input/option fields or invocation forwarding. -Only requested CLI capture allocates an application group; explicit request -capture callbacks remain. Worker contexts derive from their parent and all -started work joins before CLI finalization/reporting. Success, returned failure, -cancellation, retained publication, and snapshot-write failures are covered. -Diff review confirms prompts/models, schemas/paths, examples, configuration -version, assessment/budgets, workers/admission, cache policy, completion fields, -license texts, and published release history are unchanged. - -All current local links resolve in the 81-file documentation review; seven -pre-existing historical release links remain historical. The 70 selected upstream -destinations/anchors and five selected dependency notice hashes match local -release sources. ADR-0024's accepted body and unrelated decisions are unchanged. -`git diff --check` passes. No paid inference, billing/model-quality claim, -application accounting model, permanent new gate, release, tag, push, planning -document deletion, or user-data change was needed. - -**Goal:** Confirm the complete target, remove migration leftovers, and report -actual validation results. This stage is verification and targeted correction, -not a second refactoring initiative. - -**Checks:** Perform the following review and validation against the final tree. - -1. Review the final diff against the feature roadmap. Confirm removal of both - old fields and invocation-observer forwarding; no unconditional application - group, observer service, manual totals, or copied report renderer remains. - Native request capture and explicit caller observers remain legitimate. -2. Confirm worker/continuation/validator contexts preserve inherited observers - and work is drained before the CLI's native final report. Review success, - failure, cancellation, partial publication, and debug finalization paths. -3. Run the repository checks below with the actual selected module files, not a - sibling workspace replacement. Reuse successful unchanged checks rather than - re-running the full suite after every prose edit. - - ```sh - GOWORK=off go test ./... - GOWORK=off go vet ./... - GOWORK=off go test -race ./internal/framework/pipeline ./internal/cli - GOWORK=off go mod verify - ``` - -4. Build `./cmd/notarius` to an explicitly chosen temporary directory using - `GOWORK=off go build -o /notarius ./cmd/notarius`. - With that executable, run: - - ```text - notarius version - notarius run --help - notarius pipeline run --help - notarius pipeline validate dnd-session --config examples/dnd-minimal/config.yml --show-tokens --format json - notarius pipeline validate dnd-session --config examples/dnd-complete/config.yml --show-tokens --format json - notarius promptkit show backend limited-openrouter --config examples/dnd-complete/config.yml --format json - notarius config explain --show-tokens - ``` - - Use the built binary's full path in these commands. These are offline checks; - the example profiles need no production credentials for preflight/inspection. - Model-backed behavior is exercised by the local fixtures, not a paid run. - -5. Check whitespace, local documentation links, ADR partial-supersession links, - selected attribution commits, and the absence of unintended prompt/schema/ - model/budget/cache/artifact changes. Report checks run and any genuine limits. - Do not tag, release, push, or delete planning documents as part of this sprint - unless separately requested. - -**Acceptance:** All feature-roadmap requirements are accounted for, the final -tree builds and passes deterministic checks, and documentation matches the -implemented ownership. Ordinary no-flag behavior retains its existing contracts; -native opt-in diagnostics add no application-maintained accounting model. - -## Open Questions - -None. The dependency set, consumer-owned observation, optional debug grouping, -native reporting, documentation ownership, and narrow ADR supersession have -been selected. Snapshot filename/helper layout and test organization are -implementation details, not new product decisions or approval gates. diff --git a/docs/roadmap/upgrade-kit.md b/docs/roadmap/upgrade-kit.md deleted file mode 100644 index eddf2215..00000000 --- a/docs/roadmap/upgrade-kit.md +++ /dev/null @@ -1,418 +0,0 @@ -# Native Kit Observability Upgrade - -## Purpose - -Upgrade Notarius's native kit dependencies together and adopt their new -execution-observation, provider-accounting, and operator-reporting capabilities. -Retain the existing configuration ownership, typed pipeline, accepted-result -cache, domain artifacts, and application assessment boundaries. - -This document defines the selected target and its policy choices. The dependency -upgrade, consumer-owned observation, native reporting integration, and verification -are complete. [The implementation plan](implementation.md) records each completed -stage and its evidence; canonical documentation describes the current workflow. - -## Reviewed Baseline And Published Targets - -The Notarius baseline is commit -`7faa4a05066179eb61ab6f129b6c915343d094e2`. Its [go.mod](../../go.mod) -declares the versions below. Release status was checked against the upstream -repositories' remote tags on 2026-11-23; annotated tags were resolved to source -commits. The source commits, rather than tag-object hashes, are recorded here. - -| Module | Notarius baseline | Selected target | Target source commit | -| --- | --- | --- | --- | -| `go.maximumdirect.net/configkit` | v1.4.0 | Retain v1.4.0 | `4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3` | -| `go.maximumdirect.net/promptkit` | v0.24.0 | v0.25.0 | `207677e9948dc5699073a4d6620d21139033c72d` | -| `go.maximumdirect.net/commandkit` | v0.7.0 | v0.8.0 | `0b53a63648c536afe50c46f948159116f776adae` | -| `go.maximumdirect.net/ckconfig` | v0.10.0 | v0.11.0 | `cd5cf483a46caeff7ca0a91fb4747d57188a3888` | -| `go.maximumdirect.net/ckprompt` | v0.11.0 | v0.12.0 | `2422ccf02d6b55756b07f21e66a581202a09fc3f` | - -ConfigKit has no newer published version at this review: v1.4.0 is already -selected, and upstream main points to that release's source commit. There is -no additional ConfigKit migration to invent. ckprompt v0.12.0 became published -during this review; the complete target set is now available as released Go -modules. Recheck published tags when implementation starts if upstream has -advanced; changes beyond these reviewed versions need their own assessment. - -All five selected modules retain Go 1.27.0 as their consumer minimum. The -published integrations align with this dependency set; no compatibility patch, -local replacement, pseudo-version, or toolchain change is needed for it. - -Primary release evidence: - -- [ConfigKit v1.4.0](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.4.0/docs/releases/v1.4.0.md). -- [PromptKit v0.25.0](https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/releases/v0.25.0.md). -- [CommandKit v0.8.0](https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/releases/v0.8.0.md). -- [ckconfig v0.11.0](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/cd5cf483a46caeff7ca0a91fb4747d57188a3888/integrations/ckconfig/docs/releases/v0.11.0.md). -- [ckprompt v0.12.0](https://forge.maximumdirect.net/base-layer/commandkit/src/commit/2422ccf02d6b55756b07f21e66a581202a09fc3f/integrations/ckprompt/docs/releases/v0.12.0.md). - -## Release Assessment - -### ConfigKit: Already Adopted - -v1.4.0 adds current typed `Result.Value`, frozen `InspectSubtree` views, and -focused comparisons across application root types. Notarius already composes -PromptKit settings into one application-owned load, hands its original result -to `promptkit.NewFromConfig`, and uses ckconfig's whole-application/subtree -adapters. These are the relevant native capabilities; retain this integration. - -The existing distinction between current typed values and frozen inspection -must remain. Do not add a second configuration load, settings serialization -round-trip, or application-owned implementation of native composition or diff. -See [ConfigKit integration](../integrations/pkg-configkit.md) and -[ADR-0020](../adr/0020-delegate-configuration-mechanics-to-configkit.md). - -### PromptKit: Execution Observation And Provider Accounting - -v0.25.0 adds: - -- `WithExecutionObserver(ctx, observer)`, covering calls using that context - across ordinary execution, coordinated corrections, prepared execution, - nested validators, concurrent work, and multiple engines. Prepared handles - select contextual observers when executed, not when prepared. Explicit - request observers still run first and can coexist with contextual observers. -- Native reasoning-token counts, presence-aware observations, and - `ObservedTokenUsage.CacheHitRatio()`. Reasoning is a subset of completion - tokens; cache reads/writes are input details, not additional total tokens. -- Native `RunResult.CostUSD` and observed/group cost, retaining availability, - completeness, and provider/configured-zero/mixed source information. - Cost covers dispatched attempts, including repairs and transient retries; - observed failures can retain cost without a returned result. Existing - `RunResult.Usage` still sums successful generation responses and is not a - substitute for presence-aware execution observations. -- Explicit backend `provider` selection: `openai-compatible`, `openrouter`, - or `vllm`. Names and endpoint hostnames do not select conventions. Missing, - null, or blank selects generic OpenAI-compatible conventions. -- OpenRouter-specific reasoning, cache-write, and optional `usage.cost` - decoding; vLLM-specific reasoning/cache activity decoding; explicit optional - backend `zero_cost` fallback. Provider-reported cost, including zero, takes - precedence over that fallback. -- Provider-default authentication diagnostics and the `vllm_models` adapter. - A supplied authentication object can omit its kind. Clearing the object - restores the provider default; explicit `kind: none` disables that diagnostic. - -OpenRouter cache writes now come from -`usage.prompt_tokens_details.cache_write_tokens`; vLLM uses -`usage.prompt_tokens_details.created_cache_tokens`. Missing or unusable new -details remain unknown without invalidating otherwise usable model content. -vLLM detail availability depends on server token-detail/reasoning configuration. -Generic-provider behavior remains available for other compatible endpoints. - -The native result JSON gains `cost_usd`, and token JSON gains `reasoning_tokens`. -Review strict decoders and unkeyed literals if present. Notarius's debug writer -already serializes native events, results, and group snapshots directly, so it -can retain the expanded evidence without a new application accounting schema. -See the [native observation guide](https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/consumers/pkg-promptkit.md#observe-an-ordinary-run) -and [provider response contract](https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/integrations/openai-compatible-chat.md#response-handling). - -### CommandKit And Integrations: Native Invocation Reporting - -CommandKit v0.8.0 adds captured invocation features with invocation-wide flags, -context decoration, and final diagnostic reports. Features start after input -construction and successful `CheckInput`; reports run after deferred messages -and before terminal failure explanations, including returned failure and -cancellation. Help, version, completion, and input failures skip startup. -`ErrHelpRequested` supports help-only preflight without starting features. - -ckconfig v0.11.0 uses that mechanism for bare `config explain`; its normal help -fallback remains free of configuration loading and usage reporting. - -ckprompt v0.12.0 automatically installs `--show-tokens` through the ordinary -nonempty `Command` or `Declarations` integration. It observes application-owned -commands as well as the PromptKit family, using the invocation context. -The flag defaults to false, accepts explicit false, and uses the last repeated -value. Reporting is text on diagnostics, independent of the primary result -format, and is suppressed by quiet mode. - -The native summary includes prompt executions, nonzero repair details, -reasoning/cache token categories, available cache-hit ratio, and observed cost. -Smoke reports separately gain reasoning and nullable cache-hit ratio. Their -default representation changes to text with YAML evidence and percentage -comments; callers needing structured smoke output should select JSON or YAML. -Smoke usage remains in the smoke report, separate from ordinary execution -observation, without a new smoke cost field. - -## Selected Target State And Work - -### Adopt The Coordinated Published Set - -Update `go.mod` and `go.sum` for the four changed modules together, retaining -ConfigKit v1.4.0. Confirm the selected graph with `GOWORK=off`; local workspace -replacements must not mask a published dependency mismatch. Review tidy's -actual dependency changes rather than importing upstream maintainer tooling -into Notarius. - -Keep configuration version 6, the built-in D&D profile/model, prompt content, -schemas, producer budgets, assessment policy, worker limits, and backend -admission choices unchanged unless a specific compatibility fix requires it. -These releases do not require new domain extraction behavior. - -Preserve application outcomes and useful diagnostic evidence; freely remove or -relocate internal plumbing that upstream capabilities make unnecessary. Existing -group parameters, observer hooks, and snapshot-writing locations are not -compatibility requirements. Keep the public artifact, cache, assessment, and -execution-policy contracts distinct from those implementation choices. - -### Use Native Operator Usage Reporting - -Retain the existing `ckprompt.Declarations` assembly in -[application.go](../../internal/cli/application.go). Let the updated integration -provide `--show-tokens`; do not register a competing flag, wrap `App.Execute`, -copy its template, or add manual token/cost summation to handlers. - -Audit the invocation context path through -[pipeline_run.go](../../internal/cli/pipeline_run.go), runner workers, producers, -native coordination, and LLM validators. Preserve that context and join all -application-owned work before returning so the final summary sees completed -execution. Existing cancellation/draining behavior is the foundation, not a -reason to add another scheduler. - -Keep the small completion report and durable domain outputs unchanged. Usage -is opt-in diagnostic information, not a warning, success qualification, -mandatory sidecar, public debug contract, or promised invoice. Missing token -or cost details are ordinary unknowns, not new warnings or run failures. -Cached accepted artifacts represent no current model execution and must not -replay historical usage or cost; deterministic-only operations likewise create -no synthetic executions. An empty native group can legitimately report zeros. - -### Move Invocation Accounting Out Of Runner Inputs - -The runner currently enrolls its `RunInput.Executions` group by composing its -observer into `input.Execution.Observer` and propagating that observer through -requests. Replace this with native contextual observation owned by the consumer -of the evidence: - -- ckprompt owns ordinary invocation usage reporting through its installed feature. -- Debug capture creates and attaches a native group when it needs a snapshot, - retaining that group for capture at the appropriate application boundary. -- Other callers attach their own observers or groups through - `WithExecutionObserver` and inspect them after their work finishes. -- The runner propagates the supplied context without an accounting-group input - or unconditional allocation of its own group. - -Remove `RunInput.Executions` and general observer forwarding through -`ExecutionOptions.Observer`. Audit remaining callers and migrate them to native -contextual enrollment; internal caller compatibility does not justify retaining -the old path. Remove the old request/coordination/validator enrollment in the same -change so a group is registered once, without relying on terminal de-duplication -to conceal duplicate event delivery. When neither capture nor an explicit caller -needs a group, Notarius creates none of its own. - -A debug group and ckprompt's CLI invocation group may independently observe the -same execution. Never add their overlapping totals. Exactly one group is not an -architectural goal: do not introduce shared-group discovery, an accounting -service, or new upstream integration machinery merely to avoid this small -duplication. - -Verify both `Run` and `RunPrepared` use the decorated execution context, as do -corrections and nested validators. Preparation/cache hits must remain event-free. - -### Retain Operation Evidence And Application Lifecycle Ownership - -Invocation accounting and operation evidence serve different purposes. -`NativeCapture` still associates prepared messages, raw responses, exchanges, -cache-hit evidence, and domain scope with individual operations. Preserve that -useful evidence and native request-specific callbacks, including `OnPrepared` -and direct request observers where needed. Contextual accounting does not require -turning per-operation writers into one centralized event router that reconstructs -lane/chunk/validator ownership. - -Keep callback composition, synchronization, native run identity, and capture-error -handling where their consumers still need them. Remove forwarding that only -served invocation accounting; do not remove capture hooks simply because they -also use native observer APIs. - -Notarius continues to own debug allocation and finalization, domain assessment, -and publication-aware failure handling. CommandKit's final diagnostic reports -do not replace these application boundaries. Preserve requested capture failures, -available artifacts and locations, and completion-report ordering without moving -domain lifecycle work into a generic invocation feature solely because one exists. - -### Adopt Explicit Provider Conventions Without Adding Defaults - -The bundled OpenRouter backend now declares `provider: openrouter` upstream. -Notarius already loads that underlay, and the complete example's -`limited-openrouter` inherits it. Retain that inheritance; an extra local copy -of the upstream backend is unnecessary. - -Link operators to PromptKit's canonical backend documentation for independently -declared or replaced backends, including OpenRouter and vLLM provider selection. -Brief Notarius-specific orientation or examples may explain an integration choice; -link upstream for field semantics rather than maintaining a parallel reference. -An endpoint override of an inherited backend retains its provider selection, -so switching from an OpenRouter parent to a local vLLM endpoint also needs a -deliberate provider override. Do not infer conventions from an ID, hostname, -model name, or the fact that an endpoint is locally hosted. - -Keep `zero_cost` omitted by default; link upstream for its meaning and use. -Do not assume that local inference is free or introduce token-rate tables, -estimated charges, billing guarantees, application-side provider parsing, or -extra public accounting types. - -Expose new inspection and authentication behavior through the installed native -suite. Probes remain explicit operator actions; an accessible vLLM `/models` -response establishes neither authentication enforcement nor permission to run -inference. No new startup probe, credential requirement, or provider restriction -is part of this upgrade. - -### Maintain Canonical Documentation And Notices - -Notarius documentation should state which native libraries and integrations it -imports and link to their canonical upstream documentation. Upstream owns the -explanation of its features, APIs, configuration fields, defaults, flags, -reporting, and authentication semantics. Do not reproduce those references or -write parallel library tutorials in Notarius. Brief orientation and concrete -Notarius workflows are appropriate, with links to the selected upstream contracts -for details. For example, explaining that an accepted-artifact cache hit makes -no model call and adds no current token usage connects application behavior to -native reporting; that explanation belongs locally. The release assessment above -supplies upgrade-review context, not material to copy wholesale into product docs. - -Local documentation retains Notarius-specific integration choices, application -behavior, and workflows. Update only the affected content when changes land: - -- [CLI reference](../cli.md): identify the imported CommandKit/ckconfig/ckprompt - interfaces and link to the selected upstream CLI reference, including native - [usage reporting](https://forge.maximumdirect.net/base-layer/commandkit/src/tag/v0.8.0/docs/cli.md#promptkit-usage-reporting). - Keep application-owned commands, aliases, inputs, and completion reports local; - brief usage examples may orient callers without duplicating a usage-flag or - smoke-report reference. -- [Configuration](../config.md): retain Notarius's source assembly and embedded - collection choices; link to PromptKit's - [backend definitions](https://forge.maximumdirect.net/base-layer/promptkit/src/tag/v0.25.0/docs/formats.md#backend-definitions) - for provider, zero-cost, and authentication semantics. Explain Notarius-specific - source/inheritance choices locally where useful. -- [Operations](../operations.md): retain application-owned accepted-result reuse - and debug handling, including how application cache reuse affects current - execution. Link upstream for token/cache/cost interpretation without adding - a reporting contract or duplicating accounting documentation. -- [LLM internals](../internal/llm.md), [pipeline internals](../internal/pipeline.md), - and [CLI internals](../internal/cli.md): update Notarius's contextual enrollment - and integration wiring where implementation changes; link upstream for API - contracts rather than reproducing library behavior. -- [Kit integration documents](../integrations/pkg-commandkit.md): keep concise - adoption/boundary notes and update affected versions and canonical upstream - links, including the separate PromptKit/ConfigKit integration documents where - relevant. Replace affected duplicated library explanations with links. -- [Subprocess](../consumers/subprocess.md) and [D&D consumer](../consumers/dnd-pipeline.md) - guidance: briefly link opt-in diagnostics while retaining primary stdout - parsing and domain artifact retrieval as the consumer contract. -- [Maintained examples](../../examples/): retain native inherited OpenRouter - configuration and valid complete/minimal pipelines; only change declarations - if review finds they actually need migration. -- [Attribution](../oss/attribution.md): update changed modules' versions and - source/notice links to their distinct release commits. Selected COPYRIGHT - and LICENSE texts were compared with the current releases and are unchanged; - recheck the final selected graph and preserve existing license texts. Retain - the unchanged ConfigKit entry. Maintainer-only tools are not new runtime - attribution entries merely because an upstream `go.mod` lists them. - -Update [architecture policy](../policy/architecture.md#state-output-and-safety) -to describe consumer-owned contextual observation rather than requiring one -native execution group. Each interested consumer may attach its own native -observer or group; the runner propagates context without owning invocation -accounting. Retain accurate native identity, terminal coverage, unknown usage, -and event-free cache hits. Group count and snapshot placement are implementation -choices, not architectural requirements. - -Add a short successor ADR, using the next available sequential number, that -narrowly supersedes [ADR-0024](../adr/0024-publish-artifacts-with-native-reports-and-debug-evidence.md)'s -requirement to use one native invocation `ExecutionGroup`. Record consumer-owned -observation and independent native groups without shared-group discovery or -application-maintained totals. Update ADR-0024's status to identify this partial -supersession and link to the successor; preserve its accepted decision body. -Its remaining artifact, reporting, capture, failure-handling, and native-accounting -decisions remain in force. This is a targeted correction to the group-count -clause, not a redesign of those boundaries. - -Documentation acceptance: readers can discover each adopted interface and reach -its selected upstream documentation directly. Local material describes what -Notarius contributes or selects, allowing brief orientation without a parallel -library reference. This upgrade is not a repository-wide documentation rewrite. - -## Verification And Acceptance - -Use the real updated kits with fake clients or local HTTP fixtures. Protect -integration behavior, not an exact copy of upstream report wording. The list -below defines coverage, not one required new test per item or flag combination. -Reuse existing tests and combine representative workflows where they protect -the same integration boundary: - -1. Both maintained example configurations pass offline pipeline validation; - original-result handoff, focused inspection, overlays, and secret-aware - evidence remain intact. -2. `run` and `pipeline run` accept the native usage flag, with no application - flag/alias collision. An assembled model-backed run covers initial calls, - a correction or structural repair, concurrent work, and a nested validator - without duplicate totals. Reuse existing recovery fixtures where practical. -3. `--show-tokens --format json` leaves stdout as the ordinary completion report - and writes usage only to diagnostics. Omission/explicit false, repeated - selection, quiet, help, bare `config explain`, returned failure, cancellation, - and diagnostic-delivery failure retain native semantics. Cover representative - application reporting and failure boundaries using existing tests where - sufficient; do not reproduce upstream's parser and presentation matrix. -4. A subsequent accepted-result hit performs no new model call and contributes - no historical usage. Preparation alone emits no execution; a prepared miss - observes its execution context. Debug events/group snapshots continue to - retain native identity, coverage, reasoning, and cost without a second ledger. - Caller/debug observers work through context without `RunInput.Executions` or - general `ExecutionOptions.Observer` forwarding. Preserve operation-specific - evidence and capture/publication failure handling while retiring tests coupled - only to the old plumbing. -5. One representative HTTP fixture verifies an application-selected OpenRouter - or vLLM configuration through the built-in HTTP client and new accounting - fields. Preserve known zero versus unavailable/incomplete state; do not add - reasoning/cache counts again to total tokens. Avoid duplicating the full - upstream provider decoder test suite. -6. Smoke JSON/YAML retain native structured reasoning/cache-ratio fields; - scripts/documentation no longer assume the old default serialization. - Existing domain JSON, completion fields, cache identity/eligibility, and - producer failure/fallback behavior remain unchanged. -7. Architecture policy and the successor ADR describe consumer-owned native - observation without an exact-one-group requirement. ADR-0024's status links - the partial supersession; its accepted body and unrelated decisions remain - unchanged. No shared accounting machinery is introduced to satisfy retired - wording. - -Relevant existing test owners include -[application assembly](../../internal/cli/application_test.go), -[recovery](../../internal/cli/recovery_contract_test.go), -[native processes](../../internal/cli/native_process_test.go), -[completion/delivery](../../internal/cli/run_result_command_test.go), -[producer execution](../../internal/framework/pipeline/producer_test.go), -[cache reuse](../../internal/framework/pipeline/producer_cache_test.go), -[capture](../../internal/framework/pipeline/native_capture_test.go), and -[native validator execution](../../internal/modules/dnd/validate/scenedescriptions/combat_semantics/native_execution_test.go). - -Run focused tests during changes, then `GOWORK=off go test ./...`, -`GOWORK=off go vet ./...`, and a build of `./cmd/notarius`. Run focused race -checks for touched pipeline/CLI observation paths. Validate maintained examples -and exercise native help/inspection/reporting using the resulting executable. -Tests remain offline and credential-independent; production billing accuracy -and model quality are not release gates for this dependency upgrade. - -### Review-Time Compatibility Evidence - -The published target set was selected in a temporary module file outside the -repository. The existing full test suite, vet, build, and module verification -passed. Executable tests were also rerun with the temporary module selection -inherited by their child builds. The resulting executable passed both maintained -examples' offline preflight with `--show-tokens --format json`, showed the -inherited `openrouter` provider on `limited-openrouter`, and displayed bare -`config explain` help without a usage summary. Local roadmap links and whitespace -checks passed. At that review checkpoint, repository dependency files and -application code were unchanged. - -Those review-time checks established baseline compatibility, not completion of -the later contextual-enrollment refactor or accounting integration coverage. -The implementation plan now records that completed work and final verification. -No live-provider, production-model, or billing test was required or claimed. - -## Scope Boundaries - -This is a coordinated dependency and native-observability upgrade. It does not -add a dashboard, cost enforcement, budget caps, usage database, durable execution -ledger, new validator policy, prompt/model change, configuration compatibility -layer, or changed artifact schema. Future reporting demands can build on the -native evidence when a concrete consumer requires them.