Validate internal decisions and reconcile exact model references
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/core/chunking"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/core/schema"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/proposals"
|
||||
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/validators"
|
||||
)
|
||||
|
||||
// testChunkProposalHarness is a test-only helper that composes existing
|
||||
@@ -77,7 +78,7 @@ func (m deterministicFakeModule) ReplacementPolicy() proposals.ReplacementPolicy
|
||||
return m.replacementPolicy
|
||||
}
|
||||
|
||||
func (m deterministicFakeModule) Validators() []Validator { return nil }
|
||||
func (m deterministicFakeModule) Validators() []validators.Validator { return nil }
|
||||
|
||||
func (m deterministicFakeModule) Propose(ctx context.Context, req ProposalRequest) (ProposalResult, error) {
|
||||
_ = ctx
|
||||
|
||||
@@ -22,16 +22,10 @@ type StructuredLLMClient = structuredoutput.Client
|
||||
type TranscriptModule interface {
|
||||
Key() string
|
||||
ReplacementPolicy() proposals.ReplacementPolicy
|
||||
Validators() []Validator
|
||||
Validators() []validators.Validator
|
||||
Propose(ctx context.Context, req ProposalRequest) (ProposalResult, error)
|
||||
}
|
||||
|
||||
// Validator evaluates candidate proposals and returns one decision per proposal index.
|
||||
type Validator interface {
|
||||
Name() string
|
||||
Validate(ctx context.Context, req ValidationRequest) (validators.Result, error)
|
||||
}
|
||||
|
||||
type StructuredCompletionRequest = structuredoutput.Request
|
||||
type StructuredCompletionResponse = structuredoutput.Response
|
||||
|
||||
@@ -98,9 +92,6 @@ type ProposalResult struct {
|
||||
Operations []outcomes.Operation `json:"operations,omitempty"`
|
||||
}
|
||||
|
||||
// ValidationRequest is the input to validator execution.
|
||||
type ValidationRequest = validators.Request
|
||||
|
||||
// ResolveModuleRunSpecs derives isolated consumer views from resolved settings.
|
||||
func ResolveModuleRunSpecs(cfg *config.Config) []ModuleRunSpec {
|
||||
if cfg == nil {
|
||||
|
||||
@@ -30,7 +30,7 @@ type fakeValidator struct{}
|
||||
|
||||
func (f *fakeValidator) Name() string { return "fake-validator" }
|
||||
|
||||
func (f *fakeValidator) Validate(ctx context.Context, req ValidationRequest) (validators.Result, error) {
|
||||
func (f *fakeValidator) Validate(ctx context.Context, req validators.Request) (validators.Result, error) {
|
||||
_ = ctx
|
||||
decisions := make([]validators.Decision, len(req.CandidateProposal))
|
||||
for i, proposal := range req.CandidateProposal {
|
||||
@@ -47,8 +47,8 @@ func (f *fakeModule) ReplacementPolicy() proposals.ReplacementPolicy {
|
||||
return proposals.ReplacementPolicyRequireUnique
|
||||
}
|
||||
|
||||
func (f *fakeModule) Validators() []Validator {
|
||||
return []Validator{&fakeValidator{}}
|
||||
func (f *fakeModule) Validators() []validators.Validator {
|
||||
return []validators.Validator{&fakeValidator{}}
|
||||
}
|
||||
|
||||
func (f *fakeModule) Propose(ctx context.Context, req ProposalRequest) (ProposalResult, error) {
|
||||
@@ -63,7 +63,7 @@ func (f *fakeModule) Propose(ctx context.Context, req ProposalRequest) (Proposal
|
||||
|
||||
func TestInterfaceContractsCompileWithFakes(t *testing.T) {
|
||||
var _ StructuredLLMClient = (*fakeLLMClient)(nil)
|
||||
var _ Validator = (*fakeValidator)(nil)
|
||||
var _ validators.Validator = (*fakeValidator)(nil)
|
||||
var _ TranscriptModule = (*fakeModule)(nil)
|
||||
|
||||
module := &fakeModule{}
|
||||
|
||||
Reference in New Issue
Block a user