feat: add IR tooling — gen eject codegen and the crucible CLI#158
Merged
Conversation
9a26432 to
0567672
Compare
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
f21dace to
21b16c2
Compare
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 this change does
Adds the headless IR tooling — the backbone a visual editor will eventually sit on — as two new, independently-versioned modules:
gen— an "eject" codegen.gen.Ejectturns a machine's IR into typed Go stub source: a context type derived from the IR'sContextSchema, apanic("TODO")-bodied stub for every behavior the IR references (typed to the engine's exact guard/action/assign/service signatures), and aProvide(reg)that registers each stub by name so the IR binds. Output is gofmt'd and deterministic. A test writes the generated source into a temp module andgo builds it againststate, proving the stubs compile and wire.cmd/crucible— an IR command-line tool withlint(analysis),render(Mermaid/DOT),diff(evolution semver classification),validate, andeject(viagen). Structural commands work without real behaviors by binding deterministic no-op stubs for every referenced name, so a definition can be inspected, rendered, and analyzed straight from its IR.Why
This is the contract-consuming half of crucible's IR story: it exercises the IR, palette, analysis, and evolution surfaces, which is what proves those contracts are sufficient before the 1.0 freeze. Both modules version independently and are not part of the
statev1 frozen surface.Relates to: 1.0 IR tooling
Checklist
git commit -s) per the DCOtype: subject)mage checkequivalent passes locally — both new modules passgo build,go test, andgolangci-lint; the workspace builds.