Skip to content

Commit 4b8afe4

Browse files
committed
Add FlowChain SDK docs goal prompt
1 parent 7327dee commit 4b8afe4

4 files changed

Lines changed: 369 additions & 2 deletions

File tree

Lines changed: 274 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,274 @@
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.

docs/agent-goals/production-l1-live-chain/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ exact missing variable or deployment artifact.
5656
- `11-ops-installer-monitoring.md`
5757
- `12-state-storage-recovery.md`
5858
- `13-live-product-verification.md`
59+
- `14-sdk-docs-developer-tooling.md`
5960

6061
Launcher:
6162

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Full Live Chain Completion Audit
2+
3+
Date: 2026-05-14
4+
Branch: `agent/production-l1-hq`
5+
6+
## Objective Restatement
7+
8+
FlowChain is complete only when it is a live, running L1 with its own node/RPC
9+
surface, block production, usable wallets, transaction execution, bridge
10+
crediting from Base 8453, spendable bridged funds, explorer/control-plane
11+
visibility, storage/recovery, docs, SDK/dev kits, and release verification. The
12+
goal is not complete if any path is local-only, fixture-only, blocked by missing
13+
deployment input, or unverified.
14+
15+
## Current Result
16+
17+
Status: `NOT_COMPLETE`.
18+
19+
The local/private path is now substantially green, including runtime-backed RPC
20+
submission and local production-shaped E2E. The public/live path is still
21+
blocked by missing public RPC deployment inputs and Base 8453 bridge inputs. A
22+
new uncovered goal prompt was added for SDK, docs, examples, and developer
23+
tooling because the original goal pack did not assign that requirement to a
24+
dedicated agent.
25+
26+
## Prompt-To-Artifact Checklist
27+
28+
| Requirement | Evidence inspected | Status |
29+
| --- | --- | --- |
30+
| Produce blocks | `devnet/local/production-l1-e2e/flowchain-production-l1-e2e-report.json` shows `latestHeight`, `latestHash`, `finalizedHeight`; `npm run flowchain:node:smoke` previously passed | Local/private proven |
31+
| Transaction intake and execution | `npm run flowchain:wallet:transfer:e2e` passed; production E2E `walletE2EStatus` and `transferE2EStatus` are `passed` | Local/private proven |
32+
| Runtime-backed RPC | `devnet/local/rpc-e2e/flowchain-rpc-e2e-report.json` shows `runtimeSubmitChecked`, `mempoolVisibleBeforeBlock`, block/tx/account/balance/provenance/restart checks all true | Local/private proven |
33+
| Public RPC readiness | RPC E2E reports `readinessStatus: BLOCKED`, `publicRpcReady: false` | Blocked |
34+
| Missing public RPC inputs | RPC E2E names `FLOWCHAIN_RPC_PUBLIC_URL`, `FLOWCHAIN_RPC_ALLOWED_ORIGINS`, `FLOWCHAIN_RPC_RATE_LIMIT_PER_MINUTE`, `FLOWCHAIN_RPC_TLS_TERMINATED`, `FLOWCHAIN_RPC_STATE_BACKUP_PATH` | Blocked |
35+
| Wallet create/send/transfer | production E2E has wallet commands passed; desktop/mobile wallet agent still owns full installable app completion | Partially proven |
36+
| Bridge mock path | production E2E `bridgeMockStatus: passed` | Local/mock proven |
37+
| Live Base 8453 bridge readiness | production E2E `bridgeLiveReadinessStatus: blocked`; pass/fail summary `passed-with-live-blockers` | Blocked |
38+
| Missing live bridge inputs | production E2E names `FLOWCHAIN_PILOT_OPERATOR_ACK`, `FLOWCHAIN_BASE8453_RPC_URL`, `FLOWCHAIN_BASE8453_LOCKBOX_ADDRESS`, `FLOWCHAIN_BASE8453_SUPPORTED_TOKEN`, `FLOWCHAIN_BASE8453_ASSET_DECIMALS`, `FLOWCHAIN_BASE8453_FROM_BLOCK`, `FLOWCHAIN_BASE8453_TO_BLOCK`, `FLOWCHAIN_PILOT_MAX_DEPOSIT_WEI`, `FLOWCHAIN_PILOT_TOTAL_CAP_WEI`, `FLOWCHAIN_PILOT_CONFIRMATIONS` | Blocked |
39+
| Exact bridge credit spendability | Mock/local bridge and wallet transfer paths pass; configured-live Base 8453 credit/spend path is blocked before broadcast | Not live-proven |
40+
| Assets/DEX/swap | production E2E `tokenE2EStatus` and `dexE2EStatus` are `passed` | Local/private proven |
41+
| Explorer/control-plane visibility | production E2E `rpcSmokeStatus` and `dashboardBuildOrBrowserStatus` are `passed`; control-plane smoke passed | Local/private proven |
42+
| Storage/export/import/restart | production E2E `exportImportStatus` and `restartRecoveryStatus` are `passed` | Local/private proven |
43+
| Cryptography/signing safety | wallet E2E and no-secret scan passed; dedicated wallet/keys and consensus agents still own deeper production hardening | Partially proven |
44+
| Docs and dev kits | No dedicated prompt existed in the goal pack; added `14-sdk-docs-developer-tooling.md` and launcher entry | Newly assigned, not built |
45+
| Final live product verifier | `13-live-product-verification.md` exists and requires `npm run flowchain:live-product:e2e`, but that final command is not yet evidenced as passing | Not complete |
46+
| GitHub state | branch was pushed previously; current work adds uncommitted docs/launcher changes and must be committed/pushed | Pending |
47+
48+
## Actual Command Evidence
49+
50+
- `npm test --prefix services/control-plane`: passed, 27/27.
51+
- `npm run control-plane:smoke`: passed.
52+
- `npm run flowchain:rpc:e2e`: passed locally with public readiness blocked.
53+
- `npm run flowchain:node:smoke`: passed locally.
54+
- `npm run flowchain:wallet:transfer:e2e`: passed locally.
55+
- `npm run flowchain:l1-e2e`: passed locally.
56+
- `npm run flowchain:production-l1:e2e`: `passed-with-live-blockers`.
57+
- `npm run flowchain:no-secret:scan`: passed.
58+
- `node infra/scripts/check-unsafe-claims.mjs`: passed.
59+
- `git diff --check`: passed before this audit update; must be rerun after.
60+
61+
## Missing Or Weakly Verified Requirements
62+
63+
1. Public FlowChain RPC is not ready until public URL, CORS, rate limit, TLS
64+
termination, and state backup path inputs are configured and verified.
65+
2. Live Base 8453 bridge is not ready until operator acknowledgement, Base RPC,
66+
lockbox address, token metadata, block range, caps, and confirmations are
67+
configured and verified.
68+
3. Real Base deposit to exact FlowChain credit to spendable transfer is not
69+
live-proven; only mock/local paths are currently green.
70+
4. Desktop/mobile wallet installability and every side panel still need final
71+
verification from the wallet-apps and release-gate prompts.
72+
5. SDK/docs/devkit work was uncovered by the original 13-prompt pack; it now has
73+
a dedicated prompt and launcher entry but no completed artifacts yet.
74+
6. `npm run flowchain:live-product:e2e` is required by the goal pack but has not
75+
been proven passing from a clean checkout with configured live dependencies.
76+
77+
## Next Prompt Action
78+
79+
Added:
80+
81+
- `docs/agent-goals/production-l1-live-chain/14-sdk-docs-developer-tooling.md`
82+
- launcher entry for `sdk-docs`
83+
84+
This new prompt must keep looping until FlowChain has runnable SDK/devkit/docs
85+
artifacts and `npm run flowchain:sdk:e2e` passes locally while keeping live
86+
paths fail-closed.
87+
88+
## Completion Decision
89+
90+
Do not mark the active goal complete. FlowChain is not yet a fully live L1 with
91+
public RPC, configured live Base bridge, spendable live bridged funds, and
92+
completed SDK/devkit/docs verification.

infra/scripts/launch-production-l1-live-chain-goals.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ $agents = @(
2626
@{ Name = "wallet-apps"; Worktree = "E:\FlowMemory\flowmemory-live-wallet-apps"; Branch = "agent/live-product-wallet-apps"; Prompt = "10-desktop-mobile-wallet.md" },
2727
@{ Name = "ops-installer"; Worktree = "E:\FlowMemory\flowmemory-live-ops"; Branch = "agent/live-product-ops-installer"; Prompt = "11-ops-installer-monitoring.md" },
2828
@{ Name = "storage-recovery"; Worktree = "E:\FlowMemory\flowmemory-live-storage"; Branch = "agent/live-product-state-storage-recovery"; Prompt = "12-state-storage-recovery.md" },
29-
@{ Name = "verification"; Worktree = "E:\FlowMemory\flowmemory-live-verification"; Branch = "agent/live-product-verification"; Prompt = "13-live-product-verification.md" }
29+
@{ Name = "verification"; Worktree = "E:\FlowMemory\flowmemory-live-verification"; Branch = "agent/live-product-verification"; Prompt = "13-live-product-verification.md" },
30+
@{ Name = "sdk-docs"; Worktree = "E:\FlowMemory\flowmemory-live-sdk-docs"; Branch = "agent/live-product-sdk-docs"; Prompt = "14-sdk-docs-developer-tooling.md" }
3031
)
3132

3233
function Invoke-Git {
@@ -110,4 +111,3 @@ codex --cd "$worktree" -s danger-full-access -a never `$prompt
110111
}
111112

112113
Write-Host "Production L1 live-chain goal launch complete."
113-

0 commit comments

Comments
 (0)