Expand description
Commit pass for haz init per AUX-005..AUX-006.
Once the interactive flow has finalised a selection in
super::model::Tree, the commit pass:
- Computes the project-root set (
AUX-005step 1, delegated to the tree). - Sanitises each project root’s basename to an
ID-001..ID-005-validProjectName(AUX-005step 2). - Renders the final
.haz/workspace.ymlbody and the per- projecthaz.ymlbodies (AUX-005step 3 listing data; the UI prompt for confirmation lives in the TUI driver). - Applies the plan to disk via
AUX-006rename-into-place, writing everyhaz.ymlfirst and.haz/workspace.ymllast so an interrupted run never leaves a workspace referencing a non-existenthaz.yml.
Existing haz.yml files are not overwritten per AUX-005
step 2 (“for each path… that does not contain a haz.yml”).
Structs§
- Commit
Plan - The full commit plan derived from a finalised
Tree. - Projects
Entry - A single entry that will land in
.haz/workspace.yml’sprojects:list. Ordering is byte-ascending onSelf::textso the AUX-005 step 3 listing and the eventualworkspace.ymlare byte-stable across runs. - Scaffolded
HazYml - A new
haz.ymlfile to scaffold perAUX-005step 2.
Enums§
- Commit
Plan Error - Sanitisation failure surfaced during
plan_commit.
Functions§
- apply_
commit - Apply
planto disk perAUX-006: write everyhaz.ymlfirst, then.haz/workspace.ymllast, each via the rename-into-place pattern. - plan_
commit - Compute the
CommitPlanfortree, anchoring relative paths againstcwd_host_root. - projects_
entries - Convenience accessor for tests / callers that want to inspect
the
projects:entries without forcing a string render.