Skip to content

[codex] optimize provisioning metadata and output - #187

Merged
brsbl merged 1 commit into
mainfrom
bb/thr_j9wcwd3xh4
Jun 17, 2026
Merged

brsbl merged 1 commit into
mainfrom
bb/thr_j9wcwd3xh4

Conversation

@brsbl

@brsbl brsbl commented Jun 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR trims avoidable work and noisy transcript entries from environment provisioning.

  • Adds a narrow HostWorkspace.getDefaultBranch() path so provisioning no longer calls full workspace status just to return default branch metadata.
  • Reads current/default branch metadata in parallel after provisioning completes.
  • Stops emitting synthetic git worktree add ... and env bash .bb-env-setup.sh command echo lines into provisioning transcripts while preserving real git/setup output and status steps.
  • Updates host-daemon fakes, branch-metadata regression coverage, and Ladle provisioning stories to match the cleaned transcript shape.

Why

Provisioning command result assembly used getStatus() only to read branch.defaultBranch. That status path scans working-tree state and can be unnecessarily expensive on large or dirty repositories. The transcript also repeated command invocations that did not add much diagnostic value next to the surrounding status and real process output.

Impact

Locally, the branch metadata step dropped from about 248ms to 101ms on this checkout. End-to-end provisioning improvement depends on setup-script cost, but this avoids a full status scan on the hot path and makes the provisioning row easier to read.

In the dev bb app managed-worktree smoke, full provisioning took about 14.8s. The setup script reported pnpm install taking 13.3s, so most of that smoke timing was dependency setup rather than branch metadata/result assembly.

Validation

  • pnpm exec turbo run typecheck --filter=@bb/host-workspace --filter=@bb/host-daemon --filter=@bb/app --output-logs=new-only
  • pnpm exec turbo run test --filter=@bb/host-workspace --filter=@bb/host-daemon --output-logs=new-only
  • pnpm exec turbo run test --filter=@bb/host-workspace --force --output-logs=new-only after trimming the over-specific transcript absence test
  • pnpm exec turbo run typecheck --filter=@bb/app --output-logs=new-only
  • pnpm exec turbo run smoke:tarball --filter=bb-app --force --output-logs=new-only
  • Dev bb app personal workspace smoke: thr_5crsarstpk returned ok
  • Dev bb app managed worktree smoke: thr_3qshhskv95 returned ok, created ready env env_ks64ct45xf, and DB event inspection found no git-worktree-command / setup-command entries or synthetic command echo text
  • GitHub CI checks: passed on cleaned head
  • git diff --check

@brsbl
brsbl marked this pull request as ready for review June 17, 2026 03:58
@brsbl
brsbl force-pushed the bb/thr_j9wcwd3xh4 branch from 909e85c to 9358f1f Compare June 17, 2026 04:12
@brsbl
brsbl merged commit e79412b into main Jun 17, 2026
12 checks passed
@brsbl
brsbl deleted the bb/thr_j9wcwd3xh4 branch June 17, 2026 04:25
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