Files
hermes-agent/scripts
Teknium cf7dc01a37 fix(code-health): TypeScript identity by object, token hash, fail closed on syntax errors
Why (round-5 review, unsupportedpastels M3/m1/m6 + §3; Adolanium, helix4u):
- M3: methods of object literals were named `f`, `f#2` and paired by position, so swapping
  two objects gave b.f a.f's cap of 31 (V9a). They are now named by the variable/property
  that holds the object (`a.f`, `b.f`). Overload signatures (and `declare`/abstract
  signatures) have no body and are no longer units, so adding an overload no longer shifts
  the implementation to `old#4` and makes it new code (V10a).
- m1: the body hash covered raw text, comments included, so rename + one comment line was new
  code in TS (not in Python). It now hashes the parser's token stream (no comments, no
  whitespace, no JSDoc), collected once per file.
- §3 (Adolanium, helix4u): `export function f(x: number {` exited 0 because the parser
  recovers and sf.parseDiagnostics was never read. A file with parse diagnostics is now an
  error -> MEASURE (fails closed), like unparseable Python. No tracked TS file in the tree
  has parse diagnostics (4191 files checked).
- m6: the header documents exactly where the CC count deviates from ESLint's complexity
  (optional chaining, &&=/||=/??=, default parameters are not counted).
Units also carry their end line (`end`), for body-similarity pairing.
2026-10-04 21:29:39 -07:00
..