Skip to content

fix(members): show the roster patrol badge only while a loop is active - #9525

Closed
satyam-thakur wants to merge 2 commits into
kirodotdev:mainfrom
satyam-thakur:feat/first
Closed

satyam-thakur wants to merge 2 commits into
kirodotdev:mainfrom
satyam-thakur:feat/first

Conversation

@satyam-thakur

@satyam-thakur satyam-thakur commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

On the Crew Members roster, a member with a stopped auto-patrol (monitor loop) kept a warn-yellow pause badge on its avatar. Most loops stop for normal reasons — cycle cap reached, runtime budget spent, or stopped by hand — so nearly every idle member wore a permanent yellow mark. At a glance that reads as "something is wrong with this member," an error rather than a resting state.

Why it matters

Idle-for-a-benign-reason is the common case, so the yellow badge was on-screen almost all the time. A standing warning colour on a normal end state trains the eye to ignore it. But one stop reason is not benign: approval_stalled means a patrol stopped because a tool approval went unanswered, and it comes back only when the operator acts. Removing the badge for every stop reason — the naive fix — would silence that incident too, so a dead-waiting-on-you patrol would look identical to no patrol and be discoverable only by opening its drawer. On a monitoring surface, silence is the wrong failure mode.

What changed (motivation → approach → change)

Symptom: idle members show a yellow "patrol stopped" badge forever. Root cause: patrolBadgeOf rendered a badge for both active and stopped, regardless of why it stopped. Approach: split stops into benign vs incident rather than dropping the stopped badge wholesale.

Change: patrolBadgeOf now returns 'active' | 'warn' | null, keyed off stopped_reason. An active loop returns 'active' (accent badge, unchanged). A loop stopped for manual / cycle_cap / runtime_budget returns null — no badge; the reason stays in the drawer's Auto patrol block. A loop stopped for approval_stalled — plus any unknown or future terminal code — returns 'warn', keeping a warn-colour pause badge at the roster so the incident stays visible. The badge's data-state for a stopped-incident is warn (was stopped); the patrol_badge_stopped i18n label is retained in all 13 catalogs (it is the warn badge's text), so the net i18n diff versus base is zero.

flowchart LR
  L[loop record]:::ctx --> A{active?}:::ctx
  A -->|yes| ACT[accent badge]:::ctx
  A -->|no| R{stopped_reason}:::changed
  R -->|manual / cycle_cap / runtime_budget| NONE[no badge]:::added
  R -->|approval_stalled / unknown| WARN[warn badge]:::ctx
  classDef added fill:#DCFCE7,stroke:#16A34A,color:#14532D,stroke-width:2px
  classDef changed fill:#FEF3C7,stroke:#D97706,color:#78350F,stroke-width:2px
  classDef removed fill:#FEE2E2,stroke:#DC2626,color:#7F1D1D,stroke-dasharray:4 3
  classDef ctx fill:#E0F2FE,stroke:#0284C7,color:#0C4A6E
  linkStyle 3 stroke:#16A34A,stroke-width:2px
Loading

🟩 added · 🟨 changed · 🟥 removed · 🟦 unchanged

A stopped loop's badge now depends on why it stopped: benign reasons show nothing, an approval-stalled (or unknown) stop keeps a warn badge so the operator sees the incident on the roster.

Tests

Rewrote the roster-badge test in MembersPage.test.tsx to pin all three states: an active loop shows the accent badge with its wake-count label, a cycle_cap stop shows no badge, and an approval_stalled stop shows a data-state="warn" badge labelled "Patrol stopped". The presence-dot assertion is loosened from exactly-1 to at-least-1 because the fixture now has multiple members with presence dots. All 76 MembersPage tests pass; tsc -b is clean.

Manual verification

N/A — unit coverage sufficient. The change is a verdict function plus its render branch, both covered by the three-state roster-badge test; the drawer block is untouched.

Screenshots / video

Why no screenshot: the only new rendered state is the warn badge for approval_stalled, which reuses the pre-existing warn colour, pause glyph, and "Patrol stopped" label that already shipped for the old stopped badge — no new visual vocabulary is introduced, and the three-state behavior is asserted by the unit test.

Related Issues

Fixes #9420

Pattern harvest

Rule candidate: review-prompt
Pattern: a fix that removes a signal for a whole category should check whether the category contains an incident sub-case that must stay visible — "no badge for stopped" hid approval_stalled; the scoped fix keeps it.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@satyam-thakur
satyam-thakur requested review from a team and krishdhasmana September 8, 2026 20:00
@dwu96

dwu96 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Sep 8, 2026
@dwu96

dwu96 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

@satyam-thakur

Copy link
Copy Markdown
Contributor Author

👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated.

Missing sections:

  • ## Problem / Motivation
  • ## Why it matters
  • ## What changed

Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle.

Updated ...

@satyam-thakur satyam-thakur reopened this Sep 8, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — ✅ no blocking findings

Reviewed bcbbfc8a59bd0f4d215b26a593f982687f2a50af via the fork AI-review pipeline; updated in place on each push.

Review details

All i18n keys exist across every locale, stopped_reason is an optional string (so unknown/undefined correctly falls to the fail-visible warn branch), and the badge partition is complete and self-consistent. Nothing to falsify from the empty candidate list, and no groundable defect surfaced.

No findings.

[OPUS-REVIEWED] bcbbfc8

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — 🔴 changes requested (blocking)

Reviewed bcbbfc8a59bd0f4d215b26a593f982687f2a50af via the fork AI-review pipeline; updated in place on each push.

Adjudication upheld 1 of 1 blocking finding(s); those must be resolved before merging.

BLOCKING -- website/src/pages/members/MembersPage.tsx:706 -- Feature map no longer matches roster badge behavior

return benign ? null : 'warn'
Benign stopped loop -> patrolBadgeOf returns null -> feature map still promises a badge whenever a loop exists.
Anchor: feature-map-correctness
Fix: Update the Crew Members feature-map row to describe reason-dependent stopped badges.
FINDING -- website/src/pages/members/MembersPage.tsx:1176 -- removing transition-colors duration-150 and changing the pause glyph styling creates a visual delta despite the stated scope -> Fix: retain the transition classes and prior size={9} strokeWidth={3} pause styling.
[BLOCK-MERGE] bcbbfc8
[GPT-REVIEWED] bcbbfc8

Adjudication (Opus 4.8) — is blocking on each finding proportionate?

F1 is anchored to feature-map-correctness, an AUTOSDE custom rule carrying blocking: true (AUTOSDE.yaml:12-13), whose scope explicitly includes website/src/pages/** and docs/feature-map/README.md and demands the map stay semantically aligned with dashboard behavior changes. The map row at docs/feature-map/README.md:87 still asserts "a roster avatar badge while a loop exists (accent while patrolling, warn once stopped)", which the changed patrolBadgeOf (returns null for a benign stop) contradicts. The rule's blocking flag is authoritative and outranks my weighing.

HARM: n/a — decided by the blocking-rule flag, not the harm ladder.
Conditions: AUTOSDE.yaml:12-13 (blocking: true), file-pattern match AUTOSDE.yaml:15-16; stale row at docs/feature-map/README.md:87.
Fix cost: n/a — flag is authoritative.

[ADJUDICATION] bcbbfc8a59bd0f4d215b26a593f982687f2a50af total=1 uphold=1 downgrade=0
UPHOLD F1 website/src/pages/members/MembersPage.tsx:706 reason=autosde-blocking-rule
[GPT-ADJUDICATED] bcbbfc8a59bd0f4d215b26a593f982687f2a50af

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5, fork) — 🟡 CONCERNS

UX-level review of bcbbfc8a59bd0f4d215b26a593f982687f2a50af via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Reconciliation complete. The diff changes one user-visible element — the roster patrol badge on member avatars: benign stops (manual/cycle_cap/runtime_budget) now show no badge, approval_stalled/unknown stops keep the warn pause badge, active stays accent. The warn badge's visuals are pre-existing (warn color, pause glyph, "Patrol stopped" label in all catalogs), the badge lives inside AnimatePresence with an exit animation, and the drawer still spells the stop reason. No screenshot ships (PR claims no visual delta), and this lane has no blind read.

UX-Verdict: CONCERNS

The warn badge now exclusively means "stopped waiting on you," but its label still says only "Patrol stopped" — the incident's cause and cure stay hidden in the drawer.

Watch

  • Generic label on an incident-only badge: patrol_badge_stopped ("Patrol stopped") is now shown solely for approval_stalled/unknown stops, yet says nothing about the stall or that operator action revives it — every incident (persistent until acted on) forces a drawer open to learn "waiting for a tool approval." The reason string already exists (patrol_stopped_approval_stalled); surface it in the badge's aria-label/tooltip.

Evidence gaps

  • No blind read ran in this lane; the two changed roster states — benign-stopped member with no badge, approval_stalled member with warn badge — appear in no screenshot. One roster screenshot showing both members would close it.
  • The PR's "no new visual vocabulary" claim isn't literal: the pause glyph changed from size={9} strokeWidth={3} to size={10} default stroke — thinner marks in a 16px circle; the screenshot above would also verify legibility.

Suggestions

  • Make the warn badge's aria-label reason-specific: t('pages.membersPage.patrol_stopped_approval_stalled') (or a composed "Patrol stopped — waiting for a tool approval") instead of the bare patrol_badge_stopped.

[UX-REVIEWED] bcbbfc8

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — 🔴 BLOCK

Premise-level review of bcbbfc8a59bd0f4d215b26a593f982687f2a50af via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

All verification is done. The findings: (1) the loosened presence-dot test pin rests on a claim the base code contradicts — only one fixture row runs, and the dot renders solely for running members, so the strict exactly-1 assertion still passes; (2) the benign-stop list omits autonudge_stop, a terminal code the frontend's own type and this very file's comment document as reaching member slots, so that known-benign stop keeps the forever-warn badge the PR set out to remove; (3) two small undeclared visual riders (glyph size/stroke, dropped colour transition).

First-Principles-Verdict: BLOCK

The presence-dot pin is loosened on a false premise — only one fixture row runs, so the exactly-1 assertion still passes; restore it.

Not justified as shipped

  1. Benign stops lose the badge — symptom-level: the benign set omits autonudge_stop, so that deliberate stop keeps the forever-warn badge this PR exists to remove.
  2. Pause glyph redrawn (size 9→10, strokeWidth 3→default) — rides along, undeclared; the description claims the glyph is "pre-existing".
  3. Badge colour transition (transition-colors duration-150) deleted — rides along, undeclared; a live active→warn flip now snaps.
  4. Presence-dot assertion loosened exactly-1 → ≥1 — weakened pin whose stated cause is contradicted by base code (see Blockers).

What this change ships

Inventory (5 items) — 2 justified

Intent: stop marking benignly-idle members with a permanent warn badge while keeping an approval-stalled patrol visible on the roster — a FIX (issue #9420; base patrolBadgeOf returns 'stopped' for any inactive loop).

  1. Members stopped for manual/cycle-cap/runtime-budget wear no roster badge — symptom-level: autonudge_stop sibling unfixed
  2. Approval-stalled members keep the warn pause badge; its data-state is now warn — justified
  3. The stopped badge's pause glyph is larger and thinner — rides along, undeclared
  4. The badge no longer animates colour changes — rides along, undeclared
  5. The roster test now tolerates extra presence dots (≥1, was exactly 1) — rides along, false justification

Blockers

Loosened presence-dot pin, justified by a claim the base contradicts. The description says it was "loosened from exactly-1 to at-least-1 because the fixture now has multiple members with presence dots" — but the dot's single render site is guarded by isRunning(m) (MembersPage.tsx:1121), isRunning falls back to m.running (:324) with no live slots seeded in tests (helpers.tsx builds a fresh store), and only radar sets running: true (the row helper defaults false, test:74). The fixture still yields exactly one dot; the fix is complete without this loosening, and the pin's own comment ("neither replaces the other") is what it weakens. Subtraction: restore toHaveLength(1).
Clears when: the toHaveLength(1) assertion is restored, or a failing run on this fixture shows exactly-1 actually breaks.

Watch

The reported defect survives for autonudge_stop: grepped autonudge_stop in website/src — it is an enumerated terminal code (autoNudgeLoop.ts:27) and MembersPage.tsx:201's own comment says member research loops are stamped with it today; the backend calls it "deliberate completion" (autonudge.py:166). Under the new verdict it maps to warn, so that benign stop keeps the permanent yellow badge. 1 counted unfixed sibling (loop-level monitor_terminal, autonudge.py:3795, may be a second).
Clears when: autonudge_stop is classified benign, or the warn verdict is keyed to approval_stalled alone.

Subtractions

  • Replace the three-clause benign list in patrolBadgeOf with the single incident check (lp.stopped_reason === 'approval_stalled' ? 'warn' : null) — smaller, and it fixes the autonudge_stop sibling; the drawer already renders unknown codes without warning (MembersPage.tsx:1668-1672).
  • Drop the glyph and transition tweaks (size={9} strokeWidth={3} → size={10}, deleted transition-colors duration-150) — undeclared riders the fix does not need.

[FIRST-PRINCIPLES-REVIEWED] bcbbfc8

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🟡 CONCERNS

Design-level review of bcbbfc8a59bd0f4d215b26a593f982687f2a50af via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

The benign-list is incomplete: monitor_terminal — a goal patrol that succeeded — falls into "unknown → warn", reinstating the permanent yellow badge this PR removes.

Watch

autonudge.py:3795 writes loop.stopped_reason = "monitor_terminal" on any non-channel loop whose watched subject finishes (a merged PR — the backend's own comment calls this a SUCCESS), and member DM slots are non-channel; the new verdict's benign = manual | cycle_cap | runtime_budget classifies that code as unknown, so "an unknown or future terminal code" returns 'warn' — a completed patrol wears a permanent incident badge labelled "Patrol stopped", the exact harm the description names ("a standing warning colour on a normal end state trains the eye to ignore it"), now on the successful case. The drawer's PATROL_STOPPED_REASON map also lacks this code, so its comment ("terminal codes a member slot can actually receive") is either stale or the guard that kills this finding.
Clears when: evidence that a member-slot loop can never carry monitor_terminal (a slot-kind guard on monitor arming), or the code is classified benign/success in patrolBadgeOf.

Suggestions

Derive both the roster severity and the drawer sentence from one table keyed by stop code (extend PATROL_STOPPED_REASON with a severity field) so the two classifications in the same file cannot drift when the next terminal code lands.

[DESIGN-REVIEWED] bcbbfc8

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 8, 2026
…for approval_stalled

Fixes kirodotdev#9420. A standing warn badge sat on every member whose auto-patrol
loop had stopped, even when the stop was a normal resting state, so the
roster was noisy with marks that signalled nothing actionable.

**Scoped, not blanket.** `patrolBadgeOf` is now three-state:
- `active` -> accent badge (unchanged).
- stopped `manual` / `cycle_cap` / `runtime_budget` -> no badge. These
  are benign resting states; the stop reason lives in the drawer's Auto
  patrol block.
- stopped `approval_stalled` (or any unknown/future code) -> `warn`
  badge. A patrol that died waiting on a tool approval is an INCIDENT,
  revived only by operator action; on a surface whose failure mode is
  silence it must show at the roster, not only once the drawer is opened.

**patrol_badge_stopped** i18n key kept (all 13 catalogs) — it is the warn
badge's label. **Test** rewritten to pin all three states: active shows an
accent badge, a cycle_cap stop shows none, an approval_stalled stop shows a
warn badge. tsc clean; 76/76 MembersPage tests pass.
@satyam-thakur

Copy link
Copy Markdown
Contributor Author

Addressed the Design Review block (and the UX / First-Principles concerns) — pushed 36aa025c5.

What changed: the badge suppression is now keyed off stopped_reason, not blanket. patrolBadgeOf is three-state:

This is the fix all three lanes prescribed: it delivers #9420's intent (drop the standing warn mark on normally-idle members) without hiding the incident case the original pin existed to surface. Unknown codes fail visible, not silent, matching the monitoring surface's failure mode.

Notes: patrol_badge_stopped is kept in all 13 catalogs (it is the warn badge's label), so the net i18n diff vs base is zero. The roster-badge test now pins all three states — active → accent, cycle_cap → none, approval_stalled → warn. tsc clean; 76/76 MembersPage tests pass.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 8, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 8, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 8, 2026
@satyam-thakur

Copy link
Copy Markdown
Contributor Author

Closing this PR. It duplicates #9422, which applies the same #9420 fix, is further along, and has all review lanes green. Consolidating on #9422 to avoid two PRs for the same change.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[insider] Members roster shows a yellow "patrol stopped" badge that reads as an error; show a badge only while a loop is active

2 participants