Skip to content

refactor(guards): two shell guards are checked by proved plans - #312

Merged
the-homeless-god merged 5 commits into
devfrom
a/share-and-forgery-guards-to-plans
Oct 4, 2026
Merged

the-homeless-god merged 5 commits into
devfrom
a/share-and-forgery-guards-to-plans

Conversation

@the-homeless-god

@the-homeless-god the-homeless-god commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

Что сделано

Сняты два сторожа на оболочке и заведены на их месте два плана:

снято строк стало обязательств / доказано
scripts/guards/proved-share-vs-tree.sh 139 …-vs-tree.fscript, планы Check, Numbers, Forgery 13 / 13
scripts/guards/guards-without-forgery-probe.sh 275 …-probe.fscript, планы Check, Census, List, Forgery 11 / 11

Оба приговора ДОКАЗАНЫ ядром целиком, поэтому ярлыки идут без --на-веру.

Довод переписи проверен прогоном, а не принят

Перепись (docs/shell-to-flang-census.md) держала первого сторожа доводом
«место вызова — хук до сборки двоичного». Довод мёртв, и это замер, а не
рассуждение:

что проверено чем ответ
хук зовёт сторожа до двоичного? cat .githooks/pre-push НЕТ: exec bootstrap/flang io .githooks/pre-push.fscript — хук сам план с задачи 1219, двоичный к этому часу обязан быть
второе место вызова, binary.yml? grep -n './bootstrap/flang' binary.yml НЕТ: двоичный зовут на двенадцати шагах выше шага Check proved share
признаков из семи у файла? образец переписи НОЛЬ, как перепись и писала

Второго держал довод «разборщик YAML (pyyaml)». Он снят не словами, а соседом:
who-calls-the-guards.fscript уже берёт ключи run: разбором отступов, и этот
план его ввозит, а не переписывает второй разборщик. Нового только
группировка строк в ТЕЛА (exit 1 обязан стоять в том же теле, что условие) и
одна правка, которой соседу не нужно: точка с запятой отрезается от слова перед
тем, как читать его как путь — ровно как это делал python. Без неё две позванных
пробы (licenses:check, emit-promises:check) терялись, и перепись давала
32/45 вместо 34/43.

Чем доказан перенос

Оба сторожа прогнаны на ОДНОМ дереве, и ответы сошлись знак в знак.

что сверено старый новый ответ
отчёт доли, 14 чисел код 0 код 0 diff пуст
перепись проб целиком код 0 код 0 diff пуст
--список / List, 43 имени код 0 код 0 diff пуст
--check / Check код 0 код 0 одна и та же строка

Снятые числа (замер на этой ветке):

число
файлов с обязательствами в дереве 960
строк в описи доказанного 1128
сторожей в дереве 79
проба позвана 36
проба построена, но не позвана 13
проба не показана (долг) 43

Отрицательный контроль, пять порч описи и переписи — на каждой оба краснеют
кодом 1 и называют одни и те же слова:

подлог старый новый
«написано» первой мерной строки +1 код 1, «НАПИСАНО» НЕ СХОДИТСЯ: docs/benchmark/01-link-key.flang — 2 против 1 та же строка, код 1
первая строка описи вынута код 1, НЕТ СТРОКИ: … несёт 1 обязательств та же строка, код 1
строка о файле, которого нет код 1, ЛИШНЯЯ СТРОКА: docs/there-is-no-such-file.flang та же строка, код 1
первая запись ведомости вынута код 1, НОВЫЙ БЕЗ ПРОБЫ: «tab-host:check» та же строка, код 1
в ведомость вписан сторож с пробой код 1, ЗАПИСЬ СТАЛА НЕПРАВДОЙ: «links:check» … проба стоит в ci.yml та же строка, код 1

У каждого плана своя проба на подлог, и порча идёт В ПАМЯТИ: ни один файл
дерева не трогается, откатывать нечего даже если прогон убьют на середине.
Прежняя проба оболочки правила опись НА ДИСКЕ и возвращала её копией — на убитом
прогоне опись оставалась порченой. Сторон четыре у доли и пять у проб порчи, и
среди них есть нулевая: «как есть, бед быть не должно».

Проба на подлог сама проверена подлогом. У обоих планов выпотрошена
«Troubles of» (возвращает пустой список на любом входе) — и оба плана Forgery
отвечают кодом 0 и называют каждую сторону, которую не показали:
ПОДЛОГ НЕ ПОЙМАН — сторона вторая: ждали слова «НЕТ СТРОКИ», а бед найдено 0.
Коды у этих планов перевёрнуты (1 — пойман, 0 — промолчал), и шаги CI написаны
if <проба>; then «сверка промолчала»; exit 1; fi.

Заслоны

застава ответ
proved-share-tree:check (сам перенесённый сторож) код 0; оба новых файла взяли строки в описи: 13|13|0|0|0 и 11|11|0|0|0, сняты take-proof-ledger.fscript
forgery-probe:check код 0: долг 43, все названы в ведомости
guard-calls:check код 0: оба новых ярлыка :check зовутся из CI
inventory:check код 0: 17 языков, четыре столбца у каждого
prose-numbers-guard код 0: примет 209, сошлись все 209
shortcut-collector код 0: объявлений 143, расходится 0
lint:growth / flang lint строк длиннее 120 — 0; вложенность глубже 2 — 0
links:check битых на базе 88 из 7130, на ветке 88 из 7130, устаревших исключений 0 и там и тут — прибавки нет
file-extensions:check код 0

Восемь мёртвых путей (имена снятых файлов в ЗАКРЫТЫХ записях задач 1177,
1188, 2277, 3593, 4416, 4433 и 5821) вписаны в
scripts/ledgers/link-guard-known-not-a-path.tsv с доводом «история»:
переписывать их значило бы соврать о том, как файл назывался тогда. Сторож
называет по одной цели на файл, поэтому первые четыре записи прятали за собой
ещё четыре — число снято тремя прогонами: 92 без записей, 89 с семью (одна была
заведена голым именем, а задача цитирует путь целиком), 88 с восемью.

Числа прозы

Перенос снял 414 строк оболочки, и каждую сдвинутую примету снял её прибор:

примета было стало
оболочка, файлов/строк (docs/tree-inventory.md) 56 / 9 875 54 / 9 461
оболочка, долг файлов/строк 50 / 5 431 48 / 5 017
файлов *.sh (binary.yml, ci.yml) 50 / 9 558 48 / 9 144
файлов вне flang (три места) 193 191

Столбец «осталось в scripts/» переписи НЕ тронут. Вся та таблица — замер
23 сентября, и 41 − 2 было бы арифметикой над протухшей базой, выданной за
замер: тем же прибором сегодня в scripts/** 9 файлов и 6 169 строк, потому
что папку худили и чужие работы. Перепись теперь называет оба числа с их датами.

scripts/guards/proved-share-vs-tree.sh (139 lines) and
scripts/guards/guards-without-forgery-probe.sh (275 lines of shell with an
embedded python program) are gone. The same two checks now stand as
proved-share-vs-tree.fscript (13 obligations, all proved by the kernel) and
guards-without-forgery-probe.fscript (11 obligations, all proved).

The census (docs/shell-to-flang-census.md) held the first one back with
"the place where it is called is a hook that runs before the binary is
built". That argument is dead, and the run says so: since task 1219 the
hook IS a plan - .githooks/pre-push is two lines of
"exec bootstrap/flang io .githooks/pre-push.fscript" - so the binary must
already exist by the time the hook calls anything, and binary.yml calls
./bootstrap/flang twelve steps earlier.

The second one was held back by "a YAML parser (pyyaml)". That argument was
killed by a neighbour, not by words: who-calls-the-guards.fscript already
takes run: keys apart by indentation, and this plan imports that module
instead of writing a second parser. Only the grouping of lines into bodies
is new - "exit 1" has to stand in the SAME body as the condition - plus one
fix the neighbour does not need: a trailing ";" is stripped off a word
before it is read as a path, the way the python did it. Without it two
called probes (licenses:check, emit-promises:check) went missing.

Old and new were run on one tree and answered the same, sign for sign:

  proved share   the whole report, 14 numbers (960 files with obligations,
                 1128 ledger rows, 15761 postconditions, 10841 proved),
                 and all three ledger forgeries gave the same words and
                 code 1 in both
  forgery probe  census, --list and --check (79 guards, 36 called probes,
                 13 built and uncalled, 43 in debt; 43 names listed), and
                 both ledger forgeries gave the same words and code 1

Each plan carries a Forgery plan of its own, and each forgery works in
memory: no file of the tree is touched, so a killed run leaves nothing to
roll back. The old shell probe edited the ledger on disk and copied it
back. Both forgeries were run against a gutted copy of their own guard
("Troubles of" returning an empty list on any input): the gutted copy
answers code 0 and names every side it failed to show.

Both plans take their rows in the proved share (13|13|0|0|0 and
11|11|0|0|0), and the four paths of the removed shells that live on in
closed task records are entered in the link ledger as history.
The move took 414 lines of shell out of the tree, and every counted mark
that names them was re-measured by its own instrument, not guessed:

  docs/tree-inventory.md   shell 56/9875 files/lines -> 54/9461,
                           shell debt 50/5431 -> 48/5017
  three places             files of all non-flang languages 193 -> 191
  docs/javascript-inventory.md and the title of tree-inventory.md say 191

inventory:check answers code 0 (17 languages, four columns each) and
prose-numbers-guard answers code 0 (209 marks, all 209 agree with the
tree). The marks in binary.yml and ci.yml ride in the previous commit,
where the steps that call the two plans stand.

docs/shell-to-flang-census.md loses the argument it held the proved share
back with, and keeps the measurement that killed it. Both guards move from
the "it is stuck on" tables into "moved to flang", so the section counts
become 7 and 4.

The "left in scripts/" total of the summary table is NOT touched: the whole
table is a snapshot of 23 September, and 41 - 2 would be arithmetic over a
stale base dressed up as a measurement. The same instrument run today gives
9 files and 6169 lines in scripts/**, because other work shrank that folder
too, and the census now says so with both dates.
The link guard names one broken target per file, so the first four records
of the two removed shells hid four more behind them: tasks 1177, 1188 and
2277 cite scripts/guards/proved-share-vs-tree.sh, task 4433 cites
guards-without-forgery-probe.sh. All four are closed task records, where
the file is named as it was named then, so rewriting them would be a lie
about the past; they go into the ledger with that as the reason.

Measured, not guessed: links:check gives 88 broken of 7130 on the base
(origin/dev in a worktree of its own) and 88 on this branch with these
eight records in place. Without them the branch gave 92.
The record was written with the bare name guards-without-forgery-probe.sh
while task 4433 cites it as scripts/guards/guards-without-forgery-probe.sh,
and the link guard keys a record by the pair (file, target) exactly. With
the wrong key the run said both things at once: "the path leads nowhere"
AND "this record no longer fires - clean it out".

Measured: links:check gives 88 broken of 7130 and 0 stale records on this
branch, the same 88 of 7130 and 0 as origin/dev in a worktree of its own.
With the wrong key it was 89 and 1.
Two removals landed the same day: PR 310 took flang/translation/run.sh
and this branch takes two guards. The shell row of the census kept the
marks of only one of them: 55 files instead of 53, 9661 lines instead
of 9247. Numbers come from the guard run, not from arithmetic: marks
209, agreed 209, diverged 0.
@the-homeless-god
the-homeless-god force-pushed the a/share-and-forgery-guards-to-plans branch from 97ed83c to 57d1787 Compare October 4, 2026 18:04
@the-homeless-god
the-homeless-god merged commit 44a5246 into dev Oct 4, 2026
32 checks passed
@the-homeless-god
the-homeless-god deleted the a/share-and-forgery-guards-to-plans branch October 4, 2026 18:17
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