docs(adr): ADR-0031 — structured control-flow (loop/parallel/try-catch), BPMN as interop#1472
Merged
Merged
Conversation
The 3 status state machines (task/project/account) covered transition topologies but not the rule's other knobs. Round it out so the showcase exercises — and verifies — the full state_machine surface: - events: ['update'] on all three — state machines validate *transitions*, so they should run on update only (insert sets the initial state). Makes the intent explicit rather than relying on the insert short-circuit. - New advisory `project_health_progression` with severity: 'warning' — health should step one level at a time (green↔yellow↔red); a skip is flagged (logged) but NOT blocked, demonstrating soft guards alongside the existing error-severity (blocking) status flows. Verified against the runtime: error-severity invalid transition → HTTP 400 `invalid_transition`; warning-severity skip (health green→red) → HTTP 200. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Records the decisions needed for loop/parallel_gateway/join_gateway/ boundary_event given (a) the engine's DAG-only invariant (detectCycles throws on back-edges), (b) valued BPMN import/export (keep protocol BPMN-complete), and (c) the multi-agent shared engine.ts. Proposes: keep DAG strict; ship DAG-safe per-item-subflow loop + pass-through parallel split now; defer join/inline-loop/ runtime-boundary as ADR-gated engine work; drive authoring/AI from the live executable registry. wait + subflow already shipped. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…horing Pivot from 'implement the four BPMN token nodes' to 'adopt structured control-flow constructs (loop container, parallel block, try/catch/retry) as the native + AI-authored model; keep BPMN gateways/boundary in the protocol as the import/export representation that maps onto them.' Rationale: AI authoring of flow metadata is the design center. Structured constructs are well-formed by construction, locally composable, and analyzable/terminating — whereas a free-form gateway/boundary/back-edge graph is easy for an LLM to make broken (deadlocks, orphan joins, infinite cycles). Keeps the DAG invariant (loops are scoped containers, not cycles); preserves BPMN interop. Sequenced: spec-define constructs -> loop container -> parallel block -> try/catch -> BPMN mapping. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A decision record (no code) reframing how flows model
loop/parallel/ error-handling — driven by the AI-authoring lens ([ADR-0010/0011]).The pivot: instead of implementing the four BPMN token nodes (
loopstub,parallel_gateway,join_gateway,boundary_event) as the native model, adopt structured control-flow constructs — aloopcontainer, aparallelblock, andtry/catch/retry— as the native + AI-authored model. BPMN gateways/boundary stay in the protocol +bpmn-interopas the import/export representation that maps to/from the structured constructs.Why (AI authoring is the design center): a free-form node+edge graph with gateways/boundary/back-edges is easy for an LLM to make semantically broken (orphan joins, unbalanced gateways, deadlocks, infinite cycles). Structured constructs are well-formed by construction, locally composable (AI emits a subtree), and statically analyzable/terminating — the right substrate for AI. (The per-item-subflow loop is worse for AI — it fragments one loop into two flows + I/O mapping.)
Decisions
try/catch/retry, surfacing the engine's existingfaultedge +errorHandling.retry./automation/actions+configSchema); valid-by-construction.Open question flagged: representation (A) marker-delimited scoped regions vs (B) nested sub-structure — decided in the implementation PR.
Sequenced: spec-define constructs → loop container → parallel block → try/catch → BPMN mapping.
wait+subflowalready shipped (subflow = reuse primitive, not the loop mechanism).Docs-only; no package changes. Awaiting direction, then implementation follows the roadmap.
🤖 Generated with Claude Code