* feat(sdk): /pnl methods in TS, Python, and Go clients 3-language SDK parity for the PnL attribution endpoint: - TS: pnl(fills?, marks?) - Python: pnl(fills=None, marks=None) - Go: PnL(ctx, fills, marks) tsc clean; Python imports; go vet+build clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(product): health-aggregator Go service services/health-aggregator: read-only ops service that polls the /health endpoints of the Guardrail services concurrently (goroutine per target, 5s timeout) and serves a single aggregate (200 all-up / 503 degraded) with per-target up/latency/error. GET /health, GET /targets; HEALTH_TARGETS / HEALTH_ADDR env. go vet + build clean; smoke verified (degraded 0/3 with no services up). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(dashboard): /quant hub page indexing the quant suite A single index of the quant tools (ta-studio, fees, sizer, orderbook, pnl) — each with its API route and a live example link; shows the CMC-capabilities summary. tsc clean. Dashboard pages -> 73. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(whats-new): Phase 3 quant suite (crate->API->page->SDK->CLI) + health-aggregator Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
16 KiB
What's New — Latest Additions
A concise changelog of the surfaces shipped most recently, grouped by prize lane. Every entry cites the real file path(s) so a judge can read the source of truth directly. Everything below is offline-safe — no API keys or chain access are required to run or verify it.
Companion docs: PRODUCT_OVERVIEW.md ·
ARCHITECTURE.md · CLI.md · API.md ·
LIVE_RUNBOOK.md · VERCEL_DEPLOY.md.
(Earlier competition writeups are archived under archive/hackathon/.)
Phase 3 — product expansion (newest)
Quant suite completed end to end — each crate is reachable as crate → API route → dashboard page → SDK (TS/Python/Go) → CLI subcommand:
pnl-attributioncrate +GET /pnl+/pnlpage +guardrail-cli pnl— average-cost realized/unrealized PnL from a fill stream.orderbookmatching engine exposed atGET /orderbook+/orderbookpage +bookCLI.GET /ta,/fees,/sizer+ their pages andta/fees/sizeCLI subcommands./quantdashboard hub indexes the whole suite.- Read-only ops:
services/health-aggregator(Go) aggregates all services'/health. - 3-language SDK parity for every new endpoint.
New real, self-contained product components across Rust/Go/Python/TS — new directories, no mocks. All build green; the Rust crates carry unit tests.
crates/orderbook— in-memory limit order book + price-time-priority matching engine (limit/market, partial fills, multi-level sweeps, cancel, depth). 8 tests.crates/ta-signals— technical-analysis library (SMA/EMA/RSI/MACD/ Bollinger/ATR/Stochastic/OBV/ADX/VWAP), input-aligned with NaN warmup. 24 tests. Exposed atGET /ta(compute an indicator over a supplied series).services/price-oracle(Go) — live cached USD prices from the free CoinGecko API;GET /prices,/prices/{symbol},/prices/refresh,/health.services/risk-analytics(Python) — Sharpe/Sortino/Calmar/VaR/correlation over the NAV curve; pure-stdlib engine + CLI, optional FastAPI surface.python-lab/optimizer(Python) — grid/random strategy-parameter search (Calmar/Sharpe), offline synthetic objective or live/skills/{id}/backtest.clients/go-cli(grctl, Go) andclients/ts-terminal(guardrail-term, TypeScript) — dependency-free read-only operator CLIs.- Dashboard — new pages
/market-oracle(CMC lineage),/transports(live-vs-mock),/journal-pro(filterable event journal).
Phase 2 — engine, data, dashboard & tooling (newest)
-
Submission-complete: one-command proof capture + turn-key go-live. Closed the gap between "demo-complete" and "submission-complete." New
scripts/capture_submission.shruns the agent (paper) + a low-threshold kill-switch demo, exportssubmission.md, runs the independent proof verifier, and auto-ticksdocs/SUBMISSION_CHECKLIST.mdfrom real event-log evidence (python-lab/scripts/tick_checklist.py) — honest by construction (items needing a real on-chain tx staypending (live)). A paper capture ticks 10/11. The live path is turn-key:guardrail-doctor --liveis a credential/caps safety gate, andscripts/go_live.shpreflights → verifies the chain → asks for a typedGO LIVEconfirmation → registers on-chain → trades → captures. The competition registration tx now threads throughRunMetainto the run report,AgentProof, and/proof/verify's on-chain receipt check (live only). Detail: LIVE_RUNBOOK.md §0, SUBMISSION_CHECKLIST.md. -
CMC Agent Hub: verifiable data lineage.
configs/cmc/capabilities.jsondeclares each CMC dataset → the read-only capability it powers, with the exactcmc-clientsource and the API route / MCP tool that exposes it. Served atGET /cmc/capabilities, mirrored as MCP resourceguardrail://cmc/capabilities, advertised in the ERC-8004 agent card. No execution is exposed to the hub. Detail: CMC_AGENT_HUB.md. -
Docker dashboard image fixed. Deterministic pinned pnpm +
CI=true(the build was failing on a nondeterministic corepack "latest" pnpm). Verified with a full local image build; greens thedockerCI job. -
On-chain proof verification (BNB SDK). The proof story was self-attested — hashes could be recomputed but nothing confirmed the chain. New crate
crates/chain-verifieradds read-only BSC JSON-RPC checks (eth_chainId,eth_getCode,eth_getTransactionReceipt) that confirm the competition contract is deployed and the registration tx was mined to it — no keys, no signing, ABI-free. Wired intoGET /proof/verify(newonchain_configuredflag +onchain_*checks), surfaced as a dedicated "On-chain Verification" section on the dashboard/proofpage, and mirrored in the standaloneclients/proof-verifier/verify.py --rpcusing only the Python stdlib. Offline-safe: withBSC_RPC_URLunset the checks areskipped, never failed, so the paper/demo flow stays green. Verified against live BSC mainnet — the competition contract0x212c61b9b72c95d95bf29cf032f5e5635629aed5returns ~2.5 KB of deployed bytecode. Detail: BNB_AGENT_IDENTITY.md. Verify:python3 clients/proof-verifier/verify.py --rpc https://bsc-dataseed.bnbchain.org. -
Snapshot persistence (Track G). The agent now persists periodic market snapshots to an append-only store under
data/snapshots/so the analytics have real history to chart without replaying the full event log. A new read-onlyGET /snapshotsroute projects that history into a compact, chartable summary: retained count, time span, the latest snapshot's regime and per-asset prices, and a lightweight series (with an optional?limit=cap). The route only reads what the agent has already persisted — it never ingests, mutates, or backfills. Spec: api/openapi.yaml (path/snapshots,SnapshotsResponseschema). Plan:../PLAN_V2.mdTrack G. Verify:curl -fsS http://127.0.0.1:8080/snapshots. -
Live ensemble routing in the engine (Track C). The regime-routed ensemble is promoted from the Python/cockpit advisory view into the live Rust engine: it blends the per-skill target books by classified regime confidence and defers to the
risk-engineas the sole execution gate. Wired into the agent runtime behind a config flag; the existingGET /ensembleroute surfaces the live blended book and per-skill attribution. Detail: ENSEMBLE.md. Plan:../PLAN_V2.mdTrack C. -
Dashboard lab / ensemble / journal pages. The Next.js cockpit (
dashboard/) gains three headline pages:/lab— a server-backed Strategy Lab that tunes inputs and re-runs the real backtest pipeline viaGET /backtest(interactive metrics + equity-curve sparkline);/ensemble— the regime-routed meta-allocator weights, blended book, and per-skill attribution; and/journal— the per-cycle decision narrative (regime → scores → target → risk → execute) off the append-only event log. Full reference: DASHBOARD.md. Files:dashboard/src/app/{lab,ensemble,journal}/page.tsx. -
In-browser WASM backtesting deferred (honest note). The PLAN_V2 Track B goal of running the real engine client-side via WASM is deferred: the compute stack (
backtester→market-data→cmc-client→reqwest/tokio) is notwasm32-compatible. The/labpage provides the same capability server-side instead — same engine that gates live trades, no WASM build. Rationale and the path to revisit: WASM_NOTE.md. -
Go
guardrailctl watch. A new Go operator CLI,guardrailctl, adds awatchsubcommand that tails the read-only API (e.g. the SSE/streamand status routes) and prints a live, terminal-friendly status stream. It is a read-only consumer — it never signs or mutates — and is offline-safe against the paper-mode API. Verify:guardrailctl watch(against a runningguardrail-api).
Platform & developer experience (latest)
-
CLI modularization. The
guardrail-clibinary now keeps argument parsing and dispatch inmain.rsand delegates everyrun_*implementation to a domain-groupedcommands/tree:backtest,market,portfolio,identity,reporting,experiment,agent_surface, andcommerce. 40 top-level subcommands (plus nestedpolicyandexperimentsubcommands) are wired throughcommands/mod.rs. Files:apps/guardrail-cli/src/commands/(8 modules) +apps/guardrail-cli/src/main.rs. Full reference: CLI.md. Verify:ls apps/guardrail-cli/src/commands/;cargo run -p guardrail-cli -- --help. -
TUI live panels. The terminal cockpit renders four live, data-driven panels off the event log and the latest run report: regime (classification + exposure), positions (book summary), risk (latest decisions / gate state), and alerts (staleness, drawdown, kill-switch). Each panel is its own module composed by
render.rs. Files:apps/guardrail-tui/src/{regime,positions,risk,alerts,render}.rs. Verify:cargo run -p guardrail-tui. -
Four new read-only API routes.
apps/guardrail-apinow serves:GET /journal— decision-journal projection of the agent's per-cycle reasoning chain (apps/guardrail-api/src/journal.rs).GET /ensemble— the regime-routed ensemble meta-allocator configuration and current regime weights (apps/guardrail-api/src/ensemble.rs).GET /skills— typed catalog projection ofskills/INDEX.json(apps/guardrail-api/src/skills.rs).GET /version— service version, build target, run mode, and uptime (apps/guardrail-api/src/version.rs). These bring the read-only surface to 68 routes (apps/guardrail-api/src/server.rs). Spec: api/openapi.yaml. Index: API.md. Verify:curl -fsS http://127.0.0.1:8080/version;curl -fsS http://127.0.0.1:8080/skills.
-
Phase-2 expansion plan (PLAN_V2). The next-phase roadmap — real-time engine telemetry (SSE), in-browser WASM backtesting, a native Rust strategy ensemble, a strategy marketplace + dynamic skill loader, a proof explorer + verifier UI, control/growth services, and the data pipeline — all offline-safe and conflict-safe, mapped to the four prize lanes. File:
../PLAN_V2.md. -
Vercel deployment. The Next.js dashboard (
dashboard/, 56 page routes) auto-deploys to Vercel on every push tomain; pull requests get preview deployments. Root directorydashboard,NEXT_PUBLIC_API_URLpoints at a runningguardrail-api. The dashboard is read-only and never holds keys. Files:dashboard/vercel.json. Guide: VERCEL_DEPLOY.md.
Track 2 — Strategy Skills ($6k)
-
Two new strategy skills (now four total). In addition to the general
regime-routed-bsc-alphaandfunding-rate-carry-bsc, the catalog now ships:mean-reversion-chop-bsc— a range-fade specialist (RSI(14) + Bollinger(20,2) %B + ATR(14) stops) that peaks in the CHOP regime. Files:skills/mean-reversion-chop/(skill.yaml,strategy_spec.yaml,SKILL.md,prompts/,examples/,tests/).trend-breakout-momentum-bsc— a momentum/breakout specialist (EMA(12/26/50) stack + MACD + Donchian(20) + volume confirmation) that peaks in the BREAKOUT regime. Files:skills/trend-breakout-momentum/(same layout).- Catalog index:
skills/INDEX.json(all four skills enumerated).
-
Regime ensemble meta-allocator. Blends the four skills' example target books by classified regime (weighted average → renormalize → USDT reserve), advisory only — the Rust risk engine remains the sole execution gate. Files: config
skills/ensemble.json; blenderpython-lab/guardrail_lab/ensemble.py; CLIpython-lab/analyze.py(ensemblesubcommand). Detail: ENSEMBLE.md. Verify:python3 python-lab/analyze.py ensemble --regime chop. -
Skill authoring kit. A reproducible scaffold-and-lint workflow so judges (or a host LLM) can add a fifth skill in seconds. Files: template
skills/_template/; scaffolderscripts/new_skill.sh; example validatorscripts/lint_skills.sh(runsguardrail_lab.skillover eachskills/*/examples/). Detail: SKILL_AUTHORING.md. Verify:bash scripts/new_skill.sh demo-skill && bash scripts/lint_skills.sh. -
Decision journal. Renders the append-only event log as a human-readable, per-cycle decision narrative (regime → scores → target → risk → execute). Files:
python-lab/analyze.py(journalsubcommand). Verify:python3 python-lab/analyze.py journal.
CMC — Best Use of Agent Hub ($2k)
-
MCP server now exposes tools + resources + prompts. The server advertises the full Model Context Protocol capability surface (
capabilities: {tools, resources, prompts}), making it Hub-ready rather than tools-only: 14 read-only tools, 5 resources, and 3 prompts. Files:clients/mcp/manifest.json,clients/mcp/run.py,clients/mcp/mcp.json,clients/mcp/guardrail_mcp/; Rust transportcrates/cmc-client/src/mcp.rs. Verify:cat clients/mcp/manifest.json. -
Hub-ready manifest. A single descriptor a host reads to register the server: protocol/transport, runtime command, env, and the tool/resource/prompt catalog. File:
clients/mcp/manifest.json.
BNB — Best Use of BNB AI Agent SDK ($2k)
- Independent on-chain proof verifier. A stdlib-only, clean-room Python tool that
re-derives the agent's
policy_hash,report_hash,agent_id,address_url, and the competition contract / tx URL formats from first principles and compares them to the claimed proof — sharing no code with the Rust agent ("don't trust, verify"). Files:clients/proof-verifier/verify.py,clients/proof-verifier/sample_proof.json,clients/proof-verifier/README.md; wrapperscripts/verify_proof.sh. Detail: PROOF_VERIFICATION.md. Verify:bash scripts/verify_proof.sh(auto-selects the run report or the bundled offline fixture).
TWAK — Best Use of TWAK ($2k)
-
Self-custody demo. A narrated, fully offline walkthrough of the agent-proposes → risk-gates → TWAK-signs-with-user-keys → execute/reconcile flow. Never loads or requires any key material; points at the real enforcing files and HTTP routes. Files:
scripts/self_custody_demo.sh. Detail: TWAK_SELF_CUSTODY_DEMO.md · SELF_CUSTODY.md. Verify:bash scripts/self_custody_demo.sh. -
Example signing policy. An illustrative TWAK authorization envelope documenting per-tx / daily / session caps, allowed and forbidden actions, the allowed contracts and assets, and the x402
primaryTypeallow/deny-list. Keys never leave the user's wallet; TWAK is the sole signer. File:configs/signing_policy.example.json(served atGET /signing-policy). Verify:cat configs/signing_policy.example.json.
Cross-cutting — operability & demo surfaces
-
Web-lite cockpit tabs. The zero-build single-file cockpit gained Ensemble (per-skill regime blend, mirroring
skills/ensemble.json), Journal (decision narrative off/events), and Signing (the self-custody envelope off/signing-policy) tabs. File:clients/web-lite/index.html. -
Scenario library. A set of deterministic stress scenarios (flash crash, funding spike, kill-switch trip, liquidity crunch, market stress, regime whipsaw) for exercising the risk controls offline. Files:
configs/scenarios/(index.json+ per-scenario JSON); served atGET /scenarios(apps/guardrail-api/src/scenarios.rs). Verify:curl -fsS http://127.0.0.1:8080/scenarios. -
Alert relay. The watchdog now relays alerts through a reusable notifier crate with Console, File, and outbound Webhook sinks (the webhook sink fires when
GUARDRAIL_WEBHOOKis configured; offline runs use the console sink). Files:crates/notifier/src/lib.rs; wiringapps/guardrail-monitor/src/notify.rs. Verify:GUARDRAIL_MONITOR_CHECKS=1 cargo run -p guardrail-monitor.