Record prompt inspection metadata results

This commit is contained in:
2026-10-09 00:45:54 +00:00
parent c5f733af45
commit a8863d49d0

View File

@@ -4,7 +4,8 @@ Implement the remaining local work in the [performance roadmap](performance.md)
in order. Each sequential stage is scoped for one Luna coding-agent prompt.
Stages 1–6 are complete; Stages 7–14 remain pending. Update status and evidence
as each work unit lands.
The completed inspection plan is preserved at
Stages 1–10 are complete; Stages 11–14 remain pending. The completed
inspection plan is preserved at
`481e2d4:docs/roadmap/implementation.md` in Git history.
## Baseline And Scope
@@ -387,6 +388,12 @@ provenance work is introduced.
## Stage 10 — Select Prompt Inspection Metadata Without Execution-Definition Copies
**Status: Complete (2026-10-09).** Prompt and requirement inspections now use
captured metadata when available, preserving the definition-based fallback.
Exact snapshot selection, hash parity, session bypass, and caller-owned results
are covered; race verification passed. The repeated inspection benchmark
comparison is recorded below.
**Outcome:** Prompt and requirement inspection avoid copying template execution
structures they do not consume.
@@ -673,6 +680,40 @@ paths preserve exact requested IDs, profile-load error wrapping, and
nil-profile/nil-target validation. Focused verification passed:
`go test ./internal/configuration ./internal/usecase .`.
### Prompt-Metadata Inspection Comparison
The before values use the Stage 9 implementation at `6c5dec7`; after values
use `c5f733a` (`Select prompt metadata for inspection`) with the same inspection
fixtures. The command and environment are those in the Inspection Baseline
subsection: Linux/amd64, Intel Core i5-7260U @ 2.20 GHz, benchmark parallelism
4, Go 1.26.8, ConfigKit `v0.5.0`, JSON Schema `v6.0.2`, and backend modules
`v3.20260930.0`. Five 500 ms samples were collected without the race detector.
Times list all five samples, followed by median and range; allocations are
`B/op; allocs/op`.
| Public requirement inspection | Stage 9 `ns/op` (median; range) | Stage 9 allocations | Metadata inspection `ns/op` (median; range) | Metadata inspection allocations |
| --- | --- | --- | --- | --- |
| Small extras | 2895, 2794, 2807, 3047, 2876 (2876; 2794–3047) | 2264; 26 | 2681, 2837, 2852, 2978, 2847 (2847; 2681–2978) | 2112; 24 |
| Nested extras | 2917, 2730, 2797, 2804, 2787 (2797; 2730–2917) | 2264; 26 | 2898, 3004, 2955, 4766, 4410 (3004; 2898–4766) | 2112; 24 |
The metadata route saves 152 cumulative bytes and two allocations per public
requirement inspection in both fixtures. Timing ranges overlap for the small
case; the larger after-run is noisy and does not show a reliable timing change.
The result supports the targeted copy reduction, not a provider-latency claim.
Configuration metadata inspection separately measured 208 B/two allocations
for both small and nested-extra fixtures, independent of their profile payload.
The benchmark command was:
```sh
GOTOOLCHAIN=local GOWORK=off GOPROXY=off GONOPROXY=none GOSUMDB=off \
go test -mod=readonly -run '^$' \
-bench 'BenchmarkInspectionSelection|BenchmarkRequirementInspection' \
-benchmem -benchtime=500ms -count=5 ./internal/configuration .
```
Verification passed on `c5f733a`:
`go test -race -mod=readonly ./internal/configuration ./internal/usecase .`.
### Validation And Compiled-Rendering Baseline
The benchmark-only baseline is commit