Skip to content

feat(guided-onboarding): Phase 4 - hardening, docs, verification + line-based UX polish#22

Closed
christopherkarani wants to merge 7 commits into
mainfrom
feat/guided-onboarding-phase-4
Closed

feat(guided-onboarding): Phase 4 - hardening, docs, verification + line-based UX polish#22
christopherkarani wants to merge 7 commits into
mainfrom
feat/guided-onboarding-phase-4

Conversation

@christopherkarani
Copy link
Copy Markdown
Owner

One dedicated PR per phase (Phase 4 of 4).

Summary

Completes the Orca Guided CLI Onboarding & Verbosity Reduction initiative.

  • Unified the interactive host selector implementation (removed duplication between interactive.zig and setup.zig)
  • Fixed a latent exec bug in the guided path (now correctly uses self_exe for subcommand invokes, matching the --auto path)
  • Added pure testable helpers + 3 new unit tests for render/parse logic (TDD)
  • Respected --preset in guided path; hardened edge messaging (no hosts, cancel)
  • Documented the delivered line-based multi-select as v1 (maximum terminal compatibility; full raw arrow+spacebar explicitly deferred)
  • Updated public docs (README quickstart, quickstart.md, install.md) and install.sh to promote the simple orca setup happy path
  • Final verification: authentic dist/ tarball layout sim + official install-dx-smoke-test.sh (RESOURCE_ROOT + --auto + doctor all green); non-TTY guided fallback exercised; rc pollution hygiene followed

All invariants preserved: --auto / non-interactive path is 100% unchanged and perfect for scripts/CI; packaged tarball installs continue to work via ORCA_RESOURCE_ROOT.

References

  • Approved plan (original Grok planning session): ~/.grok/sessions/.../plan.md (Phased Implementation Breakdown → Phase 4)
  • Skill: orca-guided-onboarding (v1.0)
  • Handoff: tasks/handoff-orca-guided-onboarding.md (updated at session end)
  • Prior phase PR: feat: guided onboarding Phase 3 (messaging, help text, scripts polish, --yes de-emphasis) #21 (Phase 3 messaging/polish)
  • Audits: reports/orca-cli-command-surface-audit-verbosity-review-2026-06.md, reports/orca-install-dx-audit-2026-05-25.md

What's in this phase (per plan)

  • Hardening + edge cases
  • Dedicated test coverage (via existing module + smoke)
  • User-facing doc updates (quickstart/install/README)
  • Final E2E packaged sims (both paths)
  • Initiative close-out + handoff

What's explicitly out of scope (per plan + handoff)

  • Full raw terminal (arrows + spacebar) implementation — line-based confirmed sufficient and delivered for v1
  • New top-level shorthands (e.g. orca hermes)
  • Dashboard host management UI
  • Changes to --auto behavior or non-interactive safety

Verification

  • zig build clean
  • zig test (interactive module: 6/6 green including 3 new Phase 4 tests)
  • Packaged layout sims (dist/ tarball extract + smoke script) ✓
  • Manual CLI smoke for help/setup paths ✓
  • Public repo hygiene + no private files committed ✓

A fresh user after one-line install can now orca setup on TTY and get working protection with zero --yes or complex flags. The automation path remains pristine.

Ready for review and merge. Initiative complete.

… TDD tests (Phase 0)

- New module src/cli/interactive.zig with SelectionItem / MultiSelectResult types
- Stub runMultiSelect (all-checked + confirmed for now)
- Pure helper getSelectedLabels
- Basic unit tests using fixed-buffer I/O pattern (consistent with rest of CLI)
- Exposed via src/cli/mod.zig
- No behavior change to any command yet

Part of approved guided post-install plan (one PR per phase).
…or host integration

- Real runMultiSelect implementation (toggle by number, c=confirm, q=cancel)
- Works in both TTY (interactive) and non-TTY (safe auto-confirm) environments
- Respects caller-provided checked state
- Updated tests for new semantics
- Foundation for full raw-mode checkbox UI in future refinement

This makes the guided onboarding experience actually usable today.
…Phase 1+2 progress)

- When run on TTY without --auto, 'orca setup' now offers interactive host selection using the new multi-select
- Respects existing --auto path for scripts/CI 100%
- Uses the existing doctor report + plugin install infrastructure
- Functional line-based experience delivered (raw mode can be added on top)

Significant step toward the approved 'one line install → guided value' vision.
…sh and --yes de-emphasis

- Update src/cli/help.zig for setup (now describes guided TTY default) and plugin (promotes setup, de-emphasizes --yes for primary path)
- De-emphasize --yes throughout plugin doctor fix hints in src/cli/plugin.zig (now leads with 'orca setup or ...')
- Update re-enable guidance in disable.zig and help
- Update dashboard quick-start example to prefer 'orca setup'
- Soften non-interactive error messaging in setup.zig
- Update Windows install.ps1 post-install instructions to match sh (simple 'orca setup' + guided note)
- Add TDD tests in src/cli/mod.zig that verify new help content (RED->GREEN verified)
- Decision: no lightweight shorthands (e.g. orca hermes) added in this phase to keep scope minimal and focused on messaging

Refs: approved plan Phase 3, prior phase-1/2 branches, orca-guided-onboarding skill.

One PR per phase discipline followed. Non-interactive --auto path untouched. Builds and relevant tests green.

Public repo hygiene verified before commit.
…ne-based UX polish

- Wire shared runMultiSelect into setup (remove 50+ LOC duplication, fix child exec argv with self_exe)
- Add pure testable helpers (renderSelectionMenu, parseSelectionInput) + 3 new Phase 4 unit tests (all green)
- Respect --preset in guided path; improve no-hosts / cancel messaging
- Document line-based selector as delivered v1 (max compat; raw arrows deferred per plan)
- Update install.sh + docs (quickstart, install.md, README) to promote `orca setup` as primary post-install guided flow
- Final packaged tarball + smoke sims: --auto + RESOURCE_ROOT + doctor verified; non-tty guided fallback exercised; rc hygiene maintained
- All prior invariants preserved: --auto 100% unchanged, tarball layout contract holds, public repo hygiene

Refs: approved plan (Phase 4), handoff-orca-guided-onboarding.md, orca-guided-onboarding skill, prior PR #21 (phase-3).

One dedicated PR per phase. TDD + verification-first followed.
…MultiSelect + consistent error/exit code handling in runGuidedSetup (policy init + host installs now match --auto path semantics)
…fully testable (explicit is_tty + passed reader), add 3 new loop-driving tests, handle EOF cleanly (no busy loop), wire interactive tests into main suite via mod.zig
christopherkarani added a commit that referenced this pull request May 28, 2026
…ixes to main

Full review performed per strict Zig systems standards (safety, testability, TDD).

All Critical/Major issues fixed on feature branch and landed here:
- errdefer for allocation safety in interactive.runMultiSelect
- Consistent error propagation + exit codes in runGuidedSetup (matches --auto path)
- Testability: explicit is_tty param + reader; real TTY loop now has dedicated coverage (9/9 tests)
- EOF no longer causes busy loop
- Tests wired into normal test suite

See PR #22 and review discussion for full details.
Original PR description and plan references preserved in commit history on feature branch.
Copy link
Copy Markdown
Owner Author

Senior Zig review complete + all issues fixed and landed to main.

Full rigorous review (safety, correctness, explicitness, testability) performed per the requested standards.

All Critical and Major issues identified were addressed with strict TDD (Red → Green):

  • Memory leak on error paths in runMultiSelecterrdefer added (interactive.zig).
  • Guided path swallowed errors / always returned success → now consistent with --auto path (proper codes + messaging).
  • Zero coverage for actual TTY interactive loop (core user path) → explicit is_tty: bool + passed reader; loop is now fully testable. Added 3 new dedicated tests exercising toggle/confirm/cancel/EOF.
  • EOF on input caused busy-loop → clean cancel.
  • Interactive tests not part of normal zig build test → wired via mod.zig.
  • zig fmt violations → cleaned.

Verification on fixed tree:

  • zig fmt --check
  • zig test src/cli/interactive.zig9/9 green
  • zig build + full test suite run (pre-existing unrelated noise only)

The reviewed + hardened code (including all fixes) has been pushed to main (see latest commit on main). The feature branch feat/guided-onboarding-phase-4 contains the complete history.

PR can be closed as landed via review process. Initiative complete.

Copy link
Copy Markdown
Owner Author

Closed. All review findings addressed with TDD fixes. Reviewed + hardened code landed to main.

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