Private
Public Access
0
0
Files
manual_slop/scripts
ed 84fd9ac90e feat(scripts): add audit_weak_types.py for AI-readability analysis
AST-based static analyzer that identifies type signatures that reduce
code clarity and AI-readability. Targets:
- Dict[str, Any] / dict[str, Any] (302 findings)
- list[dict[...]] (115 findings)
- Optional[dict[...]] / Optional[tuple[...]] (11 findings)
- Tuple[...]/tuple[...] as anonymous structs (4 findings)
- Return tuples and assign tuples (4 findings)

The script also counts POSITIVE patterns (TypeAlias, NamedTuple,
@dataclass, pydantic.BaseModel) that already exist in the codebase.
Current count: 0. The codebase has zero strong type aliases.

Usage: python scripts/audit_weak_types.py [--json] [--top N] [--verbose]
Exits 0 (informational); exits 1 only on usage error.

Initial run on src/ found 430 weak sites across 29 files. The 4 most
common unique type strings (list[dict[str, Any]], dict[str, Any],
Dict[str, Any], List[Dict[str, Any]]) account for 86% of findings.
A focused track adding 4-6 type aliases would eliminate the vast
majority of the noise.

Output modes:
- human-readable (default): top N files with category breakdowns
- JSON (--json): machine-readable for tooling
- verbose (--verbose): every finding inline

Exit codes:
- 0: audit ran successfully (regardless of findings)
- 1: usage error (bad args, source dir not found)
2026-06-06 17:35:41 -04:00
..
2026-05-16 03:01:25 -04:00
2026-06-06 12:47:41 -04:00
2026-05-15 00:13:46 -04:00
2026-05-16 03:01:25 -04:00
2026-05-16 03:01:25 -04:00
2026-05-16 03:01:25 -04:00
2026-05-09 12:43:49 -04:00
2026-05-13 23:53:04 -04:00
2026-02-27 22:10:46 -05:00
2026-02-27 22:10:46 -05:00
2026-02-27 22:10:46 -05:00
2026-02-27 22:10:46 -05:00
2026-02-27 22:10:46 -05:00