How onielrosario/frameit works
Frame is a Chrome extension backed by a FastAPI service that analyzes selected text with Gemini and returns a validated framing read with evidence. The main workflow runs from page selection through the extension worker to the API, where text is normalized, model output is validated, quoted evidence is recovered from the selection, and surviving signals are scored into the response. The repository also includes a reviewer-agreement evaluation harness. The README documents the end-to-end client/server workflow; some extension message wiring and evaluation internals are not shown in excerpts, so those links are omitted or marked unverified.
Main entry points: routes.py Analyze endpoint · pipeline.py Analysis pipeline · Overlay.tsx Page overlay · cli.py Evaluation runner
Components 21
Chrome extension
- Page overlay
apps/extension/src/content/Overlay.tsx - Content entry
apps/extension/src/content/index.ts - Background worker
apps/extension/src/background/index.ts - API client
apps/extension/src/api/client.ts - Response contract
apps/extension/src/api/contract.ts - Settings popup
apps/extension/src/popup/App.tsx - Extension settings
apps/extension/src/settings.ts
API analysis
- Analyze endpoint
services/api/app/api/routes.py - Text normalizer
services/api/app/evidence/normalize.py - Gemini analyzer
services/api/app/analysis/gemini.py - Model output schema
services/api/app/analysis/model_output.py - Analysis pipeline
services/api/app/analysis/pipeline.py - Evidence recovery
services/api/app/evidence/recover.py - Provisional scoring
services/api/app/scoring/provisional.py - Analysis taxonomy
services/api/app/models/taxonomy.py - Response models
services/api/app/models/analysis.py
Evaluation harness
- Evaluation runner
evaluation/runners/frame_eval/cli.py - Evaluation records
evaluation/runners/frame_eval/records.py - Agreement metrics
evaluation/runners/frame_eval/metrics.py - Evaluation report
evaluation/runners/frame_eval/report.py
Other components
- Page reader
Connections 22
- Page reader → Page overlay: selects text
- Page overlay → Content entry: renders through
apps/extension/src/content/index.ts - Content entry → Page overlay: mounts
apps/extension/src/content/index.ts - Page overlay → Background worker: sends request
- Background worker → API client: calls
apps/extension/src/background/index.ts - Background worker → Extension settings: reads
apps/extension/src/background/index.ts - API client → Analyze endpoint: posts selection
- API client → Response contract: validates response
apps/extension/src/api/client.ts - Settings popup → Extension settings: reads and saves
apps/extension/src/popup/App.tsx - Analyze endpoint → Text normalizer: normalizes text
services/api/app/api/routes.py - Analyze endpoint → Gemini analyzer: invokes analyzer
services/api/app/api/routes.py - Analyze endpoint → Analysis pipeline: builds response
services/api/app/api/routes.py - Gemini analyzer → Model output schema: parses output
services/api/app/analysis/gemini.py - Model output schema → Analysis taxonomy: uses enums
services/api/app/analysis/model_output.py - Analysis pipeline → Evidence recovery: recovers excerpts
services/api/app/analysis/pipeline.py - Analysis pipeline → Provisional scoring: scores survivors
services/api/app/analysis/pipeline.py - Analysis pipeline → Response models: constructs response
services/api/app/analysis/pipeline.py - Response models → Analysis taxonomy: uses enums
services/api/app/models/analysis.py - Evaluation runner → Evaluation records: loads records
evaluation/runners/frame_eval/cli.py - Evaluation runner → Agreement metrics: computes metrics
evaluation/runners/frame_eval/cli.py - Evaluation runner → Evaluation report: creates report
evaluation/runners/frame_eval/cli.py - Evaluation report → Agreement metrics: summarizes metrics
evaluation/runners/frame_eval/report.py