🦞🎬 Architecture & Protocol Specification
D-202 bounded runtime observations — browser phase complete
The bounded D-202 continuation now has genuine pxl authentication in a separately owned NI10 Chrome using only the public vhosts at resolver-mapped public IP 178.18.250.170. App/auth TLS 1.3, authenticated API/snapshot HTTP200 and wss://stfl.loca.zone/ws HTTP101 are measured; loopback CDP controls the browser but does not carry application HTTP, and TLS is not bypassed. The first browser-tooling probe is quarantined because ownership, NI10 and resolver launch arguments were not established. This proves the observed transport, not complete reconnect, UI, extension or 41-row acceptance; see D-202 progress and receipt scope.
The credential boundary is unchanged: shared global OMP storage has no supported disposable app-scoped lifecycle preserving existing authentication bytes; consent Cancel is not lifecycle acceptance. Main’s sole native —execute invocation under the NI10 heavy lease refused checkpoint_clone_changed before confirmation/reservation/provider activity. Database/WAL matched, SHM differed with cause unattributed, and provider POSTs/native fetches were zero. The allowance is consumed with no replay. The browser/local-media phase is finished, not full acceptance; D-198 remains dated BLOCKED history.
Real public Studio mutations include ordered draft/file imports, Library mapping/native role drops, scoped log Clear and held quotes stopped before execution; raw cap changes survived reload while held. These REST/WebSocket observations do not establish all reconnect states, in-flight bounds or native dispatch. A literal mapped-batch export/file import now preserves three ordered shots and two remapped assets with matching reference-role/ingredient semantics, embedded byte digests and unchanged jobs. Malformed JSON is rejected without snapshot entity changes. Export still includes only selected production fields, not a full backup. The separate historical-video inclusion superset remaps two exact Library parents but does not prove the original exporter included that whole graph. A pre-existing missing provenance.byte_count still breaks its production’s snapshot/Gallery; another working production does not erase it.
The separately installed native Chrome sidepanel now has runtime-context and rendered-surface evidence: public REST/snapshot HTTP200 and reload work, with no Flow tab or granted/requested Flow permission. Its background WebSocket instead records HTTP302 and the UI remains explicitly disconnected; web-face HTTP101 must not be transferred to this client. A public origin outside the extension’s host permission cannot fetch or frame its panel/chunk resources. The actual 360×412 Queue also exposes a narrow-column error-layout defect, despite no horizontal overflow.
The completed bounded work also exercises keyboard import/mapping, four compatible images, independent compare slots, two-ID selection drag, a promoted draft with exact Undo, real local 2K/4K PNGs and a three-deep resize graph. Historical native-video playback/full decode is real, not new generation. Exact naming and safe ZIP collision resolution work, but the derivative filename changes with selection. A 4K download escaped to Chrome’s default Downloads outside authorized roots; it remains untouched and is not repaired by a later scoped download.
Supported cleanup soft-deleted the 11 owned batches and all 23 added shots. Six stopped jobs, protected Library/Gallery media, productions and audit/undo/tombstone records remain; six Library removals were refused with HTTP409. Original application rows across all 13 tables are unchanged, not a claim about the separately observed global-authentication drift. Final publication and rendered-route proof belong to Main.
D-198 deployed implementation boundary — 2026-09-28
D-198’s canonical face and gateway source are deployed at fa9ab38a32a4ca805ca882d6480d3173bffc1c7d. Owned Bun 1.4.2 service health and all 13 served static hashes were verified locally; no required authorized external Chrome/realpxl UI or public WS101 acceptance follows. The mission remains BLOCKED. The historical Bible and D-134 plan retain the broader contract; sum.yml remains normative. Deployment and evidence and all 41 acceptance scenarios distinguish delivery, source, controlled/native proof and acceptance. All 41 per-item commits/receipts are delivered, not 41 accepted workflows.
flowchart TD WEB["SvelteKit static SPA / responsive web"] --> HTTP["Studio HTTP API"] WEB <-->|snapshots and events| WS["Gateway WebSocket"] PANEL["WXT sidepanel + background worker"] --> HTTP PANEL <--> WS HTTP --> DB["SQLite: productions, batches, shots, jobs, assets"] HTTP --> QUOTE["Preview / explicit confirmation / held or immediate queue"] QUOTE --> QUEUE["Immutable per-item requests and persisted concurrency"] QUEUE --> MEDIA["Pinned image/video adapters or labelled local assembly"] MEDIA --> AUTH["Existing shared OMP auth at explicit dispatch"] MEDIA --> DB DB --> WS RPC["Single prod_default RPC bridge"] -. separate integration .-> WS
This is not a per-production RPC session pool or an installable PWA. Production selection is a client/domain scope, not multi-tenant authorization: the gateway broadcasts events to active sockets and clients filter production state. The recorded service runs a Bun gateway; a separately exported shell helper does not make it an integrated omp ps shell manager. Public authentication depends on the ingress boundary.
Repository implementation
| Path | Inspected implementation and limits |
|---|---|
| apps/gateway | Bun HTTP/WebSocket gateway, SQLite, Studio authoring API, queue, registry, media and native-auth adapters; one prod_default RPC bridge. |
| apps/face | SvelteKit adapter-static SPA with fallback. Responsive CSS exists; no installable PWA manifest/service-worker implementation is established. |
| apps/panel | WXT sidepanel/background worker. StoryFlow-only HTTPS/WSS connectivity, sidePanel/storage permissions; no Flow content scripts, labs optional permission or web_accessible_resources declaration. No Flow tab is required. |
| packages/ui | Svelte components consumed directly from workspace source and bundled by each application, not a separate Vite library build. |
| packages/protocol | Zod domain schemas, event envelope and import validation. Envelope metadata is checked; data is unknown at envelope level. |
| packages/plugins | Six contribution kinds declared; minimal film helper validates lattice/order and returns an FFmpeg command string. Game/app adapters and an operational MCP Apps host bridge are not implemented here. |
| old-flow-files | Frozen reference archive; never a build/runtime dependency. |
The canonical stack now has successful locked-install and WXT/face build receipts for daisyUI 5.7.0 and TypeScript 5.9.3, honoring sum.yml’s 5.7/5.9 requirement. WXT 0.21.4, Vite 8.3.1, Svelte 5.57.1 and SvelteKit 2.70.3 remain recorded. Actual compiler-API smoke passes with zero parse diagnostics; no full-project typecheck is claimed. The earlier daisyUI 5.0.0-beta.8/TypeScript 7.0.2 build and artifacts remain preserved history of a contract violation, not an amendment. Build success does not establish deployment, font delivery, contrast or accessibility.
Gateway and media state
SQLite owns production/batch/shot/job/asset records and stored provenance/lineage. The asset table is assets, not asset_index. Provenance is stored in asset data; physical per-asset sidecars and automatic imports of LEDGER, Bible or session files are not established.
Queue concurrency is persisted per production: Slow 1, Balanced 2, Fast 4, custom 1–8. Optional provider caps are constructor configuration, not dynamic registry assignments. The registry discovers models/binaries and broker status, exposes admitted routes and unknowns; it does not establish live quota/latency/quality or dynamically reroute the crew.
Image and video routes are explicitly pinned; the actual native branch is distinct from local FFmpeg assembly. Confirmed quotes create immutable work, optionally held until Start. Safe transient failures can back off on the same provider; structured 429 stops the affected item without retry, re-enqueue or provider/account/model switching. Accepted/unknown outcomes and interrupted in-flight work remain blocked against duplicate paid submissions. Queued/backoff work can resume. Selecting a winner does not generate; Promote to video creates a separate draft requiring another quote.
At D-198 closure, native evidence comprised four genuine images and three genuine videos plus one HTTP403 failure across eight submission POSTs. See exact duration, cost, persistence and failure limits. The later Veo duration guard has a separate 55-test/359-expectation passing gate and 12 controlled actual-HTTP quote cases with unknown cost, unchanged requested durations and zero jobs/provider calls/unexpected network. Those native paid runs preceded that guard. The permanent HTTP regression separately checks invalid confirmation HTTP400 and valid 8-second held work; neither is new provider acceptance. D-202’s current observations remain separately dated above.
RPC bridge: implemented seams and missing integration
| Concern | Inspected source boundary |
|---|---|
| Spawn | The bridge supports explicit start and idle disposal with omp RPC/profile arguments; the gateway owns one prod_default instance, not lazy sessions per production. |
| Frames | Ready-triggered negotiation and JSONL/rpc_chunk reassembly exist. The named 1 MiB inbound limit is not enforced on incoming lines; reassembled checking uses string length after joining. Do not claim a complete 1 MiB/64 MiB byte-memory safety bound. |
| Resume | Respawn plus switch_session/get_messages_page sends exist. Acknowledged paginated replay, readiness synchronization and session_busy/stale_cursor recovery are not implemented/proved. |
| Completion | agent_end with isTerminal not false is the terminal signal; prompt acknowledgement is not completion. |
| Extension UI | HTTP-created confirm/select-style approvals exist. General RPC forwarding lacks established production ownership propagation; input/editor values and all four declared dialog types are not equivalently implemented. |
| Agent writes | storyflow:// scheme registration exists, but host_uri_request write ingestion does not. Canonical edits currently use the Studio HTTP API. |
| Todos and agents | Subscription sends and event names exist; set_todos mirroring and a rendered Agents tree do not. |
These are implementation gaps relative to the historical contract, not permissions to invent success or expand this documentation task into a new runtime.
Protocol and reconnect
Envelope metadata has the following shape; payload validation belongs to individual consumers:
{
"v": 2,
"t": "shot.updated",
"prod": "prod_example",
"seq": 42,
"data": {}
}data is z.unknown() in EnvelopeSchema, not a universally typed object. Declared topics include snapshot, production., shot., job.* including job.retrying, asset.*, studio.updated, log.created, agent.event, agent.todo, ui.request, ui.response and ping/pong. A declared topic does not prove a rendered agent/todo surface.
The gateway sends periodic pings and exposes optional GET /snapshot?since=seq deltas. The current face opens WebSocket and refreshes full production snapshots on reconnect/visibility; ordinary deltas trigger debounced resnapshot. It does not implement the historical since-cursor handshake. Candidate REST, assets and secure WebSocket use the public app origin; local echo/helper receipts are not authenticated public WS101 or installed-extension acceptance.
Production/tab/batch selections deep-link; transient dialogs/editor/compare states do not all deep-link. Server-acknowledged run/cost/approval mutations remain distinct from local reversible editing. Ctrl/Cmd+Enter opens cost preview, never immediate generation. Native dialogs handle closure and focus; complete keyboard, mobile and central-overlay behavior has not been accepted externally.