Skip to content

feat(glass-office): Event stream as the third parity-proven Basement room - #111

Merged
EmergentKnowledgeGroup merged 3 commits into
mainfrom
codex/glass-office-p5-events
Jul 24, 2026
Merged

feat(glass-office): Event stream as the third parity-proven Basement room#111
EmergentKnowledgeGroup merged 3 commits into
mainfrom
codex/glass-office-p5-events

Conversation

@EmergentKnowledgeGroup

@EmergentKnowledgeGroup EmergentKnowledgeGroup commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

The third P5 slice: the realtime Event stream is rehomed behind its stable Basement room id with the feed pipeline untouched — the room still reads visibleEvents from the existing controller, and there is no new websocket subscription, event buffer, persistence key, filter store, clear/recovery path, or incident severity model anywhere in this diff.

  • First EventsPage component parity suite (the page had none): all six domain chips as live filters with aria-pressed state; summaries, domain tone classes, and deterministic relative time under fake timers; heartbeat visibility through the real onShowRawEventsChange seam in both directions; both honest empty states plus Clear filter; exact twelve-item pagination boundaries with page reset on filter; live-shrink clamping proving a later page never goes silently blank while matching events exist; JSON expand/collapse with recursive secret redaction across nested objects and arrays; and a pin click proven to mutate no filter, page, disclosure, or heartbeat state.
  • The suite caught a real production defect on day one: the no-events empty state was written as "Listening for events…" inside a JSX attribute — JSX attribute strings do not process \u escapes, so users literally saw on screen. Fixed to the real ellipsis character.
  • Pin + block: hidden-by-default events room-shortcut block; PinRoomToOffice roomId="events" rides the shared room-row idiom beside the filter chips, leaving Show heartbeats untouched in the header slot. Shared primitives only — no Events special-casing.
  • New p5-events-slice.spec.ts drives real websocket events through the existing /api/v1/e2e/ws-event/ws-burst gateway hooks, no static DOM fixtures: per-domain marker assertions plus whole-page domain-purity checks (every row carries the filtered domain's tone class) that stay robust to the live feed's own emissions; heartbeat toggle through the checkbox; end-to-end redaction of secrets that genuinely crossed the wire ([REDACTED] present, raw values absent); thirty-event pagination boundaries on the quiet Mail domain; the 400-event retention cap verified after a 500-event burst; byte-for-byte config immutability on full-canvas refusal and a byte-identical repeat pin with the operator's filter and open JSON row untouched; live mounted-Office sync; exact door return; reload persistence; Basement floor disabled/restored door truth with no stale refusal copy; and 390px proof with a nonzero visible ES mark plus horizontal inner-containment for every chip, the checkbox, event rows, the JSON payload, and pagination controls — under console.error and requestfailed capture.
  • Two geometry judgment calls worth review: containment checks require nonzero rects (the feat(glass-office): Models & Providers as the second parity-proven Basement room #110 lesson), and surface-level checks assert horizontal containment — vertical scrolling of the feed and the surface header's designed negative-margin bleed are normal behavior, while the chop class of defect is horizontal. Same-line containers (chips in their bar, payload in its row, pagination controls in their nav) keep full containment.

Validation

From apps/mission-control/ (Playwright via PLAYWRIGHT_BROWSERS_PATH=Z:\carsinos-codex-work\playwright-browsers):

  • npm run typecheck — PASS
  • npm run lint — PASS
  • npm run test:unit -- --run — 471/471 PASS (new EventsPage suite 8/8; eventStream.test.ts helpers untouched and green)
  • npm run build — PASS (pre-existing chunk-size warning only)
  • npx playwright test e2e/p5-events-slice.spec.ts — PASS
  • npx playwright test e2e/live-feed.spec.ts e2e/reconnect-edge.spec.ts e2e/p5-models-slice.spec.ts — 5/5 PASS (live-feed, incident, recovery, reconnect, and the corrected Models anchors unweakened on this head)
  • npm run test:e2e:core — 39/39 PASS
  • python3 scripts/validate_execass_contract.py — PASS; contracts untouched
  • git diff --check — PASS
  • Screenshots under runtime/qa/p5-events-slice/ — enumerated with ls first: six, each visually inspected (refusal copy beside the Channel-filtered secret row, pinned desktop with expanded redacted JSON, Office door naming The Basement, disabled/restored door truth, and 390px with the ES mark lit, wrapped chip rows contained, and JSON wrapping inside its row)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added the Event stream room to Mission Control, including domain filter chips, empty-state messaging, pagination, heartbeat/raw-events visibility controls, and expandable JSON payloads with secret redaction.
    • Added “Pin Event stream to Office” with an Office shortcut to reopen the exact room, including a visible status note.
    • Improved mobile responsiveness for the event-stream layout.
  • Bug Fixes

    • Prevented pagination from leaving blank pages as the feed shrinks; corrected handling at pagination boundaries and under room availability changes.
  • Tests

    • Added unit and end-to-end coverage for filtering, pagination, pinning behavior, redaction, responsiveness, and realtime feed rendering.

EmergentKnowledgeGroup and others added 2 commits July 24, 2026 17:13
Rehome the existing realtime feed surface behind its stable events room
id with zero pipeline changes: the room reads visibleEvents exactly as
before, with no new websocket subscription, buffer, persistence key,
filter store, clear/recovery path, or incident model.

- EventsPage gains its first component-level parity suite: all six
  domain chips as live filters with pressed state, summaries, domain
  tones, deterministic relative time under fake timers, heartbeat
  visibility through the real onShowRawEventsChange seam in both
  directions, both honest empty states plus Clear filter, exact
  twelve-item pagination boundaries with page reset on filter,
  live-shrink clamping that never leaves a later page blank while
  matching events exist, JSON expand/collapse with recursive secret
  redaction across nested objects and arrays, and a pin click proven to
  mutate no filter, page, disclosure, or heartbeat state.
- The suite immediately caught a real production defect: the
  no-events empty state used a … escape inside a JSX attribute
  string, which JSX does not process, so users saw the literal
  characters. The copy now uses the real ellipsis.
- The registry-backed pin rides the shared room-row idiom beside the
  filter chips; Show heartbeats keeps the header slot untouched.
  Register the hidden-by-default events room-shortcut block.
- New p5-events-slice e2e drives real websocket events through the
  existing test gateway: per-domain markers plus whole-page
  domain-purity assertions (robust to the live feed's own emissions),
  heartbeat toggle through the checkbox, end-to-end redaction of
  secrets that genuinely crossed the wire, thirty-event pagination
  boundaries on the quiet Mail domain, the 400-event retention cap
  after a 500-event burst, byte-for-byte config immutability on
  full-canvas refusal and byte-identical repeat pin with feed state
  untouched, live mounted-Office sync, exact door return, reload
  persistence, Basement floor disabled/restored door truth, and 390px
  proof with a nonzero visible ES mark and horizontal inner-containment
  for every chip, the checkbox, event rows, JSON payload, and
  pagination controls, under console-error and requestfailed capture.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 32c9d3c2-6643-42ee-8fa2-4c91e7cc5340

📥 Commits

Reviewing files that changed from the base of the PR and between c0ecae8 and 9f4a614.

📒 Files selected for processing (4)
  • apps/mission-control/e2e/p5-events-slice.spec.ts
  • apps/mission-control/src/features/events/EventsPage.test.tsx
  • apps/mission-control/src/features/events/EventsPage.tsx
  • docs/plans/2026-07-23-glass-office-claude-resume.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/plans/2026-07-23-glass-office-claude-resume.md
  • apps/mission-control/src/features/events/EventsPage.test.tsx
  • apps/mission-control/e2e/p5-events-slice.spec.ts

📝 Walkthrough

Walkthrough

Adds Event stream Office pinning and a hidden Office shortcut, with unit and Playwright coverage for realtime feeds, filtering, redaction, pagination, persistence, disabled-floor behavior, and responsive layout.

Changes

Event stream room slice

Layer / File(s) Summary
Event surface contract and parity coverage
apps/mission-control/src/features/events/EventsPage.tsx, apps/mission-control/src/features/events/EventsPage.test.tsx, apps/mission-control/src/styles.css
Adds the pin control beside event filters, clamps pagination after feed shrinkage, and tests filtering, rendering, heartbeat state, empty states, pagination, payload redaction, layout styling, and pinning state preservation.
Office shortcut registration and persistence
apps/mission-control/src/features/execassOffice/officeBlocks.ts, apps/mission-control/src/features/execassOffice/PinRoomToOffice.test.tsx, apps/mission-control/src/features/execassOffice/pinToOffice.test.ts
Registers a hidden events room shortcut and verifies pin-button labeling, successful pinning, and persisted visibility.
Realtime flow and browser validation
apps/mission-control/e2e/p5-events-slice.spec.ts
Validates websocket event delivery, filters, redaction, pin capacity, Office navigation, floor availability, retention, pagination, mobile geometry, and browser errors.
Parity slice handoff updates
docs/plans/.../2026-07-23-glass-office-claude-resume.md
Updates the parity baseline and documents Event stream implementation requirements and QA lessons.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: professahx

Sequence Diagram(s)

sequenceDiagram
  participant Playwright
  participant WebsocketGateway
  participant EventsPage
  participant OfficeLayout
  Playwright->>WebsocketGateway: Emit domain-scoped events
  WebsocketGateway-->>EventsPage: Deliver realtime feed rows
  Playwright->>EventsPage: Filter, expand payload, and pin room
  EventsPage->>OfficeLayout: Persist events shortcut visibility
  OfficeLayout-->>EventsPage: Return pin and room state
  Playwright->>EventsPage: Reopen pinned room after reload
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed, but it misses required template sections like Scope, Security, Checkpoint SOP, and explicit visual evidence blocks. Add the missing template sections and clearly fill in the Scope, Security, Checkpoint SOP, and Visual evidence items with complete notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the main change in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/glass-office-p5-events

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/mission-control/e2e/p5-events-slice.spec.ts (1)

440-455: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Exact "400 events" subtitle can flake when a heartbeat lands inside the retained window.

The subtitle reflects filtered.length of visible events, and heartbeats are hidden at this point (unchecked at Line 151, reset to default after the reload). If the gateway interleaves a heartbeat.* event into the retained 400-item window, the visible count drops below the cap and this poll times out even though retention is working correctly. Consider asserting the cap as an upper bound, or enabling "Show heartbeats" before polling so the count matches the raw retained buffer.

♻️ Suggested loosening of the retention assertion
   await expect
     .poll(async () => (await eventsSubtitle.textContent())?.trim() ?? "", {
       timeout: 20_000,
     })
-    .toBe("400 events");
+    .toMatch(/^(?:39[5-9]|400) events$/);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/mission-control/e2e/p5-events-slice.spec.ts` around lines 440 - 455,
Update the retention assertion around eventsSubtitle so it does not require
exactly “400 events” when hidden heartbeat events occupy retained slots. Either
enable “Show heartbeats” before polling to make the subtitle reflect the raw
retained buffer, or change the expectation to assert the visible count is at
most 400 while still confirming retention reaches the cap.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/plans/2026-07-23-glass-office-claude-resume.md`:
- Around line 344-347: Align the Event stream identity references between the
focused `@core` P5 plan scenario and its corresponding E2E test contract. Choose
one canonical lamp identifier, ensuring both the plan and selector use the exact
same name, either “B · Event stream” or “BF · Event stream,” so validation
cannot pass against the wrong room identity.

---

Nitpick comments:
In `@apps/mission-control/e2e/p5-events-slice.spec.ts`:
- Around line 440-455: Update the retention assertion around eventsSubtitle so
it does not require exactly “400 events” when hidden heartbeat events occupy
retained slots. Either enable “Show heartbeats” before polling to make the
subtitle reflect the raw retained buffer, or change the expectation to assert
the visible count is at most 400 while still confirming retention reaches the
cap.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d60f16c4-fe2c-4180-9397-bdddcb2d5816

📥 Commits

Reviewing files that changed from the base of the PR and between e455173 and c0ecae8.

📒 Files selected for processing (8)
  • apps/mission-control/e2e/p5-events-slice.spec.ts
  • apps/mission-control/src/features/events/EventsPage.test.tsx
  • apps/mission-control/src/features/events/EventsPage.tsx
  • apps/mission-control/src/features/execassOffice/PinRoomToOffice.test.tsx
  • apps/mission-control/src/features/execassOffice/officeBlocks.ts
  • apps/mission-control/src/features/execassOffice/pinToOffice.test.ts
  • apps/mission-control/src/styles.css
  • docs/plans/2026-07-23-glass-office-claude-resume.md

Comment thread docs/plans/2026-07-23-glass-office-claude-resume.md Outdated
@EmergentKnowledgeGroup
EmergentKnowledgeGroup merged commit 7c48315 into main Jul 24, 2026
5 checks passed
@EmergentKnowledgeGroup
EmergentKnowledgeGroup deleted the codex/glass-office-p5-events branch July 24, 2026 23:36
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