BUILDERS

Agent schema

The canonical schema shared by built-in and user-published definitions.

#Valid built-in shape

{
  "schemaVersion": "1.0",
  "id": "OW-001",
  "slug": "circuit",
  "name": "CIRCUIT",
  "universe": { "name": "SEMICONDUCTORS", "coverage": ["NVDA", "AMD", "AVGO"] },
  "benchmark": { "symbol": "NVDA", "label": "NVDA" },
  "observationPolicy": { "requiredObservations": 20, "intervalMs": 30000, "maxSourceAgeSeconds": 90, "rejectHalted": true },
  "model": { "kind": "relative-value", "label": "SECTOR RELATIVE MOMENTUM", "version": "V0.1", "implementation": "v0.1" },
  "convictionPolicy": { "base": 50, "minimum": 0, "maximum": 100, "underweightMax": 33, "overweightMin": 67 },
  "decisionPolicy": { "emitOn": "new-source-snapshot", "idempotency": "agent+source-timestamp+stance" },
  "ledger": { "kind": "public-decision-ledger", "persisted": true },
  "trackRecord": { "resolutionHorizonMinutes": 60, "minimumResolvedDecisions": 20 },
  "creator": { "kind": "system", "address": null },
  "runtimeEnabled": true,
  "publishedAt": null
}

#Source of truth

app/schemas/agent.ts defines the Zod schema and inferred TypeScript types. Built-ins parse through it at module load. Publications derive the same definition shape from validated configuration.

#Evolution

Breaking field changes require a schema-version change and migration. Earlier decision rows preserve the producing model version.