Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 48 additions & 7 deletions skills/handoff/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,17 +304,58 @@ block the stamps land in the middle of.
in a container with no `LANES_WORKSTATION`, that step 4's register and object-log writes were therefore NOT
made, and that the row still reads as it did — so the next session knows the register is behind its own
handoff rather than believing the lane never paused. This commit is in the LANE'S OWN repository and is not
one of the writes that stop. Commit with an explicit pathspec
and the Rule 5 `Lane:` trailer, then pull-rebase and push:
one of the writes that stop.

**COMMIT IN THE CHECKOUT THE HANDOFF WAS PUBLISHED IN, BY ITS OWN PATH, AND NOTHING ELSE** (Amendment 4(d):
*"with explicit pathspecs — never `git add -A`, never a bare `git commit`"*; Amendment 5(c) and (d)). The
checkout is RESOLVED, never spelled: `$LANES_REPO` first, then the helper's own `workspace-root`, which is the
order `lane-handoff` uses — a lane window exports `LANES_REPO` to the lane's own clone, and step 4's writes go
there. Step 2's publication target `$handoff_file` is the same file (`$LANES_REPO/$handoff` where that exists,
else the workspace root's), so the file published is the file committed. A STAGED ENTRY THIS HANDOFF DID NOT
MAKE IS A REFUSAL, read before the `git add`: a bare commit would publish it, and with a pathspec the pull would
refuse on it. So is a rebase, merge, cherry-pick or revert in progress. Then the Rule 5 `Lane:` trailer,
pull-rebase and push:

```sh
cd ~/projects/brett-wip
git add "$handoff"
git commit -m "handoff(<lane>@<ws>): PAUSED, <one-line state>" -m "Lane: <lane>"
git pull --rebase && git push
# THE CHECKOUT IS RESOLVED, NEVER SPELLED: `$LANES_REPO` first, then the
# helper's own `workspace-root`, the order `lane-handoff` uses. Lane windows
# export `LANES_REPO` to the lane's own clone, and step 4's writes go there.
hc_root=""; hc_why=""; hc_staged=""
for hc_base in "${LANES_REPO:-}" "$("$L" workspace-root 2>/dev/null)"; do
if [ -n "$hc_base" ] && [ -f "$hc_base/$handoff" ]; then hc_root="$hc_base"; break; fi
done
if [ -z "$hc_root" ]; then
hc_why="$handoff is under neither \$LANES_REPO nor the workspace root"
else
hc_git="$(git -C "$hc_root" rev-parse --absolute-git-dir)"
for hc_op in rebase-merge rebase-apply MERGE_HEAD CHERRY_PICK_HEAD REVERT_HEAD; do
[ ! -e "$hc_git/$hc_op" ] || hc_why="$hc_root has an operation in progress ($hc_op)"
done
# A STAGED ENTRY THIS HANDOFF DID NOT MAKE, read BEFORE the add: a bare
# commit would publish it, and with a pathspec the pull would refuse on it.
hc_staged="$(git -C "$hc_root" diff --cached --name-only | grep -vxF -- "$handoff")"
[ -z "$hc_staged" ] || hc_why="${hc_why:+$hc_why; }the index of $hc_root holds $(printf '%s\n' "$hc_staged" | wc -l | tr -d ' ') staged path(s) this handoff did not make"
fi
if [ -n "$hc_why" ]; then
printf 'HANDOFF NOT COMMITTED: %s. The file is written; nothing was committed or pushed. Never commit staged entries you did not make.\n' "$hc_why"
[ -z "$hc_staged" ] || printf '%s\n' "$hc_staged" | head -n 20 | sed 's/^/ staged: /'
elif ! { git -C "$hc_root" add -- "$handoff" &&
git -C "$hc_root" commit -m "handoff(<lane>@<ws>): PAUSED, <one-line state>" -m "Lane: <lane>" -- "$handoff"; }; then
printf 'HANDOFF NOT COMMITTED: git refused the add or the commit in %s (its words are above).\n' "$hc_root"
elif git -C "$hc_root" pull --rebase origin "${LANES_BRANCH:-main}" &&
git -C "$hc_root" push origin "${LANES_BRANCH:-main}"; then
echo "handoff pushed from $hc_root"
else
git -C "$hc_root" rebase --abort 2>/dev/null || :
printf 'HANDOFF NOT PUSHED: it is a local commit in %s, any rebase is aborted, and git said why above. Never force; look first:\n git -C %s fetch origin && git -C %s cherry -v origin/%s HEAD\n' \
"$hc_root" "$hc_root" "$hc_root" "${LANES_BRANCH:-main}"
fi
```

On a rebase conflict: abort, leave the tree clean, report it, and never force.
A refusal, a conflict or a rejected push does not stop the swap (`R-A11-11`, *a swap is never left
unwritten*): the handoff file is written, the block prints what it did NOT do, and the report carries that
line. On a rebase conflict the block aborts and leaves the tree clean. Never force, and never commit staged
entries you did not make.

## 3. Subagents and worktrees — the one question, and the sweep that fills WRITERS

Expand Down
Loading
Loading