Skip to main content

Module transform

Module transform 

Source
Expand description

Assisted one-way GHA→QED transformer (R533-F4, W224).

W224 (“import, don’t emulate”) makes a GitHub Actions workflow an import source, not a foreign runtime QED reproduces forever. The onboarding path is a one-way, assisted, lossy-with-warnings transform: map the tier-1/2 ~80% mechanically, and flag the tier-3 steps it deliberately declines to imitate — proposing the native QED replacement for each rather than guessing.

This module is that transform. It sits on top of the yah_qed_gha parser + the R533-F2 tier classifier and emits native QedSteps for the runnable compute, paired with a list of human-facing flags for everything that needs a decision. It is pure — it operates on an already-parsed Workflow and performs no I/O — so the runner / the eject materializer (R533-F6) own the file read and the TOML write.

§What maps mechanically, what gets flagged

Parsed stepTier (F2)Result
run: bash1/2 computenative StepKind::Subprocess step
run: bash reaching gh/api.github.com/GITHUB_TOKEN1/2 + service touchnative step and an FlagKind::EmbeddedServiceTouch flag
run: carrying ${{ … }}1/2 computenative step and an FlagKind::UnresolvedExpression flag
uses: org/setup-*, dtolnay/rust-toolchain, …1/2 toolkitFlagKind::ToolkitAction — runs via the R533-T7 toolkit executor, no subprocess emitted yet
uses: actions/checkout, cache, upload-artifact, gh-release, build-push, …3 serviceFlagKind::ReplaceWithNative carrying the native stanza
uses: unrecognizedunknownFlagKind::Unknown — surfaced for review

§Job DAG → flat pipeline

A native Pipeline is a flat Vec<QedStep> run in declaration order; GHA workflows are a job DAG. The transform flattens jobs into a topological linearization (yah_qed_gha::topo_sort) — every job’s needs: predecessors emit before it — so execution order is honest even though inter-job parallelism collapses to sequential. Matrix expansion and the workflow_call port contract are not handled here: target lifting out of strategy.matrix is R533-F9 (it layers onto the steps emitted here) and the down/up-port mapping is R533-F5.

Structs§

TransformReport
The result of transforming one workflow — the native steps that mapped mechanically, interleaved (in execution order) with the flags the human must resolve. “Assisted / lossy-with-warnings” made concrete: nothing tier-3 is silently run, and nothing un-mappable is silently dropped.
TransformedStep
One parsed workflow step after transformation. A clean tier-1/2 run: step has native = Some(..) and flags = []; a tier-3 step has native = None and a FlagKind::ReplaceWithNative; a run: step reaching the service has both a native step (it runs) and a flag (the reach won’t resolve on QED).

Enums§

FlagKind
Why a parsed step couldn’t be imported as clean native compute — the assisted half of the transform. Each variant proposes what to do instead.
FlagSeverity
How loud a FlagKind is, for preflight summaries and reports.

Functions§

transform_workflow
Transform a parsed workflow into native QED steps + assisted flags.
transform_workflow_src
Convenience: parse raw workflow YAML and transform it in one call. Still pure (no file I/O) — the caller supplies the bytes. Used by eject (R533-F6) and the tests here.