32 lines
5.5 KiB
Markdown
32 lines
5.5 KiB
Markdown
# 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.
|