Repository navigation
docs: 把三份裁決史表移出自動載入的 .claude/rules/(移到 docs/rulings/) - #736
Merged
Merged
Conversation
.claude/rules/ 每個 session 都自動注入,2026-10-15 量到 738,145 位元組(30 萬 token 以上), 雲端 session 因此 context 溢出。mcp-cli-parity、two-kinds-of-edits、zero-instance-guards 三份的 裁決史表與相關段落逐位元組搬到 docs/rulings/<同名>.md(不自動載入),規則檔留規則本文、標題與指標。 - 自動載入:.claude/rules/ 738,145 → 235,377 位元組;連同 CLAUDE.md 780,391 → 277,758 位元組 - 守衛同批改讀新位置,不放寬任何一道:zero-instance-rows-audit、parity-table-drift、 measured-numbers-audit、受保護清單與 ratchet、三支 mutations harness(複製 docs/rulings 進副本, audit-guards-mutations 多三格:rulings 被刪、列被塞回規則檔、棘輪標記放進規則檔) - census-parity.yml 的 paths 加 docs/rulings/** - CLAUDE.md 只改因搬移而變假的一句;changelog/2026-10-15-rulings-out-of-autoload.md 本機沒有 Swift toolchain:沒有編譯、沒有跑 swift test 與守衛,只以 python 模擬比對;靠 macOS CI 驗。 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SmKsv9UzG8wS7ZnrYhy4ck
main 的 CI(ci.yml 與 census-parity.yml)在 Build 這一步失敗:Swift 對
Sources/AkashicStoreIO/DivergenceResolve.swift 的 149:20、162:20、188:20 報
「the compiler is unable to type-check this expression in reasonable time」。
三處都是 errorDescription 裡一長串 `+`,運算元夾著 `.map { " • " + $0 }` 的
closure 與三元運算式(wouldContradictClassificationTail、namedByLibraryRule、
wouldLeaveTwoConfirmedLiterals)。
改法:closure 與三元先拆成具型別(String)的 let,串接裡只剩字面與 String 變數;
wouldLeaveTwoConfirmedLiterals 末段的出路說明另成一個 let。子運算式的文字、
display-safe-exempt 註記與字面內容都沒改,組出來的訊息逐字相同(字面的多重集合
前後比對一致)。existingBlock 取代原本的巢狀三元,existing 為空時同樣是 ""。
本機沒有 Swift toolchain,沒有編譯、沒有跑 swift test;靠 macOS CI 驗證。
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XbLpV1bKG2y76nAnGyK9dp
a5666f0 修好 DivergenceResolve 之後,census-parity 的 Build 往前走到 AkashicAppKit,在 Sources/AkashicAppKit/AdjudicationViews.swift:135:25(OrphanView 的 `var body`)報 「the compiler is unable to type-check this expression in reasonable time」(run 38700806531)。 全份 log 只有這一個錯誤;akashic-guards 已經連結成功(這個 PR 改的守衛程式碼編得過)。 body 是一整串 modifier 鏈,其中兩處讓求解爆量: - `.navigationTitle("Orphans(\(…)" + (… > 0 ? "+\(…) 附加來源" : "") + ")")`:帶插值的 字面、三元與 `+` 夾在 navigationTitle 的多個多載裡。移成 `navigationTitleText: String` 計算屬性,三元先拆成具型別的 let;組出來的字串逐字不變,走的仍是 StringProtocol 那個多載。 - 確認拿掉來源的訊息 `Text("…\(pending.sourcesLabel)…" + "…" + "…")`:改成 `Text(verbatim:)`,串接直接定型成 String。`+` 的結果本來就是 String、走的就是不翻譯的 init,顯示不變;仍是 `Text(` sink,display-safe-exempt 註記留在插值那一行。 PeopleResolveView 有同形的標題,這一輪沒有報錯,沒動。 本機沒有 Swift toolchain,沒有編譯;靠 macOS CI 驗證。 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbLpV1bKG2y76nAnGyK9dp
kiki830621
marked this pull request as ready for review
October 18, 2026 13:07
This was referenced Oct 18, 2026
kiki830621
added a commit
that referenced
this pull request
Oct 19, 2026
…t 的讀取 (#711) - selfProofMeasurementCommands 24 → 18 格:query、graph(--output)、person、get-entry、venue、venues 會建 index 檔(scratch store 逐一量過) - measured-numbers-audit:每一行先看長度(fence 裡的行與分隔行也一樣),判準 3 的視窗不讀超長行;讀不到的檔、沒收尾的 fence 具名紅; 找「標題宣稱的列數」改用同一個 ATX 判準 - runGuardProcess:stdout 讀取也以期限為界,背景行程握著 pipe 時帶回已收到的輸出、rc 124;逾時不記成如預期 - 散文鏈的行數算到鏈實際接到的那一行 - 第 99 列的量測在 #736 整合後的樹上重量(補 docs/rulings、tuple 取最大改成各取最大);說法與數字的殘留收窄 - audit-guards-mutations 130 → 140:七格須紅、兩格須綠、一項後設檢查(含 b39 漏掉的 CR 與 .readOnly 對帳分支) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Requested by che830621 · project thread
之前
.claude/rules/會在每個 session 自動注入。2026-10-15 量得 738,145 位元組(超過 30 萬 token),雲端 session 因此 context 溢出。其中三份規則檔佔了大部分:mcp-cli-parity(281,520)、zero-instance-guards(187,777)、two-kinds-of-edits(73,158)。這三份的主體都是逐輪累積的裁決史表。之後
這三份的裁決史表與相關段落逐位元組搬到
docs/rulings/<同名>.md,該目錄不自動載入。規則檔只留規則本文、各節標題,以及指向新位置的指標。.claude/rules/mcp-cli-parity.md.claude/rules/zero-instance-guards.md.claude/rules/two-kinds-of-edits.md.claude/rules/合計CLAUDE.md新增檔案:
docs/rulings/mcp-cli-parity.md(259,453 位元組)、docs/rulings/zero-instance-guards.md(180,620 位元組,102 列)、docs/rulings/two-kinds-of-edits.md(67,915 位元組)。做法
docs/rulings/),其餘不動。measurement-commands-self-prove.md、docs/zero-instance-measurements.md:只更新引用位置。後者另補一段 2026-10-15 的補記。changelog/2026-10-15-rulings-out-of-autoload.md,記錄原因與搬移前後的位元組數。改了哪些守衛、為什麼
這些守衛原本直接解析規則檔裡的表,所以要改讀新位置。沒有拿掉、跳過或放寬任何一道。
ZeroInstanceRowsAudit.swiftdocs/rulings/zero-instance-guards.md讀取。ParityTableDrift.swift:把規則檔與docs/rulings/mcp-cli-parity.md接起來一起讀;rulings 檔不存在時判紅。MeasuredNumbersAudit.swift:多掃一個來源docs/rulings/*.md。ProtectedInventory.swift、.githooks/protected-ratchet.txt:把docs/rulings/*.md三個檔加入受保護清單。AuditGuardsMutations.swift、AuditGuardsMutationsData.swiftagmWatched加入兩份 rulings 檔。TriggerCoverageMutations.swift、PluginRootsMutations.swift:建副本時一併複製docs/rulings。.github/workflows/census-parity.yml:paths加上"docs/rulings/**",改動 rulings 檔時也會觸發 CI。驗證:本機沒有 Swift,靠 macOS CI(Census parity 已在 3860f6e 通過)
這個環境沒有 Swift toolchain。本機沒有編譯、沒有跑
swift test,也沒有執行任何守衛;守衛是在 CI 上執行並通過的(Census parity run 38702392253)。本機只做了以下比對,全部通過:parity-table-drift:35 個工具對 35 列,沒有差集;第一欄 token 65 = 65。zero-instance-rows-audit:102 列連續,沒有殘留在規則檔的列,也沒有未被引用的列。棘輪標記只出現在量測文件。measured-numbers-audit:docs/rulings/*.md共 23 個來源檔,裸數字 0。audit-guards-mutations的 needle:51 個都能在目標檔裡找到(0 個找不到)。CI 的狀態:
census-parity.yml與ci.yml都有在 macos-15 runner 上啟動並執行步驟,不是 steps=0。Sources/AkashicStoreIO/DivergenceResolve.swift裡三段很長的+字串串接 type-check 逾時("the compiler is unable to type-check this expression in reasonable time";census-parity.ymlrun 37925990395,head f2a321e,ci.yml在同一個 commit 上也是 failure)。三處在第 149、162、188 行,分別是.wouldContradictClassificationTail、.namedByLibraryRule、.wouldLeaveTwoConfirmedLiterals的訊息。這個 PR(commit a5666f0)把每一段拆成幾個宣告為String型別的let,訊息文字完全相同。Sources/AkashicAppKit/AdjudicationViews.swift:135(OrphanView.body):navigationTitle的字串改在private var navigationTitleText: String裡組出,其中的三元運算拆成一個宣告為String型別的let;確認對話框的訊息改用Text(verbatim:)。畫面上顯示的文字完全相同。census-parity)會跑swift build與守衛,但不跑swift test,也不把 warning 當成 error;這兩項只會在合併後於 main 上執行,而 main 的 Build 至少從 2026-09-28 起就是紅的,所以這段期間 CI 上沒有跑過swift test。沒有改的地方
paths:frontmatter 的候選:無。 三份規則都橫跨多個程式區域,沒有一份明確只關係到單一區域,所以都沒有加。.claude/rules/zero-instance-guards.md第 N 列」,分別在VenueBootstrap.swift、Organization.swift、VenueBootstrapTests.swift。那份規則檔現在會指向新位置,所以這次沒有改這些註解(changelog 有記錄)。🤖 Generated with Claude Code
https://claude.ai/code/session_01SmKsv9UzG8wS7ZnrYhy4ck
Generated by Claude Code