fix(onboard): replace broken preflight check with direct config file test#637
Conversation
…test The onboarding preflight used `openspec status --json` to detect if a project was initialized, but that command requires an existing change to succeed. After a fresh `openspec init` (no changes yet), it always failed — causing the onboarding to incorrectly tell users to run init again. Replace with two targeted checks: - `openspec --version` to verify the CLI is installed - `test -f openspec/config.yaml` to verify project initialization
📝 WalkthroughWalkthroughThe changes introduce a fix to the onboarding preflight check by replacing status JSON parsing with direct verification of OpenSpec CLI availability and project initialization. The implementation now performs a two-step check: verifying CLI presence via Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review CompleteYour review story is ready! Comment !reviewfast on this PR to re-generate the story. |
Greptile OverviewGreptile SummaryFixes a critical onboarding loop bug where The fix replaces the single broken check with two direct, independent checks:
This approach correctly identifies both failure modes (CLI not installed vs. project not initialized) and provides appropriate error messages for each case. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Agent as Onboarding Agent
participant CLI as OpenSpec CLI
participant FS as File System
User->>Agent: Run /opsx:onboard
Agent->>CLI: openspec --version
alt CLI not installed
CLI-->>Agent: Error
Agent->>User: CLI_NOT_INSTALLED - Install CLI first
else CLI installed
CLI-->>Agent: Version info
Agent->>FS: test -f openspec/config.yaml
alt Config file not found
FS-->>Agent: NOT_INITIALIZED
Agent->>User: Run openspec init first
else Config file exists
FS-->>Agent: INITIALIZED
Agent->>User: Begin onboarding workflow
end
end
|
The changeset referenced "openspec" instead of "@fission-ai/openspec", causing the Release (prepare) action to fail.
…test (Fission-AI#637) The onboarding preflight used `openspec status --json` to detect if a project was initialized, but that command requires an existing change to succeed. After a fresh `openspec init` (no changes yet), it always failed — causing the onboarding to incorrectly tell users to run init again. Replace with two targeted checks: - `openspec --version` to verify the CLI is installed - `test -f openspec/config.yaml` to verify project initialization
…test (Fission-AI#637) The onboarding preflight used `openspec status --json` to detect if a project was initialized, but that command requires an existing change to succeed. After a fresh `openspec init` (no changes yet), it always failed — causing the onboarding to incorrectly tell users to run init again. Replace with two targeted checks: - `openspec --version` to verify the CLI is installed - `test -f openspec/config.yaml` to verify project initialization
Summary
openspec status --jsonto detect project initialization, but that command requires an existing change — so it always failed on a freshly initialized project (no changes yet), creating a loop where users were told to runopenspec initagainopenspec --version(CLI installed?) andtest -f openspec/config.yaml(project initialized?)Test plan
openspec initin a fresh project, then trigger onboarding — preflight should passopenspec/config.yaml— should report "not initialized"🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.