@adia-ai/a2ui-compose 0.1.0 → 0.2.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +58 -1
  2. package/README.md +12 -8
  3. package/{engine → core}/generator.js +13 -13
  4. package/{engine → core}/state.js +2 -2
  5. package/index.js +4 -4
  6. package/package.json +17 -14
  7. package/{engines → strategies}/monolithic/_shared.js +9 -9
  8. package/{engines → strategies}/monolithic/generate-instant.js +8 -8
  9. package/{engines → strategies}/monolithic/generate-pro.js +10 -10
  10. package/{engines → strategies}/monolithic/generate-thinking.js +8 -8
  11. package/{engines → strategies}/registry.js +6 -6
  12. package/{engines → strategies}/zettel/generate.js +1 -1
  13. package/{engines → strategies}/zettel/session-store.js +1 -1
  14. package/transpiler/transpiler.js +1 -1
  15. package/engine/constitution.md +0 -78
  16. /package/{engine → core}/artifacts.js +0 -0
  17. /package/{engine → core}/context-store.js +0 -0
  18. /package/{engine → core}/pattern-export.js +0 -0
  19. /package/{engine → core}/pipeline/engine.js +0 -0
  20. /package/{engine → core}/pipeline/types.js +0 -0
  21. /package/{engine → core}/reference.js +0 -0
  22. /package/{engines → strategies}/zettel/_smoke.js +0 -0
  23. /package/{engines → strategies}/zettel/chunk-composer.js +0 -0
  24. /package/{engines → strategies}/zettel/chunk-refiner.js +0 -0
  25. /package/{engines → strategies}/zettel/chunk-synthesizer.js +0 -0
  26. /package/{engines → strategies}/zettel/composer.js +0 -0
  27. /package/{engines → strategies}/zettel/fragment-library.js +0 -0
  28. /package/{engines → strategies}/zettel/generator-adapter.js +0 -0
  29. /package/{engines → strategies}/zettel/issue-reporter.js +0 -0
  30. /package/{engines → strategies}/zettel/state-cache.js +0 -0
  31. /package/{engines → strategies}/zettel/synthesizer.js +0 -0
package/CHANGELOG.md CHANGED
@@ -10,6 +10,63 @@ generator graph.
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ _No pending changes._
14
+
15
+ ---
16
+
17
+ ## [0.2.0] - 2026-05-02
18
+
19
+ **Lockstep cut + boundary cleanup.** All 8 published `@adia-ai/*`
20
+ packages now share one version, governed by
21
+ [`docs/specs/package-architecture.md` § 15 (Versioning Policy)](../../../docs/specs/package-architecture.md#15-versioning-policy).
22
+ This release also lands the `engine/` ↔ `engines/` collision fix from
23
+ T3 of the
24
+ [`docs/plans/packages-architecture-fixes-2026-05-02.md`](../../../docs/plans/packages-architecture-fixes-2026-05-02.md)
25
+ plan.
26
+
27
+ ### Changed
28
+
29
+ - `version`: `0.1.0` → `0.2.0`.
30
+ - `dependencies["@adia-ai/a2ui-utils"]`: `^0.0.2` → `^0.2.0`.
31
+ - `dependencies["@adia-ai/a2ui-retrieval"]`: `^0.0.1` → `^0.2.0`.
32
+ - `dependencies["@adia-ai/a2ui-validator"]`: `^0.0.1` → `^0.2.0`.
33
+
34
+ - **Directory renames — `engine/` → `core/`, `engines/` → `strategies/`**
35
+ to remove the singular/plural collision that read as a typo. The
36
+ orchestrator (`generator.js`, `state.js`, `context-store.js`,
37
+ `artifacts.js`, `pattern-export.js`, `reference.js`, `pipeline/`) now
38
+ lives at `core/`; the pluggable strategies (`monolithic/`, `zettel/`,
39
+ `registry.js`) live at `strategies/`. The `transpiler/` directory's
40
+ internal imports were also rewritten by the same sweep (no behavior
41
+ change). All internal imports updated in one sweep.
42
+ - **`constitution.md` moved out of the package source** to
43
+ [`docs/specs/compose-constitution.md`](../../../docs/specs/compose-constitution.md)
44
+ so it doesn't ship in the published tarball. Pointer added in
45
+ README.
46
+ - **`package.json` `exports` map updated** with new keys (`./core`,
47
+ `./strategies/registry`, `./strategies/zettel`); old keys
48
+ (`./engine`, `./engines/registry`, `./engines/zettel`) retained as
49
+ aliases for one release cycle and removed in the next major.
50
+ - Spec [`docs/specs/package-architecture.md`](../../../docs/specs/package-architecture.md)
51
+ bumped 0.5.0 → 0.6.0 with the directory tree updated to reflect the
52
+ new layout; new § 15 documents the lockstep versioning policy.
53
+
54
+ ### Migration
55
+
56
+ Consumers importing from the old paths still work for one release
57
+ cycle, but should update on next touch:
58
+
59
+ ```diff
60
+ - import { generateUI } from '@adia-ai/a2ui-compose/engine';
61
+ + import { generateUI } from '@adia-ai/a2ui-compose/core';
62
+
63
+ - import { pick, registerEngine } from '@adia-ai/a2ui-compose/engines/registry';
64
+ + import { pick, registerEngine } from '@adia-ai/a2ui-compose/strategies/registry';
65
+
66
+ - import { generateZettel } from '@adia-ai/a2ui-compose/engines/zettel';
67
+ + import { generateZettel } from '@adia-ai/a2ui-compose/strategies/zettel';
68
+ ```
69
+
13
70
  ---
14
71
 
15
72
  ## [0.1.0] - 2026-04-28
@@ -85,7 +142,7 @@ thin until Phase B introduces typed component-tree refinements.
85
142
 
86
143
  ### Out of scope (Phase B / C)
87
144
 
88
- - Persistent state across server restarts (SQLite-backed cache).
145
+ - Persistent state across server restarts (filesystem-JSON-backed cache at `.brain/state-cache/`; mirrors the existing audit-ledger convention; design in plan §2).
89
146
  - Branching / version trees.
90
147
  - LLM-streamed op emission.
91
148
  - Multi-user concurrent refinement (CRDT / OT).
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # @adia-ai/a2ui-compose
2
2
 
3
- Framework-agnostic UI generation engine. Takes a natural-language intent +
3
+ Framework-agnostic UI generation engine. Constitution doc:
4
+ [`docs/specs/compose-constitution.md`](../../../docs/specs/compose-constitution.md).
5
+ Takes a natural-language intent +
4
6
  an A2UI component catalog and produces a tree of A2UI protocol messages
5
7
  ready for a renderer.
6
8
 
@@ -24,7 +26,7 @@ intent ─▶ classify ─▶ retrieve ─▶ compose / adapt ─▶ val
24
26
  One entry point, two generation strategies, pluggable LLM back-end.
25
27
 
26
28
  ```javascript
27
- import { generateUI } from '@adia-ai/a2ui-compose/engine';
29
+ import { generateUI } from '@adia-ai/a2ui-compose/core';
28
30
 
29
31
  const result = await generateUI({
30
32
  intent: 'login form with email, password, and remember-me',
@@ -41,11 +43,13 @@ const result = await generateUI({
41
43
  ## Layout
42
44
 
43
45
  ```
44
- gen-ui/
45
- ├── engine/
46
- └── generator.js generateUI() — the one public entry point
46
+ a2ui-compose/
47
+ ├── core/ orchestrator — state, dispatch, pipeline (formerly engine/)
48
+ ├── generator.js generateUI() — the one public entry point
49
+ │ ├── state.js ArtifactStore + PipelineEngine singletons
50
+ │ └── pipeline/ 6-stage pipeline engine
47
51
 
48
- ├── engines/ pluggable strategies via registerEngine()
52
+ ├── strategies/ pluggable engines via registerEngine() (formerly engines/)
49
53
  │ ├── registry.js engine selector + reserved-name guard
50
54
  │ ├── monolithic/ pattern-match + LLM-adapt (3 modes)
51
55
  │ │ ├── generate-instant.js no LLM — pattern-match only
@@ -54,7 +58,7 @@ gen-ui/
54
58
  │ └── zettel/ fragment-graph composition
55
59
  │ ├── generator-adapter.js entry point
56
60
  │ ├── composer.js assembles fragments → compositions
57
- │ └── session.js multi-turn state
61
+ │ └── session-store.js multi-turn state (Phase A)
58
62
 
59
63
  ├── retrieval/
60
64
  │ ├── catalog.js loads component schemas from sibling .a2ui.json
@@ -98,7 +102,7 @@ and assembles them into compositions. Verbatim retrieval above a threshold
98
102
  across multi-turn iterations.
99
103
 
100
104
  ```javascript
101
- import { registerEngine } from '@adia-ai/a2ui-compose/engines/registry';
105
+ import { registerEngine } from '@adia-ai/a2ui-compose/strategies/registry';
102
106
 
103
107
  registerEngine('my-engine', async (ctx) => {
104
108
  // ctx: intent, catalog, patterns, concepts, session, llm, …
@@ -14,21 +14,21 @@
14
14
  import { validateSchema } from '../../validator/validator.js';
15
15
  import { getContext, searchBlocks, searchBlocksSemantic, lookupDomain, listPatterns } from './reference.js';
16
16
  import { store, engine } from './state.js';
17
- import { checkIntentAlignment } from '../../retrieval/intent-alignment.js';
18
- import { decomposeIntent, composeSubtasks } from '../../retrieval/decomposer.js';
17
+ import { checkIntentAlignment } from '../../retrieval/intent/intent-alignment.js';
18
+ import { decomposeIntent, composeSubtasks } from '../../retrieval/intent/decomposer.js';
19
19
  import { getWiringCatalog } from '../../retrieval/wiring-catalog.js';
20
20
  import { getComponentData } from '../../retrieval/pattern-library.js';
21
21
 
22
22
  import { StubLLMAdapter } from '../llm/llm-stub.js';
23
23
  import { createAdapter } from '../llm/llm-bridge.js';
24
- import { assessClarity } from '../../retrieval/clarity.js';
25
- import { isConversational } from '../../retrieval/intent-gate.js';
24
+ import { assessClarity } from '../../retrieval/intent/clarity.js';
25
+ import { isConversational } from '../../retrieval/intent/intent-gate.js';
26
26
  import { classifyIntent } from '../../retrieval/domain-router.js';
27
- import { researchIntent, detectReferences } from '../../retrieval/web-research.js';
28
- import { feedbackStore } from '../../retrieval/feedback-store.js';
29
- import { pick as pickEngine, registerMonolithicEngines } from '../engines/registry.js';
30
- import { analyzePrompt } from '../../retrieval/prompt-analyzer.js';
31
- import { recordTurn, isRecording } from '../../retrieval/dialog-recorder.js';
27
+ import { researchIntent, detectReferences } from '../../retrieval/authoring/web-research.js';
28
+ import { feedbackStore } from '../../retrieval/feedback/feedback-store.js';
29
+ import { pick as pickEngine, registerMonolithicEngines } from '../strategies/registry.js';
30
+ import { analyzePrompt } from '../../retrieval/intent/prompt-analyzer.js';
31
+ import { recordTurn, isRecording } from '../../retrieval/feedback/dialog-recorder.js';
32
32
  import {
33
33
  buildSystemPrompt,
34
34
  buildChatMessages,
@@ -38,10 +38,10 @@ import {
38
38
  parseA2UIResponse,
39
39
  buildRepairPrompt,
40
40
  generateSuggestions,
41
- } from '../engines/monolithic/_shared.js';
42
- import { generateInstant } from '../engines/monolithic/generate-instant.js';
43
- import { generatePro } from '../engines/monolithic/generate-pro.js';
44
- import { generateThinking } from '../engines/monolithic/generate-thinking.js';
41
+ } from '../strategies/monolithic/_shared.js';
42
+ import { generateInstant } from '../strategies/monolithic/generate-instant.js';
43
+ import { generatePro } from '../strategies/monolithic/generate-pro.js';
44
+ import { generateThinking } from '../strategies/monolithic/generate-thinking.js';
45
45
 
46
46
 
47
47
  /**
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Shared module-level singletons for the monolithic engine.
3
3
  *
4
- * These were previously private to engine/generator.js. Extracted so that
5
- * engines/monolithic/generate-{instant,pro,thinking}.js can share the same
4
+ * These were previously private to core/generator.js. Extracted so that
5
+ * strategies/monolithic/generate-{instant,pro,thinking}.js can share the same
6
6
  * artifact store and pipeline engine without going through the dispatcher.
7
7
  *
8
8
  * Same instances, imported by reference — do NOT re-instantiate per-call.
package/index.js CHANGED
@@ -5,12 +5,12 @@
5
5
  * via subpaths:
6
6
  *
7
7
  * import { generateUI } from '@adia-ai/a2ui-compose';
8
- * import { pick, registerEngine } from '@adia-ai/a2ui-compose/engines/registry';
9
- * import { generateZettel } from '@adia-ai/a2ui-compose/engines/zettel';
8
+ * import { pick, registerEngine } from '@adia-ai/a2ui-compose/strategies/registry';
9
+ * import { generateZettel } from '@adia-ai/a2ui-compose/strategies/zettel';
10
10
  * import { llmBridge } from '@adia-ai/a2ui-compose/llm';
11
11
  *
12
12
  * See README for the full public surface.
13
13
  */
14
14
 
15
- export { generateUI, generateUIStream } from './engine/generator.js';
16
- export { pick, listEngines, registerEngine, unregisterEngine, ENGINES } from './engines/registry.js';
15
+ export { generateUI, generateUIStream } from './core/generator.js';
16
+ export { pick, listEngines, registerEngine, unregisterEngine, ENGINES } from './strategies/registry.js';
package/package.json CHANGED
@@ -1,21 +1,24 @@
1
1
  {
2
2
  "name": "@adia-ai/a2ui-compose",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "AdiaUI A2UI compose engine — framework-agnostic. Takes natural-language intents + a catalog and produces A2UI protocol messages. Pairs with `@adia-ai/a2ui-retrieval` (intent classification, catalog lookup) and `@adia-ai/a2ui-validator` (schema + semantic checks).",
5
5
  "type": "module",
6
6
  "exports": {
7
- ".": "./index.js",
8
- "./engine": "./engine/generator.js",
9
- "./engines/zettel": "./engines/zettel/generator-adapter.js",
10
- "./engines/registry": "./engines/registry.js",
11
- "./llm": "./llm/llm-bridge.js",
12
- "./llm/*": "./llm/*.js",
13
- "./transpiler": "./transpiler/transpiler.js",
14
- "./evals": "./evals/harness.mjs"
7
+ ".": "./index.js",
8
+ "./core": "./core/generator.js",
9
+ "./strategies/zettel": "./strategies/zettel/generator-adapter.js",
10
+ "./strategies/registry": "./strategies/registry.js",
11
+ "./llm": "./llm/llm-bridge.js",
12
+ "./llm/*": "./llm/*.js",
13
+ "./transpiler": "./transpiler/transpiler.js",
14
+ "./evals": "./evals/harness.mjs",
15
+ "./engine": "./core/generator.js",
16
+ "./engines/zettel": "./strategies/zettel/generator-adapter.js",
17
+ "./engines/registry": "./strategies/registry.js"
15
18
  },
16
19
  "files": [
17
- "engine/",
18
- "engines/",
20
+ "core/",
21
+ "strategies/",
19
22
  "llm/",
20
23
  "evals/",
21
24
  "transpiler/",
@@ -34,8 +37,8 @@
34
37
  "directory": "packages/a2ui/compose"
35
38
  },
36
39
  "dependencies": {
37
- "@adia-ai/a2ui-utils": "^0.0.2",
38
- "@adia-ai/a2ui-retrieval": "^0.0.1",
39
- "@adia-ai/a2ui-validator": "^0.0.1"
40
+ "@adia-ai/a2ui-utils": "^0.2.0",
41
+ "@adia-ai/a2ui-retrieval": "^0.2.0",
42
+ "@adia-ai/a2ui-validator": "^0.2.0"
40
43
  }
41
44
  }
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * @adia-ai/a2ui-compose — monolithic engine, shared helpers.
3
3
  *
4
- * Pure helpers extracted from engine/generator.js per spec §11 Phase 2:
4
+ * Pure helpers extracted from core/generator.js per spec §11 Phase 2:
5
5
  * prompt builders, JSON parsers, canvas diff utilities, suggestion
6
6
  * generators. All stateless (the only module-level state is the lazy
7
7
  * component-catalog cache inside getComponentCatalog).
8
8
  */
9
9
 
10
- import { listPatterns } from '../../engine/reference.js';
11
- import { store } from '../../engine/state.js';
12
- import { checkIntentAlignment } from '../../../retrieval/intent-alignment.js';
13
- import { composeSubtasks } from '../../../retrieval/decomposer.js';
10
+ import { listPatterns } from '../../core/reference.js';
11
+ import { store } from '../../core/state.js';
12
+ import { checkIntentAlignment } from '../../../retrieval/intent/intent-alignment.js';
13
+ import { composeSubtasks } from '../../../retrieval/intent/decomposer.js';
14
14
  import { getWiringCatalog } from '../../../retrieval/wiring-catalog.js';
15
15
  import { getComponentData } from '../../../retrieval/pattern-library.js';
16
16
 
@@ -412,10 +412,10 @@ STATE LAYER:
412
412
  Controllers: ${wc.controllers.map(c => c.type).join(', ')} (extensible via registerController)
413
413
  "bind" maps controller state ↔ model paths for two-way sync.
414
414
 
415
- ACTIONS LAYER — AdiaEvent → handler chains:
416
- Each action binds a AdiaEvent to a handler. The event is a typed object, not a string.
415
+ ACTIONS LAYER — UIEvent → handler chains:
416
+ Each action binds a UIEvent to a handler. The event is a typed object, not a string.
417
417
 
418
- AdiaEvent types: ${wc.adiaEvents.map(e => e.event).join(', ')}
418
+ UIEvent types: ${wc.adiaEvents.map(e => e.event).join(', ')}
419
419
  Each carries a typed payload:
420
420
  ${wc.adiaEvents.filter(e => e.payload).map(e => ` ${e.event} → ${e.payload}`).join('\n')}
421
421
 
@@ -434,7 +434,7 @@ ${wc.adiaEvents.filter(e => e.payload).map(e => ` ${e.event} → ${e.payload}
434
434
  }
435
435
  ]
436
436
 
437
- AdiaEvent shape: { "event": "<type>", "target": "<componentId>", "debounce"?: ms, "throttle"?: ms, "condition"?: { "path", "equals"|"notEquals"|"exists" } }
437
+ UIEvent shape: { "event": "<type>", "target": "<componentId>", "debounce"?: ms, "throttle"?: ms, "condition"?: { "path", "equals"|"notEquals"|"exists" } }
438
438
  "target" scopes to a component id. Omit for surface-level events (mount, unmount).
439
439
  "onSuccess" / "onError" are follow-up action arrays — NOT separate entries.
440
440
  Handlers: ${wc.handlers.map(h => h.name).join(', ')} (extensible via registerHandler)
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @adia-ai/a2ui-compose — monolithic engine, instant mode.
3
3
  *
4
- * Extracted from engine/generator.js per spec §11 Phase 2. Shares state
5
- * (ArtifactStore, PipelineEngine) via engine/state.js. Pure helpers live
6
- * in engines/monolithic/_shared.js.
4
+ * Extracted from core/generator.js per spec §11 Phase 2. Shares state
5
+ * (ArtifactStore, PipelineEngine) via core/state.js. Pure helpers live
6
+ * in strategies/monolithic/_shared.js.
7
7
  */
8
8
 
9
9
  import { validateSchema } from '../../../validator/validator.js';
10
- import { getContext, searchBlocks, lookupDomain } from '../../engine/reference.js';
11
- import { assessClarity } from '../../../retrieval/clarity.js';
12
- import { feedbackStore } from '../../../retrieval/feedback-store.js';
13
- import { store, engine } from '../../engine/state.js';
14
- import { isRecording } from '../../../retrieval/dialog-recorder.js';
10
+ import { getContext, searchBlocks, lookupDomain } from '../../core/reference.js';
11
+ import { assessClarity } from '../../../retrieval/intent/clarity.js';
12
+ import { feedbackStore } from '../../../retrieval/feedback/feedback-store.js';
13
+ import { store, engine } from '../../core/state.js';
14
+ import { isRecording } from '../../../retrieval/feedback/dialog-recorder.js';
15
15
  import {
16
16
  generateSuggestions,
17
17
  } from './_shared.js';
@@ -1,19 +1,19 @@
1
1
  /**
2
2
  * @adia-ai/a2ui-compose — monolithic engine, pro mode.
3
3
  *
4
- * Extracted from engine/generator.js per spec §11 Phase 2. Shares state
5
- * (ArtifactStore, PipelineEngine) via engine/state.js. Pure helpers live
6
- * in engines/monolithic/_shared.js.
4
+ * Extracted from core/generator.js per spec §11 Phase 2. Shares state
5
+ * (ArtifactStore, PipelineEngine) via core/state.js. Pure helpers live
6
+ * in strategies/monolithic/_shared.js.
7
7
  */
8
8
 
9
9
  import { validateSchema } from '../../../validator/validator.js';
10
- import { getContext, searchBlocks, lookupDomain } from '../../engine/reference.js';
11
- import { decomposeIntent } from '../../../retrieval/decomposer.js';
12
- import { assessClarity } from '../../../retrieval/clarity.js';
13
- import { isConversational } from '../../../retrieval/intent-gate.js';
14
- import { feedbackStore } from '../../../retrieval/feedback-store.js';
15
- import { store, engine } from '../../engine/state.js';
16
- import { isRecording } from '../../../retrieval/dialog-recorder.js';
10
+ import { getContext, searchBlocks, lookupDomain } from '../../core/reference.js';
11
+ import { decomposeIntent } from '../../../retrieval/intent/decomposer.js';
12
+ import { assessClarity } from '../../../retrieval/intent/clarity.js';
13
+ import { isConversational } from '../../../retrieval/intent/intent-gate.js';
14
+ import { feedbackStore } from '../../../retrieval/feedback/feedback-store.js';
15
+ import { store, engine } from '../../core/state.js';
16
+ import { isRecording } from '../../../retrieval/feedback/dialog-recorder.js';
17
17
  import {
18
18
  buildSystemPrompt,
19
19
  buildChatMessages,
@@ -1,18 +1,18 @@
1
1
  /**
2
2
  * @adia-ai/a2ui-compose — monolithic engine, thinking mode.
3
3
  *
4
- * Extracted from engine/generator.js per spec §11 Phase 2. Shares state
5
- * (ArtifactStore, PipelineEngine) via engine/state.js. Pure helpers live
6
- * in engines/monolithic/_shared.js.
4
+ * Extracted from core/generator.js per spec §11 Phase 2. Shares state
5
+ * (ArtifactStore, PipelineEngine) via core/state.js. Pure helpers live
6
+ * in strategies/monolithic/_shared.js.
7
7
  */
8
8
 
9
9
  import { validateSchema } from '../../../validator/validator.js';
10
10
  import { validateMessages as validateCatalog } from '../../../validator/catalog-validator.js';
11
- import { getContext, searchBlocksSemantic, lookupDomain } from '../../engine/reference.js';
12
- import { assessClarity } from '../../../retrieval/clarity.js';
13
- import { feedbackStore } from '../../../retrieval/feedback-store.js';
14
- import { store, engine } from '../../engine/state.js';
15
- import { isRecording } from '../../../retrieval/dialog-recorder.js';
11
+ import { getContext, searchBlocksSemantic, lookupDomain } from '../../core/reference.js';
12
+ import { assessClarity } from '../../../retrieval/intent/clarity.js';
13
+ import { feedbackStore } from '../../../retrieval/feedback/feedback-store.js';
14
+ import { store, engine } from '../../core/state.js';
15
+ import { isRecording } from '../../../retrieval/feedback/dialog-recorder.js';
16
16
  import {
17
17
  buildSystemPrompt,
18
18
  buildChatMessages,
@@ -7,7 +7,7 @@
7
7
  * - zettel → fragment-graph composition (single mode: instant)
8
8
  *
9
9
  * The registry deliberately does NOT own intent-gating, clarity assessment, or
10
- * execution lifecycle — the public `generateUI()` in engine/generator.js does
10
+ * execution lifecycle — the public `generateUI()` in core/generator.js does
11
11
  * that, then delegates the actual work through `pick()`.
12
12
  *
13
13
  * Shape invariant: every engine function returns
@@ -15,8 +15,8 @@
15
15
  */
16
16
 
17
17
  // Zettel is lazy-loaded — it transitively imports node:fs / node:path / node:url
18
- // (engines/zettel/fragment-library.js), which Vite externalizes in the browser.
19
- // Static-importing it here would break browser loads of engine/generator.js.
18
+ // (strategies/zettel/fragment-library.js), which Vite externalizes in the browser.
19
+ // Static-importing it here would break browser loads of core/generator.js.
20
20
  // In-browser callers reach zettel via POST /api/generate (server-side), never
21
21
  // through this registry, so lazy-loading is safe and incurs only a one-time
22
22
  // import on first server-side invocation.
@@ -33,15 +33,15 @@ async function getGenerateZettel() {
33
33
  let _isRecording = null;
34
34
  async function getIsRecording() {
35
35
  if (!_isRecording) {
36
- const mod = await import('../../retrieval/dialog-recorder.js');
36
+ const mod = await import('../../retrieval/feedback/dialog-recorder.js');
37
37
  _isRecording = mod.isRecording;
38
38
  }
39
39
  return _isRecording;
40
40
  }
41
41
 
42
- // The three monolithic paths live inside engine/generator.js as internal
42
+ // The three monolithic paths live inside core/generator.js as internal
43
43
  // functions. They're injected at boot via `registerMonolithicEngines()` to
44
- // avoid a circular import (engine/generator.js owns the registry caller).
44
+ // avoid a circular import (core/generator.js owns the registry caller).
45
45
  let _monolithicInstant = null;
46
46
  let _monolithicPro = null;
47
47
  let _monolithicThinking = null;
@@ -9,7 +9,7 @@
9
9
  * existing canvas instead of regenerating
10
10
  *
11
11
  * The actual implementation is generator-adapter.js; this file is the
12
- * spec-compliant entry point at engines/zettel/generate.js per §11.
12
+ * spec-compliant entry point at strategies/zettel/generate.js per §11.
13
13
  */
14
14
 
15
15
  export { generateZettel as generate } from './generator-adapter.js';
@@ -17,7 +17,7 @@
17
17
  * restart. Good enough for a dev server; a persistent store is a later phase.
18
18
  */
19
19
 
20
- import { ArtifactStore } from '../../engine/artifacts.js';
20
+ import { ArtifactStore } from '../../core/artifacts.js';
21
21
 
22
22
  const store = new ArtifactStore();
23
23
 
@@ -15,7 +15,7 @@ import {
15
15
  SKIP_TAGS, extractProps, inferGap,
16
16
  } from './transpiler-maps.js';
17
17
  import { validateSchema } from '../../validator/validator.js';
18
- import { getContext } from '../engine/reference.js';
18
+ import { getContext } from '../core/reference.js';
19
19
 
20
20
  // ═══════════════════════════════════════════════════════════════
21
21
  // PUBLIC API
@@ -1,78 +0,0 @@
1
- # AdiaUI Generation Constitution
2
-
3
- Rules the generator MUST satisfy. Used by the RLAIF critique-revise stage
4
- to evaluate and improve generated output. Each rule maps to a validator check.
5
-
6
- ---
7
-
8
- ## Card Content Model
9
-
10
- - Every `Card` MUST have at least one of: `Header`, `Section`, `Footer`.
11
- - `Section` content MUST be wrapped in a `Column` component, not placed directly.
12
- - Headings (`h1`-`h6`) belong in `Header`, not `Section`.
13
- - Action buttons belong in `Footer`, not `Section` or `Header` (unless using `slot="action"`).
14
- - `Header` supports 4 slots: `slot="icon"` (leading), `slot="heading"` (title), `slot="description"` (subtitle), `slot="action"` (trailing badge/button).
15
-
16
- ## Typography & Variant System
17
-
18
- - Use semantic HTML elements with `variant` attribute: `<h1 variant="title">`, `<h3 variant="section">`, `<p variant="body">`.
19
- - Never use `data-heading` — use `variant` instead.
20
- - Text hierarchy: display > title > heading > section > subsection > body > deck > caption > kicker > label.
21
- - Use `color="subtle"` or `color="muted"` for secondary text, not inline styles.
22
-
23
- ## Layout Primitives
24
-
25
- - `Column` (col-ui): vertical stack. Use numeric `gap` values: `gap="2"`, `gap="4"`, `gap="6"`.
26
- - `Row` (row-ui): horizontal. Use `gap`, `justify`, `align` attributes.
27
- - `Grid` (grid-ui): CSS grid. Use `columns="2|3|4"`.
28
- - Never use named gaps (`gap="sm"`, `gap="md"`, `gap="lg"`) — always numeric.
29
- - Never use inline `style` attributes for layout.
30
- - Never use CSS class names.
31
-
32
- ## Component Types
33
-
34
- - Use `Input` for text inputs (not `TextField` or `TextInput`).
35
- - Use `CheckBox` for checkboxes (not `Checkbox`).
36
- - Use `Select` for dropdowns (not `ChoicePicker`).
37
- - Use `Toggle` for switch controls.
38
- - Use `Button` with `variant="primary"` for main CTA, `variant="outline"` for secondary.
39
- - Button text via `text` prop, icon via `icon` prop (Phosphor icon name).
40
-
41
- ## Flat Adjacency Protocol
42
-
43
- - Every component has a unique `id`.
44
- - Root component MUST have `id: "root"`.
45
- - Children referenced by ID array: `children: ["child-1", "child-2"]`.
46
- - IDs should be short and descriptive: `"hdr"`, `"email-field"`, `"submit-btn"`.
47
- - No circular references.
48
- - No orphaned components (every non-root must be referenced by a parent).
49
-
50
- ## Anti-Patterns (DO NOT)
51
-
52
- 1. **No bare divs** — never use `<div>` or HTML-only elements. Use AdiaUI components.
53
- 2. **No flat adjacency violations** — every Text inside Section must be inside a Column wrapper.
54
- 3. **No heading hierarchy skips** — don't jump from h1 to h3.
55
- 4. **No duplicate IDs** — every component must have a unique ID.
56
- 5. **No content directly in Tab** — Tab is a button strip item, not a content container.
57
- 6. **No invented components** — only use types registered in the A2UI registry.
58
- 7. **No slot on containers** — `slot="heading"` goes on the heading element, not on Header.
59
- 8. **No inline styles** — use component props and tokens, not `style="..."`.
60
-
61
- ## Prose & Content Context
62
-
63
- - For marketing/content pages, wrap in `<section prose>` to shift to content-optimized typography.
64
- - Centered page headers use: `<header align="center" size="lg">` → `<col-ui gap="4">` → kicker/display/deck.
65
- - Use `nomargin` on typography elements inside cards to prevent double-spacing.
66
-
67
- ## Icon Names
68
-
69
- - Use Phosphor icon names: `arrow-right`, `check-circle`, `warning-circle`, etc.
70
- - Brand icons need `-logo` suffix: `google-logo`, `github-logo`, `twitter-logo`.
71
- - Common aliases are resolved automatically: `send`→`paper-plane-right`, `settings`→`gear`, `mail`→`envelope`.
72
-
73
- ## Accessibility
74
-
75
- - Interactive elements must have `aria-label` if no visible text.
76
- - Icon-only buttons must have `aria-label`.
77
- - Images must have `alt` text.
78
- - Form inputs must have `label` prop.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes