Skip to content

feat(pool): report step-by-step worktree setup progress - #192

Open
bearomorphism wants to merge 7 commits into
kunchenguid:mainfrom
bearomorphism:feat/setup-progress
Open

bearomorphism wants to merge 7 commits into
kunchenguid:mainfrom
bearomorphism:feat/setup-progress

Conversation

@bearomorphism

@bearomorphism bearomorphism commented Oct 19, 2026 •

Copy link
Copy Markdown

What Changed

  • Add 🌳 step messages and an animated indeterminate bar during worktree creation/reuse. Fetch stays plain so Git/SSH prompts remain visible.
  • Keep redirected, dumb, and narrow terminals plain; preserve path/JSON stdout.
  • Stop animation before post-create hooks so their terminal output and background processes behave as before.
  • Add CLI/PTY regressions in the existing E2E file, renderer tests, and documentation.

Closes #54

Demo

Animated worktree setup progress

Real CLI capture; checkout was held briefly to make the animation visible.

Testing

  • Passed: full test suite, focused CLI/PTY regressions, renderer/hook race tests, build, lint, and Windows cross-build.
  • Controlling-terminal regression verifies fetch prompts remain visible with redirected stdin. Tests also cover checkout animation and hook streaming/background-child completion.
  • Windows runtime animation was not exercised. GitHub CI awaits maintainer approval for fork workflows.

Pipeline

Updates from git push no-mistakes

…pers verbatim into cmd/e2e_test.go and deleted cmd/progress_e2e_test.go. Coverage and behavior are unchanged. All four tests and their subtests passed with go test ./cmd -run '^TestGetSetupProgress' -count=1 -v. git diff --check passed
…ar, preserving tree-prefixed step messages, plain redirected stderr, and path/JSON stdout. Animation clears around hook output and stops on success or failure; hook failures remain nonfatal. PTY regression tests failed before wiring the fix and passed afterward. Verified setup E2E tests across three runs, progress race tests across 20 runs, pool and hook tests, targeted go vet, Windows cross-build, and git diff --check. PTY tests are Unix-only; Windows runtime animation was not exercised
…umns or fewer), and unknown-width terminals now receive static progress. Animation rechecks width and bounds clearing after resizes. Hook streams track partial lines independently, preventing redirected stdout from enabling redraw over unfinished stderr. Regressions failed before the fix and passed afterward. Verified setup E2E tests across 3 runs, progress race tests across 20 runs, pool and hook tests, targeted go vet, Windows cross-build, and git diff --check. Windows runtime behavior was not exercised. No pipeline or PR actions performed
…ir original streams directly after the permanent tree-prefixed announcement, with no animation during hooks. Removed the writer wrapper and partial-line state. Git fetch/create/reuse animation, terminal-size and TERM=dumb safeguards, error cleanup, nonfatal warnings, and machine stdout remain intact. Updated README and existing cmd/e2e_test.go. Both new PTY regressions failed before the fix and passed afterward. Animation coverage now blocks a real Git checkout operation. Tests verify terminal identity, unbuffered-by-default newline streaming, acquisition completion while a background descendant remains alive, and no redraws after the hook announcement. Passed checks: - go test ./cmd -run '^(TestGetSetupProgress|TestGetHookPreservesTerminalAndLineBuffering|TestGetHookBackgroundChildDoesNotDelayLease)' -count=3 -v - go test ./cmd -run '^(TestGetHookPreservesTerminalAndLineBuffering|TestGetHookBackgroundChildDoesNotDelayLease)$' -count=20 - go test -race ./internal/pool -run '^TestSetupProgress' -count=20 - go test -race ./internal/hooks - make build - make test (all packages passed) - make lint (no formatting output or vet errors) - go vet ./cmd ./internal/pool ./internal/hooks - GOOS=windows go build ./... - GOOS=windows go test -c -o .ci-cmd.test.exe ./cmd (temporary binary removed) - git diff --check Baseline go test ./internal/pool ./internal/hooks also passed before the production fix. Limitations: PTY runtime verification was on macOS; Windows runtime and jj integration were not exercised. No external approvals, workflow reruns, pushes, or PR edits were performed. Read-only inspection confirmed PR kunchenguid#192 remains draft with a stale description. The outer executor must update it concisely to describe animation during Git setup only, paused for hooks to preserve terminal output, retaining Closes kunchenguid#54 and the generated attestation. Findings ci-1 through ci-4 were untouched
…nges. Reused existing E2E scenarios for progress ordering, skipped steps, hook routing, reuse, and machine-readable stdout. Replaced duplicated PTY runners with one socket-controlled harness covering animation during blocked Git, terminal capabilities, hook terminal identity/newline streaming, background-child completion, and no animation during hooks. Moved renderer tests unchanged into internal/pool/pool_test.go and deleted the standalone file. Production code and README are unchanged. Diff versus base: before +893/-5; after +574/-11. cmd/e2e_test.go decreased from +628/-0 to +317/-6. This round removes 325 net lines. Passed checks: - go test ./cmd -run '^TestGet(AndStatus|LeasePrintsOnlyPathToStdout|NoFetchUsesLocalRefs|LeaseAndStatusJSONContracts|ReusesWorktree|SetupProgress.*)$' -count=3 -timeout=5m -v - go test ./cmd -run '^TestGetSetupProgressTerminal$' -count=10 -timeout=5m - go test -race ./internal/pool -run '^TestSetupProgress' -count=20 -timeout=5m - go test ./internal/pool ./internal/hooks -timeout=10m - go test -race ./internal/hooks -timeout=5m - make build - make test - make lint - GOOS=windows go build ./... - GOOS=windows go test -c -o .ci-cmd.test.exe ./cmd - GOOS=windows go test -c -o .ci-pool.test.exe ./internal/pool - git diff --check Three temporary build-overlay mutations failed at the intended behavioral assertions: disabling animation, restoring hook-writer pipes, and restoring pipes only for the background hook. Temporary verification files and cross-compiled test binaries were removed. PTY runtime verification was on macOS; Windows runtime was not exercised. No pushes, PR/draft/description/attestation edits, media uploads, or external workflow approval/rerun actions were performed. Findings ci-1 through ci-4 remain untouched
@bearomorphism
bearomorphism marked this pull request as ready for review October 19, 2026 07:40
@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous fetch-prompt issue is fixed.

Reviews (2) · Last reviewed commit: "no-mistakes(ci): Fixed greptile-fetch-pr..." · Reviewed by Greptile

Comment thread internal/pool/progress.go Resolved
…le diff: 33 insertions, 13 deletions. internal/pool/pool.go now prints the existing fetch step directly to stderr and calls vcs.Fetch without animation, because Git/SSH can prompt through the controlling terminal even with redirected stdin. Create/reuse animation and product semantics are otherwise unchanged. README explains the distinction. Extended the existing cmd/e2e_test.go PTY harness with a real controlling terminal and local upload-pack helper that prompts through /dev/tty, validates a dummy response, and executes Git. Assertions reject redraw/erase bytes throughout fetch and retain valid lease JSON, blocked-checkout animation, terminal-mode, and hook regressions. The background fixture now synchronizes readiness before terminal teardown and ignores hangup. The final regression failed against original production code using a temporary build overlay and passed with the fix. Temporary verification files were removed. Passed checks: - go test ./cmd -run '^TestGet(AndStatus|LeasePrintsOnlyPathToStdout|NoFetchUsesLocalRefs|LeaseAndStatusJSONContracts|ReusesWorktree|SetupProgress.*)$' -count=3 -timeout=5m -v - go test ./cmd -run '^TestGetSetupProgressTerminal$' -count=10 -timeout=5m - go test -race ./internal/pool -run '^TestSetupProgress' -count=20 -timeout=5m - go test -race ./internal/hooks -timeout=5m - make build - make test - make lint - GOOS=windows go build ./... - GOOS=windows go test -c -o .ci-cmd.test.exe ./cmd - GOOS=windows go test -c -o .ci-pool.test.exe ./internal/pool - git diff --check Initial fixture failures were corrected before final successful validation. PTY runtime verification was on macOS; Windows runtime was not exercised. No pipeline-control commands, pushes, PR state/body changes, replies, uploads, approvals, or workflow reruns were performed. Findings ci-1 through ci-4 remain untouched
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @bearomorphism. I approved the fork CI runs for 323d67d (CI, Nix, vendor hash, and no-mistakes), so they're running now. Greptile is already at 5/5 on this tip, and the demo capture works as live evidence.

I'll do the full contract and VISION review once CI finishes. A heads-up so it doesn't surprise you: the plain stderr step lines match what #54 asked for, but the animated bar on interactive terminals is new on-by-default output, so this may need Kun's call rather than an auto-merge. If so, I'll say that plainly here so you know it isn't waiting on you.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: CI is fully green on 323d67d (Linux, macOS, Windows, Nix, vendor hash, and no-mistakes), the branch is up to date with main, and Greptile is at 5/5. Thanks, @bearomorphism.

This is now a captain-decision hold. It is not waiting on you. Every unconfigured get now prints new stderr step lines, and on interactive terminals it also draws an animated bar while it creates or reuses the worktree. That's new output that's on by default, so under our rules it goes to Kun rather than auto-merging. Stdout and --json are unchanged.

Contract-class: new-default (new default-on progress output, including a terminal animation, on every get).

VISION per-rule (VISION.md on main acf59c8; inspected internal/pool/progress*.go, the acquire changes in pool.go, the README, and the PTY e2e tests):

  • Isolation and reuse: aligns. Progress output doesn't change who can claim a slot.
  • Safe lifecycle operations: aligns. There are no destructive changes, and hook failures are still warnings.
  • Ownership and interface: aligns. Users can see what setup is doing, with the 🌳 prefix. Machine-facing stdout stays separate, fetch stays plain so credential prompts are visible, and the animation stops before hooks take the terminal.
  • Scope and evaluation: aligns. This is UX on the existing setup path, with no daemon. The only question is whether this default output is wanted.

@bearomorphism

Copy link
Copy Markdown
Author

This is a feature change. You probably need a human to review the result and sign off the PR?

Thanks.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: yes, exactly right, @bearomorphism. Because this adds new on-by-default output to every get (the step lines plus the animated bar on interactive terminals), it needs Kun's own sign-off rather than an auto-merge. I've passed it to him as ready for that decision: CI is green on 323d67d, Greptile is at 5/5, and the branch is still clean against main.

Nothing is waiting on you. If Kun asks for changes, I'll post them here.

This branch has not been deployed

No deployments
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.

Feature request: show progress feedback during worktree setup

2 participants