Repository navigation
[Epic] Build comprehensive interactive setup wizard for the CLI - #1611
Conversation
…ew `setup/` directory is added). Summary I created the setup-wizard domain layer described in issue #1599 — two pure modules under `packages/cli/src/commands/setup/` that let the upcoming `propr setup` flow be driven and tested without Ink, readline, or Docker. `types.ts` — shared step/status model - `SetupStepId` — stable ids for the nine flow steps (`check`, `init-stack`, `pull-images`, `configure-agents`, `github-auth`, `start-stack`, `whitelist`, `repo`, `launch-ui`), in run order. - `SetupStepStatus` — `pending | active | done | skipped | warning | failed`. - `SetupStep` (title, description, `optional`, status, live `detail`, suggested `nextAction`) and the aggregate `SetupState`. - `SETUP_STEP_DEFINITIONS` — the canonical ordered definitions (repo + UI launch marked optional). No Docker/Ink/readline imports, so both the TUI and the sequential renderer can share it. `state.ts` — pure helpers - Stack root: `resolveSetupRoot` reuses the orchestrator's `resolveStackRoot` precedence (flag → `PROPR_ROOT` → saved config → cwd) without loading the Docker core. - Initialization check: `inspectStackInit` / `isStackInitialized` report whether `.env` + `data/logs/repos` already exist (read-only, so the flow stays re-runnable). - Safe `.env` editing: `readEnvVars`, `hasEnvValue`, and `applyEnvSelection` — non-destructive by default (a key is only written when absent/empty; empty selections never blank an existing value; `{ overwrite: true }` for explicit user selections). Writes route through the existing `upsertEnvVars`. - GitHub auth: `detectGithubAuthMode` infers the configured mode from `.env` via the shared `resolveGithubAuthMode`, so it can't drift from the backend. - Step state machine: `createSetupState`, `getStep`, `updateStep` (immutable patch), `nextPendingStep`, and `isSetupComplete` (required steps must reach a non-failed terminal state; optional steps never block). Verification - `tsc --noEmit` and `eslint .` both pass clean. - A smoke test confirmed each acceptance criterion: helpers import with no Docker/UI; existing `.env` values are preserved unless overwrite is requested; empty values are ignored; and the step model reports progress/completion correctly. `scaffoldStack` is already exported from `initStack.ts`, so the prerequisite noted in the issue is satisfied — no separate export was needed.
Summary The issue asked to export the stack scaffolding primitives from `packages/cli/src/commands/initStack.ts` so `propr setup` can reuse them. On inspection, the function `scaffoldStack` and the types `InitStackOptions` / `InitStackResult` were already exported. The remaining gap was `DetectedCred` — the interface used by the exported `InitStackResult` (its `detected` and `pendingCredentials` fields) and by `scaffoldStack`'s return value — which was still private. Setup code couldn't name credential entries, and with `declaration: true` a private name in the public surface is fragile. Change made: exported the `DetectedCred` interface (`packages/cli/src/commands/initStack.ts:17`). Purely additive — one `export` keyword, no implementation changes. This satisfies the acceptance criteria: - `propr init stack` behavior unchanged — only a type was made public; the command, action, and `scaffoldStack` body are untouched (`npm run build` passes, declaration emit clean). - Setup can import directly — `scaffoldStack`, `InitStackOptions`, `InitStackResult`, and now `DetectedCred` are all importable. - No forced overwrite — `scaffoldStack` already skips an existing `.env` unless `options.force` is set (`initStack.ts:106`), so re-running setup against an initialized root won't overwrite `.env` until an explicit force option is wired in later.
… I implemented for issue #1601. Summary I created the UI-agnostic setup wizard engine that sequences `check` + `init stack` behavior and the remaining one-time setup tasks in a safe order. Files 1. `packages/cli/src/commands/setup/engine.ts` (new) — the engine. It builds on the existing `setup/types.ts` and `setup/state.ts` (step model + non-destructive `.env` helpers) already present in the base branch. 2. `packages/cli/src/commands/setup/engine.test.ts` (new) — 9 tests, all passing, run via `npx tsx --test`. 3. `packages/cli/tsconfig.json` (modified) — excludes `*.test.ts` from the build so the test lives next to its source without leaking into `dist/`. Design The engine separates *sequencing/decision logic* from *I/O* via two injectable seams, so it runs fully mocked in tests (no Docker/network/TTY): - `SetupPrompts` — optional callback hooks a renderer (Ink or readline, in later issues) supplies for user decisions (root, agents, GitHub auth, start, whitelist, repo, UI). Every hook is optional with a safe non-interactive default. - `SetupActions` — the side-effecting operations, with `createDefaultActions()` binding to the real `runChecks`, `scaffoldStack`, orchestrator (pull/start/health), and repo API. Heavy modules are lazy-imported so importing the engine stays cheap and Docker-free. - `SetupReporter` — optional progress hooks (`onState`/`onStepStart`/`onStepSettled`/`onLog`). Order & safety contract (matches all requirements) `check → init-stack → pull-images → configure-agents → github-auth → start-stack → whitelist → repo → launch-ui` - Checks run first and steer the rest; a missing/unreachable Docker daemon blocks the flow with a clear next action, while addressable failures (e.g. GitHub auth) continue. - Init only when `.env` is missing or the user picks a new root; `scaffoldStack` is always called without `force`, so an existing `.env` is never overwritten wholesale. - Core images pull by default; agent images only for selected agents (default = agents detected on the host). - Stack start validates backend health afterward; a running stack is reused, not restarted (user data untouched). - All `.env` edits go through the non-destructive per-key `applyEnvSelection`. - Optional repo addition can be skipped or fail without aborting the run (becomes a warning). Verification - `npm run typecheck` ✅ - `npm run build` ✅ (declarations emit cleanly; test excluded from `dist/`) - `npm run lint` ✅ (only a pre-existing warning in a generated file) - 9/9 engine tests pass, covering: re-run leaves install intact, selective image pulls, optional-repo skip/failure tolerance, Docker-blocked check, unresolved auth warning, unhealthy-backend warning, running-stack reuse, and a full unattended run hitting every step in order.
… I implemented for issue #1602. Summary Added the interactive Ink setup TUI that drives the existing UI-agnostic setup engine (`packages/cli/src/commands/setup/engine.ts`). New file: `packages/cli/src/tui/SetupApp.tsx` - `SetupBridge` — the prompt bridge requested by the issue. A pub/sub bridge (same history-replay pattern as the existing `CheckHub`) with two halves: - *Engine → UI*: `emitState`, `emitLog`, `finish` feed live state/log events into the React tree. - *Prompt primitives*: `confirm`, `input`, `select` (single choice), and `multiSelect` (multi choice) — each enqueues a prompt request and returns a promise the UI resolves. Only one is ever in flight since the engine runs steps sequentially. `cancel()` rejects the in-flight prompt (and any later ones) with a `SetupCancelledError`. - `buildSetupPrompts(bridge)` — maps the engine's typed `SetupPrompts` hooks onto the four primitives (agents → multi, GitHub auth → single choice + chained inputs, whitelist/root → input, start/repo/UI → confirm), preserving the engine's safe-default contract (blank input / "keep" leaves config untouched). - `SetupApp` — renders every step with status glyph/title/detail/next-action and a spinner on the active step, streams recent log lines, and renders the active prompt with keyboard navigation (↑/↓, space, ←/→, y/n) and text entry (with cursor, backspace, and masking for tokens). Ctrl-C cancels and exits cleanly. Modified: `packages/cli/src/tui/app.tsx` - Added `renderSetupWizard()`, which wires a `SetupBridge` + reporter to `runSetup()`, renders `SetupApp`, and resolves with the final `SetupRunResult`. Because a cancelled prompt unwinds the engine, `runSetup` always resolves, so the function returns cleanly on both completion and Ctrl-C. Acceptance criteria - ✅ `renderSetupWizard()` resolves with the final setup state (`SetupRunResult`, which carries `state`). - ✅ The TUI updates as the engine emits state (reporter → bridge → reducer). - ✅ Ctrl-C cancels without leaving an Ink session running (`exitOnCtrlC: false`, explicit `bridge.cancel()` + `exit()`). Verification - `npm run typecheck`, `npm run lint`, `npm run build` all pass. - Added `SetupApp.test.tsx` (11 tests) covering the bridge primitives, cancellation, history replay, and the engine-hook mappings — all pass, and the existing 12 engine tests still pass. One note: since there's no `ink-testing-library` in the project, the tests cover the bridge/mapping logic directly (the component is driven entirely by those same events) rather than rendering the React tree.
… I implemented for issue #1603. Summary Created the sequential fallback wizard for `propr setup`, which runs when the Ink TUI is unavailable (non-TTY, no raw mode, SSH/CI shells, or explicit `--no-tui`). New files `packages/cli/src/commands/setup/sequential.ts` — the readline fallback wizard: - Reuses the same engine. It wires the engine's two seams (`SetupPrompts` and `SetupReporter`) to plain `readline/promises` prompts and line output, so the flow, decision logic, and safe-default contract are identical to the Ink path — the two renderers can't drift. - Prompt callbacks via `readline/promises`. Four primitives (`confirm`, `input`, `select`, `multiSelect`) back the engine hooks, whose bodies mirror `buildSetupPrompts` in `SetupApp.tsx` one-for-one (same blank-keeps-default semantics, same auth/whitelist/repo logic). Secrets like the relay token are masked — keystroke echo is suppressed by intercepting readline's internal output writer, with a graceful fallback if that hook is absent. - Clear step/choice output. `buildSequentialReporter` prints a `▶` heading + description when each step starts, a status glyph (`✓ − ! ✗`) + detail when it settles, the `↳` next-action on failures/warnings, and log lines in between. Color is auto-enabled only on a TTY with `NO_COLOR` unset (matching `checkCommands.ts`). - Fails fast when stdin isn't interactive. `runSequentialSetup` throws a typed `SequentialSetupUnavailableError` with actionable guidance (run in a real terminal, or `propr init stack` + edit `.env`) instead of hanging on a prompt no one can answer. - Testable I/O seam. All I/O goes through a `SequentialIo` interface; the default binds to readline, tests inject a scripted transcript. `packages/cli/src/commands/setup/sequential.test.ts` — 15 tests covering each prompt primitive (defaults, re-prompting on invalid input, masking, de-duping), the reporter, the non-TTY guard, and two full engine runs (success + a failed required step) driven entirely by scripted answers. Verification - `npm run typecheck` ✅ (both src and test configs) - `npm run lint` ✅ - All 15 new tests pass; the full setup suite (38 tests incl. engine + Ink bridge) stays green - Smoke-tested the real readline path with piped streams: answers return correctly, masked input is not echoed, output prints Scope note The issue's acceptance criteria reference `propr setup --no-tui`; this issue is part of an epic and the `setup` command itself isn't registered yet (no command wiring exists in the tree). Per the spec ("Create `packages/cli/src/commands/setup/sequential.ts`"), I implemented the module and its tests; a sibling issue wiring the command will simply call `runSequentialSetup` on the `--no-tui`/non-TTY branch.
Summary Issue #1604 asked to register a top-level `propr setup` command. Most of the scaffolding already existed on this branch (`createSetupCommand()`, the UI-agnostic engine, the Ink wizard, the sequential fallback, and the barrel/entrypoint registrations). Comparing the existing `setupCommand.ts` against the issue's requirements surfaced two genuine gaps, which I fixed in `packages/cli/src/commands/setupCommand.ts`: 1. `--skip-remote-image-check` option — the requirement listed this flag but the command didn't expose it. I added the option, extended `SetupCommandOptions`, and threaded `skipRemoteImageCheck` into both render paths (`renderSetupWizard` for Ink and `runSequentialSetup` for the fallback). The downstream engine already accepted this option via `RunSetupOptions`, so it now flows all the way to `actions.runChecks(...)`. 2. Help text on re-running — the issue requires "help text explaining that setup is safe to re-run." I added a paragraph stating setup re-discovers the environment, skips already-satisfied steps, and never undoes existing configuration, plus a `--skip-remote-image-check` example. Verification - `tsc --noEmit` passes clean. - Existing `setupCommand.test.ts` (renderer-selection tests) all pass (4/4). - `propr setup --help` renders the command with all three options (`--root`, `--no-tui`, `--skip-remote-image-check`) and the "safe to re-run" guidance. Acceptance criteria - ✅ `propr setup --help` shows the command and options. - ✅ `propr setup --no-tui` uses the sequential fallback (`options.tui !== false` gate). - ✅ `propr setup` attempts Ink first (`canRenderInkSetup()`) and falls back to sequential otherwise.
…ted for issue #1605. Summary Added setup support for agent enablement and image-based authentication, running as a new `enable-agents` step in the `propr setup` flow after the stack is up (the backend must be reachable to read/write agent config). New file: `packages/cli/src/commands/setup/agents.ts` A UI-agnostic module mirroring the engine's seam philosophy: - `runAgentSetup()` — the orchestration. It (1) reads the agents already configured in the running backend, (2) adds any *selected* agent whose type is missing, seeding alias + supported-model set from the shared `AGENT_DEFAULTS` metadata, and (3) for selected agents that support an interactive image login, offers to authenticate and runs login only for those the user confirms. It never throws for expected conditions — every failure is captured in `outcome.errors`. - `createDefaultAgentSetupActions()` — production side effects, lazily importing the orchestrator/API/validation modules. Backend calls go through `listAgents`/`addAgent` (pointed at the local stack's API port); login reuses `planAgentLogin()` + `spawnSync("docker", …)` exactly like `propr agent login`. Engine wiring (`engine.ts`, `types.ts`) - New `enable-agents` step inserted between `start-stack` and `whitelist`. - `SetupActions extends AgentSetupActions`; defaults spread in via `createDefaultAgentSetupActions`. - New optional `confirmAgentLogin` prompt hook (default = authenticate none). - The step maps the outcome to done/skipped/warning and never settles failed — agent setup can't abort the run. Renderer prompts (`sequential.ts`, `tui/SetupApp.tsx`) - Both renderers gained a matching `confirmAgentLogin` multi-select (loginable candidates only), keeping the two paths in sync. Tests - New `agents.test.ts` (10 tests) pinning the acceptance criteria: existing agents kept intact (incl. a disabled one not re-enabled), missing selected agents added, login offered only for loginable+confirmed agents, and graceful handling of read/add/prompt failures. - Updated both existing setup test files: added inert agent-action mocks (so no test touches the backend/Docker) and the step-order assertion. All 39 setup tests pass and `tsc --noEmit` is clean. Acceptance criteria - ✅ Existing enabled agents remain enabled (matched by type; backend array preserved verbatim, only appended to). - ✅ Selected new agents are added if missing (seeded from shared metadata). - ✅ Authentication attempted only for agents with an image login plan (`loginableAgents()` filter) and only on user confirmation. - ✅ Only selected agent images are pulled — that was already handled by the existing `pull-images` step, which this step relies on.
…docs/tutorials/setup-server`) are correct. Everything is implemented, type-checks, lints clean, and all 73 setup-related tests pass. Here's a summary of what I implemented for issue #1606. Summary Added a dedicated GitHub intake-mode and whitelist helper module for `propr setup`, and refactored the engine to use it. New file: `packages/cli/src/commands/setup/github.ts` The single tested home for both concerns, with side effects injected so it stays UI/Docker/network-free: - `buildIntakeEnvVars(mode, opts)` — turns an intake choice into `.env` keys: - `app` / `polling` → `ENABLE_GITHUB_WEBHOOKS=false` (events arrive via the shared relay or polling) - `webhooks` → `ENABLE_GITHUB_WEBHOOKS=true` + `GH_WEBHOOK_SECRET`, and throws `IntakeConfigError` on an empty/whitespace secret (the API refuses to boot without one) - `defaultIntakeMode(authMode)` — defaults to the ProPR App/relay path (`app`) when an App or relay is configured, else `polling` - `saveWhitelist(...)` — saves through the settings API when the backend is running (a *partial* update that never overwrites unrelated settings), mirrors into `.env` for restart durability, and falls back to `.env`-only when the backend is down or the API call fails - Exposes `INTAKE_DOCS_URL` / `WEBHOOK_DOCS_URL` (docs.propr.dev links) surfaced in prompt detail text Engine (`engine.ts`) - New non-optional `intake` step between `github-auth` and `start-stack` (env vars must be written before boot); skipped in demo mode; an invalid choice (e.g. webhooks with no secret) is a non-blocking warning - Whitelist step rewritten to route through `saveWhitelist` + a new `saveWhitelistSetting` action (wired to `updateSetting("github_user_whitelist", …)` against the local stack) - New `configureIntake` prompt hook on `SetupPrompts` Renderers - `sequential.ts` and `tui/SetupApp.tsx` both gained a `configureIntake` prompt (mode select + masked, re-asked-until-non-empty webhook secret) with docs links — kept one-for-one in parity Types (`types.ts`) - Added the `intake` step id/definition; corrected the inaccurate whitelist step description Tests - New `github.test.ts` covering all four acceptance criteria directly - Engine tests for polling/webhooks env writes, empty-secret rejection, demo skip, and whitelist-via-settings vs `.env` fallback - Sequential + Ink prompt-mapping tests, plus updated step-order/scripted-run fixtures All acceptance criteria are met: polling writes `ENABLE_GITHUB_WEBHOOKS=false`; webhooks writes the flag + secret; an empty secret is rejected; and the whitelist saves through settings via a partial update.
Summary I added a new focused test file `test/cliSetupWizard.test.ts` (14 tests) that addresses GitHub issue #1607. Approach The setup wizard lives in `packages/cli/src/commands/setup/` (engine, state, github, agents, sequential). The package already has fully-mocked unit tests where *every* action — including the `.env` helpers — is stubbed. My new top-level file deliberately keeps the env/state helpers real (`inspectStackInit`, `readEnvVars`, `applyEnvSelection`, `detectGithubAuthMode`) and runs them against real temporary stack roots, while mocking only Docker/network/backend actions. This proves the on-disk `.env` behavior the wizard relies on for safe re-runs — the gap the issue targets. Coverage against the requirements 1. State helpers without Docker — reads/edits a real `.env` in a temp dir; verifies `inspectStackInit` only reports `initialized` once `.env` plus `data/logs/repos` all exist. 2. Intake mode `.env` writes — `polling` writes `ENABLE_GITHUB_WEBHOOKS=false`; `webhooks` writes the flag + signing secret; an empty secret is rejected and writes nothing (non-blocking warning) — all asserted by reading the real file back. 3. Existing `.env` not overwritten — a re-run on an initialized stack skips scaffolding (asserts `scaffoldStack` is never called) and preserves every user-set value; a blank-Enter re-run keeps an existing webhook config (defaults to `keep`); plus a direct `applyEnvSelection` non-overwrite proof. 4. Fallback prompt behavior with mocked prompts — a scripted in-memory `SequentialIo` drives `buildSequentialPrompts` (blank-Enter safe defaults, webhook secret re-ask) and a full `runSequentialSetup` run that writes the scripted choices to the real `.env`. 5. Selected agent images only — asserts `pullImages` receives exactly the selected agents, with duplicates/unknowns filtered, and no agent images when none are selected. Acceptance criteria met - Tests pass via the normal `tsx --test` command (verified: 14/14, and 34/34 alongside existing setup tests). - No test requires real Docker, GitHub, or agent credentials — all such actions are stubbed; only temp-dir filesystem I/O is real. - The re-run/idempotency scenario is covered by multiple tests. The file is type-clean (0 errors under the project's strict compiler settings) and follows the existing test conventions (`node:test`, `node:assert/strict`, `mkdtempSync` temp roots, scripted `SequentialIo`).
…es are complete. Summary I documented the new `propr setup` command across the four files specified in issue #1608, after reading the actual command implementation (`packages/cli/src/commands/setupCommand.ts` and `setup/engine.ts`) so the docs match real behavior — its options (`--root`, `--no-tui`, `--skip-remote-image-check`), its 11 orchestrated steps, and its re-run safety contract. `docs/docs/tutorials/setup.md` (overview) - Reframed the intro to make `propr setup` the preferred CLI bootstrap, with a quick-start snippet and a note that it is safe to re-run. - Updated the Local and Server section blurbs to lead with `propr setup` while noting `init stack` / `check` / `start` and the launcher remain as manual alternatives. - Added security-hardening links (VPS + advanced hardening) to the final "After Setup" guidance. `docs/docs/tutorials/setup-local.md` - Made `propr setup` the recommended quick-start; explained interactivity, `--no-tui`/SSH fallback, and re-run safety. - Added a Manual / Advanced Flow subsection that preserves the existing `init stack` → configure `.env` → `check` → `start` flow verbatim, and relocated the npm-permissions tip next to the install command. `docs/docs/tutorials/setup-server.md` - Made `propr setup --root /srv/propr` the recommended bootstrap (noting the polling-vs-webhook intake choice), with the original `init stack`/`check`/`start` retained under a Manual / Advanced Flow subsection. - Added hardening links (Secure VPS Deployment + Advanced VPS Hardening) to the final guidance. `docs/docs/features/propr-cli.md` (CLI reference) - Added `propr setup` to the control-plane command list and a dedicated `### propr setup` subsection covering purpose, the full step list, re-run/idempotency behavior, an options table, and the non-interactive (CI/piped) fallback to `init stack`. All acceptance criteria are met: quick-starts show `propr setup`; `init stack`/`check`/`start` remain documented as manual/advanced flows; and the docs mention polling-vs-webhook tradeoffs and link to hardening guidance. The Docusaurus build passes.
|
/merge |
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryAll conflicts are resolved, no markers remain, and both the CLI-package and root TypeScript type-checks pass clean. SummaryI found and resolved merge conflicts in all 5 conflicted files from the 1.
|
…-b5c Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - docs/docs/tutorials/setup-local.md - docs/docs/tutorials/setup.md - packages/cli/src/commands/setup/state.ts - packages/cli/src/commands/setup/types.ts - test/cliSetupState.test.ts PR: #1611 Model: claude-opus-4-8
|
Double check whether the relay routing option (which is now default for Github event intake) has been wired correctly (as the epic was implemented before important additions to event intake were merged into main). |
|
✅ Applied the requested follow-up changes in commit 60d076d Summary of ChangesAll 104 tests pass, typecheck and lint are clean. Here's what I found and fixed. SummaryThe relay routing option was not wired correctly. The setup wizard was built against the old event-intake model, but main has since replaced it — and the two no longer connect. The core miswiringMain now resolves GitHub event intake from a dedicated env var The wizard, however, only ever wrote
A second, related bugThe wizard's relay auth flow read and wrote Changes
The docs (#1608) already described the new 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
Processing comment ID: 4767974740✓ |
…at I found and fixed. All 104 tests pass, typecheck and lint are clean. Here's what I found and fixed. ## Summary The relay routing option was **not** wired correctly. The setup wizard was built against the *old* event-intake model, but main has since replaced it — and the two no longer connect. ### The core miswiring Main now resolves GitHub event intake from a dedicated env var `GITHUB_EVENT_INTAKE_MODE` with three values — `routing_websocket` (the default), `polling`, `direct_webhook` — via `resolveGithubEventIntakeMode`. The legacy boolean `ENABLE_GITHUB_WEBHOOKS` is **deprecated and no longer selects the mode**. The wizard, however, only ever wrote `ENABLE_GITHUB_WEBHOOKS`. The consequences were silent: - Selecting **polling** wrote `ENABLE_GITHUB_WEBHOOKS=false` — a no-op. The backend stayed on the `routing_websocket` default. - Selecting **direct webhooks** wrote `ENABLE_GITHUB_WEBHOOKS=true` + secret — also ignored; the backend stayed on routing. - The "App/relay" default never actually configured the relay routing path. ### A second, related bug The wizard's relay **auth** flow read and wrote `RELAY_URL` / `RELAY_TOKEN`, but the real keys (used by `propr relay enroll` and the backend) are `PROPR_GH_RELAY_URL` / `PROPR_GH_RELAY_TOKEN`. So relay credentials never reached the backend, and `detectGithubAuthMode` never recognized an already-enrolled relay stack. Since `routing_websocket` *requires* relay auth + a relay token, this compounded the first bug. ### Changes - **`github.ts`** — intake modes aliased to the shared `GithubEventIntakeMode`; `buildIntakeEnvVars` now writes `GITHUB_EVENT_INTAKE_MODE` (never the deprecated boolean); `defaultIntakeMode` recommends `routing_websocket` only under relay auth, else `polling`; added a shared `intakeModeLabel`. - **`engine.ts`** — resolves the current mode via `resolveGithubEventIntakeMode`; keys "keep" default off `GITHUB_EVENT_INTAKE_MODE`; and now **validates the resolved mode against the shared `validateIntakeModePrerequisites`**, so choosing routing without relay auth/token surfaces a warning + actionable hint (`propr relay enroll`) instead of a silent backend boot failure. - **`state.ts`** — `detectGithubAuthMode` reads `PROPR_GH_RELAY_URL`/`PROPR_GH_RELAY_TOKEN`. - **`sequential.ts` / `SetupApp.tsx`** — relay auth writes the correct `PROPR_GH_*` keys; intake prompts offer `routing_websocket` / `polling` / `direct_webhook`. - **`types.ts`** — step description updated. - Tests across `github.test.ts`, `engine.test.ts`, `sequential.test.ts`, `SetupApp.test.tsx`, and `test/cliSetupWizard.test.ts` updated, plus new coverage for routing-with-relay (valid) and routing-without-relay (warns). The docs (#1608) already described the new `GITHUB_EVENT_INTAKE_MODE` model correctly, so no doc changes were needed — the gap was purely in the wizard code. PR: #1611 Comment by: @integry (ID: 4767974740) Model: claude-opus-4-8
|
/ultrafix |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-5.5Overall EvaluationThis PR adds a substantial I would not merge yet. There are a few correctness gaps around “safe re-run” configuration changes and completion reporting that can cause the wizard to claim success while not applying the user’s intent. Findings🔴 Cannot clear whitelist from 🔴 Switching out of demo mode is likely broken — 🔴 Setup can exit successfully without starting the stack — 🟡 “Open UI” prompt does not open anything — 🟡 Ink and sequential whitelist behavior differ — sequential supports entering 🟡 Existing legacy intake config may not default to keep — 🟡 Prompt-entered roots are not normalized after scaffolding — when 🟢 Consider allowing explicit env clearing — several setup flows need to remove or blank stale keys safely. A targeted helper such as ✅ Good separation of engine, prompts, and side effects — ✅ Relay routing is handled deliberately — the intake helper defaults routing only for relay auth and validates relay prerequisites before startup, addressing the routing wiring concern from the PR comments. ✅ Strong test coverage for core behavior — the PR includes focused tests for engine idempotency, intake writes, fallback prompts, agent image selection, and bridge behavior. ScoreThe implementation is broad and mostly well-structured, but the remaining correctness issues can misreport success or fail to apply security-relevant configuration changes. Fixing those should make this close to merge-ready. Score: 7/10 🤖 Review Details
|
|
🔄 Starting work on follow-up changes requested by @propr-ultrafix I'll analyze the 1 request and implement the necessary changes. |
|
⌛ Processing Delayed: Claude's usage limit was reached while processing requests from @propr-ultrafix. The job has been automatically rescheduled and will restart 12:30 PM UTC on 6/22/2026. Job ID: pr-comments-batch-integry-propr-1611-default-main-ratelimit-retry will run again after delay. |
|
✅ Applied the requested follow-up changes in commit 5b9315a
Summary of ChangesAll changes are complete, typecheck/lint are clean, and all tests pass (107 wizard/state + 7 envFile + 8 command/wrapper). Here's a summary of what I fixed, mapped to the review findings. Critical (🔴)1. Whitelist couldn't be cleared from 2. Switching out of demo mode was broken — Both renderers ( 3. Setup could exit 0 without starting the stack — Added a Medium (🟡)4. "Open UI" didn't open anything — Added an 5. Ink vs sequential whitelist drift — The Ink 6. Legacy intake config defaulting — 7. Prompt-entered roots not normalized — After Nit (🟢)The suggested I also added focused tests for each fix (whitelist clearing, demo→app switch on disk and in both renderers, declined-start incompleteness, legacy-webhooks keep default, UI-open invocation, and Note: I did not touch docs — the legacy 🤖 Implementation Details
💡 ProPR Slash Commands
|
… tests pass (107 wizard/state + 7 envFile + 8 command/wrapper). Here's a summary of what I fixed, mapped to the review findings. All changes are complete, typecheck/lint are clean, and all tests pass (107 wizard/state + 7 envFile + 8 command/wrapper). Here's a summary of what I fixed, mapped to the review findings. ## Critical (🔴) **1. Whitelist couldn't be cleared from `.env`** — Added a `clearEnvKeys(path, keys)` helper to `envFile.ts` (and a `clearEnvKeys(rootDir, keys)` wrapper in `state.ts`) that *removes* keys rather than blanking them. The engine's whitelist `saveViaEnv` now deletes `GITHUB_USER_WHITELIST` when the user selects none, instead of trying to write `GITHUB_USER_WHITELIST=""` (which `applyEnvSelection` skips as blank, leaving the stale value to reappear on restart). **2. Switching out of demo mode was broken** — Both renderers (`SetupApp.tsx`, `sequential.ts`) now write `PROPR_DEMO_MODE=false` when the user picks App or relay auth, so a leftover `PROPR_DEMO_MODE=true` no longer keeps `detectGithubAuthMode()` resolving as demo. **3. Setup could exit 0 without starting the stack** — Added a `startDeclined` flag; declining startup now keeps `completed` false (→ exit 1), since the backend never came up. The step still shows as skipped with a clearer detail/next-action. ## Medium (🟡) **4. "Open UI" didn't open anything** — Added an `openUrl` action (platform launcher: `open`/`cmd start`/`xdg-open`, detached + unref'd). The launch-ui step now actually opens the browser when confirmed, falling back to printing the URL if the launcher fails. **5. Ink vs sequential whitelist drift** — The Ink `configureWhitelist` now treats `"none"` as "clear", matching the sequential renderer (previously it configured a literal `none` username). **6. Legacy intake config defaulting** — `intakeConfigured` now also recognizes `ENABLE_GITHUB_WEBHOOKS`, so an older `.env` defaults the intake prompt to "keep" rather than risking an auth-derived rewrite on blank Enter. **7. Prompt-entered roots not normalized** — After `scaffoldStack()`, the engine adopts `result.rootDir` so later steps use the resolved absolute path instead of a raw relative/trailing-slash string. ## Nit (🟢) The suggested `clearEnvKeys` helper was implemented (used for #1). I also added focused tests for each fix (whitelist clearing, demo→app switch on disk and in both renderers, declined-start incompleteness, legacy-webhooks keep default, UI-open invocation, and `clearEnvKeys` unit tests). Note: I did not touch docs — the legacy `ENABLE_GITHUB_WEBHOOKS` handling is code-only defensive behavior, consistent with the "no legacy refs in docs" guidance. PR: #1611 Comment by: @propr-ultrafix (ID: 0) Model: claude-opus-4-8
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-5.5Overall EvaluationThis PR adds a substantial I think this is close, but it needs minor changes before merge because a couple of setup paths can leave users with a misleading or incomplete configuration. Findings🟡 Stack root is not persisted when setup reuses an existing initialized root — In 🟡 GitHub App private-key variable may not match the CLI stack docs — Both renderers write 🟡 Setup can continue backend-dependent steps after the user declines startup — 🟢 Minor mismatch between 🟢 Ink multi-select empty option state could be cleaner — ✅ Strong engine design — The setup engine is UI-agnostic, side effects are injectable, and the tests cover idempotency, intake mode writes, relay routing prerequisites, fallback prompts, and selected-agent-only image pulls. ✅ Relay routing wiring is explicitly covered — The PR validates ✅ Good non-destructive ScoreThe implementation is comprehensive and well-tested, but the root persistence and GitHub App env-key ambiguity are important setup correctness issues to resolve before merge. 🤖 Review Details
|
|
The setup appeared to be frozen while images were being pulled, not even the active item indicator was spinning next to "Pull images". Ideally it should show the details of the images being pulled and the progress. |
Choosing "Token relay" in `propr setup` now reuses the stored `propr login` token to discover/select the installation, mint the relay token, and write GH_AUTH_MODE / PROPR_GH_RELAY_URL / PROPR_GH_RELAY_TOKEN / GH_INSTALLATION_ID — no more manual URL/token entry and no separate `propr relay enroll` step. When no token is stored, the sequential wizard offers to run `gh auth login` inline (the Ink wizard surfaces "run `propr login`" guidance instead). Enroll is network I/O, so it lives in the setup actions layer (hasGithubToken, fetchRelayInstallations, enrollRelay, loginWithGithub); the prompt only signals intent via GithubAuthDecision.enrollRelay and an optional relay URL. The engine orchestrates discover -> picker (selectInstallation) -> enroll, degrading enroll failures to a warning rather than aborting setup. The intake step already defaults to routing_websocket for relay auth, so its prerequisite check now passes automatically once the relay creds are written. The gh-CLI login flow is extracted to auth/githubLogin.ts and shared by the `propr login` command and setup. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
`propr setup`'s "Token relay" auth choice now enrolls the shared GitHub App automatically (login if needed, discover the installation, mint the token, write the relay/routing creds), so the docs lead with it and present `propr relay enroll` as the standalone alternative. Also note that `propr relay enroll` now auto-discovers the installation id from the `propr login` identity. Updated: propr-cli, github-auth, deployment, setup, setup-local, setup-server, setup-vps, and the landing page. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
✅ Applied the requested follow-up changes in commit 5f13291 Summary of ChangesDone. I added a harmless no-op comment line to 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
Processing comment ID: 4796021258✓ |
…i/src/commands/setup/types.ts` — a documentation-only change inside an existing JSDoc block that alters no behavior, types, or exports, but produces a diff that will trigger CI on PR #1611. Done. I added a harmless no-op comment line to `packages/cli/src/commands/setup/types.ts` — a documentation-only change inside an existing JSDoc block that alters no behavior, types, or exports, but produces a diff that will trigger CI on PR #1611. PR: #1611 Comment by: @integry (ID: 4796021258) Model: claude-opus-4-8
|
implement a dummy change to trigger CI |
|
✅ Applied the requested follow-up changes in commit 800f5fe Summary of ChangesDone. I updated the existing CI-touch comment in 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
Processing comment ID: 4796075867✓ |
…cli/src/commands/setup/types.ts` (line 9) with a date stamp. It's a documentation-only change inside a JSDoc block — no behavior, types, or exports affected — but it produces a diff that will trigger CI on PR #1611. Done. I updated the existing CI-touch comment in `packages/cli/src/commands/setup/types.ts` (line 9) with a date stamp. It's a documentation-only change inside a JSDoc block — no behavior, types, or exports affected — but it produces a diff that will trigger CI on PR #1611. PR: #1611 Comment by: @integry (ID: 4796075867) Model: claude-opus-4-8
The routing relay delivers each GitHub webhook body as a raw JSON string (`rawPayload: string`), but `processWebhookEvent` and its type guards (`isIssueCommentEvent`, etc.) operate on a parsed object — the shape the direct-webhook intake produces. The routing client passed the string through unparsed, so every event was ACKed but silently dropped: guards saw a string, returned false, and no handler ran. This is why direct webhooks worked while the routing relay produced no logs and no follow-up processing. `resolveDeliveryPayload` now materializes string payloads into objects on both the inline and pull paths via a new dependency-free `parseWebhookPayload` (string -> JSON.parse, object -> passthrough, invalid JSON -> throw so the ACK is withheld and the relay can redeliver). Verified end-to-end: a PR comment now enqueues the follow-up job and the worker processes it. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
✅ Applied the requested follow-up changes in commit cd6c2b6 Summary of ChangesThe fix is verified. The spinner is driven by What I changed
Now the whole start step — running check, image pulls, network creation, container starts, and the already-async health probe — yields between every docker call, so the Ink TUI keeps animating and streaming progress instead of freezing. Verification
I left the changes uncommitted per the instructions. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
Processing comment ID: 4796106332✓ |
……, 80)` (SetupApp.tsx:677), which needs a free event loop — and the start step was calling the orchestrator's synchronous `spawnSync`-based `ensureNetwork`/`startStack`, blocking the loop for the entire cold start. That froze the spinner and swallowed keystrokes, exactly as reported. The fix is verified. The spinner is driven by `setInterval(…, 80)` (SetupApp.tsx:677), which needs a free event loop — and the start step was calling the orchestrator's synchronous `spawnSync`-based `ensureNetwork`/`startStack`, blocking the loop for the entire cold start. That froze the spinner and swallowed keystrokes, exactly as reported. ## What I changed **`docker/launcher/orchestrator.mjs`** — added non-blocking async mirrors of the start path, built on the existing `dockerAsync` primitive (the same pattern already used by `inspectImageFreshnessAsync`): - `ensureNetworkAsync`, `startServiceAsync`, `startStackAsync`, `getStackStatusAsync`, `isStackRunningAsync` (plus private `containerExistsAsync`/`removeIfExistsAsync`/`dockerRunDetachedAsync`/`ensureServiceImageAsync`/`stopServiceAsync`/`cachedImageFreshnessAsync`/`getServiceStateAsync`). - Refactored `getStackStatus` to share a `parseStackStatus` helper so sync and async versions can't drift. The synchronous functions are untouched, so `propr start` (and the production launcher image, which uses the same file) behave exactly as before — the additions are purely additive. **`packages/cli/src/orchestrator/types.ts`** — declared the new async functions and `dockerAsync` on `OrchestratorModule`. **`packages/cli/src/commands/setup/engine.ts`** — pointed the wizard's default actions at the async path: - `startStack` → `ensureNetworkAsync` + `startStackAsync` - `isStackRunning` → `isStackRunningAsync` - `pullImages` → `dockerAsync(["pull", …])` (the image-pull step had the same freeze the earlier comment flagged) Now the whole start step — running check, image pulls, network creation, container starts, and the already-async health probe — yields between every docker call, so the Ink TUI keeps animating and streaming progress instead of freezing. ## Verification - `tsc --noEmit` (incl. test config) — clean - `eslint .` — clean - `node --check orchestrator.mjs` — OK - 52 setup engine + sequential tests — all pass I left the changes uncommitted per the instructions. PR: #1611 Comment by: @integry (ID: 4796106332) Model: claude-opus-4-8
|
After stopping the stack, I can't restart it again: rinalds@localhost:/var/www/gitfix> npx tsx packages/cli/src/index.ts start Cannot start — the stack environment is not ready: Run |
|
✅ Applied the requested follow-up changes in commit 9ff6af8 Summary of ChangesThe failing test is purely about GitHub auth/demo-mode prompts ( SummaryThe bug: after stopping the stack, Root cause: The host Vibe prompt-cache directory is bind-mounted into spawned Vibe agent containers. On the first run the directory doesn't exist yet, so the Docker daemon auto-creates it as root when it sets up the mount. The first The fix (4 files):
Typecheck passes; orchestrator config tests (7/7) and 41/42 setup tests pass (the one failure is a pre-existing, unrelated GitHub-auth test). 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
Processing comment ID: 4796624895✓ |
…pts (`buildSequentialPrompts`/`configureGithubAuth`) — entirely unrelated to my changes and pre-existing on this branch. The failing test is purely about GitHub auth/demo-mode prompts (`buildSequentialPrompts`/`configureGithubAuth`) — entirely unrelated to my changes and pre-existing on this branch. ## Summary The bug: after stopping the stack, `propr start` fails with `HOST_VIBE_PROMPT_CACHE_DIR (/tmp/propr-vibe-prompts-1000) is not writable`. **Root cause:** The host Vibe prompt-cache directory is bind-mounted into spawned Vibe agent containers. On the *first* run the directory doesn't exist yet, so the Docker daemon auto-creates it as **root** when it sets up the mount. The first `start` passes validation (the dir didn't exist; `/tmp` was writable), but from then on the dir exists and is root-owned, so the host user (uid 1000) can't write to it — and every subsequent `propr start` is blocked by the writability check. `propr init stack` already pre-creates this dir owned by the user, but `propr start` did not. **The fix** (4 files): 1. **`packages/cli/src/commands/initStack.ts`** — Extracted the dir-creation logic into an exported, reusable `ensureVibePromptCacheDir()` helper (creates the dir owned by the invoking user, `0700`, idempotent) and refactored the existing inline init-stack code to use it. 2. **`packages/cli/src/tui/render.ts`** (`propr start`) — Call `ensureVibePromptCacheDir(cfg.hostVibePromptCacheDir)` before `validateEnv`, so the dir is created by the user before Docker ever auto-creates it as root. 3. **`packages/cli/src/commands/setup/engine.ts`** — Same pre-creation in the setup wizard's `startStack` action, for consistency on re-runs. 4. **`docker/launcher/orchestrator.mjs`** — Made the "is not writable" error message actionable for users *already* in the broken state, suggesting `sudo chown -R …` to reclaim or `sudo rm -rf …` to remove the regenerable cache. Typecheck passes; orchestrator config tests (7/7) and 41/42 setup tests pass (the one failure is a pre-existing, unrelated GitHub-auth test). PR: #1611 Comment by: @integry (ID: 4796624895) Model: claude-opus-4-8
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-5.5Overall EvaluationThis PR adds a substantial Not ready to merge yet because there is at least one clear test/behavior mismatch in the current diff, plus a few user-facing edge cases that should be tightened. Findings🔴 Failing stale test for demo → relay auth selection — In 🟡 Homepage quickstart still shows the old manual flow — 🟡 Declining stack startup still runs backend-dependent follow-up steps — In 🟡 Generated recovery command is not shell-quoted — 🟢 Remove the CI-trigger no-op comment before merge — ✅ Good separation of engine, prompts, and side effects — ✅ Async startup path addresses the UI freeze concern — The new async orchestrator methods and use of ✅ Relay routing payload parsing is a good regression fix — ✅ GitHub intake option gating is much clearer — ScoreStrong implementation overall, but the stale failing test and a couple of user-facing flow issues should be fixed before merge. 🤖 Review Details
|
|
/fix |
|
✅ Applied the requested follow-up changes in commit 5041445
Summary of ChangesAll changes are complete, typecheck passes, and all 24 setup-wizard tests (plus the 87 in the package suite) pass. Here's a summary of what I addressed from the two AI reviews: Correctness fixes🔴 Failing stale test ( 🟡 Stack root not persisted on reuse ( 🟡 GitHub App key variable mismatch — Both renderers now write 🟡 Backend steps run after declined startup ( 🟡 Recovery command not shell-quoted ( Cleanups
I did not commit — per the instructions, the system will handle that. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
Processing comment ID: 4796928464✓ |
…p-wizard tests (plus the 87 in the package suite) pass. Here's a summary of what I addressed from the two AI reviews: All changes are complete, typecheck passes, and all 24 setup-wizard tests (plus the 87 in the package suite) pass. Here's a summary of what I addressed from the two AI reviews: ## Correctness fixes **🔴 Failing stale test** (`test/cliSetupWizard.test.ts`) — With an existing config the sequential prompt orders options `keep / relay / custom-app`, so the old test's `"2"`→app / `"3"`→relay assumptions were inverted, and the relay path returns `enrollRelay` (not `vars`). Rewrote the test to match: option `3` is the custom App, option `2` is token relay (asserting `mode: "relay"` + `enrollRelay.relayUrl`). **🟡 Stack root not persisted on reuse** (`engine.ts`) — Added a `persistStackRoot` action (defaults to `configManager.setStackRoot`, a no-op without a config) and call it on the reuse path where scaffolding is skipped, so later `propr start`/`status` without `--root` target the right stack. Added a test. **🟡 GitHub App key variable mismatch** — Both renderers now write `HOST_GH_PRIVATE_KEY` (the host path the CLI bind-mounts) instead of `GH_PRIVATE_KEY_PATH` (the in-container launcher path), matching the CLI-stack docs. Updated `detectGithubAuthMode` to accept either so app mode still resolves, and updated the prompt label + `SetupApp.test.tsx` assertion. **🟡 Backend steps run after declined startup** (`engine.ts`) — When the user declines to start the stack, `enable-agents` and `repo` now skip with guidance instead of firing doomed backend API calls. (Whitelist already falls back to `.env` via its `isStackRunning` check.) Added a test asserting neither API is touched. **🟡 Recovery command not shell-quoted** (`orchestrator.mjs`) — Added a `shellQuote()` helper and applied it to the `mkdir`/`sudo chown`/`sudo rm -rf` suggestions so a cache path with spaces/metacharacters stays a single safe argument. ## Cleanups - **🟢 `clearEnvKeys` doc** (`envFile.ts`) — Comment now correctly says it removes *every* matching assignment, not just the first. - **🟢 Ink empty multi-select** (`SetupApp.tsx`) — Guarded the zero-options case so arrow/space keys can't index an empty array or compute a `NaN` highlight; Enter resolves to `[]`. - **🟢 CI-trigger no-op comment** removed from `types.ts`. - **🟡 Homepage quickstart** (`docs/src/pages/index.tsx`) — Leads with `propr setup` (noting it's safe to re-run) and keeps the manual `init stack`/`check`/`start` flow as a commented fallback. I did not commit — per the instructions, the system will handle that. PR: #1611 Comment by: @integry (ID: 4796928464) Model: claude-opus-4-8
|
/ultrafix |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-5.5Overall EvaluationThis PR substantially expands I would not block on major rework, but I would request a few targeted fixes before merge, mainly around partial stack detection and fallback behavior. Findings🟡 Partial stack can be mistaken for a running stack — 🟡 Ink render failure does not actually fall back to sequential mode — 🟡 Stale mode-specific secrets are left in 🟡 Async orchestrator path duplicates a large amount of sync startup logic — 🟡 Image pull progress is still very coarse — 🟢 Docs package name appears inconsistent — ✅ Good separation of concerns — ✅ Strong test coverage for the risky paths — The new tests cover idempotent ✅ Async startup addresses the UI-freeze complaint — The new async orchestrator methods and setup usage avoid blocking the Ink event loop during long Docker operations. ✅ Relay routing payload parsing fix is well-scoped — ✅ Vibe prompt cache ownership fix is pragmatic — Pre-creating ScoreThe implementation is broad, thoughtful, and well-tested, but there are still a couple of operational edge cases that can make setup appear successful or unrecoverable when the local stack is only partially running. Fixing those would put this in very strong shape. 🤖 Review Details
|


Build comprehensive interactive setup wizard for the CLI
This Epic PR aggregates all changes for the plan: Build comprehensive interactive setup wizard for the CLI
Issues in this Epic
propr setupin setup guides and CLI reference #1608: Documentpropr setupin setup guides and CLI referenceAuto-close
When this PR is merged, the following issues will be automatically closed:
Fixes #1599
Fixes #1600
Fixes #1601
Fixes #1602
Fixes #1603
Fixes #1604
Fixes #1605
Fixes #1606
Fixes #1607
Fixes #1608
Created automatically by ProPR