mulgae

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: 49 Imported by: 0

Documentation

Overview

Package mulgae parses the fixed Mulgae command line into immutable invocations.

Index

Constants

View Source
const MaxReportMarkdownBytes int64 = 8 << 20

MaxReportMarkdownBytes is the shared bound for rendered report projections.

Variables

View Source
var ErrAttemptSelectorUnavailable = errors.New("mulgae attempt selector unavailable")

ErrAttemptSelectorUnavailable marks a syntactically valid attempt selector that has no unique committed match.

View Source
var ErrProjectRootMismatch = errors.New("mulgae project root mismatch")

ErrProjectRootMismatch marks selector resolution attempted outside the canonical project root that owns Mulgae artifacts.

View Source
var ErrRunSelectorUnavailable = errors.New("mulgae run selector unavailable")

ErrRunSelectorUnavailable marks a syntactically valid run selector that has no committed match.

View Source
var ErrSelectorUnavailable = errors.New("mulgae selector unavailable")

ErrSelectorUnavailable marks a syntactically valid selector that has no unique match.

View Source
var ErrUsage = errors.New("mulgae usage error")

ErrUsage marks an argument error that the CLI must render with exit code 2.

Functions

This section is empty.

Types

type Application

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

Application is the executable foundation command surface. It owns no mutable process state and only reaches the filesystem, Git, and environment through the injected ports.

func NewApplication

func NewApplication(dependencies Dependencies) (*Application, error)

NewApplication constructs the foundation CLI application. Required dependencies are rejected before any command can execute. The online workflow trio is one authority capability; resolver, review, retention, and export capabilities are independently optional. Optional typed-nil dependencies are normalized.

func (*Application) PreflightReview added in v0.1.13

func (application *Application) PreflightReview(
	ctx context.Context,
	request ReviewRequest,
	projectRoot ports.AnchoredRoot,
) (ReviewPreflightResult, error)

PreflightReview captures and validates the execution-free review projection through the same configured authority used by the CLI.

func (*Application) Run

func (application *Application) Run(ctx context.Context, argv []string, canonicalDefaultRoot string) Result

Run parses and executes argv against canonicalDefaultRoot. It never returns raw adapter errors: machine output contains a validated envelope when the parser supplied a contract-valid request, while human failures use stderr.

func (*Application) StartReviewRun added in v0.1.13

func (application *Application) StartReviewRun(
	ctx context.Context,
	request ReviewRequest,
	projectRoot ports.AnchoredRoot,
) (ReviewRunResult, error)

StartReviewRun preserves the CLI review preparation, private publication root, execution, and terminal validation sequence for other local entrypoints.

type Availability

type Availability string

Availability describes whether a command is executable in the current milestone.

const (
	// AvailabilityFoundation identifies an executable foundation command.
	AvailabilityFoundation Availability = "foundation"
	// AvailabilityFutureMilestone identifies a recognized but unavailable command.
	AvailabilityFutureMilestone Availability = "future_milestone"
)

type CleanRequest

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

CleanRequest contains one immutable cleanup selection.

func (CleanRequest) All added in v0.1.10

func (request CleanRequest) All() bool

All reports whether every safely deletable terminal run was selected.

func (CleanRequest) DryRun added in v0.1.10

func (request CleanRequest) DryRun() bool

DryRun reports whether cleanup is observation-only.

func (CleanRequest) OlderThanDays added in v0.1.10

func (request CleanRequest) OlderThanDays() int64

OlderThanDays returns the selected whole-day age, or zero for --all.

type ConfigMode

type ConfigMode string

ConfigMode selects the configuration view returned by the config service.

const (
	// ConfigModeEffective selects the effective configuration view.
	ConfigModeEffective ConfigMode = "effective"
	// ConfigModeProvenance selects the provenance configuration view.
	ConfigModeProvenance ConfigMode = "provenance"
)

type ConfigRequest

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

ConfigRequest contains the executable configuration-selection fields.

func (ConfigRequest) Mode

func (request ConfigRequest) Mode() ConfigMode

Mode returns the requested configuration view.

func (ConfigRequest) ProjectRoot

func (request ConfigRequest) ProjectRoot() string

ProjectRoot returns the canonical project root selected for configuration.

type DeltaRequest

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

DeltaRequest contains the immutable source run, target, and roles.

func (DeltaRequest) Roles

func (request DeltaRequest) Roles() []string

Roles returns a caller-owned copy of the requested roles.

func (DeltaRequest) SourceRunID

func (request DeltaRequest) SourceRunID() string

SourceRunID returns the source run selected for the delta workflow.

func (DeltaRequest) Target

func (request DeltaRequest) Target() TargetRequest

Target returns the literal target request.

type DeltaRunService

type DeltaRunService interface {
	StartDeltaRun(context.Context, appdelta.StartRequest) (StartedRun, error)
}

DeltaRunService is the command-facing delta workflow boundary.

func NewDeltaRunService

func NewDeltaRunService(service *appdelta.Service) DeltaRunService

NewDeltaRunService adapts the delta application service to command wiring.

type Dependencies

type Dependencies struct {
	Clock                   ports.Clock
	RequestIDGenerator      RequestIDGenerator
	RequestResolver         RequestResolver
	Catalog                 ports.ContractCatalog
	JSONSchemaValidator     cli.SchemaValidator
	SecureWriter            ports.SecureFileWriter
	TrustedProjectReader    ports.TrustedProjectReader
	EnvironmentInspector    ports.EnvironmentInspector
	ProviderVersionObserver ports.ProviderVersionObserver
	Heartbeats              HeartbeatService
	PublicationQueries      PublicationQueryService
	DiagnosticQueries       ports.RuntimeDiagnosticQuery
	PublicationReports      PublicationReportService
	FollowupRuns            FollowupRunService
	ReviewRuns              ReviewRunService
	DeltaRuns               DeltaRunService
	Reruns                  RerunService
	Retention               RetentionService
	Exports                 RedactedExportService
	EvidenceReader          doctor.EvidenceReader
}

Dependencies are the explicit inward dependencies required by Application. The G006 query/report pair is optional for source compatibility, but it must be supplied as one complete pair. EvidenceReader is optional and absent authority evidence remains unverified.

func NewG008Dependencies

func NewG008Dependencies(composition G008Composition) (Dependencies, error)

NewG008Dependencies composes only G008 command capabilities. Callers merge its result with the independently constructed foundation Dependencies.

type DoctorRequest

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

DoctorRequest contains the executable doctor fields.

func (DoctorRequest) CheckPlatform

func (request DoctorRequest) CheckPlatform() bool

CheckPlatform reports the fixed platform-check selection.

func (DoctorRequest) CheckProviders

func (request DoctorRequest) CheckProviders() bool

CheckProviders reports the fixed provider-check selection.

func (DoctorRequest) ProjectRoot

func (request DoctorRequest) ProjectRoot() string

ProjectRoot returns the canonical project root selected for diagnosis.

type ExcerptRequest

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

ExcerptRequest contains the immutable evidence-excerpt fields.

func (ExcerptRequest) CurrentTargetSHA256

func (request ExcerptRequest) CurrentTargetSHA256() string

CurrentTargetSHA256 returns the immutable current-target integrity identifier.

func (ExcerptRequest) FindingID

func (request ExcerptRequest) FindingID() string

FindingID returns the selected canonical run-scoped finding ID.

func (ExcerptRequest) RunID

func (request ExcerptRequest) RunID() string

RunID returns the selected canonical review-run ID.

type ExportRequest

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

ExportRequest contains the immutable redacted export selection.

func (ExportRequest) OutputPath

func (request ExportRequest) OutputPath() string

OutputPath returns the safe relative export output path.

func (ExportRequest) Redacted

func (request ExportRequest) Redacted() bool

Redacted reports the schema-required redacted export mode.

func (ExportRequest) RunID

func (request ExportRequest) RunID() string

RunID returns the source run selected for export.

type FindingView

type FindingView struct {
	ID       string
	Severity domain.Severity
	Title    string
}

FindingView is one finding in the query service's preserved final order.

type FindingsRequest

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

FindingsRequest contains the immutable finding-query fields.

func (FindingsRequest) MinimumSeverity

func (request FindingsRequest) MinimumSeverity() domain.Severity

MinimumSeverity returns the inclusive severity threshold for the query.

func (FindingsRequest) RunID

func (request FindingsRequest) RunID() string

RunID returns the selected canonical review-run ID.

type FindingsView

type FindingsView struct {
	RunID             string
	Findings          []FindingView
	ReviewArtifactURI string
	TargetSHA256      string
}

FindingsView is a committed finding selection and its committed review URI.

type FollowupRequest

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

FollowupRequest contains the immutable source finding and target fields.

func (FollowupRequest) FindingID

func (request FollowupRequest) FindingID() string

FindingID returns the source finding selected for followup.

func (FollowupRequest) Objective

func (request FollowupRequest) Objective() (string, bool)

Objective returns the optional followup objective.

func (FollowupRequest) Role

func (request FollowupRequest) Role() (string, bool)

Role returns the optional followup role.

func (FollowupRequest) SourceRunID

func (request FollowupRequest) SourceRunID() string

SourceRunID returns the source run selected for the child workflow.

func (FollowupRequest) Target

func (request FollowupRequest) Target() TargetRequest

Target returns the literal target request.

type FollowupRunService

type FollowupRunService interface {
	StartFollowupRun(context.Context, appfollowup.Request) (StartedRun, error)
}

FollowupRunService is the command-facing followup workflow boundary.

func NewFollowupRunService

func NewFollowupRunService(service *appfollowup.Service) FollowupRunService

NewFollowupRunService adapts the followup application service to command wiring.

type G008Composition

type G008Composition struct {
	ArtifactRoot         ports.AnchoredRoot
	Queries              *appquery.Service
	RequestResolver      *G008RequestResolver
	Clock                ports.Clock
	IDs                  G008IdentityGenerator
	ExportInstaller      appexport.ExportInstaller
	PublicationAuthority ports.PublicationStore

	Online *G008OnlineAuthority

	CleanStore     appclean.ApplyStore
	CleanValidator appclean.SchemaValidator
}

G008Composition is the complete input for the G008 Dependencies projection. Export and selector resolution remain available without online authority.

type G008IdentityGenerator

type G008IdentityGenerator interface {
	RequestIDGenerator
	NewRunID(time.Time) (domain.RunID, error)
}

G008IdentityGenerator supplies the distinct identities needed by command envelopes, delta children, and rerun children.

type G008OnlineAuthority

type G008OnlineAuthority struct {
	FollowupTargetCapturer appfollowup.CurrentTargetCapturer
	DeltaTargetCapturer    appdelta.TargetCapturer
	DeltaComparator        appdelta.Comparator
	ChildExecutor          *childrun.Executor
	FollowupExecutor       *childrun.FollowupExecutor
	RerunAssignments       []review.Assignment
}

G008OnlineAuthority is the complete, explicit authority required to create online child workflows. A nil authority leaves all three workflows absent; a partial authority is rejected rather than inferred from adjacent services.

type G008RequestResolver

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

G008RequestResolver resolves CLI selectors using the P2 query service. Its captured stdin is owned by this resolver and is never kept in package state.

func NewG008RequestResolver

func NewG008RequestResolver(artifactRoot ports.AnchoredRoot, queries *appquery.Service, enumerator G008RunEnumerator, reader io.Reader, limit ...int64) (*G008RequestResolver, error)

NewG008RequestResolver constructs the production selector resolver. The optional positive limit supports bounded integration fixtures; production capture has no fixed source-size ceiling.

func (*G008RequestResolver) CaptureTarget

func (resolver *G008RequestResolver) CaptureTarget(ctx context.Context) (string, error)

CaptureTarget reads the injected stdin exactly once, freezes the successful bytes behind an invocation-scoped opaque token, and returns that token on every call. The token contains no review input bytes or input-derived data.

func (*G008RequestResolver) Diagnostics

func (resolver *G008RequestResolver) Diagnostics() []string

Diagnostics returns a defensive copy of deterministic latest-selection exclusions from the most recent latest resolution.

func (*G008RequestResolver) ResolveAttempt

func (resolver *G008RequestResolver) ResolveAttempt(ctx context.Context, runSelector, roleSelector, provider string) (string, error)

ResolveAttempt delegates exact role/provider uniqueness to query.Service.

func (*G008RequestResolver) ResolvePublicationRun

func (resolver *G008RequestResolver) ResolvePublicationRun(ctx context.Context, root ports.AnchoredRoot, runID domain.RunID) (ports.PublicationRun, error)

ResolvePublicationRun resolves an explicit canonical run within this resolver's artifact root. It shares the resolver's P2 query authority and deliberately does not enumerate the run namespace.

func (*G008RequestResolver) ResolveRun

func (resolver *G008RequestResolver) ResolveRun(ctx context.Context, selector string) (string, error)

ResolveRun resolves an explicit canonical ID through the query boundary, or selects latest strictly from fresh P2 committed observations.

func (*G008RequestResolver) TakeCapturedStdin

func (resolver *G008RequestResolver) TakeCapturedStdin(ctx context.Context, token string) ([]byte, error)

TakeCapturedStdin transfers a defensive copy of a captured stdin value once. It removes and zeroes the resolver-owned input before returning.

type G008RunEnumerator

type G008RunEnumerator interface {
	Enumerate(context.Context, ports.AnchoredRoot) ([]filesystem.RunCandidate, []filesystem.RunSelectorDiagnostic, error)
}

G008RunEnumerator is the filesystem-only namespace projection used to find possible runs. It deliberately has no P2 interpretation authority.

type G008RunResolver

type G008RunResolver interface {
	ResolvePublicationRun(context.Context, ports.AnchoredRoot, domain.RunID) (ports.PublicationRun, error)
}

G008RunResolver resolves an already-canonical source ID beneath the current anchored artifact root. It intentionally has no filesystem or selector authority of its own.

type G008RuntimePromptSource

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

G008RuntimePromptSource is the production prompt-source seam for child delta and exact replay execution. Prompt construction is supplied explicitly; this source verifies all persisted P2 authority before forwarding it.

func NewG008RuntimePromptSource

NewG008RuntimePromptSource requires distinct ordinary, delta-aware, and exact-replay prompt authorities. No mode falls back to another authority.

func (*G008RuntimePromptSource) DeltaPrompt

func (*G008RuntimePromptSource) ExactReplayPrompt

func (*G008RuntimePromptSource) Prompt

type G008Sources

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

G008Sources is the root-bound P2 source authority shared by G008 wiring. It has no mutable target, provider-output, or publication-write fallback.

func NewG008Sources

func NewG008Sources(root ports.AnchoredRoot, resolver G008RunResolver, query *appquery.Service) (*G008Sources, error)

func (*G008Sources) ReadFollowupSource

func (sources *G008Sources) ReadFollowupSource(ctx context.Context, runID domain.RunID, findingID string) (appfollowup.VerifiedSource, error)

func (*G008Sources) ReadRerunSource

func (sources *G008Sources) ReadRerunSource(ctx context.Context, runID domain.RunID, attemptID domain.AttemptID) (apprerun.SourceAttempt, error)

func (*G008Sources) ReadSource

func (sources *G008Sources) ReadSource(ctx context.Context, runID domain.RunID) (appdelta.SourceSnapshot, error)

type HeartbeatRequest added in v0.1.15

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

func (HeartbeatRequest) Authorized added in v0.1.15

func (request HeartbeatRequest) Authorized() bool

func (HeartbeatRequest) CredentialProfile added in v0.1.15

func (request HeartbeatRequest) CredentialProfile() string

func (HeartbeatRequest) ProjectRoot added in v0.1.15

func (request HeartbeatRequest) ProjectRoot() string

func (HeartbeatRequest) ProviderID added in v0.1.15

func (request HeartbeatRequest) ProviderID() string

type HeartbeatService added in v0.1.15

type HeartbeatService interface {
	ProbeProvider(context.Context, ports.AnchoredRoot, appheartbeat.Request) (appheartbeat.Result, error)
}

HeartbeatService performs one explicitly authorized synthetic live request.

type HelpRequest

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

HelpRequest contains a validated fixed help topic.

func (HelpRequest) Topic

func (request HelpRequest) Topic() string

Topic returns the requested help topic.

type InitRequest

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

InitRequest contains the executable init fields. ContextPath is absent unless the user explicitly supplied --context.

func (InitRequest) AGYOverrides

func (request InitRequest) AGYOverrides() (string, string)

func (InitRequest) ArtistInputs

func (request InitRequest) ArtistInputs() (string, []string)

func (InitRequest) CodexOverrides added in v0.1.14

func (request InitRequest) CodexOverrides() (string, string, string)

func (InitRequest) ContextPath

func (request InitRequest) ContextPath() (string, bool)

ContextPath returns the optional safe relative context path.

func (InitRequest) KimiOverrides

func (request InitRequest) KimiOverrides() (string, string, string)

func (InitRequest) NativeHome

func (request InitRequest) NativeHome() (string, bool)

func (InitRequest) Overwrite

func (request InitRequest) Overwrite() bool

func (InitRequest) ProjectKind

func (request InitRequest) ProjectKind() (string, bool)

func (InitRequest) ProjectName

func (request InitRequest) ProjectName() string

ProjectName returns the validated project name.

func (InitRequest) ProjectPolicyOptions added in v0.1.13

func (request InitRequest) ProjectPolicyOptions() bool

func (InitRequest) ProjectRoot

func (request InitRequest) ProjectRoot() string

ProjectRoot returns the canonical project root selected for initialization.

func (InitRequest) RefreshLocal added in v0.1.13

func (request InitRequest) RefreshLocal() bool

func (InitRequest) Roles

func (request InitRequest) Roles() []string

Roles returns the canonical project role set selected for initialization.

func (InitRequest) Selection

func (request InitRequest) Selection() (string, []string)

func (InitRequest) ZCodeOverrides

func (request InitRequest) ZCodeOverrides() (string, string)

type Invocation

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

Invocation is the immutable result of parsing one Mulgae command line.

func Parse

func Parse(arguments []string, defaultProjectRoot, requestID string) (Invocation, error)

Parse converts command-line arguments into one immutable Mulgae invocation. The caller must supply a canonical default project root and a UUIDv7 request ID. Parse does not inspect the filesystem, environment, or service state.

func ParseResolved

func ParseResolved(ctx context.Context, arguments []string, defaultProjectRoot, requestID string, resolver RequestResolver) (Invocation, error)

ParseResolved resolves documented CLI selectors before freezing the exact schema request object. Parse remains the pure canonical-ID entry point.

func (Invocation) Availability

func (invocation Invocation) Availability() Availability

Availability reports whether the command can execute in this milestone.

func (Invocation) Clean

func (invocation Invocation) Clean() (CleanRequest, bool)

Clean returns the parsed clean fields when this is a clean invocation.

func (Invocation) Command

func (invocation Invocation) Command() app.CommandName

Command returns the exact recognized command name.

func (Invocation) Config

func (invocation Invocation) Config() (ConfigRequest, bool)

Config returns the parsed config fields when this is a config invocation.

func (Invocation) Delta

func (invocation Invocation) Delta() (DeltaRequest, bool)

Delta returns the parsed delta fields when this is a delta invocation.

func (Invocation) Doctor

func (invocation Invocation) Doctor() (DoctorRequest, bool)

Doctor returns the parsed doctor fields when this is a doctor invocation.

func (Invocation) Excerpt

func (invocation Invocation) Excerpt() (ExcerptRequest, bool)

Excerpt returns the parsed excerpt fields when this is an excerpt invocation.

func (Invocation) Export

func (invocation Invocation) Export() (ExportRequest, bool)

Export returns the parsed export fields when this is an export invocation.

func (Invocation) Findings

func (invocation Invocation) Findings() (FindingsRequest, bool)

Findings returns the parsed findings fields when this is a findings invocation.

func (Invocation) Followup

func (invocation Invocation) Followup() (FollowupRequest, bool)

Followup returns the parsed followup fields when this is a followup invocation.

func (Invocation) FutureMilestone

func (invocation Invocation) FutureMilestone() bool

FutureMilestone reports whether dispatch must reject the command as unavailable.

func (Invocation) Heartbeat added in v0.1.15

func (invocation Invocation) Heartbeat() (HeartbeatRequest, bool)

func (Invocation) Help

func (invocation Invocation) Help() (HelpRequest, bool)

Help returns the parsed help fields when this is a help invocation.

func (Invocation) Init

func (invocation Invocation) Init() (InitRequest, bool)

Init returns the parsed init fields when this is an init invocation.

func (Invocation) OutputFormat

func (invocation Invocation) OutputFormat() OutputFormat

OutputFormat returns the selected response representation.

func (Invocation) Providers

func (invocation Invocation) Providers() (ProvidersRequest, bool)

Providers returns the parsed providers fields when this is a providers invocation.

func (Invocation) Report

func (invocation Invocation) Report() (ReportRequest, bool)

Report returns the parsed report fields when this is a report invocation.

func (Invocation) RequestID

func (invocation Invocation) RequestID() string

RequestID returns the caller-provided request identifier.

func (Invocation) RequestJSON

func (invocation Invocation) RequestJSON() ([]byte, bool)

RequestJSON returns a caller-owned copy of the exact command-request object. The boolean is false when no contract-consistent request object is available.

func (Invocation) Rerun

func (invocation Invocation) Rerun() (RerunRequest, bool)

Rerun returns the parsed rerun fields when this is a rerun invocation.

func (Invocation) Review

func (invocation Invocation) Review() (ReviewRequest, bool)

Review returns the parsed review fields when this is a review invocation.

func (Invocation) Roles

func (invocation Invocation) Roles() (RolesRequest, bool)

Roles returns the parsed role-catalog listing fields when this is a roles invocation.

func (Invocation) Schema

func (invocation Invocation) Schema() (SchemaRequest, bool)

Schema returns the parsed schema fields when this is a schema invocation.

func (Invocation) Status

func (invocation Invocation) Status() (StatusRequest, bool)

Status returns the parsed status fields when this is a status invocation.

type OutputFormat

type OutputFormat string

OutputFormat controls the CLI rendering selected by an invocation.

const (
	// OutputFormatJSON requests the machine-readable command envelope.
	OutputFormatJSON OutputFormat = "json"
	// OutputFormatHuman requests the human-readable command envelope.
	OutputFormatHuman OutputFormat = "human"
)

type ProvidersRequest

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

ProvidersRequest contains the immutable provider-profile listing fields.

func (ProvidersRequest) IncludeUnverified

func (request ProvidersRequest) IncludeUnverified() bool

IncludeUnverified reports whether unverified provider profiles are included.

func (ProvidersRequest) ProjectRoot

func (request ProvidersRequest) ProjectRoot() string

ProjectRoot returns the canonical project root selected for provider listing.

type PublicationQueryService

PublicationQueryService is the command-facing projection of the durable G006 query API. It deliberately accepts an already anchored artifact root so command handlers cannot discover publication files themselves.

func NewPublicationQueryService

func NewPublicationQueryService(service *appquery.Service) PublicationQueryService

NewPublicationQueryService adapts the existing query service to the narrow command boundary. A nil service remains nil so optional-group validation can distinguish an absent service from a complete G006 dependency group.

type PublicationReportService

type PublicationReportService interface {
	Render(context.Context, ports.PublicationRun) (RenderedReport, error)
}

PublicationReportService is the command-facing projection of the G006 report renderer. SourceIDs bind a persisted report to its committed inputs.

func NewPublicationReportService

func NewPublicationReportService(service *appreport.Service) PublicationReportService

NewPublicationReportService adapts the existing report service to the narrow command boundary. A nil service remains nil so optional-group validation can distinguish an absent service from a complete G006 dependency group.

type RedactedExportRequest

type RedactedExportRequest struct {
	RunID        string
	OutputPath   string
	Redacted     bool
	ProjectRoot  ports.AnchoredRoot
	ArtifactRoot ports.AnchoredRoot
}

RedactedExportRequest is the complete schema-backed export selection.

type RedactedExportResult

type RedactedExportResult struct {
	ExportManifestURI string
	BundleURI         string
	Redacted          bool
}

RedactedExportResult is the authoritative persisted export projection.

type RedactedExportService

type RedactedExportService interface {
	ExportRedactedRun(context.Context, RedactedExportRequest) (RedactedExportResult, error)
}

RedactedExportService is the command-facing export workflow boundary.

func NewRedactedExportService

func NewRedactedExportService(
	queries *appquery.Service,
	installer appexport.ExportInstaller,
	clock ports.Clock,
	requestIDs RequestIDGenerator,
) (RedactedExportService, error)

NewRedactedExportService composes offline export from verified P2 query reads and a paired secure export installer. It deliberately accepts no provider or runtime authority.

type RedactedExportServiceFunc

type RedactedExportServiceFunc func(context.Context, RedactedExportRequest) (RedactedExportResult, error)

RedactedExportServiceFunc adapts a command export function to RedactedExportService.

func (RedactedExportServiceFunc) ExportRedactedRun

type RenderedReport

type RenderedReport struct {
	Markdown  []byte
	RunID     string
	SourceIDs []string
}

RenderedReport is an immutable report projection for one committed run.

type ReplayMode

type ReplayMode string

ReplayMode identifies the rerun prompt construction mode.

const (
	// ReplayModeExact reuses the captured source invocation exactly.
	ReplayModeExact ReplayMode = "exact"
	// ReplayModeRecompose recompiles from current trusted templates.
	ReplayModeRecompose ReplayMode = "recompose"
)

type ReportRequest

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

ReportRequest contains the immutable report-rendering fields.

func (ReportRequest) OutputPath

func (request ReportRequest) OutputPath() string

OutputPath returns the selected safe relative report path.

func (ReportRequest) RunID

func (request ReportRequest) RunID() string

RunID returns the selected canonical review-run ID.

type RequestIDGenerator

type RequestIDGenerator interface {
	NewRequestID(time.Time) (string, error)
}

RequestIDGenerator creates the request identifier bound into a parsed command request and its command-result envelope.

type RequestResolver

type RequestResolver interface {
	ResolveRun(context.Context, string) (string, error)
	ResolveAttempt(context.Context, string, string, string) (string, error)
	CaptureTarget(context.Context) (string, error)
}

RequestResolver resolves CLI-only selectors before a schema request is frozen. Implementations must return canonical IDs and a nonempty captured stdin target.

type RerunRequest

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

RerunRequest contains the immutable source attempt and replay selection.

func (RerunRequest) ReplayMode

func (request RerunRequest) ReplayMode() ReplayMode

ReplayMode returns the selected replay construction mode.

func (RerunRequest) SourceAttemptID

func (request RerunRequest) SourceAttemptID() string

SourceAttemptID returns the source attempt selected for replay.

func (RerunRequest) SourceRunID

func (request RerunRequest) SourceRunID() string

SourceRunID returns the source run selected for replay.

type RerunService

type RerunService interface {
	StartRerun(context.Context, appreplay.Request) (StartedRun, error)
}

RerunService is the command-facing rerun workflow boundary.

func NewRerunService

func NewRerunService(service *appreplay.Service) RerunService

NewRerunService adapts the rerun application service to command wiring.

type Result

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

Result is the complete process projection of one invocation. Stdout and Stderr return caller-owned copies so a caller cannot mutate application-owned response bytes.

func (Result) ExitCode

func (result Result) ExitCode() app.ExitCode

ExitCode returns the assigned Mulgae process exit code.

func (Result) Stderr

func (result Result) Stderr() []byte

Stderr returns a defensive copy of command standard error.

func (Result) Stdout

func (result Result) Stdout() []byte

Stdout returns a defensive copy of command standard output.

func (Result) WriteTo added in v0.1.5

func (result Result) WriteTo(stdout, stderr io.Writer) error

WriteTo delivers stdout and stderr without requiring callers to obtain defensive byte copies. Future file-backed command projections use this same boundary while the existing Result accessors remain compatible.

type ResultStream added in v0.1.5

type ResultStream string

ResultStream identifies the process stream whose delivery failed.

const (
	// ResultStreamStdout is the command result stream.
	ResultStreamStdout ResultStream = "stdout"
	// ResultStreamStderr is the command diagnostic stream.
	ResultStreamStderr ResultStream = "stderr"
)

type ResultWriteError added in v0.1.5

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

ResultWriteError reports an incomplete command-result delivery.

func (*ResultWriteError) Error added in v0.1.5

func (err *ResultWriteError) Error() string

func (*ResultWriteError) Stream added in v0.1.5

func (err *ResultWriteError) Stream() ResultStream

Stream returns the stream whose delivery failed.

func (*ResultWriteError) Unwrap added in v0.1.5

func (err *ResultWriteError) Unwrap() error

Unwrap returns the underlying writer failure.

type RetentionRequest

type RetentionRequest struct {
	OlderThanDays int64
	All           bool
	DryRun        bool
}

RetentionRequest is the complete schema-backed clean command selection.

type RetentionResult

type RetentionResult struct {
	DryRun           bool
	AffectedRunCount int
	AffectedBytes    int64
}

RetentionResult is the authoritative cleanup summary.

type RetentionService

type RetentionService interface {
	CleanRuns(context.Context, RetentionRequest) (RetentionResult, error)
}

RetentionService is the command-facing retention workflow boundary.

func NewRetentionService

func NewRetentionService(service *appclean.Service) RetentionService

NewRetentionService adapts the cleanup application service to the command boundary.

type RetentionServiceFunc

type RetentionServiceFunc func(context.Context, RetentionRequest) (RetentionResult, error)

RetentionServiceFunc adapts a command retention function to RetentionService.

func (RetentionServiceFunc) CleanRuns added in v0.1.10

type ReviewPreflightBudget added in v0.1.2

type ReviewPreflightBudget struct {
	Eligible             bool                      `json:"eligible"`
	ReasonCode           string                    `json:"reason_code"`
	MaxActiveLanes       int                       `json:"max_active_lanes"`
	TotalInvocations     int                       `json:"total_invocations"`
	CriticalPathDeadline string                    `json:"critical_path_deadline"`
	RunDeadline          string                    `json:"run_deadline"`
	Ceilings             ReviewPreflightCeilings   `json:"ceilings"`
	RolePaths            []ReviewPreflightRolePath `json:"role_paths"`
}

type ReviewPreflightCeilings added in v0.1.2

type ReviewPreflightCeilings struct {
	ProviderTimeout       string `json:"provider_timeout"`
	RolePathDeadline      string `json:"role_path_deadline"`
	RunDeadline           string `json:"run_deadline"`
	MaxInvocationsPerRole int    `json:"max_invocations_per_role"`
	MaxInvocationsPerRun  int    `json:"max_invocations_per_run"`
}

type ReviewPreflightFile added in v0.1.2

type ReviewPreflightFile struct {
	Path        string `json:"path"`
	MediaType   string `json:"media_type"`
	Size        int64  `json:"size"`
	SHA256      string `json:"sha256"`
	Disposition string `json:"disposition"`
}

type ReviewPreflightFileSet added in v0.1.2

type ReviewPreflightFileSet struct {
	ID             string                `json:"id"`
	PolicyIdentity string                `json:"policy_identity"`
	Files          []ReviewPreflightFile `json:"files"`
}

type ReviewPreflightGeneratedFile added in v0.1.2

type ReviewPreflightGeneratedFile struct {
	Path        string `json:"path"`
	MediaType   string `json:"media_type"`
	Disposition string `json:"disposition"`
}

type ReviewPreflightResult added in v0.1.2

type ReviewPreflightResult struct {
	SchemaVersion     string                         `json:"schema_version"`
	Status            string                         `json:"status"`
	Qualification     string                         `json:"qualification"`
	Target            ReviewPreflightTarget          `json:"target"`
	AGYPermissionMode string                         `json:"agy_permission_mode"`
	Warnings          []string                       `json:"warnings"`
	FileSets          []ReviewPreflightFileSet       `json:"file_sets"`
	GeneratedFiles    []ReviewPreflightGeneratedFile `json:"generated_files"`
	Transmissions     []ReviewPreflightTransmission  `json:"transmissions"`
	Budget            ReviewPreflightBudget          `json:"budget"`
}

ReviewPreflightResult is the schema-facing, deterministic execution-free review projection. Every slice is owned by the result.

func NewReviewPreflightResult added in v0.1.2

func NewReviewPreflightResult(
	material ports.CapturedReviewMaterial,
	workspaceReceipt ports.WorkspaceSnapshotReceipt,
	requestedKind string,
	plan reviewrun.ExecutionPlan,
	budgetReceipt review.RunBudgetReceipt,
	agyPermissionMode string,
) (ReviewPreflightResult, error)

NewReviewPreflightResult converts the already-captured snapshot and the authoritative pure budget receipt into the stable external projection.

func (ReviewPreflightResult) Validate added in v0.1.2

func (result ReviewPreflightResult) Validate() (err error)

Validate rejects malformed service projections before either renderer can expose them as successful preflight evidence.

type ReviewPreflightRolePath added in v0.1.12

type ReviewPreflightRolePath struct {
	Role               string `json:"role"`
	ProviderInstance   string `json:"provider_instance"`
	InvocationCount    int    `json:"invocation_count"`
	TransitionCount    int    `json:"transition_count"`
	InvocationTimeouts string `json:"invocation_timeouts"`
	Deadline           string `json:"deadline"`
}

type ReviewPreflightService added in v0.1.2

type ReviewPreflightService interface {
	PreflightReview(context.Context, ReviewRequest, ports.AnchoredRoot) (ReviewPreflightResult, error)
}

ReviewPreflightService projects the exact capture and configured execution envelope without provider discovery, qualification, invocation, or durable publication.

type ReviewPreflightTarget added in v0.1.2

type ReviewPreflightTarget struct {
	RequestedKind string `json:"requested_kind"`
	CapturedKind  string `json:"captured_kind"`
	GitMode       string `json:"git_mode"`
	SHA256        string `json:"sha256"`
	Size          int64  `json:"size"`
}

type ReviewPreflightTransmission added in v0.1.2

type ReviewPreflightTransmission struct {
	Role              string `json:"role"`
	RouteKind         string `json:"route_kind"`
	ProviderInstance  string `json:"provider_instance"`
	ProviderFamily    string `json:"provider_family"`
	ConfiguredTimeout string `json:"configured_timeout"`
	PermissionMode    string `json:"permission_mode"`
	TargetChannel     string `json:"target_channel"`
	FileSetID         string `json:"file_set_id"`
}

type ReviewRequest

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

ReviewRequest contains the immutable independent-review fields.

func ResolveReviewPolicyRequest added in v0.1.2

func ResolveReviewPolicyRequest(request ReviewRequest, enabled map[domain.Role]bool, artistInputs ports.ArtistReviewInputs, hasArtistInputs bool) (ReviewRequest, error)

ResolveReviewPolicyRequest is the shared normal-run and preflight authority for enabled-role selection plus Config v1 artist defaults and request-scoped overrides. The returned request is canonical and explicitly selected.

func (ReviewRequest) ArtistAutomatic added in v0.1.11

func (request ReviewRequest) ArtistAutomatic() bool

func (ReviewRequest) ArtistBrief

func (request ReviewRequest) ArtistBrief() (string, bool)

ArtistBrief returns the optional review-scoped artist brief path.

func (ReviewRequest) ArtistDesignSpecs

func (request ReviewRequest) ArtistDesignSpecs() []string

ArtistDesignSpecs returns a caller-owned copy of the optional review-scoped visual asset globs.

func (ReviewRequest) Objective

func (request ReviewRequest) Objective() (string, bool)

Objective returns the optional review objective.

func (ReviewRequest) Preflight added in v0.1.2

func (request ReviewRequest) Preflight() bool

Preflight reports whether the review is an execution-free capture, routing, and budget projection.

func (ReviewRequest) Roles

func (request ReviewRequest) Roles() []string

Roles returns a caller-owned copy of the requested roles.

func (ReviewRequest) RolesExplicit

func (request ReviewRequest) RolesExplicit() bool

RolesExplicit reports whether --roles was supplied by the caller.

func (ReviewRequest) SessionID

func (request ReviewRequest) SessionID() (string, bool)

SessionID returns the optional imported workflow session ID.

func (ReviewRequest) Target

func (request ReviewRequest) Target() TargetRequest

Target returns the literal target request.

type ReviewRunInputSourceFactory

type ReviewRunInputSourceFactory = reviewrun.ImmutableInputSourceFactory

ReviewRunInputSourceFactory is the application-owned immutable capture factory. The entrypoint maps command values into its typed request only.

type ReviewRunResult

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

ReviewRunResult is the immutable terminal P2 projection returned by ReviewRunService.

func NewReviewRunResult

func NewReviewRunResult(
	sessionID string,
	runID string,
	runManifestURI string,
	reviewArtifactURI string,
	terminalExit domain.OperationalExitDecision,
) ReviewRunResult

NewReviewRunResult creates an immutable terminal review projection.

func (ReviewRunResult) ReviewArtifactURI

func (result ReviewRunResult) ReviewArtifactURI() string

ReviewArtifactURI returns the persisted final review artifact URI.

func (ReviewRunResult) RoleReportURIs added in v0.1.4

func (result ReviewRunResult) RoleReportURIs() []RoleReportURI

RoleReportURIs returns caller-owned project-relative role report URIs.

func (ReviewRunResult) RunID

func (result ReviewRunResult) RunID() string

RunID returns the terminal review run ID.

func (ReviewRunResult) RunManifestURI

func (result ReviewRunResult) RunManifestURI() string

RunManifestURI returns the persisted run manifest URI.

func (ReviewRunResult) SessionID

func (result ReviewRunResult) SessionID() string

SessionID returns the terminal review session ID.

func (ReviewRunResult) TerminalExit

func (result ReviewRunResult) TerminalExit() domain.OperationalExitDecision

TerminalExit returns the reduced committed P2 exit authority.

func (ReviewRunResult) TerminalProviderFailures added in v0.1.2

func (result ReviewRunResult) TerminalProviderFailures() []reviewrun.ProviderExecutionFailure

func (ReviewRunResult) Validate

func (result ReviewRunResult) Validate() error

Validate verifies that the result can safely be represented in the review command envelope.

type ReviewRunService

type ReviewRunService interface {
	StartReviewRun(context.Context, ReviewRequest, ports.AnchoredRoot) (ReviewRunResult, error)
}

ReviewRunService is the command-facing independent review workflow boundary. It receives the parsed immutable request and an already anchored project root; it owns all provider execution and P2 publication authority.

func NewPolicyReviewRunService

func NewPolicyReviewRunService(service ReviewRunService, _ []domain.Role, enabled map[domain.Role]bool) ReviewRunService

NewPolicyReviewRunService binds the resolved production role policy at the command boundary. An omitted --roles selects every enabled project role; an explicit --roles selects exactly that enabled non-empty subset.

func NewPolicyReviewRunServiceWithArtistInputs

func NewPolicyReviewRunServiceWithArtistInputs(service ReviewRunService, _ []domain.Role, enabled map[domain.Role]bool, artistInputs ports.ArtistReviewInputs) ReviewRunService

NewPolicyReviewRunServiceWithArtistInputs binds Config v1 artist inputs as review defaults. Request-scoped values are resolved after role selection.

func NewReviewRunService

func NewReviewRunService(service *reviewrun.Service, factory ReviewRunInputSourceFactory) ReviewRunService

NewReviewRunService adapts the provider-neutral review-run service to the command boundary. Nil and typed-nil dependencies preserve the optional review provider-unavailable path.

func NewUnavailableReviewRunService

func NewUnavailableReviewRunService(cause error) ReviewRunService

NewUnavailableReviewRunService retains a safe, typed composition diagnostic when production review authority could not be composed. It is deliberately a service rather than a nil dependency so review failures remain actionable.

type ReviewRunServicePreparer

type ReviewRunServicePreparer interface {
	PrepareReviewRun(context.Context, ports.AnchoredRoot) (ReviewRunService, error)
}

ReviewRunServicePreparer is the optional lazy-composition boundary used by the standalone binary. Preparation happens only for review, but before the handler creates the private publication directory.

type RoleReportURI added in v0.1.4

type RoleReportURI struct {
	Role string
	URI  string
}

RoleReportURI is one project-relative role-report projection.

type RolesRequest

type RolesRequest struct{}

RolesRequest identifies the static built-in role inventory request.

type RunStatusView

type RunStatusView struct {
	SessionID        string
	RunID            string
	RunState         domain.RunState
	HasRunState      bool
	PublicationState domain.PublicationStatus
	RecoveryAction   domain.RecoveryAction
	FinalArtifactURI string
	HasFinalArtifact bool
	ContentVerdict   domain.ContentVerdict
	CoverageStatus   domain.CoverageStatus
	CIDecision       domain.CIDecision
	HasAxes          bool
	RoleReportURIs   []RoleReportURI
}

RunStatusView is the safe status projection returned by PublicationQueryService. FinalArtifactURI and the independent outcome axes are present only after a P2 committed read. HasAxes makes the three axes an all-or-none projection. RoleReportURIs are present only after independently verified P2 support checks.

type SchemaOperation

type SchemaOperation string

SchemaOperation selects a schema catalog operation.

const (
	// SchemaOperationList lists the embedded schema catalog.
	SchemaOperationList SchemaOperation = "list"
	// SchemaOperationShow renders one embedded schema.
	SchemaOperationShow SchemaOperation = "show"
	// SchemaOperationExport securely writes one embedded schema.
	SchemaOperationExport SchemaOperation = "export"
)

type SchemaRequest

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

SchemaRequest contains the executable schema catalog fields.

func (SchemaRequest) ExportPath

func (request SchemaRequest) ExportPath() (string, bool)

ExportPath returns the selected safe relative export path for export operations.

func (SchemaRequest) Operation

func (request SchemaRequest) Operation() SchemaOperation

Operation returns the explicit schema catalog operation.

func (SchemaRequest) ProjectRoot

func (request SchemaRequest) ProjectRoot() string

ProjectRoot returns the canonical project root selected for schema export.

func (SchemaRequest) SchemaID

func (request SchemaRequest) SchemaID() (string, bool)

SchemaID returns the selected schema identifier for show and export operations.

type StartedRun

type StartedRun struct {
	SessionID                  string
	RunID                      string
	ArtifactURI                string
	FollowupResolution         *domain.FollowupResolution
	StructuredExtractionStatus domain.StructuredExtractionStatus
	RoleReportURIs             []RoleReportURI
	TerminalExit               domain.OperationalExitDecision
}

StartedRun is the authoritative projection of a newly started child workflow.

type StatusRequest

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

StatusRequest contains the immutable run selected for status lookup.

func (StatusRequest) RunID

func (request StatusRequest) RunID() string

RunID returns the selected canonical review-run ID.

type TargetRequest

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

TargetRequest contains one literal command-request target.

func (TargetRequest) Kind

func (request TargetRequest) Kind() string

Kind returns the selected project or external-input target kind.

func (TargetRequest) Value

func (request TargetRequest) Value() string

Value returns the target value.

Jump to

Keyboard shortcuts

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