Help us shape the future of Go! Take the 2026 Go Developer Survey

query

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Package query exposes committed publication data to status, findings, excerpt, and report consumers. It never grants publication authority itself.

Index

Constants

View Source
const (
	InspectionReceiptVersion     = "mulgae-publication-receipt.v1"
	LiveInspectionReceiptVersion = "mulgae-publication-receipt.v2"
	FindingCursorVersion         = "mulgae-finding-cursor.v1"
	DefaultFindingPageSize       = 100
	MaxFindingPageSize           = 1000
	MaxVerifiedContentChunkBytes = 16 * 1024
)
View Source
const RequirementsReadVersion = "mulgae-requirements-read.v1"

Variables

This section is empty.

Functions

func DecodeFindingCursor added in v0.1.24

func DecodeFindingCursor(value string, expected FindingPageScope) (uint64, error)

func EncodeFindingCursor added in v0.1.24

func EncodeFindingCursor(scope FindingPageScope, offset uint64) (string, error)

EncodeFindingCursor is an integrity envelope, not a secret or authorization token. Consumers still verify the named publication and query on every page.

func EvidenceContentURI added in v0.1.24

func EvidenceContentURI(runID, findingID, target string, index int, binding, receipt, digest string, offset int64) string

func FindingDetailURI added in v0.1.24

func FindingDetailURI(runID, findingID, binding, receipt, digest string, offset int64) string

func FindingPageLimit added in v0.1.24

func FindingPageLimit(value int) (int, error)

func ReportContentURI added in v0.1.24

func ReportContentURI(runID, role, binding, receipt, digest string, offset int64) string

func RequirementContentURI added in v0.1.26

func RequirementContentURI(runID, id, binding, receipt, digest string, offset int64) string

func SourceEvidenceContentURI added in v0.1.25

func SourceEvidenceContentURI(runID, findingID, source string, index int, binding, receipt, digest string, offset int64) string

func SourceImageContentURI added in v0.1.25

func SourceImageContentURI(runID, source, side, path, binding, receipt, digest string, offset int64) string

Types

type AttemptSummary added in v0.1.19

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

AttemptSummary is one schema- and semantics-verified manifest attempt.

func (AttemptSummary) AttemptID added in v0.1.19

func (attempt AttemptSummary) AttemptID() domain.AttemptID

func (AttemptSummary) ProviderInstance added in v0.1.19

func (attempt AttemptSummary) ProviderInstance() string

func (AttemptSummary) Role added in v0.1.19

func (attempt AttemptSummary) Role() domain.Role

func (AttemptSummary) State added in v0.1.19

func (attempt AttemptSummary) State() domain.AttemptState

type CommittedAttempt

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

CommittedAttempt is the unique P2-bound source projection for one attempt.

func (CommittedAttempt) AttemptID

func (attempt CommittedAttempt) AttemptID() domain.AttemptID

func (CommittedAttempt) Prompt

func (attempt CommittedAttempt) Prompt() RuntimePrompt

func (CommittedAttempt) Provider

func (attempt CommittedAttempt) Provider() string

func (CommittedAttempt) ReviewID

func (attempt CommittedAttempt) ReviewID() domain.ReviewID

func (CommittedAttempt) Role

func (attempt CommittedAttempt) Role() domain.Role

func (CommittedAttempt) RunID

func (attempt CommittedAttempt) RunID() domain.RunID

func (CommittedAttempt) SessionID

func (attempt CommittedAttempt) SessionID() domain.SessionID

func (CommittedAttempt) Target

func (attempt CommittedAttempt) Target() RuntimeTarget

type CommittedFindingSource

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

CommittedFindingSource contains the exact P2 support artifacts bound to a committed finding. All byte accessors return defensive copies.

func (CommittedFindingSource) Excerpt

func (source CommittedFindingSource) Excerpt() []byte

func (CommittedFindingSource) Finding

func (source CommittedFindingSource) Finding() Finding

func (CommittedFindingSource) Normalized

func (source CommittedFindingSource) Normalized() []byte

func (CommittedFindingSource) Review

func (source CommittedFindingSource) Review() CommittedReview

type CommittedLineage

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

CommittedLineage is the canonical immutable lineage projection for a committed review.

func (CommittedLineage) ParentRunID

func (lineage CommittedLineage) ParentRunID() (domain.RunID, bool)

ParentRunID returns the parent run identity for a child review.

func (CommittedLineage) ReplayMode

func (lineage CommittedLineage) ReplayMode() (ReplayMode, bool)

ReplayMode returns the replay authority mode for a rerun review.

func (CommittedLineage) SourceAttemptID added in v0.1.19

func (lineage CommittedLineage) SourceAttemptID() (domain.AttemptID, bool)

SourceAttemptID returns the exact rerun source attempt when recorded by the publication. Legacy reruns may not carry this optional compatibility field.

func (CommittedLineage) SourceFindingRef

func (lineage CommittedLineage) SourceFindingRef() (string, bool)

SourceFindingRef returns the source finding reference for a followup review.

func (CommittedLineage) SourceRecoveryManifestSHA256 added in v0.1.20

func (lineage CommittedLineage) SourceRecoveryManifestSHA256() (string, bool)

func (CommittedLineage) SourceReviewID

func (lineage CommittedLineage) SourceReviewID() (domain.ReviewID, bool)

SourceReviewID returns the source review identity for a child review.

func (CommittedLineage) SourceRunID

func (lineage CommittedLineage) SourceRunID() (domain.RunID, bool)

SourceRunID returns the source run identity for a child review.

type CommittedReview

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

CommittedReview is a defensive read view of a semantically verified P2 final review. Exact final and manifest bytes remain available only as copies.

func (CommittedReview) Attempts added in v0.1.19

func (review CommittedReview) Attempts() []AttemptSummary

Attempts returns the verified manifest attempt inventory in committed order.

func (CommittedReview) CIDecision

func (review CommittedReview) CIDecision() domain.CIDecision

CIDecision returns the independent committed CI axis.

func (CommittedReview) ContentVerdict

func (review CommittedReview) ContentVerdict() domain.ContentVerdict

ContentVerdict returns the independent committed content axis.

func (CommittedReview) CoverageStatus

func (review CommittedReview) CoverageStatus() domain.CoverageStatus

CoverageStatus returns the independent committed coverage axis.

func (CommittedReview) Epoch

func (review CommittedReview) Epoch() uint64

Epoch returns the positive immutable publication epoch.

func (CommittedReview) EpochPath

func (review CommittedReview) EpochPath() ports.SafeRelativePath

EpochPath returns the immutable epoch record path bound by the manifest.

func (CommittedReview) FinalBytes

func (review CommittedReview) FinalBytes() []byte

FinalBytes returns a caller-owned copy of the exact final artifact bytes.

func (CommittedReview) FinalPath

func (review CommittedReview) FinalPath() ports.SafeRelativePath

FinalPath returns the authoritative P2 final artifact path.

func (CommittedReview) FinalSHA256

func (review CommittedReview) FinalSHA256() string

FinalSHA256 returns the authoritative P2 final artifact digest.

func (CommittedReview) Findings

func (review CommittedReview) Findings() []Finding

Findings returns caller-owned finding views in final artifact order.

func (CommittedReview) FollowupOutcome

func (review CommittedReview) FollowupOutcome() (FollowupOutcome, bool)

FollowupOutcome returns the committed followup resolution only for followup reviews. Its rationale and evidence are validated final/manifest data.

func (CommittedReview) Lineage

func (review CommittedReview) Lineage() CommittedLineage

Lineage returns the immutable, semantically verified run lineage.

func (CommittedReview) LineageEdgePath

func (review CommittedReview) LineageEdgePath() ports.SafeRelativePath

LineageEdgePath returns the immutable lineage edge path bound by the final.

func (CommittedReview) LineageEdgeSHA256

func (review CommittedReview) LineageEdgeSHA256() string

LineageEdgeSHA256 returns the immutable lineage edge digest bound by the final.

func (CommittedReview) LiveSource added in v0.1.25

func (review CommittedReview) LiveSource() (evidence.LiveSourceRead, bool)

func (CommittedReview) ManifestBytes

func (review CommittedReview) ManifestBytes() []byte

ManifestBytes returns a caller-owned copy of the exact committed manifest bytes.

func (CommittedReview) ManifestPath

func (review CommittedReview) ManifestPath() ports.SafeRelativePath

ManifestPath returns the immutable committed manifest path.

func (CommittedReview) ManifestSHA256

func (review CommittedReview) ManifestSHA256() string

ManifestSHA256 returns the immutable committed manifest digest.

func (CommittedReview) PublicationStatus

func (review CommittedReview) PublicationStatus() domain.PublicationStatus

PublicationStatus returns the committed publication axis.

func (CommittedReview) RequestChangesThreshold added in v0.1.19

func (review CommittedReview) RequestChangesThreshold() domain.Severity

RequestChangesThreshold returns the verified threshold persisted by the review.

func (CommittedReview) RequirementsEvaluation added in v0.1.26

func (review CommittedReview) RequirementsEvaluation() domain.RequirementEvaluation

func (CommittedReview) ReviewID

func (review CommittedReview) ReviewID() domain.ReviewID

ReviewID returns the publisher-issued review identity.

func (CommittedReview) RoleReports added in v0.1.4

func (review CommittedReview) RoleReports() []RoleReport

RoleReports returns caller-owned committed role-report inventory entries.

func (CommittedReview) Roles

func (review CommittedReview) Roles() []Role

Roles returns caller-owned role views in final artifact order.

func (CommittedReview) RunID

func (review CommittedReview) RunID() domain.RunID

RunID returns the committed review's run identity.

func (CommittedReview) RunState

func (review CommittedReview) RunState() domain.RunState

RunState returns the terminal run state recorded in the committed manifest.

func (CommittedReview) RunType added in v0.1.19

func (review CommittedReview) RunType() domain.RunType

RunType returns the verified immutable run type.

func (CommittedReview) SessionID

func (review CommittedReview) SessionID() domain.SessionID

SessionID returns the committed review's session identity.

func (CommittedReview) SourceIdentitySHA256 added in v0.1.25

func (review CommittedReview) SourceIdentitySHA256() string

func (CommittedReview) StructuredExtractionStatus added in v0.1.4

func (review CommittedReview) StructuredExtractionStatus() domain.StructuredExtractionStatus

StructuredExtractionStatus returns the independent committed extraction axis.

func (CommittedReview) TargetSHA256

func (review CommittedReview) TargetSHA256() string

TargetSHA256 returns the canonical current target digest bound by the final.

type ContentChunk added in v0.1.24

type ContentChunk struct {
	RequirementID      string `json:"requirement_id,omitempty"`
	PublicationReceipt string `json:"publication_receipt"`
	ContentSHA256      string `json:"content_sha256"`
	MediaType          string `json:"media_type"`
	Encoding           string `json:"encoding"`
	Offset             int64  `json:"offset"`
	TotalBytes         int64  `json:"total_bytes"`
	ReturnedBytes      int64  `json:"returned_bytes"`
	NextOffset         *int64 `json:"next_offset"`
	Content            string `json:"content"`
	RunID              string `json:"run_id"`
	FindingID          string `json:"finding_id,omitempty"`
	Role               string `json:"role,omitempty"`
	EvidenceIndex      *int   `json:"evidence_index,omitempty"`
}

func NewContentChunk added in v0.1.24

func NewContentChunk(data []byte, mediaType string, text bool, receipt domain.PublicationReceipt, continuation ContentContinuation) (ContentChunk, error)

NewContentChunk binds every continuation to complete content and publication.

type ContentContinuation added in v0.1.24

type ContentContinuation struct {
	Offset             int64
	PublicationReceipt string
	ContentSHA256      string
}

ContentContinuation validates an exact byte-offset continuation. The service additionally checks an issued boundary, total size, and the observed identities. No total-content ceiling is derived from the per-response chunk bound.

func (ContentContinuation) Check added in v0.1.24

func (continuation ContentContinuation) Check(receipt domain.PublicationReceipt, contentSHA256 string) error

func (ContentContinuation) Validate added in v0.1.24

func (continuation ContentContinuation) Validate() error

type ContentReader added in v0.1.24

type ContentReader interface {
	ReadCommitted(context.Context, ports.PublicationRun) (CommittedReview, error)
	RenderExcerptAt(context.Context, ports.PublicationRun, string, string, int) ([]byte, error)
}

ContentReader confines an existing report renderer to one verified snapshot.

type Evidence

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

Evidence binds one source identity to one current immutable-target claim.

func (Evidence) CopiedAvailability added in v0.1.24

func (item Evidence) CopiedAvailability() string

CopiedAvailability reports verified or evidence_unavailable only for a composite claim whose copied support metadata has been independently verified. Ordinary review claims return an empty string and require a fresh excerpt read.

func (Evidence) CurrentExcerptSHA256

func (item Evidence) CurrentExcerptSHA256() string

CurrentExcerptSHA256 returns the current verified excerpt digest.

func (Evidence) LineEnd

func (item Evidence) LineEnd() int

LineEnd returns the inclusive one-based final line.

func (Evidence) LineStart

func (item Evidence) LineStart() int

LineStart returns the inclusive one-based first line.

func (Evidence) Path

func (item Evidence) Path() ports.SafeRelativePath

Path returns the logical target path.

func (Evidence) Side

func (item Evidence) Side() evidence.Side

Side returns the claimed immutable target side.

func (Evidence) SourceExcerptSHA256

func (item Evidence) SourceExcerptSHA256() string

SourceExcerptSHA256 returns the source excerpt digest.

func (Evidence) SourceFindingID

func (item Evidence) SourceFindingID() string

SourceFindingID returns the source finding reference.

func (Evidence) SourceIdentitySHA256 added in v0.1.25

func (item Evidence) SourceIdentitySHA256() string

func (Evidence) SourceReviewID

func (item Evidence) SourceReviewID() domain.ReviewID

SourceReviewID returns the source review identity.

func (Evidence) SourceRunID

func (item Evidence) SourceRunID() domain.RunID

SourceRunID returns the source review run identity.

func (Evidence) SourceSessionID

func (item Evidence) SourceSessionID() domain.SessionID

SourceSessionID returns the source review session identity.

func (Evidence) SourceTargetSHA256

func (item Evidence) SourceTargetSHA256() string

SourceTargetSHA256 returns the source immutable target digest.

func (Evidence) TargetSHA256

func (item Evidence) TargetSHA256() string

TargetSHA256 returns the current immutable target digest.

func (Evidence) Verification

func (item Evidence) Verification() evidence.ReceiptStatus

Verification returns the evidence verification state. A composite claim with no copied evidence is unverifiable.

type Finding

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

Finding is one immutable report-facing finding. Evidence carries claims only; callers must use RenderExcerpt to obtain freshly verified bytes.

func (Finding) Confidence

func (finding Finding) Confidence() domain.Confidence

Confidence returns the normalized confidence.

func (Finding) Description

func (finding Finding) Description() string

Description returns the finding explanation.

func (Finding) Evidence

func (finding Finding) Evidence() []Evidence

Evidence returns caller-owned evidence claim views in final artifact order.

func (Finding) Fingerprint

func (finding Finding) Fingerprint() string

Fingerprint returns the canonical finding fingerprint digest.

func (Finding) ID

func (finding Finding) ID() string

ID returns the final deterministic finding ID.

func (Finding) Lifecycle

func (finding Finding) Lifecycle() domain.FindingLifecycle

Lifecycle returns the final finding lifecycle.

func (Finding) ProviderInstance

func (finding Finding) ProviderInstance() string

ProviderInstance returns the producing provider instance.

func (Finding) Recommendation

func (finding Finding) Recommendation() string

Recommendation returns the final recommendation.

func (Finding) Role

func (finding Finding) Role() domain.Role

Role returns the producing fixed Mulgae role.

func (Finding) Severity

func (finding Finding) Severity() domain.Severity

Severity returns the normalized severity.

func (Finding) Title

func (finding Finding) Title() string

Title returns the concise finding title.

type FindingEvidenceReference added in v0.1.24

type FindingEvidenceReference struct {
	Index        int    `json:"index"`
	URI          string `json:"uri"`
	Availability string `json:"availability"`
}

type FindingPageScope added in v0.1.24

type FindingPageScope struct {
	ProjectBinding     string `json:"project_binding"`
	PublicationReceipt string `json:"publication_receipt"`
	RunID              string `json:"run_id"`
	QueryKind          string `json:"query_kind"`
	MinimumSeverity    string `json:"minimum_severity"`
	Limit              int    `json:"limit"`
}

FindingPageScope contains every selector whose change invalidates a cursor. Limit is bound too: changing a page size starts a new explicit query.

func (FindingPageScope) Validate added in v0.1.24

func (scope FindingPageScope) Validate() error

type FindingSummary added in v0.1.24

type FindingSummary struct {
	ID                  string                     `json:"id"`
	Fingerprint         string                     `json:"fingerprint"`
	Role                string                     `json:"role"`
	Provider            string                     `json:"provider"`
	Severity            string                     `json:"severity"`
	Title               string                     `json:"title"`
	Confidence          string                     `json:"confidence"`
	Lifecycle           string                     `json:"lifecycle"`
	DetailURI           string                     `json:"detail_uri"`
	EvidenceResourceURI *string                    `json:"evidence_resource_uri"`
	Evidence            []FindingEvidenceReference `json:"evidence"`
}

type FollowupEvidence

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

FollowupEvidence is one immutable committed followup evidence claim.

func (FollowupEvidence) CurrentExcerptSHA256

func (item FollowupEvidence) CurrentExcerptSHA256() string

func (FollowupEvidence) LineEnd

func (item FollowupEvidence) LineEnd() int

func (FollowupEvidence) LineStart

func (item FollowupEvidence) LineStart() int

func (FollowupEvidence) Path

func (FollowupEvidence) Quote

func (item FollowupEvidence) Quote() string

func (FollowupEvidence) Side

func (item FollowupEvidence) Side() evidence.Side

func (FollowupEvidence) SourceExcerptSHA256

func (item FollowupEvidence) SourceExcerptSHA256() string

func (FollowupEvidence) SourceFindingID

func (item FollowupEvidence) SourceFindingID() string

func (FollowupEvidence) SourceReviewID

func (item FollowupEvidence) SourceReviewID() domain.ReviewID

func (FollowupEvidence) SourceRunID

func (item FollowupEvidence) SourceRunID() domain.RunID

func (FollowupEvidence) SourceSessionID

func (item FollowupEvidence) SourceSessionID() domain.SessionID

func (FollowupEvidence) SourceTargetSHA256

func (item FollowupEvidence) SourceTargetSHA256() string

func (FollowupEvidence) TargetSHA256

func (item FollowupEvidence) TargetSHA256() string

func (FollowupEvidence) Verification

func (item FollowupEvidence) Verification() evidence.ReceiptStatus

type FollowupOutcome

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

FollowupOutcome is the immutable committed resolution for a followup review.

func (FollowupOutcome) Evidence

func (outcome FollowupOutcome) Evidence() []FollowupEvidence

Evidence returns caller-owned committed followup evidence in final order.

func (FollowupOutcome) Rationale

func (outcome FollowupOutcome) Rationale() string

Rationale returns the committed followup rationale.

func (FollowupOutcome) Resolution

func (outcome FollowupOutcome) Resolution() domain.FollowupResolution

Resolution returns the validator-owned followup resolution.

type Inspection added in v0.1.24

type Inspection struct {
	Requirements               *RequirementsRead        `json:"requirements"`
	RequirementContentURIs     map[string]string        `json:"requirement_content_uris"`
	FailedRunRecovery          recovery.Status          `json:"failed_run_recovery"`
	SessionID                  string                   `json:"session_id"`
	RunID                      string                   `json:"run_id"`
	ReviewID                   string                   `json:"review_id"`
	RunType                    string                   `json:"run_type"`
	RunState                   string                   `json:"run_state"`
	PublicationState           string                   `json:"publication_state"`
	PublicationAuthority       string                   `json:"publication_authority"`
	RecoveryAction             string                   `json:"recovery_action"`
	ContentVerdict             string                   `json:"content_verdict"`
	CoverageStatus             string                   `json:"coverage_status"`
	StructuredExtractionStatus string                   `json:"structured_extraction_status"`
	CIDecision                 string                   `json:"ci_decision"`
	TargetSHA256               string                   `json:"target_sha256"`
	SourceIdentitySHA256       string                   `json:"source_identity_sha256,omitempty"`
	ReviewArtifactURI          string                   `json:"review_artifact_uri"`
	PublicationReceipt         string                   `json:"publication_receipt"`
	Receipt                    *InspectionReceipt       `json:"receipt"`
	CaptureIdentity            string                   `json:"capture_identity"`
	CaptureAvailability        string                   `json:"capture_availability"`
	Capabilities               VerifiedReadCapabilities `json:"capabilities"`
	RoleReports                []InspectionRoleReport   `json:"role_reports"`
	MinimumSeverity            string                   `json:"minimum_severity"`
	FindingCount               int                      `json:"finding_count"`
	ReturnedCount              int                      `json:"returned_count"`
	Findings                   []FindingSummary         `json:"findings"`
	NextCursor                 string                   `json:"next_cursor"`
	DiagnosticOnly             bool                     `json:"diagnostic_only"`
}

Inspection contains only values derived from the same verified observation. Diagnostic-only observations never carry a publication receipt or content references.

type InspectionReceipt added in v0.1.24

type InspectionReceipt struct {
	SchemaVersion        string `json:"schema_version"`
	ProjectBinding       string `json:"project_binding"`
	SessionID            string `json:"session_id"`
	RunID                string `json:"run_id"`
	ReviewID             string `json:"review_id"`
	RunType              string `json:"run_type"`
	TargetSHA256         string `json:"target_sha256,omitempty"`
	SourceIdentitySHA256 string `json:"source_identity_sha256,omitempty"`
	FinalSHA256          string `json:"final_sha256"`
	ManifestSHA256       string `json:"manifest_sha256"`
	SupportSHA256        string `json:"support_sha256"`
	LineageSHA256        string `json:"lineage_sha256"`
	Epoch                uint64 `json:"epoch"`
	CaptureIdentity      string `json:"capture_identity"`
	CaptureAvailability  string `json:"capture_availability"`
}

InspectionReceipt binds one already verified publication and its support. Construction does not read storage or confer publication authority. The query service must verify and reobserve the complete P2 snapshot before returning it.

func DecodeInspectionReceipt added in v0.1.24

func DecodeInspectionReceipt(data []byte) (InspectionReceipt, error)

func (InspectionReceipt) Identity added in v0.1.24

func (receipt InspectionReceipt) Identity() (domain.PublicationReceipt, error)

type InspectionRequest added in v0.1.24

type InspectionRequest struct {
	RequirementsLimit          int
	RequirementsCursor         string
	QueryKind                  string
	MinimumSeverity            domain.Severity
	Limit                      int
	Cursor                     string
	ExpectedPublicationReceipt string
}

InspectionRequest selects one publication and a page within its canonical order.

type InspectionRoleReport added in v0.1.24

type InspectionRoleReport struct {
	Role       string `json:"role"`
	URI        string `json:"uri"`
	SHA256     string `json:"sha256"`
	ByteLength int    `json:"byte_length"`
}

type ProjectContext added in v0.1.24

type ProjectContext struct {
	ProjectBinding string                   `json:"project_binding"`
	Capabilities   VerifiedReadCapabilities `json:"capabilities"`
}

ProjectContext contains only public identity and implemented capabilities.

type ProjectContextService added in v0.1.24

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

ProjectContextService has no configuration, provider, or publication ports.

func NewProjectContextService added in v0.1.24

func NewProjectContextService(observer ports.ProjectBindingObserver) (*ProjectContextService, error)

func (*ProjectContextService) Open added in v0.1.24

Open pins a server's startup anchors. The owner must close the lease at shutdown.

func (*ProjectContextService) Read added in v0.1.24

func (service *ProjectContextService) Read(ctx context.Context, root ports.AnchoredRoot) (result ProjectContext, err error)

Read independently observes the requested root, without retaining server state.

func (*ProjectContextService) ReadLease added in v0.1.24

ReadLease fails closed when the startup anchors have moved or been replaced.

type ReadContractError added in v0.1.24

type ReadContractError string
const (
	ErrPublicationReceiptMismatch ReadContractError = "publication_receipt_mismatch"
	ErrCursorInvalid              ReadContractError = "cursor_invalid"
	ErrCursorMismatch             ReadContractError = "cursor_mismatch"
	ErrContentDigestMismatch      ReadContractError = "content_digest_mismatch"
	ErrReadContinuationIncomplete ReadContractError = "read_continuation_incomplete"
)
const ErrSourceReplayUnavailable ReadContractError = "source_replay_unavailable"

ErrSourceReplayUnavailable is explicit absence of retained source/replay authority. Stored observations remain readable through their P2 receipt.

func (ReadContractError) Error added in v0.1.24

func (err ReadContractError) Error() string

type ReplayMode

type ReplayMode string

ReplayMode is the validated prompt authority mode for a rerun.

const (
	ReplayModeExact     ReplayMode = "exact"
	ReplayModeRecompose ReplayMode = "recompose"
)

type RequirementContentReader added in v0.1.26

type RequirementContentReader interface {
	ReadRequirementContent(context.Context, ports.PublicationRun, string) ([]byte, error)
}

RequirementContentReader serves exact retained content within the same verified snapshot used by a report renderer, without starting another public read.

type RequirementItem added in v0.1.26

type RequirementItem struct {
	RequirementID     string                    `json:"requirement_id"`
	OwnerRole         domain.Role               `json:"owner_role"`
	Verdict           domain.RequirementVerdict `json:"verdict"`
	Origin            domain.AssessmentOrigin   `json:"origin"`
	Reason            domain.AssessmentReason   `json:"reason"`
	ContentPath       string                    `json:"content_path"`
	ContentSHA256     string                    `json:"content_sha256"`
	ContentByteLength int64                     `json:"content_byte_length"`
}

type RequirementsRead added in v0.1.26

type RequirementsRead struct {
	SchemaVersion  string                        `json:"schema_version"`
	Receipt        InspectionReceipt             `json:"receipt"`
	Availability   domain.AssessmentAvailability `json:"availability"`
	InputSHA256    *string                       `json:"input_sha256"`
	SelectedCount  *int                          `json:"selected_count"`
	EvaluatedCount *int                          `json:"evaluated_count"`
	Items          []RequirementItem             `json:"items"`
	NextCursor     *string                       `json:"next_cursor"`
}

type Role

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

Role is the report-facing summary for one selected role.

func (Role) AttemptID

func (role Role) AttemptID() (domain.AttemptID, bool)

AttemptID returns the selected terminal attempt ID, when one exists.

func (Role) FailureReason

func (role Role) FailureReason() (string, bool)

FailureReason returns the terminal failure reason, when one exists.

func (Role) Limitations

func (role Role) Limitations() []string

Limitations returns a caller-owned copy of the role limitations.

func (Role) Name

func (role Role) Name() domain.Role

Name returns the fixed Mulgae role.

func (Role) Outcome

func (role Role) Outcome() string

Outcome returns completed, degraded, failed, or skipped as serialized.

func (Role) ProviderInstance

func (role Role) ProviderInstance() (string, bool)

ProviderInstance returns the selected provider instance, when one exists.

func (Role) ReportsOnly added in v0.1.4

func (role Role) ReportsOnly() bool

ReportsOnly reports whether the selected terminal attempt was free-form reports-only rather than validated structured extraction.

func (Role) Required

func (role Role) Required() bool

Required reports whether the role was required for coverage.

func (Role) SelectedVia

func (role Role) SelectedVia() (string, bool)

SelectedVia returns primary or fallback, when one exists.

func (Role) ValidFindingIDs

func (role Role) ValidFindingIDs() []string

ValidFindingIDs returns a caller-owned copy of the role's finding references.

type RoleReport added in v0.1.4

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

RoleReport is one verified committed free-form role-report inventory entry.

func (RoleReport) AttemptID added in v0.1.4

func (report RoleReport) AttemptID() string

AttemptID returns the selected attempt identity.

func (RoleReport) ByteLength added in v0.1.4

func (report RoleReport) ByteLength() int

ByteLength returns the committed report byte length.

func (RoleReport) ContentType added in v0.1.4

func (report RoleReport) ContentType() string

ContentType returns the committed report media type.

func (RoleReport) Path added in v0.1.4

func (report RoleReport) Path() string

Path returns the run-relative role-report path.

func (RoleReport) ProviderInstance added in v0.1.4

func (report RoleReport) ProviderInstance() string

ProviderInstance returns the selected provider instance.

func (RoleReport) Role added in v0.1.4

func (report RoleReport) Role() string

Role returns the selected Mulgae role for this report.

func (RoleReport) SHA256 added in v0.1.4

func (report RoleReport) SHA256() string

SHA256 returns the committed report digest.

type RoleReportURI added in v0.1.4

type RoleReportURI struct {
	Role string
	URI  string
}

RoleReportURI is one project-relative role-report identity exposed only after independent P2 support-index and artifact verification.

type RunStatus

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

RunStatus is the safe status projection of one observed run. Content and final artifact details are present only after an independent P2 committed read. RoleReportURIs are present only after support-indexed artifact verification.

func (RunStatus) Authority

func (status RunStatus) Authority() domain.PublicationAuthority

Authority returns the classifier-derived durable authority.

func (RunStatus) CIDecision

func (status RunStatus) CIDecision() (domain.CIDecision, bool)

CIDecision returns a committed final axis only when safely available.

func (RunStatus) ContentVerdict

func (status RunStatus) ContentVerdict() (domain.ContentVerdict, bool)

ContentVerdict returns a committed final axis only when safely available.

func (RunStatus) CoverageStatus

func (status RunStatus) CoverageStatus() (domain.CoverageStatus, bool)

CoverageStatus returns a committed final axis only when safely available.

func (RunStatus) FailedRunRecovery added in v0.1.20

func (status RunStatus) FailedRunRecovery() recovery.Status

func (RunStatus) FinalPath

func (status RunStatus) FinalPath() (ports.SafeRelativePath, bool)

FinalPath returns a P2 final path only after the committed review passed all schema and semantic checks.

func (RunStatus) PublicationStatus

func (status RunStatus) PublicationStatus() domain.PublicationStatus

PublicationStatus returns the classifier-derived publication status.

func (RunStatus) RecoveryAction

func (status RunStatus) RecoveryAction() domain.RecoveryAction

RecoveryAction returns the classifier-derived next recovery action.

func (RunStatus) RoleReportURIs added in v0.1.4

func (status RunStatus) RoleReportURIs() []RoleReportURI

RoleReportURIs returns caller-owned project-relative role-report identities only after independent P2 support verification. Non-P2 and corrupt status always return none.

func (RunStatus) RunID

func (status RunStatus) RunID() domain.RunID

RunID returns the observed run identity.

func (RunStatus) RunState

func (status RunStatus) RunState() (domain.RunState, bool)

RunState returns a state from an independently verified publication or failed-run recovery manifest. Failed recovery does not grant final-review authority.

func (RunStatus) SessionID

func (status RunStatus) SessionID() domain.SessionID

SessionID returns the observed session identity.

type RuntimePrompt

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

RuntimePrompt is exact persisted replay material from one initial invocation.

func (RuntimePrompt) AdapterParameters

func (prompt RuntimePrompt) AdapterParameters() map[string]string

func (RuntimePrompt) AdapterProfile

func (prompt RuntimePrompt) AdapterProfile() string

func (RuntimePrompt) CompleteStdinSHA256

func (prompt RuntimePrompt) CompleteStdinSHA256() string

func (RuntimePrompt) ExecutionInvocationID

func (prompt RuntimePrompt) ExecutionInvocationID() string

func (RuntimePrompt) ManifestPath

func (prompt RuntimePrompt) ManifestPath() ports.SafeRelativePath

func (RuntimePrompt) ManifestSHA256

func (prompt RuntimePrompt) ManifestSHA256() string

func (RuntimePrompt) Role

func (prompt RuntimePrompt) Role() domain.Role

func (RuntimePrompt) Scope

func (prompt RuntimePrompt) Scope() string

func (RuntimePrompt) SourceInvocationID

func (prompt RuntimePrompt) SourceInvocationID() string

func (RuntimePrompt) Stdin

func (prompt RuntimePrompt) Stdin() []byte

func (RuntimePrompt) StdinSHA256

func (prompt RuntimePrompt) StdinSHA256() string

func (RuntimePrompt) TemplateID

func (prompt RuntimePrompt) TemplateID() string

func (RuntimePrompt) TemplateSHA256

func (prompt RuntimePrompt) TemplateSHA256() string

func (RuntimePrompt) TemplateVersion

func (prompt RuntimePrompt) TemplateVersion() string

type RuntimeTarget

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

RuntimeTarget is the immutable target material reconstructed from a committed P2 target manifest. Its bytes and identity are returned as defensive copies.

func (RuntimeTarget) ArtistBrief added in v0.1.26

func (target RuntimeTarget) ArtistBrief() ([]byte, bool)

ArtistBrief returns the exactly retained brief bytes when the runtime target manifest binds an artist brief.

func (RuntimeTarget) ArtistVisualAssets added in v0.1.26

func (target RuntimeTarget) ArtistVisualAssets() ([]byte, bool)

ArtistVisualAssets returns the exactly retained artist visual manifest bytes when the runtime target manifest binds one.

func (RuntimeTarget) Bytes

func (target RuntimeTarget) Bytes() []byte

func (RuntimeTarget) CapturedArchive

func (target RuntimeTarget) CapturedArchive() []byte

func (RuntimeTarget) Identity

func (target RuntimeTarget) Identity() domain.TargetIdentity

type SchemaValidator

type SchemaValidator interface {
	Validate(context.Context, ports.AssetID, []byte) error
}

SchemaValidator validates final publication records against their consumer-owned embedded schema asset.

type Service

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

Service reads only physically safe P2 snapshots, then independently verifies their schema and semantic identities before exposing consumer-facing views.

func NewService

func NewService(
	store ports.PublicationStore,
	validator SchemaValidator,
	_ evidence.ImmutableTargetReader,
	maxReadBytes int64,
) (*Service, error)

NewService constructs the shared committed-read service. The immutable target reader remains an accepted dependency for source compatibility, but v2 publications require their own durable excerpts and never fall back to it.

func (*Service) Inspect added in v0.1.24

func (service *Service) Inspect(ctx context.Context, run ports.PublicationRun, binding domain.ProjectBinding, request InspectionRequest) (Inspection, error)

Inspect verifies one committed snapshot, its support, and its final P2 observation. The caller retains and revalidates the descriptor lease that supplied binding.

func (*Service) ListFindings

func (service *Service) ListFindings(
	ctx context.Context,
	run ports.PublicationRun,
	minimum domain.Severity,
) ([]Finding, error)

ListFindings returns final-order findings at or above minimum severity. An empty minimum returns every committed finding, including informational ones.

func (*Service) ReadCommitted

func (service *Service) ReadCommitted(ctx context.Context, run ports.PublicationRun) (CommittedReview, error)

ReadCommitted returns a defensive view only when the observed P2 epoch binds the snapshot and remains unchanged under the call's final confirmation.

func (*Service) ReadCommittedAttempt

func (service *Service) ReadCommittedAttempt(ctx context.Context, run ports.PublicationRun, attemptID domain.AttemptID) (CommittedAttempt, error)

ReadCommittedAttempt reconstructs one exact-replay source attempt from P2. The only replay authority is the unique persisted initial prompt for that attempt; repair prompts are deliberately not candidates.

func (*Service) ReadCommittedFindingSource

func (service *Service) ReadCommittedFindingSource(ctx context.Context, run ports.PublicationRun, findingID string) (CommittedFindingSource, error)

ReadCommittedFindingSource rereads the final and manifest, then exposes only normalized finding and excerpt artifacts whose exact identities are bound by the manifest support index for one stable P2 finding.

func (*Service) ReadCommittedForComposition added in v0.1.19

func (service *Service) ReadCommittedForComposition(ctx context.Context, run ports.PublicationRun) (CommittedReview, error)

ReadCommittedForComposition verifies the exact P2 review together with its target and role-report support; the final confirmation covers any change made while that support was verified.

func (*Service) ReadCommittedRoleReport added in v0.1.19

func (service *Service) ReadCommittedRoleReport(ctx context.Context, run ports.PublicationRun, report RoleReport) ([]byte, error)

ReadCommittedRoleReport returns exact report bytes only after the report is bound by the committed manifest, support index, and a stable P2 observation.

func (*Service) ReadCompositionSupport added in v0.1.24

func (service *Service) ReadCompositionSupport(ctx context.Context, run ports.PublicationRun) (compositesupport.Material, error)

ReadCompositionSupport captures portable source provenance and verified evidence, then confirms the same publication supplied all copied material.

func (*Service) ReadEvidence added in v0.1.24

func (service *Service) ReadEvidence(ctx context.Context, run ports.PublicationRun, binding domain.ProjectBinding, findingID, target string, index int, continuation ContentContinuation) (ContentChunk, error)

ReadEvidence uses public zero-based indices and returns exact committed bytes.

func (*Service) ReadFailedRunRecovery added in v0.1.20

func (service *Service) ReadFailedRunRecovery(ctx context.Context, run ports.PublicationRun) (recovery.Snapshot, error)

ReadFailedRunRecovery is separate from every final-review query. An absent manifest may lead a caller to a P2 source; a corrupt recovery never may.

func (*Service) ReadFinding added in v0.1.24

func (service *Service) ReadFinding(ctx context.Context, run ports.PublicationRun, binding domain.ProjectBinding, findingID string, continuation ContentContinuation) (ContentChunk, error)

ReadFinding returns canonical complete finding JSON through bounded chunks.

func (*Service) ReadRecoveryCompositionProviders added in v0.1.24

func (service *Service) ReadRecoveryCompositionProviders(ctx context.Context, run ports.PublicationRun) ([]string, error)

ReadRecoveryCompositionProviders retains the same ancestry retirement policy used when admitting a failed-run recovery source.

func (*Service) ReadReport added in v0.1.24

func (service *Service) ReadReport(ctx context.Context, run ports.PublicationRun, binding domain.ProjectBinding, role string, continuation ContentContinuation, render func(context.Context, ContentReader) ([]byte, error)) (ContentChunk, error)

ReadReport returns an original role report or renders against the same receipt. The callback is the existing report service; query owns all storage observation.

func (*Service) ReadRequirement added in v0.1.26

func (service *Service) ReadRequirement(ctx context.Context, run ports.PublicationRun, binding domain.ProjectBinding, id string, continuation ContentContinuation) (ContentChunk, error)

func (*Service) ReadRunStatus

func (service *Service) ReadRunStatus(ctx context.Context, run ports.PublicationRun) (RunStatus, error)

ReadRunStatus returns classifier-derived status for every valid observation. P0 and P1 never cause a final snapshot read or expose a final path. A corrupt durable or semantic result returns a safe corrupt status with an artifact failure so callers can still render the non-sensitive status projection.

func (*Service) ReadRuntimeTarget

func (service *Service) ReadRuntimeTarget(ctx context.Context, run ports.PublicationRun) (RuntimeTarget, error)

ReadRuntimeTarget reconstructs target authority only from artifacts bound by a freshly verified P2 final. It never reads a working tree or mutable target.

func (*Service) ReadSourceEvidence added in v0.1.25

func (service *Service) ReadSourceEvidence(ctx context.Context, run ports.PublicationRun, binding domain.ProjectBinding, findingID, source string, index int, continuation ContentContinuation) (ContentChunk, error)

ReadSourceEvidence binds a stored text observation to selection metadata.

func (*Service) ReadSourceImage added in v0.1.25

func (service *Service) ReadSourceImage(ctx context.Context, run ports.PublicationRun, binding domain.ProjectBinding, source, side, path string, continuation ContentContinuation) (ContentChunk, error)

ReadSourceImage returns an indexed selected PNG/JPEG/WebP observation as binary content. The original source path is never opened on this read path.

func (*Service) ReadSourceImageArtifact added in v0.1.25

func (service *Service) ReadSourceImageArtifact(ctx context.Context, run ports.PublicationRun, finalSHA256, sourceSHA256, side, path string) (ports.ImmutablePublicationArtifact, error)

ReadSourceImageArtifact returns the complete retained raster for an offline export bound to an exact final identity. It does not read the original path.

func (*Service) RenderExcerpt

func (service *Service) RenderExcerpt(
	ctx context.Context,
	run ports.PublicationRun,
	findingID string,
	targetSHA256 string,
) ([]byte, error)

RenderExcerpt returns the first canonical committed evidence excerpt. Callers rendering multiple items must use RenderExcerptAt with its one-based index.

func (*Service) RenderExcerptAt

func (service *Service) RenderExcerptAt(
	ctx context.Context,
	run ports.PublicationRun,
	findingID string,
	targetSHA256 string,
	evidenceIndex int,
) ([]byte, error)

RenderExcerptAt returns one canonical committed evidence excerpt by its one-based canonical index.

func (*Service) ResolveCommittedAttempt

func (service *Service) ResolveCommittedAttempt(ctx context.Context, run ports.PublicationRun, role domain.Role, provider string) (CommittedAttempt, error)

ResolveCommittedAttempt selects exactly one manifest attempt by role and provider. It deliberately treats zero and multiple matches as artifact failures instead of relying on attempt order.

func (*Service) ResolveRun

func (service *Service) ResolveRun(
	ctx context.Context,
	root ports.AnchoredRoot,
	runID domain.RunID,
) (ports.PublicationRun, error)

ResolveRun resolves a caller-selected canonical run ID beneath an approved artifact root through the store boundary. It never scans artifact directories.

func (*Service) WithVerifiedSnapshot added in v0.1.26

func (service *Service) WithVerifiedSnapshot(ctx context.Context, run ports.PublicationRun, use func(context.Context, ContentReader) error) error

WithVerifiedSnapshot runs use against one query-owned, per-call verified snapshot of run. The committed snapshot, its whole-support verification and the retirement walk all complete before use runs — preserving the legacy render path's order — and every consumed publication is confirmed in dependency postorder before it returns.

type Status

type Status = RunStatus

Status is the report-facing alias for one safe run status projection.

type VerifiedReadCapabilities added in v0.1.24

type VerifiedReadCapabilities struct {
	RequirementsAssessment string `json:"requirements_assessment"`
	LiveSource             string `json:"live_source"`
	SourceEvidence         string `json:"source_evidence"`
	ProjectBinding         string `json:"project_binding"`
	ExecutionGuard         string `json:"execution_guard"`
	CaptureIdentity        string `json:"capture_identity"`
	Inspection             string `json:"inspection"`
	FindingPages           string `json:"finding_pages"`
	FindingDetails         string `json:"finding_details"`
	ReportContent          string `json:"report_content"`
	IndexedEvidence        string `json:"indexed_evidence"`
	CompositeEvidence      string `json:"composite_evidence"`
}

VerifiedReadCapabilities is a closed version advertisement. An empty field means unavailable; a consumer must not infer support from a binary version.

func ImplementedReadCapabilities added in v0.1.24

func ImplementedReadCapabilities() VerifiedReadCapabilities

ImplementedReadCapabilities advertises only wired native read contracts.

func (VerifiedReadCapabilities) Validate added in v0.1.24

func (capabilities VerifiedReadCapabilities) Validate() error

Jump to

Keyboard shortcuts

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