Repository navigation
feat(wrap): warn when a write verb lands a file on the default branch - #658
Merged
Merged
Conversation
wrap log, wrap stage and board set write a file and leave the commit to the caller. The caller usually sits in the repo's main checkout, on the default branch, where a commit cannot reach a PR. One machine accumulated 29 such commits plus 61 merge commits before an operator drained them by hand. Add kit_warn_default_branch in lib/gate/default-branch-warn.sh. Each verb calls it after the write lands; it prints one stderr line and always returns 0, so the write is never refused. commands/wrap.md step 2 now states the rule for every file the pass writes, including a seam skill's flush.
…t-commit # Conflicts: # docs/FEATURES.md
Review found two holes. `board dedupe-all` is a hand-runnable CLI verb, not only wrap's internal re-merge call, so a sweep on the default branch wrote the file the guard exists to flag and said nothing. And `git -C` does not clear an inherited GIT_DIR, so a verb invoked from inside a git hook would resolve HEAD against the hook's repo; every git read now drops GIT_DIR and GIT_WORK_TREE.
…t-commit # Conflicts: # _meta/BACKLOG.md # docs/FEATURES.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes ID-879.
Problem
Three kit verbs write a file inside a checkout and leave the commit to the caller:
wrap log,wrap stage,board set.commands/wrap.mdstep 2 says so in prose, and the model makes that call in whatever checkout the session runs in, usually the main checkout on the default branch. Nobody pushes the default branch, so those commits never reach a PR. One Air carried 29 such commits plus 61 merge commits by 2026-09-14 before an operator drained them by hand.What changed
lib/gate/default-branch-warn.shadds one sourced helper,kit_warn_default_branch <path> [label]. It prints one stderr line and always returns 0:Call sites:
wrap log,wrap stage,board set,board dedupe,board dedupe-all.Warn, never refuse. The file is what the session asked for and the next feature PR carries it fine. Refusing would lose the write; auto-creating a housekeeping branch would take a git write nobody asked for, in a checkout other sessions share, while
wrapis already juggling merges and worktrees.Silent outside a git repo, on a detached HEAD, when no default branch resolves, and on any branch that is not the default one.
origin/HEADdecides, thenorigin/main, thenorigin/master; a repo with no remote at all falls back to a localmainormaster. Every git read dropsGIT_DIRandGIT_WORK_TREEso an inherited value cannot point the probe at another repo.Prose:
commands/wrap.mdstep 2 now states the rule for every file the pass writes, including a seam skill's flush; step 6 and thewrap.afterparagraph point back at it.Verification
bash tests/test-wrap.sh->all 508 passed(498 before)bash tests/test-board-set-note.sh->ALL PASSbash tests/run-all.sh->all 148 suites passed, 1 skipped for missing toolinglib/gate/negctl.shin a fresh clone, mutation neuters the guard's branch comparison: both suites RED under the mutation, green after restore,Verdict: PASStwice.Spec:
docs/specs/SPEC-289-no-default-branch-commit.md. Proof:docs/verification/no-default-branch-commit.md. Notes:docs/implementation-notes/no-default-branch-commit.md.Not in this PR
The knowledge-flush skill the
wrap.afterseam names lives in the operator's dotfiles, andlib/gate/boundary-lint.shforbids naming it here; step 2 carries the rule for every seam skill instead. The two companion guards the row names, an ops-toolkit pre-commit hook and a dotfilespull.ff=only, belong to those repos.