checkpoint

⚒️ Generated with [Fabro](https://fabro.sh)
This commit is contained in:
Fabro 2026-03-15 14:55:13 -04:00
parent d041663320
commit c0b3f20670
5 changed files with 74 additions and 0 deletions

52
checkpoint.json Normal file
View file

@ -0,0 +1,52 @@
{
"timestamp": "2026-03-15T18:55:13.431676Z",
"current_node": "toolchain",
"completed_nodes": [
"start",
"toolchain"
],
"node_retries": {
"toolchain": 1,
"start": 1
},
"context_values": {
"command.stderr": "",
"internal.run_id": "01KKSDEQC3GZ6NB715GFVPPRG6",
"graph.goal": "# Add `goal` to WorkflowRunStarted and render in `fabro logs --pretty`\n\n## Context\n\n`fabro logs --pretty` shows `▶ WorkflowName run_id` at the top but doesn't show what the workflow is trying to do. The goal is available via `graph.goal()` at the emit site but isn't included in the event. Adding it gives users immediate context when reading logs.\n\nGoals can be short one-liners or full markdown documents.\n\n## Changes\n\n### 1. Add `goal` field to `WorkflowRunEvent::WorkflowRunStarted` (`event.rs:~11`)\n\n```rust\n#[serde(default, skip_serializing_if = \"Option::is_none\")]\ngoal: Option<String>,\n```\n\n`Option` + `serde(default)` for backward compat with old JSONL (same pattern as `base_sha`, `run_branch`).\n\n### 2. Populate at emit site (`engine.rs:~1209`)\n\nAdd `goal:` field using `graph.goal()`. Emit `None` when empty, `Some(...)` otherwise:\n\n```rust\ngoal: {\n let g = graph.goal();\n if g.is_empty() { None } else { Some(g.to_string()) }\n},\n```\n\n### 3. Update all other construction sites\n\nGrep for `WorkflowRunStarted {` — tests in `event.rs` construct this variant. Add `goal: None` to each.\n\n### 4. Render in `logs.rs` `format_event_pretty` (`logs.rs:~203`)\n\nAfter the existing header line, if `goal` is present, render it below indented. Use `styles.render_markdown_width()` for markdown rendering (same approach as `Agent.AssistantMessage` at line 355).\n\n- Short goal (single line, no markdown): render inline on same line or as a single indented line\n- Multi-line / markdown goal: render with `render_markdown_width` + indent, same as assistant messages\n\n```rust\n\"WorkflowRunStarted\" => {\n let name = str_field(&envelope, \"workflow_name\").unwrap_or(\"?\");\n let run_id = str_field(&envelope, \"run_id\").unwrap_or(\"?\");\n let header = format!(\n \"{} {} {} {}\",\n styles.dim.apply_to(&ts),\n styles.bold_cyan.apply_to(\"\\u{25b6}\"),\n styles.bold.apply_to(name),\n styles.dim.apply_to(run_id),\n );\n match str_field(&envelope, \"goal\") {\n Some(goal) if !goal.is_empty() => {\n let indent = \" \";\n let term_width = fabro_util::terminal::Styles::terminal_width();\n let wrap_width = term_width.saturating_sub(indent.len());\n let rendered = styles.render_markdown_width(goal, wrap_width);\n let body: String = rendered\n .lines()\n .map(|l| format!(\"{indent}{l}\"))\n .collect::<Vec<_>>()\n .join(\"\\n\");\n Some(format!(\"{header}\\n{body}\\n\"))\n }\n _ => Some(header),\n }\n}\n```\n\n### 5. Tests (`event.rs`)\n\n- Update existing `workflow_run_started` serialization tests to include `goal`\n- Add test: round-trip with `goal: Some(\"Fix the bug\")`\n- Existing backward-compat test (`workflow_run_completed_backward_compat_without_new_fields` pattern) — add one for `WorkflowRunStarted` without `goal` field deserializing to `goal: None`\n\n## Files to modify\n\n| File | What |\n|---|---|\n| `lib/crates/fabro-workflows/src/event.rs` | Add `goal` field, update trace, update tests |\n| `lib/crates/fabro-workflows/src/engine.rs` | Populate `goal` at emit site |\n| `lib/crates/fabro-workflows/src/cli/logs.rs` | Render goal in pretty logs |\n\n## Verification\n\n1. `cargo test -p fabro-workflows`\n2. `cargo build --workspace`\n3. `cargo test --workspace`\n4. `cargo clippy --workspace -- -D warnings`\n5. `cargo fmt --check --all`\n",
"failure_signature": "",
"internal.thread_id": "start",
"thread.start.current_node": "toolchain",
"current.preamble": "Goal: # Add `goal` to WorkflowRunStarted and render in `fabro logs --pretty`\n\n## Context\n\n`fabro logs --pretty` shows `▶ WorkflowName run_id` at the top but doesn't show what the workflow is trying to do. The goal is available via `graph.goal()` at the emit site but isn't included in the event. Adding it gives users immediate context when reading logs.\n\nGoals can be short one-liners or full markdown documents.\n\n## Changes\n\n### 1. Add `goal` field to `WorkflowRunEvent::WorkflowRunStarted` (`event.rs:~11`)\n\n```rust\n#[serde(default, skip_serializing_if = \"Option::is_none\")]\ngoal: Option<String>,\n```\n\n`Option` + `serde(default)` for backward compat with old JSONL (same pattern as `base_sha`, `run_branch`).\n\n### 2. Populate at emit site (`engine.rs:~1209`)\n\nAdd `goal:` field using `graph.goal()`. Emit `None` when empty, `Some(...)` otherwise:\n\n```rust\ngoal: {\n let g = graph.goal();\n if g.is_empty() { None } else { Some(g.to_string()) }\n},\n```\n\n### 3. Update all other construction sites\n\nGrep for `WorkflowRunStarted {` — tests in `event.rs` construct this variant. Add `goal: None` to each.\n\n### 4. Render in `logs.rs` `format_event_pretty` (`logs.rs:~203`)\n\nAfter the existing header line, if `goal` is present, render it below indented. Use `styles.render_markdown_width()` for markdown rendering (same approach as `Agent.AssistantMessage` at line 355).\n\n- Short goal (single line, no markdown): render inline on same line or as a single indented line\n- Multi-line / markdown goal: render with `render_markdown_width` + indent, same as assistant messages\n\n```rust\n\"WorkflowRunStarted\" => {\n let name = str_field(&envelope, \"workflow_name\").unwrap_or(\"?\");\n let run_id = str_field(&envelope, \"run_id\").unwrap_or(\"?\");\n let header = format!(\n \"{} {} {} {}\",\n styles.dim.apply_to(&ts),\n styles.bold_cyan.apply_to(\"\\u{25b6}\"),\n styles.bold.apply_to(name),\n styles.dim.apply_to(run_id),\n );\n match str_field(&envelope, \"goal\") {\n Some(goal) if !goal.is_empty() => {\n let indent = \" \";\n let term_width = fabro_util::terminal::Styles::terminal_width();\n let wrap_width = term_width.saturating_sub(indent.len());\n let rendered = styles.render_markdown_width(goal, wrap_width);\n let body: String = rendered\n .lines()\n .map(|l| format!(\"{indent}{l}\"))\n .collect::<Vec<_>>()\n .join(\"\\n\");\n Some(format!(\"{header}\\n{body}\\n\"))\n }\n _ => Some(header),\n }\n}\n```\n\n### 5. Tests (`event.rs`)\n\n- Update existing `workflow_run_started` serialization tests to include `goal`\n- Add test: round-trip with `goal: Some(\"Fix the bug\")`\n- Existing backward-compat test (`workflow_run_completed_backward_compat_without_new_fields` pattern) — add one for `WorkflowRunStarted` without `goal` field deserializing to `goal: None`\n\n## Files to modify\n\n| File | What |\n|---|---|\n| `lib/crates/fabro-workflows/src/event.rs` | Add `goal` field, update trace, update tests |\n| `lib/crates/fabro-workflows/src/engine.rs` | Populate `goal` at emit site |\n| `lib/crates/fabro-workflows/src/cli/logs.rs` | Render goal in pretty logs |\n\n## Verification\n\n1. `cargo test -p fabro-workflows`\n2. `cargo build --workspace`\n3. `cargo test --workspace`\n4. `cargo clippy --workspace -- -D warnings`\n5. `cargo fmt --check --all`\n\n",
"graph.model_stylesheet": "\n * { backend: api; model: claude-opus-4-6;}\n ",
"command.output": "cargo 1.94.0 (85eff7c80 2026-01-15)\n",
"internal.node_visit_count": 1,
"internal.retry_count.toolchain": 1,
"internal.retry_count.start": 1,
"failure_class": "",
"current_node": "toolchain",
"graph.rankdir": "LR",
"outcome": "success",
"internal.fidelity": "compact"
},
"logs": [],
"node_outcomes": {
"toolchain": {
"status": "success",
"context_updates": {
"command.output": "cargo 1.94.0 (85eff7c80 2026-01-15)\n",
"command.stderr": ""
},
"notes": "Script completed: command -v cargo >/dev/null || { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && sudo ln -sf $HOME/.cargo/bin/* /usr/local/bin/; }; cargo --version 2>&1",
"duration_ms": 41
},
"start": {
"status": "success",
"duration_ms": 0
}
},
"next_node_id": "preflight_compile",
"node_visits": {
"toolchain": 1,
"start": 1
}
}

6
nodes/start/status.json Normal file
View file

@ -0,0 +1,6 @@
{
"status": "success",
"notes": null,
"failure_reason": null,
"timestamp": "2026-03-15T18:55:13.375582+00:00"
}

View file

@ -0,0 +1,5 @@
{
"command": "command -v cargo >/dev/null || { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && sudo ln -sf $HOME/.cargo/bin/* /usr/local/bin/; }; cargo --version 2>&1",
"language": "shell",
"timeout_ms": null
}

View file

@ -0,0 +1,5 @@
{
"duration_ms": 41,
"exit_code": 0,
"timed_out": false
}

View file

@ -0,0 +1,6 @@
{
"status": "success",
"notes": "Script completed: command -v cargo >/dev/null || { curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && sudo ln -sf $HOME/.cargo/bin/* /usr/local/bin/; }; cargo --version 2>&1",
"failure_reason": null,
"timestamp": "2026-03-15T18:55:13.431446+00:00"
}