Skip to content

feat(composer): hosted demo is the shadcn v3 reference project - #58

Merged
ryandmonk merged 1 commit into
mainfrom
feat/hosted-demo-v3
Aug 8, 2026
Merged

feat(composer): hosted demo is the shadcn v3 reference project#58
ryandmonk merged 1 commit into
mainfrom
feat/hosted-demo-v3

Conversation

@ryandmonk

Copy link
Copy Markdown
Contributor

Makes composer.aesthetic-function.com demonstrate the v3 representation work (not the v1 Acme sample). The baked demo is the shadcn/ui v3 project — 34 components, T1-T4 + A0, 14 surfaces (11 emit, 3 acknowledged-casualty refusals).

Two real v3-compat bugs found by validating the hosted demo, both fixed:

  1. In-browser validation FAILed on rule 48 (requiredCategories) — Studio bundled dspack-spec 0.4.2's schema; bumped to ^0.4.4. Contract+surface gates now PASS.
  2. Mapper crashed (React feat(composer): ledger-v2 entry-level ownership — decisions, not defaults #31) on any v3 enum prop ({value, description} members rendered as children) — added enumLabel() normalisation.

Rewrote composer-prod-smoke.spec.ts for v3 (12 specs, 12/12 green against the built static export): load, agent honesty, checklist, inventory+casualty, mapper fidelity, whole-in-browser validation, preview + casualty refusals, export, reload-safety, acknowledged casualties, rule-builder gate, scenario live gates, bundle hygiene.

This is the legitimate product merge that verifies the restored Cloudflare pipeline. Live authoring/generation still requires the local agent (asserted, not hidden).

🤖 Generated with Claude Code

composer.aesthetic-function.com now demonstrates the representation work we
shipped, not the v1 Acme sample. The baked demo (demo-data.ts + demo-assets)
is the shadcn/ui v3 project: 34 components mapped through the v2-language
production profile (T1-T4 + A0), 14 worked surfaces (11 emit, 3 refuse on
declared casualties — accordion/breadcrumb/pagination/tooltip, first-class).
The Acme project stays in the repo for the agent 'bring your own library'
story. Removed the v3 project's surfaces/ dir (it duplicated the contract's
14 examples; recomputeEmit/demo-assets read contract examples directly).

Two real v3-compat bugs found by validating the hosted demo, both fixed:

1. **In-browser validation failed on the v3 contract**: rule 48
   (rule.form-control-carries-control) uses requiredCategories (dspack-spec
   0.4.3+), but Studio's browser validator bundled dspack-spec 0.4.2's v0.4
   schema, which rejects it. Bumped @aestheticfunction/dspack-spec ^0.4.2 ->
   ^0.4.4 (composer + agent); 'contract + surface gates' now PASS.

2. **Mapper crashed (React #31) on any v3 enum prop**: v3 contracts carry
   enum members as {value, description} objects; the Mapper rendered them as
   React children and used them as keys. Added enumLabel() and normalised
   every enum-value use through it (v1 strings and v3 objects both).

Rewrote e2e/composer-prod-smoke.spec.ts for the v3 demo (12 specs): load,
agent honesty, project checklist, inventory + casualty, mapper fidelity,
whole-in-browser validation (catalog A1-A3 + document S1-S3 PASS), preview +
casualty refusals, export, reload-safety, acknowledged casualties, rule
builder rationale-gate, scenario live gates, bundle hygiene. 12/12 green
against the built static export. Live authoring/generation still needs the
local agent — asserted, not hidden.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 8, 2026 18:52
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
dspack-studio-composer b7c19a5 Aug 08 2026, 06:53 PM

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the hosted Composer demo to use the shadcn/ui v3 reference project and aligns the app/tests/dependencies so the deployed site validates and renders v3 correctly (including enum-member normalization and schema compatibility).

Changes:

  • Bump @aestheticfunction/dspack-spec to ^0.4.4 (lockfile + app deps) to resolve v3 schema validation (requiredCategories).
  • Update the mapper to safely render v3 enum members ({ value, description }) via normalization.
  • Rewrite production smoke E2E specs to assert the hosted demo’s v3 behavior and gating outputs; remove legacy demo surface assets from the project.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pnpm-lock.yaml Locks @aestheticfunction/dspack-spec to 0.4.4.
e2e/composer-prod-smoke.spec.ts Reworks hosted-demo smoke coverage for shadcn v3 flows and gate assertions.
apps/composer/shadcn-v3-project/surfaces/workspace-members-directory.dsurface.json Removes legacy surface asset (now relying on v3 contract examples / emitted surfaces).
apps/composer/shadcn-v3-project/surfaces/usage-help-affordances.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/support-ticket-queue.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/project-workspace-panels.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/orders-table-loading.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/order-detail-summary.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/notification-preferences.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/invite-teammates-dialog.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/import-run-status.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/expense-report-form.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/docs-article-trail.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/delete-project-confirmation.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/delete-account-confirmation.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/surfaces/customer-context-sheet.dsurface.json Removes legacy surface asset.
apps/composer/shadcn-v3-project/project.json Updates demo project manifest (removes surfacesDir).
apps/composer/scripts/demo-assets.mjs Points demo asset generation at shadcn-v3-project contract/profile.
apps/composer/package.json Bumps @aestheticfunction/dspack-spec to ^0.4.4.
apps/composer/app/views/mapper-view.tsx Normalizes enum labels to avoid rendering v3 objects as React children.
apps/composer/app/demo-data.ts Switches demo imports to shadcn v3 contract/profile/manifest; drops extra surfaces.
apps/agent/package.json Bumps @aestheticfunction/dspack-spec to ^0.4.4.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 16 to 18
const here = dirname(fileURLToPath(import.meta.url));
const project = join(here, "..", "demo-project");
const project = join(here, "..", "shadcn-v3-project");
const outDir = join(here, "..", "app", "demo", "generated");
Comment on lines +18 to +29
import demoContract from "../shadcn-v3-project/shadcn-ui.dspack.json";
import demoProfile from "../shadcn-v3-project/shadcn-v3.profile.json";
import demoManifest from "../shadcn-v3-project/project.json";
import demoEmit from "./demo/generated/emit.json";
import usesCasualty from "../demo-project/surfaces/uses-casualty.dsurface.json";

export const DEMO_CONTRACT = demoContract as unknown as Record<string, any>;
export const DEMO_PROFILE = demoProfile as unknown as Record<string, any>;
export const DEMO_MANIFEST = demoManifest as unknown as Record<string, any>;
export const DEMO_EMIT = demoEmit as unknown as Record<string, any>;
export const DEMO_EXTRA_SURFACES = [{ name: "uses-casualty", surface: usesCasualty as unknown }];
// The v3 contract's 14 examples ARE the worked surfaces (recomputeEmit emits
// contractSurfaces(doc)); the project carries no extra surfaces beyond them.
export const DEMO_EXTRA_SURFACES: Array<{ name: string; surface: unknown }> = [];
@ryandmonk
ryandmonk merged commit d1b9445 into main Aug 8, 2026
3 checks passed
@ryandmonk
ryandmonk deleted the feat/hosted-demo-v3 branch August 8, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants