combine on-close-hook-failures + version-stamped-hooks#5
Closed
eric-jones wants to merge 14 commits into
Closed
Conversation
Hook scripts now embed a gc-hook-stamp comment with the build date and commit. installBeadHooks reads the on-disk stamp before writing and skips the write when the existing hook was installed by a newer binary. This prevents stale per-worktree gc binaries from silently reverting hooks to old templates. Rules: - Dev builds (date=unknown) always write - Legacy hooks (no stamp) are always upgraded - Stamped hooks are only overwritten by equal-or-newer builds Also adds engdocs/contributors/stale-worktree-binaries.md documenting the workflow gap and workaround for stale per-worktree gc copies.
The bd on_close hook is the only mechanism that cascade-closes sling
scaffolding (auto-convoy + molecule root + step beads) when a work bead
closes. Every gc invocation in the hook redirected stderr to /dev/null
and swallowed non-zero exits with `|| true`, so any failure -- gc not on
the hook subshell's PATH, store-resolution errors, transient panics --
was completely invisible. The downstream symptom was leaked sling
scaffolding with no diagnostic record anywhere.
Capture each gc command's stderr to ${BEADS_DIR:-.beads}/hooks.log, and
on non-zero exit append a dated diagnostic line that names the hook,
the bead id, the failed command, and the resolved $GC_BIN. Keep the
trailing `|| true` chain so a logging-write failure can't propagate to
bd, and keep the leading `&` so bd close stays non-blocking.
Apply the same pattern to the on_create / on_update generator for
consistency. Add hookNameFromEventType() so the diagnostic line names
the hook the operator can grep for ("on_create"/"on_close"/"on_update")
rather than the event-type label.
Closes gastownhall#1417
53e4378 to
0b4724a
Compare
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.
Fork-PR for review. Upstream: gastownhall#1607 (EXTERNAL, OPEN). Carrying for our integration.