How shraman-c/codecanon works
codeCanon is a documentation-drift scanner for JavaScript/TypeScript repositories, exposed as a CLI, a local GUI, and an Agent Skill. Its main workflow scans a target repository for code facts and documentation claims, compares them deterministically, escalates ambiguous findings to an AI judge, optionally checks referenced images, and generates verified patch suggestions and reports. The CLI pipeline order and major capabilities are documented; some wiring is supported only by the SOURCE INDEX, so unsampled GUI and Skill internals are not expanded.
Main entry points: drift.py Scan CLI · extract_images.py Screenshot Claims · judge.py AI Judge · vision.py Image Vision
Components 19
User Interfaces
- Scan CLI
scripts/drift.py - Desktop GUI
scripts/gui.py - Agent Skill
SKILL.md
Fact and Claim Extraction
- Stack Detection
drift/detect.py - Route Facts
drift/extract_routes.py - Environment Facts
drift/extract_env.py - Package Facts
drift/extract_pkg.py - Port Facts
drift/extract_ports.py - Text Claims
drift/extract_docs.py - Screenshot Claims
drift/extract_images.py - Fact Claim Models
drift/models.py
Drift Evaluation
- Deterministic Matcher
drift/match.py - AI Judge
drift/judge.py - Image Vision
drift/vision.py - Gemma Client
drift/llm.py
Remediation and Reporting
- Patch Generator
drift/patch.py - Drift Reports
drift/report.py
Other components
- Developer
- Target Repository
Connections 18
- Developer → Scan CLI: runs scan
README.md - Scan CLI → Target Repository: scans
README.md - Developer → Desktop GUI: launches
README.md - Developer → Agent Skill: uses
README.md - Scan CLI → Stack Detection: detects stack
scripts/drift.py - Scan CLI → Route Facts: extracts routes
scripts/drift.py - Scan CLI → Environment Facts: extracts variables
scripts/drift.py - Scan CLI → Package Facts: extracts package facts
scripts/drift.py - Scan CLI → Port Facts: extracts ports
scripts/drift.py - Scan CLI → Text Claims: extracts claims
scripts/drift.py - Scan CLI → Screenshot Claims: extracts images
scripts/drift.py - Scan CLI → Deterministic Matcher: matches claims
scripts/drift.py - Scan CLI → AI Judge: judges findings
scripts/drift.py - Scan CLI → Patch Generator: generates patches
scripts/drift.py - Scan CLI → Drift Reports: writes reports
scripts/drift.py - Screenshot Claims → Image Vision: extracts image text
drift/extract_images.py - Image Vision → Gemma Client: uses model client
drift/vision.py - AI Judge → Gemma Client: requests verdicts
drift/judge.py