Skip to content

governance: belief-shift plumbing -- WO-P1 bypass lane closed + WO-P2 vow exit ledger wired - #335

Open
Fan1234-1 wants to merge 2 commits into
masterfrom
claude/belief-plumbing-20260711
Open

Fan1234-1 wants to merge 2 commits into
masterfrom
claude/belief-plumbing-20260711

Conversation

@Fan1234-1

Copy link
Copy Markdown
Owner

這張 PR 是什麼

認知路(信念轉移)的第一塊磚:belief_shift_ledger_spec_2026-07-05.md §7 的兩張前置水管工單。你 2026-07-05 授權(「就這個吧」)、2026-07-11 說「開始吧」啟動。照你的 §5 裁示:敘事 ledger 維持緩開(怕假記),本 PR 零敘事欄、零自動填——純堵洞。

工單 洞 修法
WO-P2 vow 退役=從 active_vows 直接濾掉,state 無痕;VowRegistry._withdrawals 已實作、runtime 零呼叫者 退役改走 withdraw():registry ledger 拿到不可變記錄(actor/reason/session),state 留薄 tombstone(withdrawn_vows 新欄)
WO-P1 update_governance_state.py=平行重寫的 commit(自有常數、無 shield、無 lock、直寫檔);import_conversation --update-state 也走這條旁路 腳本改建 SessionTrace 呼叫 runtime_adapter.commit() 正門;平行數學整段刪除(-168 行=最強的常數收斂);CLI 介面不變

治理決策記錄

【治理決策記錄】
決策:runtime vow 退役接 VowRegistry.withdraw()+state 薄 tombstone;ledger 檔=state 檔旁的 vow_registry.json(預設 store → memory/vow_registry.json,已入 .gitignore,同 kappa ledger 紀律)。
為什麼:信念層 mutation 不留敘事是 belief-shift 盤點最尖的洞——「無痕退場」正是撤回研究要拒絕的形狀。
張力來源:無新 gate(照 #219 同族判準:只記不擋)。ledger 寫入失敗不擋 commit——tombstone 的 withdrawal_ref=null 就是可見的 deficit 訊號,不靜默。
承受者:退役 vow 的發起 agent(行為被具名記錄);未來讀 state 的人多一個欄位要理解。
可逆性:高(欄位向後相容,from_dict 容忍缺欄;濾除行為不變)。

【治理決策記錄】
決策:update_governance_state.py 旁路上鎖——改走正門 commit,刪除平行常數。
為什麼:旁路 lane 的變更不上 Aegis 鏈;RFC-015 快照常數與 SOUL config 已漂移(兩份平行程式,spec §1 關鍵事實 c)。
張力來源:--trace-log 語義微調——舊=「額外側寫一份未上鏈的 copy」,新=「trace 以上鏈記錄落在該路徑」。舊語義本身就是問題的一部分,不保留。
承受者:import_conversation.py --update-state 的使用者——同樣的管道現在會過 shield 與 commit lock(變慢一點、被擋得住);這是 feature 不是 regression。
可逆性:中(git revert 即回,但回去=重開旁路,不建議)。

驗收對照(spec §7 原文驗收)

  • ✅「腳本改寫後 governance_state 變更出現在 Aegis 鏈上」——測試斷言持久化 trace 帶 _chain 欄位(舊直寫 lane 從來沒有)。
  • ✅「常數單一來源」——測試斷言 TENSION_DECAY_ALPHA/DRIFT_RATE/TENSION_PRUNE_THRESHOLD 不再存在於腳本模組。
  • ✅「退役後 _withdrawals 有記錄、state 可追」——測試斷言 registry 檔 withdrawals 記錄(actor/reason/session: pointer)+ state tombstone round-trip。

誠實限制

  • 未經外眼(同源 Fable 5 自產自驗);governance 層改動,per dispatch 協議建議 codex 覆核——你可觸發,或 merge 前我補跑。
  • 測試 9 新 + 觸及面 253 條重跑全綠(runtime_adapter×4 / vow_system / aegis_shield / vow_withdrawal);black/ruff 乾淨。
  • 刻意不做 subprocess 冒煙對真狀態跑——會把 tmp trace 掛上真機鏈頭(2026-07-05 chain-head 污染事故同型);端到端由 in-process 測試覆蓋(conftest 隔離)。
  • 敘事 ledger(§3/§4 schema)照你的裁示維持緩開;重啟條件不變(第一批真實玩家軌痕過審或你再議)。
  • Redis store 的 registry ledger 仍是本機檔(memory/vow_registry.json)——雙後端 parity 這條已在 30 問 feat(gateway+council): POST /council/validate + v0b Bucket A outcome collection #22 記帳,不在本 PR scope。

🤖 Generated with Claude Code

Fan1234-1 and others added 2 commits July 11, 2026 01:59
…not a traceless delete

belief_shift_ledger_spec_2026-07-05 §7, owner-authorized 2026-07-05
("就這個吧"), kicked off by owner 2026-07-11 ("開始吧").

Before: the runtime retire path filtered the vow out of active_vows and
nothing else. VowRegistry.withdraw() and its immutable _withdrawals ledger
existed with zero runtime callers -- exactly the traceless exit the
withdrawal study rejects, and the sharpest finding of the belief-shift
inventory (a belief-plane mutation with no narrative anywhere).

Now: _commit_locked_posture routes retirement through
VowRegistry.withdraw() -- the ledger (vow_registry.json, next to the state
file; memory/vow_registry.json for default stores, gitignored per the
kappa-ledger discipline) gets an immutable record with actor/reason/
session pointer, and the state keeps a thin tombstone in the new
GovernancePosture.withdrawn_vows field (thin node, thick text -- owner
ruling 2026-07-05). A ledger write failure does not block the commit; the
tombstone then carries withdrawal_ref=None, which is itself the visible
deficit signal. Retiring a vow that was never active leaves no tombstone.

Tests: 6 new (ledger record + tombstone, state round-trip, unknown-vow
no-op, accumulation across commits, posture serialization); runtime_adapter
x4 / vow_system / aegis_shield / vow_withdrawal suites re-run green
(253 passed).

Agent: claude-fable-5-yu
Trace-Topic: the first brick on the cognition road is an exit ledger -- beliefs may change, silently is the part we refuse
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…e front door

belief_shift_ledger_spec_2026-07-05 §7, owner-authorized 2026-07-05.

Before: the script was a parallel re-implementation of the commit path --
its own decay/drift constants (an RFC-015 snapshot that had drifted from
SOUL config), no Aegis shield, no commit lock, direct state-file write.
Belief-plane mutations through this lane (including the
import_conversation.py --update-state pipe) left no chain trace.

Now: the script builds a SessionTrace and calls runtime_adapter.commit().
Every mutation passes the shield and the commit lock and the persisted
trace carries the Aegis _chain fields. The parallel math is deleted
(-168 lines) -- deletion is the strongest form of constant convergence.
CLI surface preserved (--state / --trace / --stdin; --trace-log now maps
to the store traces path, so the trace lands there as the chained record
rather than an unchained side copy).

Tests: 4 new, including spec acceptance ("changes appear on the Aegis
chain" -- asserts _chain on the persisted trace; "constants single-source"
-- asserts the RFC-015 snapshot constants no longer exist) and the --stdin
lane that import_conversation.py depends on.

Agent: claude-fable-5-yu
Trace-Topic: the bypass lane is closed -- there is one door now and it keeps receipts
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview – tonesoul52 — 1ed66770 Deployed Jul 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant