Skip to main content

Online edition for BLOGE 0.9.8-RC1 · facts verified 2026-09-15 · 中文

Arc 2 Recap — Maintainable Authoring (Chapters 5–9)

You can now author branching, resilient workflows with well-designed operators and clean, reviewable DSL files.


What You Learned

Chapter 5 — Branches That Decide introduced branch on for control-plane routing. You learned how the engine marks un-chosen paths as SKIPPED, why otherwise matters, and how to distinguish branch on (routing) from when (value selection).

Chapter 6 — Resilience by Design showed that retry, timeout, fallback, and compensate are graph-level declarations, not inline try/catch. You learned to attach policies to nodes, layer them (retry inside timeout inside fallback), and predict the engine's behavior when policies interact.

Chapter 7 — Designing Good Operators turned attention to the operator boundary. You learned what makes an operator testable (single responsibility, no hidden state, declared schema), how to handle failure idiomatically, and when to return a rich result type vs. throw.

Chapter 8 — Turning a Personal DSL Draft into a Team Asset pulled everything together into maintainable .bloge files. You practiced graph-level schemas, doc comments, named schemas, let bindings, and consistent file layout — the skills that turn a personal draft into a reviewable team asset.

Chapter 9 — Tooling Workflow closed the authoring loop. You followed one change from editor diagnostics to lint, tests, rendered graph, and pull-request evidence, so a readable DSL file becomes a change another person can review.


What You Should Be Able to Do Now

  • Route execution through different paths with branch on and provide a safe default with otherwise.
  • Attach retry, timeout, and fallback to nodes that need them — and explain why the other nodes do not.
  • Design an operator with a clear input/output contract and testable boundaries.
  • Write a complete .bloge file with schemas, doc comments, branches, resilience policies, and transforms.
  • Review someone else's .bloge file and spot structural issues.
  • Run the edit → lint → test → visualize loop and attach the smallest useful evidence to a review.

Common Mistakes at This Stage

MistakeWhy It HappensFix
Branching on the wrong expression typeUsing a string where the engine expects an enum or booleanMatch the branch on expression type to the declared cases exactly.
Adding retry to every nodeDefensive instinctRetry only the nodes that call unreliable external systems; pure-logic nodes should not retry.
Forgetting otherwiseTrusting that all cases are coveredAlways include otherwise — even if it routes to an error node — so the graph never silently stalls.
Operators that know about graph structurePassing graph context internals into operator logicOperators receive typed input and context; they should not navigate the graph model.
Undocumented schemas"The types are obvious"Add /// doc comments and explicit schema blocks; they are free and save the next reader minutes.
Treating editor diagnostics as proofRed underlines feel authoritativeLet the editor shorten feedback; let parser and behavior tests decide correctness.

Key Vocabulary Additions

TermMeaning
branch onControl-plane routing: directs execution to one of several target nodes based on a runtime value.
otherwiseThe default branch target when no explicit case matches.
SKIPPEDThe status given to nodes on branch paths that were not taken.
retryResilience policy: re-execute a node up to N times on failure.
timeoutResilience policy: cancel a node if it exceeds a duration.
fallbackResilience policy: substitute a default result when the primary execution fails.
compensateResilience policy: run a cleanup action when a previously successful node must be undone.
SchemaA named or inline type declaration for a graph or node's input/output contract.
Authoring loopEdit, lint, test, visualize, and review the same change through increasingly strong feedback.

Try It: Prepare a Reviewable Change

A teammate adds retry to every node in a payment graph and submits only a DSL screenshot. Mark each node keep retry or remove retry, then write the three artifacts you require before review. A strong answer distinguishes unreliable I/O from deterministic logic and asks for lint output, a focused behavior test, and a rendered graph showing the changed path.


Where to Go Next

Arc 3 teaches composition: sub-graphs, batch iteration, waiting for external events, and durable execution. Start with Chapter 10 — Reuse with Subgraphs.