query

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 16 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) SourceFindingRef

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

SourceFindingRef returns the source finding reference for a followup review.

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) 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) 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) 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) SessionID

func (review CommittedReview) SessionID() domain.SessionID

SessionID returns the committed review's session identity.

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 Evidence

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

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

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) 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 final serialized evidence verification state.

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 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 ReplayMode

type ReplayMode string

ReplayMode is the validated prompt authority mode for a rerun.

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

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) 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 manifest-backed state only when a committed manifest was independently parsed and semantically verified.

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) 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) 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 P2 re-observation.

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) 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) 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.

type Status

type Status = RunStatus

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

Jump to

Keyboard shortcuts

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