Why
The current manual-test-trader-roundtrip.sh (PR #475 / issue #474) is written against a shared host manager: it assumes HOST_MANAGER (or SPHERE_HOST_MANAGER) points to one HM that both alice and bob can spawn trader tenants on. Two problems with that:
-
Auth model mismatch. A host manager whitelists AUTHORIZED_CONTROLLERS at boot; the public HM allows exactly one controller pubkey at a time. The soak creates two fresh wallets each run, neither of which is on the whitelist. To run the soak end-to-end against a shared HM, the operator has to edit manager.env and restart the HM container per run — impractical.
-
Architectural intent. Per project owner guidance, the design is for each developer to run their own local HM scoped to their controller pubkey. The public HM is reserved for shared services (escrow, faucet, etc.). The soak should mirror that — alice brings up her own local HM, bob brings up his.
What changes
Once sphere trader spawn / stop lands in sphere-cli (unicity-sphere/sphere-cli#47-or-similar), reshape §3 / §11 of manual-test-trader-roundtrip.sh:
Today (§3):
sphere host spawn alice-trader-$SUFFIX \
--template trader-agent --nametag alice-trader-$SUFFIX \
--env UNICITY_CONTROLLER_PUBKEY=<alice-pubkey> ...
After the wrapper lands:
cd "$PEER_ALICE"
sphere wallet use alice
ALICE_TRADER_ADDR=$(sphere trader spawn --name alice-trader-$SUFFIX --json | jq -r .agent_address)
cd "$PEER_BOB"
sphere wallet use bob
BOB_TRADER_ADDR=$(sphere trader spawn --name bob-trader-$SUFFIX --json | jq -r .agent_address)
Each sphere trader spawn brings up its own HM + tenant scoped to the current wallet's controller pubkey. No shared HM. No HOST_MANAGER env var. No AUTHORIZED_CONTROLLERS editing.
§11 cleanup becomes:
cd "$PEER_ALICE" && sphere wallet use alice && sphere trader stop --name alice-trader-$SUFFIX
cd "$PEER_BOB" && sphere wallet use bob && sphere trader stop --name bob-trader-$SUFFIX
Everything in between (§4 ready-check, §5 fund, §6/§7 post intents, §8 wait for completion, §9 assert deltas) stays the same — the wrapper makes the tenant's address available, but post-spawn the existing sphere trader create-intent --tenant <addr> flow is unchanged.
Acceptance
Out of scope
- The wrapper itself (
sphere trader spawn / stop) — tracked in sphere-cli.
- The trader image rebuild — tracked in agentic_hosting.
- Integration of the trader engine into sphere-sdk as a MarketModule extension — separate conversation.
Related
Why
The current
manual-test-trader-roundtrip.sh(PR #475 / issue #474) is written against a shared host manager: it assumesHOST_MANAGER(orSPHERE_HOST_MANAGER) points to one HM that both alice and bob can spawn trader tenants on. Two problems with that:Auth model mismatch. A host manager whitelists
AUTHORIZED_CONTROLLERSat boot; the public HM allows exactly one controller pubkey at a time. The soak creates two fresh wallets each run, neither of which is on the whitelist. To run the soak end-to-end against a shared HM, the operator has to editmanager.envand restart the HM container per run — impractical.Architectural intent. Per project owner guidance, the design is for each developer to run their own local HM scoped to their controller pubkey. The public HM is reserved for shared services (escrow, faucet, etc.). The soak should mirror that — alice brings up her own local HM, bob brings up his.
What changes
Once
sphere trader spawn/stoplands in sphere-cli (unicity-sphere/sphere-cli#47-or-similar), reshape §3 / §11 ofmanual-test-trader-roundtrip.sh:Today (§3):
After the wrapper lands:
Each
sphere trader spawnbrings up its own HM + tenant scoped to the current wallet's controller pubkey. No shared HM. NoHOST_MANAGERenv var. NoAUTHORIZED_CONTROLLERSediting.§11 cleanup becomes:
Everything in between (§4 ready-check, §5 fund, §6/§7 post intents, §8 wait for completion, §9 assert deltas) stays the same — the wrapper makes the tenant's address available, but post-spawn the existing
sphere trader create-intent --tenant <addr>flow is unchanged.Acceptance
# KNOWN LIMITATIONSblock updated to remove the controller-auth caveat.HOST_MANAGERandSPHERE_HOST_MANAGERenv contracts; replaces with--nameslugs.sphere trader stop; theKEEP_TENANTS=1flag forwards to--keep-hm --keep-data.TRADER_DEAL_DEADLINE_Sdefault from 600 to 900 s likely necessary.docs/DEMO-PLAYBOOK-TRADER-ROUNDTRIP.md) §3 narrative updated — "alice spins up her own trader" is a stronger demo beat than "alice issues a spawn against the shared HM."Out of scope
sphere trader spawn / stop) — tracked in sphere-cli.Related