RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/AGENTS.md/nexu-io/open-design

AGENTS.md

apps/web/src/components/Theater/AGENTS.md
AGENTS.md

Quality

72/100

Scores the file, not the repository.

Length

853 words

5 headings · 0 code blocks

Repository

83k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
nexu-io/open-design/apps/web/src/components/Theater/AGENTS.mdRawGitHub
1# `apps/web/src/components/Theater/` (Critique Theater, web side)
2 
3Module map agents enter when they need to change the visual surface of
4the Design Jury feature. The directory keeps the internal **Theater**
5name; the user-facing label "Design Jury" comes from a single i18n key,
6`critiqueTheater.userFacingName`, so the product name can be renamed
7without code churn.
8 
9## Layout
10 
11| File | Responsibility |
12|---|---|
13| `state/reducer.ts` | Pure state machine. Driven by `PanelEvent` from the contracts package plus a synthetic `__reset__` action the hooks dispatch on context changes. |
14| `state/sse.ts` | SSE channel manager + `sseToPanelEvent` which lifts the wire shape back to a `PanelEvent`. Runs per-variant validation so a malformed frame cannot reach the reducer. |
15| `hooks/useCritiqueStream.ts` | Subscribes to the project SSE stream and feeds the reducer. Tears down on `enabled=false` and on `projectId` change, dispatching `__reset__` so a prior project's state cannot bleed in. |
16| `hooks/useCritiqueReplay.ts` | Drives the same reducer from a recorded `.ndjson(.gz)` transcript. Parse + pace are split into two effects so pause / resume preserves the cursor. |
17| `CritiqueTheaterMount.tsx` | Drop-in mount the project view uses. Owns the kill-request handshake (`POST /api/projects/:id/critique/:runId/interrupt`) and the phase-aware swap from live stage to collapsed badge. |
18| `TheaterStage.tsx` | Live-debate container. Mounts five `PanelistLane`s + `ScoreTicker` + `RoundDivider` rail + `InterruptButton`. |
19| `PanelistLane.tsx` | One row per panelist. Keyed by `data-role` for CSS tinting; no hex literals in source. |
20| `ScoreTicker.tsx` | Composite trajectory with a threshold marker. |
21| `RoundDivider.tsx` | Round-by-round separator carrying composite vs threshold. |
22| `InterruptButton.tsx` | Click + Esc binding. Esc scopes itself to non-text-input focus so the prompt textarea is safe. |
23| `TheaterDegraded.tsx` | Single chip surface for runs the orchestrator could not score. `useId()` for the heading id so multiple chips on one page do not collide. |
24| `TheaterCollapsed.tsx` | Post-run summary: shipped, interrupted, failed. The interrupted branch uses `interruptedSummary`, not `shippedSummary`. |
25| `TheaterTranscript.tsx` | Read-only replay surface bound to `useCritiqueReplay`. |
26| `hooks/useCritiqueTheaterEnabled.ts` | Reads the Settings toggle from `open-design:config` localStorage and stays in sync with cross-tab `storage` events plus the same-tab `open-design:critique-theater-toggle` CustomEvent. Pairs with the `setCritiqueTheaterEnabled` setter so a Settings save reflects in every mounted hook without a reload. |
27| `index.ts` | Public barrel. Exports the mount, the four surface components plus the `InterruptButton`, the three hooks (`useCritiqueStream`, `useCritiqueReplay`, `useCritiqueTheaterEnabled`), the imperative setter (`setCritiqueTheaterEnabled`), and the reducer-derived contract types. Everything else stays internal. |
28 
29## Invariants
30 
31- **Reducer is pure.** All state lives in `useReducer`; no `useState`
32 for run state inside the components. The reducer's actions are the
33 contract-level `PanelEvent` union plus the host-synthesized
34 `{ type: '__reset__' }`.
35- **Role-keyed tinting via `data-role`.** Components carry the role as
36 a data attribute; CSS picks the right hue via `color-mix` over an
37 existing semantic token (`var(--accent)`, `var(--amber)`,
38 `var(--purple)`, `var(--green)`, `var(--blue)`). No hex literals
39 inside this directory.
40- **All strings go through the i18n registry.** Every visible string is
41 a `t(...)` call against the `critiqueTheater.*` key namespace.
42 Hardcoded English will fail review; the locale alignment test
43 enforces every locale carries the same keyset.
44- **Terminal phases are sticky.** Once the reducer is in `shipped`,
45 `degraded`, `interrupted`, or `failed`, only a `run_started` for a
46 new runId or a host-dispatched `__reset__` can leave that phase.
47 Late `parser_warning` events are accepted because they are
48 informational, not lifecycle.
49- **Interrupt is double-action.** Click or Esc dispatches the
50 optimistic local `interrupted` action AND issues `POST
51 /api/projects/:id/critique/:runId/interrupt`. A failed fetch is
52 swallowed with a dev-mode warning so the UI still moves to the
53 collapsed badge.
54- **Designer weight is frozen at 0.0 until v2 cast config lands.**
55 Mirror of the same invariant in
56 [`apps/daemon/src/critique/AGENTS.md`](../../../../daemon/src/critique/AGENTS.md):
57 the v1 weight distribution (designer 0 / critic 0.4 / brand 0.2 /
58 a11y 0.2 / copy 0.2) is wire-shape, not a tuning knob. The web
59 side reflects that by treating composite weights as read-only:
60 `ScoreTicker` and `TheaterCollapsed` read `composite` straight off
61 the wire and never recompute it from per-panelist scores. V2
62 lands per-skill cast configuration as a Settings surface
63 (`apps/web/src/components/SettingsDialog.tsx`) that writes to the project's
64 settings row; the daemon resolver reads that row and feeds the
65 per-run weight map into the composite computation, so the web
66 layer continues to render whatever number the daemon produces. Do
67 not add a `weights` prop to any component in this directory and
68 do not recompute the composite client-side until the contracts
69 package carries the v2 cast type.
70 
71## When you change anything here
72 
731. Update `packages/contracts/src/critique.ts` first if the wire shape
74 changes. The web reducer keys off `PanelEvent`; the SSE manager
75 keys off `CRITIQUE_SSE_EVENT_NAMES`. Both live in that one file.
762. Add an i18n key to `apps/web/src/i18n/types.ts`, then define it in
77 all 19 files under `apps/web/src/i18n/locales/`. The locale files
78 carry complete dictionaries rather than inheriting missing keys from
79 English.
803. Run `pnpm --filter @open-design/web exec vitest run tests/components/Theater`
81 before pushing. The suite has 100+ cases pinning the reducer
82 shape, SSE validation, host lifecycle, and component renders.
834. Visual regression: run `pnpm --filter @open-design/e2e test:ui:extended`
84 with `--update-snapshots` after any CSS change in
85 `apps/web/src/styles/viewer/theater.css`'s `.theater-*` block.
86 
87## Related
88 
89- Spec: `specs/current/critique-theater.md`
90- Plan: `specs/current/critique-theater-plan.md`
91- User docs: `docs/critique-theater.md`
92- Daemon counterpart: `apps/daemon/src/critique/AGENTS.md`
93 

Commands it names

  • pnpm --filter @open-design/web exec vitest run tests/components/Theater
  • pnpm --filter @open-design/e2e test:ui:extended

Sections

  • `apps/web/src/components/Theater/` (Critique Theater, web side)
  • Layout
  • Invariants
  • When you change anything here
  • Related

What it covers

testarchitecturemonorepo

Stack — with the evidence

typescript

(1.00)

vitest

(0.95)

node

(0.70)

react

(0.70)

nextjs

(0.70)

astro

(0.70)

express

(0.70)

tailwind

(0.70)

playwright

(0.70)

aws

(0.70)

desktop-app

(0.70)

javascript

(0.60)

monorepo

(0.60)

pnpm

(0.60)

kubernetes

(0.60)

github-actions

(0.60)

vercel

(0.60)

Format

AGENTS.md

A plain-markdown README for coding agents, deliberately unopinionated: no frontmatter, no globs, no vendor keys. That minimalism is why it became the one file a dozen different agents will read, and why it carries the least per-file targeting power of any format here.

What the corpus says about it

Repository

Owner
nexu-io
Language
—
License
—
Archived
no

All configs in this repo

Also in nexu-io/open-design

Diff this repo’s formats

One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
nexu-io/open-designplugins/AGENTS.md · 83kAGENTS.mdtypescriptnode+15stylearchsecuritydo-not68/1003 days ago
nexu-io/open-design.github/AGENTS.md · 83kAGENTS.mdtypescriptmonorepo+15stylearchgitapi+383/1003 days ago
nexu-io/open-designAGENTS.md · 83kAGENTS.mdtypescriptnode+15setupteststylearch+974/1003 days ago
nexu-io/open-designapps/AGENTS.md · 83kAGENTS.mdtypescriptplaywright+15testarchmonorepo90/1003 days ago
nexu-io/open-designapps/daemon/AGENTS.md · 83kAGENTS.mdtypescriptvitest+15teststylearchtesting-strategy+486/1003 days ago
nexu-io/open-designapps/daemon/src/critique/AGENTS.md · 83kAGENTS.mdtypescriptnode+15archtesting-strategymonorepo52/1003 days ago
nexu-io/open-designapps/landing-page/AGENTS.md · 83kAGENTS.mdtypescriptastro+16apideploymentmonorepo82/1003 days ago
nexu-io/open-designapps/packaged/AGENTS.md · 83kAGENTS.mdtypescriptvitest+15monorepodo-not54/1003 days ago
nexu-io/open-designdesign-systems/_schema/AGENTS.md · 83kAGENTS.mdtypescriptnode+15archtesting-strategyapi58/1003 days ago
nexu-io/open-designdesign-templates/AGENTS.md · 83kAGENTS.mdtypescriptnode+15apiui43/1003 days ago
nexu-io/open-designe2e/AGENTS.md · 83kAGENTS.mdtypescriptvitest+15teststylearchtesting-strategy+393/1003 days ago
nexu-io/open-designpackages/AGENTS.md · 83kAGENTS.mdtypescriptnode+15archdependenciesmonorepo86/1003 days ago
nexu-io/open-designskills/AGENTS.md · 83kAGENTS.mdtypescriptnode+15no sections39/1003 days ago
nexu-io/open-designtools/AGENTS.md · 83kAGENTS.mdtypescriptplaywright+15testing-strategy82/1003 days ago
nexu-io/open-designtools/pack/AGENTS.md · 83kAGENTS.mdtypescriptvitest+16styletesting-strategyperformancedeployment+185/1003 days ago
nexu-io/open-designtools/serve/AGENTS.md · 83kAGENTS.mdtypescriptvitest+15do-not32/1003 days ago
Diff against plugins/AGENTS.md Diff against .github/AGENTS.md Diff against AGENTS.md Diff against apps/AGENTS.md Diff against apps/daemon/AGENTS.md Diff against apps/daemon/src/critique/AGENTS.md Diff against apps/landing-page/AGENTS.md Diff against apps/packaged/AGENTS.md Diff against design-systems/_schema/AGENTS.md Diff against design-templates/AGENTS.md Diff against e2e/AGENTS.md Diff against packages/AGENTS.md Diff against skills/AGENTS.md Diff against tools/AGENTS.md Diff against tools/pack/AGENTS.md Diff against tools/serve/AGENTS.md

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199kAGENTS.mdtypescriptlangchain+16buildteststylearch+3100/1003 days ago
TryGhost/Ghoste2e/AGENTS.md · 55kAGENTS.mdtypescriptjavascript+12setupteststylearch+2100/1003 days ago
SkeneTechnologies/skene-cookbookAGENTS.md · 51AGENTS.mdpythoneslint+4setupbuildtestlint-format+7100/1002 days ago
mui/material-uiAGENTS.md · 99kAGENTS.mdtypescriptjavascript+13setupbuildtestlint-format+9100/1003 days ago
aaif-goose/gooseAGENTS.md · 52kAGENTS.mdrusttypescript+2setupbuildtestlint-format+6100/1003 days ago
duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70AGENTS.mdtypescriptjavascript+5buildteststylearch+3100/1003 days ago
trick77/agents-md-syncAGENTS.md · 2AGENTS.mdtypescriptnode+4setupbuildteststyle+5100/1003 days ago
code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67kAGENTS.mdtypescriptbun+10setupbuildtestlint-format+6100/1002 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack