@adia-ai/adia-ui-forge 0.1.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +3 -6
- package/CHANGELOG.md +27 -26
- package/README.md +35 -40
- package/agents/a2ui-engineer.md +26 -0
- package/agents/component-author.md +29 -0
- package/agents/framework-verifier.md +26 -0
- package/agents/release-engineer.md +25 -0
- package/agents/routing-corpus.json +318 -0
- package/bin/demo-postwrite-pattern-gate +94 -0
- package/bin/forge-lint +17 -2
- package/bin/sidecar-prewrite-guard +104 -0
- package/commands/deploy.md +9 -0
- package/commands/dogfood.md +10 -0
- package/commands/gen-review.md +9 -0
- package/commands/release.md +10 -0
- package/hooks/hooks.json +15 -0
- package/package.json +3 -5
- package/references/contracts/a2ui-mcp-surface.md +35 -0
- package/references/contracts/migration-guide-format.md +34 -0
- package/references/shared/content-trust.md +19 -74
- package/skills/adia-a2ui/SKILL.md +99 -0
- package/skills/{adia-ui-a2ui → adia-a2ui}/evals/routing-corpus.json +10 -10
- package/skills/adia-a2ui/references/anti-patterns.md +27 -0
- package/skills/adia-a2ui/references/chunk-authoring.md +71 -0
- package/skills/adia-a2ui/references/corpus-discipline.md +68 -0
- package/skills/adia-a2ui/references/eval-diagnostics.md +86 -0
- package/skills/adia-a2ui/references/format-extension-decisions.md +66 -0
- package/skills/adia-a2ui/references/leverage-rules.md +52 -0
- package/skills/adia-a2ui/references/mcp-pipeline-ops.md +83 -0
- package/skills/adia-a2ui/references/mcp-tool-reference.md +59 -0
- package/skills/adia-a2ui/references/pipeline-overview.md +115 -0
- package/skills/adia-a2ui/references/semantic-fail-lifting.md +74 -0
- package/skills/adia-a2ui/references/strategy-engines.md +109 -0
- package/skills/adia-a2ui/references/zettel-calibration.md +104 -0
- package/skills/adia-author/SKILL.md +112 -0
- package/skills/adia-author/evals/routing-corpus.json +222 -0
- package/skills/{adia-ui-authoring → adia-author}/references/anti-patterns.md +33 -4
- package/skills/{adia-ui-authoring → adia-author}/references/authoring-cycle.md +9 -11
- package/skills/adia-author/references/canonical-pattern-index.md +243 -0
- package/skills/{adia-ui-authoring → adia-author}/references/code-style.md +19 -21
- package/skills/adia-author/references/common-gotchas.md +129 -0
- package/skills/adia-author/references/composite-demo-protocol.md +271 -0
- package/skills/{adia-ui-authoring → adia-author}/references/css-patterns.md +19 -6
- package/skills/{adia-ui-authoring → adia-author}/references/lifecycle-patterns.md +1 -0
- package/skills/{adia-ui-authoring → adia-author}/references/llm-bridge.md +3 -5
- package/skills/{adia-ui-authoring → adia-author}/references/module-promotion.md +22 -40
- package/skills/{adia-ui-authoring → adia-author}/references/primitive-audit.md +2 -4
- package/skills/{adia-ui-authoring → adia-author}/references/shell-patterns.md +12 -18
- package/skills/{adia-ui-authoring → adia-author}/references/token-contract.md +5 -7
- package/skills/{adia-ui-authoring → adia-author}/references/worked-example.md +3 -3
- package/skills/{adia-ui-authoring → adia-author}/references/yaml-contract.md +3 -3
- package/skills/{adia-ui-authoring → adia-author}/scripts/build-canonical-pattern-index.mjs +3 -3
- package/skills/adia-deploy/SKILL.md +128 -0
- package/skills/adia-deploy/references/deploy-playbooks.md +276 -0
- package/skills/adia-dogfood/SKILL.md +124 -0
- package/skills/adia-dogfood/references/admin-shell-anatomy.md +77 -0
- package/skills/adia-dogfood/references/app-shell-pitfalls.md +66 -0
- package/skills/adia-dogfood/references/card-anatomy-sweep.md +66 -0
- package/skills/adia-dogfood/references/html-attr-sweep.md +63 -0
- package/skills/adia-dogfood/references/native-leak-annotations.md +73 -0
- package/skills/adia-dogfood/references/visual-probe-triage.md +80 -0
- package/skills/{adia-ui-dogfood → adia-dogfood}/scripts/analyze.mjs +30 -14
- package/skills/adia-gen-review/SKILL.md +127 -0
- package/skills/adia-gen-review/references/corpus-html-patterns.md +279 -0
- package/skills/adia-gen-review/references/loop-protocol.md +216 -0
- package/skills/adia-gen-review/references/rubric-cosmetic.md +100 -0
- package/skills/adia-gen-review/references/rubric-decompose.md +101 -0
- package/skills/adia-gen-review/references/rubric-score.md +214 -0
- package/skills/{adia-ui-gen-review → adia-gen-review}/references/scores.schema.json +2 -2
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-coverage-audit.mjs +4 -4
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-decompose.mjs +10 -6
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/gen-review-status.mjs +5 -5
- package/skills/{adia-ui-gen-review → adia-gen-review}/scripts/validate-cycle-scores.mjs +5 -5
- package/skills/adia-llm-internals/SKILL.md +77 -0
- package/skills/{adia-ui-llm → adia-llm-internals}/references/adapter-contract.md +4 -2
- package/skills/{adia-ui-llm → adia-llm-internals}/references/add-a-provider.md +4 -5
- package/skills/{adia-ui-llm → adia-llm-internals}/references/bridge-facade.md +10 -3
- package/skills/{adia-ui-llm → adia-llm-internals}/references/browser-proxy-boundary.md +1 -1
- package/skills/{adia-ui-llm → adia-llm-internals}/references/model-registry.md +5 -3
- package/skills/{adia-ui-llm → adia-llm-internals}/references/streaming-sse.md +2 -2
- package/skills/adia-release/SKILL.md +72 -0
- package/skills/adia-release/references/changelog-discipline.md +119 -0
- package/skills/adia-release/references/cut-procedure.md +247 -0
- package/skills/adia-release/references/gates-catalog.md +222 -0
- package/skills/adia-release/references/independent-package-release.md +52 -0
- package/skills/adia-release/references/migration-guide-authoring.md +86 -0
- package/skills/adia-release/references/notes-authoring.md +90 -0
- package/skills/adia-release/references/recovery-paths.md +106 -0
- package/skills/{adia-ui-release → adia-release}/scripts/bump.mjs +27 -2
- package/skills/{adia-ui-release → adia-release}/scripts/dispatch-publish.mjs +72 -6
- package/skills/{adia-ui-release → adia-release}/scripts/insert-stub.mjs +6 -4
- package/skills/adia-release/scripts/package-paths.mjs +50 -0
- package/skills/{adia-ui-release → adia-release}/scripts/promote-unreleased.mjs +4 -3
- package/skills/{adia-ui-release → adia-release}/scripts/release-pack.mjs +48 -27
- package/skills/{adia-ui-release → adia-release}/scripts/tag-lockstep.mjs +15 -3
- package/skills/adia-site-docs/SKILL.md +68 -0
- package/skills/adia-site-docs/evals/audit-report.md +30 -0
- package/skills/adia-site-docs/evals/routing-corpus.json +176 -0
- package/skills/adia-site-docs/intent.md +72 -0
- package/bin/lib/audit-axes.mjs +0 -555
- package/bin/lib/dry-run-irreversible.mjs +0 -236
- package/bin/lib/run-skill-evals.mjs +0 -487
- package/bin/lib/teach-router.mjs +0 -250
- package/commands/adia-forge-a2ui.md +0 -10
- package/commands/adia-forge-author.md +0 -10
- package/commands/adia-forge-dogfood.md +0 -8
- package/commands/adia-forge-llm.md +0 -8
- package/commands/adia-forge-orient.md +0 -10
- package/commands/adia-forge-release.md +0 -8
- package/commands/adia-forge-review.md +0 -10
- package/references/shared/pev-rationale.md +0 -64
- package/references/shared/skill-conventions.md +0 -133
- package/skills/adia-ui-a2ui/CHANGELOG.md +0 -32
- package/skills/adia-ui-a2ui/SKILL.md +0 -243
- package/skills/adia-ui-a2ui/evals/adversarial-corpus.json +0 -75
- package/skills/adia-ui-a2ui/evals/teach-routing-cases.json +0 -100
- package/skills/adia-ui-a2ui/references/anti-patterns.md +0 -24
- package/skills/adia-ui-a2ui/references/chunk-authoring.md +0 -88
- package/skills/adia-ui-a2ui/references/corpus-discipline.md +0 -56
- package/skills/adia-ui-a2ui/references/eval-diagnostics.md +0 -127
- package/skills/adia-ui-a2ui/references/fragment-graph.md +0 -91
- package/skills/adia-ui-a2ui/references/mcp-pipeline-ops.md +0 -106
- package/skills/adia-ui-a2ui/references/mcp-tool-reference.md +0 -398
- package/skills/adia-ui-a2ui/references/pipeline-overview.md +0 -175
- package/skills/adia-ui-a2ui/references/semantic-fail-lifting.md +0 -120
- package/skills/adia-ui-a2ui/references/strategy-engines.md +0 -111
- package/skills/adia-ui-a2ui/references/teach-protocol.md +0 -220
- package/skills/adia-ui-a2ui/references/zettel-calibration.md +0 -93
- package/skills/adia-ui-a2ui/scripts/audit-a2ui-roster.mjs +0 -96
- package/skills/adia-ui-a2ui/scripts/teach-route.mjs +0 -157
- package/skills/adia-ui-a2ui/skill.json +0 -38
- package/skills/adia-ui-authoring/CHANGELOG.md +0 -32
- package/skills/adia-ui-authoring/SKILL.md +0 -256
- package/skills/adia-ui-authoring/assets/case-studies/admin-shell-decomposition.md +0 -101
- package/skills/adia-ui-authoring/assets/case-studies/maxtokens-32768-discovery.md +0 -109
- package/skills/adia-ui-authoring/assets/case-studies/theme-panel-promotion.md +0 -113
- package/skills/adia-ui-authoring/evals/adversarial-design-plan-gates.json +0 -138
- package/skills/adia-ui-authoring/evals/routing-corpus.json +0 -245
- package/skills/adia-ui-authoring/references/canonical-pattern-index.md +0 -179
- package/skills/adia-ui-authoring/references/common-gotchas.md +0 -93
- package/skills/adia-ui-authoring/references/composite-demo-protocol.md +0 -1084
- package/skills/adia-ui-authoring/references/teach-protocol.md +0 -428
- package/skills/adia-ui-authoring/scripts/audit-authoring-roster.mjs +0 -148
- package/skills/adia-ui-authoring/skill.json +0 -45
- package/skills/adia-ui-dogfood/CHANGELOG.md +0 -17
- package/skills/adia-ui-dogfood/README.md +0 -62
- package/skills/adia-ui-dogfood/SKILL.md +0 -866
- package/skills/adia-ui-dogfood/skill.json +0 -40
- package/skills/adia-ui-forge/SKILL.md +0 -88
- package/skills/adia-ui-forge/evals/routing-corpus.json +0 -30
- package/skills/adia-ui-gen-review/CHANGELOG.md +0 -108
- package/skills/adia-ui-gen-review/SKILL.md +0 -266
- package/skills/adia-ui-gen-review/references/loop-protocol.md +0 -712
- package/skills/adia-ui-gen-review/references/rubric-cosmetic.md +0 -144
- package/skills/adia-ui-gen-review/references/rubric-decompose.md +0 -117
- package/skills/adia-ui-gen-review/references/rubric-score.md +0 -249
- package/skills/adia-ui-gen-review/references/teach-protocol.md +0 -214
- package/skills/adia-ui-gen-review/skill.json +0 -22
- package/skills/adia-ui-llm/CHANGELOG.md +0 -25
- package/skills/adia-ui-llm/SKILL.md +0 -165
- package/skills/adia-ui-llm/evals/adversarial-corpus.json +0 -75
- package/skills/adia-ui-llm/evals/routing-corpus.json +0 -30
- package/skills/adia-ui-llm/evals/teach-routing-cases.json +0 -73
- package/skills/adia-ui-llm/references/teach-protocol.md +0 -78
- package/skills/adia-ui-llm/scripts/audit-llm-roster.mjs +0 -93
- package/skills/adia-ui-llm/scripts/teach-route.mjs +0 -119
- package/skills/adia-ui-llm/skill.json +0 -33
- package/skills/adia-ui-release/CHANGELOG.md +0 -23
- package/skills/adia-ui-release/SKILL.md +0 -295
- package/skills/adia-ui-release/assets/case-studies/2026-05-20-batch-push-v0.6.14-v0.6.15.md +0 -144
- package/skills/adia-ui-release/assets/case-studies/2026-05-20-corpus-drift-remediation-v0.6.15.md +0 -155
- package/skills/adia-ui-release/assets/case-studies/2026-05-20-version-skip-correction-v0.6.12.md +0 -114
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-author-from-scratch-v0.6.18.md +0 -139
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-feedback37-retraction-v0.6.21.md +0 -124
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-fn1-enrichment-pass-v0.6.19.md +0 -125
- package/skills/adia-ui-release/assets/case-studies/2026-05-21-stale-test-detection-v0.6.20.md +0 -142
- package/skills/adia-ui-release/assets/case-studies/2026-05-23-freshness-gate-recovery-v0.6.32.md +0 -97
- package/skills/adia-ui-release/assets/case-studies/2026-05-26-catalog-drift-recurring-v0.6.40.md +0 -147
- package/skills/adia-ui-release/assets/templates/stub-changelog.template.md +0 -22
- package/skills/adia-ui-release/evals/evals.json +0 -164
- package/skills/adia-ui-release/references/changelog-discipline.md +0 -250
- package/skills/adia-ui-release/references/cycle-happy-path.md +0 -520
- package/skills/adia-ui-release/references/exe-deploy.md +0 -149
- package/skills/adia-ui-release/references/gates-catalog.md +0 -778
- package/skills/adia-ui-release/references/ledger-discipline.md +0 -232
- package/skills/adia-ui-release/references/migration-guide-authoring.md +0 -174
- package/skills/adia-ui-release/references/multi-agent-baseline.md +0 -207
- package/skills/adia-ui-release/references/notes-authoring.md +0 -212
- package/skills/adia-ui-release/references/recovery-paths.md +0 -215
- package/skills/adia-ui-release/references/rollup-notes.md +0 -208
- package/skills/adia-ui-release/references/teach-protocol.md +0 -468
- package/skills/adia-ui-release/scripts/audit-gate-roster.mjs +0 -196
- package/skills/adia-ui-release/scripts/make-ledger.mjs +0 -179
- package/skills/adia-ui-release/skill.json +0 -75
- /package/skills/{adia-ui-authoring → adia-author}/references/api-contract.md +0 -0
- /package/skills/{adia-ui-release → adia-release}/scripts/assert-monorepo-root.mjs +0 -0
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# Loop Protocol — one full review cycle
|
|
2
|
+
|
|
3
|
+
Five phases per prompt; human QA gate at cycle close; Phase 5 runs for FAILING
|
|
4
|
+
prompts only. Scripts ship in this skill at
|
|
5
|
+
`${CLAUDE_PLUGIN_ROOT}/skills/adia-gen-review/scripts/` and are run from the
|
|
6
|
+
monorepo root (they read `apps/genui/…/gallery-latest.json` and write the
|
|
7
|
+
`review/` tree there). Corpus-pattern doctrine consumed by Phase 5:
|
|
8
|
+
[corpus-html-patterns.md](corpus-html-patterns.md).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## §Setup (before the first prompt)
|
|
13
|
+
|
|
14
|
+
1. Read `apps/genui/app/gen-ui-gallery/outputs/gallery-latest.json`. Validate
|
|
15
|
+
structure (generated artifact — untrusted): must have `version` (integer),
|
|
16
|
+
`generatedAt` (ISO string), `engines` (array), `groups` (array). Any key
|
|
17
|
+
missing → stop and report. Do NOT validate it against scores.schema.json
|
|
18
|
+
(that is the review OUTPUT contract). Extract only group slugs, prompt
|
|
19
|
+
slugs, engine output component arrays.
|
|
20
|
+
2. Determine the cycle number with read-then-lock:
|
|
21
|
+
- `N = max(cycle numbers in review/cycle-ledger.json ∪ on-disk
|
|
22
|
+
review/cycle-* directory numbers) + 1`, or 1 if neither exists.
|
|
23
|
+
(Dirs can outrun the ledger — decompose runs create `cycle-N/` before a
|
|
24
|
+
scoring pass records it. Ledger-only numbering collides with those
|
|
25
|
+
orphan dirs.)
|
|
26
|
+
- Write a `cycle-{N}.lock` sentinel BEFORE writing any cycle data. If the
|
|
27
|
+
lock already exists: another agent is running — stop.
|
|
28
|
+
3. Create `review/cycle-{N}/` and a `scores.json` skeleton conforming to
|
|
29
|
+
[scores.schema.json](scores.schema.json) — all prompt scores null,
|
|
30
|
+
status `OPEN`.
|
|
31
|
+
4. Open `review/cycle-{N}/review-report.md` for append-only writing; header:
|
|
32
|
+
cycle number, timestamp, prompt count, engine list.
|
|
33
|
+
5. Confirm the dev server responds (Playwright needs it). Do not boot a
|
|
34
|
+
background server — the operator runs it (see §ManualHandoff).
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## §Phase 1 — Ideal-Output Specification (A data)
|
|
39
|
+
|
|
40
|
+
Delegate to **`adia-author`** per prompt:
|
|
41
|
+
|
|
42
|
+
> "Compose the ideal AdiaUI UI for: '{prompt text}'. Output: (1) user intent +
|
|
43
|
+
> primary task + states, (2) ASCII DOM wireframe, (3) slot vocabulary table,
|
|
44
|
+
> (4) key prop/attr table."
|
|
45
|
+
|
|
46
|
+
Binary success check — the spec itself is not scored:
|
|
47
|
+
|
|
48
|
+
- Structured spec returned → `specProduced: true`, proceed.
|
|
49
|
+
- Error/empty/off-topic → `specProduced: false`, `status: FAILING` with cause
|
|
50
|
+
`FREE_FORM_HALLUC`, skip Phases 2–5 for this prompt, log in review-report.md.
|
|
51
|
+
|
|
52
|
+
Capture as A-data: `spec.rootComponent`, `spec.layoutPrimitive`,
|
|
53
|
+
`spec.keyComponents` (DOM order), `spec.slotVocabulary`
|
|
54
|
+
(`{parent, slot, child}` triples), `spec.states`, `spec.wireframe` (stored as
|
|
55
|
+
string, not interpreted).
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## §Phase 2 — Canvas Decomposition (B data)
|
|
60
|
+
|
|
61
|
+
Mechanized end-to-end by the decompose script — screenshots, DOM walk,
|
|
62
|
+
primitive lookup (`TAG_TO_COMPONENT`, the authoritative table), attr
|
|
63
|
+
sanitization, overflow gate:
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
node ${CLAUDE_PLUGIN_ROOT}/skills/adia-gen-review/scripts/gen-review-decompose.mjs
|
|
67
|
+
--cycle N [--group <slug>] [--prompt <slug>] [--port 5300] [--settle 2500] [--dry-run]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Outputs per prompt under `review/cycle-N/`: `screenshots/<slug>.png`,
|
|
71
|
+
`raw-dom/<slug>.json` (internal only), `decomposed/<slug>.json` — the
|
|
72
|
+
trust-boundary file:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"promptSlug": "auth-login-form",
|
|
77
|
+
"renderFailure": false,
|
|
78
|
+
"rootComponent": "Card",
|
|
79
|
+
"layoutPrimitive": "Column",
|
|
80
|
+
"components": ["Card", "NativeHeader", "NativeSection", "Column", "Field", "Input", "Button"],
|
|
81
|
+
"slotPositions": [{ "parent": "Card", "slot": "header", "child": "NativeHeader" }],
|
|
82
|
+
"attrs": { "Button": { "variant": "primary", "text": "Sign in" } },
|
|
83
|
+
"unknownElements": [],
|
|
84
|
+
"overflowElements": [],
|
|
85
|
+
"screenshotPath": "review/cycle-N/screenshots/auth-login-form.png"
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Only allowlisted attrs survive (`ATTR_ALLOWLIST` in the script); `data-*`,
|
|
90
|
+
`aria-*`, and raw text nodes are discarded. Assess decomposition quality with
|
|
91
|
+
[rubric-decompose.md](rubric-decompose.md).
|
|
92
|
+
|
|
93
|
+
**Overflow gate (mechanical, visual lane).** The script checks text-bearing
|
|
94
|
+
elements for `scrollWidth/Height > clientWidth/Height` under computed
|
|
95
|
+
`overflow: hidden`; hits land in `overflowElements`. Each entry auto-promotes
|
|
96
|
+
to a P1 in Phase 4. This lane is independent of Phase 3: score 93 with
|
|
97
|
+
overflow is still FAILING.
|
|
98
|
+
|
|
99
|
+
**RENDER_FAILURE protocol.** Canvas height < 50px OR empty `components`:
|
|
100
|
+
`renderFailure: true`, `status: RENDER_FAILURE` in scores.json, skip Phases
|
|
101
|
+
3–5, log in review-report.md, count toward `aggregate.renderFailureCount`.
|
|
102
|
+
RENDER_FAILURE does not block cycle close; the same prompt failing 3+ cycles
|
|
103
|
+
escalates to the operator as a pipeline bug.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## §Phase 3 — A-vs-B Gap Scoring
|
|
108
|
+
|
|
109
|
+
Rubric: [rubric-score.md](rubric-score.md). Inputs: `spec.*` (A) + the
|
|
110
|
+
decomposed file (B) — never the raw DOM. Before scoring, run the rubric's
|
|
111
|
+
§DomainMismatchCheck. Score D1–D5 (0–20 each) + D6 (mechanical root-component
|
|
112
|
+
match, 0 or +5; max 105). Record `rubricScore.score`, `rubricScore.delta` vs
|
|
113
|
+
prior cycle, dimension breakdown, and cause codes per gap.
|
|
114
|
+
|
|
115
|
+
**Regression block**: any prompt with `rubricScore.delta < -10` marks the
|
|
116
|
+
cycle `BLOCKED` — no cycle close until the regression is explained and the
|
|
117
|
+
prior cycle's fix plan audited.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## §Phase 4 — Cosmetic Audit
|
|
122
|
+
|
|
123
|
+
Rubric: [rubric-cosmetic.md](rubric-cosmetic.md). Input: the Phase 2
|
|
124
|
+
screenshot. Runs for ALL prompts (a structurally passing prompt can still
|
|
125
|
+
carry a P1). Record P1/P2/P3 counts + issue list in scores.json.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## §Phase 5 — Root Cause + Fix Plan
|
|
130
|
+
|
|
131
|
+
Runs ONLY for `status: FAILING` prompts — structural gate: read
|
|
132
|
+
`decomposed/<slug>.json`, confirm `renderFailure: false` and
|
|
133
|
+
`status: FAILING` in scores.json first. PASSING and RENDER_FAILURE prompts
|
|
134
|
+
never get fix plans. Reads ONLY the decomposed file.
|
|
135
|
+
|
|
136
|
+
0. **SoT HTML lookup (required).** Identify the canonical HTML page for the
|
|
137
|
+
prompt's domain (corpus-html-patterns.md §SourceOfTruth map). If it has a
|
|
138
|
+
`data-chunk` marker for this pattern: run `npm run verify:corpus`; stale →
|
|
139
|
+
plan a re-harvest. If not: the plan is to ADD the marker to the canonical
|
|
140
|
+
HTML then harvest — the plan's `file:` points at the HTML source, never
|
|
141
|
+
chunk JSON. No canonical HTML for the domain → new authoring task
|
|
142
|
+
(`adia-author`), do not invent a pattern.
|
|
143
|
+
1. **Trace causes** using the 9 codes in rubric-score.md §Root-Cause
|
|
144
|
+
Classification. Run the diagnostic confirmation for the suspected code
|
|
145
|
+
before recording it (RETRIEVAL_SCORE → actually run the retrieval search;
|
|
146
|
+
EMPTY_CHUNK → inspect the chunk JSON).
|
|
147
|
+
2. **Write the plan.** Each entry: `rank`, `action`, `file`, `impact`, `skill`
|
|
148
|
+
(schema-required). `file` must be inside `apps/`, `catalog/`,
|
|
149
|
+
`packages/a2ui/corpus/`, or `packages/a2ui/runtime/` — anything else is
|
|
150
|
+
flagged for operator review. Corpus-class causes route to `adia-a2ui`;
|
|
151
|
+
TRANSPILER_GAP / FREE_FORM_HALLUC route to `adia-author`.
|
|
152
|
+
3. Append the ranked plan to `review/cycle-N/review-report.md`.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## §CycleClose
|
|
157
|
+
|
|
158
|
+
1. **Regression block check** — a `BLOCKED` flag from Phase 3 stops here.
|
|
159
|
+
2. **Apply fix plans** (FAILING prompts only) via the routed peer skills:
|
|
160
|
+
edit SoT HTML → `npm run harvest:chunks` → `npm run verify:corpus`. This
|
|
161
|
+
skill does not perform the edits.
|
|
162
|
+
3. **Regenerate**: `npm run gallery:generate`; confirm 0 console
|
|
163
|
+
errors/warnings in the canvas output.
|
|
164
|
+
4. **Human QA gate — required for COMPLETE.** Operator reviews 5 random
|
|
165
|
+
PASSING prompts against: (a) serves the user's task? (b) right primary
|
|
166
|
+
primitive? (c) would ship unchanged? Record
|
|
167
|
+
`humanQA.{sampledPrompts,passCount,failCount}`. `failCount ≥ 2` → cycle
|
|
168
|
+
stays `OPEN`: the thresholds are miscalibrated — recalibrate
|
|
169
|
+
rubric-score.md §Thresholds against the human judgments.
|
|
170
|
+
5. **Schema gate** (must exit 0 before touching the ledger):
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
node ${CLAUDE_PLUGIN_ROOT}/skills/adia-gen-review/scripts/validate-cycle-scores.mjs --cycle N --strict
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
6. **Update ledger** (`review/cycle-ledger.json`): `cycleNumber`,
|
|
177
|
+
`completedAt`, `engine`, `status`, `aggregate`
|
|
178
|
+
(passingCount/failingCount/renderFailureCount/meanScore/Δ), `humanQA`.
|
|
179
|
+
Remove the `cycle-{N}.lock` sentinel.
|
|
180
|
+
7. **Exit condition**:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
node ${CLAUDE_PLUGIN_ROOT}/skills/adia-gen-review/scripts/gen-review-status.mjs --check-exit
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Exit 0 → `status: COMPLETE`; exit 1 → `status: OPEN` (the script lists the
|
|
187
|
+
blockers). Δ = 0 for every prompt across a full cycle → escalate to the
|
|
188
|
+
operator: the causes need substrate changes beyond corpus patching.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## §ManualHandoff — human-executed steps per cycle
|
|
193
|
+
|
|
194
|
+
`gallery:generate` and the decompose script need a running dev server, which
|
|
195
|
+
the agent must not boot in the background. Per cycle the operator runs:
|
|
196
|
+
|
|
197
|
+
```text
|
|
198
|
+
[Agent: Phases 1–5, fix plans] → HUMAN: apply data-chunk edits (via adia-a2ui plans)
|
|
199
|
+
→ HUMAN: npm run harvest:chunks
|
|
200
|
+
→ HUMAN: npm run gallery:generate
|
|
201
|
+
→ HUMAN: node <plugin>/skills/adia-gen-review/scripts/gen-review-decompose.mjs --cycle N
|
|
202
|
+
→ [Agent: re-score Phases 3–5]
|
|
203
|
+
→ HUMAN: npm run eval:diff -- --engine <engine> ← corpus changes must hold the eval floors
|
|
204
|
+
→ [Agent: scores.json + ledger + schema gate + exit check]
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## §Modes
|
|
210
|
+
|
|
211
|
+
**Single prompt** (diagnostic): same phases for the named prompt only; skip
|
|
212
|
+
cycle-close regeneration; write `review/single-{slug}-{timestamp}.json`; no
|
|
213
|
+
human QA gate.
|
|
214
|
+
|
|
215
|
+
**Root-cause only**: skip Phases 1–3; requires a prior cycle's decomposed file
|
|
216
|
+
+ scores.json as input; run Phase 5 directly.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Rubric — Cosmetic & Visual Quality
|
|
2
|
+
|
|
3
|
+
Phase 4 of [loop-protocol.md](loop-protocol.md). Input: the Phase 2 canvas
|
|
4
|
+
screenshot. Output: P1/P2/P3 counts + issue list. Runs for ALL prompts;
|
|
5
|
+
P1 blocks a prompt from PASSING.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## §Thresholds
|
|
10
|
+
|
|
11
|
+
Cosmetically PASSING: P1 = 0 AND P2 ≤ 2 AND P3 ≤ 4.
|
|
12
|
+
Cosmetic BLOCK (prompt cannot pass overall): P1 ≥ 1. Overflow entries from the
|
|
13
|
+
Phase 2 gate auto-count as P1s here.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## §Severity Definitions
|
|
18
|
+
|
|
19
|
+
| Severity | Meaning | Example |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| **P1** | User-visible layout failure; looks broken or unusable | Content overflows canvas, zero-height element, overlapping text, invisible text |
|
|
22
|
+
| **P2** | Noticeably wrong; degrades quality, doesn't break function | Wrong field padding, badge outside its container, inconsistent gap scale |
|
|
23
|
+
| **P3** | Minor cosmetic; acceptable but suboptimal | Slightly off optical alignment, icon size mismatch |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## §Cosmetic Dimensions
|
|
28
|
+
|
|
29
|
+
### COS-1 — Container geometry
|
|
30
|
+
|
|
31
|
+
- Zero height/width where non-zero expected → P1
|
|
32
|
+
- Container visibly overflows its parent → P1
|
|
33
|
+
- Distorted card/image aspect ratio → P2
|
|
34
|
+
- Container expands beyond content without reason → P2
|
|
35
|
+
- Unbalanced internal whitespace (all padding one side) → P3
|
|
36
|
+
|
|
37
|
+
### COS-2 — Spacing scale
|
|
38
|
+
|
|
39
|
+
- 0 visible gap where clear separation needed → P1
|
|
40
|
+
- Visually inconsistent spacing within one region (3px vs 20px between fields) → P2
|
|
41
|
+
- Off the AdiaUI token scale (multiples of 4px) → P3
|
|
42
|
+
- Optically unbalanced margins in a centred block → P3
|
|
43
|
+
|
|
44
|
+
### COS-3 — Optical alignment
|
|
45
|
+
|
|
46
|
+
- Misaligned text baselines across a row → P2
|
|
47
|
+
- Icons not vertically centred against companion text → P2/P3
|
|
48
|
+
- Action buttons not trailing-edge aligned → P3
|
|
49
|
+
- Labels not consistently flush-left within a group → P3
|
|
50
|
+
|
|
51
|
+
### COS-4 — Visual balance
|
|
52
|
+
|
|
53
|
+
- One element dominates the canvas with no counterweight → P2
|
|
54
|
+
- Heading and body at identical weight (no hierarchy contrast) → P2
|
|
55
|
+
- Left/right or top/bottom regions unbalanced vs importance → P3
|
|
56
|
+
|
|
57
|
+
### COS-5 — Token usage signals
|
|
58
|
+
|
|
59
|
+
- Component appears unstyled (raw browser styles bleeding through) → P1
|
|
60
|
+
- Very low text contrast (fg-subtle on bg-subtle class) → P2
|
|
61
|
+
- Black/white background where a subtle tint belongs → P2
|
|
62
|
+
- Border too thick/thin for context → P3
|
|
63
|
+
|
|
64
|
+
### COS-6 — Empty state quality
|
|
65
|
+
|
|
66
|
+
- Empty state is a blank box (not communicative) → P2
|
|
67
|
+
- Collapsed to near-zero height → P2
|
|
68
|
+
- Placeholder text unreadable or unstyled → P3
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## §Issue Format
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
[
|
|
76
|
+
{ "severity": "P1", "location": "card-ui root", "issue": "Card height is zero — canvas-ui likely returned empty components array" },
|
|
77
|
+
{ "severity": "P2", "location": "field-ui email label", "issue": "Label right-aligned instead of left; field-ui inline mode applied incorrectly" },
|
|
78
|
+
{ "severity": "P3", "location": "col-ui body gap", "issue": "Gap between form fields inconsistent — some 8px, some 16px" }
|
|
79
|
+
]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## §Screenshot Reading Protocol
|
|
85
|
+
|
|
86
|
+
1. Scan for P1 first (broken layout, overflow, invisible content), then P2 per
|
|
87
|
+
region top-to-bottom, then P3.
|
|
88
|
+
2. Report only what is visible — "spacing appears inconsistent", never an
|
|
89
|
+
invented "gap is 7px".
|
|
90
|
+
3. Use prompt context: a sparse loading skeleton is correct; a sparse
|
|
91
|
+
completed form is a COS-6 finding.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## §Connection to Root Causes
|
|
96
|
+
|
|
97
|
+
Cosmetic findings usually trace to: gallery canvas CSS
|
|
98
|
+
(`gallery-canvas-wrap`), component token overrides inside a2ui-root, missing
|
|
99
|
+
template attrs (`gap=` absent from the node), or a structurally wrong
|
|
100
|
+
primitive. Note the suspected connection when obvious; Phase 5 confirms it.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Rubric — Canvas Decomposition
|
|
2
|
+
|
|
3
|
+
Phase 2 of [loop-protocol.md](loop-protocol.md). Evaluates the quality of the
|
|
4
|
+
decomposition itself (screenshot + DOM walk → decomposed file), not the
|
|
5
|
+
quality of the generated output (that is [rubric-score.md](rubric-score.md)).
|
|
6
|
+
Output: score 0–100 + findings.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## §Thresholds
|
|
11
|
+
|
|
12
|
+
| Level | Score | Meaning |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| **Excellence** | 85–100 | Complete outside-in decomposition; every element named with its correct primitive |
|
|
15
|
+
| **Acceptable** | 65–84 | One level missed or one element misidentified |
|
|
16
|
+
| **Failing** | 0–64 | Root container or a major child missed |
|
|
17
|
+
|
|
18
|
+
**Phase gate: ≥ 65.** A failing decomposition invalidates the Phase 3 score.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## §Decomposition Protocol (outside-in, in order)
|
|
23
|
+
|
|
24
|
+
1. **Root container** — outermost rendered component node (canvas-ui →
|
|
25
|
+
a2ui-root are shells, skipped by the lookup).
|
|
26
|
+
2. **Layout strategy** — flex? grid? col-ui? row-ui? raw block?
|
|
27
|
+
3. **Primary regions** — header / body / footer, named card slots, panes.
|
|
28
|
+
4. **Content regions** — the primitives filling each region.
|
|
29
|
+
5. **Leaf nodes** — text, icon, button leaves.
|
|
30
|
+
6. **Data binding** — content-carrying attrs (`text=`, `label=`, `value=`,
|
|
31
|
+
`icon=`).
|
|
32
|
+
|
|
33
|
+
Per level record: element tag, key attrs observed, slot placement if slotted.
|
|
34
|
+
Primitive naming comes from `TAG_TO_COMPONENT` in the decompose script — a
|
|
35
|
+
lookup, never interpretation.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## §Dimensions (0–20 each, total 100)
|
|
40
|
+
|
|
41
|
+
### D1 — Root container identification
|
|
42
|
+
|
|
43
|
+
| Score | Description |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| 18–20 | Correct tag + key attrs recorded |
|
|
46
|
+
| 13–17 | Tag correct, attrs incomplete |
|
|
47
|
+
| 8–12 | Tag partially correct ("some card element") |
|
|
48
|
+
| 0–7 | Root not identified or wrong |
|
|
49
|
+
|
|
50
|
+
### D2 — Layout strategy accuracy
|
|
51
|
+
|
|
52
|
+
| Score | Description |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| 18–20 | Layout primitive named with direction + gap where applicable |
|
|
55
|
+
| 13–17 | Layout type correct, gap or direction missing |
|
|
56
|
+
| 8–12 | "stacked"/"column" without naming the primitive |
|
|
57
|
+
| 0–7 | Layout not described or incorrect |
|
|
58
|
+
|
|
59
|
+
### D3 — Region completeness
|
|
60
|
+
|
|
61
|
+
Proportional credit for key regions identified (card header, body section,
|
|
62
|
+
footer must all be named when present).
|
|
63
|
+
|
|
64
|
+
### D4 — Primitive identification accuracy
|
|
65
|
+
|
|
66
|
+
`button-ui` not "a button"; `field-ui` not "div with label"; `badge-ui` not
|
|
67
|
+
"small colored text". Deduct 3 per misidentified primitive. Floor 0.
|
|
68
|
+
|
|
69
|
+
Native tags in the tree map to `Native*` names (NativeHeader, NativeH3, …) —
|
|
70
|
+
their presence is itself a quality signal (e.g. `NativeLink` where `link-ui`
|
|
71
|
+
belongs).
|
|
72
|
+
|
|
73
|
+
### D5 — Data binding capture
|
|
74
|
+
|
|
75
|
+
Content attrs (`text=`, `label=`, `value=`, `icon=`, `heading=`) + structural
|
|
76
|
+
attrs (`variant=`, `size=`, `gap=`, `columns=`). Deduct 4 per visible attr
|
|
77
|
+
missed. Floor 0.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## §Screenshot Requirements
|
|
82
|
+
|
|
83
|
+
- [ ] Taken AFTER canvas settle (the script waits ≥2.5s per prompt).
|
|
84
|
+
- [ ] Clip is exactly the `.gallery-canvas-wrap` bounding box.
|
|
85
|
+
- [ ] Saved to the cycle's `screenshots/<slug>.png`.
|
|
86
|
+
- [ ] Canvas height < 50px → RENDER_FAILURE, skip Phase 3.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## §Findings Format
|
|
91
|
+
|
|
92
|
+
Observations, not judgments:
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
[
|
|
96
|
+
"Root: card-ui (no size or variant attrs visible)",
|
|
97
|
+
"Layout: col-ui gap=3 inside section slot",
|
|
98
|
+
"Missing: no footer slot populated; actions appear inline in body",
|
|
99
|
+
"D5: button-ui text attr absent — label rendered via ::after pseudo, not captured"
|
|
100
|
+
]
|
|
101
|
+
```
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Rubric — A-vs-B Gap Score (Fidelity)
|
|
2
|
+
|
|
3
|
+
Phase 3 of [loop-protocol.md](loop-protocol.md). Input: `spec.*` fields from
|
|
4
|
+
Phase 1 + the sanitized decomposed file from Phase 2 — never the raw DOM.
|
|
5
|
+
Output: score 0–105, delta vs prior cycle, per-dimension breakdown.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## §Thresholds
|
|
10
|
+
|
|
11
|
+
Max score 105 (D1–D5 at 20 each = 100; D6 mechanical = 0 or +5).
|
|
12
|
+
|
|
13
|
+
| Level | Score | Meaning |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| **Excellence** | 92–105 | Matches the ideal spec with only cosmetic gaps |
|
|
16
|
+
| **Acceptable** | 70–91 | Structural intent met; minor substitutions or missing secondary elements |
|
|
17
|
+
| **Failing** | 0–69 | Wrong root container, wrong layout strategy, or primary intent not represented |
|
|
18
|
+
|
|
19
|
+
**Exit gate**: every prompt at Excellence (92+) AND zero
|
|
20
|
+
`overflowElements` — see §VisualGate.
|
|
21
|
+
|
|
22
|
+
**Recalibrating** (when human QA contradicts mechanical scores across 2+
|
|
23
|
+
cycles): sweep candidate threshold values and read the pass-flips at each step
|
|
24
|
+
against the human verdicts — never pick a round number by feel. A threshold
|
|
25
|
+
change must also update the exit gate in SKILL.md and the schema comment, and
|
|
26
|
+
new cause codes / dimensions bump `schemaVersion` in
|
|
27
|
+
[scores.schema.json](scores.schema.json).
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## §VisualGate (independent of structural score)
|
|
32
|
+
|
|
33
|
+
Evaluated from `decomposed.overflowElements` before Phase 3 scoring; a high
|
|
34
|
+
structural score cannot compensate. A prompt with `rubricScore.score ≥ 92` is
|
|
35
|
+
still **FAILING** if `overflowElements.length > 0`. Each overflow entry
|
|
36
|
+
auto-promotes to a Phase 4 P1
|
|
37
|
+
(`"[tag] content clipped — overflow:hidden with scrollWidth > clientWidth"`).
|
|
38
|
+
|
|
39
|
+
Two independent lanes, both must clear:
|
|
40
|
+
|
|
41
|
+
- **Structural lane** (Phase 3): correct component types, nesting, attributes.
|
|
42
|
+
- **Visual lane** (Phase 2→4 overflow gate): legible, unclipped, visible.
|
|
43
|
+
|
|
44
|
+
Canonical example: analytics-chart at score 93 with every stat label clipped
|
|
45
|
+
to "T.." / "$.." and an invisible chart — structural pass, visual fail.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## §Dimensions
|
|
50
|
+
|
|
51
|
+
### D1 — Root container fidelity (0–20)
|
|
52
|
+
|
|
53
|
+
| Score | Condition |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| 20 | Exact match: same tag + same key attrs |
|
|
56
|
+
| 15 | Same tag, minor attr difference (missing `size` or `variant`) |
|
|
57
|
+
| 10 | Same category (both card-like, or both layout-only) |
|
|
58
|
+
| 5 | Wrong category but not catastrophically wrong |
|
|
59
|
+
| 0 | Completely wrong (bare div where card-ui expected; form stamped as table) |
|
|
60
|
+
|
|
61
|
+
### D2 — Layout strategy fidelity (0–20)
|
|
62
|
+
|
|
63
|
+
| Score | Condition |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| 20 | Exact: same layout primitive, same gap, same direction |
|
|
66
|
+
| 15 | Same direction but wrong primitive or missing gap attr |
|
|
67
|
+
| 10 | Direction correct; gap incorrect or missing |
|
|
68
|
+
| 5 | Wrong direction but content still readable |
|
|
69
|
+
| 0 | Horizontal where vertical required (or vice versa), or no layout applied |
|
|
70
|
+
|
|
71
|
+
### D3 — Slot vocabulary fidelity (0–20)
|
|
72
|
+
|
|
73
|
+
Key slot contracts:
|
|
74
|
+
|
|
75
|
+
- card-ui header: `slot=icon` / `slot=heading` / `slot=description` /
|
|
76
|
+
`slot=action`; body: `<section>` child; footer element for actions
|
|
77
|
+
- list-item-ui: `slot=icon` / `slot=text` / `slot=description` / `slot=action`
|
|
78
|
+
- field-ui: no slots — content is the control child
|
|
79
|
+
|
|
80
|
+
18–20 = all key slots correct. Deduct 5 per incorrect or missing slot
|
|
81
|
+
placement. Floor 0.
|
|
82
|
+
|
|
83
|
+
### D4 — Primitive accuracy (0–20)
|
|
84
|
+
|
|
85
|
+
Compare `spec.keyComponents` (A) against `decomposed.components` (B), using
|
|
86
|
+
the `TAG_TO_COMPONENT` names from the decompose script:
|
|
87
|
+
|
|
88
|
+
- 20 = all key elements match
|
|
89
|
+
- −5 per wrong primitive · −3 per missing element (in A, absent from B) ·
|
|
90
|
+
−2 per unexpected element (in B, absent from A). Floor 0.
|
|
91
|
+
|
|
92
|
+
### D5 — Content and data binding fidelity (0–20)
|
|
93
|
+
|
|
94
|
+
Start at 20, apply deductions, floor 0:
|
|
95
|
+
|
|
96
|
+
| Attr | Expected | Deduct if missing |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| `text=` on button-ui | Non-empty action label | −4 |
|
|
99
|
+
| `label=` on field-ui | Describes the field | −3 |
|
|
100
|
+
| `value=` on stat-ui | Realistic number | −4 |
|
|
101
|
+
| `change=` on stat-ui | Trend delta | −2 |
|
|
102
|
+
| `icon=` on button/nav | Correct semantic icon | −3 |
|
|
103
|
+
| `variant=` on badge/tag | Correct semantic variant | −2 |
|
|
104
|
+
|
|
105
|
+
### D6 — Root component match (mechanical, 0 or +5)
|
|
106
|
+
|
|
107
|
+
`decomposed.rootComponent` exactly equals `spec.rootComponent` → +5, else 0.
|
|
108
|
+
A single lookup comparison — no judgment. (It replaced a ±10 subjective
|
|
109
|
+
"intent satisfaction" modifier; the human QA gate covers intent.)
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## §Delta
|
|
114
|
+
|
|
115
|
+
`delta = score(cycle N) − score(cycle N−1)`; null if no prior cycle.
|
|
116
|
+
Zero for two consecutive cycles → investigate. Negative → must be explained in
|
|
117
|
+
root-cause analysis; `delta < −10` → cycle `BLOCKED` (loop-protocol §Phase 3).
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## §Root-Cause Classification
|
|
122
|
+
|
|
123
|
+
| Code | Cause |
|
|
124
|
+
| --- | --- |
|
|
125
|
+
| `WRONG_CHUNK` | Retrieval returned the wrong corpus chunk for the intent |
|
|
126
|
+
| `EMPTY_CHUNK` | Chunk exists but template has no useful attrs (props not transpiled) |
|
|
127
|
+
| `WRONG_COMPONENT` | Right structure, wrong primitive (e.g. select-ui children are Text nodes) |
|
|
128
|
+
| `MISSING_PROPS` | Component present but key attrs not set (label, text, value) |
|
|
129
|
+
| `WRONG_NESTING` | Correct component at wrong DOM depth |
|
|
130
|
+
| `TRANSPILER_GAP` | Prop not in catalog; transpiler cannot extract it |
|
|
131
|
+
| `RETRIEVAL_SCORE` | Correct chunk exists but scored lower than a wrong chunk |
|
|
132
|
+
| `FREE_FORM_HALLUC` | Free-form LLM chose a non-existent or wrong primitive |
|
|
133
|
+
| `COSMETIC_ONLY` | Structure correct; only visual/spacing issue |
|
|
134
|
+
|
|
135
|
+
Record per gap in `scores.json`. Before pinning MISSING_PROPS or
|
|
136
|
+
TRANSPILER_GAP, check the component yaml — components no-op on made-up attrs,
|
|
137
|
+
so the "missing" prop may never have existed
|
|
138
|
+
(corpus-html-patterns.md §Silent-failure attrs).
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## §DomainMismatchCheck (pre-scoring gate)
|
|
143
|
+
|
|
144
|
+
Verify the retrieved chunk's domain matches the prompt's group:
|
|
145
|
+
|
|
146
|
+
```text
|
|
147
|
+
auth/ → auth, forms
|
|
148
|
+
billing/ → billing, settings, forms
|
|
149
|
+
dashboard/ → dashboard, data
|
|
150
|
+
data-tables/ → data, settings
|
|
151
|
+
forms/ → forms, data
|
|
152
|
+
content/ → content, layout, marketing
|
|
153
|
+
navigation/ → navigation, layout
|
|
154
|
+
settings/ → settings, forms
|
|
155
|
+
notifications/ → agent, data
|
|
156
|
+
team-access/ → settings, data
|
|
157
|
+
onboarding/ → onboarding, forms, auth
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
If the decomposed components clearly indicate a different domain (email inbox
|
|
161
|
+
for a contact-form prompt), classify `RETRIEVAL_SCORE` and flag for human QA.
|
|
162
|
+
Never mark these PASSING without human verification — DOM scoring sees valid
|
|
163
|
+
component types regardless of whether the content answers the prompt.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## §KnownGaps — failures mechanical scoring cannot detect
|
|
168
|
+
|
|
169
|
+
These pass Phases 3 and 4 mechanically but are visually wrong. Human QA
|
|
170
|
+
(loop-protocol §CycleClose) is the only gate that catches them unless a
|
|
171
|
+
computed-style probe is added to Phase 2.
|
|
172
|
+
|
|
173
|
+
### Layout-axis collapse (validated: analytics-chart)
|
|
174
|
+
|
|
175
|
+
**What**: elements that belong on separate lines render on one line because
|
|
176
|
+
the wrong CSS display mode is active — `text-ui` is `display:inline` by
|
|
177
|
+
default, so wherever the card-header grid fails to activate, an inline
|
|
178
|
+
text-ui collapses next to a block heading. (The original trigger — the
|
|
179
|
+
transpiler dropping `slot=` — was fixed with the universal slot preserve; the
|
|
180
|
+
failure class remains live for any future grid-activation miss.)
|
|
181
|
+
|
|
182
|
+
**Why it passes**: Phase 3 scores component presence (both Text nodes are in
|
|
183
|
+
the tree → D4 satisfied); the overflow gate detects clipping, not wrong-axis
|
|
184
|
+
layout.
|
|
185
|
+
|
|
186
|
+
**Detection**: human QA, or a computed-style probe checking
|
|
187
|
+
`getComputedStyle(el).display` + `getBoundingClientRect().top` per Text node.
|
|
188
|
+
|
|
189
|
+
**Prevention**: canonical slot grammar / native block elements (`h3`, `p`) in
|
|
190
|
+
card headers — corpus-html-patterns.md §CanonicalCardAnatomy.
|
|
191
|
+
|
|
192
|
+
### Empty chart (no data)
|
|
193
|
+
|
|
194
|
+
`chart-ui` with no data renders 0px high but IS in the tree → D4 satisfied;
|
|
195
|
+
the overflow gate only fires if the whole card collapses below 50px.
|
|
196
|
+
Prevention: always inline `data='[…]'` (corpus-html-patterns.md §FailsWorks).
|
|
197
|
+
|
|
198
|
+
### Viewport clipping (canvas boundary)
|
|
199
|
+
|
|
200
|
+
Content cut by the canvas paint boundary, not a CSS `overflow:hidden` box —
|
|
201
|
+
the overflow detector requires computed `overflow:hidden`, so this class never
|
|
202
|
+
fires it. Canonical case: magic-link-sent alert "Didn't get th...". Detection:
|
|
203
|
+
human screenshot inspection only. Prevention: keep canvas-bound content
|
|
204
|
+
narrow; `text-ui align="center"` for centered auth cards.
|
|
205
|
+
|
|
206
|
+
### RETRIEVAL_SCORE (wrong content, correct-looking DOM)
|
|
207
|
+
|
|
208
|
+
A different chunk sharing component types (Card + List + Avatar) fools
|
|
209
|
+
component-presence scoring every time. Canonical cases: contact-form → email
|
|
210
|
+
inbox; team-members → email inbox; blog-post-card → social post; invoice-table
|
|
211
|
+
→ invoice line-items. Detection: §DomainMismatchCheck pre-screen + the human
|
|
212
|
+
QA gate (this failure class is WHY the gate exists). Prevention: each gallery
|
|
213
|
+
prompt needs a dedicated, grounded chunk whose keywords outscore generic
|
|
214
|
+
competitors.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "adia-
|
|
3
|
+
"$id": "adia-gen-review/scores",
|
|
4
4
|
"title": "Gen UI Review Scores — per cycle",
|
|
5
5
|
"description": "Formal contract for review/cycle-N/scores.json. Every downstream tool that reads cycle data must validate against this schema.",
|
|
6
6
|
"type": "object",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"cycle": { "type": "integer" },
|
|
49
49
|
"specProduced": {
|
|
50
50
|
"type": "boolean",
|
|
51
|
-
"description": "Whether the Phase-1 spec
|
|
51
|
+
"description": "Whether the Phase-1 spec delegate successfully produced an A-spec (the spec itself is not scored)"
|
|
52
52
|
},
|
|
53
53
|
"rubricDecompose": {
|
|
54
54
|
"type": "object",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* gen-review-coverage-audit.mjs —
|
|
3
|
+
* gen-review-coverage-audit.mjs — TAG_TO_COMPONENT parity gate for adia-gen-review.
|
|
4
4
|
*
|
|
5
5
|
* Verifies that every AdiaUI primitive tag (from component yamls) has
|
|
6
6
|
* an entry in gen-review-decompose.mjs TAG_TO_COMPONENT. Reports any
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
* script is run.
|
|
18
18
|
*
|
|
19
19
|
* Usage (from the monorepo root):
|
|
20
|
-
* node ${CLAUDE_PLUGIN_ROOT}/skills/adia-
|
|
21
|
-
* node ${CLAUDE_PLUGIN_ROOT}/skills/adia-
|
|
22
|
-
* node ${CLAUDE_PLUGIN_ROOT}/skills/adia-
|
|
20
|
+
* node ${CLAUDE_PLUGIN_ROOT}/skills/adia-gen-review/scripts/gen-review-coverage-audit.mjs # report gaps
|
|
21
|
+
* node ${CLAUDE_PLUGIN_ROOT}/skills/adia-gen-review/scripts/gen-review-coverage-audit.mjs --strict # exit 1 if gaps exist
|
|
22
|
+
* node ${CLAUDE_PLUGIN_ROOT}/skills/adia-gen-review/scripts/gen-review-coverage-audit.mjs --json # machine-readable output
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
import { readFileSync, readdirSync, statSync } from 'node:fs';
|