M6 Phase D — run acp-adapter under node --import tsx (FDQ-70) - #30
Closed
Mayakovsky wants to merge 1 commit into
Closed
M6 Phase D — run acp-adapter under node --import tsx (FDQ-70)#30Mayakovsky wants to merge 1 commit into
Mayakovsky wants to merge 1 commit into
Conversation
The @virtuals-protocol/acp-node-v2 SDK is ESM with extensionless relative imports
(bun-authored: dist/index.js does `export * from "./acpAgent"`). bun tolerates these;
strict Node ESM rejects them ("Cannot find module .../dist/acpAgent"). The adapter,
designed as a standalone `node` process, therefore could not load the SDK. The tsx
loader resolves extensionless ESM, so the unit runs under `node --import tsx`.
- infra/systemd/grey-acp-adapter.service: ExecStart → `/usr/bin/node --import tsx …`.
- adapters/acp-adapter/package.json: tsx devDependency → dependency (runtime requirement).
Validated live in the Phase D cutover window (job #70220 accepted → delivered →
completed under this runtime). Build isolation intact: typecheck + build green, tier-1
offline smoke green (SDK still out of the tsc type graph via the variable-specifier
dynamic import).
NOTE: the running box already carries this ExecStart (window fix). Once merged, the
committed unit matches the box — until then, do not re-copy the old unit over it.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
Superseded by #31. #30 shipped a production |
3 tasks
Mayakovsky
added a commit
that referenced
this pull request
Aug 12, 2026
…ENT_INSTANCE (BION-DIRECTIVE-38) Once deploy() runs, BASE_MECH_AGENT_INSTANCE is the sole (threshold=1) signer of the service's real Safe multisig, and every delivered mech response requires deliverToMarketplace, gated onlyOperator (operator = the multisig, read live from ServiceRegistry). Nothing in this codebase could produce that call. This builds the capability without turning it on. - agentInstanceSigner.ts: isolated hot-key loader (mirrors grey-sweeper's wallet.ts pattern), new invariant #30 confines the key to this one file. - mechAbi.ts / safeAbi.ts: real deliverToMarketplace + Safe v1.3.0 execTransaction ABIs, traced from OlasMech.sol/Mech.sol/GnosisSafe.sol source (valory-xyz/ai-registry-mech, safe-global/safe-contracts@v1.3.0), not guessed. - safeDeliveryClient.ts: builds deliverToMarketplace calldata, reads the multisig's real getTransactionHash (ground truth, not hand-rolled EIP-712), signs via the plain-ECDSA (non-eth_sign) branch checkNSignatures expects, wraps in execTransaction with a real estimated safeTxGas so a failed inner call surfaces as success:false instead of reverting the whole tx. - mechAdapter.ts: new deliverSigned() step, same observeOnly-gated shape as every other registration step. Not wired to any automatic trigger — no task-intake -> deliver flow exists yet. Real multisig (0x5587...5872) confirmed live: Safe v1.3.0, sole owner = BASE_MECH_AGENT_INSTANCE, threshold=1. Storage layout (owners mapping slot 2, mech's maxDeliveryRate slot 1) empirically verified against real chain state, not derived from source order alone. Fork-proven (GREY_MECH_ANVIL=1, safeDeliveryClient.anvil.test.ts) against a real Base mainnet fork: owner substituted via storage override (real key never leaves Forces), a real pending request created via the real MechMarketplace.request(), delivered end-to-end through a real signed execTransaction, independently verified via numTotalDeliveries incrementing. Grey's real mech's maxDeliveryRate is an unusually large real value (~1.14e77 wei, confirmed on two independent RPCs) that also hit a genuine anvil/revm tooling wall for value transfers above ~1e35 wei (bisected, not assumed) -- worked around via the same storage-override technique for the test run only. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
M6 Phase D — FDQ-70: run the ACP adapter under
node --import tsxDiscovered live in the Phase D cutover window.
@virtuals-protocol/acp-node-v2@0.0.4is"type":"module"with extensionless relative imports (dist/index.js:export * from "./acpAgent", …). bun (the ElizaOS runtime) tolerates these; strict Node ESM rejects them (Cannot find module '.../dist/acpAgent'). The adapter was designed as a standalonenodeprocess, so it could not load the SDK under plainnode.Fix — run under the tsx loader, which resolves extensionless ESM:
infra/systemd/grey-acp-adapter.service→ExecStart=/usr/bin/node --import tsx adapters/acp-adapter/dist/main.js.adapters/acp-adapter/package.json→tsxmoves fromdevDependenciestodependencies(now a runtime requirement).(
bunisn't on thegreyuser's PATH;node --experimental-specifier-resolution=nodewas removed in Node ≥17 — tsx is the clean path, and it was already an adapter dep-of-record.)Validated live: the running adapter uses this ExecStart and completed proof job #70220 end-to-end (accept → shared handler → submit → nudge → complete → escrow to
0xa966…). Build isolation intact — typecheck + build green, tier-1 offline smoke green (SDK still out of the tsc type graph via the variable-specifier dynamic import)./etc/systemd/system/grey-acp-adapter.servicealready carries this fix (applied in-window; survives reboot). Do not re-copy the pre-fix committed unit over it until this merges. Once merged,infra/matches the box.Alternative for later hardening (not this PR): a build step that bundles/rewrites the SDK's extensionless imports so the adapter can run under bare
node.🤖 Generated with Claude Code