Avoid repeated prompt metadata lookups

This commit is contained in:
2026-11-06 18:00:32 +00:00
parent 63e9f0b731
commit 78b78ea00b
2 changed files with 11 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ resource-oriented profile result and changed post-handoff null fallback are
deliberately selected compatibility changes, not accidental regressions.
Review evidence below describes the pre-remediation implementation. Completion
markers record the subsequent corrections.
markers record the subsequent corrections. Both findings are now addressed.
## Findings
@@ -79,7 +79,14 @@ another implementation path, compatibility field, or new runtime test.
### R2. Hoist The Prompt Presence Lookup Out Of The Input Loop [P3]
**Status:** Open for consideration. **Affected stage:** 4.
**Status:** Complete. **Affected stage:** 4.
Completion: `InspectPrompt` fetches the selected presence slice once before
iterating over inputs. The loop now indexes that slice directly, with no new
cache or public contract. Existing inherited-presence, captured-content, generic
JSON/YAML encoding, typed-source, and isolation tests pass with Go 1.27.3 under
the race detector; `go vet ./...` also passes. No benchmark or implementation-
coupled lookup-count test was added.
**Location:** [Prompt resource projection](../../internal/configuration/resources.go),
`InspectPrompt`, lines 77–85, especially `state.promptMetadata[id][i]` at line 81.