35 lines
1.5 KiB
Go
35 lines
1.5 KiB
Go
|
|
package semanticreconcile
|
||
|
|
|
||
|
|
import (
|
||
|
|
"fmt"
|
||
|
|
"strings"
|
||
|
|
|
||
|
|
"go.maximumdirect.net/promptkit"
|
||
|
|
)
|
||
|
|
|
||
|
|
const PromptID = "notarius/generic.semantic_reconciliation"
|
||
|
|
const CorrectionPromptID = "notarius/generic.semantic_reconciliation.repair"
|
||
|
|
|
||
|
|
// InitialRequest selects a native prompt and copies already prepared evidence.
|
||
|
|
// The owner prepares once and retains the same Preparation for every proposal.
|
||
|
|
// Deterministic skips and preparation limits do not create synthetic requests.
|
||
|
|
func InitialRequest(preparation Preparation, promptID, profileID, sessionID string) (promptkit.RunRequest, error) {
|
||
|
|
if preparation.Disposition() != Ready {
|
||
|
|
return promptkit.RunRequest{}, fmt.Errorf("semantic reconciliation materials are not ready for execution")
|
||
|
|
}
|
||
|
|
inputs := make(map[string]promptkit.ArtifactRef, len(preparation.materials))
|
||
|
|
for name, content := range preparation.materials {
|
||
|
|
inputs[name] = promptkit.Inline(string(content))
|
||
|
|
}
|
||
|
|
return promptkit.RunRequest{PromptID: promptID, ProfileID: profileID, SessionID: sessionID, Inputs: inputs}, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// CorrectionRequest supplies only findings. Native coordination retains source
|
||
|
|
// windows, candidate handles, and prior proposals from the original exchange.
|
||
|
|
func CorrectionRequest(promptID, profileID, sessionID string, guidance []string) promptkit.RunRequest {
|
||
|
|
return promptkit.RunRequest{
|
||
|
|
PromptID: promptID, ProfileID: profileID, SessionID: sessionID,
|
||
|
|
Inputs: map[string]promptkit.ArtifactRef{"guidance": promptkit.Inline(strings.Join(guidance, "\n\n"))},
|
||
|
|
}
|
||
|
|
}
|