Skip to content

create: post_create hook failures exit 0 by default (best-effort) — an empty-DB worktree reads as successfully 'created' #95

Description

@ikeikeikeike

Context

Follow-up (UX) from the mysql readiness-race investigation whose root cause is fixed in #90 / v0.9.29. Ranked #4 in that handover.

Problem

bough create is best-effort by default: --strict (internal/cli/create.go:60) is false unless passed, so once the worktree directory exists the command exits 0 even if every post_create DB hook failed. The only signal is a WARNING line (create.go:198):

[bough] WARNING: create finished with N problem(s); the worktree exists but its environment may be incomplete: ...

When create-databasemigrateseed-force all fail (e.g. the readiness race this repo just fixed, or any future post_create breakage), the worktree looks "created" and claude --worktree proceeds into it. The user only discovers the empty DB later, when the app can't find its tables — far from the actual failure.

Proposal (pick one / discuss)

  1. Make post_create DB-hook failures non-zero by default (invert --strict, or add a narrower default-on gate for post_create specifically while keeping worktree-add best-effort).
  2. Keep exit 0 but make the failure summary much more prominent — e.g. a boxed/colored final summary that names each failed hook and the remediation (bough remove --name X / re-run), instead of a single WARNING line that scrolls past.
  3. At minimum, document the --strict flag prominently in the README/quickstart so CI and scripted bough create callers opt into it.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions