Workflow script dialect and loader transform are undocumented — no offline parse-check or test entry point

Status Fixed / completed
Maintainer reply None cached
Activity 1 comment · opened Aug 17, 2026 · closed Aug 17, 2026

Workflow scripts accept export const meta (module syntax) + top-level return (function-body syntax) + top-level await in one file, so the loader demonstrably wraps/transforms scripts before execution — but the transform, the parser options, the definitive blocked-globals list, and any offline parse/dry-run entry point are all undocumented. node --check returns 0 on scripts the loader rejects, so a repo gate cannot pin against the loader's own parser.

We maintain a 1,678-line production workflow (plugin workflow, invoked via a slash command) and want to run it deterministically under pytest by stubbing agent() — the sandbox's own guarantees (no fs/clock/randomness) make scripts pure functions of their agent() returns, which is ideal for testing, but we have to reverse-engineer the wrapper to do it.

Ask:

  1. Document the script dialect and loader transform (parser, ecmaVersion/sourceType/allowReturnOutsideFunction or equivalent)
  2. Expose a parse-check or dry-run (CLI or library entry point) usable in CI
  3. Document the resume/journal replay mechanism for deterministic testing
  4. Document which globals are available/blocked and how (absent vs throwing vs shadowed)

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗