AGENTS.md
apps/daemon/src/critique/AGENTS.mdAGENTS.md
Quality
52/100
Scores the file, not the repository.Length
735 words
5 headings · 0 code blocksRepository
83k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# `apps/daemon/src/critique/` (Critique Theater, daemon side)23Module map agents enter when they need to change anything in the critique4pipeline. The user-facing feature name is **Design Jury**; the directory5keeps the **Critique Theater** internal name so the product label can move6without churning code paths.78## Layout910| File | Responsibility |11|---|---|12| `config.ts` | `CritiqueConfig` defaults + `OD_CRITIQUE_*` env-var parsing. The single source of truth for thresholds, weights, max-rounds, timeouts. |13| `orchestrator.ts` | The state machine. Spawns a CLI session, feeds the panelist prompts in order, awaits each round's SHIP / round_end, and decides whether to continue or terminate. |14| `parser.ts` + `parsers/v1.ts` | Streaming parser that ingests the agent's stdout and yields `PanelEvent`s. Owns the `<CRITIQUE_RUN>`, `<PANELIST>`, `<SHIP>` envelope. |15| `errors.ts` | Typed parser failures: `MalformedBlockError`, `OversizeBlockError`, `MissingArtifactError`. Each maps to a `DegradedReason` so the wire-level `critique.degraded` event carries the right tag. |16| `persistence.ts` | SQLite writes for run rows and per-round summaries (`critique_runs`, `critique_rounds`). |17| `artifact-writer.ts` | Disk persistence for the SHIP artifact body. Owns the byte-budget guard (`ArtifactTooLargeError`) and the `O_NOFOLLOW` path-traversal protections. |18| `artifact-handler.ts` | HTTP read path: `GET /api/projects/:id/critique/:runId/artifact`. |19| `interrupt-handler.ts` | Resolves the kill request from `POST /api/projects/:id/critique/:runId/interrupt`. |20| `adapter-degraded.ts` | In-memory degraded-adapter registry with 24h TTL. The orchestrator + Settings UI consult `isDegraded(adapterId)` before routing a run to it. |21| `conformance.ts` | Conformance harness entry point. The prerelease cycle calls `runAdapterConformance` per adapter × per brief template and tallies `shipped / degraded / failed`. |22| `conformance-history.ts` | Reads and summarizes persisted conformance history used by rollout decisions. |23| `ratchet.ts` + `rollout.ts` | Evaluate conformance evidence and resolve the current feature rollout tier. |24| `run-registry.ts` | Project-keyed in-process run registry used by interrupt handling. |25| `scoreboard.ts` | Aggregates per-adapter conformance outcomes for the status surfaces. |26| `spawn-inputs.ts` | Builds the isolated prompt and filesystem inputs passed to critique subprocesses. |27| `transcript.ts` | Persists and reads replayable critique event transcripts. |28| `__fixtures__/v1/` | Canonical transcripts the parser tests + conformance harness consume (happy-3-rounds, malformed-unbalanced, missing-artifact, etc.). |29| `__fixtures__/adapters/` | Synthetic adapter stubs that emit the v1 fixtures. The conformance harness wraps them in `AsyncIterable<string>` so the parser path is exercised end-to-end without a real model. |3031## Invariants3233- **Parser yields one `PanelEvent` at a time** via async generator. The34 orchestrator drives the loop; nothing in this directory collects events35 into an array eagerly.36- **Terminal phases (`shipped`, `degraded`, `interrupted`, `failed`) are37 emitted exactly once** per run. The reducer treats them as sticky;38 duplicate ship events trip `duplicate_ship` in `parser_warning`.39- **Artifact bytes never travel on the wire.** The SHIP event carries an40 `artifactRef: { projectId, artifactId }` only; the byte body is written41 by `artifact-writer.ts` and fetched via the HTTP route.42- **Round bookkeeping is keyed by round number**, not by "always the43 last." A stray late panelist event from round 1 must NOT corrupt44 round 2's bucket. See `withRound` in the web reducer for the parallel.45- **No `apps/daemon/src/agents/registry.ts`.** The plan refers to that46 path historically; the actual adapter registry is `runtimes/registry.ts`47 in this repo. Phase 10 routing extensions land here in48 `adapter-degraded.ts` instead.49- **Designer weight is frozen at 0.0 until v2 cast config lands.**50 `config.ts` exposes the panel weights as `CritiqueConfig.weights`51 but every production deployment uses the v1 distribution52 (designer 0 / critic 0.4 / brand 0.2 / a11y 0.2 / copy 0.2). The53 v2 work is cross-package: the daemon adds per-skill weight54 overrides driven off `od.critique.cast` in `SKILL.md` frontmatter55 (this directory) and the web Settings surface adds a per-project56 weight editor (`apps/web/src/components/SettingsDialog.tsx`). Treat the v157 weights as a wire-shape invariant rather than a tuning knob;58 changing them mid-v1 will break the `composite` numbers persisted59 in `critique_runs`.6061## When you change anything here62631. The contracts in `packages/contracts/src/critique.ts` are the single64 source of truth for `PanelEvent`, `DegradedReason`, `FailedCause`,65 `ParserWarningKind`. Update them before changing this directory.662. The parser is the natural place to enforce schema strictness; do not67 loosen it under pressure. The web `sseToPanelEvent` already runs a68 defence-in-depth variant validator.693. Add a v1 fixture under `__fixtures__/v1/` for every new failure70 shape, and a corresponding conformance test case.714. Bump `CRITIQUE_PROTOCOL_VERSION` in the contracts when the wire72 shape changes. Adapter conformance auto-marks `degraded` on73 protocol-version mismatch, so this is load-bearing.7475## Related7677- Spec: `specs/current/critique-theater.md`78- Plan: `specs/current/critique-theater-plan.md`79- User docs: `docs/critique-theater.md`80- Web counterpart: `apps/web/src/components/Theater/AGENTS.md`81
Also in nexu-io/open-design
Diff this repo’s formatsOne 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?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| nexu-io/open-designplugins/AGENTS.md · 83k | AGENTS.md | stylearchsecuritydo-not | 68/100 | 3 days ago | |
| nexu-io/open-design.github/AGENTS.md · 83k | AGENTS.md | stylearchgitapi+3 | 83/100 | 3 days ago | |
| nexu-io/open-designAGENTS.md · 83k | AGENTS.md | setupteststylearch+9 | 74/100 | 3 days ago | |
| nexu-io/open-designapps/AGENTS.md · 83k | AGENTS.md | testarchmonorepo | 90/100 | 3 days ago | |
| nexu-io/open-designapps/daemon/AGENTS.md · 83k | AGENTS.md | teststylearchtesting-strategy+4 | 86/100 | 3 days ago | |
| nexu-io/open-designapps/landing-page/AGENTS.md · 83k | AGENTS.md | apideploymentmonorepo | 82/100 | 3 days ago | |
| nexu-io/open-designapps/packaged/AGENTS.md · 83k | AGENTS.md | monorepodo-not | 54/100 | 3 days ago | |
| nexu-io/open-designapps/web/src/components/Theater/AGENTS.md · 83k | AGENTS.md | testarchmonorepo | 72/100 | 3 days ago | |
| nexu-io/open-designdesign-systems/_schema/AGENTS.md · 83k | AGENTS.md | archtesting-strategyapi | 58/100 | 3 days ago | |
| nexu-io/open-designdesign-templates/AGENTS.md · 83k | AGENTS.md | apiui | 43/100 | 3 days ago | |
| nexu-io/open-designe2e/AGENTS.md · 83k | AGENTS.md | teststylearchtesting-strategy+3 | 93/100 | 3 days ago | |
| nexu-io/open-designpackages/AGENTS.md · 83k | AGENTS.md | archdependenciesmonorepo | 86/100 | 3 days ago | |
| nexu-io/open-designskills/AGENTS.md · 83k | AGENTS.md | no sections | 39/100 | 3 days ago | |
| nexu-io/open-designtools/AGENTS.md · 83k | AGENTS.md | testing-strategy | 82/100 | 3 days ago | |
| nexu-io/open-designtools/pack/AGENTS.md · 83k | AGENTS.md | styletesting-strategyperformancedeployment+1 | 85/100 | 3 days ago | |
| nexu-io/open-designtools/serve/AGENTS.md · 83k | AGENTS.md | do-not | 32/100 | 3 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/landing-page/AGENTS.md Diff against apps/packaged/AGENTS.md Diff against apps/web/src/components/Theater/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.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| aaif-goose/gooseAGENTS.md · 52k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | 3 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 199k | AGENTS.md | buildteststylearch+3 | 100/100 | 3 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| SkeneTechnologies/skene-cookbookAGENTS.md · 51 | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 2 days ago | |
| trick77/agents-md-syncAGENTS.md · 2 | AGENTS.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 67k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 2 days ago |
