Repository navigation
docs(计划): v4 语法迁移——(乙) 大爆炸 + layout 一次做完;T0 布局规格 → T1…T7;判据三代换代表 + 反向规范化对拍 - #172
Merged
Merged
Conversation
…T3 拼接源 → T4 自源改写法 → T5 自源 parser → T6 语料 → T7 收尾重锁;判据三代换代表 + 反向规范化对拍(零构建下判 T4 只改形状)
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.
这是什么
docs/superpowers/plans/2026-09-24-v4-syntax-migration.md(1013 行 / 13 节)—— 把 Core 迁到 v4 目标语法的施工计划。维护者已定的前提(作为前提写死,计划不重新论证):策略 = (乙) 大爆炸(不开影子语法)· layout region 不可让步、一次做完。
(乙) 的三个后果,以及每个逼出哪一节
§二 判据纪律 = 本计划的第一等交付物
三代换代表(写死):代 0 采行为等价基线(76 档
rc + 诊断码集 + stdout)→ 代 1 挂起逐字节面(canary 5 值 /.ccr四条 /rebuild.sh3 sha /PINNED_REV)→ 代 2 重锁。并写实两个边界:corec2 == corec3与语法无关(不被迁移削弱),但它 (a) 在 (乙) 窗口内不可跑、(b) 不在 PR 门内。「中途坏了怎么定位」:(乙) 下按「能否构建」二分(
jj bisect)无效。计划给 L1 单档 / L2 单构造 / L3 单拼接单元三层(L2 的计数表在动手前先写死,含反向对照)+ B4「反向规范化对拍」:写一个 v4→v3 的机械还原器,断言reflow(v4) == v3逐档逐字节相同 —— 这是**批内唯一能在零构建下判定「T4 只改形状没改语义」**的机器,配正反两条断言(正向 74 档全绿;反向故意改错一个缩进 ⇒ 当场红)。七步顺序
T0 布局规格→T1/T2 Python 前端(自举链第一环,不可绕)→T3 Python 发的 Core 源(1 行改动 + 三处硬耦合)→T4 自源改写法(机械面:{}→layout、;→换行)→T5 自源 parser 改语义(真正实现 layout,必须晚于 T4)→T6 其余语料(必须晚于 T5)→T7 收尾重锁(显式归因 + 同批重锁 + 旧值留痕)。对两份侦查报告的 6 条更正(写手实核)
gap.md:现行关键字「34 个」mech.md:src/**struct 字面量 = 0src/内 2 处(src/compiler/elf.cr:45、src/stdlib/toml.cr:268)。成因 = 判别式用了Name{field:(带冒号),而真实写法是Name { field = value }(等号)。我(team-lead)已复核这两处mech.md:T4 后corec2==corec3仍可跑mech.md:corespec.ebnf零花括号{}(EBNF 重复记号;结论仍成立,表述要写实)写手新发现的两条(两份报告都没有)
src/compiler/parser.cr:552-554,第二个advance_tok()的返回值被丢弃)⇒=与:两形今天都收。所以 T0 输入「照现行形=」这句本身有歧义,必须二选一(计划给了两候选的改动面:选=改 9 档/18 处;选:改 8 档/14 处)。src/compiler/*.cr花括号 = 15,771(7,886 开 + 7,885 闭)—— 与我的读数独立复现一致。⚠ 一条工作区陷阱(写手报告,我复核确认)
core-v4-ws的@的父提交是旧 develop ⇒ 该工作区里tools/baseline/parity_run.sh与REBUILD.md是 #170 之前的版本。谁若把@原样提交并推到新 develop,就会静默回退 #170。 写手未动它们(铁律 #3),只报告。本 PR 只提交计划档一份(1 file changed, 1013 insertions(+))。待维护者裁的两条 T0 输入
Type { field = value }vsType { field: value })—— 因上面那条「盲跳」发现,两形今天都收,选哪个都不破坏既有代码。catch收口绑定到哪个对象(§6.2 真歧义)。本 PR 的实核与未核
src/ci/run.sh:122-124的 75 档引用(fix(tools): parity runner 计数失配收口——CORPUS_TOTAL 75→76(第一腿自 2026-09-18 恒红;#132 加语料未同步) #170 漏改,已另开 PR fix(ci): 补 #170 漏改的第三处——src/ci/run.sh 的「75 档 / CORPUS_TOTAL=75」 #171 补)· struct 字面量两处确实存在 ·parser.cr:548-558的盲跳确实无校验 · 工作区陷阱确实成立 · 计划档 1013 行 / sha256a705941e…/ 旧术语 9 词全 0 命中。