@240xu/dsh-message-ops 0.10.8 → 0.10.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/session-file.js +14 -0
package/package.json
CHANGED
package/src/session-file.js
CHANGED
|
@@ -340,6 +340,20 @@ export function computeShadowed(events) {
|
|
|
340
340
|
for (const e of events) {
|
|
341
341
|
const range = readReplaceOp(e);
|
|
342
342
|
if (!range) continue;
|
|
343
|
+
// M2′(0.10.9):反向区间 [start>end] —— 引擎 foldSurface 的替换遮蔽是
|
|
344
|
+
// 「节点索引序重算」(dsh-session/types/surface.js:299-327 replacementRange
|
|
345
|
+
// 用 nodes.indexOf + nodes.slice)。数值方向本身合法,宿主判 clean(语料
|
|
346
|
+
// afcc0453 的 9 个 compact-checkpoint 反向 marker 复演实证,m2-probe)。
|
|
347
|
+
// 磁盘口径下唯一等价的推导源是顶层 sourceEventSeqs(折叠凭据 = 被消费的
|
|
348
|
+
// 原事件序列);无凭据时无法等价推导,保持旧约定忽略。
|
|
349
|
+
if (range.startSeq > range.endSeq) {
|
|
350
|
+
const src = e.sourceEventSeqs;
|
|
351
|
+
if (!Array.isArray(src)) continue;
|
|
352
|
+
for (const s of src) {
|
|
353
|
+
if (Number.isInteger(s) && s >= 0 && s < e.seq) shadowed.add(s);
|
|
354
|
+
}
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
343
357
|
if (range.endSeq - range.startSeq > MAX_SPAN) {
|
|
344
358
|
throw new OpsError(
|
|
345
359
|
`surface replace span too large: [${range.startSeq}..${range.endSeq}] exceeds MAX_SPAN=${MAX_SPAN} — refusing to materialize (corrupt or hostile replace marker?)`,
|