7.1 KiB
Studio runtime source reconciliation
Captured on 2026-10-18 from the running Aura Studio static application. app.js is restored byte-for-byte from the privately preserved live file, SHA-256 025a1d94971361944cc3a3197bb894255d96cc824f603da3425466fab4cbdf74. The remaining checked static entry/config files match repository main after line-ending normalization.
The runtime includes substantial poster-renderer changes not represented by main. This branch preserves those existing changes before any packaging or API repair. Syntax is checked separately; preserving this file does not certify generation providers or all UI actions.
The running Nginx service serves /api/get-synced-stores through its HTML fallback. A fresh no-cache GET reproduced HTML rather than JSON. This is the standalone Studio endpoint, not the separate Aura Admin URL-sync or Client catalog path.
Do not blindly enable serve.js: it uses one shared store file and contains invented price/compare-price fallbacks. A production repair must retain tenant boundaries, real product values and existing client behavior. No Meta 1-Click flow is included in this reconciliation.
Backend candidate — not deployed
server/workspace.cjs uses the existing Auth active-account endpoint and the additive Client workspace identity contract. Browser client IDs are not accepted as storage identity. An owner must select a workspace explicitly; the Client gate owns the canonical workspace and catalog permission decisions. Storage uses the immutable client ID, not a display slug. Actor ID, email and role must match current Auth state. No database superuser credential or signing key is copied into these modules. The Client identity response must be released first; missing/stale identity fails closed.
server/store.cjs persists per-canonical-workspace data using hashed namespace directories, serialized updates, atomic replacement and fsync. It does not load the prototype shared store file into a new tenant. Corrupt saved data fails instead of being silently replaced with an empty list. This store is for a single server process; a multi-replica deployment needs a shared transactional store or cross-process locking before use.
server/products.cjs maps structured Shopify, Woo Store API and schema.org data without guessed prices, discounts or currencies. It preserves variant/SKU distinctions and zero prices. Missing selling prices remain unknown; an aggregate starting price or strikethrough price alone is not presented as an exact current selling price.
The Nginx Dockerfile copies an explicit static asset set instead of publishing all repository files. The separate Dockerfile.api builds the Node API/static server as a non-root user. It implements workspace store-list/import/delete routes, origin checks, JSON/body limits, import rate/concurrency limits and public-source fetching with DNS pinning, redirect revalidation, decompressed-byte limits and timeout/cancellation. Static backend/configuration paths are denied. The existing static image is unchanged in production. Frontend integration, the upstream Client identity release and a persistent production mount are still required before claiming the deployed Studio endpoint is repaired.
Verification: 17 tests pass on Windows and in an isolated Linux Node 22 container. They exercise canonical tenant selection, active-account rejection, shared owner/staff workspace storage, cross-workspace isolation, concurrent writes, corruption preservation, variant IDs and non-invented prices. Identity replies and product data in these tests are explicit fixtures, not production account/provider results.
Later integration verification: 49 tests pass in the Node 22 API candidate image with networking disabled, a read-only root and all capabilities dropped. The earlier 17-test result describes the initial foundation phase. A separate actual-entrypoint startup check covers health/static serving, unauthenticated JSON errors, unknown API paths and denied backend downloads. The current dependency audit reports zero advisories; this is not an all-security certification.
A read-only probe against ApplixBD walked eleven public Woo pages and read 1,006 source product records. Three samples were independently reconciled against raw Store API price/currency/minor-unit fields. No catalog data was saved. The GT public HTML probe returned no products; it did not use or test the separately connected Supabase catalog. HTML-only extraction reports discovered-page coverage instead of claiming every product on an arbitrary JavaScript-rendered site.
Import request pacing defaults to 350 ms between source requests, consistent with the existing host-compatibility policy. Operational caps are configurable through STUDIO_MAX_IMPORT_PAGES, STUDIO_MAX_PRODUCTS, STUDIO_MAX_SOURCE_REQUESTS, STUDIO_IMPORT_TIMEOUT_MS, STUDIO_PAGE_DELAY_MS, STUDIO_MAX_SOURCE_BYTES, STUDIO_SOURCE_TIMEOUT_MS, STUDIO_IMPORTS_PER_MINUTE and STUDIO_MAX_PARALLEL_IMPORTS. Limit or incomplete-page failures do not replace the saved catalog.
A separate offline Nginx image build reproduces all 11 current web asset files after line-ending normalization and omits backend/test/configuration sentinel files. The candidate Nginx configuration validates. No candidate HTTP backend is running in production.
Price format reference: https://developer.woocommerce.com/docs/apis/store-api/resources-endpoints/products/ documents Store API currency/minor-unit fields. https://schema.org/PriceSpecification defines structured price specifications. A parent/range amount remains distinct from a selected variation's selling price.
Workspace and raster image integration — 18 October 2026
The protected API now exposes GET /api/workspace for the canonical Client UUID, tenant, display name and catalog permission. It returns no saved catalog or internal namespace. Missing login and owner workspace selection remain explicit failures.
Catalog list/import/delete responses replace merchant image URLs with a same-origin /api/catalog-image reference. That route resolves the product from the authenticated workspace's saved catalog; arbitrary URL parameters are rejected. Its outbound reads use the bounded public fetcher, including DNS/redirect checks, a 5 MiB decoded-body ceiling and ten-second timeout. Four image reads may run concurrently. Only signature-recognized PNG, JPEG, GIF and WebP responses are returned. HTML and SVG are rejected. This is format recognition, not complete image decoding or a claim that every source image is supported.
The backend candidate is not deployed. Frontend authentication/workspace selection, private browser-state namespacing, imported-text rendering, connected Client catalog access and persistent production configuration remain required release work. The prototype global GT catalog is not a valid default for another client. No Meta connector inspection or modification is part of this work.
The local branch reference was found zero-filled. Its bytes were retained outside the Git refs directory, the remote branch was read, and the existing local commit object was checked before restoring the reference to cbe6e0ae94e22e6c34ecc55bad036ff8c165b488. No working files were reset. The cause of that local reference damage is not established.