3 Commits

Author SHA1 Message Date
0716bfb8d9
fix(api): /skills/:id routing (axum 0.7) + expand Python operator CLI (#24)
Building out the Python CLI surfaced a dead route. The API uses axum 0.7
(matchit 0.7), whose path-param syntax is ':id' — but the skill-detail routes
were registered with the axum-0.8 '{id}' form, so '/skills/{id}' and
'/skills/{id}/backtest' were treated as literal segments and 404'd for every
real id, on every client (TS/Go/Python SDKs and the dashboard). Corrected to
':id'; OpenAPI keeps the '{id}' template (that is the correct OpenAPI form).

Python SDK: add the operator-read endpoints it was missing relative to the
TS/Go SDKs — journal, ensemble, ensemble_live, snapshots, skills,
skill_detail(id), proof_verify.

Python CLI: expand from a 3-command stub to operator parity with guardrailctl
and the TS CLI — status, regime, journal, ensemble, snapshots, skills [ID],
verify, smoke. Each renders a focused summary (or --json), offline-safe except
the smoke gate.

Verified live (API on 127.0.0.1:8097): cargo clippy clean, 35 api tests pass;
/skills/cmc-regime-routed-alpha now HTTP 200 (was 404), .../backtest 200;
every Python CLI command renders real data incl. 'skills <id>'; smoke → all 9
PASS.
2026-06-16 20:08:32 +03:00
ef3b10d0a9
feat(python): operator CLI with quant smoke gate (4-language parity) (#23)
The Python SDK was the richest but had no operator CLI. Add a stdlib-only one
mirroring the TS 'guardrail' CLI and Go 'guardrailctl':

- python -m guardrail_client <status|regime|smoke|help> [--base URL] [--json]
- 'guardrail' console_scripts entry point in pyproject.toml.
- status: /health + /readiness + /regime summary; regime: regime + inputs.
- smoke: exercises all 9 quant endpoints (ta, fees, sizer, orderbook, pnl,
  correlation, equity/indicators, portfolio/risk, cmc/capabilities) and prints
  a PASS/WARN/FAIL table. Offline-safe everywhere except smoke, which is a gate
  and exits non-zero on failure (EXIT_SMOKE_FAIL=1).

The quant smoke gate now has full parity across all four surfaces: bash
(scripts/smoke_quant.sh), TS CLI, guardrailctl, and python -m guardrail_client.

Docs: Python README gains the quant-method table (incl. orderbook) and a CLI
section.

Verified live (API on 127.0.0.1:8091): py_compile clean; 'smoke' -> all 9 PASS
exit 0; 'status' renders regime/readiness/health; dead-port smoke -> exit 1;
dead-port status -> exit 0 (offline-safe preserved).
2026-06-16 19:56:10 +03:00
2d2b15c7fe feat: full guardrail-alpha system + CLI modularization + Vercel deploy config
- Rust engine: real bootstrap/wiring preflight (guardrail-agent), execution layer (retry/router/pre-trade/post-trade/reconciliation), guardrail-doctor diagnostics with allowlist-drift guard.

- guardrail-cli: extracted pure helpers into util.rs (split in progress).

- 6 Track-2 skills + ensemble; python-lab analytics (regime/drawdown/montecarlo/dossier/ensemble/journal/seed); clients (ts/py/go/mcp/langchain/web-lite/proof-verifier); alert relay; scenarios; helm/k8s/compose; docs.

- dashboard/vercel.json + docs/VERCEL_DEPLOY.md for Vercel deployment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 11:02:22 +03:00