fix: F8 stage 9a — A's 100->0 is the funding note being consumed by t… #105
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: # manual trigger for the heavy real-proof e2e job | |
| jobs: | |
| # --------------------------------------------------------------------------- | |
| # Job 1: lint / format check | |
| # --------------------------------------------------------------------------- | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install clang-format | |
| run: sudo apt-get install -y clang-format | |
| - name: Check C++ formatting (clang-format --dry-run) | |
| run: | | |
| find scaffold/src scaffold/interfaces \ | |
| \( -name '*.cpp' -o -name '*.h' \) \ | |
| -print0 \ | |
| | xargs -0 clang-format --dry-run --style=LLVM # advisory (no --Werror): reports diffs without failing the build | |
| # --------------------------------------------------------------------------- | |
| # Job 2: build the agent_module + lez_wallet_module plugins (nix-based) | |
| # --------------------------------------------------------------------------- | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: DeterminateSystems/nix-installer-action@v14 | |
| - name: Enable flake cache (Magic Nix Cache) | |
| uses: DeterminateSystems/magic-nix-cache-action@v8 | |
| # The flake.nix in scaffold/ uses logos-module-builder which provides | |
| # Qt 6.9, logos-cpp-generator, nlohmann_json, cmake, ninja. | |
| - name: Build agent_module plugin via nix | |
| run: nix build ./scaffold#lib --out-link result-agent | |
| env: | |
| NIX_CONFIG: "experimental-features = nix-command flakes" | |
| - name: Verify agent_module .so was produced | |
| run: | | |
| ls -lh result-agent/lib/ | |
| # There must be at least one shared library in the output | |
| find result-agent/lib -name '*.so' | grep -q . \ | |
| || { echo "ERROR: no .so found in result-agent/lib/"; exit 1; } | |
| # The module manifest is the committed scaffold/metadata.json; it is | |
| # deployed next to the built .so (the modules dir holds both). The #lib | |
| # output ships only the library, so verify the manifest at its source. | |
| test -f scaffold/metadata.json \ | |
| || { echo "ERROR: scaffold/metadata.json (module manifest) missing"; exit 1; } | |
| echo "OK: agent_module_plugin.so built + manifest present" | |
| # TODO (runtime milestone): build the lez_wallet_module plugin once its | |
| # flake/CMakeLists are authored (when its flake/CMakeLists are authored). Steps will mirror | |
| # the block above with ./lez_wallet_module#lib instead of ./scaffold#lib. | |
| # - name: Build lez_wallet_module plugin via nix | |
| # run: nix build ./lez_wallet_module#lib --out-link result-wallet | |
| - name: Upload built plugins as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: agent-module-plugins | |
| path: result-agent/ | |
| # --------------------------------------------------------------------------- | |
| # Job 3: e2e-dev — fast dev-mode e2e (RISC0_DEV_MODE=1, runs on PUSH) | |
| # Criterion #19: e2e integration tests run against a LEZ sequencer (standalone mode). | |
| # Mirrors the e2e-sequencer boot pattern from LP-0002/LP-0003 exactly. | |
| # Mock proofs (RISC0_DEV_MODE=1) keep this under CI time budget (~5 min). | |
| # Full skill calls require logoscore (Logos platform binary, not buildable in stock CI); | |
| # those are covered by the real-proof `e2e` job (workflow_dispatch) and demo-real.sh. | |
| # --------------------------------------------------------------------------- | |
| e2e-dev: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Clone LEZ (logos-execution-zone v0.1.2) as sibling lez-build | |
| run: | | |
| git clone --depth 1 --branch v0.1.2 \ | |
| https://github.com/logos-blockchain/logos-execution-zone.git \ | |
| "$GITHUB_WORKSPACE/../lez-build" | |
| - name: Cache LEZ sequencer build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ../lez-build/target | |
| key: ${{ runner.os }}-lez-v0.1.2-sequencer-dev | |
| - name: Install logos-blockchain-circuits release v0.4.2 | |
| run: | | |
| mkdir -p ~/.logos-blockchain-circuits | |
| curl -sfL -o /tmp/circuits.tar.gz \ | |
| https://github.com/logos-blockchain/logos-blockchain-circuits/releases/download/v0.4.2/logos-blockchain-circuits-v0.4.2-linux-x86_64.tar.gz | |
| tar -xzf /tmp/circuits.tar.gz -C ~/.logos-blockchain-circuits | |
| inner=$(find ~/.logos-blockchain-circuits -maxdepth 1 -mindepth 1 -type d \ | |
| -name 'logos-blockchain-circuits-*' | head -1) | |
| if [ -n "$inner" ]; then cp -r "$inner"/* ~/.logos-blockchain-circuits/; fi | |
| ls ~/.logos-blockchain-circuits | |
| - name: Build standalone sequencer | |
| run: cargo build --release -p sequencer_service --features standalone | |
| working-directory: ../lez-build | |
| - name: Install r0vm (risc0 executor backend) v3.0.5 | |
| run: | | |
| curl -sfL -o /tmp/crz.tgz \ | |
| https://github.com/risc0/risc0/releases/download/v3.0.5/cargo-risczero-x86_64-unknown-linux-gnu.tgz | |
| tar -xzf /tmp/crz.tgz -C "$HOME/.cargo/bin" r0vm | |
| chmod +x "$HOME/.cargo/bin/r0vm" | |
| r0vm --version | |
| - name: Download built agent_module plugins artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: agent-module-plugins | |
| path: result-agent/ | |
| - name: Start LEZ standalone sequencer (RISC0_DEV_MODE=1 — mock proofs, fast) | |
| run: | | |
| mkdir -p /tmp/lez-seq-home | |
| RISC0_DEV_MODE=1 RUST_LOG=info RUST_BACKTRACE=1 \ | |
| ../lez-build/target/release/sequencer_service \ | |
| .github/sequencer_config.json -p 3040 > /tmp/lez-seq.log 2>&1 & | |
| echo "Waiting for sequencer to come up (up to 120s) ..." | |
| for i in $(seq 1 60); do | |
| curl -sf -m 2 -X POST http://127.0.0.1:3040 \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","method":"checkHealth","params":[],"id":1}' \ | |
| >/dev/null 2>&1 && echo "Sequencer ready after $((i*2))s." && exit 0 | |
| sleep 2 | |
| done | |
| echo "ERROR: sequencer did not come up in 120s"; tail -80 /tmp/lez-seq.log; exit 1 | |
| - name: Run e2e-dev integration test | |
| env: | |
| RISC0_DEV_MODE: "1" | |
| SEQUENCER: "http://127.0.0.1:3040" | |
| MODULES_DIR: "${{ github.workspace }}/result-agent" | |
| run: bash tests/e2e-dev.sh | |
| - name: Sequencer log on failure | |
| if: failure() | |
| run: tail -100 /tmp/lez-seq.log | |
| # --------------------------------------------------------------------------- | |
| # Job 4: e2e — standalone LEZ sequencer + demo script | |
| # Mirrors the e2e-sequencer job from LP-0002/LP-0003. | |
| # RISC0_DEV_MODE=0 for this job (real proofs) as required by the spec. | |
| # --------------------------------------------------------------------------- | |
| e2e: | |
| # Real-proof e2e (RISC0_DEV_MODE=0) takes minutes per proof and pulls the full | |
| # LEZ stack — too heavy for push CI. Run on demand: `gh workflow run CI`. | |
| if: github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| # Clone logos-execution-zone v0.1.2 as sibling ../lez-build (same pattern as LP-0002/0003) | |
| - name: Clone LEZ (logos-execution-zone v0.1.2) as sibling lez-build | |
| run: | | |
| git clone --depth 1 --branch v0.1.2 \ | |
| https://github.com/logos-blockchain/logos-execution-zone.git \ | |
| "$GITHUB_WORKSPACE/../lez-build" | |
| - name: Cache LEZ sequencer build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| ../lez-build/target | |
| key: ${{ runner.os }}-lez-v0.1.2-sequencer | |
| - name: Install logos-blockchain-circuits release v0.4.2 | |
| run: | | |
| mkdir -p ~/.logos-blockchain-circuits | |
| curl -sfL -o /tmp/circuits.tar.gz \ | |
| https://github.com/logos-blockchain/logos-blockchain-circuits/releases/download/v0.4.2/logos-blockchain-circuits-v0.4.2-linux-x86_64.tar.gz | |
| tar -xzf /tmp/circuits.tar.gz -C ~/.logos-blockchain-circuits | |
| # surface contents if the tarball nests a versioned sub-directory | |
| inner=$(find ~/.logos-blockchain-circuits -maxdepth 1 -mindepth 1 -type d \ | |
| -name 'logos-blockchain-circuits-*' | head -1) | |
| if [ -n "$inner" ]; then cp -r "$inner"/* ~/.logos-blockchain-circuits/; fi | |
| ls ~/.logos-blockchain-circuits | |
| - name: Build standalone sequencer | |
| run: cargo build --release -p sequencer_service --features standalone | |
| working-directory: ../lez-build | |
| - name: Install r0vm (risc0 executor backend) v3.0.5 | |
| run: | | |
| curl -sfL -o /tmp/crz.tgz \ | |
| https://github.com/risc0/risc0/releases/download/v3.0.5/cargo-risczero-x86_64-unknown-linux-gnu.tgz | |
| tar -xzf /tmp/crz.tgz -C "$HOME/.cargo/bin" r0vm | |
| chmod +x "$HOME/.cargo/bin/r0vm" | |
| r0vm --version | |
| - name: Install Nix (needed to build the module for the e2e run) | |
| uses: DeterminateSystems/nix-installer-action@v14 | |
| - name: Enable flake cache (Magic Nix Cache) | |
| uses: DeterminateSystems/magic-nix-cache-action@v8 | |
| - name: Build agent_module plugin for e2e | |
| run: nix build ./scaffold#lib --out-link result-agent | |
| env: | |
| NIX_CONFIG: "experimental-features = nix-command flakes" | |
| # logoscore CLI is used to load the module and call skills | |
| - name: Build logoscore CLI from lez-build | |
| # TODO (runtime milestone): replace with the canonical logos-logoscore-cli nix build | |
| # once the package is published: | |
| # nix build 'github:logos-co/logos-logoscore-cli' --out-link ./logoscore-bin | |
| # For now, build from lez-build source which ships a compatible logoscore binary. | |
| run: | | |
| cargo build --release -p logoscore --features standalone 2>/dev/null \ | |
| || cargo build --release -p logoscore_cli 2>/dev/null \ | |
| || cargo build --release --bins 2>/dev/null \ | |
| || true | |
| find ../lez-build/target/release -maxdepth 1 -name 'logoscore*' -type f \ | |
| | head -5 || true | |
| working-directory: ../lez-build | |
| - name: Start LEZ standalone sequencer | |
| run: | | |
| mkdir -p /tmp/lez-seq-home | |
| # RISC0_DEV_MODE=0 — real proofs (spec requirement) | |
| RISC0_DEV_MODE=0 RUST_LOG=info RUST_BACKTRACE=1 \ | |
| ../lez-build/target/release/sequencer_service \ | |
| .github/sequencer_config.json -p 3040 > /tmp/lez-seq.log 2>&1 & | |
| echo "Waiting for sequencer to come up (up to 120s) ..." | |
| for i in $(seq 1 60); do | |
| curl -sf -m 2 -X POST http://127.0.0.1:3040 \ | |
| -H 'Content-Type: application/json' \ | |
| -d '{"jsonrpc":"2.0","method":"checkHealth","params":[],"id":1}' \ | |
| >/dev/null 2>&1 && echo "Sequencer ready after $((i*2))s." && exit 0 | |
| sleep 2 | |
| done | |
| echo "ERROR: sequencer did not come up in 120s"; tail -80 /tmp/lez-seq.log; exit 1 | |
| - name: Set up modules directory for the demo | |
| run: | | |
| mkdir -p /tmp/agent-modules | |
| cp -r result-agent/lib /tmp/agent-modules/ | |
| cp result-agent/metadata.json /tmp/agent-modules/ | |
| # TODO (runtime milestone): also copy lez_wallet_module .so once built | |
| - name: Run e2e demo script | |
| env: | |
| RISC0_DEV_MODE: "0" | |
| SEQUENCER: "http://127.0.0.1:3040" | |
| MODULES_DIR: "/tmp/agent-modules" | |
| # TODO (runtime milestone): set LOGOSCORE_BIN to the correct path once | |
| # logoscore CLI build is resolved above. | |
| LOGOSCORE_BIN: "${{ github.workspace }}/../lez-build/target/release/logoscore" | |
| run: bash tests/e2e.sh | |
| - name: Sequencer log on failure | |
| if: failure() | |
| run: tail -100 /tmp/lez-seq.log |