Repository navigation
Installation app ids, published node agents and delegated connections for the integration proxy (#1700, answers 1-3) - #1710
Conversation
… connections (#1700) Answers 1-3 of #1700 (ontola/atomic-plugins#54, phase 2), provisional: - integrationAppAgent: a keyless atomic:agent:<pubkey> that installRelease mints in the genesis the user signs, discarding the private key. The server refuses a value that is not an agent id, and refuses to change it once set. - On activation, each node publishes the agent it minted for a JS Installation on an InstallationRuntime child, signed by and writable by that agent, so the page can register it with POST /runtimes. - integrationConnections ({platform: connection_id}) reaches server-side JS runs as ctx.connections, with the app id as ctx.app, next to ctx.config. The host's values replace any the caller sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The after-commit hook runs outside the Installation's subject lock, so two commits landing together both missed the runtime lookup and both created a child. A duplicate is permanent and syncs to every client. A process-wide lock now covers the lookup and the create; a publish is rare, and once the child exists it is only the lookup. The test fires eight publishes on separate threads, released together. It left seven children before the lock and leaves one now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merge-risk triage (2026-09-28). This is a read-only review of this PR's own diff. The rule it applies: nothing that works today may break for existing users or clients, and new behaviour is added alongside the old. The stack is being rebased onto Verdict: SAFE-WITH-FIX Otherwise additive: new properties and class, and Fix before merging: 🤖 Generated with Claude Code |
|
Closing as part of the plugin-host stack cleanup (Q-101): not needed by atomic-plugins now. See the inventory at #1726 (comment). The branch is kept, and pin candidates are unaffected. Closed by Claude (VPS coordinator) on behalf of Michiel. |
Answers 1–3 of #1700, the atomic-server side of phase 2 of ontola/atomic-plugins#54. Stacked on #1702. The answers are provisional, so all the reading and writing lives in one module,
server/src/plugins/installation_identity.rs.1. An app id per Installation
integrationAppAgent(integration-app-agent, atomicURL, classtype Agent). It holds a keylessatomic:agent:<pubkey>.installRelease(in@tomic/lib) mints the id withmintInstallationAppId(), which generates a keypair and keeps only the public key. It writes the id in the genesis, so the user's signature records it. Both the catalog install (IntegrationStore) andNewPluginButtongo throughinstallRelease, so no UI changes were needed.ctx.app. Frames get it from the page, which can read it directly off the Installation.2. Publishing the node's agent
InstallationRuntime(installation-runtime), withintegrationRuntimeAgent(required) andname.publish_runtime. If this node has an active app agent for the Installation, it creates one child of the Installation with:integrationRuntimeAgentset to that agent;nameset to the node's device name, which is the label forPOST /runtimes;writeset to[that agent].ensure_js_identity).POST /runtimes {app, agent, label}call isn't in this PR.3. The delegated connection id
integrationConnections(integration-connections, JSON):{platform: connection_id}. The before-commit hook refuses anything else: a non-object, a non-string or empty id, or an empty platform.PluginHost::run_context()hook (the default adds nothing) letsStoreHostread the Installation the run resolves to.JsRuntime::run_innerthen setsconnections({}when there are none) andapp(nullwhen unset) on the run input, next toconfig./plugin-run, schedules, triggers, sync sessions and actions. It leaves describe runs and non-Installation hosts byte-for-byte unchanged.integrationConnectionswhen it delegates isn't in this PR.The ontology changes are in
lib/defaults/plugins.json,lib/src/urls.rsandbrowser/lib/src/ontologies/server.ts. TheInstallationclass now recommends the two new properties.Tests (written first)
plugins::installation_identity(8 tests):did:ad:agent:spelling is accepted;writeis the node agent and whose genesis signer is the node agent; a second commit publishes nothing new;ctx.connectionsandctx.appfrom the Installation, next toctx.config; forged caller values are overridden, and a later delegation reaches the next run;{}andnull.browser/lib/src/plugin-install.test.ts:installReleaserecords a freshatomic:agent:for each install, with theatomicUrltag, in the genesis, and with no key material.cargo test -p atomic-server --lib: 285 passed, 1 failed. The failure wastriggers::a_hard_restart_delivers_a_saved_arrival_once, a crash/restart test; it passes when run alone and doesn't touch Installations.cargo test -p atomic_lib --features db-redb --lib: 657 passed.browser/libvitest: 965 passed.cargo clippy -p atomic-server -p atomic_lib --testsis clean.No UI changes.
Open questions
DELETE /runtimes/{agent}. Should the node delete it or mark it once that's done?/commit, and not through snapshot sync, might refuse it. Sync of these children isn't tested.GET /app-agentunchanged. The page can read the app id from the Installation and the runtimes from its children. It could return both in one call if that turns out to be useful.ctx.connections. They have no network access, so they can't reach the proxy anyway.Refs #1700, ontola/atomic-plugins#54, ontola/atomic-plugins#122.
🤖 Generated with Claude Code