You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(gastown): add in_review bead state between in_progress and closed
Beads now transition to in_review when a polecat calls gt_done, rather
than going straight to closed. The refinery review then closes the bead
on merge or returns it to in_progress for rework. This prevents the bead
board from showing beads as done before the refinery has actioned them.
Changes:
- Add in_review to BeadStatus enum (schema + types)
- gt_done transitions source bead to in_review instead of closed
- Review failure/conflict returns bead to in_progress and re-dispatches
the original polecat for rework
- Mayor and polecat prompts updated to reflect the new lifecycle
- BeadBoard UI adds In Review column with purple styling
- Dashboard badge styling for in_review state
Closes#895
* fix(gastown): add in_review to tRPC bead schemas and rig-beads table
The listBeads tRPC route was returning 500 (output validation failed)
because beads with in_review status didn't pass the output schema.
Add in_review to BeadOutput, the listBeads input filter, the rig-beads
table Zod enum + SQL CHECK constraint, and the generated router types.
* fix(gastown): triage handler 401 in dev mode — fall back to identity header
In development, authMiddleware is skipped so agentJWT is never set on
the Hono context. The triage handler used getEnforcedAgentId() as a
hard requirement (returning 401 on null), unlike other handlers which
treat it as optional. Fall back to the X-Gastown-Agent-Id header that
the container client sends with every request.
* feat(gastown): add triage_resolved events to activity feed and encourage gt_status in triage prompt
Triage actions (RESTART, CLOSE_BEAD, ESCALATE, etc.) now emit a
triage_resolved bead event on the target bead, making them visible in
the activity feed. Previously only a status_changed event was logged on
the triage request bead itself, which doesn't appear in the affected
bead's timeline.
- Add triage_resolved to BeadEventType enum
- Log triage_resolved on the target bead in resolveTriage with action
and resolution notes in metadata
- Add ShieldCheck icon (amber) and description formatting in ActivityFeed
- Update triage system prompt to instruct agents to call gt_status at
the start and end of their batch for dashboard visibility
* fix(gastown): prevent hooking agents to escalation and triage-request beads
hookBead had no bead-type validation — any agent could be hooked to any
bead, including system-managed types like escalation, convoy, agent, and
message beads. Triage-request beads (type='issue' with gt:triage-request
label) were also unguarded, letting polecats accidentally pick them up.
Add two guards in hookBead:
- Reject beads with system-managed types (escalation, convoy, agent,
message) since no agent should work on these directly
- Reject beads with the gt:triage-request label since those are resolved
via gt_triage_resolve, not by hooking an agent
* fix(gastown): address PR review comments — in_review gaps, rework stranding, responsive layout
Address all four review comments and four code review observations:
- Wire in_review through container plugin types, mayor gt_list_beads
tool, rig detail stats, town overview stats, healthCheck pending count,
and getAlarmStatus bead counts
- Fix rework stranding: use getOrCreateAgent instead of re-hooking the
original polecat (which may already be working on something else)
- Fix BeadBoard loading skeleton to use responsive grid-cols-1/sm:4
matching the loaded layout
- Add In Review stat cell to both rig detail and town overview pages
* fix(gastown): use inline grid-template-columns for 5-col stats strip
Tailwind's grid-cols-5 was being purged or not applying correctly.
Use an inline style to guarantee the 5-column layout.
* fix(gastown): gate triage header fallback on dev, wire inReview through alarm status
- Gate X-Gastown-Agent-Id header fallback in handleResolveTriage on
ENVIRONMENT === 'development' to prevent header spoofing in production
- Add inReview to AlarmStatusOutput tRPC schema, router.d.ts types,
and TerminalBar UI so the new bead count is visible in the status pane
// If this triage request was created for an escalation, close the
970
1018
// linked escalation bead too so it doesn't sit open indefinitely.
971
1019
// The escalation_bead_id is nested under metadata.context (set by
@@ -3245,7 +3293,7 @@ export class TownDO extends DurableObject<Env> {
3245
3293
[
3246
3294
...query(
3247
3295
this.sql,
3248
-
/* sql */`SELECT COUNT(*) AS cnt FROM ${beads} WHERE ${beads.status} IN ('open', 'in_progress') AND ${beads.type} NOT IN ('agent', 'message')`,
3296
+
/* sql */`SELECT COUNT(*) AS cnt FROM ${beads} WHERE ${beads.status} IN ('open', 'in_progress', 'in_review') AND ${beads.type} NOT IN ('agent', 'message')`,
3249
3297
[]
3250
3298
),
3251
3299
][0]?.cnt??0
@@ -3274,6 +3322,7 @@ export class TownDO extends DurableObject<Env> {
3274
3322
beads: {
3275
3323
open: number;
3276
3324
inProgress: number;
3325
+
inReview: number;
3277
3326
failed: number;
3278
3327
triageRequests: number;
3279
3328
};
@@ -3328,12 +3377,13 @@ export class TownDO extends DurableObject<Env> {
0 commit comments