fix: honor workstream in verify-work init#3386
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThreads an optional ChangesWorkstream-aware phase resolution
Sequence Diagram(s)sequenceDiagram
participant User as CLI
participant Workflow as verify-work.md
participant SDK as gsd-sdk
participant Roadmap as roadmap.get-phase
User->>Workflow: gsd-verify-work <phase> --ws <name>
Workflow->>SDK: query init.verify-work(phase, workstream=GSD_WS)
SDK->>Roadmap: roadmap.get-phase(phase, workstream=GSD_WS)
Roadmap-->>SDK: phase metadata (phase_dir, Goal)
SDK-->>Workflow: phase_info
Workflow->>SDK: query phase.mvp-mode(phase, workstream=GSD_WS)
SDK-->>Workflow: MVP_MODE result
Workflow->>Workflow: validate Goal with user-story.validate (if MVP_MODE)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/bug-3381-verify-work-workstream.test.cjs (1)
17-21: 💤 Low valueConsider relaxing the character-count bounds in the regex.
The regex on line 19 uses exact character limits (
[\s\S]{0,260}and[\s\S]{0,160}) to verify theGSD_WSextraction logic. While this validates the contract, the tight bounds are fragile—adding comments or reformatting could break the test even if the behavior is correct.Consider using a more flexible pattern that checks for the presence of both
grepcommands without strict distance limits, or document that this test is intentionally strict about formatting.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/bug-3381-verify-work-workstream.test.cjs` around lines 17 - 21, The test's regex on the variable workflow is brittle because it uses exact character-count bounds ([\s\S]{0,260} and [\s\S]{0,160}); update the assertion to relax those bounds by replacing them with a non-greedy any-span pattern (e.g., [\s\S]*? or equivalent) or by splitting into two assertions that independently check for the two grep invocations, referencing the workflow variable and the grep -qE and grep -oE patterns so the test verifies presence and order without strict distance limits.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@get-shit-done/workflows/verify-work.md`:
- Around line 33-36: The INIT call uses an undeclared PHASE_ARG; add extraction
of PHASE_ARG from $ARGUMENTS before invoking gsd-sdk so the phase is passed
correctly — remove any --ws argument first, trim whitespace, and assign to
PHASE_ARG (ensure this runs after detecting/extracting GSD_WS) so INIT=$(gsd-sdk
query init.verify-work "${PHASE_ARG}" ${GSD_WS}) receives a valid phase;
reference symbols: PHASE_ARG, GSD_WS, INIT, and gsd-sdk query init.verify-work.
---
Nitpick comments:
In `@tests/bug-3381-verify-work-workstream.test.cjs`:
- Around line 17-21: The test's regex on the variable workflow is brittle
because it uses exact character-count bounds ([\s\S]{0,260} and [\s\S]{0,160});
update the assertion to relax those bounds by replacing them with a non-greedy
any-span pattern (e.g., [\s\S]*? or equivalent) or by splitting into two
assertions that independently check for the two grep invocations, referencing
the workflow variable and the grep -qE and grep -oE patterns so the test
verifies presence and order without strict distance limits.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7e861fc0-88fd-4889-8652-2bc6fcd2e380
📒 Files selected for processing (6)
.changeset/fix-3381-init-verify-work-ws.mdcommands/gsd/verify-work.mdget-shit-done/workflows/verify-work.mdsdk/src/query/init.test.tssdk/src/query/init.tstests/bug-3381-verify-work-workstream.test.cjs
* fix: honor workstream in verify-work init * fix: define verify-work phase arg (cherry picked from commit 574d1f4)
Fix PR
Linked Issue
Fixes #3381
What was broken
gsd-sdk query init.verify-work <phase> --ws <workstream>ignored the selected workstream and looked in root.planning/, so workstream-scoped phases returnedphase_found: false.The
verify-workworkflow also called workstream-sensitive SDK queries without forwarding the--wsargument from$ARGUMENTS.What this fix does
Threads the SDK
workstreamparameter throughinitVerifyWorkphase lookup and config loading.Extracts
${GSD_WS}inverify-work.mdand forwards it toinit.verify-work,phase.mvp-mode, androadmap.get-phase. The command hint now advertises--ws <name>.Root cause
getPhaseInfoForVerifyWorkwas a separate helper from the shared init phase lookup path and calledfindPhase/roadmapGetPhasewithout passing the QueryHandlerworkstreamargument.Testing
How I verified the fix
npm test -- --run src/query/init.test.tsnode --test tests/bug-3381-verify-work-workstream.test.cjsnpm run buildinsdk/init.verify-work 32 --ws deliveryreturnedphase_found: falsephase_found: trueandphase_dir: ".planning/workstreams/delivery/phases/32-shipment-creation-tracking-numbers-print-forms"npm run lint:testsnpm run lint:changesetRegression test added?
initVerifyWorkworkstream routing and workflow${GSD_WS}forwardingPlatforms tested
Runtimes tested
Checklist
Fixes #NNN— PR will be auto-closed if missingconfirmed-buglabelnpm test).changeset/fragment added if this is a user-facing fix (npm run changeset -- --type Fixed --pr <NNN> --body "...") — orno-changeloglabel appliedBreaking changes
None
Summary by CodeRabbit
New Features
Bug Fixes
Tests