fix(process): import and type-only lines no longer raise risk (#755)

The risk table of #707 judged every non-comment line of a class A file as
code. On the history since 15.09 that raised #741 from ship to show for a
removed interface member that never reaches JS, and put false classes on
#624 (removed imports), #693/#694 (stairs-view is rendering, not geometry)
and #725 (the config fingerprint memo is not the config schema).

- Lines of module syntax and TypeScript types give no risk, like comments:
  `import …`, `export … from …`, `export type …`, the head of `interface X`
  or `type X =`, and the lines inside such a block (indented, plus the
  closing line). The block state per side of a change block starts from the
  hunk context git writes after `@@ … @@` and follows every unindented line
  of the block, so a member under `@@ … @@ export interface X {` and a whole
  interface added in one hunk are judged alike. Only `.ts`, and not in the
  `migration` area: there the types are the config contract (#588, #649).
- `stairs*` is narrowed to the stairs model (`stairs`, `stairs-box`,
  `stairs-editor-model`); `config-*` to writing and adopting the config
  (`config-adoption`, `config-store`, `config-reload-authority`,
  `config-write-conflict`).
- A replaced line is one piece of evidence: a removed line whose counterpart
  in the same change block hits the same class is folded into it instead of
  printing `path:N (удалена)` next to `path:N`.

classifyRisk stays a pure function over the diff text. On the history the
raising classes change for #741 (none), #693 (visual only), #694 (no
geometry), #725 (perf only) and #624 (no devices/perf); migration on #588,
#612, #649 and #661 stays. PROCESS.md §5 names the new exemption.

Issue: #755
User-Visible: no
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018qZfe7YS4rqEMKoVeS3GKd
This commit is contained in:
Claude
2026-10-01 12:18:02 +00:00
committed by claude[bot]
parent 707cb18f7e
commit c23bbcd7d9
3 changed files with 228 additions and 10 deletions
+3 -1
View File
@@ -623,7 +623,9 @@ patch-id кандидата слияния: вердикт к работе за
строки файлов класса A — дифф `git diff --unified=0` от merge-base с `dev`
(`scripts/change-risk.mjs`). Правило «участок» — любая изменённая строка кода в
файле из списка, правило «токен» — токен в изменённой строке; пустые строки,
комментарии и чистое переименование риска не дают, удаление кода — даёт.
комментарии и чистое переименование риска не дают, а также строки импорта и
строки только типов TypeScript (кроме файлов участка `migration`: типы конфига —
контракт, #755); удаление кода — даёт.
Классы: `geometry`, `touch`, `migration`, `devices`, `perf`, `ux` и `visual`
(области `render` — путь отрисовки плана — и `ui` — стили интерфейса). Таблица
путей и токенов — эвристика и живёт в скрипте.