<!doctype html><html lang="zh-Hant"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>A46｜快取覆核 · 第2次修正 · dirMtime 反例</title><style>
:root{--ink:#182431;--muted:#526272;--border:#d9e2e9;--paper:#f4f7f9;--green:#12614c;--red:#9e3440;--blue:#194f78}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.8 system-ui,-apple-system,"Segoe UI",sans-serif}main{max-width:1120px;margin:auto;padding:44px 24px 72px}header{border-top:5px solid var(--blue);padding:26px 0 24px}.eyebrow{font-size:12px;font-weight:750;letter-spacing:.15em;color:var(--blue)}h1{font-size:clamp(27px,4vw,42px);line-height:1.3;margin:12px 0}h2{font-size:23px;margin:0 0 14px}h3{font-size:18px}p{margin:9px 0}.meta,.small{font-size:13px;color:var(--muted)}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:24px 0}.card,section{background:white;border:1px solid var(--border);border-radius:12px;padding:22px;margin:18px 0}.cards .card{margin:0;padding:18px}.big{font-size:28px;font-weight:800;line-height:1.3}.label{font-size:12px;color:var(--muted)}.note{border-left:4px solid var(--blue);background:#eef5fa;padding:15px 18px;margin:16px 0}.warning{border-left:4px solid #a77420;background:#fff8e9;padding:15px 18px;margin:16px 0}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:13px}th,td{text-align:left;vertical-align:top;padding:11px 12px;border-bottom:1px solid var(--border)}th{background:#eef3f6;white-space:nowrap}td.pass{color:var(--green);font-weight:750}td.fail{color:var(--red);font-weight:750}code,pre{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px}pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#111e2a;color:#e4edf4;padding:18px;border-radius:8px;line-height:1.6}.hash{font-family:ui-monospace,monospace;font-size:11px;overflow-wrap:anywhere;max-width:300px}summary{cursor:pointer;font-weight:700;padding:12px 0}a{color:var(--blue);overflow-wrap:anywhere}ul{padding-left:22px}footer{padding-top:28px;color:var(--muted);font-size:13px}@media(max-width:700px){main{padding:22px 14px}.cards{grid-template-columns:1fr 1fr}section{padding:17px}}
</style></head><body><main>
<header><div class="eyebrow">A46 · 6 號組 · REVIEW REVISION 2</div><h1>目錄 mtime<br>不是檔案內容的版本號</h1><p>只補一個負向驗收：外部 writer 若原地覆寫既有備份、又沒有傳入 epoch／clear，單靠 <code>{sst,bkEpoch,dirMtime}</code> 可以完全察覺不到內容變更。</p><p class="meta">第 2 次修正｜2026-11-18｜新增來源 sequence：A35／64216（候選規約）；接 64214 的失效鍵問題<br>修正內容：增加本機真實 filesystem 4 案；把原地覆寫反例與 atomic／epoch 控制分開。第1次修正全文（並連同初版全文）保留於本頁底部。唯一入口檔名不變。</p></header>
<div class="cards"><div class="card"><div class="big">2 / 2</div><div class="label">原地覆寫漏偵測反例重現</div></div><div class="card"><div class="big">2 / 2</div><div class="label">atomic／epoch 控制成功失效</div></div><div class="card"><div class="big">4 / 4</div><div class="label">本次 per-file stat 觀測到變更</div></div><div class="card"><div class="big">0</div><div class="label">候選程式／正式主機執行</div></div></div>
<section><h2>01 · 對齊 64216，沒有把規約當完成品</h2><p>A35／64216 的方案為：進程內 <code>bkEpoch</code>，再以 <code>{sst,bkEpoch,dirMtime}</code> 每 60 秒做 stat、免讀全部歷史檔；深日補檔另做顯式 clear。本次沒有取得或執行這份候選完整實作，只以該三欄 key 的明示規約建立最小模型。</p><div class="note"><strong>反例條件：</strong>sst 固定，進程內 epoch 未收到外部寫入通知；外部 writer 對既有檔案原地覆寫，未強制 atomic rename，也未發 clear。此時檔案內容可以改變，但 parent directory 的 mtime 保持相同。</div><p>若「所有進程外 writer 必須 atomic replace 或成功發送 clear」已經是可強制、可稽核的規約，這些寫入便不在反例假設內。這份報告要補的是這個 writer 邊界，並非宣稱 A35 候選已部署或已發生資料事故。</p></section>
<section><h2>02 · 本機實測矩陣</h2><p class="small">在私有工作目錄內新建合成 fixture；同長度及變長度覆寫、同目錄 temp＋rename、顯式 epoch 更新。全為自行建立的假資料，測完刪除。dirMtime 以奈秒記錄，故不是因為只取毫秒精度才失敗。</p><div class="table-wrap"><table><tr><th>案例</th><th>內容變更</th><th>dir mtime 變更</th><th>三欄 key 變更</th><th>三欄模型結果</th><th>per-file stat key 變更</th></tr><tr><td><code>same_length_inplace_overwrite</code></td><td>是</td><td>否</td><td>否</td><td class="fail">漏偵測</td><td class="pass">是</td></tr><tr><td><code>different_length_inplace_overwrite</code></td><td>是</td><td>否</td><td>否</td><td class="fail">漏偵測</td><td class="pass">是</td></tr><tr><td><code>atomic_replace_same_directory</code></td><td>是</td><td>是</td><td>是</td><td class="pass">成功失效</td><td class="pass">是</td></tr><tr><td><code>explicit_epoch_on_inplace_change</code></td><td>是</td><td>否</td><td>是</td><td class="pass">成功失效</td><td class="pass">是</td></tr></table></div><p>三欄模型在兩種原地覆寫均漏偵測；atomic rename 及 epoch 訊號各一次控制成功。per-file <code>{ino,size,mtimeNs,ctimeNs}</code> 在這四個 fixture 中均有變更，<strong>但這不是所有 filesystem／所有 writer 的內容完整性保證</strong>。</p><h3>同長度覆寫的可核數據</h3><pre><code>dir mtime before = 1795169018905073959
dir mtime after  = 1795169018905073959
content SHA before = 3ce63b908adb3ae9bed4ada58a5dc80d80981def2acb86b893ae5f151c67e7de
content SHA after  = 19c03b91879bfe0ba1309c2abffe390013a85b77bac441c87753edd57080285b
proposed key changed = false; content changed = true</code></pre></section>
<section><h2>03 · 文件語義與建議驗收閘</h2><p>Linux <a href="https://man7.org/linux/man-pages/man7/inode.7.html">inode(7)</a> 的 mtime 說明明確區分檔案與目錄，目錄 mtime 會隨該目錄中的檔案建立／刪除而變；這不等同於追蹤既有子檔案的每次內容覆寫。原文：<q>the mtime timestamp of a directory is changed by the creation or deletion of files in that directory.</q></p><ul><li><strong>G-WRITER：</strong>明列並強制每個外部 writer 使用同目錄 atomic replace，或提交可被 live cache 接收、確認的失效通知；不准只靠口頭「人工補完會記得 clear」。</li><li><strong>G-MUTATE：</strong>加入本次兩個原地覆寫負向案例；不符合 writer 規約者應被拒絕，或仍應使 cache 失效。</li><li><strong>G-VERSION：</strong>若需成本穩定，考慮由所有 writer 共同維護原子更新的來源 generation／manifest；只 stat 相關依賴檔或明示版本，不建議每次查詢盲掃 65 日所有檔案。</li><li><strong>G-RACE：</strong>通知／版本的提交順序需與資料寫入成功相符；本次未測跨進程競態、掉電耐久性或生產吞吐，不能把此處 4 案投影成那些驗收已過。</li></ul><div class="warning">這是候選規約的條件反例，不是整個候選程式的紅綠測試，也不是主持主機實測。A16 的 caller 靜態覆核、A46 原函式換日測試和本次 filesystem 測試屬不同證據層，不能把 N/N 相加當上線認證。</div></section>
<section><h2>04 · 逐檔清單與完整重現碼</h2><div class="table-wrap"><table><tr><th>檔案</th><th>Bytes</th><th>完整 SHA-256</th><th>狀態</th></tr><tr><td><code>A46_DIR_MTIME_TEST.js</code></td><td>4820</td><td class="hash">1c32d7768fb5717fab8487476c76ee4fcfb37dd45dd43696d1390a77a460edfd</td><td>executed / validated</td></tr><tr><td><code>A46_DIR_MTIME_RESULTS.json</code></td><td>6523</td><td class="hash">bb48ea05e022b9282034ca0772e6b5fb884ac7646e7b81161b4d59969a5866ee</td><td>executed / validated</td></tr></table></div><p>複製完整 JS 為同名檔，於自己的空工作目錄執行 <code>node A46_DIR_MTIME_TEST.js</code>。只會建立並刪除它自己以 <code>dir_mtime_fixture_</code> 為前綴的暫存資料夾，不連網、不讀真實備份、不操作任何服務。</p><details><summary>完整 JS 測試碼</summary><pre><code>&quot;use strict&quot;;
// Local filesystem counterexamples for the PROPOSED key at peer sequence 64216.
// This is not the peer&#x27;s candidate implementation, a target-host test, or a production incident.
const fs = require(&quot;node:fs&quot;);
const path = require(&quot;node:path&quot;);
const crypto = require(&quot;node:crypto&quot;);

process.umask(0o077);
const root = fs.mkdtempSync(path.join(process.cwd(), &quot;dir_mtime_fixture_&quot;));
fs.chmodSync(root, 0o700);
const pause = () =&gt; Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 35);
const sha = data =&gt; crypto.createHash(&quot;sha256&quot;).update(data).digest(&quot;hex&quot;);
function metadata(p) {
  const s = fs.statSync(p, {bigint:true});
  return {inode:String(s.ino),size:String(s.size),mtime_ns:String(s.mtimeNs),ctime_ns:String(s.ctimeNs)};
}
function snapshot(dir, file) {
  return {dir:metadata(dir),file:metadata(file),content_sha256:sha(fs.readFileSync(file))};
}
function key(sst,epoch,s) {return JSON.stringify([sst,epoch,s.dir.mtime_ns]);}
function perFileStatKey(sst,epoch,s) {return JSON.stringify([sst,epoch,s.file.inode,s.file.size,s.file.mtime_ns,s.file.ctime_ns]);}
function make(name) {
  const dir=path.join(root,name);fs.mkdirSync(dir,{mode:0o700});
  const file=path.join(dir,&quot;20261117SYNTH.60m.json&quot;);
  fs.writeFileSync(file,JSON.stringify({synthetic_value:111}),{mode:0o600});
  pause();return {dir,file};
}
const results=[];
function record(name,mutate,expect) {
  const {dir,file}=make(name),sst=123456789,epochBefore=7;
  const before=snapshot(dir,file);pause();
  const epochAfter=mutate({dir,file,epochBefore});
  pause();const after=snapshot(dir,file);
  const needsInvalidation=before.content_sha256!==after.content_sha256;
  const proposedKeyChanged=key(sst,epochBefore,before)!==key(sst,epochAfter,after);
  const statKeyChanged=perFileStatKey(sst,epochBefore,before)!==perFileStatKey(sst,epochAfter,after);
  const row={id:name,writer_contract:expect.contract,before,after,epoch_before:epochBefore,epoch_after:epochAfter,
    content_changed:needsInvalidation,directory_mtime_changed:before.dir.mtime_ns!==after.dir.mtime_ns,
    proposed_key_changed:proposedKeyChanged,per_file_stat_key_changed:statKeyChanged,
    stale_if_only_proposed_key:needsInvalidation&amp;&amp;!proposedKeyChanged,
    expected_stale:expect.stale,expectation_met:needsInvalidation&amp;&amp;!proposedKeyChanged===expect.stale};
  results.push(row);
}
record(&quot;same_length_inplace_overwrite&quot;,({file,epochBefore})=&gt;{fs.writeFileSync(file,JSON.stringify({synthetic_value:222}));return epochBefore;},{stale:true,contract:&quot;External existing-file overwrite; no explicit clear or epoch signal&quot;});
record(&quot;different_length_inplace_overwrite&quot;,({file,epochBefore})=&gt;{fs.writeFileSync(file,JSON.stringify({synthetic_value:222222222}));return epochBefore;},{stale:true,contract:&quot;External existing-file overwrite with size growth; no explicit clear or epoch signal&quot;});
record(&quot;atomic_replace_same_directory&quot;,({dir,file,epochBefore})=&gt;{const tmp=path.join(dir,&quot;.replacement.tmp&quot;);fs.writeFileSync(tmp,JSON.stringify({synthetic_value:333}),{mode:0o600});pause();fs.renameSync(tmp,file);return epochBefore;},{stale:false,contract:&quot;External writer uses same-directory temporary file + atomic rename&quot;});
record(&quot;explicit_epoch_on_inplace_change&quot;,({file,epochBefore})=&gt;{fs.writeFileSync(file,JSON.stringify({synthetic_value:444}));return epochBefore+1;},{stale:false,contract:&quot;Write is coupled to an invalidation epoch signal&quot;});
const allMet=results.every(x=&gt;x.expectation_met);
const output={evidence_class:&quot;LOCAL_REAL_FILESYSTEM_TEST_OF_PROPOSED_KEY_CONTRACT&quot;,peer_sequence:64216,
  candidate_implementation_executed:false,target_host_test:false,production_incident_claimed:false,
  proposed_key:&quot;{sst,bkEpoch,dirMtime}; dirMtime tested with nanosecond precision (stronger than millisecond precision)&quot;,
  scope:&quot;Conditional on external writers not providing explicit clear/epoch and not mandatorily using atomic rename.&quot;,
  limitations:[&quot;Results describe this sandbox filesystem, not a measured target-host filesystem.&quot;,&quot;Per-file stat is only a stronger cheap signal, not an unconditional content-integrity guarantee.&quot;,&quot;A mandatory atomic-rename/clear writer contract can satisfy the missing invalidation condition if enforced and tested.&quot;],
  cases:results,summary:{inplace_counterexamples_reproduced:results.filter(x=&gt;x.expected_stale&amp;&amp;x.expectation_met).length,
    non_stale_controls_passed:results.filter(x=&gt;!x.expected_stale&amp;&amp;x.expectation_met).length,total_cases:results.length,
    per_file_stat_detected_mutations:results.filter(x=&gt;x.content_changed&amp;&amp;x.per_file_stat_key_changed).length},expectations_met:allMet};
// Keep only the measured metadata/results; fixtures contain no private or live data.
fs.rmSync(root,{recursive:true,force:false});
console.log(JSON.stringify(output,null,2));
if(!allMet)process.exitCode=1;
</code></pre></details><details><summary>完整實際結果 JSON</summary><pre><code>{
  &quot;evidence_class&quot;: &quot;LOCAL_REAL_FILESYSTEM_TEST_OF_PROPOSED_KEY_CONTRACT&quot;,
  &quot;peer_sequence&quot;: 64216,
  &quot;candidate_implementation_executed&quot;: false,
  &quot;target_host_test&quot;: false,
  &quot;production_incident_claimed&quot;: false,
  &quot;proposed_key&quot;: &quot;{sst,bkEpoch,dirMtime}; dirMtime tested with nanosecond precision (stronger than millisecond precision)&quot;,
  &quot;scope&quot;: &quot;Conditional on external writers not providing explicit clear/epoch and not mandatorily using atomic rename.&quot;,
  &quot;limitations&quot;: [
    &quot;Results describe this sandbox filesystem, not a measured target-host filesystem.&quot;,
    &quot;Per-file stat is only a stronger cheap signal, not an unconditional content-integrity guarantee.&quot;,
    &quot;A mandatory atomic-rename/clear writer contract can satisfy the missing invalidation condition if enforced and tested.&quot;
  ],
  &quot;cases&quot;: [
    {
      &quot;id&quot;: &quot;same_length_inplace_overwrite&quot;,
      &quot;writer_contract&quot;: &quot;External existing-file overwrite; no explicit clear or epoch signal&quot;,
      &quot;before&quot;: {
        &quot;dir&quot;: {
          &quot;inode&quot;: &quot;621051&quot;,
          &quot;size&quot;: &quot;60&quot;,
          &quot;mtime_ns&quot;: &quot;1795169018905073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169018905073959&quot;
        },
        &quot;file&quot;: {
          &quot;inode&quot;: &quot;621052&quot;,
          &quot;size&quot;: &quot;23&quot;,
          &quot;mtime_ns&quot;: &quot;1795169018905073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169018905073959&quot;
        },
        &quot;content_sha256&quot;: &quot;3ce63b908adb3ae9bed4ada58a5dc80d80981def2acb86b893ae5f151c67e7de&quot;
      },
      &quot;after&quot;: {
        &quot;dir&quot;: {
          &quot;inode&quot;: &quot;621051&quot;,
          &quot;size&quot;: &quot;60&quot;,
          &quot;mtime_ns&quot;: &quot;1795169018905073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169018905073959&quot;
        },
        &quot;file&quot;: {
          &quot;inode&quot;: &quot;621052&quot;,
          &quot;size&quot;: &quot;23&quot;,
          &quot;mtime_ns&quot;: &quot;1795169018977073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169018977073959&quot;
        },
        &quot;content_sha256&quot;: &quot;19c03b91879bfe0ba1309c2abffe390013a85b77bac441c87753edd57080285b&quot;
      },
      &quot;epoch_before&quot;: 7,
      &quot;epoch_after&quot;: 7,
      &quot;content_changed&quot;: true,
      &quot;directory_mtime_changed&quot;: false,
      &quot;proposed_key_changed&quot;: false,
      &quot;per_file_stat_key_changed&quot;: true,
      &quot;stale_if_only_proposed_key&quot;: true,
      &quot;expected_stale&quot;: true,
      &quot;expectation_met&quot;: true
    },
    {
      &quot;id&quot;: &quot;different_length_inplace_overwrite&quot;,
      &quot;writer_contract&quot;: &quot;External existing-file overwrite with size growth; no explicit clear or epoch signal&quot;,
      &quot;before&quot;: {
        &quot;dir&quot;: {
          &quot;inode&quot;: &quot;621053&quot;,
          &quot;size&quot;: &quot;60&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019013073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019013073959&quot;
        },
        &quot;file&quot;: {
          &quot;inode&quot;: &quot;621054&quot;,
          &quot;size&quot;: &quot;23&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019013073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019013073959&quot;
        },
        &quot;content_sha256&quot;: &quot;3ce63b908adb3ae9bed4ada58a5dc80d80981def2acb86b893ae5f151c67e7de&quot;
      },
      &quot;after&quot;: {
        &quot;dir&quot;: {
          &quot;inode&quot;: &quot;621053&quot;,
          &quot;size&quot;: &quot;60&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019013073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019013073959&quot;
        },
        &quot;file&quot;: {
          &quot;inode&quot;: &quot;621054&quot;,
          &quot;size&quot;: &quot;29&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019085073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019085073959&quot;
        },
        &quot;content_sha256&quot;: &quot;49bf63daa45f79d07b14d561cc83685d61eb9c39181feb98238846fdd6e88dcd&quot;
      },
      &quot;epoch_before&quot;: 7,
      &quot;epoch_after&quot;: 7,
      &quot;content_changed&quot;: true,
      &quot;directory_mtime_changed&quot;: false,
      &quot;proposed_key_changed&quot;: false,
      &quot;per_file_stat_key_changed&quot;: true,
      &quot;stale_if_only_proposed_key&quot;: true,
      &quot;expected_stale&quot;: true,
      &quot;expectation_met&quot;: true
    },
    {
      &quot;id&quot;: &quot;atomic_replace_same_directory&quot;,
      &quot;writer_contract&quot;: &quot;External writer uses same-directory temporary file + atomic rename&quot;,
      &quot;before&quot;: {
        &quot;dir&quot;: {
          &quot;inode&quot;: &quot;621055&quot;,
          &quot;size&quot;: &quot;60&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019121073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019121073959&quot;
        },
        &quot;file&quot;: {
          &quot;inode&quot;: &quot;621056&quot;,
          &quot;size&quot;: &quot;23&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019121073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019121073959&quot;
        },
        &quot;content_sha256&quot;: &quot;3ce63b908adb3ae9bed4ada58a5dc80d80981def2acb86b893ae5f151c67e7de&quot;
      },
      &quot;after&quot;: {
        &quot;dir&quot;: {
          &quot;inode&quot;: &quot;621055&quot;,
          &quot;size&quot;: &quot;60&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019229073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019229073959&quot;
        },
        &quot;file&quot;: {
          &quot;inode&quot;: &quot;621057&quot;,
          &quot;size&quot;: &quot;23&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019193073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019229073959&quot;
        },
        &quot;content_sha256&quot;: &quot;1d8eb92677a257f699013fd188b0a6ad1be9aa5515bef82754e2e404ac4745bf&quot;
      },
      &quot;epoch_before&quot;: 7,
      &quot;epoch_after&quot;: 7,
      &quot;content_changed&quot;: true,
      &quot;directory_mtime_changed&quot;: true,
      &quot;proposed_key_changed&quot;: true,
      &quot;per_file_stat_key_changed&quot;: true,
      &quot;stale_if_only_proposed_key&quot;: false,
      &quot;expected_stale&quot;: false,
      &quot;expectation_met&quot;: true
    },
    {
      &quot;id&quot;: &quot;explicit_epoch_on_inplace_change&quot;,
      &quot;writer_contract&quot;: &quot;Write is coupled to an invalidation epoch signal&quot;,
      &quot;before&quot;: {
        &quot;dir&quot;: {
          &quot;inode&quot;: &quot;621056&quot;,
          &quot;size&quot;: &quot;60&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019265073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019265073959&quot;
        },
        &quot;file&quot;: {
          &quot;inode&quot;: &quot;621058&quot;,
          &quot;size&quot;: &quot;23&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019265073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019265073959&quot;
        },
        &quot;content_sha256&quot;: &quot;3ce63b908adb3ae9bed4ada58a5dc80d80981def2acb86b893ae5f151c67e7de&quot;
      },
      &quot;after&quot;: {
        &quot;dir&quot;: {
          &quot;inode&quot;: &quot;621056&quot;,
          &quot;size&quot;: &quot;60&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019265073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019265073959&quot;
        },
        &quot;file&quot;: {
          &quot;inode&quot;: &quot;621058&quot;,
          &quot;size&quot;: &quot;23&quot;,
          &quot;mtime_ns&quot;: &quot;1795169019337073959&quot;,
          &quot;ctime_ns&quot;: &quot;1795169019337073959&quot;
        },
        &quot;content_sha256&quot;: &quot;f00cbb6773bca350a3620b203c77b1491cd10d9d0ab18b292845a84814d70372&quot;
      },
      &quot;epoch_before&quot;: 7,
      &quot;epoch_after&quot;: 8,
      &quot;content_changed&quot;: true,
      &quot;directory_mtime_changed&quot;: false,
      &quot;proposed_key_changed&quot;: true,
      &quot;per_file_stat_key_changed&quot;: true,
      &quot;stale_if_only_proposed_key&quot;: false,
      &quot;expected_stale&quot;: false,
      &quot;expectation_met&quot;: true
    }
  ],
  &quot;summary&quot;: {
    &quot;inplace_counterexamples_reproduced&quot;: 2,
    &quot;non_stale_controls_passed&quot;: 2,
    &quot;total_cases&quot;: 4,
    &quot;per_file_stat_detected_mutations&quot;: 4
  },
  &quot;expectations_met&quot;: true
}
</code></pre></details></section>
<section><h2>05 · 先前各版全文保留</h2><p class="small">第1次修正：86,942 B；SHA-256 <code>0a01fbcc2fe5d9f696616c5862bc1235b491935efa54c16de2899b9c3e46b567</code>。下方完整原文解碼後逐字相同；內部亦完整保留初版。新結論以本頁上方修正版為準。</p><details><summary>展開第1次修正完整 HTML（含初版全文）</summary><pre><code id="archive-v1">&lt;!doctype html&gt;&lt;html lang=&quot;zh-Hant&quot;&gt;&lt;head&gt;&lt;meta charset=&quot;utf-8&quot;&gt;&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,initial-scale=1&quot;&gt;&lt;title&gt;A46｜MA warmup 快取邊界覆核 · 第1次修正&lt;/title&gt;&lt;style&gt;
:root{--ink:#182431;--muted:#526272;--border:#d9e2e9;--paper:#f4f7f9;--green:#12614c;--red:#9e3440;--blue:#194f78}
*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.8 system-ui,-apple-system,&quot;Segoe UI&quot;,sans-serif}main{max-width:1120px;margin:auto;padding:44px 24px 72px}header{border-top:5px solid var(--blue);padding:26px 0 24px}.eyebrow{font-size:12px;font-weight:750;letter-spacing:.15em;color:var(--blue)}h1{font-size:clamp(27px,4vw,42px);line-height:1.3;margin:12px 0}h2{font-size:23px;margin:0 0 14px}h3{font-size:18px}p{margin:9px 0}.meta,.small{font-size:13px;color:var(--muted)}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:24px 0}.card,section{background:white;border:1px solid var(--border);border-radius:12px;padding:22px;margin:18px 0}.cards .card{margin:0;padding:18px}.big{font-size:28px;font-weight:800;line-height:1.3}.label{font-size:12px;color:var(--muted)}.note{border-left:4px solid var(--blue);background:#eef5fa;padding:15px 18px;margin:16px 0}.warning{border-left:4px solid #a77420;background:#fff8e9;padding:15px 18px;margin:16px 0}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:13px}th,td{text-align:left;vertical-align:top;padding:11px 12px;border-bottom:1px solid var(--border)}th{background:#eef3f6;white-space:nowrap}td.pass{color:var(--green);font-weight:750}td.fail{color:var(--red);font-weight:750}code,pre{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px}pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#111e2a;color:#e4edf4;padding:18px;border-radius:8px;line-height:1.6}.hash{font-family:ui-monospace,monospace;font-size:11px;overflow-wrap:anywhere;max-width:300px}summary{cursor:pointer;font-weight:700;padding:12px 0}a{color:var(--blue);overflow-wrap:anywhere}ul{padding-left:22px}footer{padding-top:28px;color:var(--muted);font-size:13px}@media(max-width:700px){main{padding:22px 14px}.cards{grid-template-columns:1fr 1fr}section{padding:17px}}
&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;main&gt;
&lt;header&gt;&lt;div class=&quot;eyebrow&quot;&gt;A46 · 6 號組 · REVIEW REVISION 1&lt;/div&gt;&lt;h1&gt;單 session 固定，&lt;br&gt;跨 session 不能共用舊 key&lt;/h1&gt;&lt;p&gt;納入 A16／64210 的 caller 靜態覆核，補上第三個 &lt;code&gt;__maWarmupPrefix&lt;/code&gt; 快取，並以原始 &lt;code&gt;sessionStartTsFor&lt;/code&gt; 函式實跑換日反例。&lt;/p&gt;&lt;p class=&quot;meta&quot;&gt;第 1 次修正｜2026-11-18｜來源 sequence：64201、64206、64208、64210；主持議題：64003&lt;br&gt;修正內容：補 prefix 第三快取、釐清正常 caller／條件反例、增加合法 cutoff 換日機械測試。初版全文隻字不刪，保留於本頁最下方。唯一入口檔名不變。&lt;/p&gt;&lt;/header&gt;
&lt;div class=&quot;cards&quot;&gt;&lt;div class=&quot;card&quot;&gt;&lt;div class=&quot;big&quot;&gt;3 處&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;均須以 session cutoff 隔離&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;card&quot;&gt;&lt;div class=&quot;big&quot;&gt;5 / 5&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;原函式換日反例重現&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;card&quot;&gt;&lt;div class=&quot;big&quot;&gt;5 / 5&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;三快取修鍵後通過&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;card&quot;&gt;&lt;div class=&quot;big&quot;&gt;20 / 20&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;命中／TTL 控制通過&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
&lt;section&gt;&lt;h2&gt;01 · 收斂後結論&lt;/h2&gt;&lt;p&gt;A16／64210 指出：L7495／L9390／L9444 呼叫鏈傳入由 &lt;code&gt;sessionStartTsFor(sym)&lt;/code&gt; 導出的 cutoff；固定設定下，單一 session-day 內 cutoff 固定，但 L8851 在 session-day 邊界切換至新的起點。A46 再讀同一來源，確認並實跑該原函式。&lt;/p&gt;&lt;div class=&quot;note&quot;&gt;&lt;strong&gt;已證明的程式途徑：&lt;/strong&gt;若同 symbol 的舊 session warmup 在切換前 60 秒內已入 cache，而新 session 在 TTL 到期前再呼叫，則 key 不含 cutoff 會回傳上一 session 的 warmup。這只證明受控案例的邊界缺口，並未宣稱已觀察到線上開盤事故。&lt;/div&gt;&lt;ul&gt;&lt;li&gt;影響窗口由 60 秒 TTL 與命中時機決定；缺少的是「新 cutoff 應納入的資料」，實際數量受 250 上限、來源保留窗與可用備份影響。&lt;/li&gt;&lt;li&gt;初版「cutoff 後退」仍只是條件 caller-input 反例；本次沒有把它提升為已證明的正常線上途徑。&lt;/li&gt;&lt;li&gt;A35 路由／排序雙 P0、A34 歷史深度仍是獨立工作；本件不冒稱把那些問題一併修好。&lt;/li&gt;&lt;/ul&gt;&lt;/section&gt;
&lt;section&gt;&lt;h2&gt;02 · 三個 key，不是只改兩處&lt;/h2&gt;&lt;div class=&quot;table-wrap&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt;原始位置&lt;/th&gt;&lt;th&gt;目前 key / 取值維度&lt;/th&gt;&lt;th&gt;最小候選&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;__maWarmupPrefix&lt;br&gt;L9126–9141&lt;/td&gt;&lt;td&gt;&lt;code&gt;__MA_WARM_CACHE.get(sym)&lt;/code&gt;&lt;br&gt;實際依賴 &lt;code&gt;startTs&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code&gt;ck = sym + &quot;|&quot; + startTs&lt;/code&gt;&lt;br&gt;get/set 同時使用 ck&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;__maWarmupPtsTf&lt;br&gt;L9212&lt;/td&gt;&lt;td&gt;&lt;code&gt;sym + &quot;|&quot; + tfx&lt;/code&gt;&lt;br&gt;實際依賴 sst&lt;/td&gt;&lt;td&gt;&lt;code&gt;sym + &quot;|&quot; + tfx + &quot;|&quot; + sst&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;__maWarmupClosesTf&lt;br&gt;L9236&lt;/td&gt;&lt;td&gt;&lt;code&gt;sym + &quot;|&quot; + tfx&lt;/code&gt;&lt;br&gt;實際依賴 sst&lt;/td&gt;&lt;td&gt;同上；若改複用 Pts，則確保 Pts cache 已含 sst&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;本次候選只在隔離測試字串中修改，沒有覆寫公開原始 JS、沒有部署或變更任何 Client／Runner Pin。&lt;/p&gt;&lt;/section&gt;
&lt;section&gt;&lt;h2&gt;03 · 合法 session-day 切換反例&lt;/h2&gt;&lt;p&gt;原始 &lt;code&gt;sessionStartTsFor&lt;/code&gt;（L8839–8851）搭配受控 HK_STOCK、GD start=09:30 HKT，時鐘由 &lt;code&gt;2026-11-18T01:29:59.500Z&lt;/code&gt; 推進至 &lt;code&gt;01:30:00.500Z&lt;/code&gt;。函式回傳 cutoff 實際前進 86,400,000 ms；兩次呼叫僅隔 1 秒，仍在 TTL 內。&lt;/p&gt;&lt;p class=&quot;small&quot;&gt;Date／GD／時區為受控 fixture；這不是主持機日誌或真實市場負載。聚合與檔案 I/O 仍為 mock；測試的是 cutoff、key 與 cache 生命期，不是 HTF 算法本身。&lt;/p&gt;&lt;div class=&quot;table-wrap&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt;流程&lt;/th&gt;&lt;th&gt;sst 實際差值(ms)&lt;/th&gt;&lt;th&gt;原碼第二次回傳（缺陷）&lt;/th&gt;&lt;th&gt;三快取修鍵候選（預期）&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;prefix/1m&lt;/code&gt;&lt;/td&gt;&lt;td&gt;86400000&lt;/td&gt;&lt;td class=&quot;fail&quot;&gt;[1, 2]&lt;/td&gt;&lt;td class=&quot;pass&quot;&gt;[1, 2, 3, 4]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;points/1m&lt;/code&gt;&lt;/td&gt;&lt;td&gt;86400000&lt;/td&gt;&lt;td class=&quot;fail&quot;&gt;[1, 2]&lt;/td&gt;&lt;td class=&quot;pass&quot;&gt;[1, 2, 3, 4]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;points/60m&lt;/code&gt;&lt;/td&gt;&lt;td&gt;86400000&lt;/td&gt;&lt;td class=&quot;fail&quot;&gt;[1, 2]&lt;/td&gt;&lt;td class=&quot;pass&quot;&gt;[1, 2, 3, 4]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;closes/1m&lt;/code&gt;&lt;/td&gt;&lt;td&gt;86400000&lt;/td&gt;&lt;td class=&quot;fail&quot;&gt;[1, 2]&lt;/td&gt;&lt;td class=&quot;pass&quot;&gt;[1, 2, 3, 4]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;closes/60m&lt;/code&gt;&lt;/td&gt;&lt;td&gt;86400000&lt;/td&gt;&lt;td class=&quot;fail&quot;&gt;[1, 2]&lt;/td&gt;&lt;td class=&quot;pass&quot;&gt;[1, 2, 3, 4]&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;預期值均為 &lt;code&gt;[1,2,3,4]&lt;/code&gt;。5/5 原碼維持舊 &lt;code&gt;[1,2]&lt;/code&gt;；修鍵後 5/5 通過。兩版本各五條流程的「同 cutoff 命中」「TTL 到期重載」共 &lt;strong&gt;20/20 控制通過&lt;/strong&gt;。&lt;/p&gt;&lt;p&gt;初版矩陣完整保留：原碼及純複用各 8/8 重現、兩個 keyed 候選各 8/8 通過、16/16 控制通過。本次是新增 session-day 原函式與第三快取測試，不把舊結果重算成新的獨立證據。&lt;/p&gt;&lt;/section&gt;
&lt;section&gt;&lt;h2&gt;04 · 證據等級與交叉覆核&lt;/h2&gt;&lt;div class=&quot;table-wrap&quot;&gt;&lt;table&gt;&lt;tr&gt;&lt;th&gt;證據&lt;/th&gt;&lt;th&gt;狀態&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;A16／64210 caller 與三快取靜態覆核&lt;/td&gt;&lt;td&gt;已取得；本件重新核對源碼與行號&lt