Skip to content

feat(init): Default-driven template + --force / --name flags#72

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/init-manifest-force-name
May 14, 2026
Merged

feat(init): Default-driven template + --force / --name flags#72
hyperpolymath merged 1 commit into
mainfrom
fix/init-manifest-force-name

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Per V-L2-O1: stop the init template from drifting from Default::default(), and add ergonomic flags.

  • init_manifest now calls render_manifest_template(database, name) which pulls every field value from ProjectConfig::default() / OctadConfig::default() / SidecarConfig::default(). If defaults change in code, the emitted TOML follows.
  • Add --force flag to overwrite an existing verisimiser.toml (default behaviour still refuses).
  • Add --name <NAME> flag to set [project].name directly.

Closes

Test plan

  • cargo clippy --all-targets -- -D warnings clean
  • 32 unit tests pass (3 new in manifest::init_template_tests)
  • template_round_trips_through_toml proves rendered TOML parses back and every octad field equals Default::default()
  • CI runs full integration suite on Linux

Closes #36.

`init_manifest` previously hardcoded TOML strings for the octad
defaults. Any change to `OctadConfig::default()` silently diverged
from what `init` wrote. Replace the hardcoded body with
`render_manifest_template(database, name)`, which builds the TOML
from `ProjectConfig::default()`, `OctadConfig::default()` and
`SidecarConfig::default()`. The rendered output now tracks code.

Add two flags to `Commands::Init`:

- `--name <NAME>` — set `[project].name` directly so a new repo
  doesn't need a post-init edit.
- `--force` — overwrite an existing `verisimiser.toml` instead of
  bailing. Default behaviour (no flag) still refuses to clobber.

Three unit tests in `manifest::init_template_tests`:

- `template_round_trips_through_toml` — rendered template parses as
  `Manifest` and every octad field equals `OctadConfig::default()`.
- `template_uses_explicit_name_when_provided` — passing `Some("name")`
  produces `[project].name = "name"`.
- `template_falls_back_to_default_name` — passing `None` uses the
  default project name.

`cargo clippy --all-targets -- -D warnings` clean; 32 unit tests pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hyperpolymath hyperpolymath merged commit f21fd67 into main May 14, 2026
16 of 18 checks passed
@hyperpolymath hyperpolymath deleted the fix/init-manifest-force-name branch May 14, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V-L2-O1: init_manifest reads from Default + adds --force / --name flags

1 participant