Skip to content
LegacyExodus

Every file accounted for: the discovery invariant

Before any analysis, the engine proves it has looked at everything. One equation, enforced on every run, and what it caught in Express.

October 12, 20263 min readDiscovery · VyrixScout

Most tools report what they found. Fewer report what they skipped. A migration cannot afford the difference: the file you never looked at is the one holding the edge case.

The equation

discovery accounting invariant
filesDiscovered = analyzed + parserFailures + symbolFailures
                + unsupported + nonSource + unclassified

Every discovered file lands in exactly one bucket, and the buckets must sum to the total. A parser failure is not silently dropped: it is reported by path and error code. Non-source artifacts such as JSON, Markdown and licenses are inventoried as such rather than misreported as unsupported source.

Share of discovered files per bucket, per repository. The invariant held with zero discrepancy in all eight.
RepositoryDiscoveredAnalyzedNon-sourceUnclassifiedUnsupported
ms92700
cookie-parser1221000
debug137600
express-session25131200
legacy-exodus-core111951600
express23415248340
LegacyExodus383138212330
fastify3852879701
Discovery accounting

What it caught

Express left 34 files unclassified, mostly view templates (EJS, Pug, Handlebars) and test fixtures. The invariant still holds, because unclassified is a bucket, but the benchmark marks Express completeness as NEEDS_REVIEW instead of PASS. Milestone P2.1 teaches the classifier those formats.

On commander@15.0.0 the run discovered 12 files: 7 analyzed, 4 non-source and 1 parser failure, typings/index.d.ts, reported with code DeclarationMissingInitializer. A declaration file the parser does not yet accept, named rather than hidden.

Run the same checks on your codebase.