release: v0.9.4 review-fix bundle (A1-A12 + phase-label flake removal)

Merged
SA
4mo ago
+447-180

Summary

Fixes the actionable items from the v0.9.4 pre-release multi-persona review (CTO, PM, Data Engineer, Tech Lead, Support Engineer), plus all findings from the subsequent bot review (CodeRabbit + cubic) and the local consensus review (6 reviewers). Twelve original items; A5 dropped as false positive. Everything requiring more than a 30-min patch was deferred to tracking issue #1052.

Also deletes one flaky TUI e2e file (already CI-skipped) that was emitting noise on every local suite run.

Changes

Original persona-review actionables (A1–A12, 11 commits)

#Purpose
A1Restore os.homedir spy in mcp/lifecycle.test.ts — root cause of the red TypeScript check on PR #1001. spyOn had no restore, poisoning six tilde-expansion tests in permission/next.test.ts when bun loaded the next file.
A2Materialize quotes the correct recovery command — --target-parent never existed; users hit "unknown flag". Later refined by B2 (portable + ownership-safe wording).
A3+A4Loopback OAuth: walk port range 7317-7325 on collision, bump timeout 5→15 min for corporate SSO+MFA. (An A4 stderr echo of the authorize URL was later removed — see M2 — after review discovered the worker's stdio redirect swallowed it AND the TUI dialog already renders + copies the URL.)
A6useConnected() clarified. Semantically identical to the pre-refactor code (later extracted to a shared predicate — see m8).
A7+A8Onboard-connect template: surface ~/altimate-sample-dbt/ in the menu row; offer PEP 668 alternatives (pipx / uv / venv) alongside plain pip.
A9quickstart-new.md rewritten: welcome panel + curated 6-provider picker + Altimate LLM Gateway top row; new Step 2.5 for the first-run scan gate; explicit note that the activation menu is chat text (interactive picker deferred to #1052 / D1).
A10jaffle-shop/README.md reordered: activation-menu path leads; bare-shell pip flow appendix.
A11sample_setup error metadata suffix sentinel (later reverted — see m6).
A12writeJsonAtomic docstring reflects that the call-site sweep is a tracked follow-up.
flakeDelete phase-label.tui-e2e.test.ts — flaky locally (bootstrap-span duration races the PTY poll interval), already test.skip in CI.

Bot-review round (CodeRabbit + cubic, 4 commits)

  • B1 — Atomic callback-server startup with shared startupInFlight promise so concurrent OAuth flows all use the actually-bound port.
  • B2 — Portable + ownership-safe HOME error message (drops /Users/you platform assumption; primary advice = re-run without sudo; secondary = sudo -E HOME="$HOME" altimate-code with chown recovery hint).
  • B3/B4/B5/B10 — Docs bundle (absolute dbt path in venv fallback; telemetry disclosure in quickstart; /issues/1052 in writeJsonAtomic docstring; duckdb-cli install line in sample README).
  • B6/B8 — Test-hardening (hoist mkdtemp out of os.homedir mock; retry shares timeout budget).

Consensus-review round (6-reviewer local consensus, 4 commits)

  • M1 — pipx install dbt-duckdb and uv tool install dbt-duckdb expose NO dbt binary (the entry point ships with dbt-core, a dep). Users hit a second dead end after PEP 668. Fixed to pipx install --include-deps dbt-duckdb and uv tool install dbt-core --with dbt-duckdb.
  • M2 — Drop the stderr.write of the authorize URL. The auth plugin runs inside a TUI worker whose stdio is redirected to the log file — the write reached the log, never the terminal. Also redundant (dialog-provider.tsx already renders + copies). Removed to stop leaking state-bearing URLs into logs.
  • m2 / m7 / m10 — Correctness comments + symmetric error handler on the callback server (drops false concurrency claim; drops invented useConnected grandfather history; uses once() + removeListener on success too, so a later runtime server error isn't silently swallowed).
  • m3 — SQLite retry now emits a console.warn on the retry path so a systematic regression stays visible.
  • m5 — isBinaryStale() walks src/ + script/ for the newest source mtime instead of just script/build.ts; catches the common "src edited" case, not just "build logic edited".
  • m6 — Reverted the suffix: -1 sentinel in sample_setup (the sentinel guarded an unreachable collision).
  • m8 — Extracted isAnyProviderConnected() to packages/tui/src/util/connected.ts so use-connected.tsx and home/tips.tsx can't drift.
  • n1 — Qualified the sample-path wording in the onboarding template (~/altimate-sample-dbt/ is the default, not unconditional).

Deferred (tracked in issue #1052)

11 items, including the 3 new deferrals from bot + consensus review:

  • The 8 items from the persona review (design changes, cross-platform testing, packaging optimizations, org-level infra).
  • B7 — build-manifest fingerprint for the smoke-test staleness guard.
  • B9 (from CodeRabbit) — non-idempotent retry semantics in cli-process.run().
  • m4 — deterministic replacement for the deleted phase-label e2e (synthetic-event unit test, no PTY timing).
  • Cubic P2 — SSH port-forwarding hint / device-code flow for headless users.

Test plan

  • bun turbo typecheck — 13/13 workspaces green
  • Focused suite on all touched files: 402 tests / 396 pass / 6 skip / 0 fail (skips are the smoke-test-binary set — stale local binary; the guard's job)
  • Full packages/opencode CI-mode suite: CI run on HEAD reports pass=10994 fail=0 (job 30607912838)
  • CI TypeScript job green on HEAD — this was the red check on PR #1001 (6 permission/next.test.ts tilde-expansion tests), which A1 root-fixes
  • Bot review threads (15/15 addressed inline)
  • Consensus review threads (11/11 new findings addressed above; 2 already covered by B1/B5)
  • Release-day UX smoke (loopback OAuth port-walk, sudo-HOME error text, activation-menu path disclosure) — pre-tag

Note on the acp/permission local-only failures

Earlier drafts of this description attributed the 6 local test/acp/permission.test.ts failures to "a macOS scheduling flake absent on CI's Linux runner". That was wrong. Commit 2cbc1e818c root-caused them: ALTIMATE_CLI_YOLO=true in the developer's shell env (direnv-managed) short-circuited packages/opencode/src/acp/permission.ts:57, auto-approving every permission and bypassing every assertion. Fixed by adding an env-hermetic guard in the test file that snapshots + restores the env var. Verified: 6/6 pass with and without ALTIMATE_CLI_YOLO=true in the parent env.

Related

  • Tracking issue for deferred items: #1052
  • Original activation feature PR that seeded most of the findings: #1001

Notes

  • Merges to main (not a feature branch).
  • Preflight will be re-run after merge; tag applied only after preflight is green + user approval per release skill.

Summary by CodeRabbit

  • New Features

    • Added a six-provider sign-in flow with expanded provider discovery.
    • Added optional first-run environment scanning with guided activation options.
    • Improved sample-project workflows for impact analysis, SQL review, and dbt/DuckDB tasks.
    • Improved provider connection detection across supported providers.
  • Bug Fixes

    • Sign-in callbacks now handle port conflicts and concurrent requests more reliably.
    • Pending sign-in sessions now time out after 15 minutes.
    • Clarified setup errors involving unsafe home or temporary paths.
  • Documentation

    • Updated quickstart and sample-project guidance, including dbt installation alternatives.