Skip to main content
All Python modules · Import and compatibility guidance

Pack configuration

File operations

YAML operations

Initializer contract

Hook context

Migration contract

Plan results

Exports

ChangeKind

Filesystem effects exposed in a reviewable project plan.

ChangePlan

An ordered collection of file and YAML operations returned by a pack hook.
Fields (— means no declared default):

ProjectCLI

Embed init/upgrade planning and custom commands in a company-owned executable.

ProjectCLI.add_command

Register a company command and return its parser for company-specific flags.

ProjectCLI.add_studio

Expose Studio and core commands through an explicit company executable argv.

ProjectCLI.run

Execute one command and return a process exit code; never exit the caller.

ProjectChange

A path-level change summary which never exposes configuration contents.
Fields (— means no declared default):

ProjectContext

Pack hook inputs and read-only staged project views; callbacks are trusted code.
Fields (— means no declared default):

ProjectError

A project cannot be safely planned, validated, or changed.

ProjectPack

Company-owned scaffolding and consecutive schema migrations, never auto-discovered.

ProjectPack.initialize

Register the single initializer used only when creating a new project.

ProjectPack.migration

Register one consecutive migration; upgrades never rerun initialization.

ProjectPlan

A combined immutable snapshot plan; apply refuses blockers or changed inputs. Obtain this object from the owning Harnest API; its constructor includes runtime bindings. Fields (— means no declared default):

ProjectPlan.public

Return a machine-readable preview without file contents or option values.

ProjectPlan.render

Render the same combined plan used by interactive and automated clients.

ProjectPlanner

Plan init and upgrade using explicitly supplied trusted project packs.

ProjectPlanner.plan_init

Prepare a scaffold or template, then apply pack hooks in a disposable project.

ProjectPlanner.plan_upgrade

Compose core migration and pack migration proposals without live writes.

WritePolicy

Choose whether to fill a missing value or update pack-owned content.

apply_project_plan

Reject stale inputs, back up originals, and roll back failed source writes.

ProjectContext.files

Access this facade through ProjectContext.files; its implementation type is not a public import. Read snapshot files and declare text/template changes without writing them.

ProjectContext.files.read_text

Read an existing staged UTF-8 file.

ProjectContext.files.write_text

Propose text creation or a baseline-checked managed replacement.

ProjectContext.files.from_template

Render an inert UTF-8 dollar template using only explicit substitutions.

ProjectContext.files.from_file

Copy a packaged document or binary asset unchanged through tracked file ownership.

ProjectContext.files.delete

Propose removal only if the pack still owns unchanged generated content.

ProjectContext.yaml

Access this facade through ProjectContext.yaml; its implementation type is not a public import. Declare field-level YAML edits; unrelated values survive serialization.

ProjectContext.yaml.read

Return a detached configuration mapping suitable for migration decisions.

ProjectContext.yaml.set

Propose a JSON-compatible field value with explicit overwrite policy.

ProjectContext.yaml.rename_key

Move a user’s existing value without overwriting an occupied destination.