fix(framework): per-session ticket files unblock parallel sessions [#439]

The ticket gate required the single .crush/active-ticket file, so two
concurrent sessions overwrote each other's ticket mid-work. The gate now
accepts any non-empty .crush/active-ticket* file; each session keeps its
own (e.g. active-ticket-plant, active-ticket-core). Also prune .crush/
session scratch from both shellcheck scanners so one session's throwaway
probe scripts cannot block the other session's commits. Documented in
AGENTS.md Task Tracking.

💘 Generated with Crush

Assisted-by: Crush:glm-5.2
This commit is contained in:
2026-08-27 13:01:25 -05:00
parent 5977eba503
commit ae8af3472b
4 changed files with 19 additions and 9 deletions
+12 -7
View File
@@ -9,7 +9,6 @@
# run audits, check status, etc.).
set -euo pipefail
TICKET_FILE="${CRUSH_PROJECT_DIR}/.crush/active-ticket"
TOOL="${CRUSH_TOOL_NAME:-}"
CMD="${CRUSH_TOOL_INPUT_COMMAND:-}"
@@ -54,12 +53,18 @@ case "$FILE_PATH" in
;;
esac
# Check for active ticket
if [ -f "$TICKET_FILE" ] && [ -s "$TICKET_FILE" ]; then
TICKET=$(cat "$TICKET_FILE")
printf '{"context":"Active ticket: %s"}\n' "$TICKET"
exit 0
fi
# Check for active ticket. Parallel sessions each use their OWN file:
# .crush/active-ticket (default / single session)
# .crush/active-ticket-<name> (suffixed per session; any non-empty one
# satisfies the gate — sessions never fight
# over one file)
GATE_OK=0
for f in "$CRUSH_PROJECT_DIR"/.crush/active-ticket*; do
[ -f "$f" ] && [ -s "$f" ] || continue
GATE_OK=1
printf '{"context":"Active ticket(s): %s -> %s"}\n' "$(basename "$f")" "$(cat "$f")"
done
[ "$GATE_OK" -eq 1 ] && exit 0
# No active ticket — block
cat >&2 <<'MSG'