Skip to main content

Crate codewhale_workflow

Crate codewhale_workflow 

Source
Expand description

Typed Workflow IR and validation for CodeWhale.

This crate deliberately stops at the Rust-owned IR boundary. Runtime tool exposure, worktree application, replay, and model execution are layered on top only after their cancellation and evidence semantics are proven.

Re-exports§

pub use fleet_exact::EXACT_FLEET_SCHEMA_KIND;
pub use fleet_exact::EXACT_FLEET_SCHEMA_REVISION;
pub use fleet_exact::ExactFleet;
pub use fleet_exact::ExactFleetError;
pub use fleet_exact::ExactMember;
pub use fleet_exact::FrozenRoute;
pub use fleet_exact::LEGACY_FLEET_SCHEMA_KIND;
pub use fleet_exact::PermissionCeiling;
pub use fleet_exact::ROLE_ALIASES;
pub use fleet_exact::ROUTER_PUBLIC_ID;
pub use fleet_exact::ROUTER_PUBLIC_ROLE;
pub use fleet_exact::ReasoningTier;
pub use fleet_exact::RequestedReasoning;
pub use fleet_exact::RouterMember;
pub use fleet_exact::ShellCeiling;
pub use fleet_exact::canonical_member_key;
pub use fleet_exact::canonical_role_key;
pub use fleet_preflight::CredentialReadiness;
pub use fleet_preflight::EndpointIdentity;
pub use fleet_preflight::PreflightError;
pub use fleet_preflight::PreflightedRoute;
pub use fleet_preflight::RoutePreflight;
pub use fleet_reasoning::EffectiveReasoning;
pub use fleet_reasoning::EffectiveReasoningSource;
pub use fleet_reasoning::FAITHFUL_WIRE_TIERS;
pub use fleet_reasoning::FleetTaskReceipt;
pub use fleet_reasoning::ProviderEffectiveReasoning;
pub use fleet_reasoning::ProviderReasoningControl;
pub use fleet_reasoning::ROUTER_CALL_REASONING;
pub use fleet_reasoning::ROUTER_MAX_OUTPUT_TOKENS;
pub use fleet_reasoning::ROUTER_REASONING_FIELD;
pub use fleet_reasoning::ROUTER_SUMMARY_MAX_CHARS;
pub use fleet_reasoning::ROUTING_SCOPE;
pub use fleet_reasoning::ReasoningCapability;
pub use fleet_reasoning::ReasoningResolveError;
pub use fleet_reasoning::ResolvedReasoning;
pub use fleet_reasoning::RouterAvailability;
pub use fleet_reasoning::RouterCallDisclosure;
pub use fleet_reasoning::RouterCallInput;
pub use fleet_reasoning::RouterCallPlan;
pub use fleet_reasoning::RouterDecision;
pub use fleet_reasoning::RouterDecisionError;
pub use fleet_reasoning::RouterIdentity;
pub use fleet_reasoning::RoutingDisclosure;
pub use fleet_reasoning::RoutingPayload;
pub use fleet_reasoning::TaskShape;
pub use fleet_reasoning::bounded_routing_payload;
pub use fleet_reasoning::parse_router_decision;
pub use fleet_reasoning::resolve_exact_member_reasoning;
pub use fleet_reasoning::resolve_legacy_reasoning;
pub use fleet_reasoning::router_call_plan;
pub use fleet_reasoning::router_system_prompt;
pub use fleet_reasoning::router_user_message;
pub use fleet_reasoning::transport_disclosure;
pub use fleet_snapshot::FleetSnapshot;
pub use fleet_snapshot::FleetSnapshotLegacyRole;
pub use fleet_snapshot::FleetSnapshotMember;
pub use fleet_snapshot::FleetSnapshotRouter;
pub use fleet_snapshot::QualifiedFleetId;
pub use fleet_snapshot::captured_legacy_inline_router;
pub use fleet_snapshot::verify_snapshot_content_hash;
pub use reasoning_router::CapturedReasoningRouter;
pub use reasoning_router::FleetRouterRef;
pub use reasoning_router::LEGACY_INLINE_ROUTER_ORIGIN;
pub use reasoning_router::QualifiedRouterId;
pub use reasoning_router::REASONING_ROUTER_DIR;
pub use reasoning_router::REASONING_ROUTER_SCHEMA_KIND;
pub use reasoning_router::REASONING_ROUTER_SERVICE_KIND;
pub use reasoning_router::ReasoningRouterError;
pub use reasoning_router::ReasoningRouterProfile;
pub use reasoning_router::RouterCallReasoning;
pub use redaction::REDACTION_ABSOLUTE_PATH;
pub use redaction::REDACTION_RELATIVE_PATH;
pub use redaction::REDACTION_SECRET;
pub use redaction::Redaction;
pub use redaction::redact_for_disclosure;

Modules§

experimental_search
Provider-neutral experimental search authoring for Workflow.
fleet_composition
Setup-time Fleet composition: a suggestion schema with no runtime authority.
fleet_exact
Exact named-Fleet schema — fully resolved members, no late model choice.
fleet_preflight
Worker route preflight: everything about a route that must be true and frozen before a Workflow starts, and certainly before any Router is asked anything.
fleet_reasoning
The one requested → effective reasoning resolver, with provider capability normalization, preserved provenance, and durable receipts that carry disclosure without content.
fleet_snapshot
Immutable Fleet snapshot taken at Workflow start.
reasoning_router
The Adaptive Reasoning Router — a saved, reusable service, not a Fleet member.
redaction
Redaction for anything that can reach a log, a span, or a durable receipt.

Structs§

BranchCandidate
BranchResult
BranchSpec
BranchTournament
BudgetSpec
CompletionRequest
CompletionResponse
CondSpec
ControlNodeResult
ElevationOptions
Options that refine elevation assessment beyond the IR itself.
ExpandSpec
FleetDocument
A parsed fleet file plus the provenance a Workflow snapshot needs.
FleetRoleMap
Named fleet roster: role name → AgentProfile id.
FleetSearchRoot
One labelled place fleet files are looked up.
GateSpec
One gate node in a Workflow definition.
GateStatusLine
HandoffArtifact
Lane-scoped handoff artifact produced by a role for the next role.
IterationReceipt
What one iteration actually did.
LaneGateBoard
In-memory (and serializable) gate + handoff store for one lane.
LeafResult
LeafSpec
LoopUntilSpec
MockLeafOutcome
MockModelProvider
MockWorkflowExecutor
ModelCapabilities
ModelPolicy
NamedFleet
Parsed named fleet file.
ParetoFrontier
PermissionSpec
Phase
PhasePlan
PromotionGate
PromotionGateDecision
PromotionPolicy
ProviderModel
ProviderRegistry
ReduceSpec
ReplayControlRecord
ReplayLeafRecord
ReplayOptions
ResolvedModel
ResolvedWorkflowAgent
Result of resolving a workflow step against a fleet roster.
ReviewRepairBounds
Explicit ceilings on a review→repair loop. There is no unbounded variant.
ReviewRepairLoop
A bounded review→repair loop over one lane’s artifact.
ReviewRepairPolicy
Policy knobs that are not ceilings.
RouteReceipt
The exact route a reviewer or verifier ran on.
SequenceSpec
StudentReplayMetrics
StudentReplayResult
StudentReplayTestResult
Task
TeacherCandidate
TeacherReviewReport
TeacherReviewSpec
WorkflowConfig
WorkflowExecution
WorkflowFleetLimits
WorkflowFleetShape
WorkflowMemoUsage
WorkflowPlan
WorkflowPlanElevation
Summary of why a Workflow plan needs (or does not need) elevated approval.
WorkflowReplayExecutor
WorkflowReplayTrace
WorkflowSpec
WorkflowUsage

Enums§

AgentType
ControlNodeKind
FailurePolicy
FleetRoleResolveError
FleetSchema
Which form a fleets/<name>.toml file is in.
GateError
GateKind
Kind of verification / review gate.
GateOn
When a gate fires relative to role lifecycle.
GateOnFail
Policy when a gate fails.
GateOutcome
Outcome reported by a verifier/reviewer/human for a gate evaluation.
GateState
Live state of one gate within a lane.
IsolationMode
IterationVerdict
The verdict a reviewer/verifier pair produced for one iteration.
JavascriptWorkflowError
JsonRepairError
ModelPolicyError
ModelProviderError
ModelRole
ModelSelectionSource
NamedFleetError
PlanRiskHint
Coarse risk classification from the structured plan risk field.
PromotionStrategy
ReviewRepairError
Refusal from ReviewRepairLoop::begin_iteration or ReviewRepairLoop::record_iteration.
RoutedBy
Who chose the route for a step. Distinguishing these is the difference between “the user picked this model” and “a Router picked it”.
StopReason
Why a review→repair loop stopped. Every variant is terminal.
TaskMode
TeacherCandidateKind
TeacherCandidateStatus
TournamentOrdering
WorkflowExecutionError
WorkflowFleetLimitError
WorkflowNode
WorkflowReplayError
WorkflowRunStatus
WorkflowValidationError

Constants§

DEFAULT_FLEET_WORKFLOW_MAX_AGENTS
Default hard ceiling on total agents a Fleet-shaped Workflow plan may launch. Matches the imperative VM lifetime cap (1_000 agents per run).
DEFAULT_FLEET_WORKFLOW_MAX_DEPTH
DEFAULT_HIGH_BUDGET_THRESHOLD
Default soft token budget from product config ([workflow].default_token_budget). Plans requesting more than this are treated as high-budget.
STOPSHIP_REQUIRED_ROLES
Required roles for the stopship dogfood fleet (#4178).

Traits§

ModelProvider

Functions§

assess_plan_risk_string
Lightweight assessment from a planner risk string alone (before IR lower).
assess_workflow_elevation
Assess elevation for a compiled WorkflowSpec.
compile_javascript_workflow
compile_typescript_workflow
compute_leaf_input_hash
exact_schema_revision
The schema revision an exact document is expected to declare.
is_shell_tool
True for a tool that can run a shell command.
is_write_tool
True for a tool that can modify files.
leaf_is_write_capable
A leaf is write-capable when it can mutate the workspace.
leaf_wants_worktree
Effective worktree flag for a leaf given whether it is being lowered inside a parallel branch.
load_named_fleet
Load fleet by name from search paths (first hit wins).
load_named_fleet_file
normalize_file_scope_root
Normalize the suffix-glob spelling accepted by declarative workflow file_scope into the concrete directory root enforced at runtime.
normalize_token
Normalize a role/profile token: trim, lowercase. Returns None if empty or if the token contains whitespace / quotes / backticks / =.
parse_json_with_repair
parse_named_fleet
Parse a fleet TOML document.
repair_json_text_once
resolve_workflow_agent
Resolve step identity from optional role + optional explicit profile against a fleet role map.
scopes_overlap
stopship_gate_pipeline
Canonical stopship-style gate pipeline (scout → implementer → reviewer → verifier → release_lead).
teacher_candidates_from_execution
validate_role_token
Validate a role token the same way leaf profiles are validated.

Type Aliases§

JavascriptWorkflowResult
WorkflowIr
WorkflowPhase
WorkflowRole
WorkflowTask