Generate
Generation is the compilation boundary. It converts a versioned model into deterministic, target-specific artifacts after semantic checks succeed.
Inputs
Section titled “Inputs”A generation identifies at least:
- the model revision;
- the generator version;
- the selected frontend and backend targets;
- design and infrastructure intent;
- configured add-ons;
- the parent evolution bundle when schema evolution is supported.
Hidden state from an old generated folder must not be necessary to reproduce managed output. Reusing caches is allowed; depending on undocumented manual edits is not.
Preflight
Section titled “Preflight”Before files are emitted, modelARch performs structural and semantic checks. Typical checks cover:
- references resolve to known model elements;
- mutation targets exist and source values are compatible;
- permissions and actor scopes are coherent;
- routes, symbols, and generated names do not collide;
- view bindings can resolve required data and actions;
- current target capabilities support the modeled constructs;
- portable contracts such as
MODEL.mdcontain no blocking lint findings.
An error stops generation. A warning should remain visible in the evidence so it cannot be mistaken for a clean build.
Materialization
Section titled “Materialization”The generator creates target-specific files from shared model semantics. The same concept should be interpreted once and projected consistently into backend behavior, API contracts, frontend affordances, tests, and documentation.
For a full-stack application, generate the backend and React projections with compatible target selections. The React generator needs to know which backend contract it will call.
Evolution planning
Section titled “Evolution planning”For supported targets, generation compares the physical schema manifest with its parent bundle and materializes a migration plan. Changes that are unsafe or semantically ambiguous must be blocked or require explicit evolution intent.
Generation does not apply a production migration. It prepares the artifacts that the release orchestrator will later verify and execute.
Result states
Section titled “Result states”| State | Meaning |
|---|---|
| Blocked | Input is ambiguous, invalid, or unsupported |
| Failed | The generator or formatter could not produce a valid candidate |
| Generated | Artifacts exist and compilation gates passed |
| Preview ready | A runnable candidate passed startup readiness |
| Release ready | Deployment and verification evidence is complete |
Do not collapse these states into a single “success.”
Regeneration
Section titled “Regeneration”On the next revision, regenerate managed files from the new inputs. If the output has diverged, the system should surface that divergence before overwriting. Permanent customization belongs in a modeled capability, a generator improvement, or an explicit extension surface.
Continue with Preview and deliver or consult Generator targets.
