Capture complete prompt resources for inspection

This commit is contained in:
2026-11-06 15:18:57 +00:00
parent 4cbd4e2da0
commit bf3d2e19bd
7 changed files with 108 additions and 6 deletions

View File

@@ -20,6 +20,7 @@ var (
)
type promptEntry struct {
resource promptConfig
definition domain.PromptDefinition
inspection domain.PromptInspection
requirementInputs []prompt.InputMetadata
@@ -86,7 +87,7 @@ func (state *loaded) materializePrompt(id string, raw promptConfig, base configk
}
definition.Inputs = inputs
definition.Templates = messages
entry := &promptEntry{requirementInputs: inputMetadata, messages: compiledMessages}
entry := &promptEntry{resource: raw, requirementInputs: inputMetadata, messages: compiledMessages}
definition.Validation = contract
if raw.SessionID != nil {
var err error
@@ -316,8 +317,8 @@ func (state *loaded) GetPromptSnapshot(ctx context.Context, id string) (*domain.
return ownPromptDefinition(entry.definition), entry.hash, nil
}
// GetPromptInspection returns an independently owned inspection of one
// captured prompt without copying its execution templates.
// GetPromptInspection returns lightweight metadata used for requirement
// selection, independently of the full resource inspection view.
func (state *loaded) GetPromptInspection(ctx context.Context, id string) (*domain.PromptInspection, error) {
if err := ctx.Err(); err != nil {
return nil, err