Documentation
¶
Index ¶
- Constants
- Variables
- type AppliedOperation
- type Candidate
- type Evidence
- type LearningCheck
- type Query
- type Record
- type Request
- type Result
- type Service
- func (s *Service) Candidates(ctx context.Context, task taskstate.Task) ([]taskstate.EvolutionContextItem, error)
- func (s *Service) Guidance(ctx context.Context, task taskstate.Task) ([]taskstate.EvolutionContextItem, error)
- func (s *Service) Manage(ctx context.Context, req Request) (Result, error)
- func (s *Service) ResolveBindings(ctx context.Context, task taskstate.Task) error
- func (s *Service) ValidateBindings(ctx context.Context, task taskstate.Task, ...) ([]taskstate.EvolutionBinding, error)
Constants ¶
View Source
const ( StatusProvisional = "provisional" StatusActive = "active" StatusVerified = "verified" StatusQuarantine = "quarantine" StatusRetired = "retired" )
View Source
const ( RelationSupport = "support" RelationContradict = "contradict" RelationNone = "none" RelationNotApplicable = "not_applicable" RelationUncertain = "uncertain" )
View Source
const PolicyVersion = "v1"
Variables ¶
View Source
var ErrRevisionConflict = errors.New("evolution revision conflict")
View Source
var ErrSelfProof = errors.New("rejected_self_proof")
Functions ¶
This section is empty.
Types ¶
type AppliedOperation ¶
type Candidate ¶
type Candidate struct {
Type string `json:"type"`
Statement string `json:"statement"`
Scope string `json:"scope,omitempty"`
Project string `json:"project,omitempty"`
Device string `json:"device,omitempty"`
CanonicalKey string `json:"canonical_key,omitempty"`
Source string `json:"source,omitempty"`
Tags []string `json:"tags,omitempty"`
}
type LearningCheck ¶
type Query ¶
type Query struct {
Query string `json:"query"`
EvolutionID string `json:"evolution_id,omitempty"`
Statuses []string `json:"statuses,omitempty"`
Types []string `json:"types,omitempty"`
Scope string `json:"scope,omitempty"`
Project string `json:"project,omitempty"`
Device string `json:"device,omitempty"`
Limit int `json:"limit,omitempty"`
}
type Record ¶
type Record struct {
EvolutionID string `json:"evolution_id"`
Title string `json:"title"`
Statement string `json:"statement"`
Type string `json:"type"`
Scope string `json:"scope"`
Project string `json:"project"`
Device string `json:"device,omitempty"`
CanonicalKey string `json:"canonical_key,omitempty"`
Status string `json:"status"`
PolicyVersion string `json:"policy_version"`
Revision int64 `json:"revision"`
SupportCount int `json:"support_count"`
ContradictCount int `json:"contradict_count"`
Source string `json:"source,omitempty"`
Tags []string `json:"tags,omitempty"`
Evidence []Evidence `json:"evidence,omitempty"`
SupersededBy string `json:"superseded_by,omitempty"`
AppliedOperations []AppliedOperation `json:"applied_operations,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type Request ¶
type Request struct {
Intent string `json:"intent"`
Candidate *Candidate `json:"candidate,omitempty"`
LearningCheck *LearningCheck `json:"learning_check,omitempty"`
EvolutionID string `json:"evolution_id,omitempty"`
TaskID string `json:"task_id,omitempty"`
ReviewRevision string `json:"review_revision,omitempty"`
Relation string `json:"relation,omitempty"`
EvidenceRefs []string `json:"evidence_refs,omitempty"`
Rationale string `json:"rationale,omitempty"`
SupersededBy string `json:"superseded_by,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Candidates ¶
func (*Service) ResolveBindings ¶
ResolveBindings 只消费执行前已经绑定的 learning check。final_review 的 pass/failed 只用于选择预声明的分支,本身不带 support/contradict 语义。
func (*Service) ValidateBindings ¶
func (s *Service) ValidateBindings(ctx context.Context, task taskstate.Task, bindings []taskstate.EvolutionBinding) ([]taskstate.EvolutionBinding, error)
ValidateBindings validates create-time learning checks before a Task is persisted. A support-bearing check is an explicit blinded validation: the target Evolution will be withheld from this Task's Guidance for its whole lifetime, while the normal anti-self-proof rule still rejects any target the Task has already seen or derives from.
Click to show internal directories.
Click to hide internal directories.