Skip to content

feat(web): BeadPanel babysit badge + metadata (chunk 4)#3581

Merged
jrf0110 merged 1 commit into
convoy/babysit-existing-pr-feature-re-staged/254a4b7e/headfrom
convoy/babysit-existing-pr-feature-re-staged/254a4b7e/gt/maple/4ef457eb
May 28, 2026
Merged

feat(web): BeadPanel babysit badge + metadata (chunk 4)#3581
jrf0110 merged 1 commit into
convoy/babysit-existing-pr-feature-re-staged/254a4b7e/headfrom
convoy/babysit-existing-pr-feature-re-staged/254a4b7e/gt/maple/4ef457eb

Conversation

@jrf0110

@jrf0110 jrf0110 commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Chunk 4 of 6 for the "Babysit existing PR" feature. Adds babysit-specific UI to the BeadPanel drawer and the admin BeadInspectorDashboard.

  • Babysat external PR badge: Cyan-colored badge with Eye icon shown when gt:babysit is in the bead's labels. Distinct from the amber gt:held badge and the default gt:merge-request type badge.
  • Source bead section hidden: For babysat beads (which intentionally have no source_bead_id), the "Source Work" related bead link is filtered out.
  • Babysit metadata panel: New grid section showing head_sha (7-char abbreviated, linked to commit URL when PR URL is available), force_push_allowed (Lock/Unlock icons with "Allowed"/"Blocked" text), and babysit_started_at (relative time).
  • Activity timeline event formatters: Added human-readable descriptions and icons/colors for babysit_started, pr_feedback_detected, pr_conflict_detected, pr_auto_merge, and pr_status_changed events.
  • BeadInspectorDashboard: Mirrored babysit badge in header and babysit metadata fields (head SHA, force-push, babysit started) in the Overview card.
  • Extracted pure logic: Moved buildRelatedBeads and eventDescription into separate files for testability without React/motion/DB dependencies.

Verification

Manual verification: inspected BeadPanel rendering logic for babysit badge visibility, metadata panel conditional rendering, and source bead filtering. Typecheck passes.

Visual Changes

  • New "Babysat external PR" cyan badge in bead header
  • New babysit metadata grid (Head SHA, Force-push, Babysit started) in BeadPanel
  • New babysit badge + metadata in admin BeadInspectorDashboard
  • New event descriptions and icons in activity timeline for babysit-related events

Reviewer Notes

  • buildRelatedBeads.ts and eventDescription.ts are extractions from existing code, not new logic — they're identical to what was previously inline in BeadPanel.tsx and ActivityFeed.tsx respectively, plus the new babysit event types in eventDescription.
  • Tests exist but cannot run in this environment (no Postgres). They are pure unit tests verified via typecheck.
  • The MetaCell component's value prop was widened from string to ReactNode to support the linked SHA rendering.

- 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
Comment thread apps/web/src/components/gastown/drawer-panels/BeadPanel.tsx
@kilo-code-bot

kilo-code-bot Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

isBabysit is referenced before its const declaration in BeadPanel.tsx, causing a guaranteed ReferenceError on every render.

Overview

Severity Count
CRITICAL 1
WARNING 0
SUGGESTION 0
Issue Details (click to expand)

CRITICAL

File Line Issue
apps/web/src/components/gastown/drawer-panels/BeadPanel.tsx 242 isBabysit used before const declaration (line 256) — ReferenceError at runtime
Files Reviewed (7 files)
  • apps/web/src/app/admin/gastown/towns/[townId]/beads/[beadId]/BeadInspectorDashboard.tsx
  • apps/web/src/components/gastown/ActivityFeed.test.ts
  • apps/web/src/components/gastown/ActivityFeed.tsx
  • apps/web/src/components/gastown/drawer-panels/BeadPanel.test.ts
  • apps/web/src/components/gastown/drawer-panels/BeadPanel.tsx — 1 issue
  • apps/web/src/components/gastown/drawer-panels/buildRelatedBeads.ts
  • apps/web/src/components/gastown/eventDescription.ts

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-4.6 · 751,792 tokens

Review guidance: REVIEW.md from base branch convoy/babysit-existing-pr-feature-re-staged/254a4b7e/head

@jrf0110
jrf0110 merged commit e262de4 into convoy/babysit-existing-pr-feature-re-staged/254a4b7e/head May 28, 2026
2 checks passed
@jrf0110
jrf0110 deleted the convoy/babysit-existing-pr-feature-re-staged/254a4b7e/gt/maple/4ef457eb branch May 28, 2026 20:29
jrf0110 added a commit that referenced this pull request May 29, 2026
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>
jrf0110 added a commit that referenced this pull request May 29, 2026
* 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>
jrf0110 added a commit that referenced this pull request May 30, 2026
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>
jrf0110 added a commit that referenced this pull request May 30, 2026
* 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>

* fix(gastown): address rework feedback for babysit PR feature

- Fix GitLab MR head SHA link in BeadPanel.tsx (regex now handles /-/merge_requests/ URLs)
- Extract shared test helpers into babysit-pr-helpers.ts to eliminate ~400 lines of duplication
- babysit_started_at already present from staging (confirmed)

* fix(web): remove duplicate isBabysit declaration in BeadPanel

---------

Co-authored-by: John Fawcett <john@kilcoode.ai>
jrf0110 added a commit that referenced this pull request Jul 22, 2026
* 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>
jrf0110 added a commit that referenced this pull request Jul 22, 2026
* 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>

* fix(gastown): address rework feedback for babysit PR feature

- Fix GitLab MR head SHA link in BeadPanel.tsx (regex now handles /-/merge_requests/ URLs)
- Extract shared test helpers into babysit-pr-helpers.ts to eliminate ~400 lines of duplication
- babysit_started_at already present from staging (confirmed)

* fix(web): remove duplicate isBabysit declaration in BeadPanel

---------

Co-authored-by: John Fawcett <john@kilcoode.ai>
jrf0110 added a commit that referenced this pull request Jul 22, 2026
* 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>
jrf0110 added a commit that referenced this pull request Jul 22, 2026
* 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>

* fix(gastown): address rework feedback for babysit PR feature

- Fix GitLab MR head SHA link in BeadPanel.tsx (regex now handles /-/merge_requests/ URLs)
- Extract shared test helpers into babysit-pr-helpers.ts to eliminate ~400 lines of duplication
- babysit_started_at already present from staging (confirmed)

* fix(web): remove duplicate isBabysit declaration in BeadPanel

---------

Co-authored-by: John Fawcett <john@kilcoode.ai>
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