Skip to content

feat(ws): X3 — postPull hooks on ws sync (spec 11) - #69

Merged
gustavobertoi merged 2 commits into
mainfrom
nightly/X3-postpull
Jun 29, 2026
Merged

feat(ws): X3 — postPull hooks on ws sync (spec 11)#69
gustavobertoi merged 2 commits into
mainfrom
nightly/X3-postpull

Conversation

@gustavobertoi

Copy link
Copy Markdown
Contributor

What

ws sync runs each project's postPull hooks when a fast-forward pull advances HEAD — the "pulled new code, re-run setup" trigger (spec 11).

How

  • git.Head (rev-parse HEAD) detects whether the pull moved the worktree. The SHA change is the trigger, so no state ledger is needed — postPull runs exactly once per pulled revision; re-syncing with no new commits is a no-op.
  • Hooks come from each project's devstack.yaml; the model is loaded best-effort, so an uncloned sibling degrades to git-only sync (with a [note]), never a hard failure. --no-hooks skips them.
  • Host hooks run in the repo dir; compose-exec hooks target the stack if its generated compose exists. Default onFailure is warn (a broken setup hook can't trap a sync); explicit onFailure: abort surfaces as a repo failure.

Tests

git.Head tracks commits across a new commit; runPostPull executes a host hook in the repo dir, propagates an abort, and defaults to warn. make ci green.

Scope

Remaining X3: firstRun hooks (blocked on the provision phase's scope_key).

🤖 Generated with Claude Code

gustavobertoi and others added 2 commits June 29, 2026 16:24
Adds a `macos` job on `macos-14` (arm64) so the darwin/arm64 RUNTIME target — not
just the Linux-lane cross-compile — actually builds and passes its daemon-free
tests on real hardware. Hosted macOS runners have no Docker, so the
integration/e2e (daemon) steps stay on the ubuntu `ci` lane; this lane runs the
CGO-free build, the `-race` unit suite, and a binary preflight (`version` +
`--help`). Invoked via `go` directly rather than `make` (hosted macOS ships BSD
make; the Makefile uses GNU features).

Self-verifying: the job's result on this PR confirms the macОS target is green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`ws sync` now runs each project's `postPull` hooks when a fast-forward pull
actually advances HEAD — the "I pulled new code, re-run setup" trigger.

- `git.Head` (rev-parse HEAD) detects whether the pull moved the worktree; the
  SHA change IS the trigger, so no state ledger is needed (postPull runs exactly
  once per pulled revision; re-syncing with no new commits is a no-op).
- Hooks come from each project's devstack.yaml; the full model is loaded
  best-effort, so an uncloned sibling degrades to git-only sync (with a [note]),
  never a hard failure. `--no-hooks` skips them.
- Host hooks run in the repo dir; compose-exec hooks target the project stack if
  its generated compose exists. Default onFailure is `warn` so a broken setup
  hook can't trap a sync; an explicit `onFailure: abort` surfaces as a repo
  failure in the summary.

Unit-tested: `git.Head` tracks commits; `runPostPull` executes host hooks in the
repo dir, propagates an abort, and defaults to warn.

Remaining X3: firstRun hooks (blocked on the provision phase's scope_key).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gustavobertoi
gustavobertoi merged commit 94893eb into main Jun 29, 2026
3 checks passed
@gustavobertoi
gustavobertoi deleted the nightly/X3-postpull branch June 29, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant