Defer additional HTTP reporting

This commit is contained in:
2026-11-23 01:01:05 +00:00
parent d01b4db02e
commit c2d6bbc62f
2 changed files with 38 additions and 40 deletions

View File

@@ -10,6 +10,10 @@ Current behavior belongs to the [CLI](../cli.md), [configuration](../config.md),
- **HTTP design review:** separate work before v1.0; CommandKit adoption retained - **HTTP design review:** separate work before v1.0; CommandKit adoption retained
the existing HTTP interface and execution-report representation. the existing HTTP interface and execution-report representation.
- **Additional HTTP accounting:** reasoning, cost, and cache-ratio reporting is
deferred from the [library upgrade roadmap](library-upgrades.md#deferred-work).
The upgrade retains current HTTP report shapes while adopting native CLI
reporting.
- **Embedded framework configuration:** deferred pending upstream support for a - **Embedded framework configuration:** deferred pending upstream support for a
native handoff preserving resource context and inspection evidence. The current native handoff preserving resource context and inspection evidence. The current
application settings select a separate PromptKit entry file. application settings select a separate PromptKit entry file.

View File

@@ -13,14 +13,14 @@ as the handoff to PromptKit and CommandKit's native integrations for operator
interfaces. Adopt native upstream workflows by default; retain an interfaces. Adopt native upstream workflows by default; retain an
application-specific workflow where a concrete Scriptorium requirement warrants application-specific workflow where a concrete Scriptorium requirement warrants
it. Use a clean configuration migration, including configured secrets bootstrap, it. Use a clean configuration migration, including configured secrets bootstrap,
in place of the separate framework-loading architecture. Expose native token/cost in place of the separate framework-loading architecture. Expose native CLI
reporting and preserve new definition features without building parallel token/cost reporting and preserve new definition features without building
application machinery. parallel application machinery.
The shared-load configuration cutover and native secrets bootstrap are the The shared-load configuration cutover and native secrets bootstrap are the
selected direction. They change the application format, startup behavior, and selected direction. They change the application format, startup behavior, and
inspection boundary, not just dependencies. The recommended HTTP reporting inspection boundary, not just dependencies. Additional HTTP reporting is deferred;
additions remain a separable decision. this upgrade retains the current HTTP response and execution-report shapes.
## Reviewed Releases And Sources ## Reviewed Releases And Sources
@@ -344,7 +344,7 @@ Allow native `zero_cost` and vLLM declarations without app-side defaults or
provider allowlists. Update inspection paths to include `/promptkit` and allow provider allowlists. Update inspection paths to include `/promptkit` and allow
the native prepared message hash/schema evidence through unchanged. the native prepared message hash/schema evidence through unchanged.
### Native Usage And HTTP Result Visibility ### Native CLI Usage And HTTP Scope
Adopt ckprompt's `--show-tokens` with its native defaults, ordering, quiet and Adopt ckprompt's `--show-tokens` with its native defaults, ordering, quiet and
help behavior. Preserve artifact-only CLI text output, native structured results, help behavior. Preserve artifact-only CLI text output, native structured results,
@@ -352,20 +352,14 @@ and the independently formatted separate report; structured results acquire
native reasoning/cost fields without a Scriptorium report wrapper. Document the native reasoning/cost fields without a Scriptorium report wrapper. Document the
changed automatic smoke representation and explicit structured alternatives. changed automatic smoke representation and explicit structured alternatives.
For HTTP, recommend adding `reasoning_tokens` to result usage and the opt-in Keep the existing HTTP response DTOs and opt-in terminal-report projection for
terminal usage projection, plus native-shaped `cost_usd` to success metadata and this upgrade, adapting their integration only as needed for the new library
terminal execution reports. Expose the terminal cache-hit ratio as a nullable versions. New reasoning, cost, and cache-ratio evidence remains available through
fraction derived by `ObservedTokenUsage.CacheHitRatio()`, not by guessing from native CLI reports, but adding it to HTTP is [deferred](#deferred-work).
result zeros. Keep existing integer result usage distinct from presence-aware Preserve existing result-usage versus presence-aware terminal-usage semantics,
terminal accounting. Retain cost `value`, `known`, `complete`, and `source` on request-scoped observation, status mapping, transport limits, and shared-engine
both success and failure paths where native evidence exists. capacity behavior. This deferral concerns additional reporting, not HTTP support
for the upgraded configuration and valid PromptKit definitions.
The existing request-scoped observer can remain; contextual observation is not
mandatory for HTTP. Do not attach a server-global mutable group or aggregate
unrelated requests. Do not sum terminal and attempt totals, add reasoning/cache
counts to token totals, interpret unknown as zero, estimate prices, or claim
invoice accuracy. No HTTP request controls or broader HTTP redesign are needed
to expose these result facts.
### Justified Application-Owned Boundaries ### Justified Application-Owned Boundaries
@@ -392,12 +386,14 @@ no identified Scriptorium-specific requirement that warrants a legacy path.
### Documentation, Licensing, And Verification ### Documentation, Licensing, And Verification
Update the canonical configuration, CLI, HTTP (if selected), operations, Update the canonical configuration, CLI, operations,
subprocess/migration, contributor, and internal documents with the implemented subprocess/migration, contributor, and internal documents with the implemented
changes. Update the architecture policy's current integration description and changes. Review HTTP compatibility against its existing contract without adding
versioned upstream links; accepted ADR decision text remains unchanged. Mark the report fields in this work. Update the architecture policy's current integration
embedded-configuration direction in [future work](future.md) as delivered only description and versioned upstream links; accepted ADR decision text remains
when its implementation lands. Other deferred directions remain separate. unchanged. Mark the embedded-configuration direction in [future work](future.md)
as delivered only when its implementation lands. Other deferred directions
remain separate.
Describe configured bootstrap, native overwrite behavior, partial environment Describe configured bootstrap, native overwrite behavior, partial environment
effects, and comparison behavior in configuration/operations guidance. Include effects, and comparison behavior in configuration/operations guidance. Include
maintained secret-free provisioning examples when implementation lands. maintained secret-free provisioning examples when implementation lands.
@@ -413,12 +409,12 @@ copied third-party implementation or new licensing requirement.
Validate the assembled integration, not upstream internals. Focus coverage on Validate the assembled integration, not upstream internals. Focus coverage on
shared-load imports/overlays and independent comparisons, native provenance and shared-load imports/overlays and independent comparisons, native provenance and
redaction, all schema selection forms and collection roots, omitted versus zero redaction, all schema selection forms and collection roots, omitted versus zero
repair budgets, provider declarations, and request-scoped accounting on success, repair budgets, provider declarations, and native CLI accounting on success,
failure, cancellation, retries, and repairs. Protect stream separation, quiet and failure, cancellation, retries, and repairs. Protect stream separation, quiet and
help-only behavior, independent report delivery, HTTP limits/reader containment, help-only behavior, independent report delivery, HTTP limits/reader containment,
and shared backend capacity using representative real-library integration tests existing HTTP report shapes, and shared backend capacity using representative
with controlled providers. Reuse existing coverage rather than duplicate upstream real-library integration tests with controlled providers. Reuse existing coverage
format/accounting matrices. rather than duplicate upstream format/accounting matrices.
Protect bootstrap integration with representative native-helper tests: selected Protect bootstrap integration with representative native-helper tests: selected
main capture, absent-directory/defaults-only behavior, environment preservation main capture, absent-directory/defaults-only behavior, environment preservation
@@ -437,20 +433,18 @@ The proposed public configuration changes warrant a new Scriptorium minor
release under the existing pre-v1 policy; choose its number during release release under the existing pre-v1 policy; choose its number during release
preparation, not in this roadmap. preparation, not in this roadmap.
## Open Decisions ## Deferred Work
### HTTP Accounting Additions ### HTTP Accounting Additions
**Recommendation:** include the additive reasoning/cost/cache visibility above. The user selected deferral of additional HTTP reporting. A future roadmap may
The existing result and terminal-report projections otherwise discard useful add reasoning tokens to result and terminal usage, native cost availability,
upstream evidence, especially known cost on failure. Keep the HTTP work limited completeness and source information to success/terminal reports (including
to those facts and update its canonical contract and strict-consumer guidance. failures with terminal evidence), and a nullable terminal cache-hit ratio using
`ObservedTokenUsage.CacheHitRatio()`. Keep result usage distinct from
**Alternative:** preserve the current HTTP response schema for this sprint and presence-aware observations; do not infer ratios from unavailable counts or
deliver accounting only through native CLI reports. This reduces wire-surface treat unknown cost as zero. This is future work, not an upgrade acceptance
work and cleanly separates the deferred HTTP review, at the cost of knowingly requirement or a blocker for native CLI reporting.
omitting newly available evidence for HTTP consumers. Definition support does
not itself require these response additions.
[ck130]: https://forge.maximumdirect.net/base-layer/configkit/src/commit/652ddb649c60208dbba964f0ef919e36725c12c0/docs/releases/v1.3.0.md [ck130]: https://forge.maximumdirect.net/base-layer/configkit/src/commit/652ddb649c60208dbba964f0ef919e36725c12c0/docs/releases/v1.3.0.md
[ck140]: https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/releases/v1.4.0.md [ck140]: https://forge.maximumdirect.net/base-layer/configkit/src/commit/4a7ae664a6287d71cba20f59c7c5b37b6f05b0a3/docs/releases/v1.4.0.md