caelum0x 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

39 lines
1.4 KiB
Go

// Package guardrail is a dependency-free, idiomatic Go client for the
// Guardrail Alpha read/control HTTP API.
//
// It uses only the standard library (net/http, encoding/json, context) and
// mirrors the route set and JSON shapes exposed by the Guardrail API and its
// sibling TypeScript and Python SDKs. The API is read-only: this client never
// mutates agent state.
//
// # Construction
//
// Create a client with NewClient and optional functional options:
//
// c := guardrail.NewClient("http://localhost:8080",
// guardrail.WithTimeout(5*time.Second),
// )
//
// # Calling endpoints
//
// Every method takes a context.Context as its first argument so callers can
// apply deadlines and cancellation:
//
// ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
// defer cancel()
// health, err := c.Health(ctx)
//
// # Errors
//
// On a non-2xx response the client returns an *APIError carrying the HTTP
// status code and the raw response body. Transport errors (for example a
// refused connection) are returned as ordinary wrapped errors.
//
// # Typed vs dynamic payloads
//
// Headline routes (compete readiness, history points, regime, alerts,
// backtest, walk-forward, sweep, health) return first-class structs.
// Endpoints whose payloads are dynamic are modelled loosely as map[string]any
// so the SDK stays forward-compatible with backend changes.
package guardrail