WI-036 · Next Build Slices · vision-contract

Vision scan service contract and provider adapter scaffold

queued P1 medium risk   Owner: TBD   0% · 0/3 tasks complete

Gates: E1 E2 E3 Requirements: REQ-VISION-001 REQ-VISION-002 REQ-VISION-003 Updated: 2026-06-22

At a glance

CodeWI-036
PhaseVision Contract POC
Order66 of 93
Story points8
Primary surfaceapps/web + provider adapters
Retires
Depends onFreeze scan I/O contract schemas + versioning, Provider gateway + adapter boundary — core (registry, capability, schema+prompt compiler, image prep, ProviderAttempt)
Blocks
Evidence
docs/CC-Analysis/trovesnap-vision-scanning-spec.md

Goals

Vision scan service contract and provider adapter scaffold — advances E1, E2, E3 toward its gate(s).

Implementation — what to build

Contracts (consume Platform & Contracts)

  • Implement the frozen scan contracts (WI-010) for the first two scans: table_hunt + item_scan.
  • src/lib/troveVision.ts + troveVisionTypes.ts hold the canonical result types + the scan call.

Provider adapter (WI-011 / WI-012)

  • Wire ONE hosted provider (e.g. Gemini) returning strict structured output -> canonical result.
  • Run the validation pipeline on every response (syntax->schema->enum->coordinate->business-rule).

UI (apps/web)

  • Overlay/review on a captured image: draw candidate bboxes (normalized 0-1000), ordinal labels, tap-to-select, why-flagged, launch next scan; capture corrections.

Cost

  • Economy tier + per-scan caps (WI-017); key optional with a simulated fallback (mirror /api/appraise).

Acceptance

  • table_hunt + item_scan render as tappable overlays from one provider behind the adapter, validated.

Checklist

  • E1 table_hunt and item_scan schemas are accepted and rendered as overlays.
  • E2 Provider adapter scaffold is in place (consumes the P2 boundary).
  • E3 Overlay/review UX validates confidence and captures corrections.

Gates & testing

  • E1 table_hunt and item_scan schemas are accepted and rendered as overlays.
    CODE TEST
  • E2 Provider adapter scaffold is in place (consumes the P2 boundary).
    CODE TEST 💲 API COST
  • E3 Overlay/review UX validates confidence and captures corrections.
    CODE TEST

Requirements

Verify (done when)

table_hunt/item_scan schemas validate and overlays render against the adapter.

Cost triggers

💲 API COST

First hosted vision-provider calls turn on API spend; keep economy tier + per-scan caps (spec sections 25).

Status & editing

queued   Sprint: Sprint 4 - Vision Contract POC

Edit status / sprint on the ★ Live Board → — changes are logged live with who / when / why.

Human-in-the-loop

No human tasks linked.

Findings

None recorded yet.

Concerns

None recorded yet.

Risks

None recorded yet.

Tech debt

None recorded yet.

Tools used

No tool calls recorded.

Files & artifacts

No files / artifacts recorded.

Update log

No log entries yet.