How manoj-gif-b/silent-change-detector works
Silent Change Detector investigates a company’s public disclosures and produces one evidence-backed financial finding. The principal workflow runs from document ingestion and KPI extraction through anomaly detection, hypothesis formation, adversarial review, and report assembly. A supporting layer provides arithmetic, period handling, prompts, configuration, caching, and LLM access. The repository also contains a web API and a Next.js interface; their detailed wiring is not established by the sampled backend excerpts, so those links are shown as unverified. The README documents the Streamlit dashboard, but its component internals were not sampled.
Main entry points: run.py CLI runner · detectors.py Anomaly detectors · hypothesis.py Claim and timeline · llm.py Gemini and offline LLM
Components 22
Entry and interface
- CLI runner
run.py - Web API
api.py - Streamlit dashboard
app.py - Web interface
web/src/app/page.tsx - API client
web/src/lib/api.ts - Evidence selection
web/src/components/evidence-context.tsx
Disclosure research
- Document ingestion
ingest.py - KPI ledger
ledger.py
Finding analysis
- Anomaly detectors
detectors.py - Claim and timeline
hypothesis.py - Adversarial review
redteam.py - Report assembly
report.py
Shared services
- Verified arithmetic
scd/arithmetic.py - Period handling
scd/periods.py - Gemini and offline LLM
scd/llm.py - Disk cache
scd/cache.py - Chunking
scd/chunking.py - PDF parsing
scd/pdf.py - Configuration
scd/config.py - LLM prompts
scd/prompts.py - Offline demo data
scd/demo.py
Other components
- Researcher
Connections 32
- Researcher → CLI runner: names company
README.md - CLI runner → Document ingestion: starts ingestion
run.py - Document ingestion → PDF parsing: parses PDFs
ingest.py - Document ingestion → Chunking: chunks text
ingest.py - Document ingestion → Disk cache: caches downloads
ingest.py - CLI runner → KPI ledger: builds ledger
run.py - KPI ledger → Gemini and offline LLM: extracts KPIs
ledger.py - CLI runner → Anomaly detectors: scores anomalies
run.py - Anomaly detectors → Verified arithmetic: computes comparisons
detectors.py - Anomaly detectors → Gemini and offline LLM: tags narrative
detectors.py - Anomaly detectors → LLM prompts: uses templates
detectors.py - CLI runner → Claim and timeline: builds claim
run.py - Claim and timeline → Anomaly detectors: ranks anomalies
hypothesis.py - CLI runner → Adversarial review: tests claim
run.py - Adversarial review → Claim and timeline: challenges claim
redteam.py - Adversarial review → Gemini and offline LLM: assesses evidence
redteam.py - CLI runner → Report assembly: assembles report
run.py - Report assembly → Researcher: saves finding
README.md - Claim and timeline → Period handling: normalizes timeline
hypothesis.py - Claim and timeline → Gemini and offline LLM: phrases finding
hypothesis.py - KPI ledger → LLM prompts: uses templates
ledger.py - Gemini and offline LLM → Disk cache: caches responses
scd/llm.py - CLI runner → Offline demo data: enables demo
run.py - Researcher → Web API: requests analysis
- Web API → CLI runner: dispatches run
api.py - Web API → Report assembly: serves reports
api.py - Researcher → Web interface: uses interface
- Web interface → API client: requests API
- API client → Web API: calls API
- Web interface → Evidence selection: selects evidence
- Streamlit dashboard → Report assembly: shows finding
README.md - CLI runner → Configuration: reads settings
run.py