Actio is a transpiler. The dangerous failure mode is not a crash, it is silently wrong GitHub Actions YAML. New macro work must prove behavior before implementation, stay fully typed, and keep the gate green.
- Start RED with golden fixtures. Add
tests/fixtures/<macro-case>/input.actio.ymlandexpected.ymlbefore implementing the pass. - Add diagnostic tests for invalid inputs before implementation. Every error-table row in the macro's spec issue needs a matching
tests/diagnostics.test.tscase. - Implement the pass in
packages/core/src/passes/only after the fixture and diagnostic tests fail for the right reason. - Iterate to GREEN with
npm test, then run the standard PR gate before opening a PR.
- No explicit
any. Useunknown, type guards, discriminated unions, or typed helpers. - Keep
noUncheckedIndexedAccessclean. Treat indexed map and array reads as possibly missing. - Model new IR shapes as discriminated unions when a macro introduces structured variants. Narrow by
kindbefore reading variant-specific fields. - Prefer existing helpers in
packages/core/src/ir.tsandpackages/core/src/passes/helpers.tsover ad hoc casts. - Preserve source origins with
cloneNode,deriveNode, andrecordOriginwhen cloning, deriving, or moving workflow nodes.
Pass order is data-driven with runsAfter, not array position. The locked macro pipeline is:
params (#17) -> job-defaults (#21) -> for-each/dynamic-matrix (#20) -> when-compile (#23) -> fragments/inject (shipped) -> share (#18) -> lifecycle (#24) -> injection-hoist (#22) -> annotate (last)
pins (#19) is orthogonal at emit. Build DAG tiers are T0 = #17, #19, T1 = #23, #21, T2 = #20, #18, and T3 = #24, #22.
- Pass file added in
packages/core/src/passes/. -
runsAfterwired to the locked pipeline order above. - JSON-schema extension added under
packages/core/schema/. - Golden fixtures cover happy paths and edge cases.
- Diagnostic test exists for each error-table row in the macro's spec issue.
- Source-map mappings cover emitted jobs and steps introduced or moved by the macro.
- At least one composition test covers interaction with another macro.
- README or docs section explains user-facing syntax and emitted Actions YAML.
-
npm run lintpasses. -
npm run typecheckpasses. -
npm run buildpasses. -
npm testpasses. -
npm run test:coveragepasses. -
npm run build:workflows && npm run check:workflowspasses when workflow sources changed.
Run these locally before requesting review:
npm run lint
npm run typecheck
npm run build
npm test
npm run test:coverage
npm run check:workflowsIf you edit .github/actio/*.actio.yml, do not hand-edit .github/workflows/*.yml. Run npm run build:workflows, commit the generated workflow and map, then run npm run check:workflows.