Documentation
¶
Overview ¶
Package reportschema defines shared schemas for structured runtime reports.
Index ¶
- Constants
- func ContentHash(report CanonicalReport) (string, error)
- func ReconstructAtomicMessage(update AtomicUpdate) (string, bool, error)
- func SensitivityRank(value string) (int, error)
- func StableJSONHash(value any) (string, error)
- type AtomicUpdate
- type CanonicalReport
- type Claim
- type CompatibilityGuidance
- type ConsumerCapabilities
- type FieldDelta
- type Identity
- type MessagePart
- type NegativeEvidence
- type Projection
- type ProjectionProvenance
- type RedactionProvenance
- type Registry
- type RegistryField
- type RegistryFilter
- type RegistryReport
Constants ¶
View Source
const ( SchemaV1 = "claw.report.v1" DefaultProjectionPolicyV1 = "claw.report.projection.v1" ReportingReportSchemaV1 = "codog.reporting.report.v1" ReportingSnapshotSchemaV1 = "codog.reporting.snapshot.v1" ReportingCompatibilityV1 = "codog.reporting.compatibility.v1" ReportingProjectionPolicyV1 = "codog.reporting.projection.v1" ReportingConsumerConformanceSchemaV1 = "codog.reporting.consumer_conformance.v1" ReportingConsumerConformanceResultV1 = "codog.reporting.consumer_conformance.result.v1" MockParityReportSchemaV1 = "codog.mock_parity.v1" MockParityManifestSchemaV1 = "codog.mock_parity_manifest.v1" ClaimObservedFact = "observed_fact" ClaimInference = "inference" ClaimHypothesis = "hypothesis" ClaimRecommendation = "recommendation" ConfidenceHigh = "high" ConfidenceMedium = "medium" ConfidenceLow = "low" ConfidenceUnknown = "unknown" SensitivityPublic = "public" SensitivityInternal = "internal" SensitivityOperatorOnly = "operator_only" SensitivitySecret = "secret" FieldChanged = "changed" FieldUnchanged = "unchanged" FieldCleared = "cleared" FieldCarriedForward = "carried_forward" NegativeNotObservedInCheckedScope = "not_observed_in_checked_scope" NegativeUnknownNotChecked = "unknown_not_checked" )
Variables ¶
This section is empty.
Functions ¶
func ContentHash ¶
func ContentHash(report CanonicalReport) (string, error)
func ReconstructAtomicMessage ¶
func ReconstructAtomicMessage(update AtomicUpdate) (string, bool, error)
ReconstructAtomicMessage joins message parts in canonical order.
func SensitivityRank ¶
SensitivityRank returns the projection ordering for a sensitivity label.
func StableJSONHash ¶
Types ¶
type AtomicUpdate ¶
type AtomicUpdate struct {
ReportID string `json:"report_id"`
ActiveSessions []string `json:"active_sessions,omitempty"`
ExactPinpoint string `json:"exact_pinpoint,omitempty"`
ConcreteDelta string `json:"concrete_delta,omitempty"`
Blocker string `json:"blocker,omitempty"`
MessageParts []MessagePart `json:"message_parts,omitempty"`
MessageComplete bool `json:"message_complete"`
}
AtomicUpdate binds dogfood status fields and chat fragments to one report id.
type CanonicalReport ¶
type CanonicalReport struct {
SchemaVersion string `json:"schema_version"`
Identity Identity `json:"identity"`
GeneratedAt string `json:"generated_at"`
Producer string `json:"producer"`
Claims []Claim `json:"claims,omitempty"`
NegativeEvidence []NegativeEvidence `json:"negative_evidence,omitempty"`
FieldDeltas []FieldDelta `json:"field_deltas,omitempty"`
AtomicUpdate *AtomicUpdate `json:"atomic_update,omitempty"`
}
func Canonicalize ¶
func Canonicalize(report CanonicalReport) (CanonicalReport, error)
type CompatibilityGuidance ¶
type CompatibilityGuidance struct {
Policy string `json:"policy"`
CurrentVersion string `json:"current_version"`
MinCompatibleVersion string `json:"min_compatible_version"`
AdditiveChanges []string `json:"additive_changes"`
BreakingChanges []string `json:"breaking_changes"`
MinimalStableCore []string `json:"minimal_stable_core"`
OlderConsumerGuidance string `json:"older_consumer_guidance"`
}
CompatibilityGuidance describes how consumers should handle report schema evolution.
type ConsumerCapabilities ¶
type FieldDelta ¶
type MessagePart ¶
type MessagePart struct {
ReportID string `json:"report_id"`
PartIndex int `json:"part_index"`
PartCount int `json:"part_count"`
Content string `json:"content"`
ContentHash string `json:"content_hash,omitempty"`
}
MessagePart records one transport fragment for a logical report update.
type NegativeEvidence ¶
type Projection ¶
type Projection struct {
SchemaVersion string `json:"schema_version"`
ProjectionID string `json:"projection_id"`
View string `json:"view"`
Provenance ProjectionProvenance `json:"provenance"`
Payload map[string]any `json:"payload"`
}
func Project ¶
func Project(report CanonicalReport, capabilities ConsumerCapabilities, view string) (Projection, error)
type ProjectionProvenance ¶
type ProjectionProvenance struct {
PolicyID string `json:"policy_id"`
SourceSchemaVersion string `json:"source_schema_version"`
SourceReportID string `json:"source_report_id"`
SourceContentHash string `json:"source_content_hash"`
Consumer string `json:"consumer"`
Downgraded bool `json:"downgraded"`
OmittedFieldFamilies []string `json:"omitted_field_families,omitempty"`
Redactions []RedactionProvenance `json:"redactions,omitempty"`
}
type RedactionProvenance ¶
type Registry ¶
type Registry struct {
SchemaVersion string `json:"schema_version"`
Compatibility string `json:"compatibility"`
Fields []RegistryField `json:"fields"`
Reports []RegistryReport `json:"reports,omitempty"`
}
func FilterRegistry ¶
func FilterRegistry(registry Registry, filter RegistryFilter) Registry
func RegistryV1 ¶
func RegistryV1() Registry
type RegistryField ¶
type RegistryField struct {
ID string `json:"id"`
Description string `json:"description"`
Required bool `json:"required"`
FieldFamily string `json:"field_family"`
EnumValues []string `json:"enum_values,omitempty"`
Deprecated bool `json:"deprecated"`
DeprecationReason string `json:"deprecation_reason,omitempty"`
}
type RegistryFilter ¶
Click to show internal directories.
Click to hide internal directories.