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

@@ -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
application-specific workflow where a concrete Scriptorium requirement warrants
it. Use a clean configuration migration, including configured secrets bootstrap,
in place of the separate framework-loading architecture. Expose native token/cost
reporting and preserve new definition features without building parallel
application machinery.
in place of the separate framework-loading architecture. Expose native CLI
token/cost reporting and preserve new definition features without building
parallel application machinery.
The shared-load configuration cutover and native secrets bootstrap are the
selected direction. They change the application format, startup behavior, and
inspection boundary, not just dependencies. The recommended HTTP reporting
additions remain a separable decision.
inspection boundary, not just dependencies. Additional HTTP reporting is deferred;
this upgrade retains the current HTTP response and execution-report shapes.
## 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
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
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
changed automatic smoke representation and explicit structured alternatives.
For HTTP, recommend adding `reasoning_tokens` to result usage and the opt-in
terminal usage projection, plus native-shaped `cost_usd` to success metadata and
terminal execution reports. Expose the terminal cache-hit ratio as a nullable
fraction derived by `ObservedTokenUsage.CacheHitRatio()`, not by guessing from
result zeros. Keep existing integer result usage distinct from presence-aware
terminal accounting. Retain cost `value`, `known`, `complete`, and `source` on
both success and failure paths where native evidence exists.
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.
Keep the existing HTTP response DTOs and opt-in terminal-report projection for
this upgrade, adapting their integration only as needed for the new library
versions. New reasoning, cost, and cache-ratio evidence remains available through
native CLI reports, but adding it to HTTP is [deferred](#deferred-work).
Preserve existing result-usage versus presence-aware terminal-usage semantics,
request-scoped observation, status mapping, transport limits, and shared-engine
capacity behavior. This deferral concerns additional reporting, not HTTP support
for the upgraded configuration and valid PromptKit definitions.
### Justified Application-Owned Boundaries
@@ -392,12 +386,14 @@ no identified Scriptorium-specific requirement that warrants a legacy path.
### 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
changes. Update the architecture policy's current integration description and
versioned upstream links; accepted ADR decision text remains unchanged. Mark the
embedded-configuration direction in [future work](future.md) as delivered only
when its implementation lands. Other deferred directions remain separate.
changes. Review HTTP compatibility against its existing contract without adding
report fields in this work. Update the architecture policy's current integration
description and versioned upstream links; accepted ADR decision text remains
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
effects, and comparison behavior in configuration/operations guidance. Include
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
shared-load imports/overlays and independent comparisons, native provenance and
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
help-only behavior, independent report delivery, HTTP limits/reader containment,
and shared backend capacity using representative real-library integration tests
with controlled providers. Reuse existing coverage rather than duplicate upstream
format/accounting matrices.
existing HTTP report shapes, and shared backend capacity using representative
real-library integration tests with controlled providers. Reuse existing coverage
rather than duplicate upstream format/accounting matrices.
Protect bootstrap integration with representative native-helper tests: selected
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
preparation, not in this roadmap.
## Open Decisions
## Deferred Work
### HTTP Accounting Additions
**Recommendation:** include the additive reasoning/cost/cache visibility above.
The existing result and terminal-report projections otherwise discard useful
upstream evidence, especially known cost on failure. Keep the HTTP work limited
to those facts and update its canonical contract and strict-consumer guidance.
**Alternative:** preserve the current HTTP response schema for this sprint and
deliver accounting only through native CLI reports. This reduces wire-surface
work and cleanly separates the deferred HTTP review, at the cost of knowingly
omitting newly available evidence for HTTP consumers. Definition support does
not itself require these response additions.
The user selected deferral of additional HTTP reporting. A future roadmap may
add reasoning tokens to result and terminal usage, native cost availability,
completeness and source information to success/terminal reports (including
failures with terminal evidence), and a nullable terminal cache-hit ratio using
`ObservedTokenUsage.CacheHitRatio()`. Keep result usage distinct from
presence-aware observations; do not infer ratios from unavailable counts or
treat unknown cost as zero. This is future work, not an upgrade acceptance
requirement or a blocker for native CLI reporting.
[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