From ef4d573e81370e9de8092d9059694f8b831f76f5 Mon Sep 17 00:00:00 2001 From: Parfii-bot Date: Tue, 21 Apr 2026 04:11:30 +0800 Subject: [PATCH] fix(hooks): surface FAIL lines unconditionally on agent rebuild Previous block-rebuild path piped through head -40, so a FAIL on line 50 was invisible. Now FAIL/ERROR lines are always printed first; OK lines are still truncated. Written in POSIX sh per Fix 4. --- hooks/assemble-agents.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hooks/assemble-agents.sh b/hooks/assemble-agents.sh index 78ad68f..ca42f7d 100755 --- a/hooks/assemble-agents.sh +++ b/hooks/assemble-agents.sh @@ -27,9 +27,15 @@ case "$FILE" in "$ASSEMBLER" --in-place "$FILE" 2>&1 | sed 's/^/[assemble-agents] /' ;; */agents/_blocks/*.md) - # Block changed → rebuild everything (block is shared) + # Block changed → rebuild everything (block is shared). + # Always surface FAIL/ERROR lines; truncate only the OK tail. echo "[assemble-agents] block changed, rebuilding all agents..." - "$ASSEMBLER" --in-place 2>&1 | sed 's/^/[assemble-agents] /' | head -40 + OUTPUT=$("$ASSEMBLER" --in-place 2>&1 || true) + FAILS=$(printf '%s\n' "$OUTPUT" | grep -E '^(FAIL|ERROR)' || true) + if [ -n "$FAILS" ]; then + printf '%s\n' "$FAILS" | sed 's/^/[assemble-agents] /' + fi + printf '%s\n' "$OUTPUT" | sed 's/^/[assemble-agents] /' | head -40 ;; *) exit 0