Skip to content

Demo saga followups: items #3–#7 from plan parking lot - #449

Merged
szhygulin merged 5 commits into
mainfrom
feat/demo-saga-followups
Apr 28, 2026
Merged

Demo saga followups: items #3–#7 from plan parking lot#449
szhygulin merged 5 commits into
mainfrom
feat/demo-saga-followups

Conversation

@szhygulin

Copy link
Copy Markdown
Collaborator

Summary

Implements items #3#7 from plan-demo-saga-followups.md. Items #1 (manual smoke test, owner: maintainer) and #2 (Etherscan + Reservoir runtime overrides, blocked by #1) are deliberately deferred.

Five commits, one logical unit each:

  • #3 feat(demo): markdown-render the simulation envelope — adds renderSimulationEnvelopeBlock(envelope) that emits a verbatim-relayable markdown block alongside the JSON envelope, mirroring the renderVerificationBlock / renderPrepareReceiptBlock pattern. Pattern-matches the four simulation shapes (viem { status }, Solana deferred-to-preview, our simulationFailed / simulationSkipped) with a fallback for unrecognized shapes.
  • #4 docs(demo): document current demo model in README + CONTRIBUTING — new "Demo mode" section between Setup and the MCP-client wiring (env activation, persona list, simulation envelope semantics, set_demo_wallet flow, set_helius_api_key runtime override, exit_demo_mode handoff guide, agent-loop-trap caveat) + VAULTPILOT_DEMO in the env-var list. CONTRIBUTING gets a short "Testing demo mode locally" section.
  • #5 ci(demo): persona address rotation watcher — out-of-tree scripts/verify-personas.mjs with weekly workflow_dispatch + cron trigger. Cheap public-RPC liveness checks; three statuses (alive / drifted / inconclusive — rate-limit transients don't fail the run). Smoke-tested locally: 9/10 cells alive, 1 inconclusive (TRON 429), 0 drifted.
  • #6 feat(demo): --demo CLI aliasnpx vaultpilot-mcp --demo sets VAULTPILOT_DEMO=true before init. Idempotent: an explicit env value (including the opt-out false) wins over the flag.
  • #7 feat(demo): smart per-tool persona recommendationsdefaultModeRefusalMessage now branches on persona-affinity, sourced from the matrix's rehearsableFlows so it auto-stays in sync with cell curation. Chain-aware: prepare_solana_native_send only searches solana cells.

Test plan

  • Full vitest suite green: 2067/2067 pass
  • Typecheck clean (tsc --noEmit)
  • scripts/verify-personas.mjs smoke-tested against live public RPC (9/10 alive, exit 0)
  • Manual demo-mode walkthrough — deferred to plan item Add CI workflow: typecheck + tests on Node 20/22 #1 (owner: maintainer)

🤖 Generated with Claude Code

szhygulin and others added 5 commits April 28, 2026 03:27
Mirrors the renderVerificationBlock / renderPrepareReceiptBlock pattern
used by the real broadcast path: emits a verbatim-relayable markdown
block alongside the JSON simulation envelope so agents can show users
what the simulated send_transaction did without re-decoding the
unknown-shape simulation field.

Pattern-matches the four shapes simulation can take (viem
{ status: success | reverted }, our { simulationDeferredToPreview }
for Solana, our { simulationFailed | simulationSkipped, reason } for
unhandled-handle paths) and falls back to "see simulation field"
otherwise.

Closes plan-demo-saga-followups #3.
README: new "Demo mode" section between Setup and the MCP-client wiring,
covering the post-#380 architecture — env activation, persona list,
simulation envelope semantics (no signing, no broadcast), set_demo_wallet
flow, set_helius_api_key runtime override, exit_demo_mode handoff guide,
and the agent-loop-trap caveat for state-precondition flows. Also adds
VAULTPILOT_DEMO to the env-var list.

CONTRIBUTING: short "Testing demo mode locally" section pointing
contributors at VAULTPILOT_DEMO + claude mcp add for the live-walkthrough
checks that unit tests can't cover (persona drift, envelope UX,
nudge timing).

Closes plan-demo-saga-followups #4.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Out-of-tree weekly liveness check for src/demo/personas.ts cells.
Runs cheap public-RPC / public-API queries against each non-null cell
and exits non-zero when any address has confirmed-zero native balance
or activity — the cheap proxy for "this wallet rotated and the
persona description is now false."

Three statuses:
- alive: balance > 0 / tx count > 0 (the happy path)
- drifted: confirmed empty (e.g. exchange wallet got rotated) — fails the run
- inconclusive: rate-limit / network error from the public API — does
  NOT fail the run since it's noise, not signal

Trigger: workflow_dispatch (manual) + Mondays 06:00 UTC weekly cron.
Report uploaded as workflow artifact for 30d so a maintainer can
review which cell needs refreshing.

Closes plan-demo-saga-followups #5.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sets VAULTPILOT_DEMO=true before init when --demo is in argv. Lets
users run `npx vaultpilot-mcp --demo` instead of the
`--env VAULTPILOT_DEMO=true` env-var dance, and shortens the docs'
recommended copy-paste.

Idempotency: an explicit VAULTPILOT_DEMO env value (including the
opt-out `false`) wins over the flag. The combination
"--demo + VAULTPILOT_DEMO=false" is ambiguous, so we honor the
explicit setting rather than silently overriding it.

Closes plan-demo-saga-followups #6.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
defaultModeRefusalMessage now branches on persona-affinity, sourced
from the persona matrix's rehearsableFlows so it auto-stays in sync
with cell curation:

- Single match: "Recommended persona: `defi-degen`" + others as fallback
  (e.g. prepare_aave_supply → only defi-degen rehearses aave_supply)
- Multi match: "Recommended personas: `whale`, `defi-degen`" with the
  remaining personas marked as not-supporting-this-flow
- All match: existing "Available personas" list (e.g. native_send)
- No match: warning that the prepare may fail with a state-precondition
  error + pointer at exit_demo_mode (e.g. prepare_aave_borrow — gapped
  on every cell)

Chain-aware: prepare_solana_native_send only searches solana cells, so
it doesn't recommend staking-maxi (no solana cell) just because every
EVM cell rehearses native_send.

Closes plan-demo-saga-followups #7.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@szhygulin
szhygulin merged commit 27e5aba into main Apr 28, 2026
4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2026
@szhygulin
szhygulin deleted the feat/demo-saga-followups branch May 19, 2026 04:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant