proofreceiptsvc

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LiveCompilerVersion = "proof-live-metadata-compiler-v2"
	LivePolicyVersion   = "proof-live-metadata-policy-v2"
)
View Source
const (
	CompilerVersion = "proof-preview-compiler-v3"
	PolicyVersion   = "proof-preview-policy-v1"
)
View Source
const OperationalPolicyVersion = "proof-operational-structural-policy-v1"

Variables

View Source
var ErrObservationAuditUnavailable = xerror.New(xerror.KindUnavailable, "PROOF_OBSERVATION_AUDIT_UNAVAILABLE", "Proof observation audit unavailable")

Functions

func AuditObservationAccessRejected

func AuditObservationAccessRejected(ctx context.Context, events eventssvc.Service, scope ObservationScope, actor model.EventActor, action model.Action, resource model.Resource) (retErr error)

AuditObservationAccessRejected records the HTTP authorization boundary without constructing the admitted compiler or reading an observation target. The caller keeps its original denial response regardless of audit persistence outcome.

func AuditReceiptRead

func AuditReceiptRead(ctx context.Context, events eventssvc.Service, scope ObservationScope, actor model.EventActor, receipt slug.Slug) (retErr error)

AuditReceiptRead runs before the HTTP response exposes the protected receipt.

Types

type BindingResolver

type BindingResolver interface {
	ResolvePipelineDataSourceRefs(context.Context, slug.Slug, slug.Slug, slug.Slug, *pipelinespec.Pipeline) (*datasourcerefssvc.ResolvedPipeline, error)
}

type Compiler

type Compiler struct {
	// contains filtered or unexported fields
}

func (*Compiler) Compile

func (s *Compiler) Compile(ctx context.Context, orgSlug, candidateSlug slug.Slug) (*proofreceipts.Receipt, error)

func (*Compiler) Get

func (s *Compiler) Get(ctx context.Context, orgSlug, projectSlug, environmentSlug, receiptSlug slug.Slug) (*ReceiptDetail, error)

func (*Compiler) List

func (s *Compiler) List(ctx context.Context, orgSlug, projectSlug, environmentSlug slug.Slug, req model.ListRequest) (model.ListResponse[*ReceiptDetail], error)

type ContractValidator

type ContractValidator interface {
	ValidateRevision(context.Context, slug.Slug, slug.Slug, slug.Slug, slug.Slug, string) (*odcs.ConversionResult, error)
}

type DeploymentReader

type DeploymentReader interface {
	FindDeployment(context.Context, postgres.DBTX, slug.Slug, slug.Slug, slug.Slug, slug.Slug) (*pipelinesrepo.PipelineDeployment, error)
}

type EnvironmentSecretResolver

type EnvironmentSecretResolver interface {
	ResolveRuntimeSecrets(context.Context, slug.Slug, slug.Slug) ([]model.RuntimeSecretValue, error)
}
type LifecycleLink struct {
	Kind                   model.ProofLifecycleLinkKind
	Identifier             string
	LinkedAt               time.Time
	RetainUntil            time.Time
	Status                 string
	PipelineSlug           *slug.Slug
	RunSlug                *slug.Slug
	CurrentVersionSpecHash string
}

type LiveCompiler

type LiveCompiler struct {
	// contains filtered or unexported fields
}

LiveCompiler is a separately admitted path. The ordinary compiler never dispatches observations or silently upgrades cached evidence.

func NewLiveCompiler

func NewLiveCompiler(base *Compiler, ledger *proofevidencesvc.Ledger, sources datasources.Repository, operations queries.Repository, coordinator *proofevidencesvc.Coordinator, events eventrecorder.Recorder, publication ReceiptPublicationProducer, gitChecksEnabled bool) (*LiveCompiler, error)

func (*LiveCompiler) AuthorizeObservation

func (s *LiveCompiler) AuthorizeObservation(ctx context.Context, scope ObservationScope, actor slug.Slug, token, digest string) (out *ObservationJob, retErr error)

func (*LiveCompiler) CancelObservation

func (s *LiveCompiler) CancelObservation(ctx context.Context, scope ObservationScope, actor, jobSlug slug.Slug) (out *ObservationJob, retErr error)

func (*LiveCompiler) Compile

func (s *LiveCompiler) Compile(ctx context.Context, org, candidate slug.Slug) (*proofreceipts.Receipt, error)

Compile preserves admitted live receipts for provider re-requests. Live dispatch and receipt upgrades require explicit authorization and CompileObserved.

func (*LiveCompiler) CompileObserved

func (s *LiveCompiler) CompileObserved(ctx context.Context, scope ObservationScope, actor, candidate slug.Slug, jobs []slug.Slug) (out *proofreceipts.Receipt, retErr error)

func (*LiveCompiler) Get

func (s *LiveCompiler) Get(ctx context.Context, org, project, environment, receiptSlug slug.Slug) (*ReceiptDetail, error)

func (*LiveCompiler) GetObservation

func (s *LiveCompiler) GetObservation(ctx context.Context, scope ObservationScope, actor, job slug.Slug) (out *ObservationJob, retErr error)

func (*LiveCompiler) GetObservationPolicy

func (s *LiveCompiler) GetObservationPolicy(ctx context.Context, scope ObservationScope, actor slug.Slug) (out *ObservationPolicy, retErr error)

func (*LiveCompiler) List

func (s *LiveCompiler) List(ctx context.Context, org, project, environment slug.Slug, req model.ListRequest) (model.ListResponse[*ReceiptDetail], error)

func (*LiveCompiler) PrepareObservation

func (s *LiveCompiler) PrepareObservation(ctx context.Context, scope ObservationScope, actor, candidateSlug, stepSlug slug.Slug, target proofevidence.MetadataPlan) (out *ObservationPreview, retErr error)

PrepareObservation resolves a reviewable intent without reserving a job, decrypting a credential, or contacting a provider. HTTP owns user permissions.

func (*LiveCompiler) SetObservationPolicy

func (s *LiveCompiler) SetObservationPolicy(ctx context.Context, scope ObservationScope, actor slug.Slug, settings ObservationPolicySettings) (out *ObservationPolicy, retErr error)

type ObservationJob

type ObservationJob struct {
	Slug                  slug.Slug
	State                 string
	RequestDigest         string
	Deadline              time.Time
	CancellationRequested bool
	Outcome               *proofevidence.Outcome
}

ObservationJob exposes only the public status of retained evidence.

type ObservationPolicy

type ObservationPolicy struct {
	Version  string
	Settings ObservationPolicySettings
}

type ObservationPolicySettings

type ObservationPolicySettings struct {
	Enabled                            bool
	TimeoutSeconds, EvidenceTTLSeconds int
	MaxRequests, MaxRows, MaxBytes     int64
}

ObservationPolicySettings are per-connector cumulative bounds in a rolling hour. Fixed metadata routes, zero retries/cost, and one concurrent job are not editable.

type ObservationPreview

type ObservationPreview struct {
	IntentToken   string `json:"-"`
	RequestDigest string
	Request       proofevidence.Request      `json:"-"`
	Target        proofevidence.MetadataPlan `json:"-"`
	ExpiresAt     time.Time
}

type ObservationScope

type ObservationScope = proofobservations.Scope

ObservationScope selects a tenant's project environment without a persistence capability.

type OperationalCompiler

type OperationalCompiler struct {
	Service
	// contains filtered or unexported fields
}

OperationalCompiler admits structural checks and preserves historical receipts.

func (*OperationalCompiler) CompileOperational

func (s *OperationalCompiler) CompileOperational(ctx context.Context, scope ObservationScope, actor, sourceReceipt slug.Slug, selection OperationalSelection) (out *proofreceipts.Receipt, retErr error)

func (*OperationalCompiler) Get

func (s *OperationalCompiler) Get(ctx context.Context, org, project, environment, receipt slug.Slug) (*ReceiptDetail, error)

func (*OperationalCompiler) List

func (s *OperationalCompiler) List(ctx context.Context, org, project, environment slug.Slug, req model.ListRequest) (model.ListResponse[*ReceiptDetail], error)

type OperationalObservation

type OperationalObservation struct {
	Selection     OperationalSelection       `json:"selection"`
	Status        pipelinerun.CheckStatus    `json:"status"`
	ReasonCode    string                     `json:"reason_code"`
	ExpiresAt     time.Time                  `json:"expires_at"`
	Evidence      *pipelinerun.CheckEvidence `json:"evidence"`
	ReusedFromRun string                     `json:"reused_from_run"`
}

OperationalObservation contains only retained, safe check aggregates. The caller must load it through tenant-scoped storage, never from request data.

type OperationalSelection

type OperationalSelection = model.ProofOperationalSelection

type OperationalService

type OperationalService interface {
	Service
	CompileOperational(context.Context, ObservationScope, slug.Slug, slug.Slug, OperationalSelection) (*proofreceipts.Receipt, error)
}

type ReceiptDetail

type ReceiptDetail struct {
	OperationalAdmissionEnabled *bool
	OperationalEvidenceStatus   model.ProofOperationalEvidenceStatus
	OperationalCurrentVerdict   model.ProofVerdict
	Receipt                     model.ProofReceipt
	LifecycleLinks              []LifecycleLink
}

type ReceiptPublicationProducer

type ReceiptPublicationProducer interface {
	EnqueueProofReceipt(context.Context, postgres.DBTX, model.ProofReceipt) error
}

type SchemaReader

type SchemaReader interface {
	FindByDataSourceSlug(context.Context, postgres.DBTX, slug.Slug, slug.Slug) (*datasources.SchemaMetadata, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL