An attempt at a news audit system to analyze biased or even fake journalism
An attempt at a news audit system to analyze biased or even fake journalism
Grouped repair:
bin/rails frank:repair_groupis dry-run by default. It prints an immutable projection and a copy-safe apply command containingMAIN_SLUG,NEWS_SLUGS,EVIDENCE_URLS,APPLY=1,DECISION_AT, andEXPECTED_DIGEST. Apply rejects aDECISION_ATmore than five seconds in the future.
Frank Investigator is a Rails 8.1 fact-checking pipeline for news articles. It assesses the claims in an article using an evidence graph, source authority analysis, and multi-model LLM consensus.
Submit a public article URL. Frank Investigator normalizes it, fetches the page with headless Chromium, extracts canonical claims, follows in-body citations, retrieves corroborating evidence, and produces a structured verdict for each claim with full provenance.
A fact does not become false because a million sources repeat a falsehood, and a falsehood does not become true because it is popular.
event_context and honest_headline so the parent report grows richer as siblings completebin/setup # Install deps, create DB, run migrations
bin/dev # Start Rails + Solid Queue via Procfile.devRequired environment variables:
OPENROUTER_API_KEY=your_key_here # Required when FRANK_INVESTIGATOR_LLM_PROVIDER=openrouter
OPENAI_API_KEY=your_key_here # Required when FRANK_INVESTIGATOR_LLM_PROVIDER=openai, and for direct OpenAI embeddingsOptional configuration:
…All API endpoints authenticate with a bearer token matching FRANK_AUTH_SECRET.
…Each list item returns slug, status (processing/completed/etc.), datetime,
completed_at, outlet, original_title, honest_title, summary,
investigation_url, and original_url. The q parameter matches a
case-insensitive substring against both the original article headline and the
generated honest headline.
Submission and report JSON expose pipeline_ready, evidence_current, and
ready. ready is true only when both the analysis pipeline and grouped
evidence reconciliation are current. A report with completed analysis but
pending or stale group evidence returns HTTP 202 (and ready: false); a fully
current report returns HTTP 200. Group payloads include member and evidence
states so terminal evidence failures remain observable.
Failed reports are terminal HTTP 200 responses and do not ask clients to poll.
Rejected or failed evidence is settled only when it is terminal and has no
active or scheduled retry; retryable failures keep the group unready.
bundle exec rails test # Full suite
bundle exec rails test test/path_test.rb # Single fileThe app deploys via Kamal to any server with Docker and SSH access.
Export these environment variables in your shell before deploying. Kamal reads them via .kamal/secrets, so you don't edit any secret files by hand.
export KAMAL_REGISTRY_USERNAME=your-github-username
export KAMAL_REGISTRY_PASSWORD=ghp_your_github_pat # PAT with write:packages scope
export OPENAI_API_KEY=sk-proj-...
export FRANK_INVESTIGATOR_LLM_PROVIDER=openai
export FRANK_INVESTIGATOR_LLM_MODELS=gpt-5-mini
export FRANK_AUTH_SECRET=$(openssl rand -hex 32)
export JOBS_AUTH_PASSWORD=$(openssl rand -hex 16)
export GOOGLE_ANALYTICS_ID=G-XXXXXXXXXX # OptionalSecret hygiene:
.kamal/secrets, .kamal/secrets., .kamal/secrets-common, config/deploy.env, or config/master.key..kamal/secrets.example and config/deploy.env.example.Then bootstrap the server:
bin/kamal setupPoint your DNS (A record) to the server IP for the hostname configured in config/deploy.yml.
bin/deploy # wrapper around bin/kamal deployAfter the first deploy that includes vector search, backfill embeddings for existing completed investigations so cross-reference can use the full corpus instead of only newly completed reports:
bin/kamal app exec -r web --reuse "bin/rails frank:index_embeddings[250]"Repeat that command until it reports no remaining work, or increase the batch size if the server has enough headroom.
If OpenRouter is still failing in production, switch embeddings to FRANK_INVESTIGATOR_EMBEDDING_PROVIDER=openai and set OPENAI_API_KEY before running the backfill.
…bin/rails 'frank:reanalyze[SLUG]' # Reset analysis-stage steps and rerun analyzers for one investigation
bin/rails 'frank:refresh[SLUG]' # Rebuild one investigation from stored snapshots and current heuristics
bin/rails 'frank:crossref[SLUG]' # Recompute related-investigation context for one investigation
bin/rails 'frank:index_embeddings[250]' # Backfill vector embeddings for completed investigations
bin/rails frank:crossref_all # Recompute related-investigation context for all completed investigationsUse frank:reanalyze when analyzer logic changes and you want a report to pick up new heuristics without re-fetching the source article.
Use frank:refresh when claim extraction, source-role classification, or parser cleanup changed and the investigation needs a full rebuild from stored article content without manual database edits.
config/deploy.yml defines the Kamal service (server, image, volumes, env).kamal/secrets pulls secrets from local env vars, so no raw credentials land in gitfrank_investigator_storage Docker volume persists SQLite databasesweb and worker containers for this app onlyweb role serves HTTP traffic and does not embed Solid Queue in Pumaworker role runs ./bin/jobs start and is not exposed through kamal-proxydefault and solid_queue_recurring, so recurring recovery/cleanup jobs are not strandedfetch queue to limit Chromium pressuresqlite-vec extension, then stores investigation embeddings in SQLite for related-investigation retrievalnot_checkable or needs_more_evidence, and opinion/blog amplification is downweighted automaticallybin/kamal deploy only touches containers labeled for the frank-investigator service.investigator.themakitachronicles.com.web and worker mount the same persistent /rails/storage path, so SQLite databases remain outside container lifecycle./opt/makita/content bind mount is still passed into both containers at /content.The repo still includes docker-compose.production.yml and config/deploy.env.example as legacy non-Kamal references. The old compose deployment mirrored the same split runtime:
web serves Rails/Thruster onlyworker runs Solid Queue onlyProduction deploys should use Kamal. bin/deploy is a safe wrapper around bin/kamal deploy so it cannot accidentally target stale compose/LAN settings.
All user-facing text is int
No open issues yet, or sync has not completed.