Documentation
¶
Index ¶
- Constants
- func ComputeHash(r *Record) (string, error)
- func Validate(r *Record) error
- type AgentChainHop
- type AgentLineageHop
- type Controls
- type GuardrailStatus
- type HumanOversight
- type Integrity
- type PolicyRef
- type Record
- type RecordOpts
- type Relations
- type Relationship
- type RelationshipEdge
- type RelationshipRef
Constants ¶
View Source
const SchemaVersion = "1.0"
Variables ¶
This section is empty.
Functions ¶
func ComputeHash ¶
Types ¶
type AgentChainHop ¶ added in v0.4.5
type AgentChainHop struct {
Identity string `json:"identity"`
Role string `json:"role"`
Extra map[string]json.RawMessage `json:"-"`
}
func (AgentChainHop) MarshalJSON ¶ added in v0.4.5
func (h AgentChainHop) MarshalJSON() ([]byte, error)
func (*AgentChainHop) UnmarshalJSON ¶ added in v0.4.5
func (h *AgentChainHop) UnmarshalJSON(data []byte) error
type AgentLineageHop ¶ added in v0.4.5
type AgentLineageHop struct {
AgentID string `json:"agent_id"`
DelegatedBy string `json:"delegated_by,omitempty"`
DelegationRecordID string `json:"delegation_record_id,omitempty"`
Extra map[string]json.RawMessage `json:"-"`
}
func (AgentLineageHop) MarshalJSON ¶ added in v0.4.5
func (h AgentLineageHop) MarshalJSON() ([]byte, error)
func (*AgentLineageHop) UnmarshalJSON ¶ added in v0.4.5
func (h *AgentLineageHop) UnmarshalJSON(data []byte) error
type Controls ¶
type Controls struct {
PermissionsEnforced bool `json:"permissions_enforced"`
ApprovedScope string `json:"approved_scope,omitempty"`
WithinScope *bool `json:"within_scope,omitempty"`
GuardrailsActive []GuardrailStatus `json:"guardrails_active,omitempty"`
HumanOversight *HumanOversight `json:"human_oversight,omitempty"`
}
type GuardrailStatus ¶
type HumanOversight ¶
type PolicyRef ¶ added in v0.4.5
type PolicyRef struct {
PolicyID string `json:"policy_id,omitempty"`
PolicyVersion string `json:"policy_version,omitempty"`
PolicyDigest string `json:"policy_digest,omitempty"`
MatchedRuleIDs []string `json:"matched_rule_ids,omitempty"`
Extra map[string]json.RawMessage `json:"-"`
}
func (PolicyRef) MarshalJSON ¶ added in v0.4.5
func (*PolicyRef) UnmarshalJSON ¶ added in v0.4.5
type Record ¶
type Record struct {
RecordID string `json:"record_id"`
RecordVersion string `json:"record_version"`
Timestamp time.Time `json:"timestamp"`
Source string `json:"source"`
SourceProduct string `json:"source_product"`
AgentID string `json:"agent_id,omitempty"`
RecordType string `json:"record_type"`
Event map[string]any `json:"event"`
Controls Controls `json:"controls"`
Metadata map[string]any `json:"metadata,omitempty"`
Relationship *Relationship `json:"relationship,omitempty"`
// Deprecated: use relationship. Kept for backward compatibility.
Relations *Relations `json:"relations,omitempty"`
Integrity Integrity `json:"integrity"`
}
func New ¶
func New(opts RecordOpts) (*Record, error)
type RecordOpts ¶
type RecordOpts struct {
RecordVersion string
Timestamp time.Time
Source string
SourceProduct string
AgentID string
Type string
Event map[string]any
Controls Controls
Metadata map[string]any
Relationship *Relationship
// Deprecated: use Relationship. Kept for backward compatibility.
Relations *Relations
}
type Relations ¶ added in v0.4.5
type Relations = Relationship
type Relationship ¶ added in v0.4.5
type Relationship struct {
ParentRef *RelationshipRef `json:"parent_ref,omitempty"`
EntityRefs []RelationshipRef `json:"entity_refs,omitempty"`
PolicyRef *PolicyRef `json:"policy_ref,omitempty"`
AgentChain []AgentChainHop `json:"agent_chain,omitempty"`
Edges []RelationshipEdge `json:"edges,omitempty"`
// Legacy v1.x compatibility fields (accepted in both relationship and relations).
ParentRecordID string `json:"parent_record_id,omitempty"`
RelatedRecordIDs []string `json:"related_record_ids,omitempty"`
RelatedEntityIDs []string `json:"related_entity_ids,omitempty"`
AgentLineage []AgentLineageHop `json:"agent_lineage,omitempty"`
// Extra preserves additive fields so they remain hash/signature covered.
Extra map[string]json.RawMessage `json:"-"`
}
func (Relationship) MarshalJSON ¶ added in v0.4.5
func (r Relationship) MarshalJSON() ([]byte, error)
func (*Relationship) UnmarshalJSON ¶ added in v0.4.5
func (r *Relationship) UnmarshalJSON(data []byte) error
type RelationshipEdge ¶ added in v0.4.5
type RelationshipEdge struct {
Kind string `json:"kind"`
From RelationshipRef `json:"from"`
To RelationshipRef `json:"to"`
Extra map[string]json.RawMessage `json:"-"`
}
func (RelationshipEdge) MarshalJSON ¶ added in v0.4.5
func (e RelationshipEdge) MarshalJSON() ([]byte, error)
func (*RelationshipEdge) UnmarshalJSON ¶ added in v0.4.5
func (e *RelationshipEdge) UnmarshalJSON(data []byte) error
type RelationshipRef ¶ added in v0.4.5
type RelationshipRef struct {
Kind string `json:"kind"`
ID string `json:"id"`
Extra map[string]json.RawMessage `json:"-"`
}
func (RelationshipRef) MarshalJSON ¶ added in v0.4.5
func (r RelationshipRef) MarshalJSON() ([]byte, error)
func (*RelationshipRef) UnmarshalJSON ¶ added in v0.4.5
func (r *RelationshipRef) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.