The Port's standing ask list is not in my loop brief, which BLOCKED.md itself
records as having cost three sessions. My brief does force HANDOFF.md open every
iteration and HANDOFF is mine to write, so the pointer lives there. One line in a
file I own; no brief change and no human needed.
R11 says a cross-agent pointer must fail loudly when it goes stale, because every
staleness incident here has been silent. peer_asks.sh exits 2, 3 or 4 with a
message for a missing remote, a renamed branch or a moved file, and lists the
branches it can see so the fix is obvious. A blank output is a failure, not an
empty ask list.
Its own first version was wrong in the way this retro is about. Written as
`git show ... || { echo missing; exit 4; }`, piping it into `head` closed the
pipe, git died of SIGPIPE, and the fallback printed 'the file is missing' for a
file it had just printed in full. An error path that fires on success is worth no
more than one that never fires. Existence is now checked with `cat-file -e` and
the content exec'd; all four paths were exercised before this commit.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v
38 lines
2.1 KiB
Bash
Executable File
38 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# The Port's standing asks, from THEIR branch, fetched live.
|
|
#
|
|
# Why this exists: `BLOCKED.md` is the Port's standing ask list and it is not in
|
|
# the Decoder's loop brief, which the file itself records as having cost three
|
|
# sessions. The brief DOES force `docs/port/HANDOFF.md` to be read every
|
|
# iteration, and HANDOFF is the Decoder's to write — so a pointer there routes
|
|
# the asks into a file that must already be opened. Agreed as R11/§6 of
|
|
# docs/agents/RETRO-2026-08-31.md.
|
|
#
|
|
# R11 — a cross-agent pointer must FAIL LOUDLY when it goes stale. Every
|
|
# staleness incident on this project has been silent. This names a branch ref,
|
|
# and a renamed branch would otherwise degrade the pointer to nothing. So:
|
|
# missing remote, missing ref and missing file are each a non-zero exit with a
|
|
# message, never an empty stdout.
|
|
set -u
|
|
REMOTE="${PEER_REMOTE:-origin}"
|
|
REF="${PEER_REF:-$REMOTE/auto/port-p6-audio}"
|
|
FILE="${PEER_FILE:-docs/port/BLOCKED.md}"
|
|
|
|
git -C /work fetch "$REMOTE" -q 2>/dev/null || {
|
|
echo "peer_asks: cannot fetch '$REMOTE' — the pointer is stale, not empty." >&2; exit 2; }
|
|
git -C /work rev-parse --verify --quiet "$REF" >/dev/null || {
|
|
echo "peer_asks: ref '$REF' does not exist. The Port's branch was renamed or deleted." >&2
|
|
echo " branches seen on '$REMOTE':" >&2
|
|
git -C /work branch -r --list "$REMOTE/*" | sed 's/^/ /' >&2
|
|
echo " fix the ref in this script and in docs/port/HANDOFF.md — do not ignore this." >&2
|
|
exit 3; }
|
|
# ⚠️ Existence is checked with `cat-file -e` and the content is then `exec`d.
|
|
# The obvious form -- `git show ... || { echo "missing"; exit 4; }` -- was written
|
|
# first and is WRONG: piping this script into `head` closes the pipe, `git show`
|
|
# dies of SIGPIPE, and the fallback fires, printing "the file is missing" for a
|
|
# file that had just been printed in full. An error path that fires on success is
|
|
# worth no more than one that never fires.
|
|
git -C /work cat-file -e "$REF:$FILE" 2>/dev/null || {
|
|
echo "peer_asks: '$FILE' is not in $REF. It was renamed or removed." >&2; exit 4; }
|
|
exec git -C /work show "$REF:$FILE"
|