Plan through Python
planner.plan_init("support-bot", options={"acme": {"team": "support"}}). Options are grouped by pack name. This method also accepts framework="adk" or "langgraph" and minimal=True for the built-in scaffold. If omitted, the built-in framework defaults to ADK.
To initialize from your team’s preferred template, pass template instead of scaffold options:
template accepts a Harnest template project name, short slug, or HTTPS wheel URL. Pass template_sha256 to pin an HTTPS wheel. A checksum requires a template; a template cannot be combined with an explicit framework or minimal=True. The template’s framework and mode remain authoritative, and pack hooks see its staged files before proposing their changes. The native Harnest CLI owns downloading, verification, and template rendering.
The JSON summary is for display, not an executable plan format. Keep the original
ProjectPlan object when applying a reviewed plan programmatically. apply_project_plan rejects blockers and stale inputs; it returns the backup directory or None when nothing changed.
Planning order
1
Snapshot project source
Read the project’s regular source files. Exclude runtime and cache directories such as
.harnest, .venv, and .git; reject source symlinks.2
Prepare Harnest changes
Generate the built-in scaffold, render the selected template, or apply core migrations in a disposable copy. The live project remains unchanged.
3
Run company hooks
Run packs in their supplied order and migrations in schema order. Each hook reads the current staged state and returns operations. Validate each pack’s resulting company configuration.
4
Review the combined result
Report final changed paths, owners, and blockers. A failure can leave partial proposals in the preview, but prevents applying the entire plan.
Track versions and ownership
Commit both lock files:
Ownership hashes allow managed updates to distinguish unchanged generated content from user edits. Option values are not recorded in the pack lock. Do not advance version numbers manually to skip migrations; doing so tells future upgrades that those changes already happened.
Resolve blockers
Apply and recover
Applying checks the source snapshot again, obtains a lock against other project-pack applies, and backs up affected originals under.harnest/project-backups/. It then writes the reviewed result. A handled write failure restores source files from the captured originals.
A process crash or disk failure can require manual recovery:
- Ensure the original apply process is no longer running.
- Inspect the backup’s
plan.jsonandsource/files. Restore affected originals and reconcile files that the interrupted plan created or deleted. - If
.harnest/project-apply.lockremains, remove it only after recovering the interrupted operation. - Generate a fresh plan and review it before applying again.