|
| 1 | +/goal You are the FlowChain SDK, documentation, and developer tooling agent. |
| 2 | + |
| 3 | +Worktree: `E:\FlowMemory\flowmemory-live-sdk-docs` |
| 4 | +Branch: `agent/live-product-sdk-docs` |
| 5 | + |
| 6 | +Mission: build the developer-facing surface needed for FlowChain to be usable |
| 7 | +as a real L1 product by wallet builders, app builders, bridge operators, node |
| 8 | +operators, and FlowChain maintainers. Do not stop at prose. Build runnable SDK |
| 9 | +examples, typed RPC clients, CLI/devkit commands, generated references, sample |
| 10 | +apps, and machine-checkable docs tests that prove the docs match the actual |
| 11 | +runtime/RPC/bridge/wallet behavior. |
| 12 | + |
| 13 | +You are not alone in the codebase. Other agents may be changing runtime, |
| 14 | +wallet, bridge, control-plane, dashboard, storage, and verification files. Do |
| 15 | +not revert their edits. Integrate with the existing control-plane/RPC/runtime |
| 16 | +contracts and avoid creating a parallel fake SDK or a docs-only surface. |
| 17 | + |
| 18 | +Read first: |
| 19 | +- `AGENTS.md` |
| 20 | +- `docs/agent-goals/production-l1-live-chain/README.md` |
| 21 | +- `docs/FLOWCHAIN_CONTROL_PLANE_API.md` |
| 22 | +- `docs/FLOWCHAIN_PRODUCTION_L1_GO_NO_GO.md` |
| 23 | +- `docs/FLOWCHAIN_LIVE_L1_BRIDGE_GO_NO_GO.md` |
| 24 | +- `services/control-plane/src/methods.ts` |
| 25 | +- `services/control-plane/src/json-rpc.ts` |
| 26 | +- `services/control-plane/src/types.ts` |
| 27 | +- `services/control-plane/src/rpc-e2e.ts` |
| 28 | +- `crates/flowmemory-devnet/` |
| 29 | +- `infra/scripts/flowchain-*.ps1` |
| 30 | +- `apps/dashboard/WALLET_DISTRIBUTION.md` |
| 31 | +- `apps/dashboard/src/views/WalletView.tsx` |
| 32 | +- `apps/dashboard/src/views/BridgePilotView.tsx` |
| 33 | +- `package.json` |
| 34 | + |
| 35 | +Own these files/modules unless coordination requires otherwise: |
| 36 | +- `docs/agent-runs/live-product-sdk-docs/` |
| 37 | +- `docs/developer/` |
| 38 | +- `docs/sdk/` |
| 39 | +- `examples/flowchain-*` |
| 40 | +- `tools/flowchain-*` |
| 41 | +- `packages/flowchain-sdk/` or the repo's established package location if one |
| 42 | + already exists |
| 43 | +- root `package.json` only for SDK/docs/devkit scripts |
| 44 | + |
| 45 | +Do not own: |
| 46 | +- runtime state transition internals except documented examples and type usage |
| 47 | +- bridge relayer implementation except SDK/readme integration examples |
| 48 | +- wallet private-key custody implementation except documented local-only signing |
| 49 | + interfaces and safe client types |
| 50 | +- dashboard redesign |
| 51 | +- live env values, private keys, seed phrases, RPC credentials, API keys, |
| 52 | + webhooks, or vault ciphertext |
| 53 | + |
| 54 | +Required product standard: |
| 55 | +A developer starting from a clean checkout must be able to read the docs, start |
| 56 | +a local FlowChain node/RPC, create a local account with the documented wallet |
| 57 | +tooling, submit a signed FlowChain transaction through the SDK, query blocks, |
| 58 | +transactions, balances, token/DEX state, bridge readiness, bridge credits, and |
| 59 | +finality, and run a sample app against local RPC. If a live public RPC or live |
| 60 | +Base 8453 bridge dependency is unavailable, the SDK and docs must fail closed |
| 61 | +with exact missing variable or deployment artifact names only. |
| 62 | + |
| 63 | +SDK requirements: |
| 64 | +1. Build a typed FlowChain JSON-RPC client that uses the real `/rpc` surface. |
| 65 | +2. Support browser-safe and Node.js usage where practical. |
| 66 | +3. Expose discovery and readiness helpers: |
| 67 | + - `rpc_discover` |
| 68 | + - `rpc_readiness` |
| 69 | + - browser-safe `GET /rpc/discover` |
| 70 | + - browser-safe `GET /rpc/readiness` |
| 71 | +4. Expose read helpers for: |
| 72 | + - health and node status |
| 73 | + - chain status and finality |
| 74 | + - block list/get |
| 75 | + - transaction list/get |
| 76 | + - mempool list |
| 77 | + - account list/get |
| 78 | + - balance get |
| 79 | + - wallet metadata and wallet balances |
| 80 | + - transfer history |
| 81 | + - token/asset state |
| 82 | + - DEX pools, swaps, and LP positions |
| 83 | + - bridge readiness, deposits, credits, withdrawals, release evidence, and |
| 84 | + lifecycle records |
| 85 | +5. Expose write helpers only when they submit signed envelopes through the real |
| 86 | + runtime-backed RPC path. Do not add methods that write draft rows or static |
| 87 | + fixtures while claiming live behavior. |
| 88 | +6. Model signed transaction envelopes, receipts, status codes, error codes, and |
| 89 | + fail-closed readiness responses as stable exported types. |
| 90 | +7. Add a strict redaction layer for logs and errors so SDK examples cannot print |
| 91 | + private keys, seed phrases, mnemonics, RPC credentials, API keys, webhooks, |
| 92 | + vault ciphertext, or raw env values. |
| 93 | +8. Add typed error classes or tagged errors for: |
| 94 | + - missing live config |
| 95 | + - RPC unreachable |
| 96 | + - RPC method unavailable |
| 97 | + - malformed envelope |
| 98 | + - unsigned envelope |
| 99 | + - replay rejection |
| 100 | + - not-final transaction |
| 101 | + - bridge not ready |
| 102 | + - account not found |
| 103 | + - insufficient balance |
| 104 | +9. Do not call the SDK EVM-compatible unless EVM JSON-RPC compatibility is |
| 105 | + implemented and tested. If the SDK is FlowChain-native JSON-RPC, say so. |
| 106 | + |
| 107 | +CLI/devkit requirements: |
| 108 | +1. Add a documented command group for local developers, for example: |
| 109 | + - discover RPC |
| 110 | + - print readiness |
| 111 | + - print chain status |
| 112 | + - create local dev account metadata without leaking secrets |
| 113 | + - submit a documented local signed transfer fixture or generated envelope |
| 114 | + - wait for block inclusion |
| 115 | + - print balance |
| 116 | + - print bridge readiness |
| 117 | + - print bridge credit lifecycle |
| 118 | + - print finality status |
| 119 | +2. Commands must default to `127.0.0.1` local RPC and never expose a public bind |
| 120 | + or live bridge path by accident. |
| 121 | +3. Commands that use live Base 8453 or public RPC must require explicit env and |
| 122 | + fail closed if any input is missing. |
| 123 | +4. Add `--json` output for automation. |
| 124 | +5. Add examples that can be copied into docs without hand editing. |
| 125 | + |
| 126 | +Documentation requirements: |
| 127 | +1. Create a developer quickstart that starts from a clean checkout: |
| 128 | + - prerequisites |
| 129 | + - install |
| 130 | + - start local node/RPC |
| 131 | + - discover RPC |
| 132 | + - create/import a local account safely |
| 133 | + - submit a transaction |
| 134 | + - produce or wait for a block |
| 135 | + - query balances |
| 136 | + - inspect finality |
| 137 | + - stop/restart and verify continuity |
| 138 | +2. Create an RPC reference generated from, or mechanically checked against, the |
| 139 | + actual `rpc_discover` method list. Do not maintain an unchecked hand-written |
| 140 | + list that can drift. |
| 141 | +3. Create wallet integration docs: |
| 142 | + - address/account ID shape |
| 143 | + - signing envelope shape |
| 144 | + - receive address flow |
| 145 | + - send flow |
| 146 | + - activity query flow |
| 147 | + - backup/import boundaries |
| 148 | + - no server-side custody rule |
| 149 | +4. Create bridge integration docs: |
| 150 | + - Base 8453 lockbox inputs |
| 151 | + - required env/deployment names |
| 152 | + - confirmations/finality expectations |
| 153 | + - exact-credit accounting |
| 154 | + - replay protection |
| 155 | + - withdrawal intent and release evidence |
| 156 | + - what is local/mock, what is configured-live, and what is blocked |
| 157 | +5. Create node operator docs: |
| 158 | + - local node start/stop/restart |
| 159 | + - unbounded/live pilot node mode |
| 160 | + - public RPC prerequisites |
| 161 | + - TLS/CORS/rate-limit boundaries |
| 162 | + - state backup path |
| 163 | + - export/import/recovery |
| 164 | + - health checks and monitoring fields |
| 165 | +6. Create app builder docs: |
| 166 | + - using the SDK from Node.js |
| 167 | + - using the SDK from browser/Vite/React if supported |
| 168 | + - sample balance widget |
| 169 | + - sample send transaction flow |
| 170 | + - sample bridge readiness panel |
| 171 | + - sample activity list |
| 172 | +7. Create release and versioning docs: |
| 173 | + - SDK package versioning |
| 174 | + - compatibility with RPC method versions |
| 175 | + - breaking change policy |
| 176 | + - generated reference update command |
| 177 | +8. Create troubleshooting docs: |
| 178 | + - failed to fetch |
| 179 | + - 404 on wallet creation or RPC path |
| 180 | + - missing public RPC env |
| 181 | + - bridge blocked on Base 8453 inputs |
| 182 | + - local node stopped/max-block bounded mode |
| 183 | + - stale dashboard or wrong endpoint |
| 184 | + |
| 185 | +Examples and sample apps: |
| 186 | +1. Add a minimal Node.js example that: |
| 187 | + - calls discovery/readiness |
| 188 | + - submits a local signed transaction or documented dev envelope |
| 189 | + - waits for block inclusion |
| 190 | + - reads the updated account balance |
| 191 | +2. Add a minimal browser or Vite example if the repo structure supports it. |
| 192 | +3. Add a bridge-readiness example that proves fail-closed live behavior without |
| 193 | + printing env values. |
| 194 | +4. Add a wallet-send example that uses the real SDK client and real RPC method |
| 195 | + names. |
| 196 | +5. Add sample output files only if they are generated by commands and clearly |
| 197 | + marked local/dev output. |
| 198 | + |
| 199 | +Verification requirements: |
| 200 | +1. Add a root command: |
| 201 | + ```powershell |
| 202 | + npm run flowchain:sdk:e2e |
| 203 | + ``` |
| 204 | +2. That command must: |
| 205 | + - start or attach to a local FlowChain node/RPC |
| 206 | + - call RPC discovery through the SDK |
| 207 | + - verify the generated RPC reference matches discovery |
| 208 | + - call readiness and verify public/live blockers when env is absent |
| 209 | + - submit a signed local transaction through the SDK |
| 210 | + - verify mempool visibility or accepted receipt |
| 211 | + - produce or wait for a block |
| 212 | + - read block, transaction, account, balance, finality, and provenance |
| 213 | + - run at least one CLI command with `--json` |
| 214 | + - run at least one sample app/example command |
| 215 | + - verify docs snippets or generated examples do not drift |
| 216 | + - run no-secret checks against SDK output, docs generated examples, and logs |
| 217 | +3. Add focused unit tests for SDK request/response parsing, error handling, |
| 218 | + redaction, readiness blockers, and transaction envelope validation. |
| 219 | +4. Add machine-readable report: |
| 220 | + `docs/agent-runs/live-product-sdk-docs/flowchain-sdk-e2e-report.json` |
| 221 | +5. Add human handoff: |
| 222 | + `docs/agent-runs/live-product-sdk-docs/HANDOFF.md` |
| 223 | + |
| 224 | +Implementation loop: |
| 225 | +1. Create: |
| 226 | + - `docs/agent-runs/live-product-sdk-docs/PLAN.md` |
| 227 | + - `docs/agent-runs/live-product-sdk-docs/CHECKLIST.md` |
| 228 | + - `docs/agent-runs/live-product-sdk-docs/EXPERIMENTS.md` |
| 229 | + - `docs/agent-runs/live-product-sdk-docs/NOTES.md` |
| 230 | +2. Inventory current docs/scripts/packages and mark each requirement as |
| 231 | + `implemented`, `missing`, `fixture-only`, `blocked`, or `needs-owner-input`. |
| 232 | +3. Build the smallest real SDK client over the actual RPC surface first. |
| 233 | +4. Add unit tests and a local example. |
| 234 | +5. Add generated or checked RPC reference. |
| 235 | +6. Add CLI/devkit commands. |
| 236 | +7. Add docs only after the runnable path exists. |
| 237 | +8. Run the command set below. |
| 238 | +9. Update the checklist with command output paths and exact gaps. |
| 239 | +10. Repeat until every requirement is implemented and verified or blocked by a |
| 240 | + precise external deployment input. |
| 241 | + |
| 242 | +Commands to run before finishing: |
| 243 | +```powershell |
| 244 | +npm run flowchain:rpc:e2e |
| 245 | +npm run flowchain:sdk:e2e |
| 246 | +npm run flowchain:wallet:transfer:e2e |
| 247 | +npm run flowchain:production-l1:e2e |
| 248 | +npm run flowchain:no-secret:scan |
| 249 | +node infra/scripts/check-unsafe-claims.mjs |
| 250 | +git diff --check |
| 251 | +``` |
| 252 | + |
| 253 | +Acceptance gates: |
| 254 | +- `npm run flowchain:sdk:e2e` exists and passes locally. |
| 255 | +- SDK/client uses the real FlowChain JSON-RPC surface, not static fixtures. |
| 256 | +- SDK write examples submit signed envelopes through runtime-backed RPC. |
| 257 | +- CLI/devkit commands have JSON output and fail closed for missing live config. |
| 258 | +- RPC reference is generated from or checked against live discovery. |
| 259 | +- Quickstart, wallet integration, bridge integration, node operator, app |
| 260 | + builder, release, and troubleshooting docs exist. |
| 261 | +- Sample Node.js and browser/app examples exist or a documented unsupported |
| 262 | + reason is machine-checked. |
| 263 | +- No docs, SDK output, logs, examples, or reports include secrets or raw env |
| 264 | + values. |
| 265 | +- Public/live readiness remains blocked until public RPC and Base bridge inputs |
| 266 | + are configured and verified. |
| 267 | +- Handoff includes exact changed files, commands run, report paths, remaining |
| 268 | + blockers, and integration instructions for the verification agent. |
| 269 | + |
| 270 | +Stop condition: |
| 271 | +Stop only when FlowChain has a runnable local SDK/devkit/docs path with |
| 272 | +machine-checked references and examples, and every remaining live-only gap is |
| 273 | +reported by exact missing env/deployment name. Do not mark FlowChain live-ready |
| 274 | +only because docs or examples exist. |
0 commit comments