You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Goal: provider-agnostic vision extraction with fail-closed metering, gated by a real eval. Spec: design/plays-plan.md §4, design/plays-product.md §4.1.
Deps: ai, @ai-sdk/openai, sharp; verify ai v5 zod-4 generateObject support and OpenAI strict-output .nullable() (not .optional()) constraint
PlayAnalyzer seam + injected fake; image downscale via sharp (off the main event loop)
PlayExtraction zod schema, pinned per product §4.1: per-leg positions with stable position_id, side (quantity always positive), full expiry, ×100 convention, opened_at, currency + prompt v1 (versioned, under plays/prompts/)
Deterministic validation: three-outcome ticker check (committed known-non-equity list), P&L arithmetic cross-check, confidence derived from the deterministic pass
markPlay(extraction, quotes) stub + unit tests — the compile-checked P2↔P5 pin
Metering fail-closed: zero/missing price refuses dispatch; daily cap summed from DB cost_usd rows (UTC day); worst-case pre-dispatch reservation via max_output_tokens; unit tests cover all-zero-price and restart cases
Per-stage atomicity: child row + status advance + cost in one transaction; LLM call outside any tx (P9)
Goal: provider-agnostic vision extraction with fail-closed metering, gated by a real eval. Spec:
design/plays-plan.md§4,design/plays-product.md§4.1.ai,@ai-sdk/openai,sharp; verifyaiv5 zod-4generateObjectsupport and OpenAI strict-output.nullable()(not.optional()) constraintPlayAnalyzerseam + injected fake; image downscale via sharp (off the main event loop)PlayExtractionzod schema, pinned per product §4.1: per-leg positions with stableposition_id,side(quantity always positive), full expiry, ×100 convention,opened_at,currency+ prompt v1 (versioned, underplays/prompts/)markPlay(extraction, quotes)stub + unit tests — the compile-checked P2↔P5 pincost_usdrows (UTC day); worst-case pre-dispatch reservation viamax_output_tokens; unit tests cover all-zero-price and restart casesfixtures/plays/≥30 stratified, redacted screenshots, hand-labeled; machine-scored per-field; near-perfect thresholds on marking-critical fields (ticker/side/quantity/strike/expiry)OPENAI_API_KEYindeploy/v2/.env.example;stop_grace_periodin composeGate: eval thresholds met (hand-judged sample spot-checked by owner); budget behavior proven incl. fail-closed cases; live queue extracts real plays.