Skip to content

pets and notion as iframe drive plugins on syncables/browser + host proxy relay; un-quarantine both e2e (#52, #68) - #85

Merged
michielbdejong merged 4 commits into
mainfrom
claude/issue-52-pets-iframe
Sep 23, 2026
Merged

michielbdejong merged 4 commits into
mainfrom
claude/issue-52-pets-iframe

Conversation

@michielbdejong

@michielbdejong michielbdejong commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Closes #52 under its new direction (see the issue's last comment). It supersedes #76.

Pets is now a drive app that runs in its own iframe, from integrations/pets/app/. It reads through syncables/browser (#83). It reaches the provider only through the host's proxy relay, so it never holds a credential. The host half is ontola/atomic-server claude/plugin-proxy-relay (#1624), which is not merged yet. See "Order" below.

What changes

  • integrations/pets/app/ follows the timesheets/app pattern: a plain-DOM view({ root, store }), bundled by app/build.mjs into one ES module (46 KB).
    • sync.ts: readPlatform walks the bundled Pets document (app/openapi.json) and follows its Link: rel="next" pagination. It adds one typed Property per field under the app's own ontology, adds them to the row class's recommends, and upserts rows in the app's table by id. An unchanged re-sync writes nothing.
    • transport.ts: a syncables Transport over store.proxy.request. It refuses any URL outside the document's servers[0].url, including links the provider sends.
    • controller.ts / main.ts: "Connect Pets" calls store.proxy.connect, and the host draws the consent bar. On load, the app finds its connection with store.proxy.connections and syncs once. The status reads "Last synced …: 5 pets (5 added, 0 updated, 0 unchanged)."
    • syncables/browser is aliased to this repo's syncables/src/browser.ts in build.mjs, tsconfig.json and vitest.config.ts, so it is not taken from npm.
  • fixtures/pets/document.json moves to app/openapi.json. The mock proxy's scenario points at the new path, so the app and the mock share one document.
  • e2e/pets.spec.ts is rewritten to drive the app. It installs the app test-side ("New app", with the bundle as its entry point's source; there is no catalog install flow for drive apps yet), then clicks Connect Pets, the host consent bar, and the mock proxy's consent. It checks the five rows and their datatypes (Age integer, Vaccinated boolean, Weight float, Updated at timestamp).
  • lanes.json: pets tiers: ["e2e"] and the quarantine note is removed (separate last commit). PARALLEL_LANES.md is updated to match.
  • The static sandbox plugin.ts is unchanged.

Host contract (shared with the Notion app)

store.proxy.request({ platform, connectionId, path, method?, query?, body?, ifMatch? })
  -> { status, headers /* link, retry-after, etag, content-type */, body /* parsed JSON or text */ }
store.proxy.connections({ platform }) -> [{ connectionId, platform }]
store.proxy.connect({ platform })     -> settles only on cancel; on consent the page navigates away

This is compatible with timesheets/app/transport.ts's provisional { platform, connectionId, path, query } → { status, body }.

Verification

  • vitest run --config integrations/pets/vitest.config.ts: 12 passed. They cover a two-page Link walk relayed as /pets and then /pets?page=2, datatypes, an idempotent re-sync, transport refusals, controller states, and a bundle check (one module, view only, no fetch, storage or Authorization).
  • tsc -p integrations/pets/tsconfig.json: clean. tsc -p integrations/tsconfig.e2e.json: clean for pets. The one error is in notion/e2e/notion.spec.ts and is not touched here.
  • node --test integrations/localthought/mock-proxy.test.mjs integrations/tooling/lanes.test.mjs: 19 passed. oxfmt and oxlint are clean on integrations/pets.
  • e2e: node integrations/tooling/run-lane.mjs pets --tier e2e passed 3 of 3 runs (13.2s, 13.5s, 13.9s). It ran against a local e2e build of atomic-server claude/plugin-proxy-relay at 7f4978667 (on feat/plugin-debug c707ca4ed), not against the current pin.

Order

  1. atomic-server claude/plugin-proxy-relay is reviewed and merged into feat/plugin-debug (joepio).
  2. .atomic-server-ref is bumped to a SHA that contains it.
  3. This PR is merged. Its last commit (the lanes un-quarantine) fails CI against any pin without the relay: the app shows that the host cannot reach the proxy, and the spec stops at "Not connected". If that commit needs to land first, it can be dropped and re-applied later.

For the maintainer

Pin: this PR sets .atomic-server-ref to 7f4978667, the head of ontola/atomic-server#1657 (host proxy relay, on top of feat/plugin-debug c707ca4ed). That PR is awaiting upstream review, so this pins a SHA rather than waiting.

🤖 Generated with Claude Code

Closes #52
Closes #68

Michiel de Jong and others added 4 commits September 23, 2026 16:36
…t proxy relay (#52)

integrations/pets/app/ is a browser-only drive plugin, built to one ES
module by app/build.mjs (the timesheets/app pattern). It exports view(), which
atomic-server runs in a null-origin iframe:

- Reading: syncables/browser's readPlatform walks the bundled Pets
  document (app/openapi.json, moved from fixtures/pets/document.json, which
  the mock proxy still serves) and follows its Link-header pagination.
  syncables/browser is aliased to this repo's syncables/src/browser.ts.
- Network: only through store.proxy.request (app/transport.ts), the host
  relay from atomic-server claude/plugin-proxy-relay (#1624). The page holds
  the connection. The transport refuses URLs outside servers[0].url.
- Connecting: "Connect Pets" calls store.proxy.connect. The host draws the
  consent bar and runs the PKCE handoff, so there is no pets-specific setup
  code in atomic-server.
- Writing: typed Properties under the app's ontology, the row class's
  recommends, and one row per pet in the app's table, matched by id.
  Unchanged re-syncs write nothing.

e2e/pets.spec.ts now drives that app: it installs the app test-side (New
app plus the bundle as its source), connects through the host bar and the
mock proxy, and checks the five rows and their datatypes. The lane stays
quarantined until .atomic-server-ref includes the relay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pets.spec.ts now drives the Pets drive app through the host proxy relay. It
passed 3 of 3 local runs of `run-lane.mjs pets --tier e2e`, at 13.2 to 13.9s,
against atomic-server claude/plugin-proxy-relay (7f4978667, on
feat/plugin-debug c707ca4ed).

Merge this only together with, or after, an .atomic-server-ref bump to a
commit that contains the relay. Against the current pin the spec fails at
'Not connected', because that host has no store.proxy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…in-frame proxy relay

The pets iframe app needs the host relay (store.proxy.request /
connections / connect) and the connect bar from ontola/atomic-server#1657,
which is on top of feat/plugin-debug c707ca4ed. Pinned to the PR's head
SHA until it is reviewed and merged upstream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With .atomic-server-ref at ontola/atomic-server#1657 (host proxy relay),
the notion e2e drives the Notion drive plugin through store.proxy against
the mock proxy's notion fixture: platforms ["notion"], tiers live+e2e.
Passed locally at 7f4978667 (11.6s), alongside pets e2e (13.4s).
Docs: PARALLEL_LANES 'Still open' and notion/README E2E section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michielbdejong
michielbdejong force-pushed the claude/issue-52-pets-iframe branch from c6f9898 to 4a178ae Compare September 23, 2026 14:38
@michielbdejong michielbdejong changed the title pets: drive app in its own iframe, on syncables/browser and the host proxy relay (#52) pets and notion as iframe drive plugins on syncables/browser + host proxy relay; un-quarantine both e2e (#52, #68) Sep 23, 2026
@michielbdejong

Copy link
Copy Markdown
Contributor Author

Rebased onto main (after #84 and #86) and extended. This PR now also un-quarantines the notion e2e: platforms: ["notion"], tiers: ["live", "e2e"], since it needs the same relay pin. It closes #68.

Verified locally against atomic-server 7f4978667 (ontola/atomic-server#1657):

  • pets e2e passed (13.4s) and notion e2e passed (11.6s);
  • certify.mjs --layer js passed, and the bundles are byte-identical at this pin;
  • tooling and localthought node tests passed (47/47);
  • tsc -p integrations/tsconfig.e2e.json and oxfmt are clean.

Closes #52
Closes #68

@michielbdejong
michielbdejong merged commit 39600c2 into main Sep 23, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant