Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
examples plus a one-pass repair for common `ctx.*` authoring aliases (#2670).
Leaf, branch, and workflow execution results now carry deterministic token
and cost telemetry fields that the mock executor can aggregate without live
provider calls or runtime sub-agent fanout (#2486).
provider calls or runtime sub-agent fanout (#2486). A crate-only replay
executor now evaluates workflows from recorded leaf/control records, computes
stable SHA-256 leaf input hashes, and marks missing records as
`replay_diverged` instead of calling models again (#2673); the runtime replay
command and live-provider replay fallback remain deferred.
Thanks @AdityaVG13 for the WhaleFlow draft and cost-tracking direction.
- Added a state-store v2 schema migration for WhaleFlow trace tables covering
workflow, branch, leaf, control-node, and teacher-candidate runs. The
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion crates/tui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
examples plus a one-pass repair for common `ctx.*` authoring aliases (#2670).
Leaf, branch, and workflow execution results now carry deterministic token
and cost telemetry fields that the mock executor can aggregate without live
provider calls or runtime sub-agent fanout (#2486).
provider calls or runtime sub-agent fanout (#2486). A crate-only replay
executor now evaluates workflows from recorded leaf/control records, computes
stable SHA-256 leaf input hashes, and marks missing records as
`replay_diverged` instead of calling models again (#2673); the runtime replay
command and live-provider replay fallback remain deferred.
Thanks @AdityaVG13 for the WhaleFlow draft and cost-tracking direction.
- Added a state-store v2 schema migration for WhaleFlow trace tables covering
workflow, branch, leaf, control-node, and teacher-candidate runs. The
Expand Down
1 change: 1 addition & 0 deletions crates/whaleflow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ description = "Typed WhaleFlow workflow IR and validation for CodeWhale"
[dependencies]
serde.workspace = true
serde_json.workspace = true
sha2.workspace = true
thiserror.workspace = true

[target.'cfg(not(target_env = "ohos"))'.dependencies]
Expand Down
15 changes: 12 additions & 3 deletions crates/whaleflow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//! exposure, worktree application, replay, and model execution are layered on
//! top only after their cancellation and evidence semantics are proven.

mod replay;
#[cfg(not(target_env = "ohos"))]
mod starlark_authoring;

Expand All @@ -13,6 +14,7 @@ use std::path::Path;
use serde::{Deserialize, Serialize};
use thiserror::Error;

pub use replay::*;
#[cfg(not(target_env = "ohos"))]
pub use starlark_authoring::{
compile_starlark_workflow, compile_starlark_workflow_with_repair, repair_starlark_workflow_once,
Expand Down Expand Up @@ -475,7 +477,7 @@ impl WorkflowUsage {
self.input_tokens.saturating_add(self.output_tokens)
}

fn add_assign(&mut self, other: Self) {
pub(crate) fn add_assign(&mut self, other: Self) {
self.input_tokens = self.input_tokens.saturating_add(other.input_tokens);
self.output_tokens = self.output_tokens.saturating_add(other.output_tokens);
self.cost_microusd = self.cost_microusd.saturating_add(other.cost_microusd);
Expand All @@ -502,9 +504,10 @@ pub enum WorkflowRunStatus {
Succeeded,
Failed,
Cancelled,
ReplayDiverged,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ControlNodeKind {
BranchSet,
Expand Down Expand Up @@ -546,6 +549,10 @@ impl WorkflowExecution {
pub fn mark_failed(&mut self) {
self.status = WorkflowRunStatus::Failed;
}

pub(crate) fn mark_replay_diverged(&mut self) {
self.status = WorkflowRunStatus::ReplayDiverged;
}
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
Expand Down Expand Up @@ -932,7 +939,9 @@ fn node_id(node: &WorkflowNode) -> String {
}
}

fn validate_workflow_nodes(nodes: &[WorkflowNode]) -> Result<(), WorkflowExecutionError> {
pub(crate) fn validate_workflow_nodes(
nodes: &[WorkflowNode],
) -> Result<(), WorkflowExecutionError> {
let mut seen = BTreeSet::new();
validate_workflow_nodes_inner(nodes, &mut seen)
}
Expand Down
Loading
Loading