environment-railway v0.4.10: exec_session ephemeral node + log_storage proxy + singleton relay (REQ-052)#5
Merged
Conversation
Wire the remote-animus session method: env.runSession dispatches the subject to the container's own animus via RelayServer.runSession and forwards its journal events; the exec_session handler maps them onto ExecNotification Journal frames and returns the terminal ExecSessionResponse. (startCommand daemon-boot + encrypted secret bundle land with the image rebuild / Phase C.) typecheck clean, 39 tests. REQUIREMENT-052 / TASK-457.
Cherry-picks the exec_session role method (execSession handler → env.runSession → RelayServer.runSession, forwarding node journal events) onto the deployed v0.4.4 line. Bundles the session-capable env-transport (runSession + journal frames).
Add ANIMUS_ENV_REGISTRY_USERNAME/PASSWORD support so a private run image (e.g. ghcr) can be pulled: thread registryCredentials through createRunService -> serviceInstanceUpdate. Config reads both env vars; applied only when both present.
Wire the RelayServer's onReverseRpc to a PluginClient spawning the parent-side backend plugin (ANIMUS_ENV_UPSTREAM_BACKEND_BIN, e.g. animus-postgres) with the parent's DATABASE_URL, so a lean node's proxied subject/config/queue/journal role calls resolve against the parent DB. Config: upstreamBackendBin + databaseUrl from env; declared ANIMUS_ENV_UPSTREAM_BACKEND_BIN + DATABASE_URL in the manifest.
Bundles env-transport fix: PluginClient now advertises protocol_version 1.1.0 on initialize, so the parent-side animus-postgres accepts proxied subject/ config/queue/journal calls (was -32600 'host did not advertise a protocol_version').
- Wire a second parent-side PluginClient for log-storage-s3 (ANIMUS_ENV_UPSTREAM_LOG_BIN, default /app/.animus/plugins/animus-log-storage-s3) and route a node's log_storage/* backend/call to it, forwarding the parent's S3 env (S3_BUCKET/S3_ACCESS_KEY_ID/S3_SECRET_ACCESS_KEY + optional S3_ENDPOINT/S3_REGION/S3_PREFIX/S3_FORCE_PATH_STYLE); other roles still hit animus-postgres. Falls back to default when S3 env is absent. - Inject GH_TOKEN (= the minted/passed GitHub token) alongside GITHUB_TOKEN in both githubAppCredentials and harnessCredentialVars so gh pr create works. - harnessCredentialVars defaults CODEX_OAUTH_HOME to the durable portal path /data/animus-state/codex-config so codex works on nodes without portal config.
relay() now dials the always-on animus-env-relay singleton via RelayClient (unix socket) rather than hosting an in-process RelayServer on the fixed port. Removes the per-instance port bind (EADDRINUSE/leak/no-concurrency). Reverse-RPC still serviced here against the parent's animus-postgres/log-storage. Removes the two obsolete port-binding tests (now the singleton's concern).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
REQ-052 lean-node (ephemeral remote-animus) support for the Railway environment plugin. Bumps the plugin to v0.4.10. 7 commits vs
main.0.
environment/exec_session(REQ-052 remote-animus) — v0.4.5environment/exec_session: provision a Railway ephemeral node, run a session, stream back. Private-registry pull credentials for the run image (v0.4.6).1. Role-routed parent servicing — log_storage proxies to log-storage-s3 (not postgres) — v0.4.9
PluginClientfor the log-storage plugin (ANIMUS_ENV_UPSTREAM_LOG_BIN, default/app/.animus/plugins/animus-log-storage-s3).log_storage/*backend/callnow routes to that log servicer; every other role (subject/config/queue/…) still hits animus-postgres. Uses the role-routedmakeBackendCallHandler({ default, log_storage })from animus-env-transport. Parent-side backend/call servicing added v0.4.7; advertisesprotocol_versionv0.4.8.S3_BUCKET,S3_ACCESS_KEY_ID,S3_SECRET_ACCESS_KEY(required) + optionalS3_ENDPOINT,S3_REGION,S3_PREFIX,S3_FORCE_PATH_STYLE. Never sent to the node.2.
ghworks on the node — v0.4.9Injects
GH_TOKEN(= the GitHub token) alongsideGITHUB_TOKEN, in bothgithubAppCredentialsandharnessCredentialVars, sogh pr createauthenticates.3. Codex home default — v0.4.9
harnessCredentialVarsdefaultsCODEX_OAUTH_HOMEto/data/animus-state/codex-configwhen unset, so codex auth injects on nodes without extra portal config.4. Shared singleton relay — v0.4.10 (NEW)
Connect to the shared singleton relay instead of binding the fixed port directly — pairs with the
RelaySingletonin animus-env-transport PR #1, eliminatingEADDRINUSE/port-leak on repeated exec_session.New env vars
ANIMUS_ENV_UPSTREAM_LOG_BIN(+ the forwarded S3 vars documented in the manifest).Depends on
animus-env-transport PR #1 (role-routed
makeBackendCallHandler+RelaySingleton) — picked up via the local path-dep symlink. Land env-transport first.Tests
npm run build+npm testgreen.logStorageEnv, GH_TOKEN, codex-default, and singleton-relay assertions added.Release + plugins.lock/animus.toml repin + deploy handled separately (see REQ-052 consolidation plan). Do NOT merge before env-transport #1.