Repository navigation
refactor(guards): two shell guards are checked by proved plans - #312
Merged
Merged
Conversation
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
force-pushed
the
a/share-and-forgery-guards-to-plans
branch
from
October 4, 2026 18:04
97ed83c to
57d1787
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.
Что сделано
Сняты два сторожа на оболочке и заведены на их месте два плана:
scripts/guards/proved-share-vs-tree.sh…-vs-tree.fscript, планыCheck,Numbers,Forgeryscripts/guards/guards-without-forgery-probe.sh…-probe.fscript, планыCheck,Census,List,ForgeryОба приговора ДОКАЗАНЫ ядром целиком, поэтому ярлыки идут без
--на-веру.Довод переписи проверен прогоном, а не принят
Перепись (
docs/shell-to-flang-census.md) держала первого сторожа доводом«место вызова — хук до сборки двоичного». Довод мёртв, и это замер, а не
рассуждение:
cat .githooks/pre-pushexec bootstrap/flang io .githooks/pre-push.fscript— хук сам план с задачи 1219, двоичный к этому часу обязан бытьbinary.yml?grep -n './bootstrap/flang' binary.ymlCheck proved shareВторого держал довод «разборщик YAML (
pyyaml)». Он снят не словами, а соседом:who-calls-the-guards.fscriptуже берёт ключиrun:разбором отступов, и этотплан его ввозит, а не переписывает второй разборщик. Нового только
группировка строк в ТЕЛА (
exit 1обязан стоять в том же теле, что условие) иодна правка, которой соседу не нужно: точка с запятой отрезается от слова перед
тем, как читать его как путь — ровно как это делал python. Без неё две позванных
пробы (
licenses:check,emit-promises:check) терялись, и перепись давала32/45 вместо 34/43.
Чем доказан перенос
Оба сторожа прогнаны на ОДНОМ дереве, и ответы сошлись знак в знак.
diffпустdiffпуст--список/List, 43 имениdiffпуст--check/CheckСнятые числа (замер на этой ветке):
Отрицательный контроль, пять порч описи и переписи — на каждой оба краснеют
кодом 1 и называют одни и те же слова:
«НАПИСАНО» НЕ СХОДИТСЯ: docs/benchmark/01-link-key.flang — 2 против 1НЕТ СТРОКИ: … несёт 1 обязательствЛИШНЯЯ СТРОКА: docs/there-is-no-such-file.flangНОВЫЙ БЕЗ ПРОБЫ: «tab-host:check»ЗАПИСЬ СТАЛА НЕПРАВДОЙ: «links:check» … проба стоит в ci.ymlУ каждого плана своя проба на подлог, и порча идёт В ПАМЯТИ: ни один файл
дерева не трогается, откатывать нечего даже если прогон убьют на середине.
Прежняя проба оболочки правила опись НА ДИСКЕ и возвращала её копией — на убитом
прогоне опись оставалась порченой. Сторон четыре у доли и пять у проб порчи, и
среди них есть нулевая: «как есть, бед быть не должно».
Проба на подлог сама проверена подлогом. У обоих планов выпотрошена
«Troubles of»(возвращает пустой список на любом входе) — и оба планаForgeryотвечают кодом 0 и называют каждую сторону, которую не показали:
ПОДЛОГ НЕ ПОЙМАН — сторона вторая: ждали слова «НЕТ СТРОКИ», а бед найдено 0.Коды у этих планов перевёрнуты (1 — пойман, 0 — промолчал), и шаги CI написаны
if <проба>; then «сверка промолчала»; exit 1; fi.Заслоны
proved-share-tree:check(сам перенесённый сторож)13|13|0|0|0и11|11|0|0|0, снятыtake-proof-ledger.fscriptforgery-probe:checkguard-calls:check:checkзовутся из CIinventory:checkprose-numbers-guardshortcut-collectorlint:growth/flang lintlinks:checkfile-extensions:checkВосемь мёртвых путей (имена снятых файлов в ЗАКРЫТЫХ записях задач 1177,
1188, 2277, 3593, 4416, 4433 и 5821) вписаны в
scripts/ledgers/link-guard-known-not-a-path.tsvс доводом «история»:переписывать их значило бы соврать о том, как файл назывался тогда. Сторож
называет по одной цели на файл, поэтому первые четыре записи прятали за собой
ещё четыре — число снято тремя прогонами: 92 без записей, 89 с семью (одна была
заведена голым именем, а задача цитирует путь целиком), 88 с восемью.
Числа прозы
Перенос снял 414 строк оболочки, и каждую сдвинутую примету снял её прибор:
docs/tree-inventory.md)binary.yml,ci.yml)Столбец «осталось в
scripts/» переписи НЕ тронут. Вся та таблица — замер23 сентября, и
41 − 2было бы арифметикой над протухшей базой, выданной зазамер: тем же прибором сегодня в
scripts/**9 файлов и 6 169 строк, потомучто папку худили и чужие работы. Перепись теперь называет оба числа с их датами.