Skip to content

#54 phase 2 (client side): plugins talk to the 0.2 proxy through frame capabilities; pin atomic-server 11264e83e - #142

Merged
michielbdejong merged 8 commits into
mainfrom
claude/issue-54-phase2-client
Sep 24, 2026
Merged

michielbdejong merged 8 commits into
mainfrom
claude/issue-54-phase2-client

Conversation

@michielbdejong

Copy link
Copy Markdown
Contributor

The atomic-plugins client side of the #54 interim auth design. Refs #54.

Pin. .atomic-server-ref moves to 11264e83e on ontola/atomic-server claude/atomic-plugins-pin (a fast-forward from 8270cdf6a). It adds:

  • #1696: v2 signatures;
  • #1697: frame capabilities, replacing the relay;
  • #1702: host signing of ctx.http to the proxy;
  • #1710: installation app id, runtimes and ctx.connections;
  • #1725: proxy: [...] and atomic-proxy: URLs.

Because #1697 removes the relay, the pin and the client switch have to land together.

Mock proxy. integrations/localthought/mock-proxy.mjs now speaks the integration-proxy 0.2 protocol. It makes the same checks as the real proxy on everything clients send:

  • v2 signatures: method, full URL, timestamp, body hash, ±5 min, each accepted once;
  • agent-id canonicalisation;
  • capabilities: owner signature, aud, 15-minute limit, scope, delegation, cnf key;
  • the proxy's error codes;
  • routes for connect, redeem, connections, delegations and runtimes.

Its tests verify the shared v2 vectors and atomic-server's capability vector. The per-platform fixtures, their drivers and failure injection are unchanged. The real proxy isn't used in the lanes, because it only accepts https upstreams and would need an OAuth server and Postgres per lane.

Specs. Every plugin e2e (pets, notion, calendar, timesheets, issue-tracker, money) uses the new flow: consent bar → /connect → signed redeem → delegation → capability.

  • Each spec asserts at the mock that there is one connection, owned by the signed-in agent and delegated once.
  • Pets also revokes the delegation and gets back in through "Use existing connection".
  • Clockify's API key is entered on the proxy's consent page.

Apps. Each drive app takes the new connect result and throws the proxy's own refusals. A new test pins that the proxy's 404 unknown_connection can never be read as "Clockify entry deleted" by M1's deletion check. Pets is released as 0.1.1, since published builds are immutable.

Deleted (nothing imports them any more):

  • integrations/localthought/browser.ts, settings.ts and browser-smoke.mjs, plus their tests;
  • the rotating-code path in issue-tracker/devonian/github-issues/proxy.mjs.

no-credentials-in-graph.test.mjs has new rules for the new flow.

Docs: README, PARALLEL_LANES, READINESS, AGENTS.md, and SELF_HOSTING.md (the client-flow paragraph).

Checks at 11264e83e:

  • every lane passes, including e2e;
  • calendar e2e passed 9 of 10 runs: one unexplained timeout on the calendar list after connecting, and the last 3 passed;
  • the generic plugin-system suite passes (7);
  • certify and apps.mjs check pass;
  • 86 tooling tests pass;
  • oxlint, oxfmt and the e2e tsc are clean.

Not yet (host follow-ups in progress on atomic-server: claude/page-runtimes and claude/proxy-origin-private):

  • the page's POST /runtimes, so sandbox ctx.http to the proxy isn't exercised yet;
  • appAgentOf using integrationAppAgent;
  • in Docker-image mode, the proxy address 127.0.0.1 points at the container itself, not the host.

🤖 Generated with Claude Code

Michiel de Jong and others added 8 commits September 24, 2026 17:22
The e2e mock proxy now checks what the real proxy (integration-proxy/src,
#122) checks on the surface a client sees: Atomic v2 request signatures
(method, full URL under the mock's BASE_URL, timestamp, body hash; +-5 min;
single use), agent ids in both prefixes and alphabets, frame capabilities
(owner-signed, aud, exp <= 15 min, scope, delegation, cnf signs the
request), connections owned by the redeem signer, delegations, runtimes,
and the proxy's {error, message} codes. No login and no user_id at
/connect; API-key platforms take the key on the consent page, as
templates.rs does. Rotating connection codes, Bearer and X-Connection-Code
are gone.

Fixtures, their drivers (/__fixture/..., /fixture/<platform>/<driver>) and
failure injection are unchanged: the mock rewrites /proxy/{id}/{platform}/
to the /proxy/{platform}/ paths fixtures already match. New test-side
introspection: GET /__mock/connections and POST /__mock/revoke.

mock-proxy.test.mjs verifies the shared v2 vectors
(integration-proxy/tests/fixtures/atomic-request-v2-vectors.json) and
atomic-server's capability vector against the mock's verifier.

Kept the mock rather than running the real binary: the real proxy only
accepts https upstreams and catalogs, needs a provider OAuth server per
platform and Postgres per lane.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…phase 2)

Deleted, since connection codes no longer exist and nothing in this repo or
the pinned atomic-server imports them (atomic-server's
helpers/proxyConnections.ts replaced them):
- integrations/localthought/browser.ts, browser.test.ts
  (BrowserIntegrations: rotating-code client)
- integrations/localthought/settings.ts, settings.test.ts
- integrations/localthought/browser-smoke.mjs

issue-tracker's devonian proxyTransport is dispatch-only now (no
getCode/setCode, Bearer or X-Connection-Code branch); background.mjs
classifies a connection no longer delegated to the app as needing a
person.

no-credentials-in-graph.test.mjs: no graph property naming a connection
code, capability or code verifier; no x-connection-code anywhere shipped;
no request signing or capability minting in plugin code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onnection" (#54 phase 2)

store.proxy keeps its shape, so the apps change little:
- store.ts (each plugin's copy): connect() may now resolve
  {status: 'connected', connectionId, platform} when the person picks a
  connection they already have (no reload); PUT is a valid method; docs
  describe the frame key + capability flow instead of the relay and its
  rotating code.
- Controllers reload their connections on `connected`.
- Transports throw the integration proxy's own refusals ({error, message}
  with an api_error.rs code; answered before the provider) instead of
  handing them on as the provider's answer; a lost delegation or deleted
  connection says "Connect again".
- issue-tracker: "not sent" host errors are the new host's (capability
  refused, no Ed25519, no app identity), and proxy refusals are marked
  notSent.
- calendar: a lost write response no longer spends the connection (there
  are no codes to spend); the fake store models the new host and proxy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…phase 2)

Descends from the previous pin 8270cdf6a and adds ontola/atomic-server
#1696 (v2 request signatures), #1702 (host-signed ctx.http to the
configured proxy), #1710 (installation app ids, runtimes, delegated
connections), #1725 (proxy: [...] and atomic-proxy: URLs) and #1697 (frame
capabilities replace the proxy relay).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apps/pets/0.1.1/ui.js is app/build.mjs's output after the phase 2 app
changes (connect may resolve `connected`; proxy refusals are thrown). 0.1.0
stays as published; the catalog now pins 0.1.1 and its integrity.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ase 2)

- Consent bar -> the mock proxy's /connect (no user_id) -> back to
  /app/integrations, where the page redeems signed with the user key and
  delegates to the app agent; the frame then calls the proxy with a
  capability and its own key. The consent button is the real proxy's
  ("... with this destination"); Clockify, an API-key platform, takes the
  key on the proxy's page.
- The localStorage connection-code assertions are gone. Specs instead check
  at the mock (GET /__mock/connections) that one connection exists, owned
  by the signed-in agent and delegated once, and that the page kept no
  proxy state in localStorage.
- pets: revoke the delegation at the proxy, then "Use existing connection"
  gets the app back without the consent page.
- calendar: the lost-response route matches /proxy/*/google-calendar/**,
  and no reconnect follows it (nothing is spent any more).
- issue-tracker: GitHub-side reads and edits use the github-issues
  fixture's new drivers (snapshot, updateIssue) instead of spending the
  page's code.
- tooling: serve.mjs passes MOCK_PROXY_BASE_URL (= INTEGRATION_PROXY_URL =
  ATOMIC_INTEGRATION_PROXY_URL, one mockProxyOrigin()); TENANT_SECRET is
  gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eleted

- integrations/README.md: "The host's proxy access" replaces "The host
  relay" (connections at the proxy, delegations, "Use existing
  connection", frame key + capability + v2 signatures, proxy refusals, the
  new no-credentials rules); new "Sandbox plugins and the proxy": the pin
  has proxy: [...] / atomic-proxy: and host signing, but no plugin here
  uses it yet (they call providers with secrets; POST /runtimes from the
  page is still to do upstream).
- localthought/README.md: now describes the mock proxy (routes, checks,
  signed origin, test-side routes, what it lacks) and lists what #54 phase
  2 deleted; the retired runtime stays as history.
- READINESS, PARALLEL_LANES, plugin READMEs, the root README and AGENTS.md:
  no relay or rotating codes; the pin requirement is #1697.
- integration-proxy/SELF_HOSTING.md: what the data browser does on Connect
  (redeem signed, delegation, frame calls with a capability; CORS for the
  data browser's origin and Origin: null); the not-verified note no longer
  points at the deleted browser.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 2 x #123 M1)

After rebasing onto M1's observation log: relayTransport throws the
integration proxy's own refusals (e.g. 404 unknown_connection) as a plain
Error before requestJson wraps a response in ProxyError, so
clockifyObserve's saysDeleted() cannot mistake a lost connection for a
confirmed deletion. Pinned with a test. Two comments M1 carried over still
said "relay".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michielbdejong
michielbdejong merged commit b857bd9 into main Sep 24, 2026
26 checks passed
michielbdejong pushed a commit that referenced this pull request Sep 24, 2026
…t from #54 phase 2

After the rebase onto #142: the transport keeps #142's proxyRefusal and
throws it as a ProxyRefusal carrying the proxy's code, which the observer
records. unknown_connection, not_delegated, capability_expired (after the
frame's own retry), unsupported_authorization and #142's other reconnect
codes show Reconnect needed; unauthorized and forbidden are an access
problem, not a reconnect. connect() reloads on a 'connected' result, as
#142 does, and restores the previous state on cancel.

build.mjs minifies (116 KB, from 193 KB unminified), so build.test.ts's
cap is back at 160 KiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michielbdejong pushed a commit that referenced this pull request Sep 24, 2026
…t from #54 phase 2

After the rebase onto #142: the transport keeps #142's proxyRefusal and
throws it as a ProxyRefusal carrying the proxy's code, which the observer
records. unknown_connection, not_delegated, capability_expired (after the
frame's own retry), unsupported_authorization and #142's other reconnect
codes show Reconnect needed; unauthorized and forbidden are an access
problem, not a reconnect. connect() reloads on a 'connected' result, as
#142 does, and restores the previous state on cancel.

build.mjs minifies (116 KB, from 193 KB unminified), so build.test.ts's
cap is back at 160 KiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michielbdejong pushed a commit that referenced this pull request Sep 25, 2026
…t from #54 phase 2

After the rebase onto #142: the transport keeps #142's proxyRefusal and
throws it as a ProxyRefusal carrying the proxy's code, which the observer
records. unknown_connection, not_delegated, capability_expired (after the
frame's own retry), unsupported_authorization and #142's other reconnect
codes show Reconnect needed; unauthorized and forbidden are an access
problem, not a reconnect. connect() reloads on a 'connected' result, as
#142 does, and restores the previous state on cancel.

build.mjs minifies (116 KB, from 193 KB unminified), so build.test.ts's
cap is back at 160 KiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant