From 3c83ecbf76e1f967988f62391d3187008d8fba6a Mon Sep 17 00:00:00 2001 From: FlowmemoryAI <283694809+FlowmemoryAI@users.noreply.github.com> Date: Wed, 13 May 2026 16:02:07 -0500 Subject: [PATCH] Add FlowChain private testnet runbook and scripts --- AGENTS.md | 2 +- README.md | 27 +- .../public/data/flowmemory-dashboard-v0.json | 16 +- docs/ARCHITECTURE.md | 34 +- docs/CURRENT_STATE.md | 52 ++- docs/DAILY_HQ_RUNBOOK.md | 39 +++ docs/FLOWCHAIN_AGENT_INTEGRATION_MAP.md | 101 ++++++ docs/FLOWCHAIN_FULL_PRIVATE_TESTNET.md | 141 ++++++++ docs/FLOWCHAIN_OPERATOR_CHECKLIST.md | 89 +++++ docs/FLOWCHAIN_SECOND_COMPUTER_SETUP.md | 281 +++++++++++++++ docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md | 171 +++++++++ docs/FLOWCHAIN_TROUBLESHOOTING.md | 85 +++++ docs/ISSUE_BACKLOG.md | 121 ++++++- docs/LOCAL_DEVNET.md | 14 + docs/ROADMAP.md | 110 ++++-- .../dashboard/flowmemory-dashboard-v0.json | 16 +- .../devnet/control-plane-handoff.json | 331 ++++++++++++++++++ .../generated/devnet/dashboard-state.json | 146 +++++++- .../generated/devnet/genesis-config.json | 15 + .../generated/devnet/indexer-handoff.json | 172 ++++++++- .../devnet/operator-key-references.json | 17 + .../launch-core/generated/devnet/state.json | 189 +++++++++- .../generated/devnet/verifier-handoff.json | 98 +++++- infra/scripts/flowchain-check-prereqs.ps1 | 106 ++++++ infra/scripts/flowchain-common.ps1 | 200 +++++++++++ infra/scripts/flowchain-demo.ps1 | 39 +++ infra/scripts/flowchain-export.ps1 | 64 ++++ infra/scripts/flowchain-import.ps1 | 59 ++++ infra/scripts/flowchain-init.ps1 | 73 ++++ infra/scripts/flowchain-smoke.ps1 | 127 +++++++ infra/scripts/flowchain-start.ps1 | 56 +++ infra/scripts/flowchain-stop.ps1 | 44 +++ infra/scripts/flowchain-workbench.ps1 | 27 ++ package.json | 9 + 34 files changed, 2989 insertions(+), 82 deletions(-) create mode 100644 docs/FLOWCHAIN_AGENT_INTEGRATION_MAP.md create mode 100644 docs/FLOWCHAIN_FULL_PRIVATE_TESTNET.md create mode 100644 docs/FLOWCHAIN_OPERATOR_CHECKLIST.md create mode 100644 docs/FLOWCHAIN_SECOND_COMPUTER_SETUP.md create mode 100644 docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md create mode 100644 docs/FLOWCHAIN_TROUBLESHOOTING.md create mode 100644 fixtures/launch-core/generated/devnet/control-plane-handoff.json create mode 100644 fixtures/launch-core/generated/devnet/genesis-config.json create mode 100644 fixtures/launch-core/generated/devnet/operator-key-references.json create mode 100644 infra/scripts/flowchain-check-prereqs.ps1 create mode 100644 infra/scripts/flowchain-common.ps1 create mode 100644 infra/scripts/flowchain-demo.ps1 create mode 100644 infra/scripts/flowchain-export.ps1 create mode 100644 infra/scripts/flowchain-import.ps1 create mode 100644 infra/scripts/flowchain-init.ps1 create mode 100644 infra/scripts/flowchain-smoke.ps1 create mode 100644 infra/scripts/flowchain-start.ps1 create mode 100644 infra/scripts/flowchain-stop.ps1 create mode 100644 infra/scripts/flowchain-workbench.ps1 diff --git a/AGENTS.md b/AGENTS.md index c79819c2..1b157c94 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,7 +26,7 @@ These instructions apply to every agent, assistant, script, and human operating - Use `docs/PR_PROCESS.md` for branch naming, draft PRs, merge order, dirty worktrees, and issue closing. - Use `docs/DAILY_HQ_RUNBOOK.md` for morning review, triage, monitoring, and handoff. - Use `infra/scripts/status-report.ps1` for read-only local worktree, PR, and issue status. -- The immediate major milestone is the Rootflow V0 and Flow Memory V0 launch core. Do not reinterpret that as approval for production deployment. +- The immediate major milestone is the FlowChain private/local L1 testnet package for second-computer validation, with Rootflow V0 and Flow Memory V0 kept green as the baseline. Do not reinterpret that as approval for production deployment. ## Engineering Rules diff --git a/README.md b/README.md index 04d8a206..65a570dc 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ FlowMemory is managed as a multi-agent program. The management layer is part of - `docs/MARKETING_CLAIMS_GUARDRAILS.md`: allowed and blocked launch claims for docs and marketing - `infra/scripts/status-report.ps1`: read-only local worktree, PR, and issue status report -Immediate major milestone: keep the Rootflow V0 and Flow Memory V0 launch core green. This means local contracts/tests, FlowPulse fixtures, Uniswap swap-derived memory-signal fixtures, Rootflow transitions, Flow Memory schemas, verifier reports, crypto fixtures, dashboard-readable state, Base Sepolia testnet read/deploy commands, and local smoke-test gates. It does not mean production deployment. +Immediate major milestone: keep the Rootflow V0 and Flow Memory V0 launch core green while packaging the FlowChain private/local L1 testnet path for second-computer validation. This means local contracts/tests, FlowPulse fixtures, Uniswap swap-derived memory-signal fixtures, Rootflow transitions, Flow Memory schemas, verifier reports, crypto fixtures, dashboard-readable state, Base Sepolia testnet read/deploy commands, Windows-first wrapper scripts, and local smoke-test gates. It does not mean production deployment. Run the local launch-core path: @@ -79,6 +79,31 @@ npm run launch:candidate That command runs contract hardening, the launch flow, runtime schema validation, fixture drift checks, and claim guardrails. +Run the current FlowChain private/local wrapper path: + +```powershell +npm run flowchain:prereq +npm run flowchain:init +npm run flowchain:start +npm run flowchain:demo +npm run flowchain:export +``` + +Run the merged-surface smoke path when Foundry, Python, dashboard dependencies, +and crypto dependencies are installed: + +```powershell +npm install --prefix apps/dashboard +npm install --prefix crypto +npm run flowchain:smoke +``` + +Run the existing dashboard as the local workbench: + +```powershell +npm run workbench:dev +``` + Build the dashboard after regenerating launch data: ```powershell diff --git a/apps/dashboard/public/data/flowmemory-dashboard-v0.json b/apps/dashboard/public/data/flowmemory-dashboard-v0.json index 23277afe..663e67ac 100644 --- a/apps/dashboard/public/data/flowmemory-dashboard-v0.json +++ b/apps/dashboard/public/data/flowmemory-dashboard-v0.json @@ -1993,12 +1993,12 @@ ], "devnetBlocks": [ { - "id": "0xf76ac3652230cae4a4b5afcd54b0dcec9219f20ad71e21c497264668fb30f235", + "id": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", "blockNumber": 1, - "blockHash": "0xf76ac3652230cae4a4b5afcd54b0dcec9219f20ad71e21c497264668fb30f235", + "blockHash": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", "parentHash": "0x0f23c892cbd2d00c10839d97ddab833698a83f8df8d6df27ceac03cfdd4b7bc9", - "stateRoot": "0x76ec5260c34184b6bb54ca406a43fc1f9591a47f37f71583a7620ef4a4065aff", - "receiptsRoot": "0x6962bd6dbf28c2361c1337c1d33d678a815cc4b961e0e50db5ccb401cc0fe076", + "stateRoot": "0xd92ec8176ad55060b37898d4235612d0874ae5da6a5edbf69717b704c484e016", + "receiptsRoot": "0x6393961b24d5db9f2984a39a98e827850b771f05c7f18005addb9a530af5a9b7", "timestamp": "2026-05-13T16:00:00.000Z", "observationCount": 8, "reportCount": 8, @@ -2015,11 +2015,11 @@ } }, { - "id": "0x7515374a9b020a6d271820031738a5190cb0fc374adcd74a88a32c0fd0d5c7a6", + "id": "0x54ba8fe6b5d3781a91ebd45a2ab215dd51ff2f835afe1c72d1843384fffb3919", "blockNumber": 2, - "blockHash": "0x7515374a9b020a6d271820031738a5190cb0fc374adcd74a88a32c0fd0d5c7a6", - "parentHash": "0xf76ac3652230cae4a4b5afcd54b0dcec9219f20ad71e21c497264668fb30f235", - "stateRoot": "0x3e1f5fddd84f9d460ee30a380ff700b17611891b8c03eb320edf1baefe003ef9", + "blockHash": "0x54ba8fe6b5d3781a91ebd45a2ab215dd51ff2f835afe1c72d1843384fffb3919", + "parentHash": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", + "stateRoot": "0x75373cc47666ed9bcad605ce0f5d0aeb1bc8100a1087840d755205aef8a6bb50", "receiptsRoot": "0xa0407b9a8a55106d549e0f19b92fceaa7f7a25697e94ebf8a1fa74af7b9168f4", "timestamp": "2026-05-13T16:00:01.000Z", "observationCount": 8, diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 0f814c45..38b866ec 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -1,6 +1,12 @@ # Architecture -FlowMemory is a layered system for commitment-oriented AI memory, verification, local operator tooling, and bounded hardware research. Only the repository operating system and initial contracts foundation are implemented. Everything else is either specification, local fixture work, or research until explicitly merged. +FlowMemory is a layered system for commitment-oriented AI memory, verification, +local operator tooling, and bounded hardware research. The merged repo now has +the V0 launch-core, local deterministic devnet prototype, fixture +indexer/verifier, dashboard, crypto helpers, hardware simulator, and HQ wrapper +layer. Native private/local FlowChain object lifecycle, control-plane coverage, +long-running node behavior, and full workbench coverage remain in flight until +explicitly merged. ## Layer Map @@ -14,6 +20,7 @@ FlowMemory is a layered system for commitment-oriented AI memory, verification, 8. Research lab 9. Devnet/appchain research 10. HQ program operating system +11. FlowChain private/local testnet packaging ## Contracts @@ -177,7 +184,8 @@ Boundaries: ## Devnet And Appchain Research -Status: gated research only. +Status: local no-value devnet prototype implemented; broader appchain/L1 work +remains gated research. Responsibilities: @@ -202,6 +210,28 @@ Responsibilities: - Maintain labels, milestones, review flow, and daily runbook. - Prevent agents from overlapping folders or expanding into gated work. +## FlowChain Private/Local Testnet Packaging + +Status: Windows-first wrapper command layer implemented for merged surfaces. + +Responsibilities: + +- Provide one second-computer command path for prerequisites, init, bounded + start/stop, demo, smoke, export/import, and workbench dev mode. +- Keep wrappers pointed at the existing Rust devnet, launch-core generator, + dashboard, hardware simulator, and guardrail scripts. +- Record remaining subsystem blockers in `docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md` + and `docs/ISSUE_BACKLOG.md`. + +Boundaries: + +- The wrapper layer does not create a second devnet, dashboard, crypto package, + verifier pipeline, object model, or setup path. +- The current `flowchain:start` command is a bounded local CLI readiness path, + not a long-running node. +- Production public-chain, token, bridge, and audited-cryptography claims remain + outside this milestone. + ## Data Flow 1. A local or future deployed contract action emits FlowPulse and updates compact on-chain state. diff --git a/docs/CURRENT_STATE.md b/docs/CURRENT_STATE.md index 09838602..bdba145b 100644 --- a/docs/CURRENT_STATE.md +++ b/docs/CURRENT_STATE.md @@ -6,7 +6,9 @@ This file is the beginner-friendly source of truth for what exists in FlowMemory ## Repo Phase -FlowMemory is in launch-candidate V0 hardening. +FlowMemory is in launch-candidate V0 hardening, with the next coordination +target defined as a FlowChain private/local L1 testnet package for +second-computer validation. The bootstrap repository operating system, contracts V0 foundation, crypto V0 foundation, local indexer/verifier fixture package, dashboard V0, FlowRouter hardware POC, local no-value devnet prototype, launch-core contract-event spine, and pre-production hardening guardrails have merged into `main`. The launch-candidate work added swap-derived memory signals, stricter launch validation, and Base Sepolia testnet deploy/read commands. @@ -14,7 +16,13 @@ On 2026-05-13 a small Base mainnet canary deployment was broadcast for V0 testin The launch-core V0 stack now has a single runnable local command that connects contract fixtures, local indexing/verifier outputs, crypto schema vocabulary, Rootflow transitions, Flow Memory objects, generated dashboard state, local no-value devnet output, and hardware POC output without production deployment. -Launch-critical direction: Rootflow V0 and Flow Memory V0 are the core of the next milestone. Rootflow defines memory-state transitions. Flow Memory defines the agent-facing memory objects derived from FlowPulse observations, receipts, verifier reports, and committed roots. +Launch-critical direction: keep Rootflow V0 and Flow Memory V0 green while +packaging the next private/local testnet milestone. Rootflow defines +memory-state transitions. Flow Memory defines the agent-facing memory objects +derived from FlowPulse observations, receipts, verifier reports, and committed +roots. The FlowChain private/local testnet target must build on those surfaces; +it is not approval for production mainnet, public validators, tokenomics, +audited cryptography, or production bridge work. ## Implemented In The Merged Repo @@ -101,11 +109,37 @@ Launch-core specifications: - `docs/ROOTFLOW_V0.md` defines the Rootflow V0 transition model, status vocabulary, agent ownership, and launch acceptance. - `docs/FLOW_MEMORY_V0.md` defines MemorySignal, MemoryReceipt, RootfieldBundle, AgentMemoryView, work-lane vocabulary, and dashboard display expectations. - `docs/V0_LAUNCH_ACCEPTANCE.md` maps the Rootflow and Flow Memory objective to concrete artifacts and evidence. +- `docs/FLOWCHAIN_FULL_PRIVATE_TESTNET.md` defines the next private/local testnet package target and build-on-existing boundaries. +- `docs/FLOWCHAIN_SECOND_COMPUTER_SETUP.md` names the current merged second-computer command path and the root-level FlowChain wrapper commands. +- `docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md` marks private/local testnet features as implemented, in flight, missing, or later gated. +- `docs/FLOWCHAIN_AGENT_INTEGRATION_MAP.md` maps the next-wave worktree ownership and cross-agent handoffs. +- `docs/FLOWCHAIN_TROUBLESHOOTING.md` and `docs/FLOWCHAIN_OPERATOR_CHECKLIST.md` provide the Windows-first second-computer troubleshooting and operator checklist layer. - `docs/DECISIONS/rootflow-v0.md` records the V0 decision and non-goal boundaries. - `docs/reviews/ROOTFLOW_FLOW_MEMORY_V0_ACCEPTANCE_AUDIT.md` tracks evidence and missing work for the active launch-core goal. - `docs/reviews/OPEN_PR_MERGE_READINESS.md` is now historical merge-readiness evidence for PRs that have merged. - `docs/LAUNCH_CORE_AGENT_GOALS.md` provides copy-ready goals for the contracts, crypto, indexer/verifier, dashboard, and review worktrees. +FlowChain private/local testnet snapshot: + +- Implemented: V0 launch-core generation and validation, no-value deterministic + Rust devnet prototype, contract event/settlement spine, crypto V0 helpers and + vectors, fixture indexer/verifier, fixture-backed dashboard, hardware POC + simulator, Base Sepolia reader/deploy commands, guarded canary reader, and + Windows-first root wrapper commands for prerequisite checks, init, bounded + start/stop, demo, smoke, export/import, and workbench dev mode. +- In flight: native private-testnet object lifecycle, local control-plane API, + private-testnet object IDs and envelopes, workbench extension, optional + hardware operator signal fixtures, and advanced L1 research gates. +- Missing: long-running local runtime start behavior, private genesis/config + package beyond the deterministic devnet genesis, full native object + lifecycle coverage, full control-plane method coverage, full workbench entity + coverage, no-secret API checks, and second-computer smoke evidence for the + unmerged native object/control-plane/workbench surfaces. +- Later gated: production L1/mainnet, public validators, tokenomics, + production bridge, production hook deployment, audited cryptography, + proof-circuit infrastructure, production hardware, and hosted production + services. + ## Conceptual Or Not Implemented Yet - Production protocol deployment. @@ -135,7 +169,10 @@ Closed issue notes: - #16 was closed as not planned because its scope was folded into other architecture/status issues. - #39 was closed; future on-chain verifier adapter work should stay gated behind accepted verifier and crypto boundaries. -As of this update there are no open PRs in `FlowmemoryAI/FlowMemory`. +As of the 2026-05-13 HQ review for the private/local testnet next wave, GitHub +shows open draft PRs #71 and #73, plus open canary follow-up issues #76 through +#79. Local sibling worktrees contain unmerged Local Alpha work; those changes +are useful context but are not source of truth until merged. Recently merged PRs: @@ -179,10 +216,11 @@ Before assigning agents, check for dirty worktrees and avoid overlapping folders ## Current Operator Priorities 1. Keep the generated launch-core command stable in CI. -2. Exercise the guarded Base canary reader against the documented V0 canary addresses and feed its output into the next dashboard canary-ingestion issue. -3. Exercise the Base Sepolia deploy/read path on explicit testnet contract addresses only. -4. Continue contracts hardening without production mainnet deployment or token mechanics. -5. Keep dashboard work fixture-backed until a production API is explicitly scoped. +2. Keep the new root wrapper path usable on Windows: `flowchain:prereq`, `flowchain:init`, `flowchain:start`, `flowchain:demo`, `flowchain:smoke`, `flowchain:export`, and `workbench:dev`. +3. Convert the remaining V0/local-alpha surfaces into one FlowChain private/local L1 testnet package for second-computer validation. +4. Land the missing subsystem pieces behind the wrappers: long-running runtime behavior, control-plane serve/query coverage, native object lifecycle, and workbench entity coverage. +5. Exercise the guarded Base canary reader against the documented V0 canary addresses and feed its output into the next dashboard canary-ingestion issue. +6. Keep production mainnet, public validator, tokenomics, audited-cryptography, and production bridge claims out of scope. ## Update Rule diff --git a/docs/DAILY_HQ_RUNBOOK.md b/docs/DAILY_HQ_RUNBOOK.md index 08fae803..2fa628e2 100644 --- a/docs/DAILY_HQ_RUNBOOK.md +++ b/docs/DAILY_HQ_RUNBOOK.md @@ -2,6 +2,10 @@ This runbook is for the FlowMemory HQ operator. It keeps many Codex agents moving without overlapping folders or expanding into premature product work. +Private/local testnet checklist companion: +`docs/FLOWCHAIN_OPERATOR_CHECKLIST.md`. Troubleshooting companion: +`docs/FLOWCHAIN_TROUBLESHOOTING.md`. + ## Morning Review Run: @@ -25,6 +29,41 @@ Check: - Evidence gaps in `docs/V0_LAUNCH_ACCEPTANCE.md`. - Current audit notes in `docs/reviews/ROOTFLOW_FLOW_MEMORY_V0_ACCEPTANCE_AUDIT.md`. +## FlowChain Full-Testnet Push Checklist + +Morning: + +- Confirm GitHub open PRs and issues still match `docs/CURRENT_STATE.md` and + `docs/ISSUE_BACKLOG.md`. +- Check all sibling worktrees for dirty changes before assigning agents. +- Verify no two active agents are editing the same folder family or source-of-truth + doc without coordination. +- Review `docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md` for rows that changed from + missing to in flight or implemented after merges. +- Verify root command aliases in `package.json` still match the scripts under + `infra/scripts/flowchain-*.ps1`. +- Confirm the next assigned work extends the existing devnet, control-plane, + crypto, dashboard, contracts, hardware, or research surface instead of adding + a replacement system. +- Keep production L1, tokenomics, public validator, production bridge, audited + cryptography, production hook, and production hardware claims blocked. + +Evening: + +- Record merged PRs, open PRs, dirty worktrees, blockers, and next smallest + actions for the private/local testnet package. +- Update `docs/CURRENT_STATE.md`, `docs/ROADMAP.md`, and + `docs/ISSUE_BACKLOG.md` if a merge changes implemented, in-flight, missing, + or later-gated state. +- Update `docs/FLOWCHAIN_SECOND_COMPUTER_SETUP.md` whenever a command lands or + a command name changes. +- Check whether the second-computer path can now run farther than the previous + day, and name the first failing step. +- Save or cite `devnet/local/smoke/flowchain-smoke-report.json` when full smoke + runs locally. +- Require `git diff --check` in each PR summary and area tests where the touched + area has tests. + ## Issue Triage For each issue: diff --git a/docs/FLOWCHAIN_AGENT_INTEGRATION_MAP.md b/docs/FLOWCHAIN_AGENT_INTEGRATION_MAP.md new file mode 100644 index 00000000..0716c41a --- /dev/null +++ b/docs/FLOWCHAIN_AGENT_INTEGRATION_MAP.md @@ -0,0 +1,101 @@ +# FlowChain Agent Integration Map + +Status: coordination map for the private/local testnet next wave. + +Target phrase: + +```text +FlowChain private/local L1 testnet package for second-computer validation. +``` + +## Shared Rule + +Build on existing FlowMemory/FlowChain components. Do not create a second +devnet, dashboard/workbench, crypto package, verifier pipeline, object model, +or setup flow. + +## Worktree Ownership + +| Agent | Worktree | Primary ownership | Must reuse | Must not touch | +| --- | --- | --- | --- | --- | +| HQ / Review | `E:\FlowMemory\flowmemory-review` | Docs, acceptance, backlog, process, setup clarity | Current source-of-truth docs and dispatch target | Product implementation folders | +| Chain / Devnet | `E:\FlowMemory\flowmemory-chain` | `crates/flowmemory-devnet/`, devnet tests, devnet fixtures | Existing Rust devnet and launch-core fixture model | Contracts, apps, services internals, tokenomics | +| Control Plane / Indexer | `E:\FlowMemory\flowmemory-indexer` | `services/`, control-plane API, fixture handoff | Existing indexer/verifier/generator outputs | Contracts, dashboard implementation, crypto internals | +| Crypto / RD | `E:\FlowMemory\flowmemory-crypto` | `crypto/`, object IDs, schemas, vectors | Existing Keccak typed hash package | Services, apps, contracts, production proof systems | +| Dashboard / Workbench | `E:\FlowMemory\flowmemory-dashboard` | `apps/dashboard/` | Existing dashboard app, fixtures, styling, data model | New dashboard app, services, crypto, contracts | +| Hardware | `E:\FlowMemory\flowmemory-hardware` | `hardware/`, `fixtures/hardware/` | Existing FlowRouter simulator and POC docs | Chain runtime, services, dashboard implementation | +| Contracts | `E:\FlowMemory\flowmemory-contracts` | `contracts/`, `tests/` | Existing FlowPulse and registry/event skeletons | Core private L1 runtime, tokenomics, bridge | +| Research | `E:\FlowMemory\flowmemory-research` | `research/`, `docs/DECISIONS/` | Existing research gates and decisions | Implementation folders, public-chain claims | + +## Current Coordination Facts + +- The merged repo has a stable V0 launch-core path and no-value local devnet + prototype. +- HQ/Ops has added the Windows-first root wrapper layer for the current merged + surfaces: prerequisite check, init, bounded start/stop, demo, smoke, + export/import, and workbench dev mode. +- Active sibling worktrees contain unmerged Local Alpha work for devnet object + transitions, control-plane API, crypto object identity, hardware signal + projection, and research gates. +- Unmerged worktree changes are not final source of truth. Treat them as + in-flight context until reviewed and merged. +- GitHub remains the source of truth for issues, pull requests, reviews, and + final history. + +## Handoff Contracts + +| From | To | Handoff | +| --- | --- | --- | +| Chain | Control Plane | Devnet state file, block/tx schema, object maps, deterministic roots, export/import behavior. | +| Chain | Dashboard | Dashboard-ready handoff or control-plane-backed state for blocks, txs, agents, models, memory, challenges, and finality. | +| Crypto | Chain | Object ID helpers, typed domains, envelope policy, valid/invalid vectors, schema names. | +| Crypto | Control Plane | Shared validation vocabulary and error reasons for malformed objects. | +| Control Plane | Dashboard | Stable methods, params, responses, errors, pagination, health, and local-only limitations. | +| Hardware | Control Plane | Optional operator signal fixture shape and trust labels. | +| Hardware | Dashboard | Optional hardware node, alert, receipt breadcrumb, verifier digest, and NFC metadata projections. | +| Contracts | Chain/Indexer | Optional settlement/event spine semantics and FlowPulse compatibility. | +| Research | All | Gates for Process-Witness, SEAL/dependency privacy, private state, public appchain, bridge, and proof systems. | +| HQ / Review | All | Acceptance matrix, merge order, claim guardrails, issue grouping, and second-computer setup criteria. | + +## Integration Sequence + +1. Keep `npm run launch:candidate` green as the V0 baseline. +2. Land or refresh Local Alpha devnet object lifecycle work. +3. Land or refresh crypto object identity and vectors for the same object set. +4. Land control-plane API on top of existing fixture/devnet outputs. +5. Extend the existing dashboard into a private testnet workbench. +6. Add optional hardware signal fixtures after object/API labels are stable. +7. Keep packaging scripts and root command aliases aligned as subsystem commands land. +8. Run the second-computer smoke path and update acceptance evidence. + +## Duplicate-Work Stops + +Stop and ask for HQ review if a PR starts adding: + +- A new chain runtime outside `crates/flowmemory-devnet/`. +- A new dashboard or explorer outside the existing app surface. +- A new crypto package instead of extending `crypto/`. +- A new verifier or control-plane pipeline that bypasses current services. +- A second object model that conflicts with `schemas/flowmemory/` or crypto IDs. +- A setup flow that competes with the second-computer setup guide. +- Tokenomics, production bridge work, public validator onboarding, or production + mainnet language. + +## PR Review Checklist + +Every private testnet PR should state: + +- Which existing surface it extends. +- Which acceptance rows in `docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md` it changes. +- Which second-computer command or setup step it improves. +- Which files it touched and why they are in scope. +- Which tests or checks passed. +- Which production claims remain explicitly out of scope. + +Required check for all PRs: + +```powershell +git diff --check +``` + +Area-specific checks remain required when the area has tests. diff --git a/docs/FLOWCHAIN_FULL_PRIVATE_TESTNET.md b/docs/FLOWCHAIN_FULL_PRIVATE_TESTNET.md new file mode 100644 index 00000000..5881e9ae --- /dev/null +++ b/docs/FLOWCHAIN_FULL_PRIVATE_TESTNET.md @@ -0,0 +1,141 @@ +# FlowChain Full Private Testnet Plan + +Status: packaging and acceptance map for the next milestone. + +Correct public phrase: + +```text +FlowChain private/local L1 testnet package for second-computer validation. +``` + +Do not describe this milestone as production mainnet, public validator readiness, +tokenomics, audited cryptography, or production bridge readiness. + +## Purpose + +This plan turns the current FlowMemory V0 launch-core and active Local Alpha +work into one testable package that a second computer can run locally. + +The target is a private/local L1-style testnet package. It should prove local +state transitions, receipts, verifier reports, memory updates, challenges, +finality, control-plane queries, and workbench inspection on a clean Windows +machine. It is not a public chain launch. + +## Build On Existing Surfaces + +Agents must extend the current surfaces in place. + +Status vocabulary for this milestone: + +- `Implemented`: merged source-of-truth surface exists today. +- `In flight`: visible in active unmerged worktrees or next-wave prompts. +- `Missing`: required for second-computer validation and not merged. +- `Later gated`: outside this private/local package. + +| Area | Existing surface to extend | Current merged status | Active work to treat as in flight | +| --- | --- | --- | --- | +| Launch core | `npm run launch:v0`, `npm run launch:candidate`, `fixtures/launch-core/`, `schemas/flowmemory/` | Implemented local/test V0 foundation | Keep as the compatibility baseline for private testnet objects. | +| Devnet/runtime | `crates/flowmemory-devnet/`, `docs/LOCAL_DEVNET.md` | Implemented no-value deterministic prototype | Local Alpha work expands native object transitions and lifecycle tests. | +| Contracts spine | `contracts/`, `tests/`, FlowPulse and registry skeletons | Implemented local/test settlement/event foundation | Contracts work should remain optional settlement/event spine. | +| Crypto/object identity | `crypto/`, `crypto/fixtures/`, `schemas/flowmemory/` | Implemented V0 hash helpers and vectors | Local Alpha work adds object IDs for agent, model, memory, challenge, and finality objects. | +| Indexer/verifier/control plane | `services/indexer/`, `services/verifier/`, `services/flowmemory/` | Implemented fixture-first indexer/verifier and generator | Local Alpha work adds `services/control-plane/` as the local API. | +| Dashboard/workbench | `apps/dashboard/` and generated dashboard fixtures | Implemented fixture-backed dashboard V0 | Workbench work should extend this app, not create a second dashboard. | +| Hardware/operator signals | `hardware/`, `fixtures/hardware/`, simulator | Implemented FlowRouter POC and simulator | Local Alpha work maps optional operator signals into private testnet views. | +| Research gates | `research/`, `docs/DECISIONS/` | Implemented research docs and guardrails | Local Alpha research gates Process-Witness, SEAL, private state, and public L1 work. | + +## Required User-Facing Path + +The final package should offer one obvious path. The exact command names may +change only if the second-computer setup guide names the chosen commands. + +| Capability | Target command | Current status | +| --- | --- | --- | +| Clone repo | `git clone https://github.com/FlowmemoryAI/FlowMemory.git` | Implemented by GitHub. | +| Install JS dependencies | `npm install` | Implemented for current npm workspaces. Dashboard still needs its own install unless package metadata changes. | +| Test devnet | `cargo test --manifest-path crates/flowmemory-devnet/Cargo.toml` | Implemented. | +| Test service packages | `npm test` | Implemented for merged service packages; control-plane tests are active unmerged work. | +| Run launch candidate gate | `npm run launch:candidate` | Implemented V0 local/test gate. | +| Initialize private testnet | `npm run flowchain:init` | Implemented wrapper over the existing devnet `init`; also writes ignored local operator metadata under `devnet/local/`. | +| Start private testnet | `npm run flowchain:start` | Implemented bounded wrapper that prepares launch-core fixtures and inspects local state. Current devnet is still CLI/demo oriented, not a long-running node. | +| Run deterministic demo | `npm run flowchain:demo` | Implemented wrapper over the existing devnet `demo`. | +| Run full smoke test | `npm run flowchain:smoke` | Implemented for merged surfaces: services, crypto tests/vectors, launch candidate, devnet tests, deterministic replay, dashboard build, hardware fixture, unsafe-claim scan, and no-secret export scan. Native object/control-plane coverage remains blocked on subsystem work. | +| Export state | `npm run flowchain:export` | Implemented wrapper over `export-fixtures`; writes ignored export bundles under `devnet/local/export/`. | +| Import state | `npm run flowchain:import -- --BundlePath -Force` | Implemented script path for local state restore from an exported bundle. | +| Start local workbench | `npm run workbench:dev` | Implemented wrapper over the existing dashboard dev server. | +| Prerequisite check | `npm run flowchain:prereq` | Implemented Windows-first prerequisite and dependency-state check. | +| Stop private testnet | `npm run flowchain:stop` | Implemented operator-state wrapper; can reset ignored local state with `-ResetLocalState`. | +| Start control plane | documented local API command | In flight in `services/control-plane/`; active command is `npm run control-plane:serve` in the control-plane worktree. | + +## Target Native Objects + +The private/local testnet package should make these objects inspectable through +the devnet, control plane, and workbench. They should reuse current schemas, +fixtures, or crypto helpers when those exist. + +| Object | Target status for package | Notes | +| --- | --- | --- | +| `AgentAccount` | Required | Local identity/provenance record only; no balance or wallet-value claim. | +| `ModelPassport` | Required | Model provenance and metadata commitment; no model weights on-chain. | +| `WorkReceipt` | Required | Builds on current receipt vocabulary and registry skeletons. | +| `ToolReceipt` | Explicit placeholder allowed | Must be documented if not implemented. | +| `EvalReceipt` | Explicit placeholder allowed | Must be documented if not implemented. | +| `MemoryCell` | Required | Must link to accepted receipts, verifier reports, roots, and provenance. | +| `ArtifactAvailabilityProof` | Required | Availability/status record only; no raw artifact storage. | +| `VerifierModule` | Required | Source-visible verifier identity and supported modes. | +| `VerifierReport` | Required | Builds on current verifier report fixtures and statuses. | +| `Challenge` | Required | Must support open, resolve, rejected/unresolved, and downgrade semantics. | +| `FinalityReceipt` | Required | Must explain accepted, rejected, pending, superseded, or downgraded finality. | +| `DependencyAtom` | Explicit placeholder allowed | SEAL-compatible future boundary; no proof claim until reviewed. | + +## Definition Of Done + +The package is ready for second-computer validation only when a clean Windows +machine can: + +1. Clone the repo and install documented prerequisites. +2. Run current baseline checks without private secrets. +3. Generate or import local operator keys without committing secrets. +4. Initialize a local/private genesis. +5. Start at least one local node/runtime. +6. Optionally start multiple local or LAN nodes, or clearly mark LAN mode later. +7. Submit transactions for FlowMemory-native objects. +8. Produce blocks and deterministic state roots. +9. Register agents and model passports. +10. Submit work receipts. +11. Submit artifact availability records. +12. Submit verifier reports. +13. Update memory cells from valid receipts only. +14. Open and resolve challenges. +15. Finalize receipts. +16. Query all state through the documented local control-plane API. +17. Inspect all state through the existing dashboard/workbench surface. +18. Export and import snapshots or state bundles. +19. Run an end-to-end smoke test proving the full flow. +20. Re-run the same smoke test deterministically. + +Current HQ/Ops completion for this pass: + +- The second-computer command names now exist at the repo root. +- The commands exercise the current merged launch-core, Rust devnet, + dashboard, hardware simulator, export, import, and claim-guardrail surfaces. +- The full private object lifecycle is still owned by the chain, crypto, + control-plane, and dashboard workstreams named in + `docs/FLOWCHAIN_AGENT_INTEGRATION_MAP.md`. + +## Non-Goals + +- No production mainnet claim. +- No token launch or tokenomics. +- No public validator onboarding. +- No production consensus claim. +- No audited cryptography claim. +- No production bridge or withdrawal claim. +- No production Uniswap v4 hook deployment. +- No raw AI memory, model weights, media, or heavy artifacts on-chain. +- No requirement that FlowRouter hardware is online for the local testnet to run. + +## Coordination Rule + +If a needed surface already exists, improve it in place. Do not create a second +devnet, second dashboard/workbench, second crypto package, second verifier +pipeline, second object model, or second setup flow. diff --git a/docs/FLOWCHAIN_OPERATOR_CHECKLIST.md b/docs/FLOWCHAIN_OPERATOR_CHECKLIST.md new file mode 100644 index 00000000..10dc101a --- /dev/null +++ b/docs/FLOWCHAIN_OPERATOR_CHECKLIST.md @@ -0,0 +1,89 @@ +# FlowChain Operator Checklist + +Status: morning/evening checklist for the private/local testnet package. + +This checklist is for HQ/Ops and second-computer validation. GitHub remains the +source of truth for issues, pull requests, reviews, and final history. + +## Morning + +Run from the main checkout: + +```powershell +cd E:\FlowMemory\flowmemory-main +git fetch --all --prune +.\infra\scripts\status-report.ps1 +gh pr list --repo FlowmemoryAI/FlowMemory --state open +gh issue list --repo FlowmemoryAI/FlowMemory --state open --limit 80 +``` + +Check: + +- Which worktrees are dirty. +- Whether `origin/main` has moved. +- Whether open PRs touch overlapping folders. +- Whether docs still match GitHub issue and PR state. +- Whether `docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md` has stale statuses. +- Whether command names in `docs/FLOWCHAIN_SECOND_COMPUTER_SETUP.md` still + match `package.json`. +- Whether any PR adds tokenomics, public validator onboarding, production + bridge work, production hook claims, audited-cryptography claims, or + production hardware claims. + +Second-computer readiness check: + +```powershell +npm run flowchain:prereq +npm run flowchain:init +npm run flowchain:start +npm run flowchain:demo +npm run flowchain:export +``` + +Run `npm run flowchain:smoke` when the machine has the full prerequisite set, +including Foundry, Python, dashboard dependencies, and crypto dependencies. + +## During The Day + +- Keep each agent in its assigned worktree and folder lane. +- If a subsystem command changes, update the wrapper script and setup guide in + the same PR. +- If a subsystem remains missing, record the blocker and the smallest next + issue in `docs/ISSUE_BACKLOG.md`. +- If the second-computer path fails earlier than yesterday, update + `docs/FLOWCHAIN_TROUBLESHOOTING.md`. +- Keep the wrapper layer pointed at existing devnet, launch-core, dashboard, + crypto, hardware, and service surfaces. + +## Evening + +Record: + +- Merged PRs. +- Open PRs and review status. +- Dirty worktrees. +- The first failing second-computer step, if any. +- Smoke command result or the reason smoke was not run. +- New blocked rows in the private/local acceptance matrix. +- Next five issue prompts or agent assignments. + +Run before handoff when dependencies are installed: + +```powershell +npm run flowchain:smoke +git diff --check +``` + +If full smoke cannot run, record the exact skipped prerequisite or failing +command. Do not replace that with a broad "works locally" note. + +## Handoff Summary Shape + +End each HQ/Ops handoff with: + +- What changed. +- Why it changed. +- Tests or checks run. +- Current second-computer next command. +- Risks, assumptions, and follow-ups. + diff --git a/docs/FLOWCHAIN_SECOND_COMPUTER_SETUP.md b/docs/FLOWCHAIN_SECOND_COMPUTER_SETUP.md new file mode 100644 index 00000000..c8c507a8 --- /dev/null +++ b/docs/FLOWCHAIN_SECOND_COMPUTER_SETUP.md @@ -0,0 +1,281 @@ +# FlowChain Second-Computer Setup + +Status: Windows-first setup guide for the private/local testnet milestone. + +This guide is intentionally conservative. It names the commands that work in +the merged V0 repo today, what those commands currently prove, and what remains +blocked behind subsystem work. + +Correct target: + +```text +FlowChain private/local L1 testnet package for second-computer validation. +``` + +## Prerequisites + +Install these on the second computer: + +- Git for Windows. +- Node.js LTS with npm. +- Rust toolchain with Cargo. +- Foundry, if running contract hardening or `npm run launch:candidate`. +- Python 3, if validating hardware simulator fixtures. + +Do not put private keys, RPC credentials, API keys, seed phrases, or webhook +URLs in committed files. + +## Current Merged Setup Path + +Use this path today on a clean second computer. It validates the merged V0 +launch-core, no-value local devnet prototype, dashboard workbench, hardware +simulator fixture, and Windows wrapper layer. It does not yet prove the full +native AgentAccount, ModelPassport, MemoryCell, Challenge, FinalityReceipt, or +control-plane lifecycle. + +Clone and install: + +```powershell +git clone https://github.com/FlowmemoryAI/FlowMemory.git +cd FlowMemory +npm install +``` + +Install dashboard and crypto package dependencies when running the full +second-computer smoke path: + +```powershell +npm install --prefix apps/dashboard +npm install --prefix crypto +``` + +Check prerequisites: + +```powershell +npm run flowchain:prereq +``` + +Initialize local state and the ignored local-only operator file: + +```powershell +npm run flowchain:init +``` + +Start the current bounded local stack: + +```powershell +npm run flowchain:start +``` + +Run the deterministic demo and export state: + +```powershell +npm run flowchain:demo +npm run flowchain:export +``` + +Run the full merged-surface smoke path: + +```powershell +npm run flowchain:smoke +``` + +Run the local workbench in a separate PowerShell window: + +```powershell +npm run workbench:dev +``` + +Stop the current bounded local stack when done: + +```powershell +npm run flowchain:stop +``` + +The workbench command prints the local URL. It usually uses +`http://127.0.0.1:5173/`. Press `Ctrl+C` in the workbench PowerShell window to +stop the Vite dev server. + +Expected current result: + +- `npm run flowchain:init` writes deterministic local state under + `devnet/local/state.json` and a local-only operator file under + `devnet/local/operator.local.json`. +- `npm run flowchain:start` regenerates launch-core fixtures and records + bounded stack status under `devnet/local/flowchain-stack-status.json`. +- `npm run flowchain:demo` writes deterministic local block/state output. +- `npm run flowchain:export` writes ignored export files and a zip bundle under + `devnet/local/export/`. +- `npm run flowchain:smoke` writes + `devnet/local/smoke/flowchain-smoke-report.json` and compares deterministic + replay roots. +- `npm run workbench:dev` opens the existing dashboard as the local workbench. + +Current stop point: if a second computer needs long-running node behavior, +control-plane queries, encrypted key storage, native AgentAccount, +ModelPassport, MemoryCell, Challenge, FinalityReceipt, or full workbench +inspection of those entities, that is still the private/local testnet package +target owned by the subsystem workstreams. + +## Final Second-Computer Path + +When the package is complete, a beginner should be able to run this exact shape +from a clean clone: + +```powershell +git clone https://github.com/FlowmemoryAI/FlowMemory.git +cd FlowMemory +npm install +npm install --prefix apps/dashboard +npm install --prefix crypto +npm run flowchain:prereq +npm run flowchain:init +npm run flowchain:start +npm run control-plane:serve -- --host 127.0.0.1 --port 8675 +npm run workbench:dev +npm run flowchain:smoke +npm run flowchain:export +``` + +If `flowchain:start`, `control-plane:serve`, or `workbench:dev` are +long-running commands, run each one in its own PowerShell window and run +`flowchain:smoke` from a fourth window after the services are healthy. + +If final command names differ, this guide must be updated in the same PR that +adds the commands. The final path must still include prerequisite checks, +initialization, runtime start, control-plane serve, workbench dev, full smoke, +and export/import or snapshot behavior. + +## Target One-Command Path + +The final package should provide these root-level commands or documented +equivalents: + +```powershell +npm run flowchain:prereq +npm run flowchain:init +npm run flowchain:start +npm run flowchain:stop +npm run flowchain:demo +npm run flowchain:smoke +npm run flowchain:export +npm run workbench:dev +``` + +Current status: + +| Target command | Status | Current fallback | +| --- | --- | --- | +| `npm run flowchain:prereq` | Implemented | `infra/scripts/flowchain-check-prereqs.ps1` | +| `npm run flowchain:init` | Implemented | `infra/scripts/flowchain-init.ps1` | +| `npm run flowchain:start` | Implemented bounded wrapper | Long-running node behavior remains missing. | +| `npm run flowchain:stop` | Implemented bounded wrapper | Use `npm run flowchain:stop -- -ResetLocalState` for an explicit reset. | +| `npm run flowchain:demo` | Implemented | Wraps the existing Rust devnet `demo`. | +| `npm run flowchain:smoke` | Implemented for merged surfaces | Native object/control-plane smoke coverage remains missing. | +| `npm run flowchain:export` | Implemented | Writes ignored export directory and zip bundle. | +| `npm run flowchain:import -- --BundlePath -Force` | Implemented script path | Restores local state from an exported bundle. | +| `npm run workbench:dev` | Implemented | Wraps `npm run dev --prefix apps/dashboard`. | + +## Local Operator Keys + +Second-computer validation needs local operator identity, but the merged repo +does not yet include a production wallet or encrypted operator vault. + +Current wrapper behavior: + +- `npm run flowchain:init` writes `devnet/local/operator.local.json`. +- The file is ignored by git through `devnet/local/`. +- The file is for private/local validation only and must not be committed. +- To import an existing local-only operator file, run: + +```powershell +powershell -NoProfile -ExecutionPolicy Bypass -File infra/scripts/flowchain-init.ps1 -ImportOperatorKeyPath -Force +``` + +Acceptance target: + +- Generate or import local operator, agent, verifier, and optional hardware + signal keys. +- Store private key material outside committed fixtures. +- Prefer an encrypted local vault or platform keystore-backed file. +- Make lock, unlock, import, export, rotate, and corrupt-vault states explicit. +- Keep public state reconstructable without private secrets. + +Until that exists, do not claim wallet support or value-bearing key management. + +## Private Genesis And Runtime + +The current devnet starts from deterministic local state and writes default +state under: + +```text +devnet/local/state.json +``` + +`devnet/local/` is ignored by git. + +Private/local testnet acceptance requires a documented genesis/config flow that +can be rerun on a clean machine. The flow must say which files are generated, +which files can be committed as fixtures, and which files are local-only. + +## Control Plane + +The target package needs a documented local API for health, chain status, +blocks, transactions, agents, models, receipts, artifacts, verifier reports, +challenges, finality, memory cells, provenance, and raw JSON. + +Active Local Alpha work defines a fixture-backed JSON-RPC control plane under +`services/control-plane/`, but that work is not merged in the current source of +truth yet. + +Expected command once merged: + +```powershell +npm run control-plane:serve -- --host 127.0.0.1 --port 8675 +``` + +The API must not return secrets. + +## Workbench + +The workbench must extend the existing dashboard in `apps/dashboard/`. + +Current command: + +```powershell +npm run dev --prefix apps/dashboard +``` + +Target command: + +```powershell +npm run workbench:dev +``` + +The first screen should be the usable local workbench, not a marketing page. +It should show local/private testnet state or deterministic fixtures with clear +local-only labels. + +## Troubleshooting Checklist + +Full guide: `docs/FLOWCHAIN_TROUBLESHOOTING.md`. + +If setup fails on a second computer, check: + +- `git status --short --branch` is clean after clone. +- Node and npm are available in the current PowerShell. +- Rust and Cargo are available in the current PowerShell. +- Foundry is installed if `npm run launch:candidate` fails during contract hardening. +- Dashboard dependencies were installed with `npm install --prefix apps/dashboard`. +- Crypto package dependencies were installed with `npm install --prefix crypto` + before `npm run flowchain:smoke`. +- No `.env`, private key, RPC URL, or local vault file was committed. +- Generated state under `devnet/local/` can be deleted and recreated with `init` + when local testing needs a clean reset. + +## Completion Rule + +This setup guide is complete for the HQ/Ops wrapper layer. The overall +private/local testnet package is complete only when the target one-command path +runs the full native-object smoke flow on a clean second computer, proves +control-plane and workbench coverage, and replays deterministically. diff --git a/docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md b/docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md new file mode 100644 index 00000000..ca6af694 --- /dev/null +++ b/docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md @@ -0,0 +1,171 @@ +# FlowChain Testnet Acceptance + +Status: acceptance matrix for the private/local testnet package. The HQ/Ops +command wrapper layer is implemented for merged surfaces; full native object, +control-plane, and workbench acceptance remains in flight. + +This document marks every major feature as one of: + +- **Implemented**: merged in the current repo. +- **In flight**: visible in active unmerged worktrees or next-wave prompts. +- **Missing**: needed for second-computer validation and not merged. +- **Later gated**: outside this private/local package. + +## Package-Level Acceptance + +| Requirement | Status | Evidence or required next step | +| --- | --- | --- | +| Clone repo on second computer | Implemented | GitHub repo clone command. | +| Install JS dependencies | Implemented | `npm install` for current root workspaces. | +| Install dashboard dependencies | Implemented | `npm install --prefix apps/dashboard`; root workspace integration is missing. | +| Run devnet tests | Implemented | `cargo test --manifest-path crates/flowmemory-devnet/Cargo.toml`. | +| Run service tests | Implemented | `npm test` for merged service packages. | +| Run launch candidate gate | Implemented | `npm run launch:candidate`. | +| One-command private testnet aliases | Implemented for merged surfaces | `package.json` now exposes `flowchain:prereq`, `flowchain:init`, `flowchain:start`, `flowchain:stop`, `flowchain:demo`, `flowchain:smoke`, `flowchain:export`, `flowchain:import`, and `workbench:dev`. `control-plane:serve` remains in flight. | +| Prerequisite check script | Implemented | `infra/scripts/flowchain-check-prereqs.ps1`. | +| Start/stop scripts | Implemented bounded wrappers | `flowchain:start` prepares launch-core fixtures and state summary; `flowchain:stop` records stopped state and can reset ignored local state. Long-running node behavior remains in flight. | +| Full smoke script | Implemented for merged surfaces | `flowchain:smoke` runs service tests, crypto tests/vectors, launch candidate, devnet tests, deterministic replay, dashboard build, hardware fixture, unsafe-claim scan, and export no-secret scan. Native object/control-plane lifecycle remains blocked. | +| Export/import state bundles | Implemented local wrapper | `flowchain:export` writes ignored export files and zip bundle; `flowchain:import` restores local state from a bundle. | +| Troubleshooting guide | Implemented | `docs/FLOWCHAIN_TROUBLESHOOTING.md` plus script error messages. | + +## Runtime And State + +| Feature | Status | Acceptance condition | +| --- | --- | --- | +| No-value deterministic devnet | Implemented | Existing Rust devnet remains the single runtime surface. | +| Private/local genesis/config | In flight | Chain agent must document generated config and replay behavior. | +| Single-node local runtime | In flight | Current CLI can init/demo/run blocks and `flowchain:start` gives an obvious bounded start path; long-running node behavior is still missing. | +| Multi-node or LAN notes | Missing | Must be optional and safe, or marked later gated. | +| Deterministic block production | Implemented | Current devnet models deterministic blocks and state roots. | +| Deterministic replay | Implemented for merged demo | `flowchain:smoke` reruns the current demo twice and compares exported dashboard state roots. Full native object replay remains in flight. | +| Transaction ingestion | In flight | Current devnet supports fixture submission; expanded object ingestion is active work. | +| State export | Implemented | `export-fixtures` exists; full package export/import still needs the package-level smoke path. | +| State import/snapshot restore | Implemented local wrapper | `flowchain:import` restores current devnet state from an exported bundle; richer subsystem snapshots remain future work. | +| Health/status output | In flight | CLI summary exists; control-plane health is active work. | + +## Native Objects + +| Object or lifecycle | Status | Acceptance condition | +| --- | --- | --- | +| Rootfield namespace | Implemented | Existing contracts, launch fixtures, and devnet model support this. | +| Root commitment | Implemented | Existing contracts, fixtures, and devnet model support this. | +| FlowPulse linkage | Implemented | Launch-core fixtures preserve contract-event semantics. | +| AgentAccount | In flight | Active devnet/crypto work adds local object identity and state. | +| ModelPassport | In flight | Active devnet/crypto work adds local object identity and state. | +| WorkReceipt | In flight | Foundation exists; it must still be part of the full private testnet smoke flow. | +| ToolReceipt | Missing | Explicit placeholder is acceptable for this package if documented. | +| EvalReceipt | Missing | Explicit placeholder is acceptable for this package if documented. | +| ArtifactAvailabilityProof | In flight | Active devnet/crypto/hardware work maps availability objects. | +| VerifierModule | In flight | Active devnet/crypto work adds local verifier identity. | +| VerifierReport | In flight | Existing verifier reports exist; they still must be queryable and workbench-visible in the private testnet package. | +| MemoryCell | In flight | Active devnet/crypto/control-plane work expands local state. | +| Challenge | In flight | Active devnet/crypto/control-plane work adds local challenge shape. | +| FinalityReceipt | In flight | Active devnet/crypto/control-plane work adds local finality shape. | +| DependencyAtom | Later gated | Keep as placeholder or dependency-root boundary; no SEAL proof claim. | + +## Control Plane API + +| Feature | Status | Acceptance condition | +| --- | --- | --- | +| Local API service | In flight | Extend `services/control-plane/`; do not create a second API surface. | +| Health endpoint/method | In flight | Must show local-only status and source health. | +| Chain status | In flight | Must include block, object, fixture, and capability counters. | +| Blocks and transactions | Missing | Required for full private testnet inspection. | +| Agents and models | In flight | Must read existing devnet/fixture outputs. | +| Receipts and artifacts | In flight | Must link memory receipts, work receipts, artifacts, and provenance. | +| Verifier reports | In flight | Must expose reports and stable error shapes. | +| Challenges and finality | In flight | Must expose real local objects or explicit placeholders. | +| Memory cells | In flight | Must link memory state to receipts and verifier status. | +| Provenance queries | In flight | Must cite source files, schema hashes, report ids, and object ids. | +| Stable errors | In flight | JSON-RPC errors are active Local Alpha work. | +| No secrets in responses | Missing | Tests must prove secrets do not appear in API responses. | + +## Workbench And Explorer + +| Feature | Status | Acceptance condition | +| --- | --- | --- | +| Existing dashboard V0 | Implemented | Fixture-backed app renders V0 Rootflow/Flow Memory and devnet data. | +| Local private testnet workbench | In flight | Extend `apps/dashboard/`; do not build a second dashboard. | +| Node health view | Missing | Must show local runtime/control-plane status. | +| Blocks and transactions views | Missing | Must show deterministic local block and transaction state. | +| Agents and models views | Missing | Must show local identity/provenance state. | +| Receipts, artifacts, reports views | In flight | Existing dashboard has V0 views; needs private testnet completeness. | +| Memory cells, challenges, finality views | Missing | Required for full smoke inspection. | +| Provenance/source view | Missing | Required for second-computer debugging. | +| Raw JSON view | Implemented | Existing dashboard has a raw JSON view; private testnet data remains part of the workbench extension. | +| Loading/empty/error states | Missing | Required before second-computer validation. | + +## Crypto, Keys, And Private State + +| Feature | Status | Acceptance condition | +| --- | --- | --- | +| Keccak typed hash helpers | Implemented | Existing `crypto/` package and vectors. | +| Local object IDs | In flight | Active crypto work expands object IDs and schemas. | +| Signature/envelope policy | In flight | Must cover local operators, agents, verifiers, and hardware signal issuers. | +| Negative vector tests | In flight | Must cover wrong domain, missing signer, zero hash, malformed objects, and replay. | +| Local operator key generation/import | Implemented local-only wrapper | `flowchain:init` writes ignored `devnet/local/operator.local.json` or imports a local operator file. Encrypted vault behavior remains missing. | +| Encrypted local operator vault | Missing | Preferred target; at minimum document current local key boundary. | +| Production proof systems | Later gated | No proof-circuit or audited-crypto claim. | +| SEAL/dependency privacy | Later gated | Vocabulary and placeholders only unless reviewed separately. | + +## Hardware And Operator Signals + +| Feature | Status | Acceptance condition | +| --- | --- | --- | +| FlowRouter POC simulator | Implemented | Existing hardware simulator and fixtures. | +| Optional operator signal fixtures | In flight | Active hardware work maps heartbeat, receipt relay, verifier digest, alert, and NFC metadata. | +| Hardware required for local chain | Later gated | Hardware must remain optional for the private/local testnet. | +| Manufacturing or RF certification | Later gated | Not part of this milestone. | + +## Contracts Settlement Spine + +| Feature | Status | Acceptance condition | +| --- | --- | --- | +| FlowPulse event spine | Implemented | Existing contracts emit compact FlowPulse events. | +| Registry and receipt skeletons | Implemented | Current contracts remain optional settlement/event surfaces. | +| Private runtime implemented in Solidity | Later gated | Core private/local runtime stays in the devnet, not Solidity. | +| Production deployment or bridge | Later gated | Not part of this milestone. | + +## Full Smoke Test Acceptance + +The package is accepted only when one documented command can: + +1. Initialize the private/local chain state. +2. Register an agent. +3. Register a model passport. +4. Submit a work receipt. +5. Mark an artifact available. +6. Submit a verifier report. +7. Update a memory cell from an accepted receipt. +8. Open a challenge. +9. Resolve the challenge. +10. Finalize the receipt. +11. Export state. +12. Query the state through the control-plane API. +13. Render the state in the workbench. +14. Rerun deterministically with the same expected roots. + +Current wrapper status: + +- `npm run flowchain:smoke` is the documented command. +- It proves the merged launch-core, crypto helpers/vectors, local devnet, + export, dashboard build, hardware fixture, deterministic replay, and + claim/no-secret guardrails. +- It does not yet prove AgentAccount, ModelPassport, native MemoryCell, + Challenge, FinalityReceipt, or control-plane query coverage. Those rows stay + in flight or missing until subsystem PRs land behind the wrapper. + +Required final evidence for the acceptance PR: + +- Commands run. +- Output files generated. +- Deterministic root or fixture hash comparison. +- Control-plane query sample. +- Workbench screenshot or test/build evidence. +- `git diff --check`. + +## Review Gate + +Reject the milestone if any PR claims production mainnet, public validator +readiness, tokenomics, audited cryptography, production bridge readiness, +production hardware readiness, or AI/model/artifact data stored on-chain. diff --git a/docs/FLOWCHAIN_TROUBLESHOOTING.md b/docs/FLOWCHAIN_TROUBLESHOOTING.md new file mode 100644 index 00000000..561fe1b1 --- /dev/null +++ b/docs/FLOWCHAIN_TROUBLESHOOTING.md @@ -0,0 +1,85 @@ +# FlowChain Troubleshooting + +Status: Windows-first troubleshooting guide for the private/local testnet package. + +Use this guide when a clean second computer cannot run the current command +path from `docs/FLOWCHAIN_SECOND_COMPUTER_SETUP.md`. + +## First Command + +From the repo root: + +```powershell +npm run flowchain:prereq +``` + +If that fails, fix the missing prerequisite before running init, demo, smoke, +or workbench commands. + +## Common Failures + +| Symptom | Likely cause | Fix | +| --- | --- | --- | +| `git was not found on PATH` | Git for Windows is missing or PowerShell was opened before install. | Install Git for Windows, reopen PowerShell, rerun `npm run flowchain:prereq`. | +| `node` or `npm` missing | Node.js LTS is missing or PATH is stale. | Install Node.js LTS, reopen PowerShell, run `npm install`. | +| `cargo` or `rustc` missing | Rust toolchain is missing. | Install Rust with rustup, reopen PowerShell, run `cargo test --manifest-path crates/flowmemory-devnet/Cargo.toml`. | +| `forge is required` | Foundry is missing. | Install Foundry before `npm run launch:candidate` or `npm run flowchain:smoke`. | +| Dashboard dependency error | Dashboard deps are separate from root npm workspaces. | Run `npm install --prefix apps/dashboard`. | +| Crypto dependency error during strict prereq | Crypto deps are separate from root npm workspaces. | Run `npm install --prefix crypto`. | +| Workbench does not open | Vite dev server did not start or the port changed. | Run `npm run workbench:dev` again and use the URL printed by Vite. | +| Smoke fails during hardware fixture check | Python is missing or not on PATH. | Install Python 3 or run `npm run flowchain:smoke -- -SkipHardware` for a scoped local smoke. | +| Cargo output looks like a different worktree | A shared `CARGO_TARGET_DIR` is reusing stale binaries. | Use the root wrapper scripts; they pin cargo output to `crates/flowmemory-devnet/target` for this checkout. | +| Existing state blocks init | `devnet/local/state.json` already exists. | Run `npm run flowchain:demo`, or force reset with `powershell -NoProfile -ExecutionPolicy Bypass -File infra/scripts/flowchain-init.ps1 -Force`. | +| Import refuses to overwrite state | Import protects existing local state by default. | Run `npm run flowchain:import -- --BundlePath -Force`. | + +## Clean Local Reset + +This resets ignored local devnet state. It does not edit committed fixtures. + +```powershell +npm run flowchain:stop -- -ResetLocalState +npm run flowchain:init +npm run flowchain:demo +``` + +## Smoke Evidence + +After a successful smoke run, check: + +```powershell +Get-Content -Raw devnet/local/smoke/flowchain-smoke-report.json +``` + +The report should show: + +- `deterministicReplay` is `true`. +- `launchCandidate`, `devnetTests`, and `serviceTests` are `passed`. +- `cryptoTests` and `cryptoVectors` are `passed`. +- `noSecretExportScan` is `passed`. + +The current smoke report also lists blocked lifecycle coverage. Those blocked +rows are expected until the chain, crypto, control-plane, and workbench +workstreams land the remaining native private/local testnet surfaces. + +## Secret Hygiene + +Do not commit: + +- `.env` files. +- RPC URLs or API keys. +- Seed phrases or private keys. +- `devnet/local/`. +- Export bundles that include local operator files. + +The export script writes handoff files and scans them for obvious secret +markers. It intentionally does not include `devnet/local/operator.local.json`. + +## When To File Or Update An Issue + +Update `docs/ISSUE_BACKLOG.md` or open a GitHub issue when: + +- A command name changes. +- A wrapper points to a subsystem command that no longer exists. +- The first failing second-computer step changes. +- The smoke report exposes a new blocked lifecycle row. +- A failure requires edits outside the HQ/Ops allowed folders. diff --git a/docs/ISSUE_BACKLOG.md b/docs/ISSUE_BACKLOG.md index 825da356..5644a44e 100644 --- a/docs/ISSUE_BACKLOG.md +++ b/docs/ISSUE_BACKLOG.md @@ -2,7 +2,9 @@ Last synced: 2026-05-13 -This file maps existing GitHub issues #6-#55 into program milestones and agent worktrees. GitHub is still the source of truth for issue state; update this index after issue or milestone changes. +This file maps existing GitHub issues and proposed next-wave work into program +milestones and agent worktrees. GitHub is still the source of truth for issue +state; update this index after issue or milestone changes. ## Milestones @@ -13,6 +15,10 @@ This file maps existing GitHub issues #6-#55 into program milestones and agent w - V0 Hardware POC: FlowRouter, Meshtastic/LoRa, enclosure, indicators, NFC cartridge, hardware demo planning. - V0 Research Lab: AI memory, crypto vocabulary, no-value devnet/appchain research, proof-carrying receipt research. - V0 Review/Audit: security process, static analysis, review workflow, audit-readiness gates. +- FlowChain Private/Local Testnet Package: second-computer private/local L1 + testnet package that extends current V0/local-alpha surfaces without + production mainnet, tokenomics, public validators, audited-cryptography, or + production bridge claims. ## Agent Worktrees @@ -25,6 +31,119 @@ This file maps existing GitHub issues #6-#55 into program milestones and agent w - Research: `E:\FlowMemory\flowmemory-research` - Review/HQ: `E:\FlowMemory\flowmemory-review` +## FlowChain Private/Local Testnet Package + +Primary milestone: make the FlowChain private/local L1 testnet package for +second-computer validation runnable from a clean Windows machine. + +These rows are proposed next-wave issue groupings unless a GitHub issue number +is named. They should become GitHub issues before implementation work starts. + +Remaining gaps for this milestone: + +- Long-running local runtime start behavior behind the current bounded wrapper. +- Encrypted local operator vault and richer key rotation/recovery behavior. +- Private genesis/config beyond the deterministic devnet genesis and full + native object replay evidence. +- Control-plane methods for blocks, transactions, agents, models, receipts, + artifacts, verifier reports, memory cells, challenges, finality, provenance, + and raw JSON. +- Workbench views for the same private/local testnet entities. +- No-secret checks for control-plane responses. +- Full deterministic second-computer smoke evidence for native private/local + objects after chain, crypto, control-plane, and dashboard work lands. + +Implemented HQ/Ops packaging layer: + +- `infra/scripts/flowchain-check-prereqs.ps1` +- `infra/scripts/flowchain-init.ps1` +- `infra/scripts/flowchain-start.ps1` +- `infra/scripts/flowchain-stop.ps1` +- `infra/scripts/flowchain-demo.ps1` +- `infra/scripts/flowchain-smoke.ps1` +- `infra/scripts/flowchain-export.ps1` +- `infra/scripts/flowchain-import.ps1` +- `infra/scripts/flowchain-workbench.ps1` +- top-level package aliases for the same command path. + +Dependency order: + +1. Chain/devnet defines the canonical private testnet state, object lifecycle, + export/import, and smoke fixture shape. +2. Crypto defines object IDs, hash domains, envelopes, and positive/negative + vectors for the same object set. +3. Control plane reads the existing devnet, launch-core, and verifier outputs + without creating a second API model. +4. Dashboard extends the existing app to consume control-plane or deterministic + fixture output. +5. Hardware contributes optional advisory signal fixtures only after object and + API labels are stable. +6. Packaging keeps root command aliases and Windows scripts aligned as command + semantics evolve. + +### Chain / Devnet + +| Issue | State | Agent/worktree | Dependencies | Notes | +| --- | --- | --- | --- | --- | +| Proposed `[chain] Extend devnet into private FlowChain testnet runtime` | Proposed | Chain - `flowmemory-chain` | Current `crates/flowmemory-devnet/`, crypto object IDs | Extend existing Rust devnet only; add genesis/config, deterministic object lifecycle, export/import, and full smoke path. | +| Proposed `[chain] Add deterministic private testnet smoke fixture` | Proposed | Chain - `flowmemory-chain` | Runtime extension | Must prove agent, model, receipt, artifact, verifier report, memory, challenge, finality, export, and replay. | +| Proposed `[chain] Document LAN/private-node boundaries` | Proposed | Chain - `flowmemory-chain` | Runtime start behavior | LAN is optional; no public validator or production consensus claim. | + +### Control Plane / Indexer + +| Issue | State | Agent/worktree | Dependencies | Notes | +| --- | --- | --- | --- | --- | +| Proposed `[indexer] Expose private FlowChain testnet control plane` | Proposed | Indexer - `flowmemory-indexer` | Chain handoff, crypto object IDs | Extend `services/control-plane/` and existing indexer/verifier outputs; no second API. | +| Proposed `[indexer] Add control-plane full-smoke client` | Proposed | Indexer - `flowmemory-indexer` | Control-plane methods | Query health, chain, blocks, txs, agents, models, receipts, artifacts, verifier reports, challenges, finality, memory, provenance, raw JSON. | +| Proposed `[indexer/security] Add no-secret response checks` | Proposed | Indexer - `flowmemory-indexer` | Control-plane API | Tests must prevent keys, RPC URLs, API keys, seed phrases, and private locators from appearing in responses. | + +### Crypto / RD + +| Issue | State | Agent/worktree | Dependencies | Notes | +| --- | --- | --- | --- | --- | +| Proposed `[crypto] Define private testnet object envelopes and vectors` | Proposed | Crypto - `flowmemory-crypto` | Existing `crypto/`, `schemas/flowmemory/` | AgentAccount, ModelPassport, MemoryCell, ArtifactAvailabilityProof, VerifierModule, Challenge, FinalityReceipt, provenance response. | +| Proposed `[crypto] Define local signer and envelope policy` | Proposed | Crypto - `flowmemory-crypto` | Object IDs | Local operators, agents, verifiers, hardware signal issuers; no production wallet or audited-crypto claim. | +| Proposed `[crypto] Add negative vector coverage` | Proposed | Crypto - `flowmemory-crypto` | Envelope policy | Replay, wrong domain, missing signer, zero hash, malformed object, duplicate IDs. | + +### Dashboard / Workbench + +| Issue | State | Agent/worktree | Dependencies | Notes | +| --- | --- | --- | --- | --- | +| Proposed `[dashboard] Build local FlowChain testnet workbench` | Proposed | Dashboard - `flowmemory-dashboard` | Control-plane API or deterministic fixture fallback | Extend existing dashboard; show node health, blocks, transactions, agents, models, receipts, memory cells, artifacts, reports, challenges, finality, provenance, raw JSON. | +| Proposed `[dashboard] Add local setup/status panel` | Proposed | Dashboard - `flowmemory-dashboard` | Packaging command names | Show expected local commands and service states; no marketing landing page. | +| #76 `[dashboard] Add canary deployment artifact ingestion and live/canary mode` | Open | Dashboard - `flowmemory-dashboard` | Guarded canary reader output | Canary mode must stay separate from private/local testnet and production claims. | + +### Hardware + +| Issue | State | Agent/worktree | Dependencies | Notes | +| --- | --- | --- | --- | --- | +| Proposed `[hardware] Add optional private testnet operator signal fixtures` | Proposed | Hardware - `flowmemory-hardware` | Crypto/control-plane labels | Heartbeat, receipt relay, verifier digest relay, offline alert/challenge input, NFC cartridge metadata. | +| Proposed `[hardware] Validate simulator projection for workbench ingestion` | Proposed | Hardware - `flowmemory-hardware` | Hardware fixture schema | Hardware remains optional and advisory; no manufacturing, RF, broadband, validator, or trustlessness claim. | + +### Contracts + +| Issue | State | Agent/worktree | Dependencies | Notes | +| --- | --- | --- | --- | --- | +| Proposed `[contracts] Align settlement spine with private testnet objects` | Proposed | Contracts - `flowmemory-contracts` | Object model and FlowPulse semantics | Contracts remain optional event/settlement spine; do not move private runtime into Solidity. | +| #78 `[contracts] Build real Uniswap v4 hook path beyond HookAdapter scaffold` | Open | Contracts - `flowmemory-contracts` | Hook boundary and deployment decisions | Must remain outside private testnet core and must not claim production hook readiness. | +| #79 `[contracts/security] Define ownership and operator policy for deployed V0 surfaces` | Open | Contracts - `flowmemory-contracts` | Access-control review | Policy only until implementation is scoped. | + +### Research + +| Issue | State | Agent/worktree | Dependencies | Notes | +| --- | --- | --- | --- | --- | +| Proposed `[research] Gate advanced FlowChain L1 research for private testnet` | Proposed | Research - `flowmemory-research` | Existing research docs and decisions | Local testnet, public devnet, and public L1 gates; Process-Witness, SEAL, encrypted compute, bridge/security blocked until reviewed. | +| Proposed `[research] Define dependency atom placeholder boundary` | Proposed | Research - `flowmemory-research` | Crypto object vocabulary | Placeholder or dependency-root vocabulary only; no proof claim. | + +### Review / HQ / Packaging + +| Issue | State | Agent/worktree | Dependencies | Notes | +| --- | --- | --- | --- | --- | +| Proposed `[hq] Define FlowChain private testnet acceptance plan` | Proposed | Review/HQ - `flowmemory-review` | Dispatch target | Docs-only acceptance, setup, integration map, roadmap, backlog. | +| Proposed `[ops] Maintain Windows private testnet run scripts` | Implemented locally; keep open until merged | Review/HQ or packaging owner | Command names from chain/control-plane/dashboard | Prereq check, init, bounded start/stop, demo, smoke, export/import, and workbench scripts now exist; update when subsystem commands change. | +| Proposed `[hq] Create second-computer validation checklist` | Implemented locally; keep open until merged | Review/HQ - `flowmemory-review` | Smoke command and workbench | `docs/FLOWCHAIN_SECOND_COMPUTER_SETUP.md`, `docs/FLOWCHAIN_TROUBLESHOOTING.md`, and `docs/FLOWCHAIN_OPERATOR_CHECKLIST.md` record commands, outputs, limitations, and follow-ups. | +| #77 `[ops/security] Automate source verification for V0 canary contracts` | Open | Review/HQ or Contracts/Ops | Canary deployment docs | Canary follow-up only; not private testnet production readiness. | + ## V0 Repo OS | Issue | State | Agent/worktree | Dependencies | Notes | diff --git a/docs/LOCAL_DEVNET.md b/docs/LOCAL_DEVNET.md index aee8c039..6245424b 100644 --- a/docs/LOCAL_DEVNET.md +++ b/docs/LOCAL_DEVNET.md @@ -27,6 +27,20 @@ cargo test --manifest-path crates/flowmemory-devnet/Cargo.toml ## Commands +Windows-first root wrappers: + +```powershell +npm run flowchain:init +npm run flowchain:start +npm run flowchain:demo +npm run flowchain:export +npm run flowchain:stop +``` + +The wrappers call the Rust CLI below and write ignored operator/status/handoff/ +export files under `devnet/local/`. The current runtime is still a +deterministic local CLI, not a long-running node. + Initialize state: ```powershell diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 5e39b264..80bc3ba3 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -2,35 +2,62 @@ This roadmap is the project-management view of FlowMemory. Use GitHub issues for execution and `docs/DECISIONS/` for durable decisions. -Production L1, tokenomics, mainnet deployment, production Uniswap v4 hook deployment, hardware manufacturing, and full dashboard implementation are later gated work. They are not approved by this roadmap. - -## Immediate Major Milestone: Rootflow And Flow Memory V0 Launch Core - -Goal: make a local developer able to run the smallest FlowMemory loop without production deployment. - -The launch-core V0 stack means: - -- Contracts compile and tests run locally. -- FlowPulse fixtures can be produced or consumed deterministically. -- The V0 hook adapter can emit a swap-derived `SWAP_MEMORY_SIGNAL` FlowPulse for the launch fixture path. -- Rootflow transitions link FlowPulse observations, parent state, receipts, verifier reports, and new roots. -- Flow Memory objects expose MemorySignal, MemoryReceipt, RootfieldBundle, and AgentMemoryView shapes. -- MemorySignals and RootflowTransitions preserve explicit `IFlowPulse.FlowPulse` contract-event semantics while keeping receipt-only fields indexer-derived. -- Indexer/verifier specs define observation identity, reorg states, and report shape. -- Crypto vocabulary defines receipts, attestations, roots, commitments, and proof boundaries. -- Dashboard can consume fixture-backed observed, pending, verified, failed, unsupported, and reorged states. -- Hardware and research tracks have bounded specs but do not block local software validation. +No production L1, tokenomics, mainnet deployment, production Uniswap v4 hook +deployment, hardware manufacturing, or production bridge work is approved by +this roadmap; those areas remain later gated work. + +## Immediate Major Milestone: FlowChain Private/Local Testnet Package + +Goal: make a clean second computer able to run the FlowChain private/local L1 +testnet package for second-computer validation, building on the existing V0 +launch-core, local devnet, contracts spine, crypto package, fixture +indexer/verifier, dashboard, hardware simulator, and research gates. + +The private/local package must preserve the launch-core V0 stack and add one +obvious second-computer path for: + +- prerequisite checks and install commands; +- local operator key generation or import guidance; +- private/local genesis initialization; +- single-node local runtime start; +- local runtime stop/reset behavior; +- deterministic block and state-root production; +- native object transactions for agents, models, receipts, artifacts, verifier reports, memory cells, challenges, and finality; +- local control-plane API queries; +- local workbench inspection through the existing dashboard surface; +- export/import or snapshot bundles; +- a full deterministic smoke command. + +The required source-of-truth planning docs are: + +- `docs/FLOWCHAIN_FULL_PRIVATE_TESTNET.md` +- `docs/FLOWCHAIN_SECOND_COMPUTER_SETUP.md` +- `docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md` +- `docs/FLOWCHAIN_AGENT_INTEGRATION_MAP.md` + +Completion gate: the milestone is not accepted until `docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md` +marks the private/local package path implemented and records the exact commands, +generated outputs, deterministic replay evidence, control-plane query evidence, +workbench evidence, and `git diff --check` result. The HQ wrapper command layer +now exists, but the native object lifecycle, long-running runtime behavior, +control-plane coverage, and workbench entity coverage still have to land behind +those wrappers. Non-goals: - No tokenomics. -- No dynamic fees. -- No production deployments. -- No production L1/appchain. +- No public validator onboarding. +- No production mainnet or production L1 claim. +- No production bridge. - No production hook deployment. - No hardware manufacturing. +- No audited-cryptography claim. - No hosted production dashboard or production API. +Rootflow V0 and Flow Memory V0 remain launch-critical baseline requirements. +The private/local testnet milestone is not allowed to fork or duplicate those +surfaces. + ## Near-Term Phases ### Phase 0: V0 Repo OS @@ -73,7 +100,22 @@ Status: implemented as fixture-first services plus generated launch-core state; - Runtime schema validation and generated fixture drift checks exist for launch-core outputs. - Local devnet smoke-test gates exist as a no-value Rust prototype, without mainnet or production deployment. -### Phase 3: V0 Review/Audit +### Phase 3: FlowChain Private/Local Testnet Package + +Status: active packaging and next-wave build coordination. The Windows-first +root wrapper layer exists for current merged surfaces; subsystem completion is +still required for the full private/local object lifecycle. + +- Extend the existing Rust devnet into the single private/local runtime surface. +- Extend the existing service packages into one local control-plane API. +- Extend the existing crypto package with object IDs, envelopes, schemas, and vectors for private testnet objects. +- Extend the existing dashboard into the local workbench/explorer. +- Keep hardware signals optional and fixture-backed. +- Keep contracts as optional settlement/event spine, not the core private runtime. +- Keep Windows-first second-computer setup, scripts, command aliases, smoke tests, and troubleshooting current as subsystem commands land. +- Keep all production mainnet, tokenomics, public validator, audited-cryptography, and bridge claims blocked. + +### Phase 4: V0 Review/Audit Status: active. @@ -85,7 +127,7 @@ Status: active. ## Mid-Term Phases -### Phase 4: V0 Crypto Schema Layer +### Phase 5: V0 Crypto Schema Layer Status: implemented for crypto V0 primitives and local Flow Memory object schemas. @@ -95,7 +137,7 @@ Status: implemented for crypto V0 primitives and local Flow Memory object schema - Validate test vectors through verifier specs and keep cross-language checks passing. - Keep proof circuits, GPU proofs, verifier economics, and production crypto infrastructure out of scope. -### Phase 5: V0 Dashboard Data Model And Display Path +### Phase 6: V0 Dashboard Data Model And Display Path Status: implemented as a generated fixture-backed local app. @@ -106,7 +148,7 @@ Status: implemented as a generated fixture-backed local app. - The dashboard fixture is generated from services, local devnet, and hardware POC outputs by `npm run launch:v0`. - Keep hosted production APIs and deployment out of scope until the local stack stabilizes. -### Phase 6: V0 Hardware POC +### Phase 7: V0 Hardware POC Status: bounded POC specs and simulator implemented; real hardware integration still future work. @@ -117,7 +159,7 @@ Status: bounded POC specs and simulator implemented; real hardware integration s ## Research Phases -### Phase 7: V0 Research Lab +### Phase 8: V0 Research Lab Status: research-only. @@ -126,7 +168,7 @@ Status: research-only. - Compare Base settlement anchors and local devnet smoke-test requirements. - Research bridge/security review requirements before any chain design. -### Phase 8: Later Gated Work +### Phase 9: Later Gated Work Status: blocked until explicit go/no-go decisions exist. @@ -143,8 +185,12 @@ The initial merge sequence has completed for repo OS, contracts foundation, cryp Next merge preference: -1. Deployment-artifact ingestion for the guarded Base canary reader output. -2. Base Sepolia reader soak tests against explicit testnet deployments. -3. Dashboard live/canary mode separation from generated fixtures. -4. Static analysis follow-up findings triaged for any public testnet deployment. -5. Production-gated research only after V0 local acceptance stays green. +1. HQ private/local testnet acceptance and setup docs. +2. Chain/devnet private testnet runtime extension. +3. Crypto object identity, envelope, and vector extension for the same object set. +4. Control-plane API over existing fixture/devnet outputs. +5. Dashboard/workbench extension of the existing app. +6. Optional hardware signal fixtures after API/object labels are stable. +7. Contracts settlement-spine alignment without moving runtime into Solidity. +8. Refresh packaging scripts and root command aliases whenever subsystem command semantics change. +9. Canary ingestion and Base Sepolia follow-ups, still gated from production claims. diff --git a/fixtures/dashboard/flowmemory-dashboard-v0.json b/fixtures/dashboard/flowmemory-dashboard-v0.json index 23277afe..663e67ac 100644 --- a/fixtures/dashboard/flowmemory-dashboard-v0.json +++ b/fixtures/dashboard/flowmemory-dashboard-v0.json @@ -1993,12 +1993,12 @@ ], "devnetBlocks": [ { - "id": "0xf76ac3652230cae4a4b5afcd54b0dcec9219f20ad71e21c497264668fb30f235", + "id": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", "blockNumber": 1, - "blockHash": "0xf76ac3652230cae4a4b5afcd54b0dcec9219f20ad71e21c497264668fb30f235", + "blockHash": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", "parentHash": "0x0f23c892cbd2d00c10839d97ddab833698a83f8df8d6df27ceac03cfdd4b7bc9", - "stateRoot": "0x76ec5260c34184b6bb54ca406a43fc1f9591a47f37f71583a7620ef4a4065aff", - "receiptsRoot": "0x6962bd6dbf28c2361c1337c1d33d678a815cc4b961e0e50db5ccb401cc0fe076", + "stateRoot": "0xd92ec8176ad55060b37898d4235612d0874ae5da6a5edbf69717b704c484e016", + "receiptsRoot": "0x6393961b24d5db9f2984a39a98e827850b771f05c7f18005addb9a530af5a9b7", "timestamp": "2026-05-13T16:00:00.000Z", "observationCount": 8, "reportCount": 8, @@ -2015,11 +2015,11 @@ } }, { - "id": "0x7515374a9b020a6d271820031738a5190cb0fc374adcd74a88a32c0fd0d5c7a6", + "id": "0x54ba8fe6b5d3781a91ebd45a2ab215dd51ff2f835afe1c72d1843384fffb3919", "blockNumber": 2, - "blockHash": "0x7515374a9b020a6d271820031738a5190cb0fc374adcd74a88a32c0fd0d5c7a6", - "parentHash": "0xf76ac3652230cae4a4b5afcd54b0dcec9219f20ad71e21c497264668fb30f235", - "stateRoot": "0x3e1f5fddd84f9d460ee30a380ff700b17611891b8c03eb320edf1baefe003ef9", + "blockHash": "0x54ba8fe6b5d3781a91ebd45a2ab215dd51ff2f835afe1c72d1843384fffb3919", + "parentHash": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", + "stateRoot": "0x75373cc47666ed9bcad605ce0f5d0aeb1bc8100a1087840d755205aef8a6bb50", "receiptsRoot": "0xa0407b9a8a55106d549e0f19b92fceaa7f7a25697e94ebf8a1fa74af7b9168f4", "timestamp": "2026-05-13T16:00:01.000Z", "observationCount": 8, diff --git a/fixtures/launch-core/generated/devnet/control-plane-handoff.json b/fixtures/launch-core/generated/devnet/control-plane-handoff.json new file mode 100644 index 00000000..01391ec3 --- /dev/null +++ b/fixtures/launch-core/generated/devnet/control-plane-handoff.json @@ -0,0 +1,331 @@ +{ + "blocks": [ + { + "blockHash": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", + "blockNumber": 1, + "logicalTime": 1778688000, + "parentHash": "0x0f23c892cbd2d00c10839d97ddab833698a83f8df8d6df27ceac03cfdd4b7bc9", + "receipts": [ + { + "error": null, + "status": "applied", + "txId": "0x2cffda58c783dc026978b06a681587b19d9536ae4e158a69be855da1200f3189" + }, + { + "error": null, + "status": "applied", + "txId": "0x75e63a0257621b8ef7412c6455a19d848996905e21f5ba79ccb0870d6e82eb25" + }, + { + "error": null, + "status": "applied", + "txId": "0x6f55c155425b968de01092be7d276f0c24430a2994910881938bc13c72f8892f" + }, + { + "error": null, + "status": "applied", + "txId": "0x05abb39c720d8ee1cd9253e32efaa595f5d5b2fcef4a908f61ab4a6bfa315359" + }, + { + "error": null, + "status": "applied", + "txId": "0xb9f435aceb1bedb86dce821743769b28c02a42002c9cd41f2df1ea0279462ab2" + }, + { + "error": null, + "status": "applied", + "txId": "0x27aeba6c55c764222964764cb2bfbb69fb6fa56cb84714d6e98240ceb6e9d01d" + }, + { + "error": null, + "status": "applied", + "txId": "0xef6df43993478d8f14d609732c7260fa08861ecc17e74137b83beda8d50931d2" + }, + { + "error": null, + "status": "applied", + "txId": "0x73b81134901c2ce13e575f161d82a404c6f7cd1ef2e8ee17beb6697062175c46" + }, + { + "error": null, + "status": "applied", + "txId": "0x3ac0b196a212a0e77d0a0c4b60e2283d2994b09993971b95427996700f5b92aa" + }, + { + "error": null, + "status": "applied", + "txId": "0xda9d2574a0d4bec158e13623499c6efe6dddb76f838c5f06c3e4dc8457b67d3b" + }, + { + "error": null, + "status": "applied", + "txId": "0xa0729982b58cc701aba6af0bc29ca993190db4e8e1489af918dbe293c0c03bad" + }, + { + "error": null, + "status": "applied", + "txId": "0xf32e17d973089ae20766e2c6ec07d1511ddecd3f79803f6146a90df971ca814f" + }, + { + "error": null, + "status": "applied", + "txId": "0x514f9ef68c09de5a4dc80611d661d07a4ea3a4fae6000a43a25864489f354a81" + } + ], + "schema": "flowmemory.local_devnet.block.v0", + "stateRoot": "0xd92ec8176ad55060b37898d4235612d0874ae5da6a5edbf69717b704c484e016", + "txIds": [ + "0x2cffda58c783dc026978b06a681587b19d9536ae4e158a69be855da1200f3189", + "0x75e63a0257621b8ef7412c6455a19d848996905e21f5ba79ccb0870d6e82eb25", + "0x6f55c155425b968de01092be7d276f0c24430a2994910881938bc13c72f8892f", + "0x05abb39c720d8ee1cd9253e32efaa595f5d5b2fcef4a908f61ab4a6bfa315359", + "0xb9f435aceb1bedb86dce821743769b28c02a42002c9cd41f2df1ea0279462ab2", + "0x27aeba6c55c764222964764cb2bfbb69fb6fa56cb84714d6e98240ceb6e9d01d", + "0xef6df43993478d8f14d609732c7260fa08861ecc17e74137b83beda8d50931d2", + "0x73b81134901c2ce13e575f161d82a404c6f7cd1ef2e8ee17beb6697062175c46", + "0x3ac0b196a212a0e77d0a0c4b60e2283d2994b09993971b95427996700f5b92aa", + "0xda9d2574a0d4bec158e13623499c6efe6dddb76f838c5f06c3e4dc8457b67d3b", + "0xa0729982b58cc701aba6af0bc29ca993190db4e8e1489af918dbe293c0c03bad", + "0xf32e17d973089ae20766e2c6ec07d1511ddecd3f79803f6146a90df971ca814f", + "0x514f9ef68c09de5a4dc80611d661d07a4ea3a4fae6000a43a25864489f354a81" + ] + }, + { + "blockHash": "0x54ba8fe6b5d3781a91ebd45a2ab215dd51ff2f835afe1c72d1843384fffb3919", + "blockNumber": 2, + "logicalTime": 1778688001, + "parentHash": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", + "receipts": [ + { + "error": null, + "status": "applied", + "txId": "0x8f719c880f17b5d4fb6d9efd54ac276d0dd8050d11c2c7870c36a79b66bc49d7" + } + ], + "schema": "flowmemory.local_devnet.block.v0", + "stateRoot": "0x75373cc47666ed9bcad605ce0f5d0aeb1bc8100a1087840d755205aef8a6bb50", + "txIds": [ + "0x8f719c880f17b5d4fb6d9efd54ac276d0dd8050d11c2c7870c36a79b66bc49d7" + ] + } + ], + "chainId": "flowmemory-local-devnet-v0", + "genesisConfig": { + "blockTimeSeconds": 1, + "chainId": "flowmemory-local-devnet-v0", + "consensus": "single-process deterministic local block production", + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ], + "genesisHash": "0x0f23c892cbd2d00c10839d97ddab833698a83f8df8d6df27ceac03cfdd4b7bc9", + "genesisLogicalTime": 1778688000, + "networkId": "flowmemory-private-local", + "noValue": true, + "operatorKeyReferenceId": "operator-key:local-devnet:alpha", + "schema": "flowmemory.local_devnet.config.v0" + }, + "latestBlock": { + "blockHash": "0x54ba8fe6b5d3781a91ebd45a2ab215dd51ff2f835afe1c72d1843384fffb3919", + "blockNumber": 2, + "logicalTime": 1778688001, + "parentHash": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", + "receipts": [ + { + "error": null, + "status": "applied", + "txId": "0x8f719c880f17b5d4fb6d9efd54ac276d0dd8050d11c2c7870c36a79b66bc49d7" + } + ], + "schema": "flowmemory.local_devnet.block.v0", + "stateRoot": "0x75373cc47666ed9bcad605ce0f5d0aeb1bc8100a1087840d755205aef8a6bb50", + "txIds": [ + "0x8f719c880f17b5d4fb6d9efd54ac276d0dd8050d11c2c7870c36a79b66bc49d7" + ] + }, + "mapRoots": { + "agentAccountRoot": "0xcf31230bfff347f79e19a55f4d1ff5fa486b0b1ad4754ce22b93de4b259a3ca7", + "artifactAvailabilityProofRoot": "0xfb4b693c45014aae0947f35696e9d864e7b26ac6fd39c1df5edb3e0dcf9bd928", + "artifactCommitmentRoot": "0xb772a9f7273032fd3ba2da8b6476d4715bbbafbd2a7eed21ecd0d558bde3beab", + "baseAnchorRoot": "0xd61259ffaad6d352bd8f2e1b498c46b9d62b3c77ff22eeacd028bbb0cc66c5bd", + "challengeRoot": "0x16da3d2bf2dcd801bc5deb3987dc01342cb957031ad01408ea77bf5d1583656f", + "finalityReceiptRoot": "0x8b8f5ff0d8c0a2f799958098165e8a6ff3c8f822f57147d1e1e7d2199ae1e347", + "importedObservationRoot": "0x99cb1b939d5a09f800f72e4c5a2b92988571126e1f6f93549f4893b3f7de7880", + "importedVerifierReportRoot": "0x6070b1015f000dd509c7b276d2ad68d8a9d188ef1a961c2f573346eb75ea5ad7", + "memoryCellRoot": "0x1b4e91099dd8d867201bd880437197ae6c031e538341aaa3cd2046e5706a2c25", + "modelPassportRoot": "0x326aa6b0b372d29d24d747fe0879adfd7aaea206373b24ae2ab77d56357e9529", + "operatorKeyReferenceRoot": "0x8457aa3ed0f4238834a8f3925f25ccca805828d8427c3ef67590a45659b22a40", + "rootfieldStateRoot": "0xb72a851dca1103410484e3272945bae5e87fc39b8f32f77d2991959b60d3bfbf", + "verifierModuleRoot": "0xd6ddd8a2d0f5812d64679656c69983a2e0aecd36bd36199d900245658ae4626c", + "verifierReportRoot": "0x4facd21e55423e182eba87355482a35daa93f53190fbd3a8d2969f9d55bc5373", + "workReceiptRoot": "0x8b3ef5650c9eea2f608ad9c7cb73df3c289fc0ac72ed04f46e6ae4bce0a1f023" + }, + "objects": { + "agentAccounts": { + "agent:demo:alpha": { + "active": true, + "agentId": "agent:demo:alpha", + "controller": "operator:local-demo", + "memoryRoot": "0xf82cda830e2aa175d9813982009a59ec8a288b691a55205a22d7007fcc3a41ae", + "metadataHash": "0x62348f90982ee812382bb97c0c6930e0e80583d0eeb40b4ae3c3395ca44cec1c", + "modelPassportId": "model:demo:local-alpha" + } + }, + "artifactAvailabilityProofs": { + "availability:demo:001": { + "artifactId": "artifact:demo:001", + "checkedAtBlock": 1, + "commitment": "0x4de1ac0e70ce73c0a03df255d1ea2a7bbcb40f05c60f1b0c1b73e0b4577c537a", + "proofDigest": "0xf5826d75505fd87288a6219067d4febfd25226cf6e70c85288317770b02d6527", + "proofId": "availability:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "status": "available", + "storageBackend": "fixture-local" + } + }, + "artifactCommitments": { + "artifact:demo:001": { + "artifactId": "artifact:demo:001", + "commitment": "0x4de1ac0e70ce73c0a03df255d1ea2a7bbcb40f05c60f1b0c1b73e0b4577c537a", + "rootfieldId": "rootfield:demo:alpha", + "uriHint": "fixture://artifact/demo/001" + } + }, + "baseAnchors": { + "0x2e2c83de6aab8190d169ad3348c62ce0cf0d4dcd6e83932c7beda822b4736a64": { + "agentAccountRoot": "0xcf31230bfff347f79e19a55f4d1ff5fa486b0b1ad4754ce22b93de4b259a3ca7", + "anchorId": "0x2e2c83de6aab8190d169ad3348c62ce0cf0d4dcd6e83932c7beda822b4736a64", + "appchainChainId": "flowmemory-local-devnet-v0", + "artifactAvailabilityProofRoot": "0xfb4b693c45014aae0947f35696e9d864e7b26ac6fd39c1df5edb3e0dcf9bd928", + "artifactCommitmentRoot": "0xb772a9f7273032fd3ba2da8b6476d4715bbbafbd2a7eed21ecd0d558bde3beab", + "blockRangeEnd": 1, + "blockRangeStart": 1, + "challengeRoot": "0x16da3d2bf2dcd801bc5deb3987dc01342cb957031ad01408ea77bf5d1583656f", + "finalityReceiptRoot": "0x8b8f5ff0d8c0a2f799958098165e8a6ff3c8f822f57147d1e1e7d2199ae1e347", + "finalityStatus": "local-placeholder", + "memoryCellRoot": "0x1b4e91099dd8d867201bd880437197ae6c031e538341aaa3cd2046e5706a2c25", + "modelPassportRoot": "0x326aa6b0b372d29d24d747fe0879adfd7aaea206373b24ae2ab77d56357e9529", + "operatorKeyReferenceRoot": "0x8457aa3ed0f4238834a8f3925f25ccca805828d8427c3ef67590a45659b22a40", + "previousAnchorId": "0x0000000000000000000000000000000000000000000000000000000000000000", + "rootfieldStateRoot": "0xb72a851dca1103410484e3272945bae5e87fc39b8f32f77d2991959b60d3bfbf", + "stateRoot": "0xd92ec8176ad55060b37898d4235612d0874ae5da6a5edbf69717b704c484e016", + "verifierModuleRoot": "0xd6ddd8a2d0f5812d64679656c69983a2e0aecd36bd36199d900245658ae4626c", + "verifierReportRoot": "0x4facd21e55423e182eba87355482a35daa93f53190fbd3a8d2969f9d55bc5373", + "workReceiptRoot": "0x8b3ef5650c9eea2f608ad9c7cb73df3c289fc0ac72ed04f46e6ae4bce0a1f023" + } + }, + "challenges": { + "challenge:demo:001": { + "challengeId": "challenge:demo:001", + "challenger": "reviewer:local-demo", + "evidenceHash": "0xcc0312e21517151c7422f9b7c0c2ec611388eadfd89a07f6199adf617c4b461c", + "openedAtBlock": 1, + "reasonCode": "local-review", + "receiptId": "receipt:demo:001", + "resolution": "dismissed", + "resolvedAtBlock": 1, + "status": "resolved" + } + }, + "finalityReceipts": { + "finality:demo:001": { + "challengeCount": 1, + "finalityReceiptId": "finality:demo:001", + "finalityStatus": "finalized", + "finalizedAtBlock": 1, + "finalizedBy": "operator:local-demo", + "receiptId": "receipt:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "stateRoot": "0x5b55ae15cf9ff5f7c18f8dce05da5ed0f780e4103607819129ce09f1ed7744a7" + } + }, + "memoryCells": { + "memory:demo:agent-alpha:core": { + "agentId": "agent:demo:alpha", + "currentRoot": "0xf82cda830e2aa175d9813982009a59ec8a288b691a55205a22d7007fcc3a41ae", + "memoryCellId": "memory:demo:agent-alpha:core", + "memoryDeltaRoot": "0x6243c81a1bc56c93f5cebf081d9b69a8d7839bcd33384fe1d00c275d50f78de6", + "parentRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "rootfieldId": "rootfield:demo:alpha", + "sourceReceiptId": "receipt:demo:001", + "status": "active", + "updateCount": 1, + "updatedAtBlock": 1 + } + }, + "modelPassports": { + "model:demo:local-alpha": { + "active": true, + "issuer": "operator:local-demo", + "metadataHash": "0x18416ecbdfcad838d0008b3692e1505886a84e9c45fc6e029b29a3456befc234", + "modelFamily": "local-alpha-fixture-model", + "modelHash": "0xdeffd2a3fbb28dcc4dbb34172d082586bd0d63e1c76ab32296911946e6a7d0eb", + "modelPassportId": "model:demo:local-alpha" + } + }, + "rootfields": { + "rootfield:demo:alpha": { + "active": true, + "latestRoot": "0xbdb66f777635a2426a834652f8efee40db4f3e0b9ddd2af15f15fd065a7fe4f4", + "metadataHash": "0x514006e494877d3d6a69848ed6264b152ebe6b73b1112d8ff1b9b48860509a2f", + "owner": "operator:local-demo", + "pulseCount": 2, + "rootCount": 1, + "rootfieldId": "rootfield:demo:alpha", + "schemaHash": "0x5909a6dc30ffe1fcd89eebc118f6d2096c4d4c3ccdcc851dc0e4386fe997c6d7" + } + }, + "verifierModules": { + "verifier:local-demo": { + "active": true, + "metadataHash": "0x965eb2a0dfe118a94ded4ef151bf0fd970cd77350cd88d1b758b23fe0ffe2d14", + "moduleHash": "0x91830f85b951a7e7a1d99f48270faa05769561bd1f7ae34b783d759a35e833be", + "operator": "operator:local-demo", + "ruleSet": "flowmemory.work.rule_set.local_demo.v0", + "verifierId": "verifier:local-demo" + } + }, + "verifierReports": { + "report:demo:001": { + "reasonCodes": [], + "receiptId": "receipt:demo:001", + "reportDigest": "0xe75619ea62e7a6d9593debe0123d366ae0f0104cff86d9a69391fb5c1e074f4c", + "reportId": "report:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "status": "verified", + "verifierId": "verifier:local-demo" + } + }, + "workReceipts": { + "receipt:demo:001": { + "artifactCommitment": "0x4de1ac0e70ce73c0a03df255d1ea2a7bbcb40f05c60f1b0c1b73e0b4577c537a", + "inputRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "outputRoot": "0xbdb66f777635a2426a834652f8efee40db4f3e0b9ddd2af15f15fd065a7fe4f4", + "receiptId": "receipt:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "ruleSet": "flowmemory.work.rule_set.local_demo.v0", + "workerId": "worker:local-demo" + } + } + }, + "operatorKeyReferences": { + "operator-key:local-devnet:alpha": { + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ], + "keyReferenceId": "operator-key:local-devnet:alpha", + "operatorId": "0x06739c78255ec573518e97ffa9d2c5e11f49d49e0c65217c77d710a558a57f21", + "publicKeyHint": "local fixture boundary; no public key registry is implemented", + "schema": "flowmemory.local_devnet.operator_key_reference.v0", + "secretMaterialBoundary": "no signing secret material is stored in devnet state or handoff output", + "signatureScheme": "eip712-secp256k1-fixture-digest-only", + "verifierKeyId": "0xeaead587bf631e8926cf1a88ea5404f2211a339b77be7b9ffc08be420ce85551", + "verifierSetRoot": "0xbecddfb2cac22961206303e4f1255f58786e62503fbd54d875be915b68cc9635", + "workerKeyId": "0xc4cc0a4e778d201e59a442e969596ef8758fa62eb72c7ae4cb468c5493fc924d" + } + }, + "pendingTxs": [], + "schema": "flowmemory.control_plane_handoff.local_devnet.v0", + "stateRoot": "0x75373cc47666ed9bcad605ce0f5d0aeb1bc8100a1087840d755205aef8a6bb50" +} diff --git a/fixtures/launch-core/generated/devnet/dashboard-state.json b/fixtures/launch-core/generated/devnet/dashboard-state.json index ef04135f..62715539 100644 --- a/fixtures/launch-core/generated/devnet/dashboard-state.json +++ b/fixtures/launch-core/generated/devnet/dashboard-state.json @@ -1,4 +1,26 @@ { + "agentAccounts": { + "agent:demo:alpha": { + "active": true, + "agentId": "agent:demo:alpha", + "controller": "operator:local-demo", + "memoryRoot": "0xf82cda830e2aa175d9813982009a59ec8a288b691a55205a22d7007fcc3a41ae", + "metadataHash": "0x62348f90982ee812382bb97c0c6930e0e80583d0eeb40b4ae3c3395ca44cec1c", + "modelPassportId": "model:demo:local-alpha" + } + }, + "artifactAvailabilityProofs": { + "availability:demo:001": { + "artifactId": "artifact:demo:001", + "checkedAtBlock": 1, + "commitment": "0x4de1ac0e70ce73c0a03df255d1ea2a7bbcb40f05c60f1b0c1b73e0b4577c537a", + "proofDigest": "0xf5826d75505fd87288a6219067d4febfd25226cf6e70c85288317770b02d6527", + "proofId": "availability:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "status": "available", + "storageBackend": "fixture-local" + } + }, "artifactCommitments": { "artifact:demo:001": { "artifactId": "artifact:demo:001", @@ -8,21 +30,127 @@ } }, "baseAnchors": { - "0x08530e63dacb23a630bbbbd56ffc4dead54aca6d7e7ee7d920d7376eb9340ae7": { - "anchorId": "0x08530e63dacb23a630bbbbd56ffc4dead54aca6d7e7ee7d920d7376eb9340ae7", + "0x2e2c83de6aab8190d169ad3348c62ce0cf0d4dcd6e83932c7beda822b4736a64": { + "agentAccountRoot": "0xcf31230bfff347f79e19a55f4d1ff5fa486b0b1ad4754ce22b93de4b259a3ca7", + "anchorId": "0x2e2c83de6aab8190d169ad3348c62ce0cf0d4dcd6e83932c7beda822b4736a64", "appchainChainId": "flowmemory-local-devnet-v0", + "artifactAvailabilityProofRoot": "0xfb4b693c45014aae0947f35696e9d864e7b26ac6fd39c1df5edb3e0dcf9bd928", "artifactCommitmentRoot": "0xb772a9f7273032fd3ba2da8b6476d4715bbbafbd2a7eed21ecd0d558bde3beab", "blockRangeEnd": 1, "blockRangeStart": 1, + "challengeRoot": "0x16da3d2bf2dcd801bc5deb3987dc01342cb957031ad01408ea77bf5d1583656f", + "finalityReceiptRoot": "0x8b8f5ff0d8c0a2f799958098165e8a6ff3c8f822f57147d1e1e7d2199ae1e347", "finalityStatus": "local-placeholder", + "memoryCellRoot": "0x1b4e91099dd8d867201bd880437197ae6c031e538341aaa3cd2046e5706a2c25", + "modelPassportRoot": "0x326aa6b0b372d29d24d747fe0879adfd7aaea206373b24ae2ab77d56357e9529", + "operatorKeyReferenceRoot": "0x8457aa3ed0f4238834a8f3925f25ccca805828d8427c3ef67590a45659b22a40", "previousAnchorId": "0x0000000000000000000000000000000000000000000000000000000000000000", "rootfieldStateRoot": "0xb72a851dca1103410484e3272945bae5e87fc39b8f32f77d2991959b60d3bfbf", - "stateRoot": "0x76ec5260c34184b6bb54ca406a43fc1f9591a47f37f71583a7620ef4a4065aff", + "stateRoot": "0xd92ec8176ad55060b37898d4235612d0874ae5da6a5edbf69717b704c484e016", + "verifierModuleRoot": "0xd6ddd8a2d0f5812d64679656c69983a2e0aecd36bd36199d900245658ae4626c", "verifierReportRoot": "0x4facd21e55423e182eba87355482a35daa93f53190fbd3a8d2969f9d55bc5373", "workReceiptRoot": "0x8b3ef5650c9eea2f608ad9c7cb73df3c289fc0ac72ed04f46e6ae4bce0a1f023" } }, "blockHeight": 2, + "challenges": { + "challenge:demo:001": { + "challengeId": "challenge:demo:001", + "challenger": "reviewer:local-demo", + "evidenceHash": "0xcc0312e21517151c7422f9b7c0c2ec611388eadfd89a07f6199adf617c4b461c", + "openedAtBlock": 1, + "reasonCode": "local-review", + "receiptId": "receipt:demo:001", + "resolution": "dismissed", + "resolvedAtBlock": 1, + "status": "resolved" + } + }, + "finalityReceipts": { + "finality:demo:001": { + "challengeCount": 1, + "finalityReceiptId": "finality:demo:001", + "finalityStatus": "finalized", + "finalizedAtBlock": 1, + "finalizedBy": "operator:local-demo", + "receiptId": "receipt:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "stateRoot": "0x5b55ae15cf9ff5f7c18f8dce05da5ed0f780e4103607819129ce09f1ed7744a7" + } + }, + "genesisConfig": { + "blockTimeSeconds": 1, + "chainId": "flowmemory-local-devnet-v0", + "consensus": "single-process deterministic local block production", + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ], + "genesisHash": "0x0f23c892cbd2d00c10839d97ddab833698a83f8df8d6df27ceac03cfdd4b7bc9", + "genesisLogicalTime": 1778688000, + "networkId": "flowmemory-private-local", + "noValue": true, + "operatorKeyReferenceId": "operator-key:local-devnet:alpha", + "schema": "flowmemory.local_devnet.config.v0" + }, + "mapRoots": { + "agentAccountRoot": "0xcf31230bfff347f79e19a55f4d1ff5fa486b0b1ad4754ce22b93de4b259a3ca7", + "artifactAvailabilityProofRoot": "0xfb4b693c45014aae0947f35696e9d864e7b26ac6fd39c1df5edb3e0dcf9bd928", + "artifactCommitmentRoot": "0xb772a9f7273032fd3ba2da8b6476d4715bbbafbd2a7eed21ecd0d558bde3beab", + "baseAnchorRoot": "0xd61259ffaad6d352bd8f2e1b498c46b9d62b3c77ff22eeacd028bbb0cc66c5bd", + "challengeRoot": "0x16da3d2bf2dcd801bc5deb3987dc01342cb957031ad01408ea77bf5d1583656f", + "finalityReceiptRoot": "0x8b8f5ff0d8c0a2f799958098165e8a6ff3c8f822f57147d1e1e7d2199ae1e347", + "importedObservationRoot": "0x99cb1b939d5a09f800f72e4c5a2b92988571126e1f6f93549f4893b3f7de7880", + "importedVerifierReportRoot": "0x6070b1015f000dd509c7b276d2ad68d8a9d188ef1a961c2f573346eb75ea5ad7", + "memoryCellRoot": "0x1b4e91099dd8d867201bd880437197ae6c031e538341aaa3cd2046e5706a2c25", + "modelPassportRoot": "0x326aa6b0b372d29d24d747fe0879adfd7aaea206373b24ae2ab77d56357e9529", + "operatorKeyReferenceRoot": "0x8457aa3ed0f4238834a8f3925f25ccca805828d8427c3ef67590a45659b22a40", + "rootfieldStateRoot": "0xb72a851dca1103410484e3272945bae5e87fc39b8f32f77d2991959b60d3bfbf", + "verifierModuleRoot": "0xd6ddd8a2d0f5812d64679656c69983a2e0aecd36bd36199d900245658ae4626c", + "verifierReportRoot": "0x4facd21e55423e182eba87355482a35daa93f53190fbd3a8d2969f9d55bc5373", + "workReceiptRoot": "0x8b3ef5650c9eea2f608ad9c7cb73df3c289fc0ac72ed04f46e6ae4bce0a1f023" + }, + "memoryCells": { + "memory:demo:agent-alpha:core": { + "agentId": "agent:demo:alpha", + "currentRoot": "0xf82cda830e2aa175d9813982009a59ec8a288b691a55205a22d7007fcc3a41ae", + "memoryCellId": "memory:demo:agent-alpha:core", + "memoryDeltaRoot": "0x6243c81a1bc56c93f5cebf081d9b69a8d7839bcd33384fe1d00c275d50f78de6", + "parentRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "rootfieldId": "rootfield:demo:alpha", + "sourceReceiptId": "receipt:demo:001", + "status": "active", + "updateCount": 1, + "updatedAtBlock": 1 + } + }, + "modelPassports": { + "model:demo:local-alpha": { + "active": true, + "issuer": "operator:local-demo", + "metadataHash": "0x18416ecbdfcad838d0008b3692e1505886a84e9c45fc6e029b29a3456befc234", + "modelFamily": "local-alpha-fixture-model", + "modelHash": "0xdeffd2a3fbb28dcc4dbb34172d082586bd0d63e1c76ab32296911946e6a7d0eb", + "modelPassportId": "model:demo:local-alpha" + } + }, + "operatorKeyReferences": { + "operator-key:local-devnet:alpha": { + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ], + "keyReferenceId": "operator-key:local-devnet:alpha", + "operatorId": "0x06739c78255ec573518e97ffa9d2c5e11f49d49e0c65217c77d710a558a57f21", + "publicKeyHint": "local fixture boundary; no public key registry is implemented", + "schema": "flowmemory.local_devnet.operator_key_reference.v0", + "secretMaterialBoundary": "no signing secret material is stored in devnet state or handoff output", + "signatureScheme": "eip712-secp256k1-fixture-digest-only", + "verifierKeyId": "0xeaead587bf631e8926cf1a88ea5404f2211a339b77be7b9ffc08be420ce85551", + "verifierSetRoot": "0xbecddfb2cac22961206303e4f1255f58786e62503fbd54d875be915b68cc9635", + "workerKeyId": "0xc4cc0a4e778d201e59a442e969596ef8758fa62eb72c7ae4cb468c5493fc924d" + } + }, "rootfields": { "rootfield:demo:alpha": { "active": true, @@ -36,7 +164,17 @@ } }, "schema": "flowmemory.dashboard_state.local_devnet.v0", - "stateRoot": "0x3e1f5fddd84f9d460ee30a380ff700b17611891b8c03eb320edf1baefe003ef9", + "stateRoot": "0x75373cc47666ed9bcad605ce0f5d0aeb1bc8100a1087840d755205aef8a6bb50", + "verifierModules": { + "verifier:local-demo": { + "active": true, + "metadataHash": "0x965eb2a0dfe118a94ded4ef151bf0fd970cd77350cd88d1b758b23fe0ffe2d14", + "moduleHash": "0x91830f85b951a7e7a1d99f48270faa05769561bd1f7ae34b783d759a35e833be", + "operator": "operator:local-demo", + "ruleSet": "flowmemory.work.rule_set.local_demo.v0", + "verifierId": "verifier:local-demo" + } + }, "verifierReports": { "report:demo:001": { "reasonCodes": [], diff --git a/fixtures/launch-core/generated/devnet/genesis-config.json b/fixtures/launch-core/generated/devnet/genesis-config.json new file mode 100644 index 00000000..8294489c --- /dev/null +++ b/fixtures/launch-core/generated/devnet/genesis-config.json @@ -0,0 +1,15 @@ +{ + "schema": "flowmemory.local_devnet.config.v0", + "chainId": "flowmemory-local-devnet-v0", + "networkId": "flowmemory-private-local", + "genesisHash": "0x0f23c892cbd2d00c10839d97ddab833698a83f8df8d6df27ceac03cfdd4b7bc9", + "genesisLogicalTime": 1778688000, + "blockTimeSeconds": 1, + "operatorKeyReferenceId": "operator-key:local-devnet:alpha", + "noValue": true, + "consensus": "single-process deterministic local block production", + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ] +} diff --git a/fixtures/launch-core/generated/devnet/indexer-handoff.json b/fixtures/launch-core/generated/devnet/indexer-handoff.json index e8a78cfd..8e3e91b3 100644 --- a/fixtures/launch-core/generated/devnet/indexer-handoff.json +++ b/fixtures/launch-core/generated/devnet/indexer-handoff.json @@ -1,7 +1,29 @@ { + "agentAccounts": { + "agent:demo:alpha": { + "active": true, + "agentId": "agent:demo:alpha", + "controller": "operator:local-demo", + "memoryRoot": "0xf82cda830e2aa175d9813982009a59ec8a288b691a55205a22d7007fcc3a41ae", + "metadataHash": "0x62348f90982ee812382bb97c0c6930e0e80583d0eeb40b4ae3c3395ca44cec1c", + "modelPassportId": "model:demo:local-alpha" + } + }, + "artifactAvailabilityProofs": { + "availability:demo:001": { + "artifactId": "artifact:demo:001", + "checkedAtBlock": 1, + "commitment": "0x4de1ac0e70ce73c0a03df255d1ea2a7bbcb40f05c60f1b0c1b73e0b4577c537a", + "proofDigest": "0xf5826d75505fd87288a6219067d4febfd25226cf6e70c85288317770b02d6527", + "proofId": "availability:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "status": "available", + "storageBackend": "fixture-local" + } + }, "blocks": [ { - "blockHash": "0xf76ac3652230cae4a4b5afcd54b0dcec9219f20ad71e21c497264668fb30f235", + "blockHash": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", "blockNumber": 1, "logicalTime": 1778688000, "parentHash": "0x0f23c892cbd2d00c10839d97ddab833698a83f8df8d6df27ceac03cfdd4b7bc9", @@ -11,11 +33,31 @@ "status": "applied", "txId": "0x2cffda58c783dc026978b06a681587b19d9536ae4e158a69be855da1200f3189" }, + { + "error": null, + "status": "applied", + "txId": "0x75e63a0257621b8ef7412c6455a19d848996905e21f5ba79ccb0870d6e82eb25" + }, + { + "error": null, + "status": "applied", + "txId": "0x6f55c155425b968de01092be7d276f0c24430a2994910881938bc13c72f8892f" + }, + { + "error": null, + "status": "applied", + "txId": "0x05abb39c720d8ee1cd9253e32efaa595f5d5b2fcef4a908f61ab4a6bfa315359" + }, { "error": null, "status": "applied", "txId": "0xb9f435aceb1bedb86dce821743769b28c02a42002c9cd41f2df1ea0279462ab2" }, + { + "error": null, + "status": "applied", + "txId": "0x27aeba6c55c764222964764cb2bfbb69fb6fa56cb84714d6e98240ceb6e9d01d" + }, { "error": null, "status": "applied", @@ -30,23 +72,51 @@ "error": null, "status": "applied", "txId": "0x3ac0b196a212a0e77d0a0c4b60e2283d2994b09993971b95427996700f5b92aa" + }, + { + "error": null, + "status": "applied", + "txId": "0xda9d2574a0d4bec158e13623499c6efe6dddb76f838c5f06c3e4dc8457b67d3b" + }, + { + "error": null, + "status": "applied", + "txId": "0xa0729982b58cc701aba6af0bc29ca993190db4e8e1489af918dbe293c0c03bad" + }, + { + "error": null, + "status": "applied", + "txId": "0xf32e17d973089ae20766e2c6ec07d1511ddecd3f79803f6146a90df971ca814f" + }, + { + "error": null, + "status": "applied", + "txId": "0x514f9ef68c09de5a4dc80611d661d07a4ea3a4fae6000a43a25864489f354a81" } ], "schema": "flowmemory.local_devnet.block.v0", - "stateRoot": "0x76ec5260c34184b6bb54ca406a43fc1f9591a47f37f71583a7620ef4a4065aff", + "stateRoot": "0xd92ec8176ad55060b37898d4235612d0874ae5da6a5edbf69717b704c484e016", "txIds": [ "0x2cffda58c783dc026978b06a681587b19d9536ae4e158a69be855da1200f3189", + "0x75e63a0257621b8ef7412c6455a19d848996905e21f5ba79ccb0870d6e82eb25", + "0x6f55c155425b968de01092be7d276f0c24430a2994910881938bc13c72f8892f", + "0x05abb39c720d8ee1cd9253e32efaa595f5d5b2fcef4a908f61ab4a6bfa315359", "0xb9f435aceb1bedb86dce821743769b28c02a42002c9cd41f2df1ea0279462ab2", + "0x27aeba6c55c764222964764cb2bfbb69fb6fa56cb84714d6e98240ceb6e9d01d", "0xef6df43993478d8f14d609732c7260fa08861ecc17e74137b83beda8d50931d2", "0x73b81134901c2ce13e575f161d82a404c6f7cd1ef2e8ee17beb6697062175c46", - "0x3ac0b196a212a0e77d0a0c4b60e2283d2994b09993971b95427996700f5b92aa" + "0x3ac0b196a212a0e77d0a0c4b60e2283d2994b09993971b95427996700f5b92aa", + "0xda9d2574a0d4bec158e13623499c6efe6dddb76f838c5f06c3e4dc8457b67d3b", + "0xa0729982b58cc701aba6af0bc29ca993190db4e8e1489af918dbe293c0c03bad", + "0xf32e17d973089ae20766e2c6ec07d1511ddecd3f79803f6146a90df971ca814f", + "0x514f9ef68c09de5a4dc80611d661d07a4ea3a4fae6000a43a25864489f354a81" ] }, { - "blockHash": "0x7515374a9b020a6d271820031738a5190cb0fc374adcd74a88a32c0fd0d5c7a6", + "blockHash": "0x54ba8fe6b5d3781a91ebd45a2ab215dd51ff2f835afe1c72d1843384fffb3919", "blockNumber": 2, "logicalTime": 1778688001, - "parentHash": "0xf76ac3652230cae4a4b5afcd54b0dcec9219f20ad71e21c497264668fb30f235", + "parentHash": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", "receipts": [ { "error": null, @@ -55,13 +125,101 @@ } ], "schema": "flowmemory.local_devnet.block.v0", - "stateRoot": "0x3e1f5fddd84f9d460ee30a380ff700b17611891b8c03eb320edf1baefe003ef9", + "stateRoot": "0x75373cc47666ed9bcad605ce0f5d0aeb1bc8100a1087840d755205aef8a6bb50", "txIds": [ "0x8f719c880f17b5d4fb6d9efd54ac276d0dd8050d11c2c7870c36a79b66bc49d7" ] } ], + "challenges": { + "challenge:demo:001": { + "challengeId": "challenge:demo:001", + "challenger": "reviewer:local-demo", + "evidenceHash": "0xcc0312e21517151c7422f9b7c0c2ec611388eadfd89a07f6199adf617c4b461c", + "openedAtBlock": 1, + "reasonCode": "local-review", + "receiptId": "receipt:demo:001", + "resolution": "dismissed", + "resolvedAtBlock": 1, + "status": "resolved" + } + }, + "finalityReceipts": { + "finality:demo:001": { + "challengeCount": 1, + "finalityReceiptId": "finality:demo:001", + "finalityStatus": "finalized", + "finalizedAtBlock": 1, + "finalizedBy": "operator:local-demo", + "receiptId": "receipt:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "stateRoot": "0x5b55ae15cf9ff5f7c18f8dce05da5ed0f780e4103607819129ce09f1ed7744a7" + } + }, + "genesisConfig": { + "blockTimeSeconds": 1, + "chainId": "flowmemory-local-devnet-v0", + "consensus": "single-process deterministic local block production", + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ], + "genesisHash": "0x0f23c892cbd2d00c10839d97ddab833698a83f8df8d6df27ceac03cfdd4b7bc9", + "genesisLogicalTime": 1778688000, + "networkId": "flowmemory-private-local", + "noValue": true, + "operatorKeyReferenceId": "operator-key:local-devnet:alpha", + "schema": "flowmemory.local_devnet.config.v0" + }, "importedObservations": {}, + "mapRoots": { + "agentAccountRoot": "0xcf31230bfff347f79e19a55f4d1ff5fa486b0b1ad4754ce22b93de4b259a3ca7", + "artifactAvailabilityProofRoot": "0xfb4b693c45014aae0947f35696e9d864e7b26ac6fd39c1df5edb3e0dcf9bd928", + "artifactCommitmentRoot": "0xb772a9f7273032fd3ba2da8b6476d4715bbbafbd2a7eed21ecd0d558bde3beab", + "baseAnchorRoot": "0xd61259ffaad6d352bd8f2e1b498c46b9d62b3c77ff22eeacd028bbb0cc66c5bd", + "challengeRoot": "0x16da3d2bf2dcd801bc5deb3987dc01342cb957031ad01408ea77bf5d1583656f", + "finalityReceiptRoot": "0x8b8f5ff0d8c0a2f799958098165e8a6ff3c8f822f57147d1e1e7d2199ae1e347", + "importedObservationRoot": "0x99cb1b939d5a09f800f72e4c5a2b92988571126e1f6f93549f4893b3f7de7880", + "importedVerifierReportRoot": "0x6070b1015f000dd509c7b276d2ad68d8a9d188ef1a961c2f573346eb75ea5ad7", + "memoryCellRoot": "0x1b4e91099dd8d867201bd880437197ae6c031e538341aaa3cd2046e5706a2c25", + "modelPassportRoot": "0x326aa6b0b372d29d24d747fe0879adfd7aaea206373b24ae2ab77d56357e9529", + "operatorKeyReferenceRoot": "0x8457aa3ed0f4238834a8f3925f25ccca805828d8427c3ef67590a45659b22a40", + "rootfieldStateRoot": "0xb72a851dca1103410484e3272945bae5e87fc39b8f32f77d2991959b60d3bfbf", + "verifierModuleRoot": "0xd6ddd8a2d0f5812d64679656c69983a2e0aecd36bd36199d900245658ae4626c", + "verifierReportRoot": "0x4facd21e55423e182eba87355482a35daa93f53190fbd3a8d2969f9d55bc5373", + "workReceiptRoot": "0x8b3ef5650c9eea2f608ad9c7cb73df3c289fc0ac72ed04f46e6ae4bce0a1f023" + }, + "memoryCells": { + "memory:demo:agent-alpha:core": { + "agentId": "agent:demo:alpha", + "currentRoot": "0xf82cda830e2aa175d9813982009a59ec8a288b691a55205a22d7007fcc3a41ae", + "memoryCellId": "memory:demo:agent-alpha:core", + "memoryDeltaRoot": "0x6243c81a1bc56c93f5cebf081d9b69a8d7839bcd33384fe1d00c275d50f78de6", + "parentRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "rootfieldId": "rootfield:demo:alpha", + "sourceReceiptId": "receipt:demo:001", + "status": "active", + "updateCount": 1, + "updatedAtBlock": 1 + } + }, + "operatorKeyReferences": { + "operator-key:local-devnet:alpha": { + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ], + "keyReferenceId": "operator-key:local-devnet:alpha", + "operatorId": "0x06739c78255ec573518e97ffa9d2c5e11f49d49e0c65217c77d710a558a57f21", + "publicKeyHint": "local fixture boundary; no public key registry is implemented", + "schema": "flowmemory.local_devnet.operator_key_reference.v0", + "secretMaterialBoundary": "no signing secret material is stored in devnet state or handoff output", + "signatureScheme": "eip712-secp256k1-fixture-digest-only", + "verifierKeyId": "0xeaead587bf631e8926cf1a88ea5404f2211a339b77be7b9ffc08be420ce85551", + "verifierSetRoot": "0xbecddfb2cac22961206303e4f1255f58786e62503fbd54d875be915b68cc9635", + "workerKeyId": "0xc4cc0a4e778d201e59a442e969596ef8758fa62eb72c7ae4cb468c5493fc924d" + } + }, "schema": "flowmemory.indexer_handoff.local_devnet.v0", - "stateRoot": "0x3e1f5fddd84f9d460ee30a380ff700b17611891b8c03eb320edf1baefe003ef9" + "stateRoot": "0x75373cc47666ed9bcad605ce0f5d0aeb1bc8100a1087840d755205aef8a6bb50" } diff --git a/fixtures/launch-core/generated/devnet/operator-key-references.json b/fixtures/launch-core/generated/devnet/operator-key-references.json new file mode 100644 index 00000000..5abe94d7 --- /dev/null +++ b/fixtures/launch-core/generated/devnet/operator-key-references.json @@ -0,0 +1,17 @@ +{ + "operator-key:local-devnet:alpha": { + "schema": "flowmemory.local_devnet.operator_key_reference.v0", + "keyReferenceId": "operator-key:local-devnet:alpha", + "operatorId": "0x06739c78255ec573518e97ffa9d2c5e11f49d49e0c65217c77d710a558a57f21", + "workerKeyId": "0xc4cc0a4e778d201e59a442e969596ef8758fa62eb72c7ae4cb468c5493fc924d", + "verifierKeyId": "0xeaead587bf631e8926cf1a88ea5404f2211a339b77be7b9ffc08be420ce85551", + "verifierSetRoot": "0xbecddfb2cac22961206303e4f1255f58786e62503fbd54d875be915b68cc9635", + "signatureScheme": "eip712-secp256k1-fixture-digest-only", + "publicKeyHint": "local fixture boundary; no public key registry is implemented", + "secretMaterialBoundary": "no signing secret material is stored in devnet state or handoff output", + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ] + } +} diff --git a/fixtures/launch-core/generated/devnet/state.json b/fixtures/launch-core/generated/devnet/state.json index 56b211b6..643b655e 100644 --- a/fixtures/launch-core/generated/devnet/state.json +++ b/fixtures/launch-core/generated/devnet/state.json @@ -1,10 +1,42 @@ { "schema": "flowmemory.local_devnet.state.v0", + "config": { + "schema": "flowmemory.local_devnet.config.v0", + "chainId": "flowmemory-local-devnet-v0", + "networkId": "flowmemory-private-local", + "genesisHash": "0x0f23c892cbd2d00c10839d97ddab833698a83f8df8d6df27ceac03cfdd4b7bc9", + "genesisLogicalTime": 1778688000, + "blockTimeSeconds": 1, + "operatorKeyReferenceId": "operator-key:local-devnet:alpha", + "noValue": true, + "consensus": "single-process deterministic local block production", + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ] + }, "chainId": "flowmemory-local-devnet-v0", "genesisHash": "0x0f23c892cbd2d00c10839d97ddab833698a83f8df8d6df27ceac03cfdd4b7bc9", "nextBlockNumber": 3, "logicalTime": 1778688002, - "parentHash": "0x7515374a9b020a6d271820031738a5190cb0fc374adcd74a88a32c0fd0d5c7a6", + "parentHash": "0x54ba8fe6b5d3781a91ebd45a2ab215dd51ff2f835afe1c72d1843384fffb3919", + "operatorKeyReferences": { + "operator-key:local-devnet:alpha": { + "schema": "flowmemory.local_devnet.operator_key_reference.v0", + "keyReferenceId": "operator-key:local-devnet:alpha", + "operatorId": "0x06739c78255ec573518e97ffa9d2c5e11f49d49e0c65217c77d710a558a57f21", + "workerKeyId": "0xc4cc0a4e778d201e59a442e969596ef8758fa62eb72c7ae4cb468c5493fc924d", + "verifierKeyId": "0xeaead587bf631e8926cf1a88ea5404f2211a339b77be7b9ffc08be420ce85551", + "verifierSetRoot": "0xbecddfb2cac22961206303e4f1255f58786e62503fbd54d875be915b68cc9635", + "signatureScheme": "eip712-secp256k1-fixture-digest-only", + "publicKeyHint": "local fixture boundary; no public key registry is implemented", + "secretMaterialBoundary": "no signing secret material is stored in devnet state or handoff output", + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ] + } + }, "rootfields": { "rootfield:demo:alpha": { "rootfieldId": "rootfield:demo:alpha", @@ -17,6 +49,65 @@ "active": true } }, + "agentAccounts": { + "agent:demo:alpha": { + "agentId": "agent:demo:alpha", + "controller": "operator:local-demo", + "modelPassportId": "model:demo:local-alpha", + "metadataHash": "0x62348f90982ee812382bb97c0c6930e0e80583d0eeb40b4ae3c3395ca44cec1c", + "memoryRoot": "0xf82cda830e2aa175d9813982009a59ec8a288b691a55205a22d7007fcc3a41ae", + "active": true + } + }, + "modelPassports": { + "model:demo:local-alpha": { + "modelPassportId": "model:demo:local-alpha", + "issuer": "operator:local-demo", + "modelFamily": "local-alpha-fixture-model", + "modelHash": "0xdeffd2a3fbb28dcc4dbb34172d082586bd0d63e1c76ab32296911946e6a7d0eb", + "metadataHash": "0x18416ecbdfcad838d0008b3692e1505886a84e9c45fc6e029b29a3456befc234", + "active": true + } + }, + "memoryCells": { + "memory:demo:agent-alpha:core": { + "memoryCellId": "memory:demo:agent-alpha:core", + "agentId": "agent:demo:alpha", + "rootfieldId": "rootfield:demo:alpha", + "currentRoot": "0xf82cda830e2aa175d9813982009a59ec8a288b691a55205a22d7007fcc3a41ae", + "parentRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "sourceReceiptId": "receipt:demo:001", + "memoryDeltaRoot": "0x6243c81a1bc56c93f5cebf081d9b69a8d7839bcd33384fe1d00c275d50f78de6", + "status": "active", + "updateCount": 1, + "updatedAtBlock": 1 + } + }, + "challenges": { + "challenge:demo:001": { + "challengeId": "challenge:demo:001", + "receiptId": "receipt:demo:001", + "challenger": "reviewer:local-demo", + "evidenceHash": "0xcc0312e21517151c7422f9b7c0c2ec611388eadfd89a07f6199adf617c4b461c", + "reasonCode": "local-review", + "status": "resolved", + "resolution": "dismissed", + "openedAtBlock": 1, + "resolvedAtBlock": 1 + } + }, + "finalityReceipts": { + "finality:demo:001": { + "finalityReceiptId": "finality:demo:001", + "receiptId": "receipt:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "finalizedBy": "operator:local-demo", + "finalityStatus": "finalized", + "challengeCount": 1, + "finalizedAtBlock": 1, + "stateRoot": "0x5b55ae15cf9ff5f7c18f8dce05da5ed0f780e4103607819129ce09f1ed7744a7" + } + }, "artifactCommitments": { "artifact:demo:001": { "artifactId": "artifact:demo:001", @@ -25,6 +116,28 @@ "uriHint": "fixture://artifact/demo/001" } }, + "artifactAvailabilityProofs": { + "availability:demo:001": { + "proofId": "availability:demo:001", + "artifactId": "artifact:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "commitment": "0x4de1ac0e70ce73c0a03df255d1ea2a7bbcb40f05c60f1b0c1b73e0b4577c537a", + "proofDigest": "0xf5826d75505fd87288a6219067d4febfd25226cf6e70c85288317770b02d6527", + "storageBackend": "fixture-local", + "status": "available", + "checkedAtBlock": 1 + } + }, + "verifierModules": { + "verifier:local-demo": { + "verifierId": "verifier:local-demo", + "operator": "operator:local-demo", + "moduleHash": "0x91830f85b951a7e7a1d99f48270faa05769561bd1f7ae34b783d759a35e833be", + "ruleSet": "flowmemory.work.rule_set.local_demo.v0", + "metadataHash": "0x965eb2a0dfe118a94ded4ef151bf0fd970cd77350cd88d1b758b23fe0ffe2d14", + "active": true + } + }, "workReceipts": { "receipt:demo:001": { "receiptId": "receipt:demo:001", @@ -50,16 +163,24 @@ "importedObservations": {}, "importedVerifierReports": {}, "baseAnchors": { - "0x08530e63dacb23a630bbbbd56ffc4dead54aca6d7e7ee7d920d7376eb9340ae7": { - "anchorId": "0x08530e63dacb23a630bbbbd56ffc4dead54aca6d7e7ee7d920d7376eb9340ae7", + "0x2e2c83de6aab8190d169ad3348c62ce0cf0d4dcd6e83932c7beda822b4736a64": { + "anchorId": "0x2e2c83de6aab8190d169ad3348c62ce0cf0d4dcd6e83932c7beda822b4736a64", "appchainChainId": "flowmemory-local-devnet-v0", "blockRangeStart": 1, "blockRangeEnd": 1, - "stateRoot": "0x76ec5260c34184b6bb54ca406a43fc1f9591a47f37f71583a7620ef4a4065aff", + "stateRoot": "0xd92ec8176ad55060b37898d4235612d0874ae5da6a5edbf69717b704c484e016", "workReceiptRoot": "0x8b3ef5650c9eea2f608ad9c7cb73df3c289fc0ac72ed04f46e6ae4bce0a1f023", "verifierReportRoot": "0x4facd21e55423e182eba87355482a35daa93f53190fbd3a8d2969f9d55bc5373", "rootfieldStateRoot": "0xb72a851dca1103410484e3272945bae5e87fc39b8f32f77d2991959b60d3bfbf", "artifactCommitmentRoot": "0xb772a9f7273032fd3ba2da8b6476d4715bbbafbd2a7eed21ecd0d558bde3beab", + "operatorKeyReferenceRoot": "0x8457aa3ed0f4238834a8f3925f25ccca805828d8427c3ef67590a45659b22a40", + "agentAccountRoot": "0xcf31230bfff347f79e19a55f4d1ff5fa486b0b1ad4754ce22b93de4b259a3ca7", + "modelPassportRoot": "0x326aa6b0b372d29d24d747fe0879adfd7aaea206373b24ae2ab77d56357e9529", + "memoryCellRoot": "0x1b4e91099dd8d867201bd880437197ae6c031e538341aaa3cd2046e5706a2c25", + "challengeRoot": "0x16da3d2bf2dcd801bc5deb3987dc01342cb957031ad01408ea77bf5d1583656f", + "finalityReceiptRoot": "0x8b8f5ff0d8c0a2f799958098165e8a6ff3c8f822f57147d1e1e7d2199ae1e347", + "artifactAvailabilityProofRoot": "0xfb4b693c45014aae0947f35696e9d864e7b26ac6fd39c1df5edb3e0dcf9bd928", + "verifierModuleRoot": "0xd6ddd8a2d0f5812d64679656c69983a2e0aecd36bd36199d900245658ae4626c", "previousAnchorId": "0x0000000000000000000000000000000000000000000000000000000000000000", "finalityStatus": "local-placeholder" } @@ -72,10 +193,18 @@ "logicalTime": 1778688000, "txIds": [ "0x2cffda58c783dc026978b06a681587b19d9536ae4e158a69be855da1200f3189", + "0x75e63a0257621b8ef7412c6455a19d848996905e21f5ba79ccb0870d6e82eb25", + "0x6f55c155425b968de01092be7d276f0c24430a2994910881938bc13c72f8892f", + "0x05abb39c720d8ee1cd9253e32efaa595f5d5b2fcef4a908f61ab4a6bfa315359", "0xb9f435aceb1bedb86dce821743769b28c02a42002c9cd41f2df1ea0279462ab2", + "0x27aeba6c55c764222964764cb2bfbb69fb6fa56cb84714d6e98240ceb6e9d01d", "0xef6df43993478d8f14d609732c7260fa08861ecc17e74137b83beda8d50931d2", "0x73b81134901c2ce13e575f161d82a404c6f7cd1ef2e8ee17beb6697062175c46", - "0x3ac0b196a212a0e77d0a0c4b60e2283d2994b09993971b95427996700f5b92aa" + "0x3ac0b196a212a0e77d0a0c4b60e2283d2994b09993971b95427996700f5b92aa", + "0xda9d2574a0d4bec158e13623499c6efe6dddb76f838c5f06c3e4dc8457b67d3b", + "0xa0729982b58cc701aba6af0bc29ca993190db4e8e1489af918dbe293c0c03bad", + "0xf32e17d973089ae20766e2c6ec07d1511ddecd3f79803f6146a90df971ca814f", + "0x514f9ef68c09de5a4dc80611d661d07a4ea3a4fae6000a43a25864489f354a81" ], "receipts": [ { @@ -83,11 +212,31 @@ "status": "applied", "error": null }, + { + "txId": "0x75e63a0257621b8ef7412c6455a19d848996905e21f5ba79ccb0870d6e82eb25", + "status": "applied", + "error": null + }, + { + "txId": "0x6f55c155425b968de01092be7d276f0c24430a2994910881938bc13c72f8892f", + "status": "applied", + "error": null + }, + { + "txId": "0x05abb39c720d8ee1cd9253e32efaa595f5d5b2fcef4a908f61ab4a6bfa315359", + "status": "applied", + "error": null + }, { "txId": "0xb9f435aceb1bedb86dce821743769b28c02a42002c9cd41f2df1ea0279462ab2", "status": "applied", "error": null }, + { + "txId": "0x27aeba6c55c764222964764cb2bfbb69fb6fa56cb84714d6e98240ceb6e9d01d", + "status": "applied", + "error": null + }, { "txId": "0xef6df43993478d8f14d609732c7260fa08861ecc17e74137b83beda8d50931d2", "status": "applied", @@ -102,15 +251,35 @@ "txId": "0x3ac0b196a212a0e77d0a0c4b60e2283d2994b09993971b95427996700f5b92aa", "status": "applied", "error": null + }, + { + "txId": "0xda9d2574a0d4bec158e13623499c6efe6dddb76f838c5f06c3e4dc8457b67d3b", + "status": "applied", + "error": null + }, + { + "txId": "0xa0729982b58cc701aba6af0bc29ca993190db4e8e1489af918dbe293c0c03bad", + "status": "applied", + "error": null + }, + { + "txId": "0xf32e17d973089ae20766e2c6ec07d1511ddecd3f79803f6146a90df971ca814f", + "status": "applied", + "error": null + }, + { + "txId": "0x514f9ef68c09de5a4dc80611d661d07a4ea3a4fae6000a43a25864489f354a81", + "status": "applied", + "error": null } ], - "stateRoot": "0x76ec5260c34184b6bb54ca406a43fc1f9591a47f37f71583a7620ef4a4065aff", - "blockHash": "0xf76ac3652230cae4a4b5afcd54b0dcec9219f20ad71e21c497264668fb30f235" + "stateRoot": "0xd92ec8176ad55060b37898d4235612d0874ae5da6a5edbf69717b704c484e016", + "blockHash": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9" }, { "schema": "flowmemory.local_devnet.block.v0", "blockNumber": 2, - "parentHash": "0xf76ac3652230cae4a4b5afcd54b0dcec9219f20ad71e21c497264668fb30f235", + "parentHash": "0x1e6f848e67c93fcd23091891ec704f5ed58989956789acd3368bce883ad493f9", "logicalTime": 1778688001, "txIds": [ "0x8f719c880f17b5d4fb6d9efd54ac276d0dd8050d11c2c7870c36a79b66bc49d7" @@ -122,8 +291,8 @@ "error": null } ], - "stateRoot": "0x3e1f5fddd84f9d460ee30a380ff700b17611891b8c03eb320edf1baefe003ef9", - "blockHash": "0x7515374a9b020a6d271820031738a5190cb0fc374adcd74a88a32c0fd0d5c7a6" + "stateRoot": "0x75373cc47666ed9bcad605ce0f5d0aeb1bc8100a1087840d755205aef8a6bb50", + "blockHash": "0x54ba8fe6b5d3781a91ebd45a2ab215dd51ff2f835afe1c72d1843384fffb3919" } ], "pendingTxs": [] diff --git a/fixtures/launch-core/generated/devnet/verifier-handoff.json b/fixtures/launch-core/generated/devnet/verifier-handoff.json index 04220953..85687b7f 100644 --- a/fixtures/launch-core/generated/devnet/verifier-handoff.json +++ b/fixtures/launch-core/generated/devnet/verifier-handoff.json @@ -1,7 +1,103 @@ { + "artifactAvailabilityProofs": { + "availability:demo:001": { + "artifactId": "artifact:demo:001", + "checkedAtBlock": 1, + "commitment": "0x4de1ac0e70ce73c0a03df255d1ea2a7bbcb40f05c60f1b0c1b73e0b4577c537a", + "proofDigest": "0xf5826d75505fd87288a6219067d4febfd25226cf6e70c85288317770b02d6527", + "proofId": "availability:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "status": "available", + "storageBackend": "fixture-local" + } + }, + "challenges": { + "challenge:demo:001": { + "challengeId": "challenge:demo:001", + "challenger": "reviewer:local-demo", + "evidenceHash": "0xcc0312e21517151c7422f9b7c0c2ec611388eadfd89a07f6199adf617c4b461c", + "openedAtBlock": 1, + "reasonCode": "local-review", + "receiptId": "receipt:demo:001", + "resolution": "dismissed", + "resolvedAtBlock": 1, + "status": "resolved" + } + }, + "finalityReceipts": { + "finality:demo:001": { + "challengeCount": 1, + "finalityReceiptId": "finality:demo:001", + "finalityStatus": "finalized", + "finalizedAtBlock": 1, + "finalizedBy": "operator:local-demo", + "receiptId": "receipt:demo:001", + "rootfieldId": "rootfield:demo:alpha", + "stateRoot": "0x5b55ae15cf9ff5f7c18f8dce05da5ed0f780e4103607819129ce09f1ed7744a7" + } + }, + "genesisConfig": { + "blockTimeSeconds": 1, + "chainId": "flowmemory-local-devnet-v0", + "consensus": "single-process deterministic local block production", + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ], + "genesisHash": "0x0f23c892cbd2d00c10839d97ddab833698a83f8df8d6df27ceac03cfdd4b7bc9", + "genesisLogicalTime": 1778688000, + "networkId": "flowmemory-private-local", + "noValue": true, + "operatorKeyReferenceId": "operator-key:local-devnet:alpha", + "schema": "flowmemory.local_devnet.config.v0" + }, "importedVerifierReports": {}, + "mapRoots": { + "agentAccountRoot": "0xcf31230bfff347f79e19a55f4d1ff5fa486b0b1ad4754ce22b93de4b259a3ca7", + "artifactAvailabilityProofRoot": "0xfb4b693c45014aae0947f35696e9d864e7b26ac6fd39c1df5edb3e0dcf9bd928", + "artifactCommitmentRoot": "0xb772a9f7273032fd3ba2da8b6476d4715bbbafbd2a7eed21ecd0d558bde3beab", + "baseAnchorRoot": "0xd61259ffaad6d352bd8f2e1b498c46b9d62b3c77ff22eeacd028bbb0cc66c5bd", + "challengeRoot": "0x16da3d2bf2dcd801bc5deb3987dc01342cb957031ad01408ea77bf5d1583656f", + "finalityReceiptRoot": "0x8b8f5ff0d8c0a2f799958098165e8a6ff3c8f822f57147d1e1e7d2199ae1e347", + "importedObservationRoot": "0x99cb1b939d5a09f800f72e4c5a2b92988571126e1f6f93549f4893b3f7de7880", + "importedVerifierReportRoot": "0x6070b1015f000dd509c7b276d2ad68d8a9d188ef1a961c2f573346eb75ea5ad7", + "memoryCellRoot": "0x1b4e91099dd8d867201bd880437197ae6c031e538341aaa3cd2046e5706a2c25", + "modelPassportRoot": "0x326aa6b0b372d29d24d747fe0879adfd7aaea206373b24ae2ab77d56357e9529", + "operatorKeyReferenceRoot": "0x8457aa3ed0f4238834a8f3925f25ccca805828d8427c3ef67590a45659b22a40", + "rootfieldStateRoot": "0xb72a851dca1103410484e3272945bae5e87fc39b8f32f77d2991959b60d3bfbf", + "verifierModuleRoot": "0xd6ddd8a2d0f5812d64679656c69983a2e0aecd36bd36199d900245658ae4626c", + "verifierReportRoot": "0x4facd21e55423e182eba87355482a35daa93f53190fbd3a8d2969f9d55bc5373", + "workReceiptRoot": "0x8b3ef5650c9eea2f608ad9c7cb73df3c289fc0ac72ed04f46e6ae4bce0a1f023" + }, + "operatorKeyReferences": { + "operator-key:local-devnet:alpha": { + "cryptoSchemaRefs": [ + "crypto/FLOWMEMORY_CRYPTO_SPEC.md#domain-separation", + "crypto/ATTESTATIONS.md#local-signature-helpers" + ], + "keyReferenceId": "operator-key:local-devnet:alpha", + "operatorId": "0x06739c78255ec573518e97ffa9d2c5e11f49d49e0c65217c77d710a558a57f21", + "publicKeyHint": "local fixture boundary; no public key registry is implemented", + "schema": "flowmemory.local_devnet.operator_key_reference.v0", + "secretMaterialBoundary": "no signing secret material is stored in devnet state or handoff output", + "signatureScheme": "eip712-secp256k1-fixture-digest-only", + "verifierKeyId": "0xeaead587bf631e8926cf1a88ea5404f2211a339b77be7b9ffc08be420ce85551", + "verifierSetRoot": "0xbecddfb2cac22961206303e4f1255f58786e62503fbd54d875be915b68cc9635", + "workerKeyId": "0xc4cc0a4e778d201e59a442e969596ef8758fa62eb72c7ae4cb468c5493fc924d" + } + }, "schema": "flowmemory.verifier_handoff.local_devnet.v0", - "stateRoot": "0x3e1f5fddd84f9d460ee30a380ff700b17611891b8c03eb320edf1baefe003ef9", + "stateRoot": "0x75373cc47666ed9bcad605ce0f5d0aeb1bc8100a1087840d755205aef8a6bb50", + "verifierModules": { + "verifier:local-demo": { + "active": true, + "metadataHash": "0x965eb2a0dfe118a94ded4ef151bf0fd970cd77350cd88d1b758b23fe0ffe2d14", + "moduleHash": "0x91830f85b951a7e7a1d99f48270faa05769561bd1f7ae34b783d759a35e833be", + "operator": "operator:local-demo", + "ruleSet": "flowmemory.work.rule_set.local_demo.v0", + "verifierId": "verifier:local-demo" + } + }, "verifierReports": { "report:demo:001": { "reasonCodes": [], diff --git a/infra/scripts/flowchain-check-prereqs.ps1 b/infra/scripts/flowchain-check-prereqs.ps1 new file mode 100644 index 00000000..065d5d2a --- /dev/null +++ b/infra/scripts/flowchain-check-prereqs.ps1 @@ -0,0 +1,106 @@ +param( + [switch] $Strict +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +. "$PSScriptRoot\flowchain-common.ps1" + +$repoRoot = Set-FlowChainRepoRoot + +function Add-Check { + param( + [System.Collections.ArrayList] $Checks, + + [Parameter(Mandatory = $true)] + [string] $Name, + + [Parameter(Mandatory = $true)] + [string] $Command, + + [Parameter(Mandatory = $true)] + [bool] $Required, + + [string[]] $VersionArgs = @("--version") + ) + + $found = Get-Command $Command -ErrorAction SilentlyContinue + if (-not $found) { + [void] $Checks.Add([pscustomobject]@{ + Name = $Name + Required = $Required + Status = "missing" + Version = "" + NextStep = "Install $Name and reopen PowerShell." + }) + return + } + + $version = "" + try { + $version = (& $Command @VersionArgs 2>$null | Select-Object -First 1) + } + catch { + $version = "found" + } + + [void] $Checks.Add([pscustomobject]@{ + Name = $Name + Required = $Required + Status = "ok" + Version = $version + NextStep = "" + }) +} + +$checks = New-Object System.Collections.ArrayList +Add-Check -Checks $checks -Name "Git" -Command "git" -Required $true +Add-Check -Checks $checks -Name "Node.js" -Command "node" -Required $true +Add-Check -Checks $checks -Name "npm" -Command "npm" -Required $true +Add-Check -Checks $checks -Name "Rust cargo" -Command "cargo" -Required $true +Add-Check -Checks $checks -Name "Rust compiler" -Command "rustc" -Required $true +Add-Check -Checks $checks -Name "Foundry forge" -Command "forge" -Required $true +Add-Check -Checks $checks -Name "Python" -Command "python" -Required:$Strict + +Write-Host "" +Write-Host "== FlowChain Prerequisites ==" +$checks | Format-Table -AutoSize + +$requiredMissing = @($checks | Where-Object { $_.Required -and $_.Status -ne "ok" }) +if ($requiredMissing.Count -gt 0) { + throw "Missing required prerequisites: $($requiredMissing.Name -join ', ')" +} + +Write-Host "" +Write-Host "== Dependency Install State ==" +$dependencyRows = @( + [pscustomobject]@{ + Area = "root npm workspaces" + Path = "node_modules" + Status = if (Test-Path -LiteralPath (Join-Path $repoRoot "node_modules")) { "installed" } else { "missing" } + InstallCommand = "npm install" + }, + [pscustomobject]@{ + Area = "dashboard workbench" + Path = "apps/dashboard/node_modules" + Status = if (Test-Path -LiteralPath (Join-Path $repoRoot "apps/dashboard/node_modules")) { "installed" } else { "missing" } + InstallCommand = "npm install --prefix apps/dashboard" + }, + [pscustomobject]@{ + Area = "crypto package" + Path = "crypto/node_modules" + Status = if (Test-Path -LiteralPath (Join-Path $repoRoot "crypto/node_modules")) { "installed" } else { "missing" } + InstallCommand = "npm install --prefix crypto" + } +) +$dependencyRows | Format-Table -AutoSize + +$missingDeps = @($dependencyRows | Where-Object { $_.Status -ne "installed" }) +if ($Strict -and $missingDeps.Count -gt 0) { + throw "Missing installed dependencies. Run: $($missingDeps.InstallCommand -join '; ')" +} + +Write-Host "" +Write-Host "Next command on a clean second computer:" +Write-Host "npm run flowchain:init" diff --git a/infra/scripts/flowchain-common.ps1 b/infra/scripts/flowchain-common.ps1 new file mode 100644 index 00000000..bb7481d4 --- /dev/null +++ b/infra/scripts/flowchain-common.ps1 @@ -0,0 +1,200 @@ +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +function Get-FlowChainRepoRoot { + if (-not (Get-Command git -ErrorAction SilentlyContinue)) { + throw "git was not found on PATH." + } + + $root = (& git rev-parse --show-toplevel 2>$null).Trim() + if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace($root)) { + throw "Run this command from inside the FlowMemory Git repository." + } + + return $root +} + +function Set-FlowChainRepoRoot { + $root = Get-FlowChainRepoRoot + Set-Location -LiteralPath $root + return $root +} + +function Resolve-FlowChainPath { + param( + [Parameter(Mandatory = $true)] + [string] $Path, + + [Parameter(Mandatory = $true)] + [string] $RepoRoot + ) + + if ([System.IO.Path]::IsPathRooted($Path)) { + return [System.IO.Path]::GetFullPath($Path) + } + + return [System.IO.Path]::GetFullPath((Join-Path $RepoRoot $Path)) +} + +function Assert-FlowChainPathInsideRepo { + param( + [Parameter(Mandatory = $true)] + [string] $Path, + + [Parameter(Mandatory = $true)] + [string] $RepoRoot + ) + + $fullPath = [System.IO.Path]::GetFullPath($Path) + $fullRoot = [System.IO.Path]::GetFullPath($RepoRoot).TrimEnd( + [System.IO.Path]::DirectorySeparatorChar, + [System.IO.Path]::AltDirectorySeparatorChar + ) + $prefix = $fullRoot + [System.IO.Path]::DirectorySeparatorChar + + if ($fullPath -ne $fullRoot -and -not $fullPath.StartsWith($prefix, [System.StringComparison]::OrdinalIgnoreCase)) { + throw "Refusing to use path outside repository: $fullPath" + } + + return $fullPath +} + +function Invoke-FlowChainCommand { + param( + [Parameter(Mandatory = $true)] + [string] $Label, + + [Parameter(Mandatory = $true)] + [string] $FilePath, + + [string[]] $ArgumentList = @() + ) + + Write-Host "" + Write-Host "== $Label ==" + & $FilePath @ArgumentList + if ($LASTEXITCODE -ne 0) { + throw "$Label failed with exit code $LASTEXITCODE." + } +} + +function Set-FlowChainCargoTargetDir { + param( + [Parameter(Mandatory = $true)] + [string] $RepoRoot + ) + + $targetDir = Join-Path $RepoRoot "crates/flowmemory-devnet/target" + $env:CARGO_TARGET_DIR = $targetDir + return $targetDir +} + +function Write-FlowChainJson { + param( + [Parameter(Mandatory = $true)] + [string] $Path, + + [Parameter(Mandatory = $true)] + [object] $Value, + + [int] $Depth = 12 + ) + + $parent = Split-Path -Parent $Path + if (-not [string]::IsNullOrWhiteSpace($parent)) { + New-Item -ItemType Directory -Force -Path $parent | Out-Null + } + + $body = $Value | ConvertTo-Json -Depth $Depth + Set-Content -LiteralPath $Path -Value $body -Encoding UTF8 +} + +function Assert-FlowChainNoSecretText { + param( + [Parameter(Mandatory = $true)] + [string] $Text, + + [Parameter(Mandatory = $true)] + [string] $Label + ) + + $patterns = @( + "privateKey", + "private_key", + "seedPhrase", + "seed phrase", + "mnemonic", + "rpcUrl", + "rpc-url", + "apiKey", + "webhook", + "BEGIN RSA PRIVATE KEY", + "BEGIN OPENSSH PRIVATE KEY" + ) + + foreach ($pattern in $patterns) { + if ($Text.IndexOf($pattern, [System.StringComparison]::OrdinalIgnoreCase) -ge 0) { + throw "Potential secret marker '$pattern' found in $Label." + } + } +} + +function Assert-FlowChainNoSecretFiles { + param( + [Parameter(Mandatory = $true)] + [string] $Path + ) + + if (-not (Test-Path -LiteralPath $Path)) { + throw "Cannot scan missing path: $Path" + } + + $item = Get-Item -LiteralPath $Path + $files = @() + if ($item.PSIsContainer) { + $files = Get-ChildItem -LiteralPath $Path -Recurse -File | Where-Object { + $_.Extension -in @(".json", ".txt", ".md", ".env") + } + } + else { + $files = @($item) + } + + foreach ($file in $files) { + $text = Get-Content -Raw -LiteralPath $file.FullName + Assert-FlowChainNoSecretText -Text $text -Label $file.FullName + } +} + +function New-FlowChainLocalOperator { + param( + [Parameter(Mandatory = $true)] + [string] $OperatorPath, + + [switch] $Force + ) + + if ((Test-Path -LiteralPath $OperatorPath) -and -not $Force) { + Write-Host "Local operator file already exists: $OperatorPath" + return + } + + $bytes = New-Object byte[] 32 + [System.Security.Cryptography.RandomNumberGenerator]::Create().GetBytes($bytes) + $hex = "0x" + (($bytes | ForEach-Object { $_.ToString("x2") }) -join "") + $publicIdInput = [System.Text.Encoding]::UTF8.GetBytes("flowchain-local-operator:" + $hex) + $sha = [System.Security.Cryptography.SHA256]::Create() + $operatorId = "local-operator:" + (($sha.ComputeHash($publicIdInput) | ForEach-Object { $_.ToString("x2") }) -join "") + + $operator = [ordered]@{ + schema = "flowchain.local_operator.v0" + operatorId = $operatorId + keyKind = "local-dev-only" + generatedAt = (Get-Date).ToUniversalTime().ToString("o") + localPrivateKeyHex = $hex + warning = "Generated for private/local second-computer validation only. Do not commit this file." + } + + Write-FlowChainJson -Path $OperatorPath -Value $operator + Write-Host "Wrote local-only operator file: $OperatorPath" +} diff --git a/infra/scripts/flowchain-demo.ps1 b/infra/scripts/flowchain-demo.ps1 new file mode 100644 index 00000000..6ab6e8ad --- /dev/null +++ b/infra/scripts/flowchain-demo.ps1 @@ -0,0 +1,39 @@ +param( + [string] $StatePath = "devnet/local/state.json", + [string] $OutDir = "devnet/local/handoff/generated", + [switch] $SkipLaunchCore +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +. "$PSScriptRoot\flowchain-common.ps1" + +$repoRoot = Set-FlowChainRepoRoot +Set-FlowChainCargoTargetDir -RepoRoot $repoRoot | Out-Null +$stateFullPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path $StatePath) +$outFullPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path $OutDir) + +if (-not $SkipLaunchCore) { + Invoke-FlowChainCommand -Label "Generate launch-core fixtures" -FilePath "npm" -ArgumentList @("run", "launch:v0") +} + +Invoke-FlowChainCommand -Label "Run deterministic FlowChain local demo" -FilePath "cargo" -ArgumentList @( + "run", + "--manifest-path", + "crates/flowmemory-devnet/Cargo.toml", + "--", + "--state", + $stateFullPath, + "demo", + "--out-dir", + $outFullPath +) + +Assert-FlowChainNoSecretFiles -Path $outFullPath + +Write-Host "" +Write-Host "FlowChain local demo complete." +Write-Host "State: $stateFullPath" +Write-Host "Handoff export: $outFullPath" +Write-Host "Next command: npm run flowchain:export" diff --git a/infra/scripts/flowchain-export.ps1 b/infra/scripts/flowchain-export.ps1 new file mode 100644 index 00000000..de2b5e18 --- /dev/null +++ b/infra/scripts/flowchain-export.ps1 @@ -0,0 +1,64 @@ +param( + [string] $StatePath = "devnet/local/state.json", + [string] $OutDir = "devnet/local/export/latest", + [string] $BundlePath = "devnet/local/export/flowchain-local-state.zip", + [switch] $NoZip +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +. "$PSScriptRoot\flowchain-common.ps1" + +$repoRoot = Set-FlowChainRepoRoot +Set-FlowChainCargoTargetDir -RepoRoot $repoRoot | Out-Null +$stateFullPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path $StatePath) +$outFullPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path $OutDir) +$bundleFullPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path $BundlePath) + +if (-not (Test-Path -LiteralPath $stateFullPath)) { + throw "State file does not exist. Run npm run flowchain:init or npm run flowchain:demo first." +} + +Invoke-FlowChainCommand -Label "Export devnet handoff fixtures" -FilePath "cargo" -ArgumentList @( + "run", + "--manifest-path", + "crates/flowmemory-devnet/Cargo.toml", + "--", + "--state", + $stateFullPath, + "export-fixtures", + "--out-dir", + $outFullPath +) + +$manifestPath = Join-Path $outFullPath "export-manifest.json" +$manifest = [ordered]@{ + schema = "flowchain.private_testnet.export_manifest.v0" + exportedAt = (Get-Date).ToUniversalTime().ToString("o") + sourceStatePath = $stateFullPath + outDir = $outFullPath + includesPrivateOperatorKey = $false + files = @( + "dashboard-state.json", + "indexer-handoff.json", + "verifier-handoff.json", + "state.json" + ) +} +Write-FlowChainJson -Path $manifestPath -Value $manifest +Assert-FlowChainNoSecretFiles -Path $outFullPath + +if (-not $NoZip) { + $bundleParent = Split-Path -Parent $bundleFullPath + New-Item -ItemType Directory -Force -Path $bundleParent | Out-Null + if (Test-Path -LiteralPath $bundleFullPath) { + Remove-Item -LiteralPath $bundleFullPath -Force + } + Compress-Archive -Path (Join-Path $outFullPath "*") -DestinationPath $bundleFullPath -Force + Write-Host "Bundle: $bundleFullPath" +} + +Write-Host "" +Write-Host "FlowChain local state export complete." +Write-Host "Export directory: $outFullPath" diff --git a/infra/scripts/flowchain-import.ps1 b/infra/scripts/flowchain-import.ps1 new file mode 100644 index 00000000..0e2081ec --- /dev/null +++ b/infra/scripts/flowchain-import.ps1 @@ -0,0 +1,59 @@ +param( + [Parameter(Mandatory = $true)] + [string] $BundlePath, + + [string] $StatePath = "devnet/local/state.json", + [string] $ImportDir = "devnet/local/imported", + [switch] $Force +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +. "$PSScriptRoot\flowchain-common.ps1" + +$repoRoot = Set-FlowChainRepoRoot +Set-FlowChainCargoTargetDir -RepoRoot $repoRoot | Out-Null +$bundleFullPath = Resolve-FlowChainPath -RepoRoot $repoRoot -Path $BundlePath +$stateFullPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path $StatePath) +$importFullPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path $ImportDir) + +if (-not (Test-Path -LiteralPath $bundleFullPath)) { + throw "Import bundle does not exist: $bundleFullPath" +} + +if ((Test-Path -LiteralPath $stateFullPath) -and -not $Force) { + throw "State file already exists. Rerun with -Force to replace it from the import bundle." +} + +if (Test-Path -LiteralPath $importFullPath) { + Remove-Item -LiteralPath $importFullPath -Recurse -Force +} +New-Item -ItemType Directory -Force -Path $importFullPath | Out-Null + +Expand-Archive -LiteralPath $bundleFullPath -DestinationPath $importFullPath -Force +$importedState = Join-Path $importFullPath "state.json" +if (-not (Test-Path -LiteralPath $importedState)) { + throw "Import bundle did not contain state.json." +} + +Assert-FlowChainNoSecretFiles -Path $importFullPath +$stateParent = Split-Path -Parent $stateFullPath +New-Item -ItemType Directory -Force -Path $stateParent | Out-Null +Copy-Item -LiteralPath $importedState -Destination $stateFullPath -Force + +Invoke-FlowChainCommand -Label "Inspect imported devnet state" -FilePath "cargo" -ArgumentList @( + "run", + "--manifest-path", + "crates/flowmemory-devnet/Cargo.toml", + "--", + "--state", + $stateFullPath, + "inspect-state", + "--summary" +) + +Write-Host "" +Write-Host "FlowChain local state import complete." +Write-Host "State: $stateFullPath" +Write-Host "Next command: npm run flowchain:start" diff --git a/infra/scripts/flowchain-init.ps1 b/infra/scripts/flowchain-init.ps1 new file mode 100644 index 00000000..0c8d4630 --- /dev/null +++ b/infra/scripts/flowchain-init.ps1 @@ -0,0 +1,73 @@ +param( + [string] $StatePath = "devnet/local/state.json", + [string] $OperatorPath = "devnet/local/operator.local.json", + [string] $ImportOperatorKeyPath = "", + [switch] $Force +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +. "$PSScriptRoot\flowchain-common.ps1" + +$repoRoot = Set-FlowChainRepoRoot +Set-FlowChainCargoTargetDir -RepoRoot $repoRoot | Out-Null +$stateFullPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path $StatePath) +$operatorFullPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path $OperatorPath) +$manifestPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path "devnet/local/flowchain-init-manifest.json") + +if ((Test-Path -LiteralPath $stateFullPath) -and -not $Force) { + Write-Host "State already exists: $stateFullPath" + Write-Host "Use npm run flowchain:demo or rerun this script with -Force to reset to genesis." +} +else { + Invoke-FlowChainCommand -Label "Initialize deterministic local genesis" -FilePath "cargo" -ArgumentList @( + "run", + "--manifest-path", + "crates/flowmemory-devnet/Cargo.toml", + "--", + "--state", + $stateFullPath, + "init" + ) +} + +if (-not [string]::IsNullOrWhiteSpace($ImportOperatorKeyPath)) { + $importFullPath = Resolve-FlowChainPath -RepoRoot $repoRoot -Path $ImportOperatorKeyPath + if (-not (Test-Path -LiteralPath $importFullPath)) { + throw "Import operator key file does not exist: $importFullPath" + } + if ((Test-Path -LiteralPath $operatorFullPath) -and -not $Force) { + throw "Operator file already exists. Rerun with -Force to replace it." + } + $operatorParent = Split-Path -Parent $operatorFullPath + New-Item -ItemType Directory -Force -Path $operatorParent | Out-Null + Copy-Item -LiteralPath $importFullPath -Destination $operatorFullPath -Force:$Force + Write-Host "Imported local-only operator file: $operatorFullPath" +} +else { + New-FlowChainLocalOperator -OperatorPath $operatorFullPath -Force:$Force +} + +$manifest = [ordered]@{ + schema = "flowchain.private_testnet.init_manifest.v0" + generatedAt = (Get-Date).ToUniversalTime().ToString("o") + statePath = $stateFullPath + operatorPath = $operatorFullPath + runtime = "crates/flowmemory-devnet" + mode = "private-local-second-computer" + productionUse = $false + nextCommands = @( + "npm run flowchain:start", + "npm run flowchain:demo", + "npm run flowchain:smoke", + "npm run workbench:dev" + ) +} +Write-FlowChainJson -Path $manifestPath -Value $manifest + +Write-Host "" +Write-Host "FlowChain private/local init complete." +Write-Host "State: $stateFullPath" +Write-Host "Local-only operator file: $operatorFullPath" +Write-Host "Next command: npm run flowchain:start" diff --git a/infra/scripts/flowchain-smoke.ps1 b/infra/scripts/flowchain-smoke.ps1 new file mode 100644 index 00000000..b4972d87 --- /dev/null +++ b/infra/scripts/flowchain-smoke.ps1 @@ -0,0 +1,127 @@ +param( + [switch] $SkipDashboardBuild, + [switch] $SkipHardware +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +. "$PSScriptRoot\flowchain-common.ps1" + +$repoRoot = Set-FlowChainRepoRoot +Set-FlowChainCargoTargetDir -RepoRoot $repoRoot | Out-Null +$smokeRoot = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path "devnet/local/smoke") + +& powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $PSScriptRoot "flowchain-check-prereqs.ps1") -Strict +if ($LASTEXITCODE -ne 0) { + throw "Prerequisite check failed." +} + +if (Test-Path -LiteralPath $smokeRoot) { + Remove-Item -LiteralPath $smokeRoot -Recurse -Force +} +New-Item -ItemType Directory -Force -Path $smokeRoot | Out-Null + +Invoke-FlowChainCommand -Label "Run service tests" -FilePath "npm" -ArgumentList @("test") +Invoke-FlowChainCommand -Label "Run crypto tests" -FilePath "npm" -ArgumentList @("test", "--prefix", "crypto") +Invoke-FlowChainCommand -Label "Validate crypto vectors" -FilePath "npm" -ArgumentList @("run", "validate:vectors", "--prefix", "crypto") +Invoke-FlowChainCommand -Label "Run launch candidate gate" -FilePath "npm" -ArgumentList @("run", "launch:candidate") +Invoke-FlowChainCommand -Label "Run devnet tests" -FilePath "cargo" -ArgumentList @("test", "--manifest-path", "crates/flowmemory-devnet/Cargo.toml") + +$runAState = Join-Path $smokeRoot "run-a/state.json" +$runAOut = Join-Path $smokeRoot "run-a/export" +$runBState = Join-Path $smokeRoot "run-b/state.json" +$runBOut = Join-Path $smokeRoot "run-b/export" + +Invoke-FlowChainCommand -Label "Run deterministic demo A" -FilePath "cargo" -ArgumentList @( + "run", + "--manifest-path", + "crates/flowmemory-devnet/Cargo.toml", + "--", + "--state", + $runAState, + "demo", + "--out-dir", + $runAOut +) +Invoke-FlowChainCommand -Label "Run deterministic demo B" -FilePath "cargo" -ArgumentList @( + "run", + "--manifest-path", + "crates/flowmemory-devnet/Cargo.toml", + "--", + "--state", + $runBState, + "demo", + "--out-dir", + $runBOut +) + +$runADashboard = Get-Content -Raw -LiteralPath (Join-Path $runAOut "dashboard-state.json") | ConvertFrom-Json +$runBDashboard = Get-Content -Raw -LiteralPath (Join-Path $runBOut "dashboard-state.json") | ConvertFrom-Json +if ($runADashboard.stateRoot -ne $runBDashboard.stateRoot) { + throw "Deterministic replay failed. State roots differ: $($runADashboard.stateRoot) vs $($runBDashboard.stateRoot)" +} + +Assert-FlowChainNoSecretFiles -Path $runAOut +Assert-FlowChainNoSecretFiles -Path $runBOut + +if (-not $SkipDashboardBuild) { + & powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $PSScriptRoot "flowchain-workbench.ps1") -BuildOnly + if ($LASTEXITCODE -ne 0) { + throw "Workbench build failed." + } +} + +if (-not $SkipHardware) { + Invoke-FlowChainCommand -Label "Validate FlowRouter simulator fixture" -FilePath "python" -ArgumentList @( + "hardware/simulator/flowrouter_sim.py", + "--validate-file", + "hardware/fixtures/flowrouter_sample_seed42.json" + ) +} + +Invoke-FlowChainCommand -Label "Check unsafe launch claims" -FilePath "node" -ArgumentList @("infra/scripts/check-unsafe-claims.mjs") + +$reportPath = Join-Path $smokeRoot "flowchain-smoke-report.json" +$report = [ordered]@{ + schema = "flowchain.private_testnet.smoke_report.v0" + generatedAt = (Get-Date).ToUniversalTime().ToString("o") + stateRoot = $runADashboard.stateRoot + deterministicReplay = $true + runAExport = $runAOut + runBExport = $runBOut + launchCandidate = "passed" + devnetTests = "passed" + serviceTests = "passed" + cryptoTests = "passed" + cryptoVectors = "passed" + dashboardBuild = $(if ($SkipDashboardBuild) { "skipped" } else { "passed" }) + hardwareFixture = $(if ($SkipHardware) { "skipped" } else { "passed" }) + noSecretExportScan = "passed" + currentLifecycleCoverage = @( + "rootfield namespace", + "root commitment", + "artifact commitment", + "work receipt", + "verifier report", + "local finality placeholder export", + "launch-core Flow Memory objects" + ) + blockedLifecycleCoverage = @( + "AgentAccount", + "ModelPassport", + "ArtifactAvailabilityProof as native object", + "VerifierModule", + "MemoryCell", + "Challenge", + "FinalityReceipt as native object", + "control-plane query evidence" + ) +} +Write-FlowChainJson -Path $reportPath -Value $report + +Write-Host "" +Write-Host "FlowChain private/local smoke passed for merged surfaces." +Write-Host "Deterministic state root: $($runADashboard.stateRoot)" +Write-Host "Smoke report: $reportPath" +Write-Host "Known remaining lifecycle gaps are recorded in docs/FLOWCHAIN_TESTNET_ACCEPTANCE.md." diff --git a/infra/scripts/flowchain-start.ps1 b/infra/scripts/flowchain-start.ps1 new file mode 100644 index 00000000..4bafab1f --- /dev/null +++ b/infra/scripts/flowchain-start.ps1 @@ -0,0 +1,56 @@ +param( + [string] $StatePath = "devnet/local/state.json", + [switch] $SkipLaunchCore +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +. "$PSScriptRoot\flowchain-common.ps1" + +$repoRoot = Set-FlowChainRepoRoot +Set-FlowChainCargoTargetDir -RepoRoot $repoRoot | Out-Null +$stateFullPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path $StatePath) +$statusPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path "devnet/local/flowchain-stack-status.json") + +if (-not (Test-Path -LiteralPath $stateFullPath)) { + Write-Host "No local state found. Initializing first." + & powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $PSScriptRoot "flowchain-init.ps1") -StatePath $stateFullPath + if ($LASTEXITCODE -ne 0) { + throw "flowchain-init failed." + } +} + +if (-not $SkipLaunchCore) { + Invoke-FlowChainCommand -Label "Generate launch-core fixtures" -FilePath "npm" -ArgumentList @("run", "launch:v0") +} + +Invoke-FlowChainCommand -Label "Inspect local devnet state" -FilePath "cargo" -ArgumentList @( + "run", + "--manifest-path", + "crates/flowmemory-devnet/Cargo.toml", + "--", + "--state", + $stateFullPath, + "inspect-state", + "--summary" +) + +$status = [ordered]@{ + schema = "flowchain.private_testnet.stack_status.v0" + status = "started" + startedAt = (Get-Date).ToUniversalTime().ToString("o") + statePath = $stateFullPath + runtimeMode = "bounded-local-cli" + longRunningNode = $false + launchCoreGenerated = -not $SkipLaunchCore + workbenchCommand = "npm run workbench:dev" + smokeCommand = "npm run flowchain:smoke" + note = "Current merged runtime is a deterministic local CLI, not a daemon. Keep this file as operator state for the second-computer package." +} +Write-FlowChainJson -Path $statusPath -Value $status + +Write-Host "" +Write-Host "FlowChain private/local stack is ready in bounded local CLI mode." +Write-Host "Next command for a transaction demo: npm run flowchain:demo" +Write-Host "Workbench command: npm run workbench:dev" diff --git a/infra/scripts/flowchain-stop.ps1 b/infra/scripts/flowchain-stop.ps1 new file mode 100644 index 00000000..980b8a56 --- /dev/null +++ b/infra/scripts/flowchain-stop.ps1 @@ -0,0 +1,44 @@ +param( + [string] $StatePath = "devnet/local/state.json", + [switch] $ResetLocalState +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +. "$PSScriptRoot\flowchain-common.ps1" + +$repoRoot = Set-FlowChainRepoRoot +Set-FlowChainCargoTargetDir -RepoRoot $repoRoot | Out-Null +$stateFullPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path $StatePath) +$statusPath = Assert-FlowChainPathInsideRepo -RepoRoot $repoRoot -Path (Resolve-FlowChainPath -RepoRoot $repoRoot -Path "devnet/local/flowchain-stack-status.json") + +if ($ResetLocalState) { + Invoke-FlowChainCommand -Label "Reset local devnet state" -FilePath "cargo" -ArgumentList @( + "run", + "--manifest-path", + "crates/flowmemory-devnet/Cargo.toml", + "--", + "--state", + $stateFullPath, + "reset-local" + ) +} + +$status = [ordered]@{ + schema = "flowchain.private_testnet.stack_status.v0" + status = "stopped" + stoppedAt = (Get-Date).ToUniversalTime().ToString("o") + statePath = $stateFullPath + resetLocalState = [bool] $ResetLocalState + note = "No long-running private/local node process is merged yet. Stop records operator state and can reset the ignored local devnet state when explicitly requested." +} +Write-FlowChainJson -Path $statusPath -Value $status + +Write-Host "FlowChain private/local stack marked stopped." +if ($ResetLocalState) { + Write-Host "Local state was reset to deterministic genesis." +} +else { + Write-Host "Local state was preserved. Use -ResetLocalState for a clean reset." +} diff --git a/infra/scripts/flowchain-workbench.ps1 b/infra/scripts/flowchain-workbench.ps1 new file mode 100644 index 00000000..727679c1 --- /dev/null +++ b/infra/scripts/flowchain-workbench.ps1 @@ -0,0 +1,27 @@ +param( + [switch] $BuildOnly +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version Latest + +. "$PSScriptRoot\flowchain-common.ps1" + +$repoRoot = Set-FlowChainRepoRoot +$dashboardModules = Join-Path $repoRoot "apps/dashboard/node_modules" +if (-not (Test-Path -LiteralPath $dashboardModules)) { + throw "Dashboard dependencies are missing. Run: npm install --prefix apps/dashboard" +} + +if ($BuildOnly) { + Invoke-FlowChainCommand -Label "Build FlowChain workbench" -FilePath "npm" -ArgumentList @("run", "build", "--prefix", "apps/dashboard") + Write-Host "Workbench build complete." + return +} + +Write-Host "Starting the existing dashboard as the FlowChain local workbench." +Write-Host "The Vite server will print the local URL, usually http://127.0.0.1:5173/." +Write-Host "Press Ctrl+C in this PowerShell window to stop it." + +Invoke-FlowChainCommand -Label "Start FlowChain workbench" -FilePath "npm" -ArgumentList @("run", "dev", "--prefix", "apps/dashboard") + diff --git a/package.json b/package.json index 2e194da5..b8b8de33 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,15 @@ "fixtures:check": "npm run fixtures:check --prefix services/flowmemory", "launch:candidate": "npm run contracts:hardening && npm run launch:v0 && npm run validate:launch && npm run fixtures:check && node infra/scripts/check-unsafe-claims.mjs", "build:production": "npm run launch:candidate && npm run build --prefix apps/dashboard", + "flowchain:prereq": "powershell -NoProfile -ExecutionPolicy Bypass -File infra/scripts/flowchain-check-prereqs.ps1", + "flowchain:init": "powershell -NoProfile -ExecutionPolicy Bypass -File infra/scripts/flowchain-init.ps1", + "flowchain:start": "powershell -NoProfile -ExecutionPolicy Bypass -File infra/scripts/flowchain-start.ps1", + "flowchain:stop": "powershell -NoProfile -ExecutionPolicy Bypass -File infra/scripts/flowchain-stop.ps1", + "flowchain:demo": "powershell -NoProfile -ExecutionPolicy Bypass -File infra/scripts/flowchain-demo.ps1", + "flowchain:smoke": "powershell -NoProfile -ExecutionPolicy Bypass -File infra/scripts/flowchain-smoke.ps1", + "flowchain:export": "powershell -NoProfile -ExecutionPolicy Bypass -File infra/scripts/flowchain-export.ps1", + "flowchain:import": "powershell -NoProfile -ExecutionPolicy Bypass -File infra/scripts/flowchain-import.ps1", + "workbench:dev": "powershell -NoProfile -ExecutionPolicy Bypass -File infra/scripts/flowchain-workbench.ps1", "e2e": "npm run index:fixtures && npm run verify:fixtures && npm run flowmemory:generate", "demo:indexer": "npm run demo --prefix services/indexer", "demo:verifier": "npm run demo --prefix services/verifier"