Expand description
Code generation engine for Gize.
Two responsibilities:
- Turn
gize_corespecs into file contents (viagize_templates). - Write those files safely — never clobbering user code without
--force, and supporting--dry-run(ADR-012).
Re-exports§
pub use plan::FileOp;pub use plan::OpKind;pub use plan::Plan;pub use plugin::GenContext;pub use plugin::Generator;pub use registry::Edit;pub use registry::register_module;pub use writer::Options;pub use writer::Report;pub use writer::Writer;
Modules§
- diff
- Model-change migration diffing (ADR-011 revision).
- plan
- A
Planis the set of file operations a generator wants to perform. Building the plan is pure (no I/O), which makes generators easy to test and makes--dry-runtrivial: we simply render the plan instead of applying it. - plugin
- Plugin API v0 (ADR-008) — unstable.
- registry
- Idempotent edits to “registry” files — the ones
gize make appmust update in place rather than create:src/app/mod.rs(module + route wiring). - scaffold
- High-level generators. Each returns a pure
Plan; applying it is the [Writer]’s job. This separation keeps generation testable and makes--dry-runfree. - sync
- Reconciliation for
gize sync(ADR-009): compare a desiredPlanagainst the filesystem and classify each file as missing, drifted (present but different), or unchanged. Applying is conservative — missing files are created, but a drifted file is never overwritten without--force, so hand edits are safe (roadmap risk: destructivesync). Directories in the plan are implicit and ignored here. - writer
- Applies a
Planto the filesystem, honouring the Gize safety model (ADR-012): never overwrite an existing file unlessforceis set, and write nothing at all whendry_runis set.