feat(site): the registry page is printed from the ledger - #316
Merged
Merged
Conversation
ADR-0059 says the registry is a ledger of names served as a plain file over HTTP. Until now the ledger lived only in the tree: there was nowhere to see it, and its fingerprints rotted unseen -- four of the seven parted from the files, because no CI job called the registry at all (task 4909). What is new: * scripts/site/registry-page.fscript -- two plans. The printing plan reads scripts/registry-example/registry.list, recomputes sha256 of every address, compares it with the fingerprint field, and only then prints both halves of the site page. One character apart and the page is not printed at all: the plan fails with FLANG_REESTR_OTPECHATOK, exit code 1, naming the record, the address and both fingerprints. The publishing plan lays the ledger into the built site, with the same comparison on the way in. * docs/site/registry.ru.md and docs/site/registry.md -- the page itself, both halves printed by the run. Its table is a reversible encoding of the ledger: strip the leading and trailing pipes, drop the backticks, and the rows are the ledger lines again. So "the table agrees with the ledger" is answered by diff, not by eye. * The ledger is served at a stable address inside Pages, https://digitable-lol.github.io/flang/registry.list -- the address the page names and the one the HTTP order of the language fetches. * .flangrc -- two shortcuts, registry:page and registry:publish. Both are called by name from .github/workflows/pages.yml, so the guard of uncalled shortcuts stays green. * pages.yml reprints the page before the build, probes the check with a bent fingerprint (a red that does not name the planted record fails the step), and publishes the ledger after the build, because the build wipes the output directory. The four rotted fingerprints in scripts/registry-example/registry.list are rebuilt by the tool that owns them; only those four lines changed, and the check now answers "fingerprints agree for every record: 7". docs/site/packages.ru.md and its English half no longer say there is no registry: they link to the page and say what the registry is and is not. docs/tree-inventory.md and docs/javascript-inventory.md carry the five JavaScript lines added to docs/site/sitemap.mjs: 22660 becomes 22665.
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.
Решение ADR-0059 говорит: реестр — это ведомость имён, строчный файл из
пяти полей, раздаваемый обычным файлом по HTTP; он отвечает адресом, а не кодом.
До этой ветки ведомость лежала только в дереве — увидеть её было негде, и
отпечатки в ней гнили: четыре из семи разошлись с файлами, потому что реестр
не звала ни одна работа CI (задача 4909).
Адрес, по которому ведомость ляжет на Pages
Что в ветке
scripts/site/registry-page.fscript— два плана. «Напечатать страницуреестра» читает
scripts/registry-example/registry.list, пересчитываетsha256каждого адреса, сличает с полем «отпечаток» и только потомпечатает обе половины страницы. Разошёлся знак — страница не печатается
вовсе:
FLANG_REESTR_OTPECHATOK, число выхода 1, названы запись, адрес и обаотпечатка. «Выложить ведомость» кладёт ведомость в собранный сайт — с тем же
сличением на входе.
docs/site/registry.ru.mdиdocs/site/registry.md— страница, обеполовины напечатаны прогоном. Таблица — обратимая запись ведомости: снять
«| » слева, « |» справа и обратные кавычки — и получаются строки ведомости.
Поэтому «таблица сходится с ведомостью» отвечает
diff, а не глаз..flangrc— две короткие команды,registry:pageиregistry:publish;обе зовутся по имени из
pages.yml, иguard-calls:checkзелен.pages.yml— перепечатка страницы до сборки, проба подлогом(подкрученный знак обязан покраснеть И назвать именно эту запись), выкладка
ведомости после сборки (сборка вычищает
docs/site/outцеликом).(
registry-tool.fscript, план «Собрать реестр»); изменились ровно четырестроки, сверка теперь отвечает «отпечатки сошлись у всех записей реестра: 7».
Доказательства прогонами
flang run-script registry:pageНапечатано: записей 7, обе половины страницы; отпечатки сошлись у всех, код 0diffтаблицы, приведённой тремя заменамиsed, с телом ведомостиFLANG_REESTR_OTPECHATOK, названа ровно эта запись и оба отпечатка; страница не тронута; ведомость возвращена,cmpсошёлсяnode docs/site/build.mjs --checkстраниц 833, битых ссылок 0;пар не хватает 0inventory:checkопись сходится с docs/tree-inventory.md: сверено языков 17prose-numbers-guard --plan Checkпримет 209: сошлось 209, разошлось 0scripts:checkобъявлений 140: сошлось знак в знак 140, расходится 0guard-calls:checkсторожа без зова: 28, все названы в ведомостиproved-share-vs-tree.shопись сходится с деревомРабота
Docs siteна запросе слияния зелена целиком, и новые шаги в нейпрошли:
Rebuild registry page→Напечатано: записей 7 … отпечатки сошлись у всех,Probe registry fingerprint→ подлог покраснел и назвал запись. ШагPublish the registry ledgerна запросе слияния пропускается по устройствуработы (выкладка идёт только с пуша в
main); локально он проверен: кладёт1300 байт в
docs/site/out/registry.list,cmpс ведомостью дерева сошёлся.Все проверки запроса слияния: 25 pass, 7 skipping, 0 fail.
--no-verifyне применялся: ветка прошлаpre-commitиpre-pushкак есть(две правки по их замечаниям — убраны комментарии из
.fscriptи снят--на-веруу обеих коротких команд).Долги ствола, не этой ветки
links:check— битых путей 88 и на базе, и на ветке:origin/dev—88 из 7130, ветка — 88 из 7140 (путей стало на 10 больше, битых — столько же).
Биты 88 путей на 36 файлах, ни одного из них ветка не трогала (задача 9807).
uncalled-checks:check— 2 проверки без зова(
flang/proof/probes/kernel-memo/run.fscript,flang/proof/probes/text-block/tokens.fscript), обе есть наorigin/dev.module-names:check— 19 модулей без английского имени, все.flangивсе с
origin/dev.