8.7 Protecting Handwritten Code from Overwrite

Go To Top

Return to Generated Artifacts

Generation processes must protect handwritten code. A generator should not overwrite handwritten source files, scripts, Configuration, tests, or documentation unless the team explicitly designs and documents that workflow.

The Repository should use directory separation, file headers, naming conventions, and script safeguards to prevent accidental overwrite. Generation scripts should write only to approved generated directories by default. If a script receives a custom output path, it should validate the path before writing files.

Generated files should include clear warnings where practical, such as:

If developers need to extend generated behavior, the team should prefer extension points, wrapper classes, partial classes, separate handwritten modules, or Configuration-based customization. The team should avoid editing generated files, as regeneration can overwrite those changes.

Protecting handwritten code keeps the Phase 0 Baseline reviewable and reproducible. It also preserves the distinction between governed source definitions, generated implementation projections, and developer-authored runtime logic.


© 2026 Dido Solutions, Inc. and Jackrabbit Consulting, Inc.