Record lightweight inspection lookup results

This commit is contained in:
2026-10-09 00:35:59 +00:00
parent b7ff37118c
commit 74b91fae99

View File

@@ -311,6 +311,11 @@ families in their owning packages.
## Stage 8 — Add Shared Lightweight Configuration Lookups
**Status: Complete (2026-10-09).** Captured prompt and profile selection now
share their lookup rules, with owned metadata-only results available for
inspection. The Stage 7 benchmark comparison is recorded below; root
requirement-inspection routing remains unchanged.
**Outcome:** Captured configuration can provide identity/inspection metadata
without copying execution payloads. Existing runtime behavior stays unchanged
until Stages 9 and 10.
@@ -595,6 +600,48 @@ large profile-selection and requirement-inspection cases; they are local
allocation measurements, not end-to-end provider-latency claims. Fixture
identity and prompt/requirement inventories were checked outside timing.
### Lightweight Inspection Lookups Comparison
The before measurements are the Stage 7 benchmark-only baseline at `04d5d69`;
the after measurements use the same fixtures at `b7ff371` (`Add lightweight
configuration lookups`). The command, environment, and five-sample procedure
are those in the Inspection Baseline subsection. Each after-case also checks
the selected identity or requirement/input inventory outside timing. The new
prompt-inspection cases return copied metadata without execution templates;
the profile-identity cases use the same two-entry and 64-entry nested-extra
snapshots as the full profile cases.
| Configuration path | Before `ns/op` (median; range) | Before allocations | After `ns/op` (median; range) | After allocations |
| --- | --- | --- | --- | --- |
| Prompt snapshot, small extras | 356.8, 354.2, 370.1, 352.8, 364.5 (356.8; 352.8–370.1) | 400; 4 | 292.6, 272.5, 332.9, 277.4, 302.3 (292.6; 272.5–332.9) | 336; 3 |
| Prompt snapshot, nested extras | 423.2, 478.8, 456.2, 436.6, 460.4 (456.2; 423.2–478.8) | 400; 4 | 359.0, 357.1, 388.8, 356.4, 365.7 (359.0; 356.4–388.8) | 336; 3 |
| Prompt inspection, small extras | — | — | 279.0, 194.3, 199.2, 187.8, 182.3 (194.3; 182.3–279.0) | 208; 2 |
| Prompt inspection, nested extras | — | — | 277.0, 236.8, 253.4, 222.5, 230.3 (236.8; 222.5–277.0) | 208; 2 |
| Full profile, small extras | 18785, 21077, 18952, 19701, 18682 (18952; 18682–21077) | 9538; 211 | 18887, 18555, 18517, 18761, 20126 (18761; 18517–20126) | 9538; 211 |
| Full profile, nested extras | 624104, 635513, 600281, 600667, 620228 (620228; 600281–635513) | 261024–261028; 5979 | 616937, 612152, 666875, 639239, 641841 (639239; 612152–666875) | 261024–261029; 5979 |
| Profile identity, small extras | — | — | 18.62, 18.62, 17.89, 18.57, 20.24 (18.62; 17.89–20.24) | 0; 0 |
| Profile identity, nested extras | — | — | 20.69, 19.83, 18.86, 18.65, 19.22 (19.22; 18.65–20.69) | 0; 0 |
The prompt snapshot now avoids the unused inspection-input copy, saving 64 B
and one allocation in these fixtures. The dedicated metadata lookup uses
208 B/two allocations for either payload size, and identity lookup uses no
allocation despite the nested provider data. Full owned-profile allocation
counts are unchanged and their before/after time ranges overlap.
The root benchmark still uses the existing inspection route; these small
changes are from its prompt snapshot dependency, not profile-identity routing:
| Public requirement inspection | Before `ns/op` (median; range) | Before allocations | After `ns/op` (median; range) | After allocations |
| --- | --- | --- | --- | --- |
| Small extras | 23022, 25193, 24687, 24974, 23157 (24687; 23022–25193) | 11922; 240 | 24320, 24715, 23919, 23911, 23885 (23919; 23885–24715) | 11858; 239 |
| Nested extras | 635726, 642297, 591992, 605001, 590312 (605001; 590312–642297) | 263370–263372; 6008 | 595187, 647166, 675430, 595950, 626551 (626551; 595187–675430) | 263304–263309; 6007 |
Root requirement-inspection allocation decreased by 64–66 B and one allocation;
the timing ranges overlap. The large profile extras still dominate until the
next routing change. No public method or ConfigKit query was added. Focused
verification passed: `go test ./internal/configuration ./internal/usecase .`;
both benchmark families were rerun without the race detector.
### Validation And Compiled-Rendering Baseline
The benchmark-only baseline is commit