feat(phoenix): add Eternal state preparation - #9
Conversation
|
|
|
|
fdd0f55 to
ecdbc0c
Compare
bfecef3 to
eb85f90
Compare
eb85f90 to
6f4a50f
Compare
6f4a50f to
ca1c453
Compare
ca1c453 to
6f864e5
Compare
| pub fn new() -> Self { | ||
| let local = format!( | ||
| "http://127.0.0.1:{}", | ||
| CHANGE_TO_DEFAULT_STUDIO_PORT_ONCE_SUPERVISOR_MERGED | ||
| ); | ||
| Self::with_urls(local.clone(), local) |
There was a problem hiding this comment.
Standalone staging ignores configured port
When standalone surfpool mcp is used with a Studio server on a non-default --studio-port, Surfpool::new() still targets 127.0.0.1:18488, causing Phoenix scenario staging to post to the wrong server and fail.
Knowledge Base Used: MCP server integration
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/mcp/src/surfpool/mod.rs
Line: 179-184
Comment:
**Standalone staging ignores configured port**
When standalone `surfpool mcp` is used with a Studio server on a non-default `--studio-port`, `Surfpool::new()` still targets `127.0.0.1:18488`, causing Phoenix scenario staging to post to the wrong server and fail.
**Knowledge Base Used:** [MCP server integration](https://app.greptile.com/limechain/-/custom-context/knowledge-base/limechain/surfpool/-/docs/mcp-server.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| let self_host = match bind_host { | ||
| "" | "0.0.0.0" | "*" => "127.0.0.1", | ||
| "::" | "[::]" => "[::1]", | ||
| host => host, | ||
| }; | ||
| let mcp_local_api_url = format!("http://{self_host}:{bind_port}"); |
There was a problem hiding this comment.
When Studio binds to a specific unbracketed IPv6 address such as ::1, this interpolation produces http://::1:<port> instead of a bracketed URL, causing Phoenix MCP builders to fail before reaching the scenario endpoint.
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/cli/src/http/mod.rs
Line: 79-84
Comment:
**IPv6 staging URL is malformed**
When Studio binds to a specific unbracketed IPv6 address such as `::1`, this interpolation produces `http://::1:<port>` instead of a bracketed URL, causing Phoenix MCP builders to fail before reaching the scenario endpoint.
**Knowledge Base Used:**
- [Command-line operations](https://app.greptile.com/limechain/-/custom-context/knowledge-base/limechain/surfpool/-/docs/command-line-operations.md)
- [MCP server integration](https://app.greptile.com/limechain/-/custom-context/knowledge-base/limechain/surfpool/-/docs/mcp-server.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.6f864e5 to
9cf8066
Compare
|
@greptileai This axis is intentionally reverted to the established team convention: the MCP tools use the shared default-port constant inline, exactly as the pump tool on the base branch does. The constant's own name (CHANGE_TO_DEFAULT_STUDIO_PORT_ONCE_SUPERVISOR_MERGED) is the tracked follow-up — runtime addresses arrive with the supervisor work, for every tool at once, rather than piecemeal per PR. A non-default Studio port is not a supported configuration today anyway: the dashboard's own /config fetch breaks on it, independent of MCP. Standalone surfpool mcp has no configuration channel at all (the command takes no flags), so the constant is that mode's contract by construction. So please check your score as I believe is unproper 4/5 |
|
That context is valid. Given the current contract, the inline |
9cf8066 to
989d4bd
Compare
989d4bd to
1d5ce77
Compare
Adds declarative state preparation for Phoenix Eternal:
The implementation prepares protocol state only. It does not
build or execute trading or liquidation transactions.
Verification
Stacking
This PR is stacked on
feat/pump-protocol.Once the Pump PR is merged into
develop, this branch will be rebased and retargeted todevelop.Greptile Summary
The PR adds Phoenix Eternal scenario templates, typed state patching, live account validation, and a dedicated MCP collateral-scenario builder.
Confidence Score: 4/5
The PR is not yet safe to merge because MCP scenario staging still fails whenever Studio is bound exclusively away from IPv4 loopback or runs on a non-default port.
The shared
stage_scenariopath remains fixed to127.0.0.1:18488, while Studio supports configurable bind hosts and ports and standalone MCP has no endpoint configuration path; the new Phoenix builder delegates directly to this staging method.Files Needing Attention: crates/mcp/src/surfpool/mod.rs, crates/cli/src/http/mod.rs
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Client[MCP client] --> Builder[Phoenix scenario builder] Builder --> Surfnet[Read and validate live Surfnet account] Surfnet --> Scenario[Build declarative scenario] Scenario --> Stage[POST /v1/scenarios] Stage --> Studio[Studio scenario service] Studio --> SVM[Materialize Phoenix account override]Reviews (17): Last reviewed commit: "feat(phoenix): add Eternal state prepara..." | Re-trigger Greptile
Context used: