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_sha256 to pin a wheel. Template framework and mode take precedence, so do not combine a template with framework or minimal=True. Pack hooks run against the rendered files.
Inspect ProjectPlan before applying. It exposes proposed changes and blockers, plus readable and JSON-safe summaries; see plan results.
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
Apply rechecks the source, locks against other pack applies, and backs up changed files under.harnest/project-backups/. Handled write failures restore those 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.