diff --git a/docs/figma-studio-runner.md b/docs/figma-studio-runner.md index a8a5848..4f254fe 100644 --- a/docs/figma-studio-runner.md +++ b/docs/figma-studio-runner.md @@ -55,9 +55,9 @@ The payload preserves the source needed for a Studio-side transform: - `scenegraph` includes the normalized current page and selected nodes rather than only generated HTML. - `assets` carries the normalized exported assets. - `transform` requests the `static-site-importer/figma` route with a WordPress target, preserved source scenegraph, asset import, selection scope, page ID, and selected node IDs. -- `debug` carries a per-request handoff ID, generated artifact context, diagnostics, and metadata. +- `debug` carries a per-request handoff ID, a bounded summary, diagnostics, and metadata. The generated website artifact remains local to avoid duplicating binary assets in the handoff request. -The debug summary is deterministic from the selected source and generated artifact. It reports the selection scope and page, selected-node count, recursive node count, asset count, and diagnostic, warning, and error counts. When no nodes are selected, node counting falls back to the current page. `generate-artifact.test.mjs` fixes this shape with a selected-node fixture and verifies the route, preservation options, handoff ID, generated artifact, and summary counts. +The debug summary is deterministic from the selected source and generated artifact. It reports the selection scope and page, selected-node count, recursive node count, asset count, and diagnostic, warning, and error counts. When no nodes are selected, node counting falls back to the current page. `generate-artifact.test.mjs` fixes this shape with a selected-node fixture and verifies the route, preservation options, handoff ID, bounded debug payload, and summary counts. ## Handoff And Diagnostics @@ -65,7 +65,7 @@ The UI posts to `http://127.0.0.1:48732/figma-to-wordpress/import` with `Content Each request receives a `figma-...` handoff ID. On success, Studio may return `requestId`, `siteName`, `siteUrl`, and `importSummary`; the UI displays the accepted site and logs those values with the handoff ID, payload schema, selection identity, source summary, and generated artifact file/entrypoint summary. -A non-2xx response or a response without `success: true` is a failed handoff. The visible error uses Studio's response message when available, appends its request ID for correlation, and otherwise includes the HTTP status. Network and response failures are logged with the same handoff ID and source summary, so Studio and Figma logs can be correlated without treating the debug artifact as the primary import contract. +A non-2xx response or a response without `success: true` is a failed handoff. The visible error uses Studio's response message when available, appends its request ID for correlation, and otherwise includes the HTTP status. Network and response failures are logged with the same handoff ID and source summary, while the generated artifact remains available in local plugin diagnostics. Not implemented yet: diff --git a/plugins/figma-to-wordpress-studio/README.md b/plugins/figma-to-wordpress-studio/README.md index dfb79fd..a3549fb 100644 --- a/plugins/figma-to-wordpress-studio/README.md +++ b/plugins/figma-to-wordpress-studio/README.md @@ -94,7 +94,6 @@ The `Open in WordPress Studio` request body is source-first: } }, "debug": { - "generatedArtifact": {}, "diagnostics": [] } }, @@ -102,6 +101,6 @@ The `Open in WordPress Studio` request body is source-first: } ``` -`debug.generatedArtifact` is diagnostic context only. Studio should route from `source`, `scenegraph`, and `transform`, not from a pre-rendered website artifact bundle. +Studio routes from `source`, `scenegraph`, and `transform`. The generated website artifact remains available in the plugin's local diagnostics but is not duplicated in the handoff request. See [`../../docs/figma-studio-runner.md`](../../docs/figma-studio-runner.md) for the integration notes. diff --git a/plugins/figma-to-wordpress-studio/src/payload.ts b/plugins/figma-to-wordpress-studio/src/payload.ts index 8495e6c..56245f7 100644 --- a/plugins/figma-to-wordpress-studio/src/payload.ts +++ b/plugins/figma-to-wordpress-studio/src/payload.ts @@ -57,7 +57,6 @@ export interface FigmaSourcePayload { debug: { handoffId?: string; summary: FigmaSourceDebugSummary; - generatedArtifact?: GeneratedArtifact["studioImportPayload"]; diagnostics: GeneratedArtifact["diagnostics"]; metadata?: GeneratedArtifact["metadata"]; }; @@ -95,7 +94,6 @@ export function toFigmaSourcePayload( debug: { handoffId, summary: sourceDebugSummary(selection, artifact), - generatedArtifact: artifact?.studioImportPayload, diagnostics: artifact?.diagnostics || [], metadata: artifact?.metadata, }, diff --git a/plugins/figma-to-wordpress-studio/tests/generate-artifact.test.mjs b/plugins/figma-to-wordpress-studio/tests/generate-artifact.test.mjs index 0eb60c4..8e8e78b 100644 --- a/plugins/figma-to-wordpress-studio/tests/generate-artifact.test.mjs +++ b/plugins/figma-to-wordpress-studio/tests/generate-artifact.test.mjs @@ -270,7 +270,7 @@ test("generates a source-first Figma handoff payload with debug summary", async assert.equal(source.transform.route, "static-site-importer/figma"); assert.equal(source.transform.options.preserveSourceScenegraph, true); assert.equal(source.debug.handoffId, "handoff-123"); - assert.equal(source.debug.generatedArtifact.schema, "blocks-engine/php-transformer/site-artifact/v1"); + assert.equal("generatedArtifact" in source.debug, false); assert.equal(source.debug.summary.scope, "selected-nodes"); assert.equal(source.debug.summary.selectedNodeCount, 1); assert.equal(source.debug.summary.nodeCount, 2);