@adia-ai/adia-ui-forge 0.8.62 → 0.8.64
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 +2 -2
- package/.codex-plugin/plugin.json +3 -3
- package/CHANGELOG.md +317 -275
- package/README.md +54 -18
- package/__init__.py +8 -8
- package/agents/a2ui-maintenance-agent.corpus.json +7 -7
- package/agents/a2ui-maintenance-agent.md +6 -6
- package/agents/a2ui-planner-agent.md +11 -11
- package/agents/demo-audit-agent.corpus.json +4 -4
- package/agents/demo-audit-agent.md +8 -9
- package/agents/framework-checker.md +10 -11
- package/agents/framework-planner-agent.md +9 -10
- package/agents/gen-ui-review-agent.corpus.json +4 -4
- package/agents/gen-ui-review-agent.md +8 -8
- package/agents/package-release-agent.corpus.json +4 -4
- package/agents/package-release-agent.md +9 -10
- package/agents/primitive-authoring-agent.corpus.json +1 -1
- package/agents/primitive-authoring-agent.md +5 -5
- package/agents/routing-corpus.json +46 -46
- package/codex.interface.json +1 -1
- package/commands/gen-ui-review.md +1 -1
- package/commands/package-release.md +2 -2
- package/package.json +1 -1
- package/plugin.yaml +2 -2
- package/prompts/gen-ui-review.md +1 -1
- package/prompts/package-release.md +2 -2
- package/references/contracts/a2ui-mcp-surface.md +7 -7
- package/references/contracts/migration-guide-format.md +6 -7
- package/references/shared/content-trust.md +3 -5
- package/skills/a2ui-maintenance/SKILL.md +13 -16
- package/skills/a2ui-maintenance/evals/evals.json +2 -2
- package/skills/a2ui-maintenance/evals/routing-corpus.json +1 -1
- package/skills/a2ui-maintenance/references/anti-patterns.md +10 -10
- package/skills/a2ui-maintenance/references/chunk-authoring.md +11 -12
- package/skills/a2ui-maintenance/references/corpus-discipline.md +13 -14
- package/skills/a2ui-maintenance/references/data-model-reactivity.md +22 -25
- package/skills/a2ui-maintenance/references/eval-diagnostics.md +21 -21
- package/skills/a2ui-maintenance/references/format-extension-decisions.md +12 -13
- package/skills/a2ui-maintenance/references/leverage-rules.md +6 -6
- package/skills/a2ui-maintenance/references/mcp-pipeline-ops.md +9 -10
- package/skills/a2ui-maintenance/references/mcp-tool-reference.md +11 -12
- package/skills/a2ui-maintenance/references/pipeline-overview.md +33 -38
- package/skills/a2ui-maintenance/references/semantic-fail-lifting.md +13 -14
- package/skills/a2ui-maintenance/references/strategy-engines.md +14 -16
- package/skills/a2ui-maintenance/references/surface-lifecycle.md +10 -11
- package/skills/a2ui-maintenance/references/zettel-calibration.md +14 -16
- package/skills/component-md-authoring/SKILL.md +22 -22
- package/skills/component-md-authoring/agents/openai.yaml +1 -1
- package/skills/cross-harness-authoring-standards/SKILL.md +19 -21
- package/skills/cross-harness-authoring-standards/agents/openai.yaml +1 -1
- package/skills/cross-harness-compatibility-standards/SKILL.md +35 -34
- package/skills/cross-harness-compatibility-standards/agents/openai.yaml +1 -1
- package/skills/demo-audit/SKILL.md +38 -38
- package/skills/demo-audit/evals/routing-corpus.json +1 -1
- package/skills/demo-audit/references/admin-shell-anatomy.md +21 -25
- package/skills/demo-audit/references/app-shell-pitfalls.md +11 -13
- package/skills/demo-audit/references/auto-fix-allowlist.md +3 -3
- package/skills/demo-audit/references/card-anatomy-sweep.md +10 -11
- package/skills/demo-audit/references/chat-shell-anatomy.md +25 -26
- package/skills/demo-audit/references/editor-shell-anatomy.md +25 -28
- package/skills/demo-audit/references/html-attr-sweep.md +12 -13
- package/skills/demo-audit/references/mode7-status-battery.md +4 -4
- package/skills/demo-audit/references/native-leak-annotations.md +8 -8
- package/skills/demo-audit/references/output-contract-worked-example.md +8 -8
- package/skills/demo-audit/references/probe-discipline-and-escalation.md +2 -2
- package/skills/demo-audit/references/visual-probe-triage.md +21 -23
- package/skills/gen-ui-review/SKILL.md +28 -28
- package/skills/gen-ui-review/agents/openai.yaml +1 -1
- package/skills/gen-ui-review/evals/evals.json +1 -1
- package/skills/gen-ui-review/evals/routing-corpus.json +1 -1
- package/skills/gen-ui-review/references/corpus-html-patterns.md +28 -29
- package/skills/gen-ui-review/references/exit-gate-mechanics.md +5 -5
- package/skills/gen-ui-review/references/lookup-maintenance.md +2 -2
- package/skills/gen-ui-review/references/loop-protocol.md +25 -25
- package/skills/gen-ui-review/references/rubric-cosmetic.md +10 -10
- package/skills/gen-ui-review/references/rubric-decompose.md +15 -16
- package/skills/gen-ui-review/references/rubric-score.md +23 -24
- package/skills/gen-ui-review/references/scorecard-worked-examples.md +12 -12
- package/skills/gen-ui-review/references/scores.schema.json +2 -2
- package/skills/llm-client-maintenance/SKILL.md +12 -12
- package/skills/llm-client-maintenance/evals/routing-corpus.json +1 -1
- package/skills/llm-client-maintenance/references/adapter-contract.md +27 -27
- package/skills/llm-client-maintenance/references/add-a-provider.md +25 -25
- package/skills/llm-client-maintenance/references/bridge-facade.md +31 -31
- package/skills/llm-client-maintenance/references/browser-proxy-boundary.md +17 -17
- package/skills/llm-client-maintenance/references/model-registry.md +14 -14
- package/skills/llm-client-maintenance/references/streaming-sse.md +21 -21
- package/skills/package-release/SKILL.md +21 -23
- package/skills/package-release/evals/evals.json +2 -2
- package/skills/package-release/evals/routing-corpus.json +2 -2
- package/skills/package-release/references/authorization-model.md +6 -8
- package/skills/package-release/references/changelog-discipline.md +25 -27
- package/skills/package-release/references/cut-procedure.md +129 -136
- package/skills/package-release/references/gates-catalog.md +42 -43
- package/skills/package-release/references/independent-package-release.md +14 -15
- package/skills/package-release/references/invariants-detail.md +9 -9
- package/skills/package-release/references/mechanization.md +11 -12
- package/skills/package-release/references/migration-guide-authoring.md +20 -20
- package/skills/package-release/references/notes-authoring.md +20 -20
- package/skills/package-release/references/recovery-paths.md +28 -28
- package/skills/primitive-authoring/SKILL.md +19 -19
- package/skills/primitive-authoring/agents/openai.yaml +1 -1
- package/skills/primitive-authoring/evals/evals.json +2 -2
- package/skills/primitive-authoring/evals/routing-corpus.json +2 -2
- package/skills/primitive-authoring/references/INDEX.md +22 -22
- package/skills/primitive-authoring/references/anti-patterns.md +76 -77
- package/skills/primitive-authoring/references/api-contract.md +63 -65
- package/skills/primitive-authoring/references/authoring-cycle.md +47 -50
- package/skills/primitive-authoring/references/canonical-pattern-index.md +118 -118
- package/skills/primitive-authoring/references/code-style.md +50 -52
- package/skills/primitive-authoring/references/common-gotchas.md +23 -23
- package/skills/primitive-authoring/references/composite-demo-protocol.md +42 -45
- package/skills/primitive-authoring/references/css-patterns.md +97 -97
- package/skills/primitive-authoring/references/for-attribute-event-contract.md +12 -12
- package/skills/primitive-authoring/references/form-control-sizing.md +16 -18
- package/skills/primitive-authoring/references/lifecycle-patterns.md +42 -42
- package/skills/primitive-authoring/references/llm-bridge.md +21 -21
- package/skills/primitive-authoring/references/module-promotion.md +51 -51
- package/skills/primitive-authoring/references/primitive-audit.md +16 -16
- package/skills/primitive-authoring/references/shell-patterns.md +81 -81
- package/skills/primitive-authoring/references/svg-authoring.md +62 -66
- package/skills/primitive-authoring/references/token-contract.md +45 -49
- package/skills/primitive-authoring/references/trait-pages.md +8 -8
- package/skills/primitive-authoring/references/worked-example.md +39 -39
- package/skills/primitive-authoring/references/yaml-contract.md +139 -143
- package/skills/site-deployment/SKILL.md +25 -26
- package/skills/site-deployment/agents/openai.yaml +1 -1
- package/skills/site-deployment/evals/routing-corpus.json +1 -1
- package/skills/site-deployment/references/deploy-playbooks.md +51 -53
- package/skills/site-docs-authoring/SKILL.md +14 -14
- package/skills/site-docs-authoring/agents/openai.yaml +1 -1
- package/skills/site-docs-authoring/evals/evals.json +1 -1
- package/skills/site-docs-authoring/evals/routing-corpus.json +1 -1
- package/skills/site-docs-authoring/intent.md +18 -18
- package/skills/ssr-compatibility/SKILL.md +24 -25
- package/skills/ssr-compatibility/agents/openai.yaml +1 -1
- package/skills/ssr-compatibility/evals/evals.json +1 -1
- package/skills/ssr-compatibility/evals/routing-corpus.json +1 -1
- package/skills/ssr-compatibility/references/consumer-workarounds.md +22 -23
- package/skills/ssr-compatibility/references/failure-shapes.md +84 -91
- package/skills/ssr-compatibility/references/guard-patterns.md +54 -58
- package/skills/ssr-compatibility/references/status-ledger.md +17 -17
- package/skills/ssr-compatibility/references/test-without-linkedom.md +26 -27
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Leverage rules
|
|
1
|
+
# Leverage rules, when a repeated subtree earns its own corpus entry
|
|
2
2
|
|
|
3
3
|
Historical note first: the zettel **fragment mechanism is retired**
|
|
4
|
-
(`$fragment` refs now render as visible drift placeholders
|
|
4
|
+
(`$fragment` refs now render as visible drift placeholders, see
|
|
5
5
|
`compose/strategies/zettel/composer.js`). The leverage discipline below
|
|
6
6
|
outlived the mechanism: it now governs whether a repeated subtree gets split
|
|
7
7
|
into its own `data-chunk` block vs staying inline in its parent chunk, and it
|
|
@@ -9,13 +9,13 @@ is the calibration for any future extraction tier.
|
|
|
9
9
|
|
|
10
10
|
## The leverage rule
|
|
11
11
|
|
|
12
|
-
**Do not extract a reusable unit unless it has leverage ≥ 3
|
|
12
|
+
**Do not extract a reusable unit unless it has leverage ≥ 3**, at least 3
|
|
13
13
|
consumers would use it. Two exceptions:
|
|
14
14
|
|
|
15
|
-
1. **Singleton closing a semantic gap
|
|
15
|
+
1. **Singleton closing a semantic gap**, a distinct domain primitive (e.g. a
|
|
16
16
|
keyboard-shortcut row) justifies extraction at leverage 1 because the
|
|
17
17
|
concept itself needs to be retrievable.
|
|
18
|
-
2. **Intra-composition multi-use
|
|
18
|
+
2. **Intra-composition multi-use**, one composition instantiating the same
|
|
19
19
|
subtree N ≥ ~10 times justifies extraction; reuse is measured per instance,
|
|
20
20
|
not per referencing composition. Historical evidence: `calendar-day-cell`
|
|
21
21
|
used 35× inside one calendar composition lifted corpus reuse 26.4% → 33.5%
|
|
@@ -46,7 +46,7 @@ corpus split, DO NOT lower the threshold. In order:
|
|
|
46
46
|
|
|
47
47
|
1. Verify the parent's keywords were preserved (above).
|
|
48
48
|
2. Check the new entry's name/description doesn't cannibalize the parent's
|
|
49
|
-
semantic space (retrieval collision
|
|
49
|
+
semantic space (retrieval collision, see
|
|
50
50
|
[semantic-fail-lifting](semantic-fail-lifting.md) Strategy B).
|
|
51
51
|
3. Only then consider threshold work, with
|
|
52
52
|
[zettel-calibration](zettel-calibration.md) history read first.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# MCP pipeline operations
|
|
1
|
+
# MCP pipeline operations, generate → validate → render → feedback
|
|
2
2
|
|
|
3
3
|
Operator workflows against the a2ui MCP server. Tool schemas + wrappers:
|
|
4
4
|
[mcp-tool-reference](mcp-tool-reference.md).
|
|
5
5
|
|
|
6
|
-
## Full pipeline
|
|
6
|
+
## Full pipeline, one command
|
|
7
7
|
|
|
8
8
|
```bash
|
|
9
9
|
node scripts/mcp-pipeline.cjs "dashboard with 4 stat cards and a revenue chart"
|
|
@@ -22,7 +22,7 @@ echo '<paste-messages-json>' | node scripts/a2ui-to-html.cjs
|
|
|
22
22
|
node scripts/mcp-call.cjs check_anti_patterns '{"html":"<paste-rendered-html>"}'
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
`validate_schema` is fast and deterministic
|
|
25
|
+
`validate_schema` is fast and deterministic, batch it over
|
|
26
26
|
`packages/gen-ui/engine/corpus/chunks/*.json` templates to surface corpus drift without
|
|
27
27
|
re-running the generator.
|
|
28
28
|
|
|
@@ -51,18 +51,18 @@ node scripts/mcp-call.cjs refine_composition '{"state_id":"abc123","intent":"add
|
|
|
51
51
|
|
|
52
52
|
Two-pass synthesis (locator → modifier), validator-driven retry
|
|
53
53
|
(`maxAttempts=2`). Each refinement chains through `parent_state_id`; walk
|
|
54
|
-
history with `get_state`. The state cache is in-memory and bounded
|
|
54
|
+
history with `get_state`. The state cache is in-memory and bounded, after an
|
|
55
55
|
MCP server restart, re-run `compose_from_chunks` for a fresh `state_id`.
|
|
56
56
|
|
|
57
57
|
## Reporting issues
|
|
58
58
|
|
|
59
59
|
When the engine breaks expectations, fire `report_issue` with the most recent
|
|
60
60
|
`state_id` (reporter: `llm` for agent self-fire, `user` for a human request).
|
|
61
|
-
The record lands in the engine-internal telemetry store
|
|
61
|
+
The record lands in the engine-internal telemetry store, scratch data for
|
|
62
62
|
diagnosis. **[corrected 2026-08-23, ADR-0008 amendment]** that store is
|
|
63
63
|
`qa/findings/issues/<issue_id>.json`
|
|
64
64
|
(`packages/gen-ui/engine/compose/strategies/zettel/issue-reporter.js:10,26`,
|
|
65
|
-
`DEFAULT_STORAGE_ROOT`)
|
|
65
|
+
`DEFAULT_STORAGE_ROOT`), not the original `.brain/audit-history/issues/`
|
|
66
66
|
path, which was retired. Anything worth durable tracking (a recurring
|
|
67
67
|
pattern, a fix proposal) belongs in a GitHub issue or the PR description of
|
|
68
68
|
the fixing change.
|
|
@@ -88,20 +88,19 @@ gap registry (`packages/gen-ui/engine/corpus/gaps/registry.json`).
|
|
|
88
88
|
|
|
89
89
|
### Human signal (gh#668)
|
|
90
90
|
|
|
91
|
-
Every score in the store except a rating is self-graded
|
|
91
|
+
Every score in the store except a rating is self-graded, the validator marking
|
|
92
92
|
its own homework. Human thumbs are the only outside signal, and they arrive two
|
|
93
93
|
ways, both through the SAME function
|
|
94
94
|
(`packages/gen-ui/a2ui/retrieval/feedback/submit-feedback.js`) into the same JSONL:
|
|
95
95
|
|
|
96
96
|
- `submit_feedback` (MCP), and
|
|
97
|
-
- `POST /api/feedback` from a rendered surface
|
|
97
|
+
- `POST /api/feedback` from a rendered surface, today the gen-UI gallery's
|
|
98
98
|
`<agent-feedback-bar-ui>` row (thumbs-up = rating 5, thumbs-down = 2).
|
|
99
99
|
|
|
100
100
|
`get_training_gaps` ranks weak domains on `blendedScore`
|
|
101
101
|
(`retrieval/feedback/human-signal.js`): `0.7 * humanScore + 0.3 * selfScore`
|
|
102
102
|
where a domain has both signals, `humanScore` alone where it has no self-grade,
|
|
103
|
-
`selfScore` alone where it has no thumbs. **A missing signal is not a zero
|
|
104
|
-
weighting an absent self-grade as 0 would rank a domain humans unanimously
|
|
103
|
+
`selfScore` alone where it has no thumbs. **A missing signal is not a zero**, weighting an absent self-grade as 0 would rank a domain humans unanimously
|
|
105
104
|
approved below an unrated one the validator liked. So a domain the pipeline
|
|
106
105
|
scores 99 and humans thumb down ranks weak, not strong; `selfScore` averages
|
|
107
106
|
execution scores plus any `score` a rating carries inline, and `engine` /
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# MCP tool reference
|
|
1
|
+
# MCP tool reference, the a2ui server's tool surface
|
|
2
2
|
|
|
3
|
-
**Schema SoT is `packages/gen-ui/mcp/TOOLS.md` (the `gen-ui` section
|
|
4
|
-
generated alongside `server.js
|
|
3
|
+
**Schema SoT is `packages/gen-ui/mcp/TOOLS.md` (the `gen-ui` section, 31 tools),
|
|
4
|
+
generated alongside `server.js`, read it for input/output shapes; never
|
|
5
5
|
restate schemas here (they drift).** Tools register in
|
|
6
6
|
`packages/gen-ui/mcp/gen-ui/server.js` +
|
|
7
7
|
`packages/gen-ui/mcp/gen-ui/tools/{corpus,discovery,feedback,refine,synthesis,
|
|
@@ -10,10 +10,10 @@ validation,zettel}.js`. Any tool change updates TOOLS.md in the same commit.
|
|
|
10
10
|
## Stability rule (load-bearing)
|
|
11
11
|
|
|
12
12
|
Changing an existing tool's input/output contract is a breaking change for
|
|
13
|
-
every external MCP client. The full producer-side rule
|
|
13
|
+
every external MCP client. The full producer-side rule, dry-run schema diff,
|
|
14
14
|
explicit operator proceed, `@adia-ai/mcp` version bump, factory pin
|
|
15
15
|
update, and the consumer-load-bearing subset whose contracts are
|
|
16
|
-
frozen-unless-versioned
|
|
16
|
+
frozen-unless-versioned, lives in
|
|
17
17
|
[../../../references/contracts/a2ui-mcp-surface.md](../../../references/contracts/a2ui-mcp-surface.md).
|
|
18
18
|
Adding tools is additive and safe; removing or renaming is breaking.
|
|
19
19
|
|
|
@@ -36,25 +36,24 @@ Selection heuristics:
|
|
|
36
36
|
- **Fresh creation from a known page-shape** → `compose_from_chunks`
|
|
37
37
|
(retrieval-first); generic/novel intent → `generate_ui`.
|
|
38
38
|
- **Modifying an existing surface** ("change", "add to", "remove") →
|
|
39
|
-
`refine_composition` with the prior `state_id
|
|
39
|
+
`refine_composition` with the prior `state_id`, never re-generate.
|
|
40
40
|
- **Catalog literacy** → `lookup_component` / `get_component_map`; the MCP is
|
|
41
|
-
the live catalog
|
|
41
|
+
the live catalog, don't memorize component names.
|
|
42
42
|
- **Trust gate on any LLM-emitted A2UI** → `validate_schema` then
|
|
43
43
|
`check_anti_patterns` on the rendered HTML.
|
|
44
44
|
|
|
45
45
|
## Local wrappers (all verified in `scripts/`)
|
|
46
46
|
|
|
47
|
-
- `scripts/mcp-pipeline.cjs "<intent>"
|
|
47
|
+
- `scripts/mcp-pipeline.cjs "<intent>"`, full pipeline one-shot with a
|
|
48
48
|
combined report.
|
|
49
|
-
- `scripts/mcp-call.cjs <tool> '<json-args>'
|
|
49
|
+
- `scripts/mcp-call.cjs <tool> '<json-args>'`, single-tool call for stepping
|
|
50
50
|
through / inspecting intermediates.
|
|
51
|
-
- `scripts/a2ui-to-html.cjs [file|stdin]
|
|
51
|
+
- `scripts/a2ui-to-html.cjs [file|stdin]`, renders A2UI message arrays to
|
|
52
52
|
HTML between `validate_schema` and `check_anti_patterns`.
|
|
53
53
|
|
|
54
54
|
## When adding a tool
|
|
55
55
|
|
|
56
56
|
1. Register in the matching `mcp/tools/<group>.js` file (zod input schema +
|
|
57
57
|
description that names its trigger phrases and its non-goals).
|
|
58
|
-
2. Update `TOOLS.md` in the same commit (generated with the server build
|
|
59
|
-
`npm run build:mcp-server`).
|
|
58
|
+
2. Update `TOOLS.md` in the same commit (generated with the server build, `npm run build:mcp-server`).
|
|
60
59
|
3. Verify: `npm run mcp:smoke`, then a real-client round-trip.
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
# Pipeline overview
|
|
1
|
+
# Pipeline overview, generator + retrieval + engines (mode: modify pipeline internals)
|
|
2
2
|
|
|
3
|
-
## Protocol layers
|
|
3
|
+
## Protocol layers, v1.0 Candidate terms
|
|
4
4
|
|
|
5
5
|
Two protocol layers coexist (ADR-0059, `docs/ops/spec/spec-a2ui-v1-conformance.md`):
|
|
6
6
|
the shipping dialect this pipeline emits (Layer A, `packages/gen-ui/a2ui/`) and
|
|
7
7
|
the A2UI v1.0 Candidate stack (Layer B, `packages/genui/`) reached
|
|
8
8
|
through `packages/genui/wire-bridge/`. **[amended 2026-08-29, ADR-0096]**
|
|
9
9
|
`adiahealth/gen-ui-system` is absorbed first-party under `packages/genui/`
|
|
10
|
-
and the standalone repo is archived
|
|
10
|
+
and the standalone repo is archived, Layer B is in-repo source, not a
|
|
11
11
|
vendored dependency; `VENDOR.json` and the sync mechanism are gone (see
|
|
12
12
|
this same note on siblings `data-model-reactivity.md` and
|
|
13
13
|
`surface-lifecycle.md`). Candidate terminology is
|
|
14
|
-
**renderer/agent
|
|
14
|
+
**renderer/agent**, never client/server: `callableFrom` values are
|
|
15
15
|
`rendererOnly`/`agentOnly`/`rendererOrAgent`; the wire function kinds are
|
|
16
16
|
`callRendererFunction`/`callAgentFunction` +
|
|
17
17
|
`rendererFunctionResponse`/`agentFunctionResponse`; the MIME type is
|
|
18
18
|
`application/a2ui+json`; catalog resolution is strict (component `catalogId` →
|
|
19
19
|
surface `catalogId` → error, no registry default). The producer's
|
|
20
20
|
`wireFormat` flag (`packages/genui/adia-producer/exit-gate.js`) **[flipped
|
|
21
|
-
2026-08-30, PR #2412]** now defaults to `'v1'`, not `'dialect'
|
|
21
|
+
2026-08-30, PR #2412]** now defaults to `'v1'`, not `'dialect'`, ADR-0072
|
|
22
22
|
ratified the flip (its precondition, genui-system#51's re-verification,
|
|
23
23
|
re-scoped and satisfied via ADR-0096/PR #2401) and the flip itself has since
|
|
24
24
|
executed. Documents authored here stay dialect-shaped; the bridge owns the
|
|
25
|
-
translation
|
|
25
|
+
translation, never hand-write Candidate envelopes from this skill's
|
|
26
26
|
surfaces.
|
|
27
27
|
|
|
28
28
|
**Catalogs are opt-out scopes, not a taxonomy.** A2UI v1.0 lets a renderer
|
|
29
29
|
mix catalogs within one surface: `createSurface.catalogId` is the default,
|
|
30
30
|
and any component may carry its own `catalogId` to override it
|
|
31
31
|
(a2ui.org/specification/v1.0-a2ui/, "Catalog Reference"). So the useful way
|
|
32
|
-
to split a catalog is by what an app OMITS, never by component kind
|
|
32
|
+
to split a catalog is by what an app OMITS, never by component kind, Buttons
|
|
33
33
|
and Inputs are never omitted together, whole feature areas are. This is the
|
|
34
34
|
ratified basis of the five-catalog partition (gh#2211, Kim 2026-08-28):
|
|
35
35
|
`adia.core` / `adia.navigation` / `adia.data` / `adia.agent` / `adia.shells`,
|
|
@@ -51,17 +51,15 @@ ruling was load-bearing on `wireFormat` defaulting to `'dialect'`, with a
|
|
|
51
51
|
**Named expiry**: the flag-flip ADR that makes `'v1'` the shipping default
|
|
52
52
|
had to re-rule site-a2ui's fitness (re-point vs retirement-by-attrition).
|
|
53
53
|
|
|
54
|
-
**[resolved, ADR-0072
|
|
54
|
+
**[resolved, ADR-0072, retired 2026-08-31]** That trigger fired and was
|
|
55
55
|
ruled: retirement, not re-point (Decision 2). Passive attrition never
|
|
56
|
-
netted the promoted set down (355 pages and growing at last measurement
|
|
57
|
-
|
|
58
|
-
operator converted it to an active drain (gh#2410): the mechanism —
|
|
59
|
-
builder, ledger, artifact tree, gates, hook — is gone. The docs site now
|
|
56
|
+
netted the promoted set down (355 pages and growing at last measurement, regen work kept adding rows faster than breakage retired them), so the
|
|
57
|
+
operator converted it to an active drain (gh#2410): the mechanism, builder, ledger, artifact tree, gates, hook, is gone. The docs site now
|
|
60
58
|
renders every route through the legacy template path only; site-a2ui is
|
|
61
59
|
no longer part of this pipeline. The dialect side's regression-corpus
|
|
62
60
|
coverage site-a2ui once provided (real-content-scale exercise of the
|
|
63
61
|
dialect renderer, the ADR-0061 lifecycle path, and the engine transpiler)
|
|
64
|
-
has no standing replacement
|
|
62
|
+
has no standing replacement, see ADR-0072 Decision 2 / gh#2410 for the
|
|
65
63
|
closure record.
|
|
66
64
|
|
|
67
65
|
All paths repo-relative. Specs worth reading before structural changes:
|
|
@@ -90,21 +88,21 @@ for any constant or decision lives in git and PR descriptions
|
|
|
90
88
|
|
|
91
89
|
| File | Role |
|
|
92
90
|
| --- | --- |
|
|
93
|
-
| `packages/gen-ui/engine/compose/core/generator.js` | `generate_ui` orchestrator
|
|
94
|
-
| `packages/gen-ui/engine/compose/strategies/registry.js` | Engine registry
|
|
95
|
-
| `packages/gen-ui/engine/compose/strategies/zettel/` | Zettel + chunk-zettel engines
|
|
91
|
+
| `packages/gen-ui/engine/compose/core/generator.js` | `generate_ui` orchestrator, instant / pro / thinking / stream modes; multi-turn via `executionId` |
|
|
92
|
+
| `packages/gen-ui/engine/compose/strategies/registry.js` | Engine registry, `registerEngine(name, factory)`. Reserved names: `monolithic`, `monolithic-instant`, `monolithic-pro`, `monolithic-thinking`, `zettel`, `chunk-zettel`, `free-form` |
|
|
93
|
+
| `packages/gen-ui/engine/compose/strategies/zettel/` | Zettel + chunk-zettel engines, see [strategy-engines](strategy-engines.md) for the per-file map |
|
|
96
94
|
| `packages/gen-ui/engine/compose/strategies/free-form-composer/` | Free-form engine (`index.js`, `system-prompt.js`, `transpile.js`) |
|
|
97
95
|
| `packages/gen-ui/engine/compose/strategies/_shared/chunk-loader.js` | Shared chunk loading for engines |
|
|
98
|
-
| `packages/gen-ui/engine/compose/shared/validate-and-repair.js` | Shared closed-loop validate→repair, adopted by every LLM-calling engine (thinking/pro fully; free-form validate-only)
|
|
96
|
+
| `packages/gen-ui/engine/compose/shared/validate-and-repair.js` | Shared closed-loop validate→repair, adopted by every LLM-calling engine (thinking/pro fully; free-form validate-only), see [strategy-engines](strategy-engines.md) §Closed-loop validation |
|
|
99
97
|
| `packages/gen-ui/engine/compose/transpiler/transpiler.js` | HTML → A2UI transpile pass (used by harvester + convert_html) |
|
|
100
98
|
|
|
101
99
|
### Corpus + retrieval
|
|
102
100
|
|
|
103
101
|
| File | Role |
|
|
104
102
|
| --- | --- |
|
|
105
|
-
| `packages/gen-ui/engine/corpus/scripts/chunk-library.js` | Chunk catalog API
|
|
103
|
+
| `packages/gen-ui/engine/corpus/scripts/chunk-library.js` | Chunk catalog API, `getChunk()`, `searchChunks()` (keyword), `searchChunksAsync()` (keyword + cosine), `listChunksByKind()`, `lookupChunksByPrimary()`. Reads `corpus/chunks/` + `_index.json` (moved from `packages/gen-ui/a2ui/` under ADR-0048's package split, corrected 2026-08-16) |
|
|
106
104
|
| `packages/gen-ui/engine/compose/strategies/zettel/composition-library.js` | Composition loader + `searchAll()` scoring (normalizes harvested chunks to composition shape) |
|
|
107
|
-
| `scripts/build/harvest-chunks.mjs` | `[data-chunk]` boundary walker over `site/pages/`, `apps/`, `playgrounds/`, `catalog
|
|
105
|
+
| `scripts/build/harvest-chunks.mjs` | `[data-chunk]` boundary walker over `site/pages/`, `apps/`, `playgrounds/`, `catalog/`, writes `corpus/chunks/<name>.json` + `_index.json`. Run via `npm run harvest:chunks` |
|
|
108
106
|
| `packages/gen-ui/engine/retrieval/intent/intent-categorizer.js` | Free-text intent → UI-category taxonomy |
|
|
109
107
|
| `packages/gen-ui/engine/retrieval/feedback/feedback-analyzer.js` | Aggregates JSONL feedback (`corpus/feedback/*.jsonl`); promotion + gap candidates |
|
|
110
108
|
| `packages/gen-ui/engine/retrieval/feedback/gap-registry.js` | Persistent gap tracking → `packages/gen-ui/engine/corpus/gaps/registry.json` |
|
|
@@ -115,22 +113,22 @@ for any constant or decision lives in git and PR descriptions
|
|
|
115
113
|
|
|
116
114
|
| File | Role |
|
|
117
115
|
| --- | --- |
|
|
118
|
-
| `packages/llm/core/llm-bridge.js` | `createAdapter()
|
|
116
|
+
| `packages/llm/core/llm-bridge.js` | `createAdapter()`, real LLM or stub fallback |
|
|
119
117
|
| `scripts/load-env.mjs` | Shared .env loader for Node scripts |
|
|
120
|
-
| `packages/gen-ui/mcp/gen-ui/server.js` + `packages/gen-ui/mcp/gen-ui/tools/*.js` | MCP stdio server + tool registrations
|
|
118
|
+
| `packages/gen-ui/mcp/gen-ui/server.js` + `packages/gen-ui/mcp/gen-ui/tools/*.js` | MCP stdio server + tool registrations, see [mcp-tool-reference](mcp-tool-reference.md) |
|
|
121
119
|
|
|
122
120
|
## Critical rules
|
|
123
121
|
|
|
124
|
-
1. **Relative imports in `packages/llm/core/*.js
|
|
122
|
+
1. **Relative imports in `packages/llm/core/*.js`**, never `@llm/` Vite aliases;
|
|
125
123
|
they don't resolve in Node and break published consumers.
|
|
126
|
-
2. **`load-env.mjs` before any a2ui import in Node
|
|
124
|
+
2. **`load-env.mjs` before any a2ui import in Node**, without it,
|
|
127
125
|
`createAdapter()` silently returns `StubLLMAdapter` (canned 6-component
|
|
128
126
|
card). Feedback or diagnosis on stub output is noise.
|
|
129
127
|
3. **Metadata IS the search index.** Descriptions + keywords are what retrieval
|
|
130
128
|
matches. Enriching descriptions from structure (headings, labels, button
|
|
131
129
|
text) took meaningful-description rate 40% → 95%. When search degrades,
|
|
132
130
|
inspect chunk metadata before touching thresholds.
|
|
133
|
-
4. **Instant-mode gate lives in `monolithic/generate-instant.js
|
|
131
|
+
4. **Instant-mode gate lives in `monolithic/generate-instant.js`**, words ≥3
|
|
134
132
|
chars pass; `GATE_STOPS` filters boilerplate. Grep the set before concluding
|
|
135
133
|
"the gate rejects valid intents".
|
|
136
134
|
5. **A2UI describes LAYOUT, not behavior.** Generation emits component trees +
|
|
@@ -138,24 +136,21 @@ for any constant or decision lives in git and PR descriptions
|
|
|
138
136
|
traits or pre-built apps. "Make the generator emit JS/CSS" is a won't-fix.
|
|
139
137
|
**This is a GENERATION-pipeline claim, not the protocol's outer bound**
|
|
140
138
|
(ADR-0022 amendment, 2026-08-24): the protocol itself, as consumed by the
|
|
141
|
-
renderer and wire bridge, now carries a ratified CSS channel
|
|
142
|
-
`UpdateStylesMessage`/`RemoveStylesMessage`
|
|
139
|
+
renderer and wire bridge, now carries a ratified CSS channel, `UpdateStylesMessage`/`RemoveStylesMessage`
|
|
143
140
|
(`packages/gen-ui/a2ui/a2ui.schema.json:279-305`, renderer
|
|
144
|
-
`#updateStyles`/`#removeStyles` at `renderer.js:113-114,821-879`)
|
|
141
|
+
`#updateStyles`/`#removeStyles` at `renderer.js:113-114,821-879`), a
|
|
145
142
|
first-class part of the protocol, not a carve-out. What stays true
|
|
146
143
|
verbatim: compose/zettel synthesis itself still never emits
|
|
147
144
|
`updateStyles`, so this rule's generation claim is unchanged; only the
|
|
148
145
|
closed "the protocol never carries CSS at all" claim was falsified. JS
|
|
149
146
|
remains fully out of scope for both the protocol and generation.
|
|
150
|
-
6. **Renderer guards `textContent` against container wipe
|
|
151
|
-
`packages/gen-ui/a2ui/renderer.js` whitelists pure-text leaves
|
|
147
|
+
6. **Renderer guards `textContent` against container wipe**, `packages/gen-ui/a2ui/renderer.js` whitelists pure-text leaves
|
|
152
148
|
(`TEXT_TAG_OK`); everything else routes through the `text=` attribute so
|
|
153
149
|
slotted children survive. Preserve this when touching the renderer.
|
|
154
150
|
7. **Registry ↔ catalog parity.** A component in the runtime registry but
|
|
155
|
-
missing from catalog schemas silently drops from generated compositions
|
|
156
|
-
`npm run check:registry-catalog-coherence` guards it; run it after catalog
|
|
151
|
+
missing from catalog schemas silently drops from generated compositions, `npm run check:registry-catalog-coherence` guards it; run it after catalog
|
|
157
152
|
changes. `packages/gen-ui/a2ui/registry.js` is Class R (ADR-0069,
|
|
158
|
-
gh#3055): never hand-edit it
|
|
153
|
+
gh#3055): never hand-edit it, a new component enters through its yaml
|
|
159
154
|
`component:`/`tag:` fields, an alias or native-element mapping through
|
|
160
155
|
`packages/gen-ui/a2ui/registry.exceptions.json`, then
|
|
161
156
|
`node scripts/build/a2ui-registry.mjs` (derived-resync regenerates it on
|
|
@@ -170,28 +165,28 @@ for any constant or decision lives in git and PR descriptions
|
|
|
170
165
|
the accumulator; never write records to disk directly. Durable issue
|
|
171
166
|
tracking belongs in GitHub issues / PR descriptions, not the engine store.
|
|
172
167
|
10. **A new LLM-calling engine adopts `validate-and-repair.js` as its final
|
|
173
|
-
stage
|
|
168
|
+
stage**, full schema/catalog/anti-pattern conformance, orthogonal to
|
|
174
169
|
whatever narrower plan/grounding validation the engine already runs
|
|
175
170
|
(chunk-zettel's slot bindings, free-form's ingredient grounding). It
|
|
176
171
|
is NOT automatic: a raw-HTML-wrapper engine (chunk-zettel today, see
|
|
177
|
-
TKT-0009) gets zero value from it
|
|
172
|
+
TKT-0009) gets zero value from it, check the engine's actual output
|
|
178
173
|
shape is a real component graph before wiring it in.
|
|
179
174
|
11. **Escalation across engine tiers is the dispatcher's call, never the
|
|
180
|
-
engine's own
|
|
175
|
+
engine's own**, `registry.js`'s adapter wrappers (not
|
|
181
176
|
`generate-instant.js`/`generate-pro.js` themselves) decide whether a
|
|
182
177
|
hard-fail escalates to a stronger tier, capped at one hop. See
|
|
183
178
|
`generateInstantAdapter`'s comment for the worked example.
|
|
184
179
|
12. **`harvest-chunks.mjs` validates every templated chunk at admission
|
|
185
|
-
time** (validate-only, via the same shared module)
|
|
180
|
+
time** (validate-only, via the same shared module), report-only by
|
|
186
181
|
default; `--strict` refuses to write on any invalid chunk but is NOT
|
|
187
182
|
the default for `npm run harvest:chunks` (TKT-0010: 27% of the corpus
|
|
188
183
|
currently fails, mostly a schema-generation gap around `data-*`/`span`
|
|
189
|
-
attributes, not corpus-content defects
|
|
184
|
+
attributes, not corpus-content defects, see the ticket before
|
|
190
185
|
assuming a chunk is actually broken).
|
|
191
186
|
13. **Every generated catalog schema carries three synthesized universal
|
|
192
187
|
props today** (`slot`/`hidden`/`ariaLive`, none declared in any yaml
|
|
193
188
|
SoT); ADR-0097 rules a fourth, `traits`, but that part is decided-not-
|
|
194
|
-
yet-shipped (gh#2513)
|
|
189
|
+
yet-shipped (gh#2513), see `primitive-authoring/references/
|
|
195
190
|
yaml-contract.md` §Synthesized universal props for the full contract.
|
|
196
191
|
14. **Provider "extended thinking" is a strategy-level opt-in, not a
|
|
197
192
|
global default** (gh#3516, LLD-0033). PR #3511 (gh#3477) made
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Semantic fail lifting
|
|
1
|
+
# Semantic fail lifting, sub-60 triage procedure
|
|
2
2
|
|
|
3
3
|
Use when `npm run eval:diff -- --engine zettel --semantic` reports intents
|
|
4
4
|
with `semanticScore < 60` (or <70 for the watch list): the judge says the
|
|
@@ -6,26 +6,26 @@ emitted UI doesn't match what was asked for.
|
|
|
6
6
|
|
|
7
7
|
## The judge's three axes (`packages/gen-ui/engine/validate/semantic/index.js:32`)
|
|
8
8
|
|
|
9
|
-
- **dominantPattern** (weight 0.5)
|
|
9
|
+
- **dominantPattern** (weight 0.5), does the root/primary component match the
|
|
10
10
|
intent type (chat, form, calendar, data-display, nav…)?
|
|
11
|
-
- **requiredCapabilities** (weight 0.35)
|
|
11
|
+
- **requiredCapabilities** (weight 0.35), are the specific controls the
|
|
12
12
|
intent requires present?
|
|
13
|
-
- **forbiddenNoise** (weight 0.15)
|
|
13
|
+
- **forbiddenNoise** (weight 0.15), are off-topic components prominent?
|
|
14
14
|
|
|
15
15
|
A sub-60 score almost always means dominantPattern scored < 40.
|
|
16
16
|
|
|
17
17
|
## Triage
|
|
18
18
|
|
|
19
|
-
1. Read the latest eval run's zettel report
|
|
19
|
+
1. Read the latest eval run's zettel report, rows with `semanticScore < 70`,
|
|
20
20
|
ascending.
|
|
21
21
|
2. Per row, read `semanticAxes.dominantPattern.{expected, observed}` and
|
|
22
22
|
`semanticAxes.requiredCapabilities.missing`.
|
|
23
23
|
3. Bucket each failure:
|
|
24
|
-
- **Thin composition
|
|
24
|
+
- **Thin composition**: the retrieved entry exists but is too sparse
|
|
25
25
|
(calendar with nav + weekday labels but no grid).
|
|
26
|
-
- **Wrong composition winning
|
|
26
|
+
- **Wrong composition winning**, retrieval collision; another entry steals
|
|
27
27
|
the intent via keyword overlap.
|
|
28
|
-
- **No matching composition exists
|
|
28
|
+
- **No matching composition exists**, coverage gap; author a new one.
|
|
29
29
|
|
|
30
30
|
## Fix strategies, in order of preference
|
|
31
31
|
|
|
@@ -37,14 +37,13 @@ semantically correct primitive fixes it instantly. Historical lifts:
|
|
|
37
37
|
calendar → `CalendarPicker` root (32→65); chat → `Chat` with
|
|
38
38
|
`Text[role=user|assistant]` children (52→70+); command palette → `Command` >
|
|
39
39
|
`ActionItem` (42→70+). Check the live catalog before authoring children
|
|
40
|
-
(`lookup_component` / `get_component_map` MCP tools)
|
|
40
|
+
(`lookup_component` / `get_component_map` MCP tools), invented child
|
|
41
41
|
components (`ChatMessage`, `CommandItem`) score zero and trip
|
|
42
42
|
`noInventedComponents`.
|
|
43
43
|
|
|
44
|
-
### B. Resolve retrieval collisions by keyword surgery
|
|
44
|
+
### B. Resolve retrieval collisions by keyword surgery, both sides
|
|
45
45
|
|
|
46
|
-
When an unrelated entry wins retrieval, don't just enrich the correct entry
|
|
47
|
-
**strip the overlapping keywords from the losing entry too**. Historical
|
|
46
|
+
When an unrelated entry wins retrieval, don't just enrich the correct entry, **strip the overlapping keywords from the losing entry too**. Historical
|
|
48
47
|
example: `empty-state` kept winning "error state with retry" (sem=32) even
|
|
49
48
|
after a dedicated error-state entry existed, until "error state" and "retry"
|
|
50
49
|
were removed from empty-state's keywords; then the right entry won at sem=91.
|
|
@@ -53,7 +52,7 @@ were removed from empty-state's keywords; then the right entry won at sem=91.
|
|
|
53
52
|
|
|
54
53
|
Indicators: multiple intents fail pointing at the same wrong candidate, and no
|
|
55
54
|
existing entry's purpose matches `dominantPattern.expected`. Author it the
|
|
56
|
-
HTML-first way
|
|
55
|
+
HTML-first way, a demo page with `data-chunk` markers, then
|
|
57
56
|
`npm run harvest:chunks` (see [chunk-authoring](chunk-authoring.md)). Put the
|
|
58
57
|
pattern's signature affordance as the dominant child (steps-timeline for a
|
|
59
58
|
wizard, textarea+richtext for an editor, accordion for settings) and give it a
|
|
@@ -68,7 +67,7 @@ node packages/gen-ui/mcp/gen-ui/scripts/eval-diff.mjs --engine zettel --semantic
|
|
|
68
67
|
```
|
|
69
68
|
|
|
70
69
|
The semantic judge is cached, content-hashed on
|
|
71
|
-
(rubricVersion, intent, a2ui-messages)
|
|
70
|
+
(rubricVersion, intent, a2ui-messages), only changed generations re-judge.
|
|
72
71
|
Compare `avgSem` and the sub-60 list row by row; hold the zettel floors
|
|
73
72
|
(cov≥87, avg≥85, MRR≥0.94) and require `avgSem` ≥ baseline before calling a
|
|
74
73
|
lift done.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Strategy engines
|
|
1
|
+
# Strategy engines, zettel file map, strategy labels, issue telemetry
|
|
2
2
|
|
|
3
3
|
## File map (`packages/gen-ui/a2ui/compose/strategies/zettel/`, verified 2026-07)
|
|
4
4
|
|
|
@@ -29,13 +29,12 @@ corpus drift. Never author new `$fragment` refs.
|
|
|
29
29
|
LLM adapter is present; no LLM → `fragment-candidates` (atoms for downstream
|
|
30
30
|
assembly).
|
|
31
31
|
- **`chunk-zettel`**: chunk-corpus synthesis + `chunk-refiner.js` for
|
|
32
|
-
history-aware iteration. The zettel session-iteration branch was retired
|
|
33
|
-
turn≥2 on `zettel` takes the same path as turn 1 (fresh retrieval). True
|
|
32
|
+
history-aware iteration. The zettel session-iteration branch was retired, turn≥2 on `zettel` takes the same path as turn 1 (fresh retrieval). True
|
|
34
33
|
modify-an-existing-canvas work goes through `chunk-zettel` + `state_id`.
|
|
35
34
|
|
|
36
35
|
Both register independently in `strategies/registry.js`.
|
|
37
36
|
|
|
38
|
-
## Strategy labels (public contract
|
|
37
|
+
## Strategy labels (public contract, emitted to the eval harness)
|
|
39
38
|
|
|
40
39
|
| Label | Trigger | LLM call? |
|
|
41
40
|
| --- | --- | --- |
|
|
@@ -46,9 +45,9 @@ Both register independently in `strategies/registry.js`.
|
|
|
46
45
|
|
|
47
46
|
The eval harness scores per-label distribution; a calibration tweak that shifts
|
|
48
47
|
the distribution shifts the score. Don't rename labels without a coordinated
|
|
49
|
-
migration
|
|
48
|
+
migration, eval, MCP tools, and dialog-recorder pattern-match on the strings.
|
|
50
49
|
|
|
51
|
-
## Issue reporter
|
|
50
|
+
## Issue reporter, three call paths (`issue-reporter.js`)
|
|
52
51
|
|
|
53
52
|
| Path | Trigger | `reporter` | Suppression |
|
|
54
53
|
| --- | --- | --- | --- |
|
|
@@ -58,22 +57,21 @@ migration — eval, MCP tools, and dialog-recorder pattern-match on the strings.
|
|
|
58
57
|
|
|
59
58
|
Records land in an engine-internal store (`DEFAULT_STORAGE_ROOT` in
|
|
60
59
|
`issue-reporter.js`); traces >200KB spill to a sidecar `.trace.json`. The store
|
|
61
|
-
is scratch telemetry
|
|
60
|
+
is scratch telemetry, durable tracking of recurring patterns belongs in GitHub
|
|
62
61
|
issues / PR descriptions. Type taxonomy: `bug` / `training-gap` /
|
|
63
62
|
`protocol-gap` / `ux-feedback`; severity `nit` < `drift` < `blocker`; owner
|
|
64
63
|
`synthesis | retrieval | validator | chunk-corpus | mcp-protocol | unknown`.
|
|
65
64
|
|
|
66
|
-
## Closed-loop validation
|
|
65
|
+
## Closed-loop validation, chunk-zettel is deliberately NOT wired in
|
|
67
66
|
|
|
68
67
|
Every LLM-calling engine outside this directory (`generate-pro`,
|
|
69
68
|
`generate-thinking`) routes its final candidate through the shared
|
|
70
|
-
`packages/gen-ui/a2ui/compose/shared/validate-and-repair.js
|
|
69
|
+
`packages/gen-ui/a2ui/compose/shared/validate-and-repair.js`, full schema +
|
|
71
70
|
Ajv catalog + anti-pattern conformance, orthogonal to whatever narrower
|
|
72
71
|
check the engine already runs. `chunk-zettel` (`chunk-synthesizer.js`'s
|
|
73
72
|
`composeFromIntent`) does NOT get this: its result is a raw HTML
|
|
74
73
|
**string**, wrapped by the caller (`registry.js`, `generator-adapter.js`)
|
|
75
|
-
into a single node with an unregistered `component: 'article'` type
|
|
76
|
-
running full schema validation against that would report `invalid` on
|
|
74
|
+
into a single node with an unregistered `component: 'article'` type, running full schema validation against that would report `invalid` on
|
|
77
75
|
every single output, unconditionally, regardless of actual quality. See
|
|
78
76
|
TKT-0009 for the three-direction decision this is waiting on before any
|
|
79
77
|
change lands. `chunk-zettel`'s own `validatePlan` (chunk-existence/slot
|
|
@@ -81,7 +79,7 @@ checks) remains its complete validation contract for now.
|
|
|
81
79
|
|
|
82
80
|
Separately, `harvest-chunks.mjs` (corpus admission) now runs every
|
|
83
81
|
templated chunk through the same shared module (validate-only) at
|
|
84
|
-
harvest time
|
|
82
|
+
harvest time, report-only by default (`npm run harvest:chunks:dry`
|
|
85
83
|
shows the results); `--strict` enforcement is deferred to TKT-0010
|
|
86
84
|
(27% of the corpus currently fails, mostly a schema-generation gap
|
|
87
85
|
around `data-*`/`span` attributes rather than corpus-content defects).
|
|
@@ -102,13 +100,13 @@ option: no consumer threads it through `generateUI()`.
|
|
|
102
100
|
|
|
103
101
|
- **`STRONG_MATCH_THRESHOLD` was raised 22 → 40 post-incident.** Lowering it
|
|
104
102
|
reverts to repetitive verbatim output. If retrieval feels cold, profile the
|
|
105
|
-
score distribution via `searchAll()` debugging first
|
|
106
|
-
- **`state-cache` is per-process
|
|
103
|
+
score distribution via `searchAll()` debugging first, don't lower the gate.
|
|
104
|
+
- **`state-cache` is per-process**, multi-turn breaks across MCP server
|
|
107
105
|
restarts; the client must re-run `compose_from_chunks` for a fresh
|
|
108
106
|
`state_id`. Nothing durable belongs in state-cache.
|
|
109
|
-
- **`issueAccumulator` must be passed via `opts`** to refinement engines
|
|
107
|
+
- **`issueAccumulator` must be passed via `opts`** to refinement engines, a
|
|
110
108
|
newly wired engine that skips it silently drops auto-fired issues.
|
|
111
|
-
- **`PRE_SEARCH_LIMIT = 30` is kind-aware, not linear
|
|
109
|
+
- **`PRE_SEARCH_LIMIT = 30` is kind-aware, not linear**, see
|
|
112
110
|
[zettel-calibration](zettel-calibration.md) before judging it over-permissive.
|
|
113
111
|
|
|
114
112
|
## Verification
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Surface lifecycle
|
|
1
|
+
# Surface lifecycle, the runtime pending/stale contract (ADR-0061)
|
|
2
2
|
|
|
3
3
|
The renderer runtime (`packages/gen-ui/a2ui/`) owns a per-surface lifecycle
|
|
4
4
|
state machine, ratified by ADR-0061
|
|
@@ -21,31 +21,31 @@ empty → pending-first → live → pending-stale → live
|
|
|
21
21
|
one surface, the newest generation's commit wins; a superseded bracket's
|
|
22
22
|
messages are discarded, not interleaved.
|
|
23
23
|
- **Stale content stays visible.** In `pending-stale` and `error-stale` the
|
|
24
|
-
previous answer keeps rendering
|
|
24
|
+
previous answer keeps rendering: the blank-flash reset+replay shape is
|
|
25
25
|
what this contract retired. Error state heals: the next successful commit
|
|
26
26
|
clears `error-*`.
|
|
27
27
|
|
|
28
28
|
## The host API
|
|
29
29
|
|
|
30
|
-
Four public runtime methods drive the machine
|
|
30
|
+
Four public runtime methods drive the machine, `beginSurfaceUpdate` /
|
|
31
31
|
`applyTo` / `commitSurfaceUpdate` / `abortSurfaceUpdate`. Messages arriving
|
|
32
32
|
inside a bracket buffer and apply atomically at commit. A `replace`-mode
|
|
33
|
-
commit sweeps components the new answer no longer declares
|
|
33
|
+
commit sweeps components the new answer no longer declares, the ONLY place
|
|
34
34
|
removal semantics exist; outside a bracket, `updateComponents` upserts
|
|
35
35
|
exactly as before, so unbracketed streams and hosts are behavior-identical
|
|
36
36
|
to the pre-lifecycle runtime (strictly additive, ADR-0061 Decision 4).
|
|
37
37
|
`<a2ui-root>`'s `doc` setter routes through this replace bracket
|
|
38
|
-
(`replaceDoc`) rather than reset+replay
|
|
38
|
+
(`replaceDoc`) rather than reset+replay, a deliberate, ratified behavior
|
|
39
39
|
change for doc-setting hosts (ADR-0061 OD-2).
|
|
40
40
|
|
|
41
41
|
## The DOM contract
|
|
42
42
|
|
|
43
43
|
Staleness is exposed as one attribute plus three events, never styling:
|
|
44
44
|
|
|
45
|
-
- **`data-a2ui-lifecycle
|
|
45
|
+
- **`data-a2ui-lifecycle`**, a single enum attribute on the surface root
|
|
46
46
|
reflecting the current state. This is the `data-a2ui-*` prefix's FIRST
|
|
47
47
|
ratification (the pre-existing `data-a2ui-surface` stamp was accidental,
|
|
48
|
-
now ratified alongside it)
|
|
48
|
+
now ratified alongside it), the runtime-owned `data-*` tier, sibling to
|
|
49
49
|
ADR-0060's trait tier.
|
|
50
50
|
- **Three bubbling CustomEvents** mark the transitions.
|
|
51
51
|
- Hosts and primitives style off the attribute with semantic tokens: stale
|
|
@@ -58,14 +58,13 @@ Staleness is exposed as one attribute plus three events, never styling:
|
|
|
58
58
|
The lifecycle is renderer-runtime work on gen-ui-kit's side of the ADR-0059
|
|
59
59
|
line. The three wire envelope kinds (`beginSurfaceUpdate` /
|
|
60
60
|
`commitSurfaceUpdate` / `abortSurfaceUpdate` as v1.0 server kinds) are
|
|
61
|
-
defined by the v1.0 Candidate reference implementation
|
|
61
|
+
defined by the v1.0 Candidate reference implementation, `a2ui.schema.json`
|
|
62
62
|
gains nothing, the dialect wire format is byte-identical. Never hand-write
|
|
63
63
|
lifecycle envelopes from this skill's surfaces; the Bridge owns the mapping
|
|
64
64
|
when the kinds land.
|
|
65
65
|
|
|
66
66
|
**[amended 2026-08-29, ADR-0096]** `adiahealth/gen-ui-system` is absorbed
|
|
67
|
-
first-party under `packages/genui/` and the standalone repo is archived
|
|
68
|
-
there is no external, separately-governed "upstream standard" to wait on
|
|
67
|
+
first-party under `packages/genui/` and the standalone repo is archived, there is no external, separately-governed "upstream standard" to wait on
|
|
69
68
|
any more. ADR-0096 Decision 5: gen-ui-kit "owns the whole stack now... and
|
|
70
69
|
the v1.0 Candidate reference implementation itself, not only the consumer
|
|
71
70
|
side of a vendor boundary." Stream-driven regeneration now proceeds on
|
|
@@ -75,6 +74,6 @@ not an upstream release.
|
|
|
75
74
|
## Interlock worth knowing
|
|
76
75
|
|
|
77
76
|
The v1.0 conformance program's duplicate-`surfaceId` error (REQ-002)
|
|
78
|
-
sequences AFTER this API
|
|
77
|
+
sequences AFTER this API, the silent `createSurface` no-op it removes was
|
|
79
78
|
previously the only wire-visible re-target path, and the lifecycle bracket
|
|
80
79
|
is its sanctioned replacement.
|