Documentation
¶
Index ¶
- func DecodeStrictJSONObject(raw []byte) (map[string]any, error)
- func FailurePrecedence(class domain.FailureClass) int
- type CommandName
- type CommandResult
- func NewCommandFailure(command CommandName, exitCode ExitCode, diagnostics ...Diagnostic) (CommandResult, error)
- func NewCommandResult(command CommandName, ok bool, exitCode ExitCode, data []byte, ...) (CommandResult, error)
- func NewCommandSuccess(command CommandName, data []byte) (CommandResult, error)
- func NewCommittedCommandOutcome(command CommandName, exitCode ExitCode, data []byte, reasons []string) (CommandResult, error)
- func NewCommittedCommandOutcomeWithReasons(command CommandName, exitCode ExitCode, data []byte, reasons []CommittedReason) (CommandResult, error)
- func (result CommandResult) Command() CommandName
- func (result CommandResult) CommittedOutcome() bool
- func (result CommandResult) CommittedReasons() []CommittedReason
- func (result CommandResult) Data() []byte
- func (result CommandResult) Diagnostics() []Diagnostic
- func (result CommandResult) ExitCode() ExitCode
- func (result CommandResult) OK() bool
- type CommittedReason
- type Diagnostic
- func NewDiagnostic(stage string, failureClass domain.FailureClass, machineCode string, ...) (Diagnostic, error)
- func NewDiagnosticWithRetryable(stage string, failureClass domain.FailureClass, machineCode string, ...) (Diagnostic, error)
- func NewDiagnosticWithRetryableArtifactPath(stage string, failureClass domain.FailureClass, machineCode string, ...) (Diagnostic, error)
- func NewDiagnosticWithRetryableDetails(stage string, failureClass domain.FailureClass, machineCode string, ...) (Diagnostic, error)
- func (diagnostic Diagnostic) ArtifactPath() string
- func (diagnostic Diagnostic) AttemptID() domain.AttemptID
- func (diagnostic Diagnostic) FailureClass() domain.FailureClass
- func (diagnostic Diagnostic) FallbackAttempted() bool
- func (diagnostic Diagnostic) FallbackProhibited() bool
- func (diagnostic Diagnostic) MachineCode() string
- func (diagnostic Diagnostic) Message() string
- func (diagnostic Diagnostic) Provider() string
- func (diagnostic Diagnostic) RecommendedNextCommand() string
- func (diagnostic Diagnostic) Retryable() bool
- func (diagnostic Diagnostic) Role() string
- func (diagnostic Diagnostic) Stage() string
- type ExitCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeStrictJSONObject ¶
DecodeStrictJSONObject decodes raw JSON as exactly one non-null object. It rejects trailing values and duplicate object keys at every nesting level.
func FailurePrecedence ¶
func FailurePrecedence(class domain.FailureClass) int
FailurePrecedence returns the canonical operational precedence for a failure class. Higher values win when independent failures are observed together.
Types ¶
type CommandName ¶
type CommandName string
CommandName is one command in the fixed Mulgae command surface.
const ( CommandInit CommandName = "init" CommandDoctor CommandName = "doctor" CommandReview CommandName = "review" CommandFollowup CommandName = "followup" CommandDelta CommandName = "delta" CommandRerun CommandName = "rerun" CommandStatus CommandName = "status" CommandReport CommandName = "report" CommandFindings CommandName = "findings" CommandExcerpt CommandName = "excerpt" CommandProviders CommandName = "providers" CommandRoles CommandName = "roles" CommandConfig CommandName = "config" CommandSchema CommandName = "schema" CommandClean CommandName = "clean" CommandExport CommandName = "export" CommandHelp CommandName = "help" )
func ParseCommandName ¶
func ParseCommandName(value string) (CommandName, error)
ParseCommandName validates a command from the fixed command surface.
func (CommandName) Valid ¶
func (command CommandName) Valid() bool
Valid reports whether command belongs to the fixed command surface.
type CommandResult ¶
type CommandResult struct {
// contains filtered or unexported fields
}
CommandResult is the immutable application result consumed by a CLI adapter.
func NewCommandFailure ¶
func NewCommandFailure(command CommandName, exitCode ExitCode, diagnostics ...Diagnostic) (CommandResult, error)
NewCommandFailure creates a typed failed command result. Every diagnostic is retained in order, allowing a command to preserve independent root causes.
func NewCommandResult ¶
func NewCommandResult(command CommandName, ok bool, exitCode ExitCode, data []byte, diagnostics []Diagnostic) (CommandResult, error)
NewCommandResult validates a command-result combination and takes ownership of data and diagnostics. Successful results must be success/0, carry no diagnostics, and provide exactly one non-null JSON object. Failed results must use a nonzero assigned exit, carry no data, and include at least one typed diagnostic with a machine code and message.
func NewCommandSuccess ¶
func NewCommandSuccess(command CommandName, data []byte) (CommandResult, error)
NewCommandSuccess creates an OK command result with caller-owned data that contains exactly one non-null JSON object.
func NewCommittedCommandOutcome ¶
func NewCommittedCommandOutcome(command CommandName, exitCode ExitCode, data []byte, reasons []string) (CommandResult, error)
NewCommittedCommandOutcome creates a data-bearing child workflow outcome from verified terminal authority. Its policy and readiness exits are committed outcomes, not transport failures, and retain every stable terminal reason.
func NewCommittedCommandOutcomeWithReasons ¶ added in v0.1.2
func NewCommittedCommandOutcomeWithReasons(command CommandName, exitCode ExitCode, data []byte, reasons []CommittedReason) (CommandResult, error)
NewCommittedCommandOutcomeWithReasons preserves safe attributed messages for each independent terminal reason without changing the v1 wire shape.
func (CommandResult) Command ¶
func (result CommandResult) Command() CommandName
Command returns the command that produced this result.
func (CommandResult) CommittedOutcome ¶
func (result CommandResult) CommittedOutcome() bool
CommittedOutcome reports whether the result is a verified child workflow terminal outcome rather than an ordinary success or transport failure.
func (CommandResult) CommittedReasons ¶
func (result CommandResult) CommittedReasons() []CommittedReason
CommittedReasons returns caller-owned stable terminal reasons.
func (CommandResult) Data ¶
func (result CommandResult) Data() []byte
Data returns a caller-owned copy of successful or committed result data. Transport failures always return nil data.
func (CommandResult) Diagnostics ¶
func (result CommandResult) Diagnostics() []Diagnostic
Diagnostics returns a caller-owned copy of the ordered typed diagnostics.
func (CommandResult) ExitCode ¶
func (result CommandResult) ExitCode() ExitCode
ExitCode returns the assigned CLI exit projection.
func (CommandResult) OK ¶
func (result CommandResult) OK() bool
OK reports whether the command completed with a success exit.
type CommittedReason ¶ added in v0.1.2
type CommittedReason struct {
// contains filtered or unexported fields
}
CommittedReason is one safe, stable reason attached to a data-bearing P2 outcome. Message may be empty, in which case the CLI supplies its historical generic text for the code.
func NewCommittedReason ¶ added in v0.1.2
func NewCommittedReason(code, message string) (CommittedReason, error)
func (CommittedReason) Code ¶ added in v0.1.2
func (reason CommittedReason) Code() string
func (CommittedReason) Message ¶ added in v0.1.2
func (reason CommittedReason) Message() string
type Diagnostic ¶
type Diagnostic struct {
// contains filtered or unexported fields
}
Diagnostic is a redacted, typed description of one user-facing failure. It deliberately carries neither a causal error nor arbitrary bytes, so adapters must redact any untrusted detail before constructing it.
func NewDiagnostic ¶
func NewDiagnostic( stage string, failureClass domain.FailureClass, machineCode string, message string, role string, provider string, attemptID domain.AttemptID, fallbackAttempted bool, fallbackProhibited bool, artifactPath string, recommendedNextCommand string, ) (Diagnostic, error)
NewDiagnostic constructs a typed, redacted user-facing diagnostic. Empty role, provider, attempt ID, artifact path, and recommended command represent fields that are not applicable to this failure.
func NewDiagnosticWithRetryable ¶
func NewDiagnosticWithRetryable( stage string, failureClass domain.FailureClass, machineCode string, message string, retryable bool, ) (Diagnostic, error)
NewDiagnosticWithRetryable constructs a diagnostic whose command-envelope retryability is defined by a command-owned outcome contract rather than the generic provider fallback policy.
func NewDiagnosticWithRetryableArtifactPath ¶
func NewDiagnosticWithRetryableArtifactPath( stage string, failureClass domain.FailureClass, machineCode string, message string, retryable bool, artifactPath string, ) (Diagnostic, error)
NewDiagnosticWithRetryableArtifactPath constructs a diagnostic with both a command-owned retryability override and an installed, redacted artifact path.
func NewDiagnosticWithRetryableDetails ¶ added in v0.1.2
func NewDiagnosticWithRetryableDetails( stage string, failureClass domain.FailureClass, machineCode string, message string, retryable bool, role string, provider string, artifactPath string, recommendedNextCommand string, ) (Diagnostic, error)
NewDiagnosticWithRetryableDetails constructs a command-owned retryable diagnostic while retaining closed provider attribution and a redacted remediation command.
func (Diagnostic) ArtifactPath ¶
func (diagnostic Diagnostic) ArtifactPath() string
ArtifactPath returns the optional redacted diagnostic artifact path.
func (Diagnostic) AttemptID ¶
func (diagnostic Diagnostic) AttemptID() domain.AttemptID
AttemptID returns the optional provider attempt identifier. Its zero value means no attempt applies to this diagnostic.
func (Diagnostic) FailureClass ¶
func (diagnostic Diagnostic) FailureClass() domain.FailureClass
FailureClass returns the typed domain failure class.
func (Diagnostic) FallbackAttempted ¶
func (diagnostic Diagnostic) FallbackAttempted() bool
FallbackAttempted reports whether a fallback was attempted for this failure.
func (Diagnostic) FallbackProhibited ¶
func (diagnostic Diagnostic) FallbackProhibited() bool
FallbackProhibited reports whether policy prohibited fallback for this failure.
func (Diagnostic) MachineCode ¶
func (diagnostic Diagnostic) MachineCode() string
MachineCode returns the stable machine-readable reason code.
func (Diagnostic) Message ¶
func (diagnostic Diagnostic) Message() string
Message returns the redacted user-facing explanation.
func (Diagnostic) Provider ¶
func (diagnostic Diagnostic) Provider() string
Provider returns the optional provider instance identifier.
func (Diagnostic) RecommendedNextCommand ¶
func (diagnostic Diagnostic) RecommendedNextCommand() string
RecommendedNextCommand returns the optional redacted next command.
func (Diagnostic) Retryable ¶
func (diagnostic Diagnostic) Retryable() bool
Retryable returns the command-owned retryability override when present and otherwise preserves the historical failure-class fallback mapping.
func (Diagnostic) Role ¶
func (diagnostic Diagnostic) Role() string
Role returns the optional functional role identifier.
func (Diagnostic) Stage ¶
func (diagnostic Diagnostic) Stage() string
Stage returns the application stage that classified the failure.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package childrun executes and publishes supplied child review runs.
|
Package childrun executes and publishes supplied child review runs. |
|
Package clean builds deterministic, side-effect-free retention plans.
|
Package clean builds deterministic, side-effect-free retention plans. |
|
Package config admits one project-local configuration and projects the fixed runtime policy consumed by review composition.
|
Package config admits one project-local configuration and projects the fixed runtime policy consumed by review composition. |
|
Package delta starts immutable A-to-B child review runs.
|
Package delta starts immutable A-to-B child review runs. |
|
Package doctor reports redacted, evidence-backed environment readiness.
|
Package doctor reports redacted, evidence-backed environment readiness. |
|
Package evidence verifies provider current-evidence claims against caller-owned immutable target bytes.
|
Package evidence verifies provider current-evidence claims against caller-owned immutable target bytes. |
|
Package export builds deterministic, redacted export packages from verified P2 projections.
|
Package export builds deterministic, redacted export packages from verified P2 projections. |
|
Package followup starts one immutable, finding-scoped child workflow.
|
Package followup starts one immutable, finding-scoped child workflow. |
|
Package help exposes exact embedded help assets through the application layer.
|
Package help exposes exact embedded help assets through the application layer. |
|
Package init implements create-once project-local configuration discovery and crash-truthful installation.
|
Package init implements create-once project-local configuration discovery and crash-truthful installation. |
|
Package prompt compiles the byte-exact provider stdin packet.
|
Package prompt compiles the byte-exact provider stdin packet. |
|
Package providers lists the fixed, trusted provider profiles without invoking them.
|
Package providers lists the fixed, trusted provider profiles without invoking them. |
|
Package publication builds deterministic, schema-validated publication records.
|
Package publication builds deterministic, schema-validated publication records. |
|
Package query exposes committed publication data to status, findings, excerpt, and report consumers.
|
Package query exposes committed publication data to status, findings, excerpt, and report consumers. |
|
Package report renders a human-readable projection of a committed query snapshot.
|
Package report renders a human-readable projection of a committed query snapshot. |
|
Package rerun starts immutable child runs that replay a verified source attempt.
|
Package rerun starts immutable child runs that replay a verified source attempt. |
|
Package review coordinates one deterministic, in-memory review run.
|
Package review coordinates one deterministic, in-memory review run. |
|
Package reviewrun contains provider-independent review-run admission policy.
|
Package reviewrun contains provider-independent review-run admission policy. |
|
Package roles exposes the fixed build-owned review role inventory.
|
Package roles exposes the fixed build-owned review role inventory. |
|
Package schema exposes the embedded schema catalog through application ports.
|
Package schema exposes the embedded schema catalog through application ports. |
|
Package validation validates untrusted provider review output before it enters the domain model.
|
Package validation validates untrusted provider review output before it enters the domain model. |