Skip to content

AI-powered virtual executive team — a single coherent executive persona backed by 8 specialist agents (FastAPI + Next.js).

Collapse the handled rail to a one-line summary

Claude272ad4d560ad
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d3a989f4..1d06613c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -116,16 +116,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
event_type, and the alert's `status` now) instead of one truncated
sentence; routed / nudged audit summaries name the person rather than
"person 12", and the nudge bookkeeping marker is stripped for display.
- The rail reads first-person: a count-only heading ("Since your last
- brief: N off your plate, N in others' hands, N waiting on you"),
- escalations first, one row per alert ("Resolved *X* — evidence",
- "Dismissed *X* as stale — …", "Handed *X* to Dana Kim", "Chased Dana Kim
- on *X*"), five rows before "Show more", every row linking its evidence to
- a pre-filtered `/audit` (the audit page now reads `event_type` / `q` from
- the query string) and a still-open row jumping to its card. Undo is only
- offered while the close still stands; a close already undone shows
- "Reopened" after a reload. A quiet night renders one honest line instead
- of nothing.
+ The rail is now one line by default — a count-only first-person heading
+ ("Since your last brief: N off your plate, N in others' hands, N waiting
+ on you") — with the rows behind a "details" disclosure, and nothing at
+ all on a night with nothing handled. Expanded, rows read first-person
+ ("Resolved *X* — evidence", "Dismissed *X* as stale — …", "Handed *X* to
+ Dana Kim", "Chased Dana Kim on *X*"), escalations first, one row per
+ alert, every row linking its evidence to a pre-filtered `/audit` (the
+ audit page now reads `event_type` / `q` from the query string) and a
+ still-open row jumping to its card. Undo is only offered while the close
+ still stands; a close already undone shows "Reopened" after a reload.
- **Specialists are told what departments watch.** The research context
every specialist receives now carries a `DEPARTMENT WATCH INTERESTS`
block (each department's watched entities), and the grounding rule
diff --git a/packages/core/openexecutive/architecture/architecture-facts.yaml b/packages/core/openexecutive/architecture/architecture-facts.yaml
index cf38884d..911cefa9 100644
--- a/packages/core/openexecutive/architecture/architecture-facts.yaml
+++ b/packages/core/openexecutive/architecture/architecture-facts.yaml
@@ -1280,10 +1280,11 @@ today:
superseded_by_alert_id and `status` (the alert's state NOW, so an undone
close renders "Reopened" rather than a second Undo). The UI's handled
rail is first-person and count-based ("Since your last brief: N off your
- plate, N in others' hands, N waiting on you"), escalations first, one
- row per alert, five before "Show more", each row linking its evidence to
- `/audit?event_type=…&q=…` and a still-open row to `#alert-<id>`; Undo →
- `POST /alerts/{id}/reopen`. The "Executive handled N overnight" status
+ plate, N in others' hands, N waiting on you") shown as ONE line by
+ default, rows behind a "details" disclosure (escalations first, one row
+ per alert, each linking its evidence to `/audit?event_type=…&q=…` and a
+ still-open row to `#alert-<id>`; Undo → `POST /alerts/{id}/reopen`),
+ nothing rendered when empty. The "Executive handled N overnight" status
pill is unchanged. UI: cards lead with `review_note`
(amber "Likely stale" / "Updated" / "Since you last looked"), chips for
age, seen ×N, why-now / due, folded-in, draft-ready, a "Reviewed <ago>"
diff --git a/packages/core/openexecutive/architecture/prebuilt/today.json b/packages/core/openexecutive/architecture/prebuilt/today.json
index c35a50e3..a7116cf7 100644
--- a/packages/core/openexecutive/architecture/prebuilt/today.json
+++ b/packages/core/openexecutive/architecture/prebuilt/today.json
@@ -1,7 +1,7 @@
{
"section_id": "today",
"title": "Today / Morning Brief",
- "markdown": "`openexecutive.api.routes.today` serves the morning brief — a one-screen, read-only view of what is happening across the org. It is the default landing surface (the Next.js root renders `<Briefing>`).\n\n`GET /today` returns `TodayResponse` assembled by `_build_today()`, which is synchronous and caller-agnostic:\n\n- **`departments`** — per-department goal health, rolling up each department's goal counts (`total`, `at_risk`, `off_track`) plus its awaiting-workflow count, and `attention_goals`: the actual off-track/at-risk goals (worst first, capped at 3) with `key_result`, `current`, `target`, and `status`, so the briefing's Department card shows *which* goal is off and how far without a click. Empty for healthy/inactive departments.\n- **`people`** — an attention-ranked roster. Each person carries `awaiting_action` count, soonest SLA, a `status` (`on_leave` / `needs_reply` / `awaiting` / `clear`), reachability, `overdue`, a server `priority` sort key, and a cached one-line `insight`. Sorted by `(-priority, full_name)`.\n- **`proposals`** — the *live* unread alerts (workflow approvals, triage-classified inbound, Executive signals, flagged artifacts, and gated calendar bookings): unread, inside their category TTL, not snoozed — see *Alert lifecycle* below. Each carries `score`, `category` (`action` vs `monitoring`), `surfaced_reason` from `openexecutive.briefing.ranking`, the lifecycle fields (`occurrence_count`, `last_seen_at`, `last_reviewed_at`, `review_verdict`, `review_note`, `recommended_move`, `why_now`, `due_at`, `superseded_count`, `suggested_workflow`), and `decision_instance_id` (set only when the proposal is backed by a decision-ledger row — a calendar booking awaiting approval). The UI splits them into 'mine' vs 'across the team' using `caller_person_id`. For decision-backed proposals the card's Approve/Reject call the `/decisions` endpoints (which book or cancel the event server-side and clear the alert) instead of the ack-and-hand-off-to-chat flow — so meeting bookings are reviewed in the briefing itself rather than on a separate page.\n- **`narrative`** — a per-viewer Executive-voice header synthesized by `synthesize_briefing_narrative`; the principal gets the whole-company scope, teammates a role-scoped one. In the web UI each bullet of this narrative is a click target: clicking one hands off to chat (the same `onContinue` path as the proposal cards) seeded to discuss that item. The Executive recognizes it because every chat turn now carries a `<briefing>` digest of open alerts (see Memory).\n- **`in_flight`** / **`awaiting`** — upcoming Executive commitments and people we are waiting on.\n- **`handled_overnight`** — the autonomous moves the Executive *completed* since the last delivered morning brief: the alert review's (routed, nudged, escalated, drafted, merged, closed) plus the research watch policy's (`watching` — a watch added on its own because it was grounded in company data; `stopped_watching` — a research watch auto-disabled as noisy or dead; no alert id, re-enable from `/watchlist`). A `changed` verdict (the review rewrote an open alert's headline / body / severity) is deliberately **not** here: the alert is still open in \"Needs you\" and its card carries the note, so the brief reports it under \"what changed\" (a REWRITTEN block) rather than as done. Each row is structured, not just a sentence: `kind`, the audit `summary` (nudge bookkeeping marker stripped), `at`, `alert_id`, `event_type` (for a pre-filtered `/audit` deep link), `headline` (the alert's headline at move time; a watch's slug), `target` (person name for routed / nudged, survivor headline for merged, new severity for escalated, draft title, workflow name), `detail` (the cited evidence or the watch policy's reason), `outcome` (`resolved` | `dismissed` for a close, `proposed` for a route that went through the authority gate), `evidence_ref` (S1 / R2 / A3), `superseded_by_alert_id`, and `status` — the alert's lifecycle state **now** (`open` = live in the queue per `lifecycle.is_live` | `resolved` | `dismissed` | `expired` | `merged` | `acked` | `inactive` for snoozed / past-TTL rows), looked up per row so a close the principal already undid renders as reopened instead of offering a second Undo, and a \"still open\" jump link only appears when there is a card to land on. The morning brief also carries a one-line count of research watch suggestions waiting on `/watchlist`.\n- **`talent`** — the active executive-search pipeline, rolled up by `briefing.talent_digest.build_talent_brief_items`: one item per non-terminal engagement (FILLED/CANCELLED dropped) with role, department, status, candidate count, per-stage counts, and four attention signals — `offers_expiring_soon` (extended offers within 72h of `expires_at`, or past it with no decision recorded — computed straight from the offers table so a missed nudge can't make the briefing stale), `needs_screening` (leads), `offers_out` (offers), and `stalled_count` (active candidates not touched in ≥7 days). Items sort expiring → offers → stalled → leads → size. It renders as the briefing's **Executive search** card (one per search; click-to-discuss hands off to chat via the same `onContinue` path), feeds the narrative (an offer landing or a search going cold re-writes the header — the narrative cache hash folds a talent fingerprint), and the same digest's `format_talent_for_prompt` is appended to the chat `<briefing>` block so the Executive can discuss live searches by client or role. One rollup, shared by all four surfaces, so the card / header / chat never disagree. See the Talent section.\n\nThe route resolves the caller from `x-caller-email`, then attaches the viewer-scoped narrative in a `BackgroundTask` so the request never blocks on an LLM call. `GET /today/activity` returns the recent self-initiated action rail — merged from fired scheduled actions (DMs, follow-ups, nudges, cadences), logged decisions, saved advice, completed workflow runs (briefings/check-ins/research), kicked-off initiatives, resolved gated decisions, and raised alerts, so it reflects all of the Executive's activity rather than just dispatched messages. The Pulse page (`/memories`) polls it (limit 100) every ~20s so new events stream into the 'Recent activity' card, which scrolls internally at a fixed height instead of growing the page. The `morning_brief` workflow calls `_build_today()` directly to build the standalone DM (via a different, enumerated prompt). `GET /morning-brief` is a deprecated alias.\n\n## Alert lifecycle & the Executive review\n\nAlerts used to be write-once: raised, then never looked at again, so the \"Needs you\" queue grew without bound and the briefs re-listed it daily. Three things now keep it live:\n\n- **Time-to-live** (`openexecutive.alerts.lifecycle`). Action items expire after `ALERT_TTL_DAYS_ACTION` (14 d), unrouted low/medium monitoring signals after `ALERT_TTL_DAYS_MONITORING` (3 d). Every surface reads `list_live_alerts` (the same predicate the scheduler's 15-minute sweep persists as status `expired`), so `/today` is right even before the sweep runs. Artifacts and decision-backed alerts are exempt. `POST /alerts/{id}/reopen` is the Undo.\n- **Coalescing** (`alerts.pipeline` + `store.coalesce_alert`). A repeat of an open alert with the same `(source, dedup_key)` updates that row — `occurrence_count`, `last_seen_at`, severity max — instead of stacking a second card, and only re-pings when severity rose to high/urgent. Monitoring alerts carry a stable `watch:<slug>` key, so one watch means one card.\n- **The review** (`openexecutive.alerts.review`, heartbeat `alert_review_scan`, every 6 h and right before the morning brief). For each open alert the Executive sees what changed since it was raised — newer signals from the same watch, related alerts, activity since, the roster with SLAs, department authority — and returns a verdict (relevant / changed / resolved / stale) plus a recommended move. Deterministic policy then acts: **route** (assign + DM the owner; `propose_via_alert` for propose-only departments), **nudge**, **escalate** (severity + `due_at` + DM the principal only), **draft** (`draft_artifact`), **suggest a workflow** (a link, never a run), **merge** (`superseded_by_alert_id`), or **resolve** — only on high confidence citing a server-minted evidence ref (a newer signal, a related alert, an activity item shown for that alert); free text never closes a card, and anything weaker is annotated `likely_stale`, demoted 30 ranking points, and left for one click. Everything that came from outside is rendered as inert data inside the review prompt, so an injected email body cannot steer the batch. Board / comp / legal matters only ever go to a scope-holder or the principal and keep their text. Route and escalate are idempotent across passes, every DM carries an \"[Alert review] Re: …\" header, outbound moves are capped per pass, passes are single-flight, `ALERT_REVIEW_ENABLED=false` stops every caller, every move is audited with its evidence and prior state, and a distinct `resolved` status keeps Executive closes separate from `ack` (user approved).\n\nOn the page, cards read as decisions: the one-line \"what changed since you last looked\" (`review_note`) leads, the recommended move is the primary control (Nudge <owner> → chat; Run <workflow> → `/jobs/<name>`), with chips for age, seen ×N, why-now / due, folded-in and draft-ready, a \"Reviewed <ago>\" footer, and an amber Likely-stale treatment with one-click Dismiss. \"Needs you\" shows *Start here* + 8 cards + \"Show N more\", a \"Dismiss N older than 7 days\" footer (explicit ids to `POST /alerts/bulk-ack` — never a server-side age sweep, which would hit teammates' routed items), and \"Re-check relevance\" (`POST /alerts/review`). The handled rail (anchor of the \"Executive handled N overnight\" pill) reads as the Executive reporting in, not an audit export: a first-person heading built from counts only — \"Since your last brief: N off your plate (resolved + dismissed closes still standing), N in others' hands (routed / nudged), N waiting on you (escalated)\" — then one first-person row per alert (\"Resolved *X* — evidence\", \"Dismissed *X* as stale — evidence\", \"Handed *X* to Dana Kim\" / \"Proposed *X* to Dana Kim (awaiting their approval)\", \"Chased Dana Kim on *X*\", \"Raised *X* to high\", \"Drafted *T* from *X*\", \"Folded *X* into *Y*\", \"Started watching *slug*\"). Escalations sort first; rows sharing an alert collapse to the newest move with the others as an \"also …\" trailer — a close always keeps the visible slot (it carries Undo), otherwise an escalation beats routed / nudged / drafted; a merge whose survivor is listed becomes \"N duplicates folded in\" on the survivor; five rows show before \"Show N more\", with workflow suggestions and stopped watches behind it by default. Every row links its `evidence_ref` (or \"evidence\") to `/audit?event_type=…&q=…` (the audit page pre-fills those filters from the query string), a still-open row jumps to its card (`#alert-<id>`), drafted rows link `/artifacts`, watch rows `/watchlist`. Undo is offered only while the close still stands (`status` not `open`); a reverted close shows \"Reopened\". A footer counts closes still standing (\"N fewer cards in your queue since your last brief · every close cites its evidence\"), and an empty rail with reviewed open alerts renders one line (\"Quiet night. I re-read N open alerts — none needed a move.\"). Dismissing a watch-sourced alert lowers that watch's `trust_score` (which discounts ranking and is shown to the review as evidence); the ack body may carry `mute_topic`.\n\n## Multi-client practice section\n\nIn multi-client practice mode (2+ client slots — see the Client Companies section), the response gains an additive `practice_clients` list: rollup cards for the **parked** clients (overdue follow-ups, awaiting replies, unread alerts, onboarding due soon, renewal countdowns), each stamped with the save point its data reflects. Single-company installs always receive an empty list and the UI renders nothing.",
+ "markdown": "`openexecutive.api.routes.today` serves the morning brief — a one-screen, read-only view of what is happening across the org. It is the default landing surface (the Next.js root renders `<Briefing>`).\n\n`GET /today` returns `TodayResponse` assembled by `_build_today()`, which is synchronous and caller-agnostic:\n\n- **`departments`** — per-department goal health, rolling up each department's goal counts (`total`, `at_risk`, `off_track`) plus its awaiting-workflow count, and `attention_goals`: the actual off-track/at-risk goals (worst first, capped at 3) with `key_result`, `current`, `target`, and `status`, so the briefing's Department card shows *which* goal is off and how far without a click. Empty for healthy/inactive departments.\n- **`people`** — an attention-ranked roster. Each person carries `awaiting_action` count, soonest SLA, a `status` (`on_leave` / `needs_reply` / `awaiting` / `clear`), reachability, `overdue`, a server `priority` sort key, and a cached one-line `insight`. Sorted by `(-priority, full_name)`.\n- **`proposals`** — the *live* unread alerts (workflow approvals, triage-classified inbound, Executive signals, flagged artifacts, and gated calendar bookings): unread, inside their category TTL, not snoozed — see *Alert lifecycle* below. Each carries `score`, `category` (`action` vs `monitoring`), `surfaced_reason` from `openexecutive.briefing.ranking`, the lifecycle fields (`occurrence_count`, `last_seen_at`, `last_reviewed_at`, `review_verdict`, `review_note`, `recommended_move`, `why_now`, `due_at`, `superseded_count`, `suggested_workflow`), and `decision_instance_id` (set only when the proposal is backed by a decision-ledger row — a calendar booking awaiting approval). The UI splits them into 'mine' vs 'across the team' using `caller_person_id`. For decision-backed proposals the card's Approve/Reject call the `/decisions` endpoints (which book or cancel the event server-side and clear the alert) instead of the ack-and-hand-off-to-chat flow — so meeting bookings are reviewed in the briefing itself rather than on a separate page.\n- **`narrative`** — a per-viewer Executive-voice header synthesized by `synthesize_briefing_narrative`; the principal gets the whole-company scope, teammates a role-scoped one. In the web UI each bullet of this narrative is a click target: clicking one hands off to chat (the same `onContinue` path as the proposal cards) seeded to discuss that item. The Executive recognizes it because every chat turn now carries a `<briefing>` digest of open alerts (see Memory).\n- **`in_flight`** / **`awaiting`** — upcoming Executive commitments and people we are waiting on.\n- **`handled_overnight`** — the autonomous moves the Executive *completed* since the last delivered morning brief: the alert review's (routed, nudged, escalated, drafted, merged, closed) plus the research watch policy's (`watching` — a watch added on its own because it was grounded in company data; `stopped_watching` — a research watch auto-disabled as noisy or dead; no alert id, re-enable from `/watchlist`). A `changed` verdict (the review rewrote an open alert's headline / body / severity) is deliberately **not** here: the alert is still open in \"Needs you\" and its card carries the note, so the brief reports it under \"what changed\" (a REWRITTEN block) rather than as done. Each row is structured, not just a sentence: `kind`, the audit `summary` (nudge bookkeeping marker stripped), `at`, `alert_id`, `event_type` (for a pre-filtered `/audit` deep link), `headline` (the alert's headline at move time; a watch's slug), `target` (person name for routed / nudged, survivor headline for merged, new severity for escalated, draft title, workflow name), `detail` (the cited evidence or the watch policy's reason), `outcome` (`resolved` | `dismissed` for a close, `proposed` for a route that went through the authority gate), `evidence_ref` (S1 / R2 / A3), `superseded_by_alert_id`, and `status` — the alert's lifecycle state **now** (`open` = live in the queue per `lifecycle.is_live` | `resolved` | `dismissed` | `expired` | `merged` | `acked` | `inactive` for snoozed / past-TTL rows), looked up per row so a close the principal already undid renders as reopened instead of offering a second Undo, and a \"still open\" jump link only appears when there is a card to land on. The morning brief also carries a one-line count of research watch suggestions waiting on `/watchlist`.\n- **`talent`** — the active executive-search pipeline, rolled up by `briefing.talent_digest.build_talent_brief_items`: one item per non-terminal engagement (FILLED/CANCELLED dropped) with role, department, status, candidate count, per-stage counts, and four attention signals — `offers_expiring_soon` (extended offers within 72h of `expires_at`, or past it with no decision recorded — computed straight from the offers table so a missed nudge can't make the briefing stale), `needs_screening` (leads), `offers_out` (offers), and `stalled_count` (active candidates not touched in ≥7 days). Items sort expiring → offers → stalled → leads → size. It renders as the briefing's **Executive search** card (one per search; click-to-discuss hands off to chat via the same `onContinue` path), feeds the narrative (an offer landing or a search going cold re-writes the header — the narrative cache hash folds a talent fingerprint), and the same digest's `format_talent_for_prompt` is appended to the chat `<briefing>` block so the Executive can discuss live searches by client or role. One rollup, shared by all four surfaces, so the card / header / chat never disagree. See the Talent section.\n\nThe route resolves the caller from `x-caller-email`, then attaches the viewer-scoped narrative in a `BackgroundTask` so the request never blocks on an LLM call. `GET /today/activity` returns the recent self-initiated action rail — merged from fired scheduled actions (DMs, follow-ups, nudges, cadences), logged decisions, saved advice, completed workflow runs (briefings/check-ins/research), kicked-off initiatives, resolved gated decisions, and raised alerts, so it reflects all of the Executive's activity rather than just dispatched messages. The Pulse page (`/memories`) polls it (limit 100) every ~20s so new events stream into the 'Recent activity' card, which scrolls internally at a fixed height instead of growing the page. The `morning_brief` workflow calls `_build_today()` directly to build the standalone DM (via a different, enumerated prompt). `GET /morning-brief` is a deprecated alias.\n\n## Alert lifecycle & the Executive review\n\nAlerts used to be write-once: raised, then never looked at again, so the \"Needs you\" queue grew without bound and the briefs re-listed it daily. Three things now keep it live:\n\n- **Time-to-live** (`openexecutive.alerts.lifecycle`). Action items expire after `ALERT_TTL_DAYS_ACTION` (14 d), unrouted low/medium monitoring signals after `ALERT_TTL_DAYS_MONITORING` (3 d). Every surface reads `list_live_alerts` (the same predicate the scheduler's 15-minute sweep persists as status `expired`), so `/today` is right even before the sweep runs. Artifacts and decision-backed alerts are exempt. `POST /alerts/{id}/reopen` is the Undo.\n- **Coalescing** (`alerts.pipeline` + `store.coalesce_alert`). A repeat of an open alert with the same `(source, dedup_key)` updates that row — `occurrence_count`, `last_seen_at`, severity max — instead of stacking a second card, and only re-pings when severity rose to high/urgent. Monitoring alerts carry a stable `watch:<slug>` key, so one watch means one card.\n- **The review** (`openexecutive.alerts.review`, heartbeat `alert_review_scan`, every 6 h and right before the morning brief). For each open alert the Executive sees what changed since it was raised — newer signals from the same watch, related alerts, activity since, the roster with SLAs, department authority — and returns a verdict (relevant / changed / resolved / stale) plus a recommended move. Deterministic policy then acts: **route** (assign + DM the owner; `propose_via_alert` for propose-only departments), **nudge**, **escalate** (severity + `due_at` + DM the principal only), **draft** (`draft_artifact`), **suggest a workflow** (a link, never a run), **merge** (`superseded_by_alert_id`), or **resolve** — only on high confidence citing a server-minted evidence ref (a newer signal, a related alert, an activity item shown for that alert); free text never closes a card, and anything weaker is annotated `likely_stale`, demoted 30 ranking points, and left for one click. Everything that came from outside is rendered as inert data inside the review prompt, so an injected email body cannot steer the batch. Board / comp / legal matters only ever go to a scope-holder or the principal and keep their text. Route and escalate are idempotent across passes, every DM carries an \"[Alert review] Re: …\" header, outbound moves are capped per pass, passes are single-flight, `ALERT_REVIEW_ENABLED=false` stops every caller, every move is audited with its evidence and prior state, and a distinct `resolved` status keeps Executive closes separate from `ack` (user approved).\n\nOn the page, cards read as decisions: the one-line \"what changed since you last looked\" (`review_note`) leads, the recommended move is the primary control (Nudge <owner> → chat; Run <workflow> → `/jobs/<name>`), with chips for age, seen ×N, why-now / due, folded-in and draft-ready, a \"Reviewed <ago>\" footer, and an amber Likely-stale treatment with one-click Dismiss. \"Needs you\" shows *Start here* + 8 cards + \"Show N more\", a \"Dismiss N older than 7 days\" footer (explicit ids to `POST /alerts/bulk-ack` — never a server-side age sweep, which would hit teammates' routed items), and \"Re-check relevance\" (`POST /alerts/review`). The handled rail (anchor of the \"Executive handled N overnight\" pill) is deliberately one line by default: a first-person heading built from counts only — \"Since your last brief: N off your plate (closes and merges still standing), N in others' hands (routed / nudged), N waiting on you (escalated)\" — with the rows behind a \"details\" disclosure, and nothing rendered at all when there is nothing handled. Expanded, it shows one first-person row per alert (\"Resolved *X* — evidence\", \"Dismissed *X* as stale — evidence\", \"Handed *X* to Dana Kim\" / \"Proposed *X* to Dana Kim (awaiting their approval)\", \"Chased Dana Kim on *X*\", \"Raised *X* to high\", \"Drafted *T* from *X*\", \"Folded *X* into *Y*\", \"Started watching *slug*\"), escalations first; rows sharing an alert collapse to the newest move with the others as an \"also …\" trailer — a close always keeps the visible slot (it carries Undo), otherwise an escalation beats routed / nudged / drafted; a merge whose survivor is listed becomes \"N duplicates folded in\" on the survivor. Every row links its `evidence_ref` (or \"evidence\") to `/audit?event_type=…&q=…` (the audit page pre-fills those filters from the query string), a still-open row jumps to its card (`#alert-<id>`), drafted rows link `/artifacts`, watch rows `/watchlist`. Undo is offered only while the close still stands (`status` not `open`); a reverted close shows \"Reopened\". Dismissing a watch-sourced alert lowers that watch's `trust_score` (which discounts ranking and is shown to the review as evidence); the ack body may carry `mute_topic`.\n\n## Multi-client practice section\n\nIn multi-client practice mode (2+ client slots — see the Client Companies section), the response gains an additive `practice_clients` list: rollup cards for the **parked** clients (overdue follow-ups, awaiting replies, unread alerts, onboarding due soon, renewal countdowns), each stamped with the save point its data reflects. Single-company installs always receive an empty list and the UI renders nothing.",
"mermaid": "flowchart TD\n REQ[\"GET /today\"]\n BUILD[\"_build_today()\"]\n DEPTS[\"departments<br/>(per-dept goal health)\"]\n ROSTER[\"people<br/>(attention-ranked roster)\"]\n PROPS[\"proposals<br/>(unread alerts, routed)\"]\n INFLIGHT[\"in_flight<br/>(pending follow-ups / nudges)\"]\n AWAIT[\"awaiting<br/>(replies we await)\"]\n TALENT[\"talent<br/>(open searches, by stage)\"]\n NARR[\"viewer-scoped narrative (BackgroundTask)\"]\n MB[\"morning_brief workflow\"]\n REQ --> BUILD\n BUILD --> DEPTS\n BUILD --> ROSTER\n BUILD --> PROPS\n BUILD --> INFLIGHT\n BUILD --> AWAIT\n BUILD --> TALENT\n REQ -->|\"resolve caller, attach\"| NARR\n MB -->|\"calls directly for standalone DM\"| BUILD\n class REQ entry\n class BUILD compute\n class DEPTS storage\n class ROSTER storage\n class PROPS storage\n class INFLIGHT storage\n class AWAIT storage\n class TALENT storage\n class NARR compute\n class MB compute",
"generated_at": "2026-09-13T00:00:00+00:00"
}
diff --git a/packages/ui/src/components/Briefing.tsx b/packages/ui/src/components/Briefing.tsx
index c74419ae..1f1436cc 100644
--- a/packages/ui/src/components/Briefing.tsx
+++ b/packages/ui/src/components/Briefing.tsx
@@ -1481,33 +1481,33 @@ function MonitoringPanel({
// escalated, drafted, merged, closed) plus the research watch policy's
// autonomous adds/drops. Rewrites of open alerts are deliberately absent:
// the alert is still in "Needs you" and its card carries the note, so
-// listing it here would double-report it and call it done. Every autonomous
-// close is reversible here (Undo → reopen), which is what makes the autonomy
-// un-scary: visible, evidence-cited, one click back.
+// listing it here would double-report it and call it done.
+//
+// Deliberately quiet: the default render is ONE sentence of counts. The
+// rows — and Undo for every autonomous close, which is what makes the
+// autonomy un-scary (visible, evidence-cited, one click back) — sit behind
+// a "details" disclosure. A night with nothing handled renders nothing.
//
// Voice: first person, past tense, specific, nothing the audit row cannot
// back. The heading counts three buckets and never interpolates names, so
// it reads the same whether the roster lookup found "Dana Kim" or not.
-const HANDLED_VISIBLE = 5;
// One table per kind: reading order (what needs the principal first, then
-// what they can undo, then what went to others, then transparency), the short
-// past-tense verb for the "also …" trailer, and whether the row is
-// transparency rather than accomplishment (folded behind "Show more").
-const HANDLED_KINDS: Record<string, { order: number; verb: string; quiet?: true }> = {
+// what they can undo, then what went to others, then transparency) and the
+// short past-tense verb for the "also …" trailer.
+const HANDLED_KINDS: Record<string, { order: number; verb: string }> = {
escalated: { order: 0, verb: "raised" },
closed: { order: 1, verb: "closed" },
merged: { order: 1, verb: "folded" },
routed: { order: 2, verb: "routed" },
nudged: { order: 2, verb: "chased" },
drafted: { order: 2, verb: "drafted" },
- suggested_workflow: { order: 3, verb: "suggested a workflow", quiet: true },
+ suggested_workflow: { order: 3, verb: "suggested a workflow" },
watching: { order: 3, verb: "started watching" },
- stopped_watching: { order: 3, verb: "stopped watching", quiet: true },
+ stopped_watching: { order: 3, verb: "stopped watching" },
};
const handledOrder = (kind: string) => HANDLED_KINDS[kind]?.order ?? 4;
const handledVerb = (kind: string) => HANDLED_KINDS[kind]?.verb ?? kind;
-const isQuietKind = (kind: string) => HANDLED_KINDS[kind]?.quiet === true;
// Stable key for one handled row (an alert can appear twice in one pass —
// e.g. routed then closed — so the alert id alone is not unique).
@@ -1738,73 +1738,47 @@ function HandledRowView({
function HandledOvernightPanel({
items,
- reviewedOpenCount,
onReopen,
undone,
}: {
items: HandledItem[];
- // Open alerts the review re-read in the last day — the honest basis for
- // the quiet-night line.
- reviewedOpenCount: number;
onReopen?: (rowKey: string, alertId: number) => void;
undone: Set<string>;
}) {
- const [showAll, setShowAll] = useState(false);
+ const [open, setOpen] = useState(false);
// The rail is rebuilt from the audit log on every fetch, so a close the
// principal already undid still has its row: `status === "open"` (server
// truth after a reload) or the in-session set marks it reverted.
const reverted = (h: HandledItem) => isCloseKind(h) && (h.status === "open" || undone.has(handledKey(h)));
- if (items.length === 0) {
- if (reviewedOpenCount === 0) return null;
- return (
- <section id={SECTION_IDS.handled} className="rounded-xl border border-line bg-surface-elevated px-4 py-3">
- <p className="text-xs text-fg-muted">
- Quiet night. I re-read {reviewedOpenCount} open alert{reviewedOpenCount === 1 ? "" : "s"} — none needed a move.
- </p>
- </section>
- );
- }
-
+ if (items.length === 0) return null;
const rows = groupHandled(items);
- const loud = rows.filter((r) => !isQuietKind(r.item.kind));
- const quiet = rows.filter((r) => isQuietKind(r.item.kind));
- // Quiet rows hide behind "Show more" only when there is something louder
- // to show first; a rail of nothing but suggestions still lists them.
- const primary = loud.length > 0 ? loud : quiet;
- const visible = showAll ? [...loud, ...quiet] : primary.slice(0, HANDLED_VISIBLE);
- const hiddenCount = rows.length - visible.length;
- const closesStanding = rows.filter((r) => isCloseKind(r.item) && !reverted(r.item)).length;
return (
- <section id={SECTION_IDS.handled} className="rounded-xl border border-line bg-surface-elevated p-4">
- <div className="flex items-start gap-1.5 mb-2">
- <p className="text-sm font-medium text-fg">{handledHeadline(rows, reverted)}</p>
+ <section id={SECTION_IDS.handled} className="rounded-xl border border-line bg-surface-elevated px-4 py-2.5">
+ <div className="flex items-center gap-1.5">
+ <p className="min-w-0 flex-1 text-sm text-fg">{handledHeadline(rows, reverted)}</p>
<InfoTip align="left">
Moves I completed on my own since your last delivered brief — routed,
chased, escalated, drafted, folded, or closed with cited evidence.
Rewrites of open alerts show on the card itself, not here. Undo puts a
closed item back in your queue.
</InfoTip>
- </div>
- <div className="divide-y divide-line">
- {visible.map((row) => (
- <HandledRowView key={handledKey(row.item)} row={row} reverted={reverted(row.item)} onReopen={onReopen} />
- ))}
- </div>
- {(hiddenCount > 0 || showAll) && (
<button
type="button"
- onClick={() => setShowAll((v) => !v)}
- className="w-full pt-2 text-[11px] text-fg-muted hover:text-fg transition-colors"
+ onClick={() => setOpen((v) => !v)}
+ aria-expanded={open}
+ className="flex-shrink-0 text-[11px] text-fg-muted hover:text-fg transition-colors"
>
- {showAll ? "Show fewer" : `Show ${hiddenCount} more`}
+ {open ? "hide ▾" : "details ▸"}
</button>
- )}
- {closesStanding > 0 && (
- <p className="mt-2 pt-2 border-t border-line text-[11px] text-fg-subtle">
- {closesStanding} fewer card{closesStanding === 1 ? "" : "s"} in your queue since your last brief · every close cites its evidence.
- </p>
+ </div>
+ {open && (
+ <div className="mt-1.5 divide-y divide-line border-t border-line">
+ {rows.map((row) => (
+ <HandledRowView key={handledKey(row.item)} row={row} reverted={reverted(row.item)} onReopen={onReopen} />
+ ))}
+ </div>
)}
</section>
);
@@ -2063,13 +2037,6 @@ export default function Briefing({ onContinue, showHeader = false, firstName }:
const restProposals = mineProposals.slice(1);
const staleNeedsYouIds = olderThan(mineProposals, NEEDS_YOU_DISMISS_OLDER_THAN_DAYS);
const handledOvernight = today?.handled_overnight ?? [];
- // Open alerts the review actually re-read in the last day — the honest
- // basis for the quiet-night line (a verdict stamped three days ago is not
- // "I read it last night").
- const reviewedOpenCount = (today?.proposals ?? []).filter((p) => {
- const t = Date.parse(p.last_reviewed_at ?? "");
- return !Number.isNaN(t) && Date.now() - t < 24 * 60 * 60 * 1000;
- }).length;
// Status-strip inputs, all from data already computed above.
const inFlightCount = today?.in_flight?.length ?? 0;
@@ -2488,7 +2455,6 @@ export default function Briefing({ onContinue, showHeader = false, firstName }:
/>
<HandledOvernightPanel
items={handledOvernight}
- reviewedOpenCount={reviewedOpenCount}
onReopen={handleReopen}
undone={undoneRows}
/>