Documentation
¶
Overview ¶
Package actioncontracts builds portable, report-only proposed Action Contract envelopes from a completed saved Wrkr scan. It does not rescan, score, invoke a network service, or change saved state.
Index ¶
- Constants
- func BuildPacket(snapshot state.Snapshot, options BuildOptions) (report.ActionContractPacket, error)
- func Filename(artifact Artifact) string
- func VerifyArtifact(artifact Artifact) error
- func Write(collection Collection, outputDir string) ([]string, error)
- type Artifact
- type BuildOptions
- type Collection
- type ManifestItem
- type ProducerMetadata
- type VariantMetadata
Constants ¶
View Source
const ( SchemaID = "https://wrkr.dev/schemas/v1/proposed-action-contract-artifact.schema.json" SchemaVersion = "1" Producer = "wrkr" )
Variables ¶
This section is empty.
Functions ¶
func BuildPacket ¶
func BuildPacket(snapshot state.Snapshot, options BuildOptions) (report.ActionContractPacket, error)
BuildPacket builds the buyer projection from the exact normalized portable artifact selected for export. Packet rendering never rebuilds or rescans the proposed contract independently from the artifact path.
func VerifyArtifact ¶
VerifyArtifact validates the portable identity and embedded immutable contract before cross-product consumers receive the bytes.
Types ¶
type Artifact ¶
type Artifact struct {
SchemaID string `json:"schema_id"`
SchemaVersion string `json:"schema_version"`
ArtifactID string `json:"artifact_id"`
ContractID string `json:"contract_id"`
ContractFamilyID string `json:"contract_family_id"`
Revision int `json:"revision"`
Producer ProducerMetadata `json:"producer"`
SourceScanRefs []string `json:"source_scan_refs"`
CompositionRefs []string `json:"composition_refs"`
ResolutionKey string `json:"resolution_key,omitempty"`
CreationEvidence []string `json:"creation_evidence"`
CanonicalContentDigest string `json:"canonical_content_digest"`
Variant VariantMetadata `json:"variant"`
ReportOnly bool `json:"report_only"`
Contract risk.ProposedActionContract `json:"contract"`
}
Artifact deliberately has no creation timestamp. Presentation time belongs in the CLI manifest, never in the JCS content identity.
type BuildOptions ¶
type BuildOptions struct {
ContractID string
}
type Collection ¶
type Collection struct {
SchemaID string `json:"schema_id"`
SchemaVersion string `json:"schema_version"`
Artifacts []Artifact `json:"artifacts"`
Manifest []ManifestItem `json:"manifest"`
}
func Build ¶
func Build(snapshot state.Snapshot, options BuildOptions) (Collection, error)
type ManifestItem ¶
type ProducerMetadata ¶
type VariantMetadata ¶
type VariantMetadata struct {
Redacted bool `json:"redacted"`
}
Click to show internal directories.
Click to hide internal directories.