feat(vision): @coderadar/vision screenshot adapter, ephemeral (A10/E3/A13)#28
Merged
Merged
Conversation
…/A13)
New internal @coderadar/vision package (TRACKER step 4.4), bundled into the
published ui-lineage as the `ui-lineage/vision` subpath:
- VisionAdapter interface: extract(image) → { terms, structure, annotations,
looksLikeApp }. Images are processed in memory, never persisted (G7).
- StubVisionAdapter — deterministic, replays a recorded extraction (the
OCR-only fallback; no network in CI).
- ClaudeVisionAdapter — Claude-vision implementation (model claude-opus-4-8,
base64 image + json_schema output). The @anthropic-ai/sdk import is lazy and
optional, so neither CI nor the default bundle depends on it.
- extractionToQuery / matchFromVision: annotation-region terms (a circle/arrow
the user drew, E3) are weighted 3×; a non-app screenshot (looksLikeApp:false)
declines rather than guessing (A13).
Core: MatchQuery gains `boosts` (per-term weight multipliers, normalized keys).
Fixture e3-annotated-screenshot with a checked-in extraction.json: the circled
"Revenue breakdown" resolves an otherwise-ambiguous match to RevenuePanel.
36 core + 3 vision + 102 parser tests pass; eval green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 4.4 — Screenshot adapter
Failure modes A10 / E3 / A13. New internal
@coderadar/visionpackage, bundled into the publishedui-lineageas theui-lineage/visionsubpath.VisionAdapterinterface:extract(image) → { terms, structure, annotations, looksLikeApp }. Images are processed in memory, never persisted (G7 — documented in the package README).StubVisionAdapter— deterministic, replays a recorded extraction (the "OCR-only fallback stub"; no network in CI).ClaudeVisionAdapter— Claude-vision implementation (claude-opus-4-8, base64 image +json_schemaoutput). The@anthropic-ai/sdkimport is lazy and optional, so neither CI nor the default bundle depends on it — you install it yourself for live extraction.extractionToQuery/matchFromVision: terms inside an annotation region (a circle/arrow the user drew — E3) are weighted 3×; a non-app screenshot (looksLikeApp: false) declines rather than guessing (A13).Core
MatchQuerygainsboosts(per-term weight multipliers; keys normalized to match query terms).Eval / tests
Fixture e3-annotated-screenshot with a checked-in extraction.json: the circled
"Revenue breakdown"resolves an otherwise-ambiguous match toRevenuePanel(verified inparser-react/src/vision.test.ts); without the annotation it's ambiguous.Verification
pnpm eval: green. ui-lineage bundle rebuilt — vision subpath ships, no@coderadaror hard@anthropic-ai/sdkimports leak.🤖 Generated with Claude Code