fix(ledger): allocate the next anchor past every paragraph id - #188
Open
titanwings wants to merge 2 commits into
Open
titanwings wants to merge 2 commits into
titanwings wants to merge 2 commits into
Conversation
A later entry was reusing paragraph ids the previous entry still owned, and a second harvest of the same bytes stemmed another text file.
The single-copy harvest prints attributed=85. The old predicate still asked for 175.
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.
Why
同一人物的后一条来源会从自己的条目 id 起编段落。旧的
nextId只看条目 id,第二份材料从 k0002 起编,和第一份材料已经占用的段落撞号。第二次 harvest 比较的是磁盘路径和账本里的 raw 路径,同一字节被当成另一个来源,多写出一份正文。数据形状如下。
Scope
nextId取账本里所有条目 id 与所有段落锚点 id 的最大值加一。新条目的段落从它自己的 id 起连续编号。claimedByOther两侧都收成 raw/source/file 再比。同一字节、同一来源的第二次写入在编号和写正文之前返回,不追加账本,也不另写 text 文件。删掉 audit-tests 基线里这三行。
note— keeps the note's anchor distinct from the subtitle'sT30 原来把三条来源的条目 id 钉成 k0001、k0002、k0003。那是撞号时的值。修完后实测是 k0001、k0036、k0054,断言改成这个字面值。
Blast Radius
已有人物目录的锚点编号不会自动迁移。要新编号就重新 harvest。栈停在 dot-skill-test,dot-skill 保留。
us-house 的 acceptance.mjs 在 Node v22.14.0 重跑后,stdout 那一行是
FAIL · units=2744 speakers=18 attributed=85。计划 You see 里的 86 作废。acceptance-us-house 的字面谓词改成这一行。栈停在 dot-skill-test,dot-skill 保留。Verification
T30、T31、T32 由红转绿。基线从 22 行减到 19 行。
改前,Node v22.14.0:
改后,Node v22.14.0:
改后,Node v20.20.2:
node scripts/run-gates.mjs --without playwright在 Node v20.20.2 与 Node v22.14.0 都是 8/8 gates passed。新 head 上 Node v22.14.0 再跑仍是 8/8。npm test是 # tests 398、# fail 0。DISTILLY_PLAYWRIGHT_ROOT=/tmp/pw-root node scripts/run-gates.mjs --requires playwright在 Node v22.14.0 上是 3/3 gates passed。acceptance-us-house 含FAIL · units=2744 speakers=18 attributed=85。新用例在 base 上失败,在 head 上通过。base 是 Node v22.14.0。
nextId 用例失败:
二次 harvest 用例失败:
Rollback
回退 319e8c3 与 55dae80。已经 harvest 过的目录保持旧编号,不需要数据迁移。栈停在 dot-skill-test,dot-skill 保留。