Skip to content

refactor(guards): three shell and JavaScript tools become proved plans - #307

Merged
the-homeless-god merged 5 commits into
devfrom
a/migrate-shell-to-plans
Oct 4, 2026
Merged

the-homeless-god merged 5 commits into
devfrom
a/migrate-shell-to-plans

Conversation

@the-homeless-god

Copy link
Copy Markdown
Member

Перенос оснастки с оболочки и JavaScript на планы flang — перепись всех 85 файлов
и первые две волны переноса.

Что снято и чем заменено

снято строк чем доказано прогоном
flang/scripts/word-occupancy.mjs 305 план flang/scripts/word-occupancy.fscript, ярлык word:occupancy на слове «неотрицательное» оба дали «файлов 1297, голым 553, цепочкой 0, в ёлочках 0, в строке 128, в комментарии 0», те же места и тот же код возврата
scripts/seed/seed-freshness.sh 3 ярлык seed:freshness (план был заведён ещё задачей 5821) переходник ТЕРЯЛ довод — exec без "$@"; единственный зовущий спрашивал --chto "доля доказанного", а проверка отвечала про «эту проверку»
scripts/guards/version-derivations-guard.sh 195 план scripts/guards/version-derivations-guard.fscript слово согласия совпало с прежним знак в знак; --строго отвечает «ДОКАЗАНО» — 15 утверждений из 15, сетка 0, на веру 0

Числа дерева: файлов *.sh 52 → 50 (строк 9756 → 9558), файлов *.js,*.mjs
49 → 48 (строк 22 965 → 22 660), файлов вне flang 194 → 193 (ствол за сутки
прибавил два), долг оболочки 52/5629 → 50/5431. Все числа сняты приборами
(prose-numbers-guard — 209 примет из 209, inventory:languages), а не
посчитаны на бумаге.

Отрицательный контроль на каждый перенос

Без него перенос не считается сделанным.

  • word:occupancy — в docs/examples/rosetta/quicksort.flang подложено голое
    имя свободного слова «кракозябра». И снимаемый файл, и план покраснели
    одинаково: «голым именем: 3», те же три места, код 1. На чистом дереве оба —
    ноль и код 0. Возврат проверен git status.
  • seed:freshness — зов в scripts/guards/published-vs-tree.sh принудительно
    сделан ненулевым: --доля ушёл в ветку «СЕМЯ ОТСТАЛО», счёт плохих мест
    5 → 6, код 1. Возврат проверен прогоном.
  • version-derivations — план «Подлог» копирует дерево ВНЕ дерева, разводит
    только строку .TH на 9.9.9 и требует от себя же кода 1 И слова
    packaging/flang.1. Код 1 получен, /srv/tmp/verderiv-podlog.* после прогона
    не остаётся. Ветви «проба холоста» и «подлог не пойман» — примеры в файле.

Названная смена поведения: проба порчи теперь отдаёт код 1, когда подлог
пойман, а оболочка отдавала 0. Это уговор дерева для всех планов «Подлог», и
ci.yml обёртывает зов так же, как у соседей.

Чего это НЕ делает, и почему

Перепись всех 85 файлов — /home/b/projects/flang-migrate-notes/census.md
(вне дерева). Коротко про остающихся:

  • четыре файла держит красный или слепой двойник, и подменять им живой
    прибор нельзя: count-guard.mjs (двойник красен — 9 чисел прозы разошлись),
    name-guard.mjs (двойник красен — 4877 мест долга в 210 файлах),
    one-string-measure-guard.sh (сам красен — 20 разладов из 23 сверок),
    link-collision-guard.mjs (двойник link-collision-guard.fscript видит
    «файлов 44» там, где mjs видит всё дерево и 86 столкновений; полный двойник
    link-collision-tree.fscript за 40 минут не ответил — задача 7192);
  • три файла зовутся до того, как двоичный есть, и планом быть не могут:
    scripts/bootstrap-reprint.sh (сам и есть точка раскрутки),
    scripts/guards/overlong-string-guard.sh (обязан отвечать именно когда семя
    не собирается), scripts/guards/module-origin-guard.sh (сторож обязан быть
    неуязвим для того, что стережёт);
  • мосты в чужие среды: docs/examples/web/browser-probe.sh и
    docs/examples/web/wasm/probe.mjs ведут настоящий браузер,
    docs/editors/vim/checks/*.sh — настоящий Vim, docs/site/search-check.mjs
    поднимает браузерный search.js через node:vm и проверяет ТОТ ЖЕ файл,
    который читает браузер;
  • docs/benchmarks/speed/programs/tasks.mjs — это и есть замеряемая
    реализация на JavaScript
    , соседка tasks.py; снять — сломать замер. Имя
    обманывает: tasks.flang рядом — другая сторона того же замера.

Один довод в дереве оказался устаревшим и назван в переписи:
docs/editors/vim/checks/stream.sh говорит «такого поля в словаре поручений
нет вовсе», а поручение «Запустить процесс с вводом» с полем ввод в словаре
есть. По существу довод держится — оно отдаёт ввод и ЖДЁТ конца, а проверка
меряет байты за две секунды при ОТКРЫТОМ вводе, — но написан он про вчерашний
словарь.

Заслоны

Хук перед пушем: 21 проверка, все зелены, 66 с. Сторож ссылок на этой ветке
даёт 91 битый путь из 6874 — ровно столько же, сколько на базе d27d0a7cb:
перенос добавил шесть мёртвых путей, пять из них внесены в
scripts/ledgers/link-guard-known-not-a-path.tsv как записи о прошлом с
доводом и названием плана, который делает ту же работу, а шестой
(docs/guide/settings.ru.md) — живое наставление и переписан на план.

counts:check и numbers:check не гонялись по прямому запрету владельца.

Two twins proved equal by running, not by reading the file names.

flang/scripts/word-occupancy.mjs (305 lines) removed. The plan
flang/scripts/word-occupancy.fscript answers the same on the whole
corpus: for the word "neotricatelnoe" both print files 1297, bare 553,
chain 0, in-brackets 0, in-string 128, in-comment 0, the same list of
places and "541 more", and both exit 1. Negative control: a bare
occurrence injected into docs/examples/rosetta/quicksort.flang turns
both red with 3 places and exit 1; reverted. Shortcut word:occupancy
now calls the plan; its phrases come from
flang/scripts/word-occupancy.words, one per line, and that file is
ignored by git for the same reason as the probe above it.

scripts/seed/seed-freshness.sh (3 lines) removed. It was a shim over
scripts/seed/seed-freshness.fscript that also LOST its argument: exec
without "$@", so the only caller asked --chto "dolya dokazannogo" and
the check answered about "eta proverka". The caller
scripts/guards/published-vs-tree.sh now runs the shortcut
seed:freshness --what; negative control: forcing that call non-zero
makes --dolya print "SEMYA OTSTALO" and count a bad place.

Counted after the change: shell 52 -> 51 files, 9756 -> 9753 lines;
JavaScript 49 -> 48 files, 22965 -> 22660 lines; tree outside flang
194 -> 192 files. All SNYATO marks and the inventory re-measured green.
scripts/guards/version-derivations-guard.sh (195 lines of shell) is
replaced by scripts/guards/version-derivations-guard.fscript. The plan
reads the five files with the "Read file" order and judges in flang;
no shell is left in the check path.

Measured, not promised:

  the sentence the plan prints when green is IDENTICAL to the one the
  shell printed, character for character, on this tree;

  flang check --proof --strict answers "PROVED": 15 obligations out of
  15, grid 0, on-trust 0. That is why the shortcut runs the plan WITHOUT
  --trust, unlike its neighbour version:check, whose own guard is not
  proved (7 grid, 8 declared-not-proved);

  negative control: the plan "Forgery" copies the tree outside it, drifts
  only the .TH line to 9.9.9, runs the guard against that copy and
  demands exit 1 AND the words packaging/flang.1 from it. Exit 1 is what
  it gets, the "blank probe" branches are examples in the file, and
  /srv/tmp/verderiv-podlog.* is gone afterwards;

  flang lint reports nothing: no line over 120 characters, no touched
  function deeper than 2 conditionals.

One named behaviour change: the forgery probe now exits 1 when the
forgery is caught, where the shell exited 0. That is the tree's own
convention for every "Forgery" plan, and ci.yml wraps the call the same
way its neighbours are wrapped.

Wiring: .githooks/pre-push.fscript calls the plan; .flangrc gains
version-derivations:check and :forgery; ci.yml gains both steps, the
probe before the check. guards-without-forgery-probe sees the pair
(43 guards without a probe, matches the ledger) and who-calls-the-guards
is green (28 uncalled, matches the ledger).

Counted after the change: shell 51 -> 50 files, 9753 -> 9558 lines; tree
outside flang 192 -> 191 files; shell debt 51/5626 -> 50/5431. All SNYATO
marks re-measured green (209 of 209) and the inventory re-printed.
The link guard counted 91 broken quoted paths on the base (origin/dev
d27d0a7) and 97 on this branch: the two moves add six, and five of
them are records of the past that must not be rewritten.

  docs/ct/spec.md and docs/tasks/0049 name flang/scripts/word-occupancy.mjs
  as the instrument that took a measurement that day;
  docs/tasks/1219 names scripts/guards/version-derivations-guard.sh as the
  file whose comment share was measured;
  docs/tasks/5821 names both removed files in its own struck-through items.

Each row says which plan does the work now. The sixth,
docs/guide/settings.ru.md, is live guidance and was repointed at the plan
instead of being excused.
bootstrap/flang run-script inventory:languages counts 50 files and 5431
lines of shell debt where the table still said 52 and 5629. The two
removed scripts, scripts/seed/seed-freshness.sh and
scripts/guards/version-derivations-guard.sh, were both debt.
scripts/guards/version-derivations-guard.fscript carries 15 obligations
and the kernel proves all 15, so the proved-share ledger gets
15|15|0|0|0 for it. Without the row proved-share-vs-tree stops the push:
a file with obligations that the ledger does not know makes every share
it prints a lie.
@the-homeless-god
the-homeless-god force-pushed the a/migrate-shell-to-plans branch from 73de766 to 02fa7a1 Compare October 4, 2026 15:53
@the-homeless-god
the-homeless-god merged commit 7e30748 into dev Oct 4, 2026
32 checks passed
@the-homeless-god
the-homeless-god deleted the a/migrate-shell-to-plans branch October 4, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant