Documentation
¶
Overview ¶
Package evidence maintains source-backed, versioned evidence relationships. Its projections never establish that a source statement is true.
Index ¶
- func Canonical(s string) string
- func CurrentObjects(ctx context.Context, db *sql.DB, owner, project string, seeds []Seed) (map[Seed]Object, error)
- func DocumentLocator(ctx context.Context, db *sql.DB, owner string, o Object) (map[string]string, error)
- func IndexEvent(ctx context.Context, tx *sql.Tx, id string) error
- func RecordDerived(ctx context.Context, tx *sql.Tx, d Derived) error
- func SHA(s string) string
- func SpanText(body string, span *Span) (string, error)
- func Text(ctx context.Context, db *sql.DB, owner string, o Object) (string, error)
- func WithPolicy(ctx context.Context, p Policy) context.Context
- type Assertion
- type Derived
- type Detail
- type Endpoint
- type Link
- type LinkScope
- type Object
- type Policy
- type Scope
- type Seed
- type SourceRef
- type Span
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentObjects ¶
func CurrentObjects(ctx context.Context, db *sql.DB, owner, project string, seeds []Seed) (map[Seed]Object, error)
CurrentObjects batches reference lookup. It never reuses an obsolete derived version after memory/summary text or provenance changes while capture is off.
func DocumentLocator ¶
func DocumentLocator(ctx context.Context, db *sql.DB, owner string, o Object) (map[string]string, error)
A locator is provenance metadata, never an instruction to fetch content.
func IndexEvent ¶
IndexEvent observes a committed-to-this-transaction raw source. Call after ingestion redaction, in the same transaction. Missing native refs stay absent until their endpoint arrives; nearest timestamps never fabricate a link.
func RecordDerived ¶
RecordDerived freezes the actual generated version and its declared sources. It records provenance, not semantic proof that every source supports a fact.
Types ¶
type Assertion ¶
type Assertion struct {
Relation string `json:"relation"`
From Endpoint `json:"from"`
To Endpoint `json:"to"`
Scope Scope `json:"scope"`
Witnesses []Endpoint `json:"witnesses"`
// Only explicit_assertion and model_inference are accepted from clients.
// Neither is promoted into native_ref or a claim of factual correctness.
Basis string `json:"basis"`
}
type Detail ¶
type Link ¶
type Link struct {
ID string `json:"link_id"`
Project string `json:"project_id"`
Relation string `json:"relation"`
From string `json:"from_object_id"`
To string `json:"to_object_id"`
Basis string `json:"basis"`
Status string `json:"status"`
Rule string `json:"rule_version"`
Scope string `json:"scope_json"`
Witnesses string `json:"witness_refs"`
Record string `json:"assertion_record_id"`
}
type Object ¶
type Object struct {
ID string `json:"object_id"`
Project string `json:"project_id"`
Kind string `json:"kind"`
Ref string `json:"ref_id"`
Revision string `json:"revision_sha"`
BodySHA string `json:"body_sha"`
SourceKind string `json:"source_kind"`
SourceID string `json:"source_id"`
Field string `json:"field_path"`
Availability string `json:"availability"`
Session string `json:"session_id"`
Device string `json:"device_id"`
Role string `json:"role"`
Turn string `json:"turn_key"`
Prompt string `json:"prompt_key"`
Message string `json:"native_message_id"`
Parent string `json:"parent_message_id"`
Batch string `json:"batch_key"`
Ordinal *int `json:"source_ordinal,omitempty"`
Count *int `json:"source_count,omitempty"`
At string `json:"occurred_at"`
Current bool `json:"is_current"`
}
type Policy ¶
type Policy struct {
Mode string `toml:"mode" json:"mode"`
MaxRelated int `toml:"max_related_nodes" json:"max_related_nodes"`
}