Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
191e8c1
docs(plan): design mode v2 Phase DM (DESIGN.md) plan, reviewed
sambitcreate Nov 24, 2026
f3ecb67
feat(design): add the live flag and the pinned DESIGN.md linter in a …
sambitcreate Nov 24, 2026
8cee25e
feat(design): read app roots, scripts and designMd from .aiden/canvas…
sambitcreate Nov 24, 2026
01a1b7d
feat(design): find the DESIGN.md for an app root
sambitcreate Nov 24, 2026
c895a9f
feat(design): read, lint and cache an app's DESIGN.md
sambitcreate Nov 24, 2026
bece976
feat(design): draft a DESIGN.md from the app's own styles
sambitcreate Nov 24, 2026
66e0779
feat(design): add the design_system tool
sambitcreate Nov 24, 2026
a288813
refactor(design): move the style scanner and offer log; offer a DESIG…
sambitcreate Nov 24, 2026
f589fdc
feat(design): give design-mode turns the app's DESIGN.md, behind the …
sambitcreate Nov 24, 2026
eb57803
feat(design): read DESIGN.md over IPC and check the packaged linter
sambitcreate Nov 24, 2026
92c7480
docs(design): Phase DM spec amendments, guide and memory
sambitcreate Nov 24, 2026
e44c518
fix(design): never read a DESIGN.md that resolves to a credential file
sambitcreate Nov 24, 2026
6c77e9c
fix(design): prove the DESIGN.md read is the file that was checked
sambitcreate Nov 24, 2026
2182225
test(design): prove the offline trap catches a worker's http.request
sambitcreate Nov 24, 2026
c2431b1
test(design): drop the deadline-constant change detector
sambitcreate Nov 24, 2026
7db19c5
fix(design): retry timed-out DESIGN.md checks, stop after a load time…
sambitcreate Nov 24, 2026
440b314
fix(design): bound DESIGN.md names and every fenced design_system answer
sambitcreate Nov 24, 2026
5b6214a
fix(design): settle each DESIGN.md offer by its own key, never worksp…
sambitcreate Nov 24, 2026
a8e93c2
fix(design): read app roots together, offer the next missing app, cap…
sambitcreate Nov 24, 2026
ce23a04
fix(design): keep the flag-off design-mode section exactly as before
sambitcreate Nov 24, 2026
81c9474
refactor(design): move the design note's offer wiring out of llm-clie…
sambitcreate Nov 24, 2026
75594c8
feat(design): report the live flag in studioCapabilities
sambitcreate Nov 24, 2026
4ca7f58
feat(design): export configuredRoots and say why canvas.json wasn't read
sambitcreate Nov 24, 2026
32fe3d6
build(design): leave out the packages only the DESIGN.md CLI needs, a…
sambitcreate Nov 24, 2026
4e22afa
docs(design): record the DM code-review fixes
sambitcreate Nov 24, 2026
d5083ab
docs(plan): Phase DM is in review as PR #915
sambitcreate Nov 24, 2026
307b875
fix(design): overlapping DESIGN.md reads and exports share one worker…
sambitcreate Nov 24, 2026
68a4b43
fix(design): cut sections and omitted too, so every read answer fits …
sambitcreate Nov 24, 2026
9c84c72
fix(design): a turn that excludes design_system gets no DESIGN.md pro…
sambitcreate Nov 24, 2026
6c4955a
docs(plan): DM as-built notes for the PR review fixes
sambitcreate Nov 24, 2026
138d6aa
fix(design): replace a journaled DESIGN.md prompt section on turns wi…
sambitcreate Nov 24, 2026
d77b4e0
fix(design): DESIGN.md's pinned read compares exact 64-bit device and…
sambitcreate Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ jobs:
if: ${{ steps.version.outputs.publish == 'true' }}
run: npm run test:e2e:diagnostics:packaged

- name: Verify the DESIGN.md linter in the signed packaged app
if: ${{ steps.version.outputs.publish == 'true' }}
run: npm run test:design-md:packaged

- name: Stage verified macOS release assets
if: ${{ steps.version.outputs.publish == 'true' }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
Expand Down
15 changes: 14 additions & 1 deletion .memory/design-mode.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Design mode

v2 (2026-11-23): owner approved the live app canvas spec `docs/superpowers/specs/2026-11-23-design-mode-live-app-design.md` (live dev-server routes as frames, localhost-only, one canvas per workspace with a page per chat, Aiden-controlled dev server, Inspect tool X, DESIGN.md as the design-system source, React mock apps for non-web React projects). Pre-build checks are in spec §11 (`@google/design.md` 0.4.0: Apache-2.0, `/linter` `lint(content)` offline; v1 `design-system*.ts` used only by `main.ts`, deleted in 3b; no default-session `webRequest` listener exists; E2E fixture symlinks root `node_modules`). The PR split was revised in §8: 1a must move every `activePageId` reader at once (tools, placement, focus with `pageId`, renderer view store), and 1b only writes `chatPages` and handles lifecycle. Phase 1a plan: `docs/superpowers/plans/2026-11-23-design-mode-v2-p1a-workspace-canvas.md`, built 2026-11-23 on `t3/design-mode-live-app-plan`, PR #894 opened 2026-11-23 after code review fixes (main `d5b1b14e9`, renderer `f78a6b0ef`); see "v2 Phase 1a" below. Key 1a decisions: `DesignChatCanvases` adapter (chat → workspace) so callers keep chat ids; a `.layout-v3` marker in `design-canvases/` triggers the one-time wipe; `designCanvas:updated` carries `workspaceId`; each No workspace chat has its own hidden workspace and so its own canvas (only legacy chats with no `workspaceId` share `default`). An adversarial plan review on 2026-11-23 added amendments A1–A12 to the 1a plan (origin `chatId` on updates, comment tray filtered by chat in 1a, per-window ordered views, Aiden's page change applied in main at once, attach merges the hidden canvas). An adversarial spec review the same day added §12 S1–S15: subframe `will-redirect` fix, a per-workspace start consent with a script-text hash plus a read-only refusal, a fail-closed null-frame rule, `file://` cookie handling, a narrowed network guarantee, a `design` job owner, an install stamp, a permission dispatcher shared with Gemini Live, no `allow-modals`, untrusted bridge output, Vite-client HMR, loopback binding, and 2b–5 behind `AIDEN_EXPERIMENTAL_DESIGN_LIVE` until Phase 7. Phase 2a (app detection: `node-toolchain.ts` lift, `detectWebApp`, `resolveAppToolchain`; no caller until 2b) built 2026-11-24 on `t3/design-mode-v2-p2a`, stacked on PR #908; see "v2 Phase 2a" below and spec S19–S24.
v2 (2026-11-23): owner approved the live app canvas spec `docs/superpowers/specs/2026-11-23-design-mode-live-app-design.md` (live dev-server routes as frames, localhost-only, one canvas per workspace with a page per chat, Aiden-controlled dev server, Inspect tool X, DESIGN.md as the design-system source, React mock apps for non-web React projects). Pre-build checks are in spec §11 (`@google/design.md` 0.4.0: Apache-2.0, `/linter` `lint(content)` offline; v1 `design-system*.ts` removed in 3d (S6), except the scanner, which moved to `design-md/style-scan.ts` (S37); no default-session `webRequest` listener exists; E2E fixture symlinks root `node_modules`). The PR split was revised in §8: 1a must move every `activePageId` reader at once (tools, placement, focus with `pageId`, renderer view store), and 1b only writes `chatPages` and handles lifecycle. Phase 1a plan: `docs/superpowers/plans/2026-11-23-design-mode-v2-p1a-workspace-canvas.md`, built 2026-11-23 on `t3/design-mode-live-app-plan`, PR #894 opened 2026-11-23 after code review fixes (main `d5b1b14e9`, renderer `f78a6b0ef`); see "v2 Phase 1a" below. Key 1a decisions: `DesignChatCanvases` adapter (chat → workspace) so callers keep chat ids; a `.layout-v3` marker in `design-canvases/` triggers the one-time wipe; `designCanvas:updated` carries `workspaceId`; each No workspace chat has its own hidden workspace and so its own canvas (only legacy chats with no `workspaceId` share `default`). An adversarial plan review on 2026-11-23 added amendments A1–A12 to the 1a plan (origin `chatId` on updates, comment tray filtered by chat in 1a, per-window ordered views, Aiden's page change applied in main at once, attach merges the hidden canvas). An adversarial spec review the same day added §12 S1–S15: subframe `will-redirect` fix, a per-workspace start consent with a script-text hash plus a read-only refusal, a fail-closed null-frame rule, `file://` cookie handling, a narrowed network guarantee, a `design` job owner, an install stamp, a permission dispatcher shared with Gemini Live, no `allow-modals`, untrusted bridge output, Vite-client HMR, loopback binding, and 2b–5 behind `AIDEN_EXPERIMENTAL_DESIGN_LIVE` until Phase 7. Phase 2a (app detection: `node-toolchain.ts` lift, `detectWebApp`, `resolveAppToolchain`; no caller until 2b) built 2026-11-24 on `t3/design-mode-v2-p2a`, stacked on PR #908; see "v2 Phase 2a" below and spec S19–S24.

Status: active. P0 (retire Studio), P1 (layout shell) and P2 (canvas and frames, Tasks 1–7) are done. The Mac Studio work was pushed as `claude/design-mode-deep-dive` on 2026-11-05, then merged with `origin/main` on `claude/project-thread-29fzrr` (the PR branch). P3 (Aiden on the canvas) is done (2026-11-05, P3a–P3d, on the PR #778 branch), plan `docs/superpowers/plans/2026-11-05-design-mode-p3-aiden-on-canvas.md`. P3a (canvas tools) is done: `main/services/design-canvas/canvas-tools.ts` (four tools, 20 calls per turn at the time, 60 now, `designCanvasToolsAllowed` gate, `DESIGN_MODE_PROMPT_SECTION`), wired in `llm-client.ts` as the `aiden.design-canvas` runtime extension (static prompt section; since 2026-11-18 the `canvasPromptLine` counts go to the transcript as a `design-canvas-status` section note via `withCanvasStatusNote`, only when they changed, instead of a volatile system prompt line). P3b (artifact frames) is done: `artifact-frames.ts` places committed `render_artifact` visuals after `generativeUiArtifactStore.commit` (never on a failed turn), same-title Aiden frames swap `mediaId` and keep their box; `ArtifactNode` keys its loaded src by mediaId. P3c (skill) is done: `design-canvas/skill.ts` (`aiden-design`, `DESIGN_CANVAS_SKILLS`), registered in `skill-registry-main.ts` only when the flag is on, dropped by `withoutSkills` unless `designCanvasOffered` in llm-client, and from Remote and Telegram catalogs. P3d is done: `design-mode-tool.ts` (`DesignModeConsent`, `design_mode`, on-demand), `canvas-snapshots.ts`, card `renderer/design/design-mode-consent.tsx`, focus store `renderer/design/canvas-focus-requests.ts`; canvas tools held back and added by `withEnteredCanvasTools` after Enter; new tests must also go in `scripts/ci-test-registry.json` or `npm test` fails its registry check. P4 plan (owner chose everything in their reference screenshots): `docs/superpowers/plans/2026-11-05-design-mode-p4-full-canvas.md`; P4a built 2026-11-05, P4e, P4b, P4c, P4d, P4f, P4g and P4h built 2026-11-06, P5 (launch) built 2026-11-06. Placement moved to `renderer/shared/design-canvas/placement.ts`; summaries in `canvas-summary.ts`. P4–P5 plans are written before each phase.

Expand Down Expand Up @@ -393,3 +393,16 @@ Branch `t3/design-mode-v2-p2a`, stacked on PR #908. Plan `docs/superpowers/plans
- Node 22 for design, the same as devices. No corepack fallback; 2b sets `COREPACK_ENABLE_DOWNLOAD_PROMPT=0` (S19).
- Nothing calls the design modules until 2b. Tests: `node-toolchain.test.ts` (in `test:devices`), `app-server-core.test.ts`, `app-detect.test.ts`, `app-toolchain.test.ts` (in `test:design-mode`).
- Code review fixes (2026-11-24): the agent-device launcher and `run`'s no-Node branch also drop empty PATH entries (plan Q7 settled). Follow-up: `ssh-device-script.ts:26` builds the remote PATH as `…:$PATH`. Detection: the enclosing walk's signal counts only when that folder's `workspaces`/`pnpm-workspace.yaml` lists the workspace; hand-off root scripts (`-w`/`--workspace`/`--prefix`/`--dir` next to a package manager, `yarn workspace`, `pnpm -C`, `concurrently`, `npm-run-all`, `run-p`) are runners; a workspace root is `web` only through the framework's own dev command; a framework app with only production scripts is `no-dev-script`; `clearAppToolchainCache()` for 2c's Retry; conflict messages say how to fix, with plural wording for 3+ managers.

## v2 Phase DM: DESIGN.md (2026-11-24)

Branch `t3/design-mode-v2-dm`, stacked on PR #911 (2a). Lands before 2b. Plan `docs/superpowers/plans/2026-11-24-design-mode-v2-dm-design-md.md`; spec S33–S44; guide `docs/design-mode.md`.
- Flag: `designLiveEnabled()` in `studio/feature-flags.ts` (design mode on and `AIDEN_EXPERIMENTAL_DESIGN_LIVE` = 1/true/yes/on). Off: no worker starts, the prompt is today's text, v1's tokens offer stays. On: the DESIGN.md offer replaces the tokens offer.
- Layout under `main/services/design-canvas/`: `canvas-config.ts` (reads `.aiden/canvas.json`: version rule, `describedRoots`, `isSafeWorkspaceRelativePath`), `offer-log.ts` (HMAC offer log shared with v1's tokens offer), and `design-md/`: `lint-worker.ts` → `build/main/design-md-lint-worker.js`, `lint-client.ts`, `locate.ts` (`locateDesignMd`, `createDesignAppRoots`), `sections.ts`, `reader.ts` (`DesignMdReader`), `draft.ts`, `tool.ts` (`design_system`), `offers.ts`, `status.ts`, `turn.ts` (per-turn glue for llm-client), `style-scan.ts` (v1's scanner, moved verbatim). Production singletons in `design-canvas/main.ts`: `designMdLinter`, `designMdReader`, `designMdOffers` (`userData/design-md-offers.json`), `designAppRoots`.
- Worker: posts `ready` after importing `@google/design.md/linter`; load limit 10 s (`linter-unavailable`, `cause: "load-timeout"`, after which the reader starts no more workers this run), lint deadline 2 s from `ready` (`timed-out`, cached with a 5-minute retry). 128 MB heap, two at once, 16 waiting, then `busy`. Env drops `DEBUG`, `LOG_STREAM`, `LOG_TOKENS` (they print to stdout and stderr, which the client drains). From `.ts` it keeps the parent's execArgv and adds tsx only when missing.
- Linter facts (0.4.0, exact pin): `/linter` is a self-contained bundle (Node built-ins only) that reads its own `dist/linter/spec-config.yaml` at import; the package has no `license` field (Apache-2.0 per its LICENSE, see THIRD_PARTY_NOTICES); `lint()` is synchronous and quadratic on emphasis runs (why it's in a worker); `omitted` accepts only token groups; no `motion` group, Motion and Voice & Content Strategy unknown, `@file#fragment` unresolved, no duplicate-section or unresolved-ref findings (Aiden adds `aiden/duplicate-section` and `aiden/unresolved-ref`).
- Prompt: no volatile prompt line. The DESIGN.md path and counts are one sentence appended to the `design-canvas-status` note (`designMdStatusSentence`), so unchanged counts add nothing. Flag on adds one static bullet (`designModePromptSection(true)`); a mid-reply entry patches the `design-mode` section only when its text differs (`withDesignModeSection`). The note is a section patch, so wires without in-place system messages fold it into the system head: a changed count costs one cache miss, as v1's canvas counts do. `canvas_read` gains a `designMd` field. The sentence reads roots in parallel within a 3 s budget (else `""`). With the flag off, `withDesignModeSection(..., { live: false })` keeps any existing copy (v1's rule), so flag-off turns stay byte-identical. The offer/settle wiring lives in `design-md/turn-wiring.ts`.
- `design_system` joins the canvas tools (held, declared and refused with them); 20 calls a turn; file text only inside `fenceAsData`; never writes. The draft offer asks once per workspace and app root (the first missing root still offerable), only when the chat can write and `ask_user_question` is offered, logged after a delivered turn. `offerFor` returns `{sentence, key}`; each turn settles only its own keys. The reader and lookup refuse a DESIGN.md resolving to a credential path, and the reader checks device/inode after a no-follow read. Tool answers' fenced JSON is capped at 64 KiB with `truncated`.
- Events: `design_md_linted` (once per new content per run, never for content lints or the IPC) and `design_md_drafted {source: "app"}` (a drafted target that exists at a delivered turn's end).
- IPC `designCanvas:designSystem {chatId, appRoot?}`: read only, no event, needs the live flag, not design mode; `designCanvasApi.designSystem` has no UI yet (Phase 5).
- Packaging: `build.files` drops the CLI `dist/index.js`, top-level `dist/spec.md` and `dist/spec-config.yaml`, `dist/linter/spec.md` and the nested `node_modules/`, and (after code review) the 18 packages only `@google/design.md` reaches (`DESIGN_MD_ONLY_DEPENDENCIES`; a lockfile-walk test fails if another production dependency needs one). `verifyPackagedDesignMdLinter` (macOS and Linux package checks) requires the worker and linter as packed files, the trimmed files absent, and lints a fixture with the extracted linter. `npm run test:design-md:packaged` launches the release app and reads DESIGN.md over the IPC (release workflow). A local unsigned `--dir` build passed the check; the linter adds about 0.7 MB to the asar. No PR workflow packages macOS, so the packaged acceptance runs only at release. `canvas-config.ts` also exports `configuredRoots` (R2 step 1, for 2b) and `readCanvasConfigText` returns a reason (`missing | link | too-large | unreadable`) or `ok` text; `studioCapabilities()` has `designLive`.
Loading
Loading