feat(web): SlingDialog babysit-PR mode (chunk 3)#3583
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryAll previously flagged issues have been resolved; the TDZ bug in Resolved Since Previous Review
Other Observations (not blocking)Duplicate test files: No duplicate-PR-URL guard in Files Reviewed (1 file changed in this increment)
Reviewed by claude-4.6-sonnet-20260217 · 227,762 tokens Review guidance: REVIEW.md from base branch |
…unk 0) (#3576) * feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0) * fix(gastown): address PR review feedback on slingExistingPr - Remove async from submitExternalPrToReviewQueue (no awaits inside) - Add GitLab host validation in slingExistingPr URL parsing to prevent non-GitLab URLs (e.g. Bitbucket) from matching the GitLab regex - Replace vacuous state validation tests with meaningful checkPRStatus integration tests that exercise the actual status resolution path --------- Co-authored-by: John Fawcett <john@kilcoode.ai>
Add gastown.babysitPr tRPC mutation, gastown.previewPr tRPC query, mayor-tools babysit-pr HTTP route, refinery bypass for babysat beads, and reconciler fast-track extension for babysat MR beads.
feat(web): BeadPanel babysit badge + metadata surfacing (chunk 4) - Add 'Babysat external PR' badge (cyan) when gt:babysit label present - Hide source bead link for babysit beads (no source_bead_id) - Add babysit metadata panel: head_sha (7-char, linked), force_push_allowed (Lock/Unlock icons), babysit_started_at (relative time) - Add event formatters for babysit_started, pr_feedback_detected, pr_conflict_detected, pr_auto_merge, pr_status_changed - Mirror babysit badge + metadata in BeadInspectorDashboard - Extract buildRelatedBeads and eventDescription into separate files for testability - Add unit tests for eventDescription and buildRelatedBeads babysit logic Co-authored-by: John Fawcett <john@kilcoode.ai>
…3582) * feat(gastown): gt_babysit_pr mayor tool + force-push gate (chunk 2) Add gt_babysit_pr mayor tool registration and client method, update mayor and polecat system prompts with babysit PR guidance and force-push policy, surface force_push_allowed in polecat prime context, and add corresponding unit tests. * fix(gastown): address PR review warnings on babysit PR feature - Rewrite PR Conflict Resolution Workflow in polecat-system.prompt.ts to choose strategy upfront (rebase vs merge) based on force_push_allowed, instead of rebase-then-abort which discarded conflict resolution work. - Extract resolveForcePushAllowed() from agents.ts prime() so tests exercise the actual function instead of inlining the logic. --------- Co-authored-by: John Fawcett <john@kilcoode.ai>
Add tabbed SlingDialog with 'Sling work' and 'Babysit existing PR' tabs. The Babysit tab includes PR URL input with debounced preview, repo mismatch and closed PR validation, title/body overrides, force-push checkbox, and calls babysitPr mutation on submit. Also updates generated tRPC type declarations for the new previewPr and babysitPr procedures.
6246da3 to
c631997
Compare
- Fix CRITICAL: move isBabysit declaration above relatedBeads in BeadPanel.tsx (temporal dead zone caused ReferenceError on babysit bead renders) - Fix WARNING: wire up userEditedTitle/userEditedBody in BabysitPrPanel.tsx (auto-populate title/body from preview unless user has manually edited) - Fix WARNING: add babysit_started_at to bead metadata in submitExternalPrToReviewQueue so UI timestamps render correctly
…fix TDZ bug The defaultTitle and defaultBody const declarations referenced preview before it was declared (temporal dead zone), causing ReferenceError on every render. Moved them after the preview declaration.
* feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0) (#3576) * feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0) * fix(gastown): address PR review feedback on slingExistingPr - Remove async from submitExternalPrToReviewQueue (no awaits inside) - Add GitLab host validation in slingExistingPr URL parsing to prevent non-GitLab URLs (e.g. Bitbucket) from matching the GitLab regex - Replace vacuous state validation tests with meaningful checkPRStatus integration tests that exercise the actual status resolution path --------- Co-authored-by: John Fawcett <john@kilcoode.ai> * feat(gastown): tRPC + HTTP for babysit PR (chunk 1) Add gastown.babysitPr tRPC mutation, gastown.previewPr tRPC query, mayor-tools babysit-pr HTTP route, refinery bypass for babysat beads, and reconciler fast-track extension for babysat MR beads. * feat(web): BeadPanel babysit badge + metadata (chunk 4) (#3581) feat(web): BeadPanel babysit badge + metadata surfacing (chunk 4) - Add 'Babysat external PR' badge (cyan) when gt:babysit label present - Hide source bead link for babysit beads (no source_bead_id) - Add babysit metadata panel: head_sha (7-char, linked), force_push_allowed (Lock/Unlock icons), babysit_started_at (relative time) - Add event formatters for babysit_started, pr_feedback_detected, pr_conflict_detected, pr_auto_merge, pr_status_changed - Mirror babysit badge + metadata in BeadInspectorDashboard - Extract buildRelatedBeads and eventDescription into separate files for testability - Add unit tests for eventDescription and buildRelatedBeads babysit logic Co-authored-by: John Fawcett <john@kilcoode.ai> * feat(gastown): gt_babysit_pr mayor tool + force-push gate (chunk 2) (#3582) * feat(gastown): gt_babysit_pr mayor tool + force-push gate (chunk 2) Add gt_babysit_pr mayor tool registration and client method, update mayor and polecat system prompts with babysit PR guidance and force-push policy, surface force_push_allowed in polecat prime context, and add corresponding unit tests. * fix(gastown): address PR review warnings on babysit PR feature - Rewrite PR Conflict Resolution Workflow in polecat-system.prompt.ts to choose strategy upfront (rebase vs merge) based on force_push_allowed, instead of rebase-then-abort which discarded conflict resolution work. - Extract resolveForcePushAllowed() from agents.ts prime() so tests exercise the actual function instead of inlining the logic. --------- Co-authored-by: John Fawcett <john@kilcoode.ai> * feat(web): SlingDialog babysit-PR mode (chunk 3) Add tabbed SlingDialog with 'Sling work' and 'Babysit existing PR' tabs. The Babysit tab includes PR URL input with debounced preview, repo mismatch and closed PR validation, title/body overrides, force-push checkbox, and calls babysitPr mutation on submit. Also updates generated tRPC type declarations for the new previewPr and babysitPr procedures. * fix: address review feedback on PR #3583 - Fix CRITICAL: move isBabysit declaration above relatedBeads in BeadPanel.tsx (temporal dead zone caused ReferenceError on babysit bead renders) - Fix WARNING: wire up userEditedTitle/userEditedBody in BabysitPrPanel.tsx (auto-populate title/body from preview unless user has manually edited) - Fix WARNING: add babysit_started_at to bead metadata in submitExternalPrToReviewQueue so UI timestamps render correctly * fix(web): move defaultTitle/defaultBody after preview declaration to fix TDZ bug The defaultTitle and defaultBody const declarations referenced preview before it was declared (temporal dead zone), causing ReferenceError on every render. Moved them after the preview declaration. --------- Co-authored-by: John Fawcett <john@kilcoode.ai>
* feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0) (#3576) * feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0) * fix(gastown): address PR review feedback on slingExistingPr - Remove async from submitExternalPrToReviewQueue (no awaits inside) - Add GitLab host validation in slingExistingPr URL parsing to prevent non-GitLab URLs (e.g. Bitbucket) from matching the GitLab regex - Replace vacuous state validation tests with meaningful checkPRStatus integration tests that exercise the actual status resolution path --------- Co-authored-by: John Fawcett <john@kilcoode.ai> * feat(gastown): tRPC + HTTP for babysit PR (chunk 1) Add gastown.babysitPr tRPC mutation, gastown.previewPr tRPC query, mayor-tools babysit-pr HTTP route, refinery bypass for babysat beads, and reconciler fast-track extension for babysat MR beads. * feat(web): BeadPanel babysit badge + metadata (chunk 4) (#3581) feat(web): BeadPanel babysit badge + metadata surfacing (chunk 4) - Add 'Babysat external PR' badge (cyan) when gt:babysit label present - Hide source bead link for babysit beads (no source_bead_id) - Add babysit metadata panel: head_sha (7-char, linked), force_push_allowed (Lock/Unlock icons), babysit_started_at (relative time) - Add event formatters for babysit_started, pr_feedback_detected, pr_conflict_detected, pr_auto_merge, pr_status_changed - Mirror babysit badge + metadata in BeadInspectorDashboard - Extract buildRelatedBeads and eventDescription into separate files for testability - Add unit tests for eventDescription and buildRelatedBeads babysit logic Co-authored-by: John Fawcett <john@kilcoode.ai> * feat(gastown): gt_babysit_pr mayor tool + force-push gate (chunk 2) (#3582) * feat(gastown): gt_babysit_pr mayor tool + force-push gate (chunk 2) Add gt_babysit_pr mayor tool registration and client method, update mayor and polecat system prompts with babysit PR guidance and force-push policy, surface force_push_allowed in polecat prime context, and add corresponding unit tests. * fix(gastown): address PR review warnings on babysit PR feature - Rewrite PR Conflict Resolution Workflow in polecat-system.prompt.ts to choose strategy upfront (rebase vs merge) based on force_push_allowed, instead of rebase-then-abort which discarded conflict resolution work. - Extract resolveForcePushAllowed() from agents.ts prime() so tests exercise the actual function instead of inlining the logic. --------- Co-authored-by: John Fawcett <john@kilcoode.ai> * feat(web): SlingDialog babysit-PR mode (chunk 3) Add tabbed SlingDialog with 'Sling work' and 'Babysit existing PR' tabs. The Babysit tab includes PR URL input with debounced preview, repo mismatch and closed PR validation, title/body overrides, force-push checkbox, and calls babysitPr mutation on submit. Also updates generated tRPC type declarations for the new previewPr and babysitPr procedures. * fix: address review feedback on PR #3583 - Fix CRITICAL: move isBabysit declaration above relatedBeads in BeadPanel.tsx (temporal dead zone caused ReferenceError on babysit bead renders) - Fix WARNING: wire up userEditedTitle/userEditedBody in BabysitPrPanel.tsx (auto-populate title/body from preview unless user has manually edited) - Fix WARNING: add babysit_started_at to bead metadata in submitExternalPrToReviewQueue so UI timestamps render correctly * fix(web): move defaultTitle/defaultBody after preview declaration to fix TDZ bug The defaultTitle and defaultBody const declarations referenced preview before it was declared (temporal dead zone), causing ReferenceError on every render. Moved them after the preview declaration. --------- Co-authored-by: John Fawcett <john@kilcoode.ai>
Summary
SlingDialogwith "Sling work" (existing) and "Babysit existing PR" (new) tabsBabysitPrPanelcomponent with PR URL input, debounced (500ms)previewPrquery, repo mismatch / closed PR validation, title/body overrides,forcePushAllowedcheckbox, andbabysitPrmutation on submitSlingDialogintoRigDetailPageClientvia new "Sling" button next to "New Bead"router.d.ts,schemas.d.ts) forpreviewPrandbabysitPrproceduresVerification
pnpm --filter web typecheckpassesVisual Changes
New "Sling" button in rig detail page header, tabbed dialog with babysit PR form
Reviewer Notes
previewPrandbabysitPrtRPC procedures were added in chunk 1 (already merged togastown-staging); the generated type declarations were manually updated sincepnpm build:typestimed out in this environmentBabysitPrPanelis extracted as a separate component to keepSlingDialogmanageable