Documentation
¶
Overview ¶
Package verdict is the engine's structured outcome contract: every migrate invocation ends in exactly one verdict — executed natively, refused with a typed reason and, where one exists, a safer native idiom, or failed during execution with the executor's stable outcome code and a disclosure of what committed before the failure. Refusals use a distinct exit code from operational errors. This type is the seam a future orchestrator adapter maps onto SchemaBot's ExecutionModeBlocked.
Index ¶
- Constants
- Variables
- func AcceptedBlockingDecision(r Refusal) (eligible, decided bool)
- func AcceptedBlockingEligible(r Refusal) bool
- type Cause
- type Class
- type IndexUsage
- type Outcome
- type Owner
- type Reason
- type Refusal
- func ByDesign(reason Reason) Refusal
- func CapabilityBoundary(reason Reason) Refusal
- func Environmental(reason Reason) Refusal
- func InvariantViolation(reason Reason) Refusal
- func NewRefusal(class Class, reason Reason, owner Owner) (Refusal, error)
- func NoOnlineSafetyProblem(reason Reason, owner Owner) Refusal
- type RefusalSite
- type StatisticsRefresh
- type Verdict
Constants ¶
const ( // ExitCodeRefused is the process exit code for refusal. Exit 0 remains // exclusive to online-safe success and exit 1 to operational failure. ExitCodeRefused = 2 // ExitCodeAcceptedBlocking marks committed execution without an online- // safety guarantee; it cannot be confused with online-safe exit 0. ExitCodeAcceptedBlocking = 3 )
const ( // ClassCapabilityBoundary means the engine has no implemented safe route. ClassCapabilityBoundary = Class(refusal.ClassCapabilityBoundary) // ClassNoOnlineSafetyProblem means another owner should run the work. ClassNoOnlineSafetyProblem Class = "no-online-safety-problem" // ClassByDesign means pg-sprite permanently refuses the form. ClassByDesign = Class(refusal.ClassByDesign) // ClassEnvironmental means the current run environment blocked the work. ClassEnvironmental = Class(refusal.ClassEnvironmental) // ClassInvariantViolation reports incoherent engine state. ClassInvariantViolation = Class(refusal.ClassInvariantViolation) )
Variables ¶
var ErrAcceptedBlocking = errors.New("executed without online safety")
ErrAcceptedBlocking is returned after an accepted-blocking verdict is printed so the entry point can map it to ExitCodeAcceptedBlocking.
var ErrInvalidAcceptedBlocking = errors.New("invalid accepted-blocking verdict")
ErrInvalidAcceptedBlocking reports an incomplete accepted-blocking verdict.
var ErrRefused = errors.New("refused")
ErrRefused is the sentinel the CLI returns after printing a refusal verdict, so the entry point can map it to ExitCodeRefused.
Functions ¶
func AcceptedBlockingDecision ¶ added in v0.3.3
AcceptedBlockingDecision reports eligibility and whether the refusal key has an explicit decision. Completeness tests use decided to reject additions to the refusal vocabulary that have not been classified here.
func AcceptedBlockingEligible ¶ added in v0.3.3
AcceptedBlockingEligible reports whether a typed refusal is in the closed accepted-blocking registry. Unknown combinations fail closed.
Types ¶
type Cause ¶
type Cause string
Cause narrows a refusal reason to the typed discriminator automation branches on without parsing prose: which budget fired under ReasonBudgetExceeded, or which parent shape was refused under ReasonUnsupportedPartitionedParent. The accepted-blocking registry keys on it, so a cause is part of the refusal identity, not a rendering detail.
const ( // CauseNone is the zero cause for verdicts whose reason has no narrower // discriminator. CauseNone Cause = "" // CauseLockBudget: the lock was not granted within lock_timeout; nothing // was executed. CauseLockBudget Cause = "lock-budget" // CauseStatementBudget: the statement ran past statement_timeout and was // cancelled; the change needs a rewrite. CauseStatementBudget Cause = "statement-budget" // CauseParentBlockingIndexBuild identifies a blocking index build on a // partitioned parent. CauseParentBlockingIndexBuild Cause = "parent-blocking-index-build" // CauseParentConcurrentIndexBuild identifies a concurrent index build on // a partitioned parent. CauseParentConcurrentIndexBuild Cause = "parent-concurrent-index-build" // CauseParentIndexAdoption identifies index adoption on a partitioned parent. CauseParentIndexAdoption Cause = "parent-index-adoption" // CauseParentNotValidForeignKey identifies a NOT VALID foreign key on a // partitioned parent. CauseParentNotValidForeignKey Cause = "parent-not-valid-foreign-key" // CauseCopyAndSwapNotEnabled: the statement routes to the copy-and-swap // backend, which the caller has not opted into; nothing was read or // executed. The route is in preview, so it runs only when the policy // opens it. CauseCopyAndSwapNotEnabled Cause = "copy-and-swap-not-enabled" )
The causes a refusal can carry, grouped by the reason they narrow.
type Class ¶ added in v0.3.3
type Class string
Class identifies the routing category of a refusal. The classes an engine cause can take are declared once, in the core's pkg/refusal, and carried here under the same token, so an adapter converts a cause's refusal.Class to a verdict Class with a plain conversion and nothing can spell the two apart; no-online-safety-problem is the verdict's own, since it describes a statement that never reached the engine.
func Classes ¶ added in v0.3.3
func Classes() []Class
Classes returns the closed set of refusal classes.
func ParseClass ¶ added in v0.3.3
ParseClass validates a refusal class token.
type IndexUsage ¶ added in v0.4.0
type IndexUsage struct {
// IdxScans is the cumulative count of scans of the index since
// StatsReset, or since the index was created if that is later; for a
// partitioned index, the sum over its leaf indexes.
IdxScans int64 `json:"idx_scan"`
// LastIdxScan is when the server last recorded a scan; absent when it
// recorded none, and always on PostgreSQL 14 and 15. In UTC.
LastIdxScan *time.Time `json:"last_idx_scan,omitempty"`
// StatsReset is when the database's statistics were last reset; absent
// when the server reports no reset. In UTC.
StatsReset *time.Time `json:"stats_reset,omitempty"`
// ReadAt is the server's clock when the evidence was read. In UTC.
ReadAt time.Time `json:"read_at"`
// Unique reports whether the index enforces uniqueness, a guarantee the
// drop would also discard.
Unique bool `json:"unique"`
// Partitions is the number of leaf indexes of a partitioned index, whose
// scans IdxScans sums; absent for an index that is not partitioned.
Partitions *int `json:"partitions,omitempty"`
// TrackCounts is false when the server was counting no scans, so a zero
// IdxScans proves nothing.
TrackCounts bool `json:"track_counts"`
// TrackCountsOffBySetting is true when a saved ALTER ROLE or ALTER
// DATABASE setting turns track_counts off, so the scans of those
// sessions are missing from IdxScans.
TrackCountsOffBySetting bool `json:"track_counts_off_by_setting"`
}
IndexUsage is how the server pg-sprite is connected to has seen an index used, read when a DROP INDEX is refused for want of the destructive acknowledgement. It describes that one server only: every replica keeps its own counters, so an index this server never scans may still serve a replica's reads.
func (IndexUsage) Summary ¶ added in v0.4.0
func (u IndexUsage) Summary() string
Summary renders the evidence on one line for the verdict's text form.
type Outcome ¶
type Outcome string
Outcome is what happened to the submitted change.
const ( // OutcomeExecuted means the change ran and committed natively within // its budgets. OutcomeExecuted Outcome = "executed-natively" // OutcomeExecutedWithoutOnlineSafety means the operator accepted a typed // blocking refusal and the statement committed under explicit budgets. OutcomeExecutedWithoutOnlineSafety Outcome = "executed-without-online-safety" // OutcomeExecutedViaCopyAndSwap means the change committed through the // copy-and-swap route: a shadow table built under the changed shape, // filled and verified against the source, then swapped into the // source's name. The source table was never rewritten in place. OutcomeExecutedViaCopyAndSwap Outcome = "executed-via-copy-and-swap" // OutcomeRefused means the change was not executed; Reason says why. OutcomeRefused Outcome = "refused" // OutcomeFailed means execution was attempted and failed: an // operational error, not a refusal — the process still exits 1. Code // carries the executor's stable outcome code, and for a mid-sequence // failure FailedStep and ExecutedSQL disclose the failed step and the // committed prefix whose state remains, so automation can distinguish // "nothing happened" from "partial state left behind". OutcomeFailed Outcome = "failed" )
The outcomes a migrate run can end in.
type Owner ¶ added in v0.3.3
type Owner string
Owner identifies who owns work that has no online-safety problem.
const ( // OwnerDataChangeRunner owns DML and backfills. OwnerDataChangeRunner Owner = "data-change-runner" // OwnerDeclarativeFrontDoor owns desired catalog convergence. OwnerDeclarativeFrontDoor Owner = "declarative-front-door" // OwnerDirectOperator means the operator runs the work directly. OwnerDirectOperator Owner = "direct-operator" // OwnerProvisioning owns access-control and replication provisioning. OwnerProvisioning Owner = "provisioning" )
func Owners ¶ added in v0.3.3
func Owners() []Owner
Owners returns the closed set of refusal owners.
func ParseOwner ¶ added in v0.3.3
ParseOwner validates a refusal owner token.
type Reason ¶
type Reason string
Reason is the typed cause of a refusal. Reasons are flat kebab-case tokens — they are what automation switches on; prose belongs in Detail.
const ( // ReasonNone is the zero reason carried by an executed verdict. ReasonNone Reason = "" // ReasonUnsupportedStatement: only ALTER TABLE is supported. ReasonUnsupportedStatement Reason = "unsupported-statement" // ReasonIndexStatement: index maintenance has a native safe idiom // (CONCURRENTLY) and is never attempted here. ReasonIndexStatement Reason = "index-statement" // ReasonTableTooLarge: the size guard skipped the optimistic attempt. ReasonTableTooLarge Reason = "not-native-safe-table-too-large" // ReasonInsufficientPrivileges: the connected role lacks the access // the change needs; Detail names the exact missing GRANT (see // docs/engine-role.md). ReasonInsufficientPrivileges Reason = "insufficient-privileges" // ReasonUnsupportedPartitionedParent: the routed plan builds an index // on a partitioned parent, for which the required partition-aware // online sequence is not implemented. ReasonUnsupportedPartitionedParent Reason = "unsupported-partitioned-parent" // ReasonBudgetExceeded: the optimistic attempt exceeded its lock or // statement budget and was cancelled. ReasonBudgetExceeded Reason = "not-native-safe-budget-exceeded" // ReasonRewriteRequired: the submitted form is not safe to run as // submitted — it blocks the table, or it is a rename that breaks the // application instances still using the old name — and must run as a // safer sequence, but the planner has none to substitute (a // multi-operation statement, a pattern it cannot build, or a rename, // whose safe sequence spans application deploys). Running the // submitted form would falsify the plan's own reason, so the engine // refuses instead unless the override names the table. ReasonRewriteRequired Reason = "not-native-safe-rewrite-required" // that has no carrying path for the operation in this build (a // copy-and-swap rewrite the shadow-table engine does not carry yet). ReasonBackendUnavailable Reason = "backend-unavailable" // ReasonDestructiveChange: the change discards live data or structure — // a dropped column, constraint, index, or NOT NULL. The imperative // front door runs such a statement only when the destructive // acknowledgement names its table; desired-state execution refuses a // destructive plan whole and has no acknowledgement for it, so the // imperative statement is the way to run a reviewed destructive change. ReasonDestructiveChange Reason = "destructive-change" // ReasonPlanFingerprintMismatch: the plan recomputed at execution time // does not carry the fingerprint the caller pinned, so the plan a // reviewer approved is not the plan that would execute; nothing runs. ReasonPlanFingerprintMismatch Reason = "plan-fingerprint-mismatch" // ReasonCreateCollision: the create plan's target name is already // occupied — a relation or standalone type took it after the plan was // derived — so the greenfield create cannot run; the caller re-derives // the plan against the live catalog rather than assuming the // occupant's shape. ReasonCreateCollision Reason = "create-collision" // ReasonDeclarativeForeignKey: the desired-state plan adds a foreign // key, or creates a table that declares one, and desired-state // execution does not run foreign-key changes yet. The plan still shows // the change; the imperative front door runs ADD FOREIGN KEY online. ReasonDeclarativeForeignKey Reason = "declarative-foreign-key" // ReasonCopyAndSwapRefused: the change routes to copy-and-swap and the // route's own gates declined it — the preflight found a table shape or // an environment it cannot run against, or the engine refused mid-run // to keep an invariant. Cause carries the route's own refusal token // (see docs/refusal-classes.md), Class its routing class. ReasonCopyAndSwapRefused Reason = "copy-and-swap-refused" )
The refusal reasons Phase 1 can emit.
func Reasons ¶ added in v0.2.0
func Reasons() []Reason
Reasons returns the closed set of non-zero Reason values. It is part of the verdict contract: the tokens are what automation switches on, so the set changes only deliberately, every token is pinned by test, and every token has a row in docs/cli-output-examples.md's refusal-reason table.
type Refusal ¶ added in v0.3.3
type Refusal struct {
// contains filtered or unexported fields
}
Refusal is proof that a class, reason, and owner form a valid refusal: the fields are unexported and the only constructor validates them, so a refusal that reaches a renderer through WithRefusal has been classified. The classification registries in pkg/plan and pkg/migrate mint these; a refusal site never names a class on its own.
func CapabilityBoundary ¶ added in v0.3.3
CapabilityBoundary classifies a refusal of work the engine may learn to do.
func Environmental ¶ added in v0.3.3
Environmental classifies a refusal the run environment caused.
func InvariantViolation ¶ added in v0.3.3
InvariantViolation classifies a refusal of a state this build should not have produced.
func NewRefusal ¶ added in v0.3.3
NewRefusal validates and constructs a refusal proof. It rejects a reason outside Reasons(), a class outside Classes(), an owner outside Owners(), and an owner that is absent when the class is no-online-safety-problem or present when it is not.
func NoOnlineSafetyProblem ¶ added in v0.3.3
NoOnlineSafetyProblem classifies a refusal of work that is safe to run elsewhere and names who runs it.
func (Refusal) Cause ¶ added in v0.3.3
Cause returns the typed cause that narrows the refusal, when one exists.
func (Refusal) IsZero ¶ added in v0.3.3
IsZero reports whether r was never constructed through NewRefusal.
func (Refusal) Owner ¶ added in v0.3.3
Owner returns the refusal's validated owner; empty unless the class is no-online-safety-problem.
func (Refusal) Site ¶ added in v0.3.3
func (r Refusal) Site() RefusalSite
Site returns the typed refusal site that narrows the refusal, when one exists.
func (Refusal) WithSite ¶ added in v0.3.3
func (r Refusal) WithSite(site RefusalSite) Refusal
WithSite returns r narrowed by a typed refusal site.
type RefusalSite ¶ added in v0.3.3
type RefusalSite string
RefusalSite is a typed refusal-site discriminator used when a reason spans statement shapes but has no underlying cause.
const ( // RefusalSiteIndexSingleRelation is the plain one-relation DROP INDEX, // REINDEX INDEX, or REINDEX TABLE gate site. RefusalSiteIndexSingleRelation RefusalSite = "index-statement-single-relation" // RefusalSiteIndexOther is a multi-relation DROP INDEX, a DROP INDEX with // CASCADE, or a REINDEX scope that does not identify one relation. RefusalSiteIndexOther RefusalSite = "index-statement-other" )
type StatisticsRefresh ¶ added in v0.4.0
type StatisticsRefresh struct {
// Columns are the columns the statement retyped, in statement order.
Columns []string `json:"columns"`
// Refreshed reports that the ANALYZE committed.
Refreshed bool `json:"refreshed"`
// Pending is the ANALYZE still to run; empty when Refreshed.
Pending string `json:"pending,omitempty"`
}
StatisticsRefresh is the outcome of re-analyzing a table after a committed type change, which deletes the retyped columns' planner statistics. The change stays committed whether or not the refresh ran, so a refresh still owed leaves the verdict executed and names the ANALYZE to run.
type Verdict ¶
type Verdict struct {
// Outcome is what happened.
Outcome Outcome `json:"outcome"`
// Reason is the typed refusal cause; empty when executed.
Reason Reason `json:"reason,omitempty"`
// Class identifies how a consumer routes a refusal.
Class Class `json:"class,omitempty"`
// Owner identifies who owns work with no online-safety problem.
Owner Owner `json:"owner,omitempty"`
// Cause narrows the refusal reason to its typed discriminator: the
// budget that fired, or the partitioned-parent shape refused. Empty
// when the reason has none. Preserved on an accepted-blocking verdict.
Cause Cause `json:"cause,omitempty"`
// Code is the executor's stable outcome code (executor.OutcomeCode)
// carried by a failed verdict — flat kebab-case, part of the executor's
// report contract. It stays a plain string here so this contract
// package does not depend on the executor. Empty unless Outcome is
// OutcomeFailed.
Code string `json:"code,omitempty"`
// FailedStep is the 1-based position of the sequence step that failed,
// matching the numbering the planner's partial-failure contracts use;
// zero when the failure was not a mid-sequence one (a single-statement
// attempt that fails before its COMMIT rolls back and commits nothing).
// When Code is an outcome-unknown code, the step's own COMMIT may have
// landed: its state is unknown, not failed.
FailedStep int `json:"failed_step,omitempty"`
// FailedStepSQL is the failed step's statement — the step the planner's
// partial-failure contract says a retry resumes from. When Code is an
// outcome-unknown code, the step may have committed, so a retry cannot
// be assumed to resume here until the catalog is inspected.
FailedStepSQL string `json:"failed_step_sql,omitempty"`
// Attempts is how many bounded attempts ran before a lock-budget
// refusal, so automation can tell an exhausted bounded retry from a
// single cancelled attempt; zero for every other verdict.
Attempts int `json:"attempts,omitempty"`
// Statement is the submitted SQL.
Statement string `json:"statement"`
// Table is the target table (schema-qualified when the statement was),
// when the statement has one.
Table string `json:"table,omitempty"`
// Detail is the human explanation: why refused, or what committed.
Detail string `json:"detail,omitempty"`
// WritesBlocked is true on an executed or failed copy-and-swap verdict
// whose run blocked the table's writes (offline mode, --block-writes):
// the write fence went on, and every write that reached it was refused
// with SQLSTATE 55006. On a failed verdict it is set only when the fence
// went on, and Detail says whether it still stands; a blocked-writes run
// that stopped before its fence went on reports false, since the table
// kept taking writes. False for every other verdict, including a live
// run's.
WritesBlocked bool `json:"writes_blocked,omitempty"`
// Abandoned is true on a failed copy-and-swap verdict whose run the
// engine abandoned on a data fault: the shadow is dropped, the hold on
// the source — write fence or replication slot — is released, and the
// checkpoint row is deleted, so nothing remains and the corrected
// statement runs from the beginning without any acknowledgement. A
// data-fault verdict with it false is a run whose abandon did not
// finish: the row and the hold stand as far as the discard got, and
// the run is started over with the restart acknowledgement. It is the
// field automation branches on; Detail says the same for a reader.
// False for every other verdict, including a refusal: a run whose lock
// session is lost after its discard finished comes back as the
// shadow-lock-lost refusal, with nothing left behind but no field to say
// so. On RunDesired it is set on the failed entry of
// DesiredResult.Verdicts, not on the aggregate.
Abandoned bool `json:"abandoned,omitempty"`
// SaferIdiom is a native alternative to the refused statement, when one
// exists (e.g. CREATE INDEX CONCURRENTLY, ADD CONSTRAINT ... NOT VALID).
SaferIdiom string `json:"safer_idiom,omitempty"`
// Guidance is the typed manual path for a rewrite-required refusal,
// drawn from the suggest contract's Guidance vocabulary
// (docs/suggest-report.md), the same value the plan report's statement
// carries, or for a destructive-change refusal whose statement drops a
// column and adds it back under the same name. Detail states the steps
// for a human; Guidance is the key an automated caller branches on.
// Empty for every other verdict.
Guidance suggest.Guidance `json:"guidance,omitempty"`
// DependentViews names the views and materialized views that read the
// column a refused statement retypes or drops, each schema-qualified
// with every identifier quoted, sorted: the objects to drop or redefine
// before the change can run. The same list the plan report's refused
// decision carries, present whenever one blocks the change, whatever
// the refusal's reason, and empty otherwise.
DependentViews []string `json:"dependent_views,omitempty"`
// DependentPolicies names the row-level security policies that read
// the column a refused statement retypes or drops, each rendered
// "policy" ON "schema"."table" with every identifier quoted, sorted:
// the policies to drop before the change and recreate after it. The
// same list the plan report's refused decision carries, present
// whenever one blocks the change, whatever the refusal's reason, and
// empty otherwise.
DependentPolicies []string `json:"dependent_policies,omitempty"`
// DependentTriggers names the triggers whose UPDATE OF list or WHEN
// condition names the column a refused statement retypes or drops,
// each rendered "trigger" ON "schema"."table" with every identifier
// quoted, sorted. The same list the plan report's refused decision
// carries, present whenever one blocks the change, whatever the
// refusal's reason, and empty otherwise.
DependentTriggers []string `json:"dependent_triggers,omitempty"`
// DependentGeneratedColumns names the generated columns whose
// expression reads the column a refused statement retypes or drops,
// each rendered "schema"."table"."column" with every identifier quoted,
// sorted. The same list the plan report's refused decision carries,
// present whenever one blocks the change, whatever the refusal's
// reason, and empty otherwise.
DependentGeneratedColumns []string `json:"dependent_generated_columns,omitempty"`
// PartitionKeyTables names the partitioned tables whose partition key
// includes the column a refused statement retypes or drops, each
// schema-qualified with every identifier quoted, sorted. The same list
// the plan report's partition-key decision carries. Empty for every
// other verdict.
PartitionKeyTables []string `json:"partition_key_tables,omitempty"`
// ExecutedSQL is the ordered SQL the engine actually ran and committed.
// On an executed verdict it is the substituted safer native sequence
// (empty when the submitted form ran as-is — a non-empty value is what
// tells automation a substitution happened). On a failed verdict it is
// the committed prefix that remains: empty means nothing is known to
// have committed — and nothing at all did, unless Code is an
// outcome-unknown code, in which case the failed step itself (or the
// single statement) may have committed and the catalog decides.
ExecutedSQL []string `json:"executed_sql,omitempty"`
// Forced reports that --force overrode the engine's routing: the
// submitted form ran as-is instead of a safer substitution or a
// strategy refusal. It is the machine-readable audit record of the
// override.
Forced bool `json:"forced,omitempty"`
// AllowedDestructive reports that --allow-destructive acknowledged the
// data the statement discards: a statement the destructive-change gate
// would refuse went on through the engine's other gates instead. It is
// the machine-readable audit record of the acknowledgement, set on
// every verdict the acknowledged statement ends in.
AllowedDestructive bool `json:"allowed_destructive,omitempty"`
// BlockingPassthrough marks execution of an operator-accepted refusal.
BlockingPassthrough bool `json:"blocking_passthrough,omitempty"`
// LockTimeout is the explicit lock-acquisition budget.
LockTimeout string `json:"lock_timeout,omitempty"`
// StatementTimeout is the explicit statement execution budget.
StatementTimeout string `json:"statement_timeout,omitempty"`
// StatisticsRefresh reports the ANALYZE a committed type change owes
// the planner; nil when the statement retyped no column.
StatisticsRefresh *StatisticsRefresh `json:"statistics_refresh,omitempty"`
// IndexUsage is the live usage evidence of the index a destructive-change
// refusal of an accepted DROP INDEX would have dropped; nil for every
// other verdict.
IndexUsage *IndexUsage `json:"index_usage,omitempty"`
// contains filtered or unexported fields
}
Verdict is the structured outcome of one migrate invocation.
func (Verdict) Refusal ¶ added in v0.3.3
Refusal reconstructs the classified refusal a refused verdict carries, so a caller that aggregates verdicts into its own result propagates the class and owner through the same one path instead of copying fields. It fails on a verdict that is not refused, or whose reason, class, and owner do not validate together — a verdict this build cannot have produced. An in-process verdict returns its full proof, re-validated the same way and checked against the exported refusal fields, so a proof that never passed the constructors, or fields rewritten after WithRefusal, cannot reach an eligibility decision. A verdict decoded from JSON reconstructs class, reason, owner, and cause, but cannot recover its refusal site; site-keyed eligibility therefore fails closed after JSON decoding, while cause-keyed eligibility is decidable from the JSON fields.
func (Verdict) WithAcceptedBlocking ¶ added in v0.3.3
func (v Verdict) WithAcceptedBlocking(r Refusal, lockTimeout, statementTimeout time.Duration) (Verdict, error)
WithAcceptedBlocking returns an executed verdict that retains the accepted refusal identity and explicit non-zero execution budgets.
func (Verdict) WithRefusal ¶ added in v0.3.3
WithRefusal returns v as a refused verdict carrying r's reason, class, owner, cause, and full in-process proof. It is the one path from a classified refusal onto the verdict contract, so a site that forgets to classify has no Reason to set.