Просмотр исходного кода

Give the dead-field sweep a real trigger and command

Paul Klumpp 1 неделя назад
Родитель
Сommit
7294c01874
1 измененных файлов с 11 добавлено и 2 удалено
  1. 11 2
      AGENTS.md

+ 11 - 2
AGENTS.md

@@ -186,8 +186,17 @@ see *Typed access* below for why that trade hides real bugs.
 written but never read: Ruff's F841 stops at locals, and pyright counts an
 written but never read: Ruff's F841 stops at locals, and pyright counts an
 attribute assignment as a use. Leftovers from long-gone features therefore
 attribute assignment as a use. Leftovers from long-gone features therefore
 survive indefinitely (`_dedup`, `_resume_cursor`, the `_ws_*` trio and the
 survive indefinitely (`_dedup`, `_resume_cursor`, the `_ws_*` trio and the
-`_token`/`_user_*` mirrors all lived here unnoticed). Every few feature
-cycles, sweep the adapter's `self.*` fields: count assignments vs. other
+`_token`/`_user_*` mirrors all lived here unnoticed). Run the sweep whenever
+a feature is removed from or reworked in the adapter — that is when its
+state gets orphaned:
+
+```bash
+git grep -hoE 'self\.[a-z_][a-z0-9_]*' -- '*.py' ':!vendor' \
+  | sort | uniq -c | sort -n
+```
+
+A low count is a suspect, not a verdict — a lone mention can be dead data,
+but just as well a one-shot helper method. Count assignments vs. other
 mentions per name, confirm each suspect against the test fixtures and the
 mentions per name, confirm each suspect against the test fixtures and the
 Hermes base class, and delete whatever nothing touches.
 Hermes base class, and delete whatever nothing touches.