Repository navigation
refactor(guards): three shell and JavaScript tools become proved plans - #307
Merged
Merged
Conversation
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
force-pushed
the
a/migrate-shell-to-plans
branch
from
October 4, 2026 15:53
73de766 to
02fa7a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Перенос оснастки с оболочки и JavaScript на планы flang — перепись всех 85 файлов
и первые две волны переноса.
Что снято и чем заменено
flang/scripts/word-occupancy.mjsflang/scripts/word-occupancy.fscript, ярлыкword:occupancyscripts/seed/seed-freshness.shseed:freshness(план был заведён ещё задачей 5821)execбез"$@"; единственный зовущий спрашивал--chto "доля доказанного", а проверка отвечала про «эту проверку»scripts/guards/version-derivations-guard.shscripts/guards/version-derivations-guard.fscript--строгоотвечает «ДОКАЗАНО» — 15 утверждений из 15, сетка 0, на веру 0Числа дерева: файлов
*.sh52 → 50 (строк 9756 → 9558), файлов*.js,*.mjs49 → 48 (строк 22 965 → 22 660), файлов вне flang 194 → 193 (ствол за сутки
прибавил два), долг оболочки 52/5629 → 50/5431. Все числа сняты приборами
(
prose-numbers-guard— 209 примет из 209,inventory:languages), а непосчитаны на бумаге.
Отрицательный контроль на каждый перенос
Без него перенос не считается сделанным.
docs/examples/rosetta/quicksort.flangподложено голоеимя свободного слова «кракозябра». И снимаемый файл, и план покраснели
одинаково: «голым именем: 3», те же три места, код 1. На чистом дереве оба —
ноль и код 0. Возврат проверен
git status.scripts/guards/published-vs-tree.shпринудительносделан ненулевым:
--доляушёл в ветку «СЕМЯ ОТСТАЛО», счёт плохих мест5 → 6, код 1. Возврат проверен прогоном.
только строку
.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не гонялись по прямому запрету владельца.