Repository navigation
Closed
Labels
ready-for-agentFully specified, ready for an AFK agent
Description
Part of #193. Implements spec §10 and ADR-0010; decisions Paths for addresses, a sandboxed frame, the frame prototype (lift the broker's shape and the click-through from proto/frame-broker, PR #185; copy the shape, not the files) and Tier 1 serving.
What to build
- The shell for tier ≥ 1 versions in
packages/serving: the page at the address resolves the name, binds a patch id and a version id, frames/~content/<patchId>/<versionId>?n=<nonce>in<iframe sandbox="allow-scripts allow-modals">; the shell's own CSP carriesframe-src 'self'. Tier 0 keepssrcdoc; two branches in one renderer keyed on the version's tier; a historical version renders with its own tier.@patchy/serving/shellexports the renderer, the broker script and the CSP constants with no auth or platform infrastructure, for ticket 14. - The content response for tier ≥ 1: spec §10's CSP (
sandbox allow-scripts allow-modals; default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src blob: data:; font-src blob: data:; media-src blob: data:; connect-src 'none'), a Permissions-Policy denying camera, microphone and geolocation, the same door as the shell, caching keyed to sharing. - The broker (Patchy's own script, on company and public shells alike): a
MessageChannelhanded once to the intended document (nonce echoed inready { wire, nonce }), bounded bootstrap failure shown as a notice, a secondloadcloses the port; envelope per spec §10; own-property dispatch; every runtime request validated with thepackages/apioperation schemas, then forwarded toPOST /api/runtime/callwith the bound ids, the principal, theX-Patchy-WireandX-Patchy-Principalheaders andcredentials: "same-origin";mefirst with a null principal, its user id bound as the principal for every later call; bytes transferred asArrayBufferand carried on the bytes routes; browser-owned opsroute.set(refusing a~first segment),routeonpopstate,download; outstanding requests and held bytes bounded (32, 64 MiB). - Notices:
session_expiredandprincipal_changedreload the whole page after sign-in;access_deniedis non-suppressible and offers no reload; validation errors are the patch's. The bootstrapmeon a public shell answers null and every other op surfacesnot_available_on_public. - Wire version: the bundle declares
wireinready; the shell forwards it; the three stale states of spec §10 with the needs-rebuild door as a first-party page (ui-consistency). - Publish admission widens to tier 1 (ticket 1's interim refusal goes): a tier 1 bundle is stored raw, never through the safe-HTML policy; a tier 0 claim over script stays
tier_mismatch.
Admitted at merge
Tier 1 manifests and bundles; they serve in the sandbox.
Done when
Playwright, Chromium and Firefox, serial and few, against a server with fake Clerk keys and a seeded session:
- Spec §10's acceptance list: script-initiated navigation, redirects and 204 responses from inside the frame blocked by
frame-src; navigation during pending reads and writes; malformed, oversized and duplicate-id messages; login, logout, expiry and account switch mid-session; simple cross-site POSTs refused; the CSP present on redirects, error pages and uploaded active content; a stale public shell refreshes once and stops; a 2,000-row print with the first and last row checked. - Deep link and back/forward through the route bridge; an own file shown through
url(name); a shell-owned download;localStorage,fetchandwindow.openfail inside the frame; a public tier 1 patch renders signed out andtables.listshows the notice. - ADR-0010 written; the Serving glossary rewritten tier-scoped (Serving guarantee, Page, Shell, Broker, Envelope, Route bridge, Needs-rebuild door);
docs/product.md§ Tier 0 and § Tier 1 carry the shell-script line and the promise.
Surfaces
Served pages (ui-consistency), the wire (admission), vocabulary, the ADR, the patchy skill's reading section and lock hash.
Metadata
Metadata
Assignees
Labels
ready-for-agentFully specified, ready for an AFK agent
Activity