EdgePilot Live router
The Node Ready Bridge always exposes edgepilot_runtime_status,
edgepilot_runtime_start, edgepilot_runtime_update and edgepilot_runtime_repair, even
before Runtime exists. The bridge automatically prepares the release-bound Runtime before first business use; never treat an older compatible Runtime as ready. Call status when Host tools are unavailable, then start once. When
Runtime is ready, use the six Host meta tools:
edgepilot_connection_list
edgepilot_tool_search
edgepilot_tool_get
edgepilot_tool_execute
edgepilot_result_present
edgepilot_view_present (in-chat cards, below)
Search for an operation, fetch its exact current descriptor, then execute with the returned
schema_revision. Do not invent dynamic MCP tools or cache operation schemas in the
plugin. Strategy package and configuration digests returned by the Runtime must remain
unchanged through backtest or execution requests.
Route one user outcome at a time:
- account availability goes directly to
edgepilot_connection_list;
- unknown capabilities use one concise English
edgepilot_tool_search query, with named
toolkits as filters and no execution values in the query;
- retrieve up to eight exact contracts in one
edgepilot_tool_get call;
- batch only independent calls in
edgepilot_tool_execute; a value returned by an earlier
call starts a later batch;
- use
presentation: "if_required" normally and present only an execute-minted
result_ref.
Route every ordinary chat request for finding or recommending strategies through
edgepilot_strategy_search, including identity/keyword lookup, explicit hard filters,
subjective fit, mixed preferences, “recommend a low-risk strategy” and “find something for
small capital”. Preserve the user's locale and every supported hard constraint; keep
unsupported wishes in the natural-language query and disclose constraints the owner cannot
apply. Never call edgepilot_strategy_recommend or discover/execute
catalog.strategy.recommend for an ordinary chat request, and never create a V3
questionnaire payload. Only an explicit request to open/start the questionnaire or strategy
onboarding may enter the onboarding flow below. The onboarding App, or its explicitly
requested textual fallback, submits the complete confirmed V2 questionnaire. Preserve the
owner order and never merge repeated searches into a new owner ranking. If the user asks for an exact number of recommendations, send that number as
limit (for example, limit=1, limit=2 or limit=3); do not let the search tool default
to ten results for a counted request. Use a larger explicit limit only when the user asks for
options or multiple candidates. For “open”, “start” or “launch EdgePilot”, ensure Runtime is ready, then
call edgepilot_dashboard_open; present its URL as a link (Dashboard links below) and never
spawn a legacy Dashboard directly.
In-chat cards
edgepilot_view_present shows one EdgePilot card in the conversation. The Runtime keeps the
card's state, so it survives reloads and updates itself; its text result is what you tell the
user, briefly, without repeating every number the card shows. Show a card when it helps the
user follow or decide, not for every call:
backtest with {job_ref} right after backtest.run.start (it follows the job to the
result), or {run_ref} when the user asks about a saved run.
configuration with {strategy_slug, strategy_version} (and configuration when not
default) when the user wants to review or change panel settings; the user can edit and
start a backtest there. Order fraction and max total exposure are locked to the strategy
version.
monitor with {venue, mode, instance_id} after a start resolves, or when the user asks how
a running strategy is doing. The user can stop it in the card; the stop is the same attended
confirmation, so never also call trading.instance.stop for that request.
incident with {reference} (a job_, req_, diag_ reference, a run ID or an
instance) for a failure, or {} to list recent ones. It is read-only like the diagnosis
below.
task with {} when the user asks where things stand; it shows this conversation's stages
from needs to a running strategy and the references to continue with.
leaderboard with {sort, query?, locale} for "top strategies by return / Sharpe /
drawdown" (sort return, drawdown, sharpe or published); add access: "redeem_code"
when the user asks which strategies need a redeem code (and access: "open" for the ones that
do not; see Agent redeem codes below); installed with {locale} for "what do I have";
glossary with {metrics, locale} when the user asks what a metric means. metrics uses
exactly these names (max_drawdown_pct, not max_drawdown): return_pct, annualized_return_pct, max_drawdown_pct, sharpe, sortino, profit_factor, win_rate, realized_pnl, trades_per_30d, median_holding_minutes, max_consecutive_losses, worst_trade_pct, capacity_usd, match_score, order_fraction, max_total_exposure_fraction, max_equivalent_leverage, leverage, starting_balance, fee_bps. locale is en, zh-CN,
zh-TW or ko.
- When a card call answers an error naming a field and its valid values, correct that field and
call once more instead of answering without the card.
A card's own actions (save, start a backtest, stop, page) are the user's; when the card later
tells you what happened (it arrives with the user's next message), continue from that and do
not repeat the action.
Dashboard links
Show a Dashboard URL as one Markdown link with a short label in the user's language, never as
the raw address: for example [打开 EdgePilot 控制台](<url>), or, when a strategy target was
opened, [在 EdgePilot 中查看 <strategy name> <version>](<url>).
- A message "Dashboard 已准备好,请点击打开:" is posted by the EdgePilot card's view
button and already carries a fresh link to that strategy: reply only with that exact URL as
the link. Do not call
edgepilot_dashboard_open for it; a new link without the card's target
would open the Dashboard without the strategy.
- A link signs the browser in once within 10 minutes. When the user asks to open it again
later, call
edgepilot_dashboard_open again with the same target as before.
Custom strategies
A custom strategy is the user's own copy of an installed strategy, saved as revisions r1, r2…
It stays on this computer. Its revisions are installed packages with slug custom-<id>-r<N>
and version 0.0.<N>; backtest and deploy them like any other installed strategy.
Where a change goes:
- Panel settings (target exchange, starting balance, fees, leverage, max equivalent leverage)
of any strategy:
workspace.configuration.get, then workspace.configuration.save on that
strategy's directory name. No custom strategy, no question. Order fraction and max total
exposure are locked to the strategy version: changing them is a custom strategy.
- Anything else on an original Marketplace strategy (strategy parameters, even "just backtest
it with length 20", instruments, bars, indicators, entries, exits, sizing, code): ask first,
in the user's language: "This change goes beyond the panel settings, so it is saved as a
custom strategy『 · 』; the original stays unchanged. Create it?"
Suggest the label yourself (2–4 words naming the change, at most 8 CJK characters or 16
letters) and say the user can reply with another one. Create only after a yes. On a no,
change nothing; mention a panel setting when one achieves something similar.
- A change to an existing custom strategy: no question; save its next revision.
- "Make another version" or "keep both": ask for a label, then create a new custom strategy
whose source is that custom revision's slug and version.
- Deleting a custom strategy happens only in the Dashboard; point the user there.
- Runs never override parameters:
overrides take only venue, period_days and workspace.
Steps:
- The source must be installed (
strategy.installed.list); custom_strategy.create refuses
others with custom_source_not_installed. When it is not, tell the user and, with their
consent, install that exact version first (strategy.install, wait for the job). A custom
strategy is a full copy: uninstalling the original later does not affect it.
Then call custom_strategy.create with the source slug and version and the label. When
label_adjusted is true a number was added to keep it unique; use the returned
display_name. A refused label (custom_label_invalid) breaks a rule: 2–16 display width,
letters, digits, spaces and · - + % . / ( ), not only words like "custom", not the
strategy name itself.
- Existing strategy parameters: pass them as
parameters to the commit. Code, markets or new
parameters: custom_strategy.draft.read (without path lists the files), then
custom_strategy.draft.write with the whole file and the sha256 you read as
expected_sha256. To trade another symbol or timeframe, call custom_strategy.draft.market
with symbol (e.g. SOL) and timeframe (e.g. 4-HOUR) first without apply: it changes
the strategy fields, backtest.markets and every venue variant together. Tell the user the
plan, especially remove_venues (exchanges that do not list the symbol), and call it again
with apply: true, the plan's preset_sha256 as expected_sha256 and remove_venues only
after they agree. custom_market_unsupported means the preset has several markets or an
unsupported exchange: then edit the strategy instrument and bar fields and
backtest.markets (and venue_variants) of configs/default.json together; a bar type is
<instrument_id>-<step>-<aggregation>-<price type>-<source>, e.g.
BTCUSDT-PERP.BINANCE-1-HOUR-LAST-EXTERNAL, and every preset trades exactly one venue.
custom_strategy.revision.commit with a one-line change_summary in the user's language.
committed gives the new revision: report "已保存为『』r()".
unchanged means nothing differed. problems name the file and line, or the preset,
venue and parameter: fix them in the draft and commit again; show them to the user only when
you cannot fix them.
- When the user asks to backtest while
draft.state is modified, commit first and say which
revision runs. A deployed instance stays on its revision. One trading account runs one
instance, so moving to a new revision means stopping the old instance (the user confirms)
and deploying the new one.
- After saving a custom strategy's first revision, and whenever the user asks to see it, call
edgepilot_dashboard_open with target {"kind": "custom_strategy", "custom_id": <id>, "revision": <N>} and show the link labelled with its display name, for example
[在 EdgePilot 中查看『自适应 ADX 策略 · 周期20』r1](<url>). Never open a custom revision with a
{"kind": "strategy"} target: that one is for Marketplace versions.
Name custom strategies『 · 』r, never by slug or id. When "this
strategy" or a name could mean several targets (the original, several custom strategies,
revisions or instances), list numbered candidates with display name, revision and running
state (add "based on " when originals share a name) and ask. When the user
does not choose and goes on:
- reading, comparing, explaining: answer for every candidate;
- changing: never change an existing custom strategy. Create a new one from the original the
user last named explicitly, without a label (it is named "自定义 N" / "Custom N"), and say
so: "因为没有确认目标,已另建『… · 自定义 2』,原有的自定义策略没有变动". When even the
original is unclear, keep asking;
- backtesting: keep asking;
- deploying, stopping, flattening: never guess; require an explicit target.
Agent redeem codes
Some strategies are sold through agents: the user needs a one-time redeem code before the
strategy can be downloaded. When a message contains an EdgePilot redeem code
(EP-XXXX-XXXX-XXXX-XXXX, any letter case, spaces allowed), for example
"请使用 EdgePilot 兑换码 EP-7K3M-9QX2-H8WD-4TRC 安装策略", call edgepilot_redeem_code_open with
that code, even when the user only pasted it.
- The tool only previews the code and returns a Dashboard link; redeeming happens in the
Dashboard after the user confirms there. Never redeem a code from chat, never retry it, and
never call
strategy.install for a strategy the tool reports as needing a code.
- Relay the tool's result in the user's language: the strategy name, the agent, and the
Dashboard link (Dashboard links above). When the account already has the strategy, say the
code is not needed and will not be used.
- When the code is invalid, already used, disabled or its strategy is unavailable, explain that
reason and do not open the Dashboard; the user gets a new code from their agent.
- The link works for about 10 minutes; when it expires, ask the user to send the code again.
- An install that fails with
entitlement_required means the strategy needs a redeem code:
ask the user for the code their agent gave them instead of retrying.
- "哪些策略需要兑换码 / 兑换码策略有哪些 / which strategies need a code": show
edgepilot_view_present leaderboard with {access: "redeem_code", locale} (add query
for a topic such as "需要兑换码的趋势策略"); for "哪些不需要兑换码" use access: "open".
The card marks each strategy as locked or unlocked for this account; say so from its text
and never claim an unlock it does not report. Search results mark redeem-code strategies
too (access on each result; "[needs a redeem code]" in the text).
- Listing these strategies never asks for or uses a code; the user redeems in the Dashboard.
Upgrade recovery
This plugin's bound release replaces the installed Runtime even when its version number is lower. An interrupted switch of that same release still resumes forward. Trading runs in the separate local trading service, which
the upgrade drains (instances keep their desired state and resume after the upgrade). Never
edit or delete trading service files, and never recommend repeated repair to clear a
failure; inspect trading.service.status and the diagnostics operations instead.
Failure diagnosis
Use this when the user asks why something failed, pastes an error, a job_, req_ or
diag_ reference or a run ID, or reports that a strategy stopped or places no orders.
Diagnosis is read-only: never start, stop, retry, repair, cancel orders or close positions
as part of it.
- Install, update or startup problems, or Host tools unavailable: call
edgepilot_runtime_diagnose (works without a running Runtime). Its text includes the
current phase, download progress, last error and recent redacted log lines; while an
install is still pending, edgepilot_runtime_status text has the same progress.
- Everything else: search the
diagnostics toolkit and execute
diagnostics.failure.explain with the reference. Without one, execute
diagnostics.failure.list first and let the user pick if several failures match.
- Report, in the user's language:
- Where it failed: kind, phase and time from
subject.
- Cause:
matches with owner_classified confidence are established by the owner;
pattern_match is a likely cause from log text. Quote at most two evidence lines.
With no match, state unclassified and summarize the strongest evidence lines
yourself, labelled as your inference.
- Trading effect: repeat
effect_guidance. For unknown, tell the user to check
orders, fills and positions on the exchange before any new action.
- What to do and how to verify: the match
actions and verify.
- Missing evidence: translate
gaps (for example diagnostic_id_not_written_to_log
means the error ID has no log entry yet; unclassified means no known signature).
- When the cause may be the exchange API key (a trading state offers
test_credentials,
or the failure is a connection, authentication or starting-capital error), execute
credentials.test with that account's venue and mode. It only reads the account and
logs in to the private stream; report its result, the failed step's venue_code and
what to change. Never ask the user to paste keys to test them.
- Never present a guess as the cause, never ask for API keys or tokens, and never tell the
user to edit or delete EdgePilot state files. If the user wants support, give them the
reference IDs and the evidence lines, which are already redacted.
First-use onboarding
Run this flow when the user's entire message is only an EdgePilot Live plugin mention
(apart from whitespace), when the edgepilot-setup skill runs (plugin setup after
installation), when the user selects an interactive-onboarding starter prompt, or when the user explicitly asks to open/start the questionnaire or onboarding. Treat a
mention-only message as a request to launch the Dashboard and interactive onboarding;
do not reply with a generic menu or ask what the user wants to do. A plain request to find
or recommend a strategy is not onboarding. Reply in the user's current language (en,
ko, zh-CN or zh-TW); if the mention-only message gives no language signal, use the
conversation's language, then the host locale, and otherwise English.
Ordinary requests such as opening the Dashboard, checking a run or searching the catalog
must go directly to that outcome and must not force the questionnaire.
- Call
edgepilot_runtime_status, then edgepilot_runtime_start when the bound target
needs starting, installation or recovery. Let the script decide whether to reuse,
start, prepare or resume; do not infer process liveness from stored job states or
historical lifecycle phases and do not assemble alternative shell recovery commands.
Wait for the original call's final result; yielded/running is not completed. If the
script reports runtime_operation_pending, wait on that call or query status with
bounded backoff, without parallel open calls or duplicate installations. Status text
includes the current state, required action, phase, download progress, last error and recent log lines.
When state=update_required, call edgepilot_runtime_start; that start upgrades to the
plugin-bound release. previous_lifecycle, including an earlier host_start_timeout, belongs
to the previous release. Do not diagnose or restart that old Host before this start.
When state=awaiting_confirmation, show switch.jobs and ask once: “暂不切换”
(defer) or “暂停并继续升级” (stop_and_continue), translated into the user's
language. A kind: "trading" entry means running strategies pause during the switch
(positions and orders stay as they are) and resume automatically once the new version
is ready. Other entries are trading tasks of the previous version; they are stopped
keeping their positions, which does not cancel orders or close positions, and the new
version lists what it finds on the exchange for the user to take over or close.
Submit the chosen action to the same lifecycle tool with the returned operation_id
and snapshot_digest; never invent or reuse a changed snapshot. This choice
authorizes only the listed pause or stop, not an orders/positions review. A refreshed
snapshot requires a fresh choice. On deferred, end this target
startup request and leave the old environment alone; do not open old onboarding as
target success. Report other failures and their script-provided recovery action.
For stale_session, reload the plugin session. A lower version number is not stale: edgepilot_runtime_start installs this plugin's bound release.
For host_start_timeout, tell the user that reloading or restarting Cursor does not
restart the Host. The Host is a separate sign-in task. Do not invent a shell command
to end it, and do not ask the user to end it in Task Scheduler. Call
edgepilot_runtime_start again: that start ends a Host task that is still occupying
the slot, then starts the current Runtime. If the same timeout returns, report it.
- For this Dashboard-and-onboarding request, all successful paths (already running,
stopped target started, first installation, upgrade or repair) continue identically.
Only after
state=ready and connection_ready=true, call
edgepilot_dashboard_open once and present its URL as a link (Dashboard links). Then call
edgepilot_onboarding_open once with the current locale. On success, hand control to
that interactive card and end the turn. A brief instruction to continue in the card is
enough; do not repeat questionnaire choices in chat or call another question/selection
tool. Keep all seven choices, review and recommendation inside that one App.
EdgePilot keeps the questionnaire and its recommendation, and the card passes you their
state. When the user later refers to a recommendation by position or role ("the first
one", "the safer one"), use exactly the strategy versions that card context names, in the
left-to-right order it gives; do not search again or substitute a newer version.
The tool does not report rendering visibility. Missing model-visible HTML, missing
acknowledgement or delayed rendering is unknown, not evidence of failure. Never claim
the card did not appear based on that absence and never automatically start text onboarding
alongside a successful App request. Do not restart installation to recover presentation.
- Switch to text onboarding only when the host explicitly reports App rendering unsupported
or failed, or the user reports the card unusable or explicitly requests text onboarding.
A Runtime/tool execution error follows step 1 recovery, not the questionnaire fallback.
Apply the one-question turn boundary
as the formal fallback. The internal field order is
profit_style,
holding_period, pain_point, max_drawdown_pct, trading_mode, allocation_band,
universe. Ask only the first unanswered field, with only that field's choices, and end
the assistant turn immediately. Never display the complete questionnaire, a numbered
checklist, future questions, future choices or a request for multiple answers. Do not
even preview what comes next.
- On the user's next message, retain every valid supplied answer and ask only the next
unanswered field, then end the turn immediately again. If the current answer is invalid
or ambiguous, clarify only the same field and end the turn; do not advance or expose any
later field. A message that already contains valid answers may fill them silently, but
the response still asks at most one unanswered field.
- After the last answer, use a separate assistant turn to summarize the selected values
and ask only for explicit confirmation. Do not combine that confirmation request with
another question and do not call recommendation before confirmation.
- Only in this explicitly requested textual onboarding fallback, call the hidden fallback
handler
edgepilot_strategy_recommend once with questionnaire_version="2.0", the seven
confirmed values and the matching locale. Present exactly the three owner-ranked choices:
best fit, relatively steadier and more aggressive, preserving versions, evidence,
trade-offs and warnings.
Onboarding never installs a recommended strategy without selection and never starts
demo or live execution. Authentication remains Dashboard-only and every existing live
confirmation gate remains unchanged.
For strategy work, prefer the Runtime workflow hints. The normal dependency order is
catalog search/recommend, exact inspect, install, configuration resolve, backtest start,
durable job status and result get. Keep the selected slug/version and all returned digests
unchanged. Login is Dashboard-only: ask the user to open the Live Dashboard. Never start
Device Authorization or put credentials, access tokens or refresh tokens in chat.
Trading runs as strategy instances in the local trading service. Demo and live are separate
trading accounts selected by mode and venue; demo can place orders in an exchange test
account and never implies live.
Deploying is always two-stage. trading.instance.prepare validates and freezes the strategy,
configuration and venue for ten minutes. trading.instance.start requires the attended
confirmation bound to that exact prepared_ref. Never turn a generic “yes” into
authorization and never place credentials in model arguments or prose.
Trading commands (start, stop, resume, halt, exposure.flatten, exposure.adopt)
return when the trading service recorded them; what happened at the exchange is read from
trading.state.get (engine, instances, exposure ownership, risk) or trading.events.list.
Every state object lists its actions; offer only those. Stopping keeps the position by
default (stop_policy: keep); flattening closes it and needs the user's explicit choice.
When the outcome of a command is unknown, read the state or repeat with the same
idempotency key; never repeat it with a new key. Orders or positions the platform cannot
attribute block the instance until the user adopts or flattens them from the actions.
After an attended result is presented, stop and wait for the App. App submit invokes the
stored exact Owner call once; do not replay the original Execute as confirmation. Continue
only from a later status/result read.
The local MCP route and bearer are created in an owner-private staged copy by the Runtime
Host. If the connection is unavailable, report that the Runtime/Host must be started
or repaired; do not search for Python, install packages, scan ports or call Marketplace MCP
as an internal substitute.
1---2name: edgepilot3description: Route strategy discovery, configuration, custom strategies (changing a strategy's parameters, markets, logic or code as the user's own local copy), backtesting, demo/live trading instances (deploy, stop, resume, flatten) and failure diagnosis (why an install, backtest, trading instance or request failed) through the local EdgePilot Runtime Host. Use for EdgePilot Live workflows; never expose credentials or bypass confirmation gates.4metadata:5 source: https://skillmd.com/skills/rivendell-investment/edgepilot6---78# EdgePilot Live router910The Node Ready Bridge always exposes `edgepilot_runtime_status`,11`edgepilot_runtime_start`, `edgepilot_runtime_update` and `edgepilot_runtime_repair`, even12before Runtime exists. The bridge automatically prepares the release-bound Runtime before first business use; never treat an older compatible Runtime as ready. Call status when Host tools are unavailable, then start once. When13Runtime is ready, use the six Host meta tools:14151. `edgepilot_connection_list`162. `edgepilot_tool_search`173. `edgepilot_tool_get`184. `edgepilot_tool_execute`195. `edgepilot_result_present`206. `edgepilot_view_present` (in-chat cards, below)2122Search for an operation, fetch its exact current descriptor, then execute with the returned23`schema_revision`. Do not invent dynamic MCP tools or cache operation schemas in the24plugin. Strategy package and configuration digests returned by the Runtime must remain25unchanged through backtest or execution requests.2627Route one user outcome at a time:2829- account availability goes directly to `edgepilot_connection_list`;30- unknown capabilities use one concise English `edgepilot_tool_search` query, with named31 toolkits as filters and no execution values in the query;32- retrieve up to eight exact contracts in one `edgepilot_tool_get` call;33- batch only independent calls in `edgepilot_tool_execute`; a value returned by an earlier34 call starts a later batch;35- use `presentation: "if_required"` normally and present only an execute-minted36 `result_ref`.3738Route every ordinary chat request for finding or recommending strategies through39`edgepilot_strategy_search`, including identity/keyword lookup, explicit hard filters,40subjective fit, mixed preferences, “recommend a low-risk strategy” and “find something for41small capital”. Preserve the user's locale and every supported hard constraint; keep42unsupported wishes in the natural-language query and disclose constraints the owner cannot43apply. Never call `edgepilot_strategy_recommend` or discover/execute44`catalog.strategy.recommend` for an ordinary chat request, and never create a V345questionnaire payload. Only an explicit request to open/start the questionnaire or strategy46onboarding may enter the onboarding flow below. The onboarding App, or its explicitly47requested textual fallback, submits the complete confirmed V2 questionnaire. Preserve the48owner order and never merge repeated searches into a new owner ranking. If the user asks for an exact number of recommendations, send that number as49`limit` (for example, `limit=1`, `limit=2` or `limit=3`); do not let the search tool default50to ten results for a counted request. Use a larger explicit limit only when the user asks for51options or multiple candidates. For “open”, “start” or “launch EdgePilot”, ensure Runtime is ready, then52call `edgepilot_dashboard_open`; present its URL as a link (Dashboard links below) and never53spawn a legacy Dashboard directly.5455## In-chat cards5657`edgepilot_view_present` shows one EdgePilot card in the conversation. The Runtime keeps the58card's state, so it survives reloads and updates itself; its text result is what you tell the59user, briefly, without repeating every number the card shows. Show a card when it helps the60user follow or decide, not for every call:6162- `backtest` with `{job_ref}` right after `backtest.run.start` (it follows the job to the63 result), or `{run_ref}` when the user asks about a saved run.64- `configuration` with `{strategy_slug, strategy_version}` (and `configuration` when not65 `default`) when the user wants to review or change panel settings; the user can edit and66 start a backtest there. Order fraction and max total exposure are locked to the strategy67 version.68- `monitor` with `{venue, mode, instance_id}` after a start resolves, or when the user asks how69 a running strategy is doing. The user can stop it in the card; the stop is the same attended70 confirmation, so never also call `trading.instance.stop` for that request.71- `incident` with `{reference}` (a `job_`, `req_`, `diag_` reference, a run ID or an72 instance) for a failure, or `{}` to list recent ones. It is read-only like the diagnosis73 below.74- `task` with `{}` when the user asks where things stand; it shows this conversation's stages75 from needs to a running strategy and the references to continue with.76- `leaderboard` with `{sort, query?, locale}` for "top strategies by return / Sharpe /77 drawdown" (sort `return`, `drawdown`, `sharpe` or `published`); add `access: "redeem_code"`78 when the user asks which strategies need a redeem code (and `access: "open"` for the ones that79 do not; see Agent redeem codes below); `installed` with `{locale}` for "what do I have";80 `glossary` with `{metrics, locale}` when the user asks what a metric means. metrics uses81 exactly these names (`max_drawdown_pct`, not `max_drawdown`): `return_pct`, `annualized_return_pct`, `max_drawdown_pct`, `sharpe`, `sortino`, `profit_factor`, `win_rate`, `realized_pnl`, `trades_per_30d`, `median_holding_minutes`, `max_consecutive_losses`, `worst_trade_pct`, `capacity_usd`, `match_score`, `order_fraction`, `max_total_exposure_fraction`, `max_equivalent_leverage`, `leverage`, `starting_balance`, `fee_bps`. locale is `en`, `zh-CN`,82 `zh-TW` or `ko`.83- When a card call answers an error naming a field and its valid values, correct that field and84 call once more instead of answering without the card.8586A card's own actions (save, start a backtest, stop, page) are the user's; when the card later87tells you what happened (it arrives with the user's next message), continue from that and do88not repeat the action.8990## Dashboard links9192Show a Dashboard URL as one Markdown link with a short label in the user's language, never as93the raw address: for example `[打开 EdgePilot 控制台](<url>)`, or, when a strategy target was94opened, `[在 EdgePilot 中查看 <strategy name> <version>](<url>)`.9596- A message "Dashboard 已准备好,请点击打开:<url>" is posted by the EdgePilot card's view97 button and already carries a fresh link to that strategy: reply only with that exact URL as98 the link. Do not call `edgepilot_dashboard_open` for it; a new link without the card's target99 would open the Dashboard without the strategy.100- A link signs the browser in once within 10 minutes. When the user asks to open it again101 later, call `edgepilot_dashboard_open` again with the same `target` as before.102103## Custom strategies104105A custom strategy is the user's own copy of an installed strategy, saved as revisions r1, r2…106It stays on this computer. Its revisions are installed packages with slug `custom-<id>-r<N>`107and version `0.0.<N>`; backtest and deploy them like any other installed strategy.108109Where a change goes:110111- Panel settings (target exchange, starting balance, fees, leverage, max equivalent leverage)112 of any strategy: `workspace.configuration.get`, then `workspace.configuration.save` on that113 strategy's directory name. No custom strategy, no question. Order fraction and max total114 exposure are locked to the strategy version: changing them is a custom strategy.115- Anything else on an original Marketplace strategy (strategy parameters, even "just backtest116 it with length 20", instruments, bars, indicators, entries, exits, sizing, code): ask first,117 in the user's language: "This change goes beyond the panel settings, so it is saved as a118 custom strategy『<strategy name> · <label>』; the original stays unchanged. Create it?"119 Suggest the label yourself (2–4 words naming the change, at most 8 CJK characters or 16120 letters) and say the user can reply with another one. Create only after a yes. On a no,121 change nothing; mention a panel setting when one achieves something similar.122- A change to an existing custom strategy: no question; save its next revision.123- "Make another version" or "keep both": ask for a label, then create a new custom strategy124 whose source is that custom revision's slug and version.125- Deleting a custom strategy happens only in the Dashboard; point the user there.126- Runs never override parameters: `overrides` take only `venue`, `period_days` and `workspace`.127128Steps:1291301. The source must be installed (`strategy.installed.list`); `custom_strategy.create` refuses131 others with `custom_source_not_installed`. When it is not, tell the user and, with their132 consent, install that exact version first (`strategy.install`, wait for the job). A custom133 strategy is a full copy: uninstalling the original later does not affect it.134 Then call `custom_strategy.create` with the source `slug` and `version` and the label. When135 `label_adjusted` is true a number was added to keep it unique; use the returned136 `display_name`. A refused label (`custom_label_invalid`) breaks a rule: 2–16 display width,137 letters, digits, spaces and `· - + % . / ( )`, not only words like "custom", not the138 strategy name itself.1392. Existing strategy parameters: pass them as `parameters` to the commit. Code, markets or new140 parameters: `custom_strategy.draft.read` (without `path` lists the files), then141 `custom_strategy.draft.write` with the whole file and the `sha256` you read as142 `expected_sha256`. To trade another symbol or timeframe, call `custom_strategy.draft.market`143 with `symbol` (e.g. `SOL`) and `timeframe` (e.g. `4-HOUR`) first without `apply`: it changes144 the strategy fields, `backtest.markets` and every venue variant together. Tell the user the145 plan, especially `remove_venues` (exchanges that do not list the symbol), and call it again146 with `apply: true`, the plan's `preset_sha256` as `expected_sha256` and `remove_venues` only147 after they agree. `custom_market_unsupported` means the preset has several markets or an148 unsupported exchange: then edit the `strategy` instrument and bar fields and149 `backtest.markets` (and `venue_variants`) of `configs/default.json` together; a bar type is150 `<instrument_id>-<step>-<aggregation>-<price type>-<source>`, e.g.151 `BTCUSDT-PERP.BINANCE-1-HOUR-LAST-EXTERNAL`, and every preset trades exactly one venue.1523. `custom_strategy.revision.commit` with a one-line `change_summary` in the user's language.153 `committed` gives the new revision: report "已保存为『<display name>』r<N>(<change>)".154 `unchanged` means nothing differed. `problems` name the file and line, or the preset,155 venue and parameter: fix them in the draft and commit again; show them to the user only when156 you cannot fix them.1574. When the user asks to backtest while `draft.state` is `modified`, commit first and say which158 revision runs. A deployed instance stays on its revision. One trading account runs one159 instance, so moving to a new revision means stopping the old instance (the user confirms)160 and deploying the new one.1615. After saving a custom strategy's first revision, and whenever the user asks to see it, call162 `edgepilot_dashboard_open` with target `{"kind": "custom_strategy", "custom_id": <id>,163 "revision": <N>}` and show the link labelled with its display name, for example164 `[在 EdgePilot 中查看『自适应 ADX 策略 · 周期20』r1](<url>)`. Never open a custom revision with a165 `{"kind": "strategy"}` target: that one is for Marketplace versions.166167Name custom strategies『<strategy name> · <label>』r<N>, never by slug or id. When "this168strategy" or a name could mean several targets (the original, several custom strategies,169revisions or instances), list numbered candidates with display name, revision and running170state (add "based on <source version>" when originals share a name) and ask. When the user171does not choose and goes on:172173- reading, comparing, explaining: answer for every candidate;174- changing: never change an existing custom strategy. Create a new one from the original the175 user last named explicitly, without a label (it is named "自定义 N" / "Custom N"), and say176 so: "因为没有确认目标,已另建『… · 自定义 2』,原有的自定义策略没有变动". When even the177 original is unclear, keep asking;178- backtesting: keep asking;179- deploying, stopping, flattening: never guess; require an explicit target.180181## Agent redeem codes182183Some strategies are sold through agents: the user needs a one-time redeem code before the184strategy can be downloaded. When a message contains an EdgePilot redeem code185(`EP-XXXX-XXXX-XXXX-XXXX`, any letter case, spaces allowed), for example186"请使用 EdgePilot 兑换码 EP-7K3M-9QX2-H8WD-4TRC 安装策略", call `edgepilot_redeem_code_open` with187that code, even when the user only pasted it.188189- The tool only previews the code and returns a Dashboard link; redeeming happens in the190 Dashboard after the user confirms there. Never redeem a code from chat, never retry it, and191 never call `strategy.install` for a strategy the tool reports as needing a code.192- Relay the tool's result in the user's language: the strategy name, the agent, and the193 Dashboard link (Dashboard links above). When the account already has the strategy, say the194 code is not needed and will not be used.195- When the code is invalid, already used, disabled or its strategy is unavailable, explain that196 reason and do not open the Dashboard; the user gets a new code from their agent.197- The link works for about 10 minutes; when it expires, ask the user to send the code again.198- An install that fails with `entitlement_required` means the strategy needs a redeem code:199 ask the user for the code their agent gave them instead of retrying.200- "哪些策略需要兑换码 / 兑换码策略有哪些 / which strategies need a code": show201 `edgepilot_view_present` `leaderboard` with `{access: "redeem_code", locale}` (add `query`202 for a topic such as "需要兑换码的趋势策略"); for "哪些不需要兑换码" use `access: "open"`.203 The card marks each strategy as locked or unlocked for this account; say so from its text204 and never claim an unlock it does not report. Search results mark redeem-code strategies205 too (`access` on each result; "[needs a redeem code]" in the text).206- Listing these strategies never asks for or uses a code; the user redeems in the Dashboard.207208## Upgrade recovery209210This plugin's bound release replaces the installed Runtime even when its version number is lower. An interrupted switch of that same release still resumes forward. Trading runs in the separate local trading service, which211the upgrade drains (instances keep their desired state and resume after the upgrade). Never212edit or delete trading service files, and never recommend repeated repair to clear a213failure; inspect `trading.service.status` and the diagnostics operations instead.214215## Failure diagnosis216217Use this when the user asks why something failed, pastes an error, a `job_`, `req_` or218`diag_` reference or a run ID, or reports that a strategy stopped or places no orders.219Diagnosis is read-only: never start, stop, retry, repair, cancel orders or close positions220as part of it.2212221. Install, update or startup problems, or Host tools unavailable: call223 `edgepilot_runtime_diagnose` (works without a running Runtime). Its text includes the224 current phase, download progress, last error and recent redacted log lines; while an225 install is still pending, `edgepilot_runtime_status` text has the same progress.2262. Everything else: search the `diagnostics` toolkit and execute227 `diagnostics.failure.explain` with the reference. Without one, execute228 `diagnostics.failure.list` first and let the user pick if several failures match.2293. Report, in the user's language:230 - **Where it failed**: kind, phase and time from `subject`.231 - **Cause**: `matches` with `owner_classified` confidence are established by the owner;232 `pattern_match` is a likely cause from log text. Quote at most two evidence lines.233 With no match, state `unclassified` and summarize the strongest evidence lines234 yourself, labelled as your inference.235 - **Trading effect**: repeat `effect_guidance`. For `unknown`, tell the user to check236 orders, fills and positions on the exchange before any new action.237 - **What to do** and **how to verify**: the match `actions` and `verify`.238 - **Missing evidence**: translate `gaps` (for example `diagnostic_id_not_written_to_log`239 means the error ID has no log entry yet; `unclassified` means no known signature).2404. When the cause may be the exchange API key (a trading state offers `test_credentials`,241 or the failure is a connection, authentication or starting-capital error), execute242 `credentials.test` with that account's `venue` and `mode`. It only reads the account and243 logs in to the private stream; report its `result`, the failed step's `venue_code` and244 what to change. Never ask the user to paste keys to test them.2455. Never present a guess as the cause, never ask for API keys or tokens, and never tell the246 user to edit or delete EdgePilot state files. If the user wants support, give them the247 reference IDs and the evidence lines, which are already redacted.248249## First-use onboarding250251Run this flow when the user's entire message is only an EdgePilot Live plugin mention252(apart from whitespace), when the `edgepilot-setup` skill runs (plugin setup after253installation), when the user selects an interactive-onboarding starter prompt, or when the user explicitly asks to open/start the questionnaire or onboarding. Treat a254mention-only message as a request to launch the Dashboard and interactive onboarding;255do not reply with a generic menu or ask what the user wants to do. A plain request to find256or recommend a strategy is not onboarding. Reply in the user's current language (`en`,257`ko`, `zh-CN` or `zh-TW`); if the mention-only message gives no language signal, use the258conversation's language, then the host locale, and otherwise English.259Ordinary requests such as opening the Dashboard, checking a run or searching the catalog260must go directly to that outcome and must not force the questionnaire.2612621. Call `edgepilot_runtime_status`, then `edgepilot_runtime_start` when the bound target263 needs starting, installation or recovery. Let the script decide whether to reuse,264 start, prepare or resume; do not infer process liveness from stored job states or265 historical lifecycle phases and do not assemble alternative shell recovery commands.266 Wait for the original call's final result; yielded/running is not completed. If the267 script reports `runtime_operation_pending`, wait on that call or query status with268 bounded backoff, without parallel open calls or duplicate installations. Status text269 includes the current state, required action, phase, download progress, last error and recent log lines.270 When `state=update_required`, call `edgepilot_runtime_start`; that start upgrades to the271 plugin-bound release. `previous_lifecycle`, including an earlier `host_start_timeout`, belongs272 to the previous release. Do not diagnose or restart that old Host before this start.273 When `state=awaiting_confirmation`, show `switch.jobs` and ask once: “暂不切换”274 (`defer`) or “暂停并继续升级” (`stop_and_continue`), translated into the user's275 language. A `kind: "trading"` entry means running strategies pause during the switch276 (positions and orders stay as they are) and resume automatically once the new version277 is ready. Other entries are trading tasks of the previous version; they are stopped278 keeping their positions, which does not cancel orders or close positions, and the new279 version lists what it finds on the exchange for the user to take over or close.280 Submit the chosen action to the same lifecycle tool with the returned `operation_id`281 and `snapshot_digest`; never invent or reuse a changed snapshot. This choice282 authorizes only the listed pause or stop, not an orders/positions review. A refreshed283 snapshot requires a fresh choice. On `deferred`, end this target284 startup request and leave the old environment alone; do not open old onboarding as285 target success. Report other failures and their script-provided recovery action.286 For `stale_session`, reload the plugin session. A lower version number is not stale: `edgepilot_runtime_start` installs this plugin's bound release.287 For `host_start_timeout`, tell the user that reloading or restarting Cursor does not288 restart the Host. The Host is a separate sign-in task. Do not invent a shell command289 to end it, and do not ask the user to end it in Task Scheduler. Call290 `edgepilot_runtime_start` again: that start ends a Host task that is still occupying291 the slot, then starts the current Runtime. If the same timeout returns, report it.2922. For this Dashboard-and-onboarding request, all successful paths (already running,293 stopped target started, first installation, upgrade or repair) continue identically.294 Only after `state=ready` and `connection_ready=true`, call295 `edgepilot_dashboard_open` once and present its URL as a link (Dashboard links). Then call296 `edgepilot_onboarding_open` once with the current locale. On success, hand control to297 that interactive card and end the turn. A brief instruction to continue in the card is298 enough; do not repeat questionnaire choices in chat or call another question/selection299 tool. Keep all seven choices, review and recommendation inside that one App.300 EdgePilot keeps the questionnaire and its recommendation, and the card passes you their301 state. When the user later refers to a recommendation by position or role ("the first302 one", "the safer one"), use exactly the strategy versions that card context names, in the303 left-to-right order it gives; do not search again or substitute a newer version.304 The tool does not report rendering visibility. Missing model-visible HTML, missing305 acknowledgement or delayed rendering is unknown, not evidence of failure. Never claim306 the card did not appear based on that absence and never automatically start text onboarding307 alongside a successful App request. Do not restart installation to recover presentation.3083. Switch to text onboarding only when the host explicitly reports App rendering unsupported309 or failed, or the user reports the card unusable or explicitly requests text onboarding.310 A Runtime/tool execution error follows step 1 recovery, not the questionnaire fallback.311 Apply the **one-question turn boundary**312 as the formal fallback. The internal field order is `profit_style`,313 `holding_period`, `pain_point`, `max_drawdown_pct`, `trading_mode`, `allocation_band`,314 `universe`. Ask only the first unanswered field, with only that field's choices, and end315 the assistant turn immediately. Never display the complete questionnaire, a numbered316 checklist, future questions, future choices or a request for multiple answers. Do not317 even preview what comes next.3184. On the user's next message, retain every valid supplied answer and ask only the next319 unanswered field, then end the turn immediately again. If the current answer is invalid320 or ambiguous, clarify only the same field and end the turn; do not advance or expose any321 later field. A message that already contains valid answers may fill them silently, but322 the response still asks at most one unanswered field.3235. After the last answer, use a separate assistant turn to summarize the selected values324 and ask only for explicit confirmation. Do not combine that confirmation request with325 another question and do not call recommendation before confirmation.3266. Only in this explicitly requested textual onboarding fallback, call the hidden fallback327 handler `edgepilot_strategy_recommend` once with `questionnaire_version="2.0"`, the seven328 confirmed values and the matching locale. Present exactly the three owner-ranked choices:329 best fit, relatively steadier and more aggressive, preserving versions, evidence,330 trade-offs and warnings.331332Onboarding never installs a recommended strategy without selection and never starts333demo or live execution. Authentication remains Dashboard-only and every existing live334confirmation gate remains unchanged.335336For strategy work, prefer the Runtime workflow hints. The normal dependency order is337catalog search/recommend, exact inspect, install, configuration resolve, backtest start,338durable job status and result get. Keep the selected slug/version and all returned digests339unchanged. Login is Dashboard-only: ask the user to open the Live Dashboard. Never start340Device Authorization or put credentials, access tokens or refresh tokens in chat.341342Trading runs as strategy instances in the local trading service. Demo and live are separate343trading accounts selected by `mode` and `venue`; demo can place orders in an exchange test344account and never implies live.345346Deploying is always two-stage. `trading.instance.prepare` validates and freezes the strategy,347configuration and venue for ten minutes. `trading.instance.start` requires the attended348confirmation bound to that exact `prepared_ref`. Never turn a generic “yes” into349authorization and never place credentials in model arguments or prose.350351Trading commands (`start`, `stop`, `resume`, `halt`, `exposure.flatten`, `exposure.adopt`)352return when the trading service recorded them; what happened at the exchange is read from353`trading.state.get` (engine, instances, exposure ownership, risk) or `trading.events.list`.354Every state object lists its `actions`; offer only those. Stopping keeps the position by355default (`stop_policy: keep`); flattening closes it and needs the user's explicit choice.356When the outcome of a command is unknown, read the state or repeat with the same357idempotency key; never repeat it with a new key. Orders or positions the platform cannot358attribute block the instance until the user adopts or flattens them from the actions.359360After an attended result is presented, stop and wait for the App. App submit invokes the361stored exact Owner call once; do not replay the original Execute as confirmation. Continue362only from a later status/result read.363364The local MCP route and bearer are created in an owner-private staged copy by the Runtime365Host. If the connection is unavailable, report that the Runtime/Host must be started366or repaired; do not search for Python, install packages, scan ports or call Marketplace MCP367as an internal substitute.