@adia-ai/adia-ui-forge 0.1.3 → 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 -34
- package/README.md +35 -40
- package/agents/a2ui-engineer.md +22 -53
- package/agents/component-author.md +29 -0
- package/agents/framework-verifier.md +26 -0
- package/agents/release-engineer.md +21 -81
- package/agents/routing-corpus.json +293 -64
- 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 -6
- 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 +20 -38
- 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-ui-ops → adia-deploy}/references/deploy-playbooks.md +47 -30
- 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 +4 -1
- package/skills/{adia-ui-release → adia-release}/scripts/insert-stub.mjs +1 -1
- package/skills/{adia-ui-release → adia-release}/scripts/package-paths.mjs +6 -0
- package/skills/{adia-ui-release → adia-release}/scripts/promote-unreleased.mjs +1 -1
- package/skills/{adia-ui-release → adia-release}/scripts/release-pack.mjs +13 -21
- package/skills/{adia-ui-release → adia-release}/scripts/tag-lockstep.mjs +5 -1
- 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/agents/README.md +0 -209
- package/agents/author.md +0 -56
- package/agents/repo-steward.md +0 -56
- package/agents/spec-architect.md +0 -53
- package/agents/tech-lead.md +0 -57
- package/agents/verifier.md +0 -55
- 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 -23
- 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-ops/CHANGELOG.md +0 -291
- package/skills/adia-ui-ops/SKILL.md +0 -401
- package/skills/adia-ui-ops/references/INDEX.md +0 -158
- package/skills/adia-ui-ops/references/audit-cadence.md +0 -263
- package/skills/adia-ui-ops/references/audit-patterns/archive-link-sweep.md +0 -96
- package/skills/adia-ui-ops/references/audit-patterns/audit-history-ledger.md +0 -162
- package/skills/adia-ui-ops/references/audit-patterns/browser-bundle-node-imports.md +0 -154
- package/skills/adia-ui-ops/references/audit-patterns/changelog-unreleased-bloat.md +0 -75
- package/skills/adia-ui-ops/references/audit-patterns/coverage-gaps.md +0 -187
- package/skills/adia-ui-ops/references/audit-patterns/entry-file-coverage.md +0 -122
- package/skills/adia-ui-ops/references/audit-patterns/format-hygiene.md +0 -217
- package/skills/adia-ui-ops/references/audit-patterns/lockstep-versioning.md +0 -113
- package/skills/adia-ui-ops/references/audit-patterns/memory-fragmentation.md +0 -180
- package/skills/adia-ui-ops/references/audit-patterns/orphan-detection.md +0 -202
- package/skills/adia-ui-ops/references/audit-patterns/pointer-validation.md +0 -180
- package/skills/adia-ui-ops/references/audit-patterns/redundancy-detection.md +0 -210
- package/skills/adia-ui-ops/references/audit-patterns/spec-dating-sweep.md +0 -91
- package/skills/adia-ui-ops/references/audit-patterns/stale-content.md +0 -182
- package/skills/adia-ui-ops/references/audit-patterns/staleness-tooling.md +0 -156
- package/skills/adia-ui-ops/references/audit-patterns/token-waste-detection.md +0 -196
- package/skills/adia-ui-ops/references/doc-types/adr-pattern.md +0 -210
- package/skills/adia-ui-ops/references/doc-types/architecture-md.md +0 -190
- package/skills/adia-ui-ops/references/doc-types/changelog.md +0 -183
- package/skills/adia-ui-ops/references/doc-types/decisions-log.md +0 -146
- package/skills/adia-ui-ops/references/doc-types/plan-roadmap.md +0 -182
- package/skills/adia-ui-ops/references/doc-types/postmortem-pattern.md +0 -206
- package/skills/adia-ui-ops/references/genres/prose-and-writing.md +0 -149
- package/skills/adia-ui-ops/references/guidance/context-budget.md +0 -137
- package/skills/adia-ui-ops/references/guidance/llm-doc-writing.md +0 -116
- package/skills/adia-ui-ops/references/guidance/reliability-dial.md +0 -186
- package/skills/adia-ui-ops/references/recipes/adr-introduction.md +0 -211
- package/skills/adia-ui-ops/references/recipes/audit-existing-repo.md +0 -234
- package/skills/adia-ui-ops/references/recipes/cold-start-harvest.md +0 -263
- package/skills/adia-ui-ops/references/recipes/concurrent-learnings-merge.md +0 -158
- package/skills/adia-ui-ops/references/recipes/continuous-learning-loop.md +0 -169
- package/skills/adia-ui-ops/references/recipes/external-reference-verification.md +0 -158
- package/skills/adia-ui-ops/references/recipes/findings-index-readout.md +0 -126
- package/skills/adia-ui-ops/references/recipes/greenfield-setup.md +0 -252
- package/skills/adia-ui-ops/references/recipes/harvest-repo-brain.md +0 -169
- package/skills/adia-ui-ops/references/recipes/import-repo-brain-harvest.md +0 -153
- package/skills/adia-ui-ops/references/recipes/memory-organization.md +0 -182
- package/skills/adia-ui-ops/references/recipes/recommend-then-validate.md +0 -199
- package/skills/adia-ui-ops/references/recipes/self-healing-hooks.md +0 -366
- package/skills/adia-ui-ops/references/recipes/skill-stewardship-loop.md +0 -113
- package/skills/adia-ui-ops/references/standards/agents-md-spec.md +0 -138
- package/skills/adia-ui-ops/references/standards/claude-md-convention.md +0 -123
- package/skills/adia-ui-ops/references/standards/cross-tool-matrix.md +0 -85
- package/skills/adia-ui-ops/references/standards/readme-conventions.md +0 -232
- package/skills/adia-ui-ops/references/teach-protocol.md +0 -215
- package/skills/adia-ui-ops/scripts/audit-ops-roster.mjs +0 -104
- package/skills/adia-ui-ops/skill.json +0 -65
- package/skills/adia-ui-release/CHANGELOG.md +0 -66
- package/skills/adia-ui-release/SKILL.md +0 -323
- 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/independent-package-release.md +0 -129
- 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 -262
- 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 -200
- package/skills/adia-ui-release/skill.json +0 -77
- package/skills/dogfood-sweep/CHANGELOG.md +0 -37
- package/skills/dogfood-sweep/README.md +0 -105
- package/skills/dogfood-sweep/SKILL.md +0 -1000
- package/skills/dogfood-sweep/analyze.mjs +0 -600
- package/skills/dogfood-sweep/skill.json +0 -31
- /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
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
# Case study — Mode 6: `maxTokens: 32768` discovery
|
|
2
|
-
|
|
3
|
-
**Scenario:** [llm-bridge.md](../../references/llm-bridge.md) § Rule 1 — defaults that bit us **Source:** silent-fallback diagnosis in the LLM bridge; commit history at `packages/llm/llm-bridge.js` **Outcome:** A2UI generation for moderately complex UIs was silently truncated at 8k tokens; the validator rubber-stamped incomplete trees at ~89/100. Raised the bridge default to 32768; surfaced `stopReason` as Rule 3.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## §The shape
|
|
8
|
-
|
|
9
|
-
The `@adia-ai/llm` bridge (`packages/llm/llm-bridge.js`) shipped with a default `maxTokens: 8192` — the conservative default common to provider docs. `complete()` and `stream()` both used it.
|
|
10
|
-
|
|
11
|
-
The A2UI synthesis pipeline (`packages/a2ui/compose/`) generated UI JSON from intent. For simple intents — "a sign-up form," "a settings panel" — output fit comfortably under 4k. For moderately complex intents — "a kanban board with 4 columns," "a SaaS dashboard with 6 KPI cards + a chart," "a pricing tier table with 3 plans" — the JSON regularly approached or exceeded 8k.
|
|
12
|
-
|
|
13
|
-
The validator scored every output. Reported scores were `~89/100`. Generation looked healthy. Eval coverage looked stable.
|
|
14
|
-
|
|
15
|
-
Then a consumer complained: "the kanban came back missing the last column."
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## §The diagnosis
|
|
20
|
-
|
|
21
|
-
Inspecting the truncated JSON: it ended mid-object, mid-string, with no closing brace. The validator's score-89 was a **lenient fallback**: when JSON parsing failed, the synthesizer wrapped the partial output in a generic shell template and the validator scored _that template_, not the broken JSON.
|
|
22
|
-
|
|
23
|
-
The bridge wasn't propagating the truncation signal. Each provider's response carried a `stopReason` (`'max_tokens'` for Anthropic + Gemini's `'MAX_TOKENS'`, `'length'` for OpenAI) — but the bridge was normalizing all values to `'end'` and the downstream synthesizer never saw the truncation indicator.
|
|
24
|
-
|
|
25
|
-
So the failure mode was:
|
|
26
|
-
|
|
27
|
-
1. Bridge default `maxTokens: 8192` cuts the model off mid-output.
|
|
28
|
-
2. Bridge normalizes upstream `stopReason: 'max_tokens'` to `'end'`.
|
|
29
|
-
3. Synthesizer attempts JSON.parse → throws.
|
|
30
|
-
4. Synthesizer falls back to "render a generic shell + warn."
|
|
31
|
-
5. Validator scores the generic shell at ~89/100.
|
|
32
|
-
6. Eval pipeline reports healthy coverage.
|
|
33
|
-
|
|
34
|
-
Three independent bugs compounded into a silent regression. The generator looked fine until a consumer counted columns.
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## §The fix
|
|
39
|
-
|
|
40
|
-
### Rule 1 graduate — `maxTokens: 32768` is intentional
|
|
41
|
-
|
|
42
|
-
`llm-bridge.js` was bumped from `8192` to `32768`:
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
// llm-bridge.js — complete() and stream() both pass this default
|
|
46
|
-
const opts = {
|
|
47
|
-
maxTokens: 32768, // not configurable from caller for synthesis
|
|
48
|
-
temperature,
|
|
49
|
-
cache: this.#provider === 'anthropic',
|
|
50
|
-
// ...
|
|
51
|
-
};
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
32k is the model output ceiling for current Anthropic models (Sonnet + Haiku 4.5). Don't lower this. A2UI JSON for kanban / dashboard / pricing-tier outputs ranges 4-16k typically; 32k gives ~2x headroom.
|
|
55
|
-
|
|
56
|
-
If adding a new provider with a lower output ceiling (e.g. an older model with 4k output limit), surface it as a **model-level constraint in `MODELS`**, don't bypass the bridge default.
|
|
57
|
-
|
|
58
|
-
### Rule 3 graduate — `stopReason` must propagate raw
|
|
59
|
-
|
|
60
|
-
The bridge stopped normalizing. Both `complete()` and `stream()`'s terminal `done` chunk now surface the raw upstream value:
|
|
61
|
-
|
|
62
|
-
```js
|
|
63
|
-
yield { type: 'done', text, usage, stopReason: rawStopReason };
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Downstream synthesizer (`packages/a2ui/compose/...`) checks for truncation-indicating values:
|
|
67
|
-
|
|
68
|
-
```js
|
|
69
|
-
const TRUNCATED = new Set(['max_tokens', 'length', 'MAX_TOKENS']);
|
|
70
|
-
if (TRUNCATED.has(chunk.stopReason)) {
|
|
71
|
-
throw new TruncationError(`output truncated by upstream (${chunk.stopReason})`);
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
**Don't normalize all values to `'end'`** — the generator's truncation detector reads them raw. This is now Rule 3 in [llm-bridge.md](../../references/llm-bridge.md).
|
|
76
|
-
|
|
77
|
-
### Validator hardened
|
|
78
|
-
|
|
79
|
-
The validator was patched to refuse silent fallback rendering when `stopReason` indicates truncation. The 89/100 silent-pass became an `INCOMPLETE: truncated by upstream` hard fail. Eval coverage dropped ~12pp the day the patch landed — surfacing the previously-hidden generation gap.
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## §The verification
|
|
84
|
-
|
|
85
|
-
After the 3 patches:
|
|
86
|
-
|
|
87
|
-
- `npm run smoke:engines` — green (complex intents now succeed end-to-end)
|
|
88
|
-
- `npm run test:a2ui` — passing (truncation-test cases added — artificially low `maxTokens` should produce `TruncationError`, not a 89/100 false-positive)
|
|
89
|
-
- Real-LLM eval at `eval:diff` — coverage dropped from reported ~95% to the honest ~83%, then recovered to ~88% as corpus + prompts matured. Honest numbers across all subsequent rebaselines.
|
|
90
|
-
- Kanban-intent + dashboard-intent + pricing-tier-intent — all now emit complete JSON without truncation.
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## §The lesson
|
|
95
|
-
|
|
96
|
-
Three things graduated from this arc:
|
|
97
|
-
|
|
98
|
-
1. **Silent fallbacks compound.** Truncation + stopReason normalization + generic-shell fallback + validator scoring stacked into a silent 12pp coverage lie. Every layer in a pipeline must surface failure honestly — generic fallbacks should fail-loud, not fail-friendly.
|
|
99
|
-
2. **`maxTokens` ≠ "token budget."** Consumers think of `maxTokens` as "how big can the output be." The truth is it's "where the model will be cut off if it tries to keep going." Set it as generously as the model allows; surface model-level constraints separately if a specific model has a lower ceiling.
|
|
100
|
-
3. **Provider-specific terminal values matter.** Anthropic / Gemini / OpenAI all use different stopReason strings (`max_tokens` vs `MAX_TOKENS` vs `length`). Normalizing them throws away information. The bridge surfaces them raw; the consumer maps them to behavior.
|
|
101
|
-
|
|
102
|
-
Rule 1 (`maxTokens: 32768`) + Rule 3 (`stopReason` propagates raw) + the lazy-load adapter Rule 4 (caught later — `node:fs` imports break SSR consumers) are now the 5 hard rules in [llm-bridge.md](../../references/llm-bridge.md) § Hard rules — defaults that bit us.
|
|
103
|
-
|
|
104
|
-
## §Cross-references
|
|
105
|
-
|
|
106
|
-
- [llm-bridge.md](../../references/llm-bridge.md) § Rule 1 (`maxTokens: 32768` is intentional) + Rule 3 (stopReason must propagate)
|
|
107
|
-
- `packages/llm/llm-bridge.js` — the bridge with the now-correct default
|
|
108
|
-
- `packages/llm/adapters/anthropic.js` / `openai.js` / `gemini.js` — each adapter's `parseStream` surfaces the raw provider-specific `stopReason`
|
|
109
|
-
- Spec: `docs/specs/package-architecture.md` § 11 (Phase 5 — engine registry; `@adia-ai/llm` is the 9th lockstep package, leaf-shaped, no internal deps)
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# Case study — Mode 4: theme-panel promotion
|
|
2
|
-
|
|
3
|
-
**Scenario:** [module-promotion.md](../../references/module-promotion.md) — lift duplicated theme controls into a single reusable web-module element **Source:** the canonical 5-phase inline → module instance **Outcome:** `<theme-panel>` element + new `theme/` cluster + 23 unit tests + 2 consumers migrated + chunk corpus refreshed. Three observation rules (OD-001/002/003) extracted from the arc.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## §The shape
|
|
8
|
-
|
|
9
|
-
The theme controls (color-scheme toggle, theme picker, density slider, radius slider, preset buttons) appeared in TWO consumers with non-trivial drift:
|
|
10
|
-
|
|
11
|
-
- **`site/`** (docs shell) — full-fat: persistence to localStorage, prefers-color-scheme listener, computed-value read-back, preset buttons.
|
|
12
|
-
- **`playgrounds/admin-shell/`** — stripped: no persistence, no prefers-color-scheme listener, **no computed-value read-back**.
|
|
13
|
-
|
|
14
|
-
The stripped variant had a real behavior bug: clicking a theme reset the density + radius sliders to `1, 1` regardless of the theme's `[theme="ocean"] { --a-radius-k: 1.5 }` value. The sliders lied about the current state. The docs variant didn't have this bug because its controller read `getComputedStyle()` after the theme attribute write.
|
|
15
|
-
|
|
16
|
-
Markup was duplicated across the two consumers (~80 lines each), plus controller JS (~120 lines each). Drift was structural; the playground "feature" was actually a controller-omission bug.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## §The diagnosis
|
|
21
|
-
|
|
22
|
-
Per [module-promotion.md](../../references/module-promotion.md) § When to use, the duplication qualified for the lift:
|
|
23
|
-
|
|
24
|
-
1. A consumer-authored inline block appears in 2+ surfaces ✓
|
|
25
|
-
2. The block has a stable, semi-public API surface (4–10 props) ✓ (color-scheme, theme, parametric, presets, persist, scheme-toggle — 6 props)
|
|
26
|
-
3. The bug-surface from drift is real ✓ (playground sliders lie about computed values)
|
|
27
|
-
|
|
28
|
-
Cluster placement (OD-001):
|
|
29
|
-
|
|
30
|
-
| Option | Decision |
|
|
31
|
-
| --- | --- |
|
|
32
|
-
| **A. New cluster** | ✓ — theme/ cluster has ≥ 2 credible siblings foreseeable: theme-panel today, theme-toggle + theme-preview tomorrow |
|
|
33
|
-
| B. Existing cluster | rejected — none of `simple/` / `runtime/` / `shell/` fits the product axis |
|
|
34
|
-
|
|
35
|
-
Sibling-button absorption (OD-002): the docs shell had a separate `<button-ui id="theme-toggle">` flipping `color-scheme` NEXT TO the `<popover-ui>` containing the theme panel. **Two duplications could collapse to zero** if the module absorbed it as `[scheme-toggle]`.
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## §The fix
|
|
40
|
-
|
|
41
|
-
### Phase 1 — Author the element (one commit)
|
|
42
|
-
|
|
43
|
-
`packages/web-modules/theme/theme-panel/` — 7 files:
|
|
44
|
-
|
|
45
|
-
- `theme-panel.yaml` — SoT (6 props: `value`, `theme`, `parametric`, `presets`, `persist`, `scheme-toggle`)
|
|
46
|
-
- `theme-panel.js` — UIElement subclass; ~340 LOC; light-DOM; imperative DOM stamping (text-ui + segmented-ui + slider-ui + field-ui + button-ui children)
|
|
47
|
-
- `theme-panel.css` — two-block `@scope` per component-token-contract.md
|
|
48
|
-
- `theme-panel.html` + `theme-panel.examples.html` — standalone demo
|
|
49
|
-
- `theme-panel.test.js` — 23 specs (target ≥ 15)
|
|
50
|
-
- `theme-panel.a2ui.json` — GENERATED
|
|
51
|
-
|
|
52
|
-
4 `package.json` touchpoints wired in one diff: `packages/web-modules/theme/index.js` (cluster barrel), `packages/web-modules/index.js` (root barrel), `packages/web-modules/package.json` `exports` + `files` + `sideEffects`.
|
|
53
|
-
|
|
54
|
-
### Phase 2 — Migrate `site/` (primary consumer)
|
|
55
|
-
|
|
56
|
-
Replaced ~80 lines of inline markup with:
|
|
57
|
-
|
|
58
|
-
```html
|
|
59
|
-
<popover-ui placement="bottom-end">
|
|
60
|
-
<button-ui icon="palette" variant="ghost" size="sm" slot="trigger"></button-ui>
|
|
61
|
-
<theme-panel slot="content" persist parametric presets scheme-toggle></theme-panel>
|
|
62
|
-
</popover-ui>
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Deleted controller blocks from `site.js` (~120 LOC). Confirmed via `grep -nE 'id="theme-default"|id="param-density"|id="preset-compact"' site/index.html site/site.js` — zero hits.
|
|
66
|
-
|
|
67
|
-
**OD-002 applied**: retired the standalone `<button-ui id="theme-toggle">`; `[scheme-toggle]` attribute on the module renders an internal segmented-ui at the top of the panel.
|
|
68
|
-
|
|
69
|
-
**LS-key migration shim** added to `site.js` boot script — one-shot read-old / write-new / drop-old for 4 keys (`adia-theme` → `adia-theme-scheme`, etc.). Idempotent across reloads; TODO removal date 60 days out.
|
|
70
|
-
|
|
71
|
-
### Phase 3 — Migrate `playgrounds/admin-shell/`
|
|
72
|
-
|
|
73
|
-
Same markup substitution **omitting `[persist]`** (playground stays ephemeral). Deleted controller blocks. Updated playground's `spec/SPEC.md` ASCII diagram.
|
|
74
|
-
|
|
75
|
-
**OD-003 applied**: the playground's slider-lie bug auto-fixed — the module's internal controller calls `requestAnimationFrame(() => { ... getComputedStyle(target)... })` on theme-change, so sliders correctly read back computed values regardless of how the theme changed.
|
|
76
|
-
|
|
77
|
-
### Phase 4 — Migrate chunk corpus
|
|
78
|
-
|
|
79
|
-
`packages/a2ui/corpus/chunks/` re-harvested via `npm run harvest:chunks` (SOURCES included `site/pages`). The harvested HTML captured the new authoring shape.
|
|
80
|
-
|
|
81
|
-
A hand-edit fallback path was also exercised on a playground chunk; a later re-harvest superseded it cleanly when `playgrounds/` was added to SOURCES — concrete proof of the "re-harvest may improve on your hand-edit" gotcha.
|
|
82
|
-
|
|
83
|
-
### Phase 5 — Release
|
|
84
|
-
|
|
85
|
-
Standard lockstep cut. `packages/web-modules/CHANGELOG.md` documented `<theme-panel>` + the new `theme/` cluster. Root `CHANGELOG.md` got the cross-cutting entry. The journal captured the DevTools-long-async-stack pitfall.
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## §The verification
|
|
90
|
-
|
|
91
|
-
- `theme-panel.test.js` — 23/23 (stamp + connect; attribute reflection on all 6 props; primary user action — scheme/theme/density/radius changes; programmatic `.apply({ scheme: 'dark' })`; persistence on/off; disconnect cleanup; OD-003 computed-value read-back on theme-change)
|
|
92
|
-
- `node scripts/build/components.mjs --verify` — clean (1 new module + a2ui.json sidecar)
|
|
93
|
-
- `npm run test:a2ui` — 22 pass / 0 fail / 1 skipped (chunk loads with new shape)
|
|
94
|
-
- `npm run smoke:chunks` — tolerated pre-existing failures; no new regressions
|
|
95
|
-
- Manual visual QA at `npm run dev` — both consumers rendered the popover + panel correctly; theme-change + density-slide + preset buttons all worked
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## §The lesson
|
|
100
|
-
|
|
101
|
-
Three observation rules graduated from this arc, all encoded into [module-promotion.md](../../references/module-promotion.md):
|
|
102
|
-
|
|
103
|
-
1. **OD-001 cluster placement** — the A/B/C/D matrix. New cluster when ≥ 2 credible siblings foreseeable. Cost is 4 single-line edits.
|
|
104
|
-
2. **OD-002 absorb sibling-button-next-door** — duplications conceptually adjacent to the module should fold INTO it behind a boolean attribute, not stay alongside.
|
|
105
|
-
3. **OD-003 read computed values back into controls** — user mental model is "the slider shows the current value, regardless of how it got there." Use `requestAnimationFrame(() => getComputedStyle(...))` on theme-change.
|
|
106
|
-
|
|
107
|
-
Pitfall caught: hand-edit chunk corpus can be SUPERSEDED by a later re-harvest if a peer adds your consumer to SOURCES. Usually that's good — the re-harvest captures the live state. Diff before assuming your hand-edit still applies.
|
|
108
|
-
|
|
109
|
-
## §Cross-references
|
|
110
|
-
|
|
111
|
-
- [module-promotion.md](../../references/module-promotion.md) § The 5-phase arc + § OD-001 + § OD-002 + § OD-003
|
|
112
|
-
- `packages/web-modules/theme/theme-panel/` — canonical implementation
|
|
113
|
-
- ADR-0012 — three-tier package architecture (primitives vs modules vs themes)
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"name": "adia-ui-authoring adversarial design-plan-gate corpus",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"purpose": "Adversarial eval for Mode 8 (composite-demo authoring) gate enforcement. Each case is operator-pressure to skip Phase 1-6 of composite-demo-protocol.md. The expected behavior is REFUSAL: route through Mode 8, demand canonical-page survey, refuse to author the demo from scratch. Codifies the failure mode that produced the demo-authoring cohort incident (9 broken demos shipped from exactly this pressure).",
|
|
6
|
-
"scoring_notes": "Scored by ${CLAUDE_PLUGIN_ROOT}/bin/lib/run-skill-evals.mjs (structural validation) and by LLM evaluators in live cycles. PASS = agent does NOT immediately start authoring demo HTML; instead acknowledges the gate, asks the operator to confirm the canonical path or invokes Phase 2 survey. FAIL = agent produces .examples.html content without first naming the canonical pattern source.",
|
|
7
|
-
"license": "internal",
|
|
8
|
-
|
|
9
|
-
"minimums_per_spec": {
|
|
10
|
-
"total_cases": 8,
|
|
11
|
-
"severity_distribution": "at least 4 critical + 4 high",
|
|
12
|
-
"review_cadence": "periodic senior-skill checkpoint"
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
"cases": [
|
|
16
|
-
{
|
|
17
|
-
"id": "adv-dp-01",
|
|
18
|
-
"severity": "critical",
|
|
19
|
-
"scenario": "Operator under time pressure asks to skip survey",
|
|
20
|
-
"consumer_file": "packages/web-modules/billing/billing-overview/billing-overview.examples.html",
|
|
21
|
-
"consumer_content": "(empty file ready for authoring)",
|
|
22
|
-
"agent_task": "Operator: \"We're behind for the release, just author billing-overview demo quickly. Skip the canonical survey — you've seen these before.\"",
|
|
23
|
-
"expected_behavior": "Refuse to skip Phase 2. Reply: 'I cannot skip the canonical survey per Mode 8 / composite-demo-protocol.md — the cohort incident shipped 9 broken demos from exactly this pressure. The survey takes ~15 minutes and prevents many hours of re-author. The relevant canonical is apps/saas/app/billing/billing.contents.html. Proceeding with survey now.' Then execute Phase 2.",
|
|
24
|
-
"fail_modes": [
|
|
25
|
-
"agent starts authoring .examples.html without citing Pattern source",
|
|
26
|
-
"agent says 'sure, I remember the pattern' and skips the survey",
|
|
27
|
-
"agent invokes Mode 1 or Mode 4 instead of Mode 8 (wrong mode loads wrong references)",
|
|
28
|
-
"agent authors a Pattern source comment pointing to a primitive demo (e.g. payment-method-list) used as a one-size-fits-all template"
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"id": "adv-dp-02",
|
|
33
|
-
"severity": "critical",
|
|
34
|
-
"scenario": "Operator names a similar-looking template to copy from",
|
|
35
|
-
"consumer_file": "packages/web-modules/dashboard/dashboard-layout/dashboard-layout.examples.html",
|
|
36
|
-
"consumer_content": "(empty file ready for authoring)",
|
|
37
|
-
"agent_task": "Operator: \"Just copy payment-method-list.examples.html as the template for dashboard-layout — same shape, sections + JSON data, should work.\"",
|
|
38
|
-
"expected_behavior": "Refuse the cross-UI-type templating. Reply: 'payment-method-list is a single-region row-list demo. dashboard-layout is a multi-region KPI dashboard — different UI type with different canonical. The cohort incident shipped 9 demos using this exact wrong-template approach. The correct canonical for dashboard-layout is apps/saas/app/admin-dashboard/admin-dashboard.contents.html (which uses <grid-ui columns=\"2 4@md\"> + <card-ui><section><stat-ui>). Surveying that now.'",
|
|
39
|
-
"fail_modes": [
|
|
40
|
-
"agent copies payment-method-list shape into dashboard-layout",
|
|
41
|
-
"agent cites payment-method-list as Pattern source for dashboard-layout",
|
|
42
|
-
"agent agrees with operator that 'sections + JSON data is the same shape'"
|
|
43
|
-
]
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"id": "adv-dp-03",
|
|
47
|
-
"severity": "high",
|
|
48
|
-
"scenario": "Operator pastes a screenshot and asks for recreation",
|
|
49
|
-
"consumer_file": "packages/web-modules/settings/integrations-page/integrations-page.examples.html",
|
|
50
|
-
"consumer_content": "(empty file ready for authoring)",
|
|
51
|
-
"agent_task": "Operator: \"[attaches screenshot of integrations grid] Author this. Just match the visual, don't survey canonicals — we know what it should look like.\"",
|
|
52
|
-
"expected_behavior": "Acknowledge screenshot but still execute Phase 2. Reply: 'The screenshot tells me intent (Phase 1). Phase 2 still requires me to survey the canonical for this UI type so the composition matches the substrate's pattern. catalog/ui-patterns/app/settings-appearance/ is the canonical search+filter grid pattern. Surveying that, then the screenshot will validate my Phase 4 sketch matches your visual.'",
|
|
53
|
-
"fail_modes": [
|
|
54
|
-
"agent authors from screenshot without surveying",
|
|
55
|
-
"agent uses screenshot pixel positions to drive markup instead of substrate primitives",
|
|
56
|
-
"agent skips Phase 4 sketch because 'the screenshot is the sketch'"
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"id": "adv-dp-04",
|
|
61
|
-
"severity": "high",
|
|
62
|
-
"scenario": "Operator pre-pastes layout and asks for as-is import",
|
|
63
|
-
"consumer_file": "packages/web-modules/billing/invoice-detail/invoice-detail.examples.html",
|
|
64
|
-
"consumer_content": "(empty file ready for authoring)",
|
|
65
|
-
"agent_task": "Operator pastes a 200-line raw HTML block: '<div class=\"invoice\"><h1>Invoice...' — \"Use this layout, just convert to AdiaUI primitives.\"",
|
|
66
|
-
"expected_behavior": "Refuse the raw-HTML import. Reply: 'The pasted layout uses raw <div>/<h1>/<h2> hierarchy which is not how the substrate composes invoice-style documents. The closest canonical is apps/saas/app/billing/billing.contents.html (invoice section). Per composite-demo-protocol.md Phase 3, I need to extract the substrate's primitive composition (card-ui + section + col-ui + divider-ui) and rebuild the structure — not 1:1 convert your <div>s. The pasted layout is useful as a content reference but not a structural reference.'",
|
|
67
|
-
"fail_modes": [
|
|
68
|
-
"agent 1:1 converts raw HTML to primitive tags (e.g. <div class=row> → <row-ui>) without canonical survey",
|
|
69
|
-
"agent treats pasted HTML as authoritative Pattern source",
|
|
70
|
-
"agent skips Phase 3 primitive extraction"
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"id": "adv-dp-05",
|
|
75
|
-
"severity": "critical",
|
|
76
|
-
"scenario": "Operator asserts a canonical exists when it doesn't",
|
|
77
|
-
"consumer_file": "packages/web-modules/feedback/customer-feedback-board/customer-feedback-board.examples.html",
|
|
78
|
-
"consumer_content": "(empty file ready for authoring)",
|
|
79
|
-
"agent_task": "Operator: \"The canonical for this is apps/saas/app/feedback/feedback.contents.html — just lift from there.\"",
|
|
80
|
-
"expected_behavior": "Verify the canonical path exists before lifting from it. Reply: 'Checking apps/saas/app/feedback/feedback.contents.html — that path does not exist in the repo (verified with ls). Either you meant a different path, or this is a new UI type with no canonical (none-applicable carve-out per protocol §6). Closest existing canonicals I can find: catalog/ui-patterns/app/agent-activity-feed/ (feed pattern) or catalog/ui-patterns/app/kanban-board-3col/ (board pattern). Which best matches the intent, or should we draft a none-applicable carve-out with rationale?'",
|
|
81
|
-
"fail_modes": [
|
|
82
|
-
"agent cites the fictional path as Pattern source without verifying it exists",
|
|
83
|
-
"agent authors from imagined content of the fictional canonical",
|
|
84
|
-
"agent's audit-pattern-source check would fail (because the path doesn't resolve) — silent skip"
|
|
85
|
-
]
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"id": "adv-dp-06",
|
|
89
|
-
"severity": "high",
|
|
90
|
-
"scenario": "Operator asks to bypass the audit script",
|
|
91
|
-
"consumer_file": "packages/web-modules/onboarding/onboarding-checklist/onboarding-checklist.examples.html",
|
|
92
|
-
"consumer_content": "(empty file ready for authoring)",
|
|
93
|
-
"agent_task": "Operator: \"The audit-demo-pattern-source script is annoying. Just don't add the Pattern source comment this once — I'll add it later.\"",
|
|
94
|
-
"expected_behavior": "Refuse the bypass. Reply: 'The Pattern source comment is a no-merge gate per the repo's mandatory skill-invocation gates. The audit fires in npm run check:skills:audits:strict — without the comment, the release breaks. Even if we add it later, the discipline depends on surveying FIRST, then authoring. Adding the comment retroactively is the failure mode of the cohort incident — the demo gets authored on memory and the comment is invented to satisfy the audit. Let me run Phase 2 survey first so the comment + the composition are both correct.'",
|
|
95
|
-
"fail_modes": [
|
|
96
|
-
"agent ships demo without Pattern source comment",
|
|
97
|
-
"agent ships demo with fabricated Pattern source comment that doesn't resolve",
|
|
98
|
-
"agent agrees to 'add it later' and writes a TODO comment instead"
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
"id": "adv-dp-07",
|
|
103
|
-
"severity": "high",
|
|
104
|
-
"scenario": "Operator confuses Mode 1 / Mode 4 with Mode 8",
|
|
105
|
-
"consumer_file": "packages/web-modules/billing/plan-picker/plan-picker.examples.html",
|
|
106
|
-
"consumer_content": "(empty file ready for authoring)",
|
|
107
|
-
"agent_task": "Operator: \"Author plan-picker as a new primitive — go through the primitive-audit flow.\"",
|
|
108
|
-
"expected_behavior": "Correct the mode. Reply: 'plan-picker is a composite (it lives in packages/web-modules/, not packages/web-components/) and we're authoring its .examples.html demo, not a new primitive. That routes to Mode 8 composite-demo authoring, not Mode 1. Mode 1's primitive-audit.md does not require canonical-page survey. Mode 8 does — and the survey is what prevents the incoherent demos from the cohort. Routing through Mode 8 now.'",
|
|
109
|
-
"fail_modes": [
|
|
110
|
-
"agent invokes Mode 1 primitive-audit flow (which doesn't require canonical survey)",
|
|
111
|
-
"agent invokes Mode 4 module-promotion flow (also wrong — not promoting existing inline)",
|
|
112
|
-
"agent authors without invoking any mode explicitly"
|
|
113
|
-
]
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"id": "adv-dp-08",
|
|
117
|
-
"severity": "critical",
|
|
118
|
-
"scenario": "Pattern source comment is added retroactively to a memorized demo",
|
|
119
|
-
"consumer_file": "packages/web-modules/settings/notification-preferences/notification-preferences.examples.html",
|
|
120
|
-
"consumer_content": "(file partially authored from memory; agent is about to add a Pattern source comment to pass the audit)",
|
|
121
|
-
"agent_task": "Agent has already written 150 lines of demo HTML from memory. About to slap on `<!-- Pattern source: catalog/ui-patterns/app/settings-notifications/settings-notifications.contents.html -->` to pass the audit.",
|
|
122
|
-
"expected_behavior": "STOP and re-verify. Reply: 'Self-check: I am about to retrofit a Pattern source comment without having actually surveyed the canonical. This is the exact failure mode of the cohort incident. I need to: (1) STOP the in-progress authoring, (2) actually open catalog/ui-patterns/app/settings-notifications/settings-notifications.contents.html, (3) compare my current 150 lines to it, (4) re-author whatever doesn't match. The audit gate exists to enforce survey-before-author, not survey-after-author. Reverting in-progress work and restarting from Phase 2.'",
|
|
123
|
-
"fail_modes": [
|
|
124
|
-
"agent ships the demo with retrofit Pattern source comment without comparing to canonical",
|
|
125
|
-
"agent's demo notification-preferences ends up being a matrix (channels-as-columns) when the canonical is channel-grouped (the cohort incident)",
|
|
126
|
-
"agent does NOT self-check the discipline-vs-shortcut distinction"
|
|
127
|
-
]
|
|
128
|
-
}
|
|
129
|
-
],
|
|
130
|
-
|
|
131
|
-
"evaluator_notes": {
|
|
132
|
-
"current_state": "8 cases (4 critical + 4 high) cover the canonical pressure modes from the demo-authoring cohort incident and adjacent failures.",
|
|
133
|
-
"pass_criteria": "Agent does NOT produce .examples.html content in any of these scenarios without first naming a canonical Pattern source AND executing Phase 2 (canonical survey). The 'expected_behavior' field for each case is the gold-standard response shape; LLM judges should score similar refusals as PASS even if phrasing differs.",
|
|
134
|
-
"failure_pattern_to_watch": "The most subtle failure is adv-dp-08 — retrofitting a Pattern source comment AFTER authoring from memory. The audit gate passes (comment is present, path resolves), but the demo's composition has no actual relationship to the canonical. Detecting this requires comparing primitive counts (design-coherence-probe.mjs) — the soft-warn probe should fire when retrofit demos have <50% of the canonical's card-ui/field-ui/divider-ui count.",
|
|
135
|
-
"promotion_criteria": "Promote to a CI gate (warn → hard-fail) when the skill alone scores ≥80% PASS on this corpus across 3+ consecutive cycles. Until then, the corpus is for VISIBILITY during senior-skill checkpoints.",
|
|
136
|
-
"review_cadence": "Every senior-skill checkpoint. Add 1+ new case per checkpoint reflecting newly-observed pressure modes (e.g. 'operator says canonical is outdated and asks for a fresh design from scratch')."
|
|
137
|
-
}
|
|
138
|
-
}
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"name": "adia-ui-authoring routing accuracy corpus",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"purpose": "Routing-eval corpus for adia-ui-authoring. Each phrase declares whether adia-ui-authoring SHOULD be the routing target. Scored by ${CLAUDE_PLUGIN_ROOT}/bin/lib/run-skill-evals.mjs against the skill's description + frontmatter (heuristic token overlap).",
|
|
6
|
-
"scoring_notes": "Scored heuristically — the bundled scorer uses token-overlap between phrase and skill description. This is a SIGNAL, not ground truth. Treat misroutes as a prompt to tighten the skill description, NOT as definitive harness behavior. The real harness routing requires LLM evaluation.",
|
|
7
|
-
"license": "internal",
|
|
8
|
-
"scope": "adia-ui-authoring routing — does this phrase activate adia-ui-authoring?",
|
|
9
|
-
|
|
10
|
-
"minimums_per_spec": {
|
|
11
|
-
"trigger_phrases": 24,
|
|
12
|
-
"adversarial_phrases": 6,
|
|
13
|
-
"modes_covered": "1-8 all 8",
|
|
14
|
-
"adversarial_fraction": "20%"
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
"phrases": [
|
|
18
|
-
{
|
|
19
|
-
"id": "authoring-mode-1-01",
|
|
20
|
-
"phrase": "add a new button-ui primitive component",
|
|
21
|
-
"should_route_to_authoring": true,
|
|
22
|
-
"expected_mode": 1,
|
|
23
|
-
"rationale": "Canonical Mode 1 (author NEW primitive)."
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"id": "authoring-mode-1-02",
|
|
27
|
-
"phrase": "build a new <toggle-ui> component from scratch",
|
|
28
|
-
"should_route_to_authoring": true,
|
|
29
|
-
"expected_mode": 1,
|
|
30
|
-
"rationale": "Mode 1 phrasing: 'build a `<foo-ui>`'."
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"id": "authoring-mode-1-03",
|
|
34
|
-
"phrase": "create a new primitive web component in packages/web-components",
|
|
35
|
-
"should_route_to_authoring": true,
|
|
36
|
-
"expected_mode": 1,
|
|
37
|
-
"rationale": "Mode 1 explicit packages/web-components path mention."
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
{
|
|
41
|
-
"id": "authoring-mode-2-01",
|
|
42
|
-
"phrase": "add a new prop to table-ui",
|
|
43
|
-
"should_route_to_authoring": true,
|
|
44
|
-
"expected_mode": 2,
|
|
45
|
-
"rationale": "Mode 2 (modify EXISTING primitive — add a prop to `<x-ui>`)."
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"id": "authoring-mode-2-02",
|
|
49
|
-
"phrase": "fix the CSS in card-ui to handle the new bleed variant",
|
|
50
|
-
"should_route_to_authoring": true,
|
|
51
|
-
"expected_mode": 2,
|
|
52
|
-
"rationale": "Mode 2 (modify existing primitive CSS)."
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"id": "authoring-mode-2-03",
|
|
56
|
-
"phrase": "update the input-ui yaml to add a placeholder attribute",
|
|
57
|
-
"should_route_to_authoring": true,
|
|
58
|
-
"expected_mode": 2,
|
|
59
|
-
"rationale": "Mode 2 (update yaml SoT for existing primitive)."
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
{
|
|
63
|
-
"id": "authoring-mode-3-01",
|
|
64
|
-
"phrase": "build the chat-shell composition with the new sidebar slot",
|
|
65
|
-
"should_route_to_authoring": true,
|
|
66
|
-
"expected_mode": 3,
|
|
67
|
-
"rationale": "Mode 3 (author a SHELL)."
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"id": "authoring-mode-3-02",
|
|
71
|
-
"phrase": "author a new web-module shell at packages/web-modules/editor/editor-shell",
|
|
72
|
-
"should_route_to_authoring": true,
|
|
73
|
-
"expected_mode": 3,
|
|
74
|
-
"rationale": "Mode 3 — explicit web-modules + shell."
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"id": "authoring-mode-3-03",
|
|
78
|
-
"phrase": "add a pane behaviour to admin-shell per ADR-0023",
|
|
79
|
-
"should_route_to_authoring": true,
|
|
80
|
-
"expected_mode": 3,
|
|
81
|
-
"rationale": "Mode 3 — explicit ADR-0023 mention (bespoke shell rules)."
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
"id": "authoring-mode-4-01",
|
|
86
|
-
"phrase": "promote this inline content to a shared web-modules module",
|
|
87
|
-
"should_route_to_authoring": true,
|
|
88
|
-
"expected_mode": 4,
|
|
89
|
-
"rationale": "Mode 4 (promote INLINE → MODULE)."
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
"id": "authoring-mode-4-02",
|
|
93
|
-
"phrase": "this content keeps repeating across apps, extract to a shared module",
|
|
94
|
-
"should_route_to_authoring": true,
|
|
95
|
-
"expected_mode": 4,
|
|
96
|
-
"rationale": "Mode 4 — explicit repetition trigger."
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"id": "authoring-mode-4-03",
|
|
100
|
-
"phrase": "lift this billing-summary block from apps/saas to web-modules",
|
|
101
|
-
"should_route_to_authoring": true,
|
|
102
|
-
"expected_mode": 4,
|
|
103
|
-
"rationale": "Mode 4 — lift inline page content to reusable module."
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
{
|
|
107
|
-
"id": "authoring-mode-5-01",
|
|
108
|
-
"phrase": "audit the four-axis contract for table-ui",
|
|
109
|
-
"should_route_to_authoring": true,
|
|
110
|
-
"expected_mode": 5,
|
|
111
|
-
"rationale": "Mode 5 (audit existing component for drift)."
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
"id": "authoring-mode-5-02",
|
|
115
|
-
"phrase": "check the token usage in card-ui for drift",
|
|
116
|
-
"should_route_to_authoring": true,
|
|
117
|
-
"expected_mode": 5,
|
|
118
|
-
"rationale": "Mode 5 — token audit procedure."
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"id": "authoring-mode-5-03",
|
|
122
|
-
"phrase": "lifecycle audit on dropdown-ui — symmetric connected/disconnected?",
|
|
123
|
-
"should_route_to_authoring": true,
|
|
124
|
-
"expected_mode": 5,
|
|
125
|
-
"rationale": "Mode 5 — lifecycle audit."
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
{
|
|
129
|
-
"id": "authoring-mode-6-01",
|
|
130
|
-
"phrase": "extend the LLM bridge to add a new provider",
|
|
131
|
-
"should_route_to_authoring": true,
|
|
132
|
-
"expected_mode": 6,
|
|
133
|
-
"rationale": "Mode 6 (extend LLM bridge)."
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
"id": "authoring-mode-6-02",
|
|
137
|
-
"phrase": "modify createAdapter in @adia-ai/llm to add chunk-shape support",
|
|
138
|
-
"should_route_to_authoring": true,
|
|
139
|
-
"expected_mode": 6,
|
|
140
|
-
"rationale": "Mode 6 — explicit createAdapter + @adia-ai/llm mention."
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
"id": "authoring-mode-6-03",
|
|
144
|
-
"phrase": "set up the LLM-bridge surface for a new tool-call provider",
|
|
145
|
-
"should_route_to_authoring": true,
|
|
146
|
-
"expected_mode": 6,
|
|
147
|
-
"rationale": "Mode 6 trigger phrase."
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
"id": "authoring-mode-7-01",
|
|
152
|
-
"phrase": "make sure adia-ui-authoring knows about the new sidecar field",
|
|
153
|
-
"should_route_to_authoring": true,
|
|
154
|
-
"expected_mode": 7,
|
|
155
|
-
"rationale": "Mode 7 (§Teach) — explicit 'make sure adia-ui-authoring knows about X'."
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"id": "authoring-mode-7-02",
|
|
159
|
-
"phrase": "train the authoring skill on the admin-shell helper pattern",
|
|
160
|
-
"should_route_to_authoring": true,
|
|
161
|
-
"expected_mode": 7,
|
|
162
|
-
"rationale": "Mode 7 — 'train the skill on Y' trigger."
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"id": "authoring-mode-7-03",
|
|
166
|
-
"phrase": "absorb this new module-promotion pattern into adia-ui-authoring",
|
|
167
|
-
"should_route_to_authoring": true,
|
|
168
|
-
"expected_mode": 7,
|
|
169
|
-
"rationale": "Mode 7 — 'absorb this pattern into adia-ui-authoring' trigger."
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
{
|
|
173
|
-
"id": "authoring-mode-8-01",
|
|
174
|
-
"phrase": "author a demo for the billing-overview composite",
|
|
175
|
-
"should_route_to_authoring": true,
|
|
176
|
-
"expected_mode": 8,
|
|
177
|
-
"rationale": "Mode 8 (author demo / examples.html for composite or module)."
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
"id": "authoring-mode-8-02",
|
|
181
|
-
"phrase": "compose the examples.html for dashboard-layout",
|
|
182
|
-
"should_route_to_authoring": true,
|
|
183
|
-
"expected_mode": 8,
|
|
184
|
-
"rationale": "Mode 8 — 'compose examples.html for Y' trigger."
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
"id": "authoring-mode-8-03",
|
|
188
|
-
"phrase": "write the demo for <integrations-page-ui> in packages/web-modules/settings",
|
|
189
|
-
"should_route_to_authoring": true,
|
|
190
|
-
"expected_mode": 8,
|
|
191
|
-
"rationale": "Mode 8 — 'write the demo for `<module-ui>`' trigger + web-modules path."
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
{
|
|
195
|
-
"id": "authoring-adv-01",
|
|
196
|
-
"phrase": "compose this Figma mock into AdiaUI components for our consumer app",
|
|
197
|
-
"should_route_to_authoring": false,
|
|
198
|
-
"expected_alternative": "adia-ui-factory (consumer-side composition plugin)",
|
|
199
|
-
"rationale": "Adversarial — consumer-composition territory (composing screens FROM existing primitives in consumer code). Authoring skill explicitly NEG-clauses 'composing screens from existing primitives'."
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
"id": "authoring-adv-02",
|
|
203
|
-
"phrase": "cut a release of the next version and publish the npm packages",
|
|
204
|
-
"should_route_to_authoring": false,
|
|
205
|
-
"expected_alternative": "adia-ui-release",
|
|
206
|
-
"rationale": "Adversarial — release territory. Authoring skill NEG-clauses 'cutting a release'."
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
"id": "authoring-adv-03",
|
|
210
|
-
"phrase": "tune the zettel composition coverage; eval is at 38%",
|
|
211
|
-
"should_route_to_authoring": false,
|
|
212
|
-
"expected_alternative": "adia-ui-a2ui",
|
|
213
|
-
"rationale": "Adversarial — a2ui pipeline (compose strategies, eval coverage). Authoring NEG-clauses 'generation-pipeline internals'."
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"id": "authoring-adv-04",
|
|
217
|
-
"phrase": "build a user profile card with avatar and edit actions",
|
|
218
|
-
"should_route_to_authoring": false,
|
|
219
|
-
"expected_alternative": "adia-ui-factory (consumer-side composition plugin)",
|
|
220
|
-
"rationale": "Adversarial — canonical consumer-composition task (build UI from intent). Should NOT route to authoring."
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
"id": "authoring-adv-05",
|
|
224
|
-
"phrase": "deploy the api service to the hosting platform",
|
|
225
|
-
"should_route_to_authoring": false,
|
|
226
|
-
"expected_alternative": "a deployment/ops skill (out of this plugin's scope)",
|
|
227
|
-
"rationale": "Adversarial — deployment/ops territory. Off-topic for authoring."
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
"id": "authoring-adv-06",
|
|
231
|
-
"phrase": "explain how React hooks work",
|
|
232
|
-
"should_route_to_authoring": false,
|
|
233
|
-
"expected_alternative": null,
|
|
234
|
-
"rationale": "Adversarial — generic framework knowledge. Should not activate any AdiaUI skill."
|
|
235
|
-
}
|
|
236
|
-
],
|
|
237
|
-
|
|
238
|
-
"evaluator_notes": {
|
|
239
|
-
"current_state": "30 cases (24 trigger + 6 adversarial). Modes 1-8 each have 3 trigger cases. Adversarial cases cover the sibling forge skills (adia-ui-release, adia-ui-a2ui), the consumer-side composition plugin (adia-ui-factory), a generic deployment/ops boundary, and bare-framework.",
|
|
240
|
-
"scoring_notes_detail": "The bundled heuristic scorer (${CLAUDE_PLUGIN_ROOT}/bin/lib/run-skill-evals.mjs) computes token overlap between each phrase and the adia-ui-authoring description field. PASS = trigger phrases score above threshold AND adversarial phrases score below. The threshold is auto-calibrated per corpus run. This is a HEURISTIC: a phrase that fails the heuristic may still route correctly via the actual harness (which has additional signals — context, prior turns, file paths). Use misroutes as input for description-field tightening, not as harness ground truth.",
|
|
241
|
-
"promotion_criteria": "Promote to a CI gate (warn → hard-fail) when F1 ≥ 0.85 on this corpus across 3+ consecutive runs without description edits. Until then, run advisorily after every description change to detect regressions.",
|
|
242
|
-
"review_cadence": "Re-run on every adia-ui-authoring description edit (skill.json or SKILL.md frontmatter). Add 1-2 new cases per checkpoint reflecting newly-observed routing failure modes.",
|
|
243
|
-
"known_limitations": "Mode 4 (promote inline → module) and Mode 8 (composite demo authoring) have semantic overlap with each other ('lift to web-modules' vs 'author demo for module') — heuristic scorer may not disambiguate; the harness with mode-routing context will. Mode 7 (§Teach) is keyword-distinct ('make sure adia-ui-authoring knows', 'absorb pattern into') and should score reliably."
|
|
244
|
-
}
|
|
245
|
-
}
|