Documentation
¶
Overview ¶
Package command implements the `command` rule type (spec §5): the interim escape hatch for toolchain gates that cannot be expressed declaratively. It runs an external command at the repository root and interprets its exit code (and optionally its output). It is a heavy, whole-run rule: a failure to execute the tool is an engine error (exit 2), never a silent pass (spec §11). Every command rule is enumerated by `formwork lint` (spec §9).
The tool runs with the caller's environment INHERITED UNCHANGED — that is the escape hatch's contract, and this package removes nothing from it. It refuses two states instead, both in ensureRepositoryAgreement, and refusing is what lets the contract stand: nothing is deleted from the tool's environment.
- an ambient POINTER variable (GIT_DIR, GIT_WORK_TREE, GIT_COMMON_DIR) naming a repository other than the one the engine is checking — the one state an identity comparison can SEE (#177);
- any of the OBJECT-STORE family being set at all, which moves which commits and objects git answers from INSIDE the right repository and so is invisible to that comparison (#213).
Both are exit 2, never a finding, and both are lifted by FORMWORK_GIT_ENV= inherit — the same hatch internal/vcs uses, so an operator who has already taken that decision does not meet a second refusal spelled differently.