Skip to content

docs(automation): document ADR-0031 control-flow constructs; fix dangling reference card#1497

Merged
os-zhuang merged 3 commits into
mainfrom
claude/docs-adr0031-control-flow
Jun 2, 2026
Merged

docs(automation): document ADR-0031 control-flow constructs; fix dangling reference card#1497
os-zhuang merged 3 commits into
mainfrom
claude/docs-adr0031-control-flow

Conversation

@os-zhuang

@os-zhuang os-zhuang commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the ADR-0031 work (#1482 loop, #1489 parallel): documentation for the structured control-flow constructs, plus two doc-generator fixes — one of which un-breaks the docs site build on main.

Changes

1. Flow authoring guide — content/docs/guides/metadata/flow.mdx (hand-written)
Adds a "Structured control flow (ADR-0031)" section documenting the loop container (config.body, iterator/index vars, maxIterations), parallel block (config.branches[], implicit join), and try/catch/retry (config.try/catch/retry), with config examples and the region / DAG-invariant model. Updates the Node Types table (loop reframed as a container; new parallel and try_catch rows).

2. Doc generator (packages/spec/scripts/build-docs.ts) — docs-build fix 🔧
The docs site (Vercel apps/docs) was failing on every branch off main:

./content/docs/references/kernel/manifest.mdx
Unexpected character `5` (U+0035) before name   (MDX)

A zod .describe() carries a SemVer range ">=4.0 <5"; escapeMdxDescription only wrapped </{ when it found a matching >/}, so the bare <5 slipped through and MDX parsed it as the start of a JSX tag, failing next build for the whole site. Now a lone </{ (no matching close) is escaped as inline code.
Verified locally: the full apps/docs build (gen:schema && gen:docs && next build) compiles and prerenders all 1089 pages.

3. Doc generator — dangling-card fix
The index now cards only reference pages that were actually generated. Control-flow's schemas embed CEL-expression transforms (like Flow/FlowEdge) → no JSON-Schema page; the index previously carded every .zod.ts, producing a dangling "Control Flow" 404 link. Cards now align with meta.json.

Notes

https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q

- guide (content/docs/guides/metadata/flow.mdx): document the structured
  loop container, parallel block (implicit join), and try/catch/retry
  constructs with config examples and the region/DAG-invariant model; update
  the Node Types table.
- doc generator (packages/spec/scripts/build-docs.ts): only emit index Cards
  for reference pages that were actually generated. control-flow's schemas
  embed CEL-expression transforms (like Flow/FlowEdge) so produce no
  JSON-Schema page; the index previously carded every .zod.ts file, yielding a
  dangling "Control Flow" 404 link. Cards now match meta.json.

https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q
@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 2, 2026 12:31am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling size/m labels Jun 1, 2026
The docs site build (Vercel apps/docs) was failing on every branch off main:

  ./content/docs/references/kernel/manifest.mdx
  Unexpected character `5` (U+0035) before name (MDX)

A zod `.describe()` carries a SemVer range `">=4.0 <5"`; the generator's
`escapeMdxDescription` only wraps `<`/`{` when it finds a matching `>`/`}`, so
the lone `<5` slipped through raw and MDX parsed it as the start of a JSX tag,
failing `next build` for the whole site.

Escape a lone `<`/`{` (no matching close) as inline code. Verified: the full
`apps/docs` build (gen:schema && gen:docs && next build) now compiles and
prerenders all 1089 pages.

https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q
…ontrol-flow

# Conflicts:
#	packages/spec/scripts/build-docs.ts
@os-zhuang os-zhuang marked this pull request as ready for review June 2, 2026 00:45
@os-zhuang os-zhuang merged commit 02d6359 into main Jun 2, 2026
12 checks passed
os-zhuang added a commit that referenced this pull request Jun 2, 2026
The structured control-flow constructs (loop/parallel/try-catch) and the BPMN
interop mapping are implemented and merged (#1482, #1489, #1499, #1500; docs
#1497). Flip ADR-0031 from Proposed to Accepted and record the implementing PRs
and the deferred follow-ups (#1504 BPMN XML plugin, #1505 region step logs).

https://claude.ai/code/session_012ti8cx3TkdiQdjCnZXZg2Q

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants