Documentation
¶
Overview ¶
Package sourceevidence captures replayable normalized observations and protects short-lived raw upstream evidence.
Index ¶
- func Replay(record NormalizedRecord) (sources.Observation, error)
- type Archive
- func (a *Archive) LoadNormalized(observationID string) (NormalizedRecord, error)
- func (a *Archive) OpenRaw(observationID string, now time.Time) (RawRecord, error)
- func (a *Archive) PurgeExpiredRaw(now time.Time) (int, error)
- func (a *Archive) ReplayObservation(observationID string) (sources.Observation, error)
- func (a *Archive) RetainNormalized(record NormalizedRecord) error
- func (a *Archive) RetainRaw(observationID string, record RawRecord) error
- type MinimizedIssue
- type NormalizedRecord
- type Policy
- type RawAccess
- type RawRecord
- type SealedRawRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Replay ¶
func Replay(record NormalizedRecord) (sources.Observation, error)
Replay verifies and reconstructs the exact normalized candidate catalog and provenance.
Types ¶
type Archive ¶
type Archive struct {
// contains filtered or unexported fields
}
Archive durably retains minimized normalized evidence and encrypted raw evidence. Directory and file modes enforce owner-only access in addition to raw encryption.
func NewArchive ¶
NewArchive creates a passive evidence archive configuration.
func (*Archive) LoadNormalized ¶
func (a *Archive) LoadNormalized(observationID string) (NormalizedRecord, error)
LoadNormalized reads and validates one retained normalized record.
func (*Archive) PurgeExpiredRaw ¶
PurgeExpiredRaw removes raw evidence whose bounded retention window has elapsed.
func (*Archive) ReplayObservation ¶
func (a *Archive) ReplayObservation(observationID string) (sources.Observation, error)
ReplayObservation loads and deterministically replays a retained observation.
func (*Archive) RetainNormalized ¶
func (a *Archive) RetainNormalized(record NormalizedRecord) error
RetainNormalized atomically stores one validated long-term replay record.
type MinimizedIssue ¶
type MinimizedIssue struct {
Scope catalogmeta.ObservationIssueScope `json:"scope"`
Code catalogmeta.ObservationIssueCode `json:"code"`
Subject string `json:"subject,omitempty"`
}
MinimizedIssue retains machine-readable degradation without diagnostic text.
type NormalizedRecord ¶
type NormalizedRecord struct {
Version uint64 `json:"version"`
ObservationID string `json:"observation_id"`
SourceID catalogmeta.SourceID `json:"source"`
ObservedAt time.Time `json:"observed_at"`
Revision catalogmeta.ObservationRevision `json:"revision"`
Completeness catalogmeta.ObservationCompleteness `json:"completeness"`
Status catalogmeta.ObservationStatus `json:"status"`
Records catalogmeta.ObservationRecordCounts `json:"records"`
Issues []MinimizedIssue `json:"issues,omitempty"`
EvidenceChecksum string `json:"evidence_checksum"`
Payload []byte `json:"payload"`
}
NormalizedRecord is the long-term, secret-minimized replay record for one observation.
func Capture ¶
func Capture(observation sources.Observation) (NormalizedRecord, error)
Capture creates a long-term normalized evidence record from an observation.
type Policy ¶
type Policy struct {
RawRetention time.Duration `json:"raw_retention"`
RawAccess RawAccess `json:"raw_access"`
RequireEncryption bool `json:"require_encryption"`
RetainHeaders bool `json:"retain_headers"`
RetainQuery bool `json:"retain_query"`
}
Policy defines raw and normalized evidence retention requirements.
func DefaultPolicy ¶
func DefaultPolicy() Policy
DefaultPolicy returns Starmap's bounded, encrypted, owner-only raw policy.
type RawAccess ¶
type RawAccess string
RawAccess describes the access boundary required for raw evidence storage.
const ( // RawAccessOwnerOnly requires an OS/service identity boundary with no public access. RawAccessOwnerOnly RawAccess = "owner_only" )
type RawRecord ¶
type RawRecord struct {
SourceID catalogmeta.SourceID `json:"source"`
ObservedAt time.Time `json:"observed_at"`
MediaType string `json:"media_type"`
Payload []byte `json:"payload"`
}
RawRecord contains response-body evidence only; request headers, query values, and credentials have no representation in this type.
type SealedRawRecord ¶
type SealedRawRecord struct {
Version uint64 `json:"version"`
Algorithm string `json:"algorithm"`
ObservationID string `json:"observation_id,omitempty"`
Nonce []byte `json:"nonce"`
Ciphertext []byte `json:"ciphertext"`
ExpiresAt time.Time `json:"expires_at"`
}
SealedRawRecord is an encrypted, expiring raw evidence envelope.