diff --git a/test/docs/CHECKLIST.md b/test/docs/CHECKLIST.md index dec4c79ca..b17a42a93 100644 --- a/test/docs/CHECKLIST.md +++ b/test/docs/CHECKLIST.md @@ -1,9 +1,8 @@ # DOT Documentation Examples Test Checklist ## Summary -- 36 .dot files (29 extracted from full workflows + 7 assembled from snippets) -- Covers 29 doc pages, 118 DOT code blocks (29 full, 89 snippets) -- Skipped: changelog/2026-02-27 (deprecated `handler=codergen` syntax) +- 40 .dot files (34 extracted from full workflows + 6 assembled from snippets) +- Skipped: changelog/2026-02-27 (deprecated `handler=codergen` syntax), human-tools/vnc-access, human-tools/vpn-connections (workflows not yet working) ## Phase 1: Validate (`arc validate`) @@ -11,66 +10,68 @@ |---|------|--------|-------| | 1 | agents/outputs/output-patterns.dot | PASS | assembled | | 2 | agents/prompts/pipeline.dot | PASS | added start/exit | -| 3 | changelog/2026-03-05/new-features.dot | PASS | assembled, added fallback | -| 4 | core-concepts/agents/backend-demo.dot | PASS | assembled | -| 5 | core-concepts/models/example.dot | PASS | added start/exit + wiring | -| 6 | core-concepts/workflows/my-workflow.dot | PASS | | -| 7 | examples/clone-substack/clone-substack.dot | PASS | 578 lines | -| 8 | examples/definition-of-done/spec-dod-multimodel.dot | PASS | fixed condition quoting + fallbacks | -| 9 | examples/definition-of-done/spec-dod.dot | PASS | fixed condition quoting + fallbacks | -| 10 | examples/nlspec-conformance/n-l-spec-conformance.dot | PASS | added retry_target="fix" to goal_gate node | -| 11 | examples/semantic-port/semantic-port.dot | PASS | added fallback edges | -| 12 | examples/solitaire/build-solitaire.dot | PASS | fixed fallback_retry_target to match node name | -| 13 | execution/context/example.dot | PASS | added start/exit | -| 14 | execution/failures/example.dot | PASS | added start/exit | -| 15 | execution/failures/example-02.dot | PASS | added start/exit | -| 16 | execution/failures/example-03.dot | PASS | added start/exit | -| 17 | execution/failures/example-04.dot | PASS | added start/exit | -| 18 | execution/interviews/default-choice.dot | PASS | assembled | -| 19 | execution/run-configuration/c-i.dot | PASS | added start/exit, has run.toml | -| 20 | getting-started/why-arc/plan-implement.dot | PASS | | -| 21 | reference/dot-language/implement-feature.dot | PASS | | -| 22 | reference/dot-language/my-workflow.dot | PASS | | -| 23 | tutorials/branch-loop/branch-loop.dot | PASS | | -| 24 | tutorials/ensemble/ensemble.dot | PASS | | -| 25 | tutorials/hello-world/hello.dot | PASS | | -| 26 | tutorials/hello-world/sub-agent.dot | PASS | | -| 27 | tutorials/hello-world/tool-use.dot | PASS | | -| 28 | tutorials/multi-model/multi-model.dot | PASS | | -| 29 | tutorials/parallel-review/parallel.dot | PASS | | -| 30 | tutorials/plan-implement/plan-implement.dot | PASS | has @prompt stub | -| 31 | workflows/human-in-the-loop/hitl-patterns.dot | PASS | assembled | -| 32 | workflows/stages-and-nodes/all-node-types.dot | PASS | assembled, 15 nodes | -| 33 | workflows/stylesheets/example.dot | PASS | | -| 34 | workflows/transitions/transition-patterns.dot | PASS | assembled, added fallbacks | -| 35 | workflows/variables/check.dot | PASS | has run.toml | -| 36 | workflows/variables/example.dot | PASS | added start/exit | +| 3 | changelog/2026-03-05/new-features.dot | PASS | assembled | +| 4 | core-concepts/models/example.dot | PASS | added start/exit + wiring | +| 5 | core-concepts/workflows/my-workflow.dot | PASS | | +| 6 | examples/clone-substack/clone-substack.dot | PASS | 578 lines | +| 7 | examples/definition-of-done/spec-dod-multimodel.dot | PASS | | +| 8 | examples/definition-of-done/spec-dod.dot | PASS | | +| 9 | examples/nlspec-conformance/n-l-spec-conformance.dot | PASS | | +| 10 | examples/semantic-port/semantic-port.dot | PASS | | +| 11 | examples/solitaire/build-solitaire.dot | PASS | | +| 12 | execution/context/example.dot | PASS | added start/exit | +| 13 | execution/failures/example.dot | PASS | added start/exit | +| 14 | execution/failures/example-02.dot | PASS | added start/exit + label | +| 15 | execution/failures/example-03.dot | PASS | added start/exit + referenced nodes | +| 16 | execution/failures/example-04.dot | PASS | added start/exit | +| 17 | execution/interviews/default-choice.dot | PASS | assembled | +| 18 | execution/run-configuration/c-i.dot | PASS | added start/exit, has run.toml | +| 19 | getting-started/why-arc/plan-implement.dot | PASS | | +| 20 | human-tools/preview/build-and-preview.dot | PASS | new | +| 21 | integrations/brave-search/research.dot | PASS | new | +| 22 | integrations/daytona/example.dot | PASS | added start/exit | +| 23 | reference/dot-language/implement-feature.dot | PASS | | +| 24 | reference/dot-language/my-workflow.dot | PASS | | +| 25 | tutorials/branch-loop/branch-loop.dot | PASS | | +| 26 | tutorials/ensemble/ensemble.dot | PASS | | +| 27 | tutorials/hello-world/hello.dot | PASS | | +| 28 | tutorials/hello-world/sub-agent.dot | PASS | | +| 29 | tutorials/hello-world/tool-use.dot | PASS | | +| 30 | tutorials/multi-model/multi-model.dot | PASS | | +| 31 | tutorials/parallel-review/parallel.dot | PASS | | +| 32 | tutorials/plan-implement/plan-implement.dot | PASS | has @prompt stub | +| 33 | tutorials/sub-workflow/implement-and-test.dot | PASS | new | +| 34 | tutorials/sub-workflow/sub-workflow.dot | PASS | new | +| 35 | workflows/human-in-the-loop/hitl-patterns.dot | PASS | assembled | +| 36 | workflows/stages-and-nodes/all-node-types.dot | PASS | assembled | +| 37 | workflows/stylesheets/example.dot | PASS | | +| 38 | workflows/transitions/transition-patterns.dot | PASS | assembled | +| 39 | workflows/variables/check.dot | PASS | has run.toml | +| 40 | workflows/variables/example.dot | PASS | added start/exit | ## Phase 2: Dry Run (`arc run start --dry-run --auto-approve`) | # | File | Status | Notes | |---|------|--------|-------| -| 1-36 | (all) | | | +| 1-40 | (all) | | | ## Phase 3: Haiku (`arc run start --model claude-haiku-4-5 --auto-approve`) | # | File | Status | Notes | |---|------|--------|-------| -| 1-36 | (all) | | | +| 1-40 | (all) | | | ## Phase 4: Full (`arc run start --auto-approve`) | # | File | Status | Notes | |---|------|--------|-------| -| 1-36 | (all) | | | +| 1-40 | (all) | | | ## Issues Found During Validation (fixed in test DOTs) -1. **Condition parser doesn't support multi-word values** — `preferred_label=More fixes needed` fails parse. Fixed by using underscored values (`more_fixes_needed`). Affects: definition-of-done examples. **This is a docs bug** — the source DOTs in docs/examples/ use multi-word condition values that won't parse. +1. **Several "full" digraphs in docs lack start/exit nodes** — 10 extracted DOTs were minimal digraph wrappers showing graph-level attributes without start/exit nodes or wiring. Fixed by adding them in test DOTs. -2. **Several "full" digraphs in docs lack start/exit nodes** — 9 extracted DOTs were minimal digraph wrappers showing graph-level attributes without start/exit nodes or wiring. Fixed by adding them in test DOTs. - -3. **All-conditional edges need unconditional fallback** — Validator requires at least one fallback edge when a node has only conditional outgoing edges. Fixed by adding fallback edges. Affects: semantic-port, definition-of-done examples, and assembled snippet DOTs. +2. **All-conditional edges need unconditional fallback** — Validator requires at least one fallback edge when a node has only conditional outgoing edges. Fixed by adding fallback edges in assembled DOTs. ## Commands diff --git a/test/docs/agents/outputs/output-patterns.dot b/test/docs/agents/outputs/output-patterns.dot index dbf646bff..2423a89b2 100644 --- a/test/docs/agents/outputs/output-patterns.dot +++ b/test/docs/agents/outputs/output-patterns.dot @@ -1,17 +1,8 @@ -// Assembled from docs/agents/outputs.mdx snippets -// Tests output context keys and routing directives - digraph OutputPatterns { - graph [goal="Exercise output and routing patterns from the outputs docs page"] + start [shape=Mdiamond] - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - - // Line 25-29: Context keys from prior stages - plan [label="Plan", prompt="Create an implementation plan."] - implement [label="Implement", prompt="Implement the plan."] - - // Line 68-78: Review node with routing directives + plan [label="Plan"] + implement [label="Implement"] review [ label="Review", shape=tab, @@ -20,14 +11,10 @@ digraph OutputPatterns { If everything looks good, respond with: \ {\"preferred_next_label\": \"approve\"}." ] + exit [shape=Msquare] - fix [label="Fix", prompt="Fix the issues found."] - - // Wiring start -> plan -> implement -> review - - review -> fix [label="Fix"] - review -> exit [label="Approve"] - - fix -> review + review -> implement [label="Fix"] + review -> exit [label="Approve"] + review -> exit [weight=-1] } diff --git a/test/docs/agents/prompts/pipeline.dot b/test/docs/agents/prompts/pipeline.dot index 286d8fb35..35c3e5cef 100644 --- a/test/docs/agents/prompts/pipeline.dot +++ b/test/docs/agents/prompts/pipeline.dot @@ -1,10 +1,9 @@ digraph Pipeline { graph [goal="Add a /health endpoint to the API server"] - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - + start [shape=Mdiamond] implement [prompt="Implement the following: $goal"] + exit [shape=Msquare] start -> implement -> exit } diff --git a/test/docs/changelog/2026-03-05/new-features.dot b/test/docs/changelog/2026-03-05/new-features.dot index 685ad6a0f..4ae8d78bd 100644 --- a/test/docs/changelog/2026-03-05/new-features.dot +++ b/test/docs/changelog/2026-03-05/new-features.dot @@ -1,28 +1,7 @@ -// Assembled from docs/changelog/2026-03-05.mdx snippets -// Tests: condition expressions, model assignment, per-node max_visits, -// $$ escape, and simplified handler type names - digraph NewFeatures { - graph [goal="Exercise new features from the 2026-03-05 changelog"] + start [shape=Mdiamond] + stage_a [label="Stage A"] + exit [shape=Msquare] - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - - // Line 85: Model assignment (gpt54-pro) - stage_a [model="gpt54-pro", type="agent", prompt="The cost is $$50 and the goal is $goal"] - - // Line 95: Per-node loop limit - verify [type="agent", max_visits=20, prompt="Verify the implementation."] - - // Line 128-129: Simplified handler type names - stage_b [type="prompt", prompt="Summarize the results."] - - // Wiring with condition expressions (line 31) - start -> stage_a -> verify - - verify -> stage_b [label="Pass", condition="outcome=success"] - verify -> stage_a [label="Retry", condition="outcome=fail"] - verify -> exit [label="Fallback"] - - stage_b -> exit + start -> stage_a -> exit } diff --git a/test/docs/core-concepts/agents/backend-demo.dot b/test/docs/core-concepts/agents/backend-demo.dot deleted file mode 100644 index 449260cb9..000000000 --- a/test/docs/core-concepts/agents/backend-demo.dot +++ /dev/null @@ -1,18 +0,0 @@ -// Assembled from docs/core-concepts/agents.mdx snippets -// Tests backend attribute and inline vs external prompts - -digraph BackendDemo { - graph [goal="Exercise agent backend and prompt patterns from the agents docs page"] - - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - - // Line 47: CLI backend with explicit provider - implement [label="Implement", backend="cli", llm_provider="anthropic"] - - // Line 95-96: Inline prompt - plan [label="Plan", prompt="Analyze the codebase and write a step-by-step plan."] - - // Wiring - start -> plan -> implement -> exit -} diff --git a/test/docs/core-concepts/agents/run-backend-demo.toml b/test/docs/core-concepts/agents/run-backend-demo.toml deleted file mode 100644 index 47d1e6238..000000000 --- a/test/docs/core-concepts/agents/run-backend-demo.toml +++ /dev/null @@ -1,12 +0,0 @@ -version = 1 -goal = "Exercise agent backend and prompt patterns from the agents docs page" -graph = "backend-demo.dot" - -[sandbox] -provider = "daytona" - -[sandbox.daytona] -auto_stop_interval = 60 - -[sandbox.daytona.labels] -project = "arc-docs-test" diff --git a/test/docs/core-concepts/models/example.dot b/test/docs/core-concepts/models/example.dot index a127b74fc..27ce421a8 100644 --- a/test/docs/core-concepts/models/example.dot +++ b/test/docs/core-concepts/models/example.dot @@ -1,6 +1,5 @@ digraph Example { graph [ - goal="Demonstrate model stylesheet", model_stylesheet=" * { llm_model: claude-haiku-4-5; } .coding { llm_model: claude-sonnet-4-5; reasoning_effort: high; } @@ -8,12 +7,11 @@ digraph Example { " ] - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - + start [shape=Mdiamond] spec [label="Write Spec"] implement [label="Implement", class="coding"] review [label="Review"] + exit [shape=Msquare] start -> spec -> implement -> review -> exit } diff --git a/test/docs/examples/clone-substack/scripts/fix-fmt.sh b/test/docs/examples/clone-substack/scripts/fix-fmt.sh index a0b8dd282..c5ada8e18 100755 --- a/test/docs/examples/clone-substack/scripts/fix-fmt.sh +++ b/test/docs/examples/clone-substack/scripts/fix-fmt.sh @@ -1,2 +1,2 @@ -#\!/bin/sh -echo "stub: $0" +#!/bin/sh +echo "fix-fmt stub" diff --git a/test/docs/examples/clone-substack/scripts/validate-artifacts.sh b/test/docs/examples/clone-substack/scripts/validate-artifacts.sh index a0b8dd282..4488287ca 100755 --- a/test/docs/examples/clone-substack/scripts/validate-artifacts.sh +++ b/test/docs/examples/clone-substack/scripts/validate-artifacts.sh @@ -1,2 +1,2 @@ -#\!/bin/sh -echo "stub: $0" +#!/bin/sh +echo "validate-artifacts stub" diff --git a/test/docs/examples/clone-substack/scripts/validate-browser.sh b/test/docs/examples/clone-substack/scripts/validate-browser.sh index a0b8dd282..fd2a2d810 100755 --- a/test/docs/examples/clone-substack/scripts/validate-browser.sh +++ b/test/docs/examples/clone-substack/scripts/validate-browser.sh @@ -1,2 +1,2 @@ -#\!/bin/sh -echo "stub: $0" +#!/bin/sh +echo "validate-browser stub" diff --git a/test/docs/examples/clone-substack/scripts/validate-build.sh b/test/docs/examples/clone-substack/scripts/validate-build.sh index a0b8dd282..ed3fdd3ac 100755 --- a/test/docs/examples/clone-substack/scripts/validate-build.sh +++ b/test/docs/examples/clone-substack/scripts/validate-build.sh @@ -1,2 +1,2 @@ -#\!/bin/sh -echo "stub: $0" +#!/bin/sh +echo "validate-build stub" diff --git a/test/docs/examples/clone-substack/scripts/validate-fmt.sh b/test/docs/examples/clone-substack/scripts/validate-fmt.sh index a0b8dd282..8a35aab82 100755 --- a/test/docs/examples/clone-substack/scripts/validate-fmt.sh +++ b/test/docs/examples/clone-substack/scripts/validate-fmt.sh @@ -1,2 +1,2 @@ -#\!/bin/sh -echo "stub: $0" +#!/bin/sh +echo "validate-fmt stub" diff --git a/test/docs/examples/clone-substack/scripts/validate-test.sh b/test/docs/examples/clone-substack/scripts/validate-test.sh index a0b8dd282..60d3690b5 100755 --- a/test/docs/examples/clone-substack/scripts/validate-test.sh +++ b/test/docs/examples/clone-substack/scripts/validate-test.sh @@ -1,2 +1,2 @@ -#\!/bin/sh -echo "stub: $0" +#!/bin/sh +echo "validate-test stub" diff --git a/test/docs/execution/context/example.dot b/test/docs/execution/context/example.dot index 1a04e4bef..44069792c 100644 --- a/test/docs/execution/context/example.dot +++ b/test/docs/execution/context/example.dot @@ -1,10 +1,8 @@ digraph Example { - graph [goal="Test default fidelity setting", default_fidelity="summary:medium"] + graph [default_fidelity="summary:medium"] + start [shape=Mdiamond] + work [label="Work"] + exit [shape=Msquare] - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - - plan [label="Plan", prompt="Create a plan."] - - start -> plan -> exit + start -> work -> exit } diff --git a/test/docs/execution/failures/example-02.dot b/test/docs/execution/failures/example-02.dot index 872a15fc2..cfd35b848 100644 --- a/test/docs/execution/failures/example-02.dot +++ b/test/docs/execution/failures/example-02.dot @@ -1,11 +1,8 @@ digraph Example { - graph [goal="Test max_node_visits with per-node max_visits", max_node_visits="20"] + graph [max_node_visits="20"] + start [shape=Mdiamond] + fix [label="Fix", max_visits=3] + exit [shape=Msquare] - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - - implement [label="Implement", prompt="Implement the feature."] - fix [label="Fix", max_visits=3, prompt="Fix the issues."] - - start -> implement -> fix -> exit + start -> fix -> exit } diff --git a/test/docs/execution/failures/example-03.dot b/test/docs/execution/failures/example-03.dot index 4bde8526b..cd618a600 100644 --- a/test/docs/execution/failures/example-03.dot +++ b/test/docs/execution/failures/example-03.dot @@ -1,12 +1,10 @@ digraph Example { - graph [goal="Test retry_target attributes", retry_target="plan"] - - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - - plan [label="Plan", prompt="Create a plan."] - implement [label="Implement", prompt="Implement the plan."] - verify [label="Verify", goal_gate="true", retry_target="implement", prompt="Verify the implementation."] + graph [retry_target="plan"] + start [shape=Mdiamond] + plan [label="Plan"] + implement [label="Implement"] + verify [shape=box, label="Verify", goal_gate="true", retry_target="implement"] + exit [shape=Msquare] start -> plan -> implement -> verify -> exit } diff --git a/test/docs/execution/failures/example-04.dot b/test/docs/execution/failures/example-04.dot index 622d37f01..dadd8bd62 100644 --- a/test/docs/execution/failures/example-04.dot +++ b/test/docs/execution/failures/example-04.dot @@ -1,10 +1,8 @@ digraph Example { - graph [goal="Test stall_timeout setting", stall_timeout="300"] + graph [stall_timeout="300"] + start [shape=Mdiamond] + work [label="Work"] + exit [shape=Msquare] - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - - plan [label="Plan", prompt="Create a plan."] - - start -> plan -> exit + start -> work -> exit } diff --git a/test/docs/execution/failures/example.dot b/test/docs/execution/failures/example.dot index fe0eb4b71..e9755b4f8 100644 --- a/test/docs/execution/failures/example.dot +++ b/test/docs/execution/failures/example.dot @@ -1,10 +1,8 @@ digraph Example { - graph [goal="Test max_node_visits graph setting", max_node_visits="20"] + graph [max_node_visits="20"] + start [shape=Mdiamond] + work [label="Work"] + exit [shape=Msquare] - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - - implement [label="Implement", prompt="Implement the feature."] - - start -> implement -> exit + start -> work -> exit } diff --git a/test/docs/execution/interviews/default-choice.dot b/test/docs/execution/interviews/default-choice.dot index f78a5c233..cd214c906 100644 --- a/test/docs/execution/interviews/default-choice.dot +++ b/test/docs/execution/interviews/default-choice.dot @@ -1,23 +1,10 @@ -// Assembled from docs/execution/interviews.mdx snippet -// Tests human gate with default_choice attribute - digraph DefaultChoice { - graph [goal="Exercise human gate with default choice from the interviews docs page"] - - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - - deploy [label="Deploy", prompt="Deploy the changes."] - abort [label="Abort", prompt="Abort the deployment."] - - // Line 114: Human gate with human.default_choice + start [shape=Mdiamond] approve [shape=hexagon, label="Approve?", human.default_choice="deploy"] + deploy [label="Deploy"] + exit [shape=Msquare] start -> approve - - approve -> deploy [label="[A] Deploy"] - approve -> abort [label="[R] Abort"] - - deploy -> exit - abort -> exit + approve -> deploy [label="[D] Deploy"] + approve -> exit [label="[S] Skip"] } diff --git a/test/docs/execution/run-configuration/c-i.dot b/test/docs/execution/run-configuration/c-i.dot index 9eced6dec..a70eaea96 100644 --- a/test/docs/execution/run-configuration/c-i.dot +++ b/test/docs/execution/run-configuration/c-i.dot @@ -1,11 +1,9 @@ digraph CI { graph [goal="Run tests for $repo_name"] - - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - + start [shape=Mdiamond] clone [shape=parallelogram, script="git clone $repo_url repo"] test [label="Test", prompt="Run the $language test suite."] + exit [shape=Msquare] start -> clone -> test -> exit } diff --git a/test/docs/extract_dots.py b/test/docs/extract_dots.py index 8528a0ddf..aa1a55668 100644 --- a/test/docs/extract_dots.py +++ b/test/docs/extract_dots.py @@ -86,7 +86,11 @@ def find_custom_vars(code: str) -> list[str]: def main(): - skip_pages = {"changelog/2026-02-27"} # deprecated syntax + skip_pages = { + "changelog/2026-02-27", # deprecated handler=codergen syntax + "human-tools/vnc-access", # workflows not yet working + "human-tools/vpn-connections", # workflows not yet working + } extracted = 0 skipped_snippets = 0 diff --git a/test/docs/human-tools/preview/build-and-preview.dot b/test/docs/human-tools/preview/build-and-preview.dot new file mode 100644 index 000000000..5fd30dd93 --- /dev/null +++ b/test/docs/human-tools/preview/build-and-preview.dot @@ -0,0 +1,14 @@ +digraph BuildAndPreview { + graph [goal="Build and preview the marketing site"] + + start [shape=Mdiamond, label="Start"] + exit [shape=Msquare, label="Exit"] + + build [label="Build Site", prompt="Install dependencies and build the marketing site."] + serve [label="Start Dev Server", shape=parallelogram, script="cd site && npx serve -l 3000 &"] + review [shape=hexagon, label="Review Preview"] + + start -> build -> serve -> review + review -> exit [label="[A] Approve"] + review -> build [label="[R] Revise"] +} diff --git a/test/docs/integrations/brave-search/research.dot b/test/docs/integrations/brave-search/research.dot new file mode 100644 index 000000000..9ac633a9a --- /dev/null +++ b/test/docs/integrations/brave-search/research.dot @@ -0,0 +1,12 @@ +digraph Research { + graph [goal="Research and summarize a topic"] + rankdir=LR + + start [shape=Mdiamond, label="Start"] + exit [shape=Msquare, label="Exit"] + + research [label="Research", prompt="Use web_search to find recent information about $goal. Save your findings to research.md."] + summarize [label="Summarize", shape=tab, prompt="Read research.md and write a concise summary of the key findings."] + + start -> research -> summarize -> exit +} diff --git a/test/docs/integrations/daytona/example.dot b/test/docs/integrations/daytona/example.dot new file mode 100644 index 000000000..737f1c5b7 --- /dev/null +++ b/test/docs/integrations/daytona/example.dot @@ -0,0 +1,8 @@ +digraph Example { + graph [stall_timeout="1200"] + start [shape=Mdiamond] + work [label="Work"] + exit [shape=Msquare] + + start -> work -> exit +} diff --git a/test/docs/tutorials/sub-workflow/implement-and-test.dot b/test/docs/tutorials/sub-workflow/implement-and-test.dot new file mode 100644 index 000000000..7b2ac793d --- /dev/null +++ b/test/docs/tutorials/sub-workflow/implement-and-test.dot @@ -0,0 +1,15 @@ +digraph ImplementAndTest { + graph [goal="Implement the plan and make tests pass"] + rankdir=LR + + start [shape=Mdiamond, label="Start"] + exit [shape=Msquare, label="Exit"] + + implement [label="Implement", prompt="Read plan.md and implement every step. Write the code and tests to disk."] + validate [label="Validate", shape=parallelogram, script="python3 -m pytest -v 2>&1 || true"] + gate [shape=diamond, label="Tests passing?"] + + start -> implement -> validate -> gate + gate -> exit [label="Pass", condition="outcome=success"] + gate -> implement [label="Fix", max_visits=5] +} diff --git a/test/docs/tutorials/sub-workflow/sub-workflow.dot b/test/docs/tutorials/sub-workflow/sub-workflow.dot new file mode 100644 index 000000000..1ae7b24fb --- /dev/null +++ b/test/docs/tutorials/sub-workflow/sub-workflow.dot @@ -0,0 +1,13 @@ +digraph SubWorkflow { + graph [goal="Create a Python module (tempconv.py) that converts between Celsius, Fahrenheit, and Kelvin, with pytest tests"] + rankdir=LR + + start [shape=Mdiamond, label="Start"] + exit [shape=Msquare, label="Exit"] + + plan [label="Plan", prompt="Analyze the goal. List the functions needed, their signatures, and edge cases. Write the plan to plan.md."] + impl [label="Implement & Test", shape=house, stack.child_dotfile="implement-and-test.dot", manager.max_cycles=50] + review [label="Review", prompt="Read every file the child workflow created. Run the tests yourself with 'python3 -m pytest -v'. Verify the implementation matches plan.md and all tests pass. Write a short verdict to review.md."] + + start -> plan -> impl -> review -> exit +} diff --git a/test/docs/workflows/human-in-the-loop/hitl-patterns.dot b/test/docs/workflows/human-in-the-loop/hitl-patterns.dot index c741900e9..7e7504ade 100644 --- a/test/docs/workflows/human-in-the-loop/hitl-patterns.dot +++ b/test/docs/workflows/human-in-the-loop/hitl-patterns.dot @@ -1,40 +1,19 @@ -// Assembled from docs/workflows/human-in-the-loop.mdx snippets -// Tests human gates: basic, freeform, and default_choice - digraph HitlPatterns { - graph [goal="Exercise human-in-the-loop patterns from the HITL docs page"] - - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - - plan [label="Plan", prompt="Create an implementation plan."] - implement [label="Implement", prompt="Implement the plan."] - custom [label="Custom", prompt="Handle custom input."] - - // Line 13-17: Basic human gate with accelerators + start [shape=Mdiamond] + plan [label="Plan"] approve [shape=hexagon, label="Approve Plan"] - - // Line 39-43: Freeform input on human gate + implement [label="Implement"] review [shape=hexagon, label="Review Changes"] + custom [label="Handle Custom"] + exit [shape=Msquare] - // Line 53: Default choice on timeout - deploy_gate [shape=hexagon, label="Deploy?", human.default_choice="approve"] - - // Wiring start -> plan -> approve - approve -> implement [label="[A] Approve"] approve -> plan [label="[R] Revise"] approve -> exit [label="[S] Skip"] - implement -> review - - review -> deploy_gate [label="[A] Approve"] - review -> plan [label="[R] Revise"] - review -> custom [freeform=true] - - custom -> deploy_gate - - deploy_gate -> exit [label="[A] Approve"] - deploy_gate -> plan [label="[R] Revise"] + review -> exit [label="[A] Approve"] + review -> plan [label="[R] Revise"] + review -> custom [freeform=true] + custom -> exit } diff --git a/test/docs/workflows/stages-and-nodes/all-node-types.dot b/test/docs/workflows/stages-and-nodes/all-node-types.dot index 2c2f9c190..51b8a8e63 100644 --- a/test/docs/workflows/stages-and-nodes/all-node-types.dot +++ b/test/docs/workflows/stages-and-nodes/all-node-types.dot @@ -1,69 +1,31 @@ -// Assembled from docs/workflows/stages-and-nodes.mdx snippets -// Tests every node type documented on that page - digraph AllNodeTypes { - graph [goal="Exercise every node type from the stages-and-nodes docs page"] - - // Line 23: Start node start [shape=Mdiamond, label="Start"] - - // Line 33: Exit node + plan [label="Plan"] + approve [shape=hexagon, label="Approve Plan"] + implement [label="Implement", prompt="Read plan.md and implement every step."] + spec [label="Write Spec", shape=tab, prompt="Write a brief spec for a string utility module."] + test [label="Run Tests", shape=parallelogram, script="cargo test 2>&1 || true"] + gate [shape=diamond, label="Tests passing?"] + cooldown [label="Wait 30s", shape=insulator, duration="30s"] + fork [label="Fan Out", shape=component, join_policy="wait_all", error_policy="continue"] + security [label="Security Review"] + architecture [label="Architecture Review"] + quality [label="Quality Review"] + merge [label="Merge Results", shape=tripleoctagon] exit [shape=Msquare, label="Exit"] - // Line 43: Agent node - implement [label="Implement", prompt="Read plan.md and implement every step."] - - // Line 74-81: Subgraph cluster with thread_id - subgraph cluster_impl { - node [fidelity="full", thread_id="impl"] - plan_thread [label="Plan Thread"] - implement_thread [label="Implement Thread"] - review_thread [label="Review Thread"] - } - - // Line 90: Prompt (tab) node - spec [label="Write Spec", shape=tab, prompt="Write a brief spec for a string utility module."] - - // Line 102: Command (parallelogram) node - test [label="Run Tests", shape=parallelogram, script="echo 'tests passed' 2>&1 || true"] - - // Line 117-120: Human (hexagon) node - approve [shape=hexagon, label="Approve Plan"] - - // Line 132: Wait (insulator) node - cooldown [label="Wait 1s", shape=insulator, duration="1s"] - - // Line 146-149: Conditional (diamond) node - gate [shape=diamond, label="Tests passing?"] - - // Line 161-165: Parallel (component) fan-out node - fork [label="Fan Out", shape=component, join_policy="wait_all", error_policy="continue"] - - // Line 198-203: Merge (tripleoctagon) fan-in node - merge [label="Merge Results", shape=tripleoctagon] - - // Branches for fan-out - security [label="Security", prompt="Check for security issues."] - architecture [label="Architecture", prompt="Check architecture."] - - // Wiring - start -> spec -> implement -> test -> gate - - gate -> approve [label="Pass", condition="outcome=success"] - gate -> implement [label="Fix"] - - approve -> plan_thread [label="[A] Approve"] - approve -> implement [label="[R] Revise"] - - plan_thread -> implement_thread -> review_thread -> cooldown - - cooldown -> fork - + start -> plan -> approve + approve -> spec [label="[A] Approve"] + approve -> plan [label="[R] Revise"] + spec -> implement -> test -> gate + gate -> fork [label="Pass", condition="outcome=success"] + gate -> cooldown [label="Fix"] + cooldown -> implement fork -> security fork -> architecture - + fork -> quality security -> merge architecture -> merge - + quality -> merge merge -> exit } diff --git a/test/docs/workflows/transitions/transition-patterns.dot b/test/docs/workflows/transitions/transition-patterns.dot index 898f452a0..d7993fc0f 100644 --- a/test/docs/workflows/transitions/transition-patterns.dot +++ b/test/docs/workflows/transitions/transition-patterns.dot @@ -1,13 +1,7 @@ -// Assembled from docs/workflows/transitions.mdx snippets -// Tests conditions, human gates, unconditional edges, weights, and agent routing - digraph TransitionPatterns { - graph [goal="Exercise every transition pattern from the transitions docs page"] - - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - - // Line 103-114: Agent transition with routing JSON + start [shape=Mdiamond] + plan [label="Plan"] + implement [label="Implement"] review [ label="Review", shape=tab, @@ -17,60 +11,20 @@ digraph TransitionPatterns { looks good, respond with: \ {\"preferred_next_label\": \"approve\"}." ] + gate [shape=diamond, label="Check Result"] + fast_path [label="Fast Path"] + slow_path [label="Slow Path"] + preferred [label="Preferred"] + exit [shape=Msquare] - fix [label="Fix", prompt="Fix the issues found in the review."] - - // Line 32-33: Condition on edges - gate [shape=diamond, label="Tests passing?"] - - // Line 60: Boolean flag condition (truthiness check) - flag_gate [shape=diamond, label="Flag check"] - - // Line 68-79: Compound conditions - deploy_gate [shape=diamond, label="Deploy gate"] - - deploy [label="Deploy", prompt="Deploy the changes."] - proceed [label="Proceed", prompt="Proceed with next step."] - retry [label="Retry", prompt="Retry the operation."] - - // Line 123-128: Human gate transitions - approve [shape=hexagon, label="Approve Plan"] - plan [label="Plan", prompt="Create a plan."] - skip [label="Skip", prompt="Skip this step."] - - // Line 137: Chain syntax (unconditional) - start -> plan -> review - - review -> fix [label="Fix"] - review -> gate [label="Approve", weight=10] - - fix -> review - - // Line 32-33: Conditional edges - gate -> exit [label="Pass", condition="outcome=success"] - gate -> flag_gate [label="Fix", condition="outcome=fail"] - gate -> exit [label="Fallback"] - - // Line 60: Truthiness check - flag_gate -> deploy_gate [condition="outcome=success"] - flag_gate -> retry - - // Line 68-70: Compound condition - deploy_gate -> deploy [condition="outcome=success && context.tests_passed=true"] - // Line 72: OR condition - deploy_gate -> proceed [condition="outcome=success || outcome=partial_success"] - deploy_gate -> exit [label="Fallback"] - - deploy -> approve - - // Line 123-128: Human gate edges - approve -> exit [label="[A] Approve"] - approve -> plan [label="[R] Revise"] - approve -> skip [label="[S] Skip"] - - skip -> exit - proceed -> exit - retry -> review - - // Line 152-153: Weight tiebreaking (tested on deploy_gate fallback) + start -> plan -> implement -> review + review -> implement [label="Fix"] + review -> gate [label="Approve"] + review -> gate [weight=-1] + gate -> fast_path [condition="outcome=success"] + gate -> slow_path + fast_path -> preferred [weight=10] + fast_path -> exit [weight=1] + slow_path -> exit + preferred -> exit } diff --git a/test/docs/workflows/variables/example.dot b/test/docs/workflows/variables/example.dot index 4fc1b1d7a..37e44ff3c 100644 --- a/test/docs/workflows/variables/example.dot +++ b/test/docs/workflows/variables/example.dot @@ -1,10 +1,9 @@ digraph Example { graph [goal="Implement the login feature"] - start [shape=Mdiamond, label="Start"] - exit [shape=Msquare, label="Exit"] - + start [shape=Mdiamond] plan [label="Plan", prompt="Create a plan for: $goal"] + exit [shape=Msquare] start -> plan -> exit }