/** * Signal intake types and response shapes. * * These types describe the wire contract for the supervised intake pipeline: * scanner_id-routed requests with per-signal acceptance/rejection statuses. */ /** One signal in a POST /signals batch. */ export interface IntakeSignal { /** * Producer-minted idempotency key (the scaffold journal eid). REQUIRED on the * wire — it is the dedup key intake uses. It is a SEPARATE id from * `correlationId` on PerSignalStatus (which intake mints server-side). */ signal_id: string; asset: string; direction: "LONG" | "SHORT"; produced_at: number; valid_until: number; data: Record; signal_type?: string; /** * Producer-minted id of the scan that produced this signal, optional. A retried * signal keeps its producing scan's id, so this is per-signal and never top-level. * Non-empty when present (the wire schema rejects the empty string). */ tick_id?: string; /** * Per-signal sizing, optional. The producer scaffold lifts these to the top * level and the open-position action reads them directly. `marginPct` is the * per-signal margin as a percent (0–100] of withdrawable (mirrors config * `margin_pct`); `leverage` is the per-signal leverage override. Positive when * present (the wire schema rejects zero/negative/non-number; marginPct also >100). */ marginPct?: number; leverage?: number; } /** * One MCP tool call a producer's tick made, as its own boundary timed it. * * `args` are author-supplied and are scrubbed and capped before they reach a wire the browser * reads; nothing here is trusted or forwarded as it arrives. */ export interface IntakeTickCall { tool: string; ms?: number; args?: Record; error_type?: string; } /** * What a producer reports about the TICK itself, as opposed to the signals it produced. * * It rides the POST that tick already makes — `/signals` on a clean tick, `/errors` on a failed one * — because those are the only two things that happen on every tick, and a scanner that produces * nothing (roughly 99% of ticks) would otherwise leave no live record at all. * * Observability only. Nothing here sizes, gates or routes a trade, and every field is optional: * ABSENT MEANS UNKNOWN and must never be read as a zero. */ export interface IntakeTickFacts { tick_id?: string; /** The producer's own run status — the value the tick frame publishes as its outcome. */ status?: string; candidate_count?: number; duration_ms?: number; /** MCP failures the author's own `except` caught and did not re-raise. */ mcp_failures?: number; mcp_ms?: number; mcp_calls?: IntakeTickCall[]; /** Consecutive ticks, this one included, that produced nothing. */ quiet_ticks?: number; /** Actual gap since the previous tick minus the configured interval. */ lag_ms?: number; /** Signals from earlier ticks the intake never acknowledged. */ journal_pending?: number; /** How the tick's state commit ended. Absent, or `committed`, is the normal case. */ commit?: string; /** The last COMMITTED state row, scalars only — stale by one tick on a failed tick. */ state?: Record; state_fields?: number; state_changed?: number; } /** Request body for POST /signals. */ export interface SignalsBody { scanner_id: string; signals: IntakeSignal[]; /** This tick's observability facts, when the producer reports any. */ tick?: IntakeTickFacts; } /** Per-signal outcome in the response. */ export interface PerSignalStatus { status: "accepted" | "expired" | "superseded" | "rejected"; correlationId?: string; reason?: string; } /** Success response for POST /signals. */ export interface SignalsSuccessResponse { signals: PerSignalStatus[]; } /** Error response for POST-level rejections. */ export interface SignalsErrorResponse { reason: string; } /** Request body for POST /errors. */ export interface ErrorsBody { scanner_id: string; error: Record; /** The failed tick's observability facts, when the producer reports any. */ tick?: IntakeTickFacts; } /** Response for POST /errors. */ export interface ErrorsResponse { ok: boolean; reason?: string; } //# sourceMappingURL=types.d.ts.map