saw govern¶
saw govern prepare --repo <open-folder> --into <holding-directory> --tool git|gh -- <arguments>
saw govern apply --repo <open-folder> --into <holding-directory>
For the editor extension. When you pull, fetch, check out, switch, merge, rebase, update a submodule, check out a pull request, sync a repository, or download a release or an Actions artifact, these commands check what arrives before your open folder changes.
saw govern prepare carries the update out into a holding directory saw owns, scans what arrived,
and prints the verdict as the same document saw scan --json prints. Your open folder is not
changed, and nothing from the incoming repository runs.
saw govern apply makes your open folder match the tree that was checked, without fetching again.
The extension calls it only when the verdict was clean or residue, and your uncommitted work is
kept — or the folder is not changed and saw says why.
When the verdict is suspicious or infected, or the check could not finish, the update is held and your open folder stays as it was. These commands never push and never open a pull request.
Covering your terminals¶
The editor extension checks updates for the folders you open in the editor. To check them in your
terminals too, and in the shells coding agents run, run saw govern install. From then on, when a
terminal pulls, fetches, checks out, switches, merges, or updates a submodule, saw checks what
arrives before it reaches the folder you are working in, the same as in the editor. Open a new
terminal, or source the file the command names, for it to take effect.
saw govern status says whether your terminals are covered and whether the shell you are in is
covered yet. saw govern uninstall takes it back out, and your editor is unaffected. saw always
falls back to your real git and gh.
Asking whether a tree is one saw let in¶
saw govern verdict answers whether the folder's current tree is one saw let in — scanned clean by
a hook, or carried in by govern with the tree still matching. It answers let-in, not-let-in (an
unknown commit, or a tree changed on top of one saw let in), or could-not-answer. It reads what saw
already recorded, so it scans nothing and changes nothing. An editor uses it to tell a change saw let
in from one that reached the folder another way.
Putting the open folder back¶
saw govern restore puts the folder back on the commit saw let in, keeping your uncommitted work.
The branch moves to that commit, so HEAD is not left detached, and nothing is fetched. Call it after
a verdict that the tree is not one saw let in. An editor uses it instead of running git over a tree
with unsaved changes.