tessri.

What is unused: scan and reachability

tessri scan reads a repository once and gives every code file a status. Only reachability says a file is unused; activity orders and qualifies the candidates.

Every code file gets one status:

StatusMeaning
ACTIVEtouched in the last active_days (90), or not in git yet
STABLEnot touched recently, but other code depends on it. Normal.
DORMANTuntouched for dormant_days (365) and barely used
ORPHANno entry point, test or config reaches it: a cleanup candidate

Only reachability says a file is unused. Activity orders and qualifies the candidates; it never decides them. Files reached only from tests are listed separately: either production code lost its caller, or it is test support.

$ tessri why pkg/dead_dep.py
pkg/dead_dep.py  (Python, 1 code lines)
status:        ORPHAN (confidence high)
reachability:  NOT reachable from any entry point, test or config reference
depended on by: pkg/dead.py
named in config/scripts: none
mentioned in docs: none
depends on:    none
note:          only referenced by other unreachable files

Each edge why lists carries the kind of evidence behind it, as impact names them, when that is anything but an import statement: pkg/loader.py (string) depends on the file through a name in a string, pkg/__init__.py [STABLE] (package) is the package file Python runs for an import, and a hop on the reached via route reads scripts/run.py -(string)-> pkg/loader.py. An unmarked edge is an import.

The report's candidate table, most confident first:

FileCodeConfidenceLast commitNotes
pkg/dead_dep.py1high-only referenced by other unreachable files
pkg/dyn/z.py1high--
pkg/dead.py3medium-mentioned in docs: docs/guide.md

Confidence drops one level per reason a file may still be wanted: modified recently, added recently, not yet committed, mentioned in docs, lives under scripts//examples//tools/.

How is reachability decided?

A file is reachable if an entry point leads to it through imports, or a config reference names it. Tests are entry points of their own: code reached only from tests is reported as test-only.

Python

JavaScript / TypeScript (the scanner reads import, export ... from, require(), import(), new URL("./x", import.meta.url) and /// <reference path>; a .vue/.svelte/.astro file contributes its script blocks)

Deliberately not evidence of use, for any language: tool configs that merely list files (pyrefly.toml, mypy.ini, .coveragerc, lint sections), JSON data, docs, and anything under docs//reports/. Docs and data count as a mention, which lowers confidence but does not rescue a file.

A page (.html) is read in two parts. What it loads is wiring: a src, a <link href> and the code in its inline <script> blocks, so <script src="/src/main.tsx"> makes that file an entry point. What it says is a mention: its text, a hyperlink (<a href>) and any other attribute. A landing page that names pkg/core.py in a sentence documents the file, like a README does, and does not keep it alive. A page under docs/ is all mention.

A file name found in a config, a script or a string names a file only when it fits exactly one. A bare utils.py in a repository with ninety of them names none of them, and the report's caveats list such names with how many files each fits; give the reference a directory (pkg/utils.py) or list the files under entry, which is taken to mean every file it fits because you wrote it. The bare __init__.py and __main__.py never name a file.

Source: docs/guide/scan.md, Markdown in the repository; this page is built from it. Edit it on GitHub.