Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
0274554
chore(workspace): hoist [workspace.dependencies] + [workspace.lints]
brunota20 Jun 25, 2026
be1972f
feat(nexum-engine): migrate CLI from hand-rolled parser to clap
brunota20 Jun 25, 2026
0b37c70
docs(07-rpc-namespace-design): mark allowlist enforcement as future d…
brunota20 Jun 25, 2026
b2fe663
chore(deps): pull cowprotocol, alloy, redb, reqwest, tracing
brunota20 Jun 1, 2026
2966262
runtime: implement cow-api, chain, local-store host backends
brunota20 Jun 1, 2026
be7a3b1
runtime: multi-module supervisor + block/log event loop
brunota20 Jun 1, 2026
9ebbeea
feat(supervisor): apply ADR-0001/0003/0005/0016 and trap-based module…
brunota20 Jun 9, 2026
473c95f
feat(supervisor): add fuel + memory limits per module store (BLEU-818)
brunota20 Jun 9, 2026
ad3d798
docs: rename nexum.toml -> module.toml in example, justfile, and READ…
brunota20 Jun 10, 2026
62c5811
test: fill host backend test gaps — manifest parsing, cow-api, provid…
brunota20 Jun 10, 2026
881965d
test: E2E supervisor tests + fix wit_import_to_cap to skip type-only …
brunota20 Jun 10, 2026
7d1c0b6
style: apply rust-idiomatic rules (em-dashes, #[from] Orderbook, unus…
brunota20 Jun 10, 2026
605b1d9
review: apply lgahdl feedback on PR #9 (+ rebase PR #8 fixes)
brunota20 Jun 12, 2026
aca680d
refactor(manifest): split into types/load/capabilities/error submodules
brunota20 Jun 13, 2026
0ff9ba9
refactor(main): extract host impls + CLI + event loop + limits
brunota20 Jun 13, 2026
33b4d56
refactor: move large #[cfg(test)] modules to sibling files
brunota20 Jun 13, 2026
8c848dd
chore(deps): patch cowprotocol to bleu/cow-rs main (post-alpha.3)
brunota20 Jun 1, 2026
edbafca
docs(adr): add 0001-0007 capturing engine and CoW architecture decisions
brunota20 Jun 2, 2026
c21378e
docs(adr): unwrap hard-wrapped paragraphs to single line each
brunota20 Jun 2, 2026
e5010c4
docs(adr): revise CoW design and reorder ADRs (0001-0008)
brunota20 Jun 3, 2026
821db88
fix(docs): reviewed ADRs by bleu
brunota20 Jun 3, 2026
e8744b5
fix(docs): revised ADRs and diagrams
brunota20 Jun 8, 2026
1ee0ca9
chore(deps): bump cowprotocol patch to bleu/cow-rs main (BLEU-822 + B…
brunota20 Jun 15, 2026
8649d59
feat(modules): module.toml for twap-monitor + ethflow-watcher (BLEU-834)
brunota20 Jun 15, 2026
dd783fc
review: address jeffersonBastos feedback on PR #54 (BLEU-834 manifests)
brunota20 Jun 22, 2026
568c7ea
chore(rust-idiomatic): M2 compliance pass (filtered from M4/M5 compli…
brunota20 Jun 23, 2026
895d78c
docs(nexum-engine): fix rustdoc intra-doc links after pub(crate) sweep
brunota20 Jun 25, 2026
0d39d89
chore(nexum-engine): derive strum::IntoStaticStr on error enums
brunota20 Jun 25, 2026
61dbd4b
refactor(local-store): extract `local_store_err` map closure helper
brunota20 Jun 25, 2026
8f0a4fe
fix(supervisor): emit nexum.toml deprecation via tracing::warn!
brunota20 Jun 25, 2026
ee72dce
test(nexum-engine): cover untested error variants and concurrent acce…
jean-neiverth Jun 29, 2026
21204ba
Merge pull request #88 from bleu/test/m2-error-variant-coverage
jean-neiverth Jun 29, 2026
353347c
feat(twap-monitor): workspace + skeleton (BLEU-825)
brunota20 Jun 15, 2026
3f55cec
feat(twap-monitor): index ConditionalOrderCreated → local-store (BLEU…
brunota20 Jun 15, 2026
bb3f918
feat(twap-monitor): eth_call poll path + PollOutcome decoder (BLEU-827)
brunota20 Jun 15, 2026
aa1d08b
feat(twap-monitor): build OrderCreation and submit via cow-api (BLEU-…
brunota20 Jun 15, 2026
3537c2a
feat(twap-monitor): wire OrderPostError retry_hint on submit (BLEU-829)
brunota20 Jun 15, 2026
2dbe22e
feat(twap-monitor): PollOutcome lifecycle dispatch (BLEU-830)
brunota20 Jun 15, 2026
310bc83
feat(ethflow-watcher): workspace + skeleton (BLEU-831)
brunota20 Jun 15, 2026
5b62995
feat(ethflow-watcher): decode CoWSwapEthFlow OrderPlacement (BLEU-832)
brunota20 Jun 15, 2026
d9fb04a
feat(ethflow-watcher): build OrderCreation, submit, apply retry_hint …
brunota20 Jun 15, 2026
a782382
fix(ethflow-watcher): idempotency guard on re-delivered placements
brunota20 Jun 15, 2026
b5d59ec
feat(shepherd-sdk): workspace + skeleton (BLEU-835)
brunota20 Jun 17, 2026
dc6a82d
feat(shepherd-sdk): extract shared helpers from M2 modules (BLEU-840)
brunota20 Jun 17, 2026
883ee82
refactor(modules): consume shepherd-sdk helpers (BLEU-843)
brunota20 Jun 17, 2026
3674177
feat(shepherd-sdk-test): in-memory host mocks for module tests (BLEU-…
brunota20 Jun 17, 2026
05a7b58
docs(shepherd-sdk): rustdoc polish + README + docs/sdk.md (BLEU-844)
brunota20 Jun 17, 2026
351f106
feat(examples): price-alert Chainlink oracle reader (BLEU-846)
brunota20 Jun 17, 2026
8b0dd45
feat(examples): balance-tracker example module (BLEU-847)
brunota20 Jun 17, 2026
8945cb1
docs(tutorial): first-module walkthrough (BLEU-848)
brunota20 Jun 17, 2026
b920828
chore: rust-idiomatic compliance pass across M3 + M2 modules
brunota20 Jun 17, 2026
93981aa
refactor(price-alert): port to Host trait + MockHost tests (BLEU-851)
brunota20 Jun 17, 2026
862cabf
feat(examples): stop-loss module + tutorial as guided tour (BLEU-852)
brunota20 Jun 17, 2026
abba8f1
refactor(twap-monitor): port to Host trait + MockHost tests (BLEU-854)
brunota20 Jun 17, 2026
cd161ba
refactor(ethflow-watcher): port to Host trait + MockHost tests (BLEU-…
brunota20 Jun 17, 2026
9176828
chore(qa): workspace cargo fmt sweep + em-dash cleanup (COW-1063)
brunota20 Jun 17, 2026
dcb4daa
docs(qa): COW-1063 sign-off matrix + architectural findings
brunota20 Jun 17, 2026
1e4bd98
docs: resolve QA findings - ADR-0009 + doc 05 status callouts
brunota20 Jun 17, 2026
7471489
ci: build all production module .wasm targets via matrix (COW-1066)
brunota20 Jun 17, 2026
09c9f76
ci: gate cargo doc warnings (-D warnings) + fix 3 broken intra-doc li…
brunota20 Jun 17, 2026
4b25de2
docs(shepherd-sdk): add 6 doctests covering Host trait + helper API (…
brunota20 Jun 17, 2026
22fbe76
test(nexum-engine): supervisor integration tests for 5 production mod…
brunota20 Jun 17, 2026
3d8a1ef
docs(m2): testnet runbook + engine.m2.toml + `just run-m2` (validated…
brunota20 Jun 17, 2026
73cc928
fix(event_loop): do not bail boot when block / log stream Vec is empty
brunota20 Jun 18, 2026
caa59f0
docs(m3): testnet runbook + engine.m3.toml + `just run-m3` (validated…
brunota20 Jun 18, 2026
e7eeed9
docs(m3): testnet edge-case validation report - 5 scenarios run, all …
brunota20 Jun 18, 2026
af4a788
fix(supervisor): mark module alive=false when init returns Err (COW-1…
brunota20 Jun 18, 2026
66fc164
review: address jeffersonBastos M3 epic feedback (PR #55)
brunota20 Jun 22, 2026
299dfd3
chore(rust-idiomatic): M3 compliance pass (filtered from M4/M5 compli…
brunota20 Jun 23, 2026
2e83e90
docs(deployment): operator runbook (BLEU-836) (#17)
brunota20 Jun 24, 2026
5c465f7
chore(shepherd-sdk): derive strum::IntoStaticStr + non_exhaustive on …
brunota20 Jun 25, 2026
0da45ba
chore(twap-monitor): derive strum::IntoStaticStr + non_exhaustive on …
brunota20 Jun 25, 2026
75a581a
fix(balance-tracker): replace Result<_, String> with typed AddressLis…
brunota20 Jun 25, 2026
7ccb93c
feat(shepherd-sdk): consolidate AddressParse helper from balance-trac…
brunota20 Jun 25, 2026
568d8ce
feat(sdk): mark HostErrorKind + LogLevel #[non_exhaustive] (COW-1029)
brunota20 Jun 18, 2026
be4fe97
test(resource-limits): 2 evil fixtures + 3 trap-isolation tests (COW-…
brunota20 Jun 18, 2026
1c1d9b8
feat(logging): JSON formatter + structured dispatch fields (COW-1035)
brunota20 Jun 18, 2026
a789dfa
feat(metrics): Prometheus /metrics endpoint + 4 recording sites (COW-…
brunota20 Jun 18, 2026
5edd14c
feat(supervisor): exponential-backoff restart with component reinstan…
brunota20 Jun 18, 2026
59dcd40
feat(event-loop): WS reconnect with exponential backoff per stream (C…
brunota20 Jun 18, 2026
fc3a755
feat(supervisor): poison-pill detection + quarantine (COW-1032)
brunota20 Jun 18, 2026
f918dc3
feat(event-loop+supervisor): graceful shutdown + last-block persisten…
brunota20 Jun 18, 2026
a609a0d
test(supervisor): multi-chain isolation regression tests (COW-1073)
brunota20 Jun 18, 2026
3f616e7
feat(ops): E2E testnet integration scaffold (COW-1064)
brunota20 Jun 18, 2026
4b65db3
docs(ops): production deployment guide (COW-1030)
brunota20 Jun 18, 2026
9617be1
ops(e2e): pin module configs + run-prep punch list for 2026-06-18 COW…
brunota20 Jun 18, 2026
dc88e4f
ops(e2e): automation scripts for COW-1064 run (.env-file pattern)
brunota20 Jun 18, 2026
168af8a
fix(scripts): match JSON-shape supervisor-ready log line (COW-1064)
brunota20 Jun 18, 2026
fcf8fcf
fix(scripts): macOS bash 3.2 compatibility (COW-1064)
brunota20 Jun 18, 2026
110f37e
fix(scripts): idempotent on-chain submission + python deps pre-flight…
brunota20 Jun 18, 2026
537c4a7
fix(scripts): EthFlow quote uses WETH not native-ETH sentinel (COW-1064)
brunota20 Jun 18, 2026
26572b6
fix(scripts): report-gen handles flat JSON + per-module marker patter…
brunota20 Jun 18, 2026
dca0cbc
feat(sdk + twap-monitor): resolve non-empty app_data via orderbook lo…
brunota20 Jun 18, 2026
0d38b70
fix(ethflow-watcher): apply resolve_app_data to submit_placement (COW…
brunota20 Jun 18, 2026
b007997
ops(e2e): COW-1064 run report 2026-06-18
brunota20 Jun 18, 2026
6268bde
fix(cow-api): forward orderbook ApiError envelope to HostError.data (…
brunota20 Jun 19, 2026
11080ea
feat(ethflow-watcher): downgrade ExcessiveValidTo drops to Info (COW-…
brunota20 Jun 19, 2026
98e74ca
fix(scripts): derive TWAP calldata with t0=now-60 (COW-1077)
brunota20 Jun 19, 2026
512c669
chore(sdk + twap-monitor): hex helpers via alloy_primitives::hex::encode
brunota20 Jun 19, 2026
a736362
feat(load-test): Anvil fork + mock orderbook + load-gen (COW-1079)
brunota20 Jun 19, 2026
fd294b5
ops(load): baseline 5x5 report - engine clean, load-gen needs calibra…
brunota20 Jun 19, 2026
25b9127
fix(scripts): load-run.sh REPORTS_DIR set after lib.sh source (COW-1079)
brunota20 Jun 19, 2026
655d1e4
fix(load-gen): explicit nonce + unique EthFlow sellAmount (COW-1080)
brunota20 Jun 19, 2026
85b60b2
ops(load): medium + saturation reports - engine clean at 300 watches …
brunota20 Jun 19, 2026
163c32d
feat(load-gen): --parallel mode + aggressive saturation report (COW-1…
brunota20 Jun 19, 2026
7213052
chore(rust-idiomatic): M4 compliance pass (blockers + majors) (#66)
brunota20 Jun 24, 2026
071dabf
fix(shepherd-sdk): add cow_api_request to chainlink StubHost + appDat…
brunota20 Jun 25, 2026
21580b9
refactor(sdk): replace [u8; 32] with B256 across resolve_app_data sur…
brunota20 Jun 25, 2026
00e0891
refactor(cow-orderbook): extract DEFAULT_CHAINS const
brunota20 Jun 25, 2026
c65b0fe
chore(engine.e2e.toml): replace em-dash with ASCII hyphen
brunota20 Jun 25, 2026
8fd29ad
feat(ops): baseline tool — EthFlow indexer creationDate semantics (CO…
brunota20 Jun 22, 2026
c458b00
feat(engine): forward eth_call ErrorResp.data into HostError.data (CO…
brunota20 Jun 22, 2026
b4df0d8
feat(ethflow-watcher): cap backoff: retries at MAX_BACKOFF_RETRIES (C…
brunota20 Jun 22, 2026
47249d0
feat(backtest): pre-soak EthFlow replay harness (COW-1078)
brunota20 Jun 22, 2026
9018f84
feat(deploy): Dockerfile + compose + ghcr CI for M5 deployment
brunota20 Jun 22, 2026
38d7857
chore(deploy): gitignore /engine.toml to protect operator RPC keys
brunota20 Jun 22, 2026
d1dae43
feat(engine): fail-fast on HTTP rpc_url + redact API keys in boot logs
brunota20 Jun 22, 2026
b2f133f
feat(engine): ${VAR} env-var substitution in engine.toml for RPC URLs
brunota20 Jun 22, 2026
2091e96
fix(deploy): healthcheck uses bash /dev/tcp (wget not in runtime image)
brunota20 Jun 22, 2026
cbfcd94
fix(deploy): healthcheck must invoke bash explicitly (CMD-SHELL is dash)
brunota20 Jun 22, 2026
eac4c05
deploy: ethflow-watcher observe + verify redesign rebased onto M5
brunota20 Jun 23, 2026
a739f92
fix(twap-monitor): skip submit_order when submitted:{uid} already in …
brunota20 Jun 23, 2026
ee3bab7
feat(event-loop): log block stream gap closures from alloy-internal r…
brunota20 Jun 23, 2026
65af476
chore(rust-idiomatic): M5 compliance pass (cherry-pick M4 + M5 deploy…
brunota20 Jun 24, 2026
30934ab
chore(docs): reconcile vapor + capability-gating drift across M2-M5 (…
brunota20 Jun 24, 2026
228047b
fix(ethflow-watcher): drop bogus wildcard arm from observe_placement
brunota20 Jun 25, 2026
cc7e345
chore(nexum-engine): derive strum::IntoStaticStr on EnvVarError + Fil…
brunota20 Jun 25, 2026
ce9f3e3
chore(engine.*.toml): replace em-dashes with ASCII hyphens
brunota20 Jun 25, 2026
8cb1b43
refactor(shepherd-backtest): consume shepherd_sdk::address::AddressPa…
brunota20 Jun 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Build context exclusion list for `docker build .`. Keeping the
# context lean matters: every byte sent to the daemon is hashed for
# the build's source-changed signal, and the production multi-stage
# Dockerfile already invalidates the dependency layer cache on any
# Cargo.lock / Cargo.toml change.

# Cargo build artefacts — re-built inside the build stage anyway.
/target/
target/
**/target/

# Runtime state directory the engine writes the redb file into. Never
# part of the image.
/data/
data/

# Backtest tooling output: large JSON fixtures + Python venv state.
# Re-collected on demand via `tools/backtest-collect/backtest_collect.py`.
tools/backtest-collect/fixtures-*.json
tools/baseline-latency/data/
tools/**/__pycache__/
tools/**/*.pyc

# NOTE: `modules/fixtures/*-bomb` are listed in the workspace
# `Cargo.toml`, so excluding them breaks `cargo build` ("failed to
# load manifest for workspace member"). They're tiny crates and the
# Dockerfile doesn't COPY them to the runtime stage, so the
# image size impact is zero. Keep them in the build context.

# Local-only configs. The production `engine.toml` is supplied at
# runtime via a bind-mount (`/etc/shepherd/engine.toml`).
engine.toml
engine.e2e.toml
engine.load.toml
engine.m2.toml
engine.m3.toml

# Git + GitHub metadata.
/.git/
/.github/
.gitignore

# Editor / OS noise.
.vscode/
.idea/
.DS_Store
*.swp

# Operator-side docs reports the image doesn't need. Source markdown
# stays so it's discoverable inside the container if an operator
# `docker exec`s in for a quick `cat docs/production.md`.
docs/operations/load-reports/
docs/operations/e2e-reports/
docs/operations/backtest-reports/
docs/operations/baselines/
25 changes: 25 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Operator template — copy to `.env` and fill in your paid RPC URLs.
# `.env` is gitignored; never commit a populated copy.
#
# Workflow:
# cp .env.example .env
# $EDITOR .env
# docker compose up -d
#
# The engine reads these via `${VAR}` placeholders in
# `engine.docker.toml` (substitution happens at config-load time,
# before TOML parse, so a missing variable fails fast).
#
# Use `wss://` schemes — `eth_subscribe` is WebSocket-only and the
# engine emits a boot-time ERROR on http(s):// URLs (see
# docs/production.md §6 and engine_config::validate_transports).

MAINNET_RPC_URL=wss://eth-mainnet.g.alchemy.com/v2/REPLACE_ME
GNOSIS_RPC_URL=wss://gnosis-mainnet.g.alchemy.com/v2/REPLACE_ME
SEPOLIA_RPC_URL=wss://eth-sepolia.g.alchemy.com/v2/REPLACE_ME
ARBITRUM_RPC_URL=wss://arb-mainnet.g.alchemy.com/v2/REPLACE_ME
BASE_RPC_URL=wss://base-mainnet.g.alchemy.com/v2/REPLACE_ME

# Optional: override the published image with a locally-built or
# pinned-by-SHA tag. Leave unset to pull `:latest` from ghcr.io.
# SHEPHERD_IMAGE=ghcr.io/bleu/nullis-shepherd:sha-abc1234
36 changes: 34 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,46 @@ jobs:
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- run: cargo test --workspace --all-features --no-fail-fast

docs:
name: rustdoc
runs-on: ubuntu-latest
env:
RUSTDOCFLAGS: "-D warnings"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master 2026-03-27
with:
toolchain: nightly
targets: wasm32-wasip2
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- run: cargo doc --workspace --no-deps

build-module:
name: build example module
name: build ${{ matrix.module }} (wasm32-wasip2)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
module:
- example
- twap-monitor
- ethflow-watcher
- price-alert
- balance-tracker
- stop-loss
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master 2026-03-27
with:
toolchain: nightly
targets: wasm32-wasip2
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- run: cargo build -p example --target wasm32-wasip2 --release
- run: cargo build -p ${{ matrix.module }} --target wasm32-wasip2 --release
- name: report wasm size
run: |
artifact_name=$(echo "${{ matrix.module }}" | tr '-' '_')
wasm_path="target/wasm32-wasip2/release/${artifact_name}.wasm"
if [ -f "$wasm_path" ]; then
size=$(wc -c < "$wasm_path")
echo "${{ matrix.module }} .wasm size: ${size} bytes"
fi
88 changes: 88 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Docker image build + publish to ghcr.io.
#
# Triggers:
# - push to `main` → publish `latest` + `sha-<sha>`
# - tag push `v*` → publish `v<tag>` + `latest`
# - workflow_dispatch (manual) → publish `manual-<run_id>`
# - pull_request to `main` → build only, no push (CI smoke)
#
# Image: ghcr.io/<owner>/nullis-shepherd
# Auth: GITHUB_TOKEN (scoped to packages:write below).
#
# Pinned action SHAs match the style of `.github/workflows/ci.yml`.

name: docker

on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
packages: write

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
name: build + push (${{ github.event_name }})
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Set up Docker buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1

- name: Log in to ghcr.io
if: github.event_name != 'pull_request'
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Compute image metadata
id: meta
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
# `latest` on push to main and on tag.
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=tag
# `sha-<short>` on every event so a soak run can pin an
# exact build.
type=sha,prefix=sha-,format=short
# manual-<run_id> for workflow_dispatch.
type=raw,value=manual-${{ github.run_id }},enable=${{ github.event_name == 'workflow_dispatch' }}
# `pr-<n>` on pull-request builds so the smoke artefact
# is identifiable. PR builds are NOT pushed (see `push:`).
type=ref,event=pr,prefix=pr-

- name: Build + push
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: ./Dockerfile
# Push on every non-PR event; PR builds are local-only smoke.
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Layer cache via the registry: the previous successful
# build's intermediate layers are reused so a Cargo.toml-only
# change re-compiles only the changed crate.
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max,ignore-error=true
# `amd64` is enough for the soak VM. Add `arm64` once an
# operator surfaces a real need; multi-arch ~2x the build.
platforms: linux/amd64
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,30 @@ Thumbs.db
# Environment
.env
.env.*
# Exception: the committed template (operator copies it to `.env`,
# which is then caught by the rule above).
!.env.example

# Agent skills / AI tooling — installed locally, never committed.
.agents/
.claude/
skills-lock.json

# Engine runtime state (default state_dir from engine.toml).
data/

# E2E automation: rendered configs with embedded RPC keys + script state
# never get committed.
*.local.toml
scripts/.state
scripts/.env

# Operator-supplied engine config (carries paid RPC URLs / API keys).
# The committed siblings `engine.example.toml`, `engine.docker.toml`,
# and `engine.{m2,m3,e2e,load}.toml` are placeholder templates.
/engine.toml

# Generated reports under e2e-reports/ (operator commits the filled-in ones
# manually via `git add -f`).
docs/operations/e2e-reports/engine-*.log
docs/operations/e2e-reports/metrics-*.txt
115 changes: 115 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
[workspace]
members = [
"crates/nexum-engine",
"crates/shepherd-backtest",
"crates/shepherd-sdk",
"crates/shepherd-sdk-test",
"modules/ethflow-watcher",
"modules/example",
"modules/examples/balance-tracker",
"modules/examples/price-alert",
"modules/examples/stop-loss",
"modules/fixtures/flaky-bomb",
"modules/fixtures/fuel-bomb",
"modules/fixtures/memory-bomb",
"modules/twap-monitor",
"tools/load-gen",
"tools/orderbook-mock",
]
resolver = "2"

Expand All @@ -10,6 +23,108 @@ edition = "2024"
license = "AGPL-3.0"
repository = "https://github.com/nullisLabs/shepherd"

# Shared dependency table. Only deps consumed by 2+ crates across the
# full workspace (nexum-engine + every downstream module crate) are
# hoisted here; single-consumer deps stay per-crate. Crates inherit
# with `dep.workspace = true` and may add features per call site via
# `dep = { workspace = true, features = ["extra"] }`. Version drift
# across crates (the failure mode that prompted hoisting in the first
# place, e.g. cowprotocol on `1.0.0-alpha` vs `1.0.0-alpha.3`) is now
# impossible by construction.
[workspace.dependencies]
# Error + async plumbing.
anyhow = "1"
thiserror = "2"
tokio = { version = "1", features = ["full"] }
futures = "0.3"

# Serde + config.
serde = { version = "1", features = ["derive"] }
serde_json = "1"

# Observability.
tracing = "0.1"
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "env-filter", "ansi", "json"] }

# `strum::IntoStaticStr` on every error / event enum gives a free
# snake_case `&'static str` for every variant, which feeds directly
# into `metrics::counter!(..., "error_kind" => name)` and
# `tracing::warn!(error_kind = name, ...)` recordings without an
# ad-hoc `match err { ... => "connect" ... }` ladder per call site.
strum = { version = "0.26", features = ["derive"] }

# `auto_impl::auto_impl(&, Arc, Box)` forwarding impls for traits
# held through smart pointers. Available workspace-wide so any future
# `Arc<dyn Trait>` boundary can opt in without touching root manifest.
auto_impl = "1"

# `derive_more` newtype boilerplate (`Deref`, `From`, `Display`, ...).
# `default-features = false, features = ["full"]` keeps the proc-macro
# surface predictable; per-derive opt-in via the standard `#[derive(...)]`
# syntax. Available workspace-wide; not pulled in by default.
derive_more = { version = "1", default-features = false, features = ["full"] }

# CLI parser. Used by every binary crate (engine, load-gen,
# orderbook-mock, shepherd-backtest) via the derive macro.
clap = { version = "4", features = ["derive"] }

# alloy stack. Engine uses the full provider/transport surface;
# guest-facing crates use `alloy-primitives` + `alloy-sol-types` for
# typed protocol values. Pinned together so a single workspace bump
# moves every consumer at once.
alloy-primitives = { version = "1.5", default-features = false, features = ["std", "serde"] }
alloy-sol-types = { version = "1.5", default-features = false, features = ["std"] }
alloy-provider = { version = "1.5", default-features = false, features = ["ws", "ipc", "pubsub", "reqwest"] }
alloy-rpc-types-eth = { version = "1.5", default-features = false, features = ["std"] }
alloy-transport-ws = { version = "1.5", default-features = false }

# CoW Protocol bindings. Pinned to one version across the workspace
# (was `1.0.0-alpha` in engine vs `1.0.0-alpha.3` in SDK before
# hoisting). Default features stay on so the engine picks up
# `http-client` for `OrderBookApi`; guest-side consumers (SDK,
# strategies) opt out with `default-features = false` for the
# `cdylib` wasm-target builds.
cowprotocol = "1.0.0-alpha.3"

# HTTP transport for `cow_api::request` REST passthrough and the
# orderbook-mock test surface.
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }

# `wit-bindgen` is consumed by every guest module crate (example +
# every strategy + every fixture). Hoisted so a single bump moves
# them in lock-step.
wit-bindgen = { version = "0.57", default-features = false, features = ["macros", "realloc"] }

# Workspace-standard lint set. New crates inherit via
# `[lints] workspace = true` in their package manifest. `unsafe_code`
# cannot be denied workspace-wide because every wit-bindgen guest
# module emits an `unsafe extern "C"` shim; modules carrying that
# macro keep the default-warn allowance, and unsafe in non-binding
# code still trips review by convention.
[workspace.lints.rust]
unsafe_op_in_unsafe_fn = "warn"

[workspace.lints.clippy]
# Deny the easy footguns. Each crate carries its own narrower
# `#![deny(...)]` where the cost of a violation is high (e.g. the
# binary entrypoints carry `unused_crate_dependencies` warn).
dbg_macro = "deny"
todo = "deny"

# `cowprotocol` v1.0.0-alpha.3 (the crates.io release the engine
# depends on) was cut from `cowdao-grants/cow-rs` PR #5 at commit
# `1742ffa`. `bleu/cow-rs` main has diverged since with: the
# `composable::Proof` width fix (relevant to the TWAP poll path),
# `OrderCreation` zero-from-address fast-fail, the `order_book` /
# `composable` submodule splits, `OrderPostErrorKind` + `retry_hint()`
# (BLEU-822, the protocol-level retry contract M2 modules dispatch
# on), and `OrderBookApi::with_base_url(chain, base_url)` for barn /
# staging routing (BLEU-823). Patching to that commit picks the lot
# up without waiting for an alpha.4 publish. Drop once
# `cowprotocol >= 1.0.0-alpha.4` ships.
[patch.crates-io]
cowprotocol = { git = "https://github.com/bleu/cow-rs", rev = "57f5f553ab28c9fff54089daf2d39b4282f3e4dd" }

[profile.dev]
panic = "abort"

Expand Down
Loading