Skip to content

chore(governance): close the orphan-kit-liveness-preflight bootstrap entry - #658

Merged
monkey1sai merged 2 commits into
mainfrom
chore/close-orphan-kit-liveness-entry
Aug 20, 2026
Merged

chore(governance): close the orphan-kit-liveness-preflight bootstrap entry#658
monkey1sai merged 2 commits into
mainfrom
chore/close-orphan-kit-liveness-entry

Conversation

@monkey1sai

Copy link
Copy Markdown
Owner

變更摘要

關閉 scripts/self-referential-bootstrap-ledger.json 唯一一筆 open entry:orphan-kit-liveness-preflight#653 讓孤兒 Kit 對 liveness 可見,並讓 Phase 4c 對「沒有任何 live pid file 認領、卻仍在 LISTEN」的 streaming port fail closed)。ledger 回到 0 open,完成 docs/agents/self-referential-bootstrap.md §2 義務 3 的 merge 後 fixpoint。

Entry 來源 PR Mechanism commit Commands
orphan-kit-liveness-preflight #653 cb92a2b 5 / 5 exit 0

修改原因

docs/agents/self-referential-bootstrap.md §2 義務 3:merge 後必須以變更後的正規機制重跑該 entry 凍結的 contract 並把結果 commit 回 ledger。#653 的 opening reason 指出,canonical deploy path 只在「一次真實部署正在對已 merge 的 origin/main 內容執行」的那一刻才決定「是否已有 instance 在跑、能不能安全啟動下一個」,而該 PR 改的行為只存在於那一刻:<Name>.ports claim 由 live Start-HostNativeService 寫出,Phase 4c 的拒絕只對「launcher 已死、child 仍握著真實 LISTEN socket」的孤兒 Kit 觸發;這兩種狀態在變更抵達 origin/main 之前無法由 canonical 機制在 branch 上製造。本 PR 即在 merge 後的 first-parent mainline commit cb92a2b 上完成該重驗,並補上該真實部署週期已發生的證據。

Mechanism commit 綁定:cb92a2bf99a4cbb7ba3c67ec17bfcf2996721972,subject Merge pull request #653 from monkey1sai/fix/orphan-kit-liveness-preflight,位於 origin/main first-parent mainline(git rev-list --first-parent origin/main 命中一次),first-parent diff touch 全部三個 declared verification_mechanism_pathsscripts/deploy.ps1scripts/lib/host-native-launcher.ps1scripts/self-referential-bootstrap-ledger.json)。本 entry 以 merge commit 落地,未使用任何 squash 前懸空 subject,也未開任何 rebind PR。

驗證方式

依 contract orphan-kit-liveness-preflight/v1aaf83a00…)凍結順序重放全部 5 個 command,全部 exit 0(指令對照取自 scripts/tests/test-self-referential-bootstrap.ps1 的 immutable command map,本 contract 五個 command 皆無 <…> 佔位參數):

test-host-native-launcher[PASS] orphaned listener detection is fail-closed and tree-aware (#640)=== test-host-native-launcher.ps1: ALL PASSED ===,41s)、test-deploy-governance-staticPASS deploy governance static checks,7s)、test-self-referential-bootstrap(all assertions passed,32s)、test-pr-body-evidence(all assertions passed,11s)、invoke-powershell-static(passed,5s)。

Contract digest 獨立重算核對:以 New-VerificationContract 的規範形式(contract id 與 command_ids 以 LF 串接、UTF-8 無 BOM 取 SHA-256)重算得 aaf83a0022155d2b8858e98570bbf15ead369b298ce8360402982a6e0c149223,與 ledger 記載 byte-exact 相符。

重驗環境:git worktree detached checkout 恰為 mechanism commit cb92a2b 本身,tracked 檔 0 dirty、untracked 0,置於非 Temp 路徑;本機 pwsh 7.5.4(Windows 11)。重驗時間 2026-08-19T13:44:15Z–13:45:51Z(UTC 實測,reverified_at 取結束時刻)。

改完 ledger 後另跑:test-self-referential-bootstrap(all assertions passed)、test-pr-body-evidence(all assertions passed)、test-agent-governance-check(46 pass / 0 fail,all assertions passed)、invoke-powershell-static(passed)、git diff --cached --check(clean)。

真實部署週期證據(回答 opening reason 的循環)

entry 之所以開,就是因為 merge 前拿不到「真實 canonical 部署跑過新 Phase 4c 孤兒 preflight」的證據。該週期已於 2026-08-19 發生(coordinator 主導的 canonical 部署,時點在 #653 於 11:58:44Z merge 之後):

  • 部署 commit 88b7fb868c9837c560cf7fd87aa4039696d15708origin/main tip;git merge-base --is-ancestor cb92a2b 88b7fb8 為真,部署樹確實含本 entry 的 mechanism),wrapper deploy_exit=0
  • Deploy tag deploy-20260819-639227436548274529-00488b7fb8…(annotated,message deploy target=canonical-linux exit=0 snapshot=20260819T134054Z-effective-env.json deployed=88b7fb8…),已 push,git fetch --tags 後本機可解析。
  • 部署後端點抽查全綠:coordinator :8004/health:8004/ui、viewer :5173、conversion :49101/health 皆 HTTP 200;kit :49100 TCP 可達。
  • Code-path 論證(cb92a2b 版本):remote transport 每次都把部署 checkout git reset --hard 到新鮮 fetch 的目標 commit,再跑 pwsh … scripts/deploy.ps1 -Build(無 -SkipKit);Kit runtime signature 含 -Revision $resolvedDeployRevision(=部署 checkout 的 git rev-parse --verify HEAD),而今日 deploy tag 鏈顯示 deployed revision 每次都變(-002b6ccc3c…-003cb92a2b…-00488b7fb8…),因此 -004 必定走 Phase 4c restarting host-native Kit because runtime parameters changed 而非 skip 分支;該分支在 Start-HostNativeKit 之前呼叫新的 Get-HostNativeOrphanListener,一旦偵測到未被認領的 LISTEN 就 Print-FinalSummary -ExitCode 4exit 4(硬停)。所以「部署樹含 mechanism」+「deploy_exit=0」蘊含 preflight 在 canonical-linux 上實跑並走了 pass path。.ports claim 同理:Start-HostNativeKit-ListenPorts 呼叫 Start-HostNativeService,後者在 Start-Process 之前寫下 <Name>.ports

誠實界定:REFUSAL 分支未在真實部署中觸發(部署環境乾淨、沒有孤兒 Kit),該分支目前只由 test-host-native-launcher.ps1 的 5 個 #640 fixture 案例釘住(本次重放全綠;Windows CI 上為 #653 merged head 0724397rebuild/test-deploy contracts job,run 32249873467 success)。remote host 上的 .ports sidecar 內容未被 operator 直接檢視,其產生是 code-path 蘊含而非直接觀察。preflight 的 pass path 沒有專屬輸出行。部署 log 與去識別化 effective-env 快照皆屬 operator 本機、未 commit 進本 repo;端點抽查為 coordinator session 當下觀察,未附主機資訊。本地重放為 pwsh 7.5.4,hosted runner 綠燈由本 PR 自己的 required checks 提供。

補充旁證(屬已由 #652 關閉remote-deploy-tag-origin-main-sync entry,本 PR 不重開它):同日較早的中間部署 tag deploy-20260819-639227435444539723-003cb92a2b… 已 push 且可見;該次部署期間 origin/main 被並行 merge(#657)推進,refs/heads/main 的 non-fast-forward push 被拒,wrapper 逐字浮出 remote_deploy_transport: deploy tag ... was pushed, but origin/main could not be synced to the deployed commit ... 並以非 0 結束,且未回收已推出的 tag——正是 #652 summary 列為「未由真實部署驗證過」的 rejection 分支被真實觀察到一次。

風險與影響

無 code/runtime 變更;closure 在 mechanism surface 內只動 ledger(另加兩個 fixpoint evidence 檔)。本 PR 落地後 ledger 無 open debt。governance-base-audit 在取得那一票計數 approve 之前預期為紅,屬既知地板,不是本 PR 的變更缺陷。

回滾方式

Revert 本 commit。

AI Coding Governance

Item Result
Change lane F
Behavior contract changed no
Linked issue PR #653
Requirement source existing contract:docs/agents/self-referential-bootstrap.md §2 義務 3(fixpoint 重驗)
CODEOWNERS / owner review requested
GitNexus evidence UNKNOWN — ledger 資料列與 evidence 檔,無 code symbol
Browser E2E evidence not user-facing
Agent workflow changed? no
Required checks expected CI / Agent Governance / PR Metadata Contract

Frontend Verification

本 PR 非 user-facing,未變更 frontend product surface。

Item Result
Frontend route not applicable(非 user-facing)
Main button(s) tested not applicable(非 user-facing)
Fixture used not applicable(非 user-facing)
Backend API called not applicable(無 runtime 變更)
Runtime action not applicable(無 runtime 變更)
Visible success state not applicable(非 user-facing)
E2E command not applicable(非 user-facing)
Screenshot / trace not applicable(非 user-facing)
Design gate status not applicable(無 frontend scope)
Design screen(s) not applicable(無 frontend scope)
Reference-missing route(s) / surface(s) none
Full completion claimed no
Design reference manifest docs/plans/design-system-reference.manifest.json
Visual fidelity result not applicable(無 frontend scope)
Visual comparison not applicable(無 frontend scope)
Visual artifacts not applicable(無 frontend scope)
Manual test steps not applicable(非 user-facing)
Known gaps none

Deploy Path Verification

Item Result
Affects runtime / docker / Kit / viewer / ports / env? no
Canonical deploy path updated? not needed
New root script added? no
Deploy dry-run command not needed(本 PR 無 deploy 變更;引用的真實部署由 #653 的機制在 2026-08-19 執行,不由本 PR 觸發)
Full deploy tested not available(本 PR 無 deploy 變更)
Verify command commands listed above
Frontend URL verified not applicable
Evidence path docs/evidence/orphan-kit-liveness-preflight/fixpoint/

Self-Referential Bootstrap

Item Result
Self-referential bootstrap no
Bootstrap ledger entry not applicable(本 PR 是既有 entry 的 fixpoint closure,非新 entry;closure 屬 ledger-only transition)
Bootstrap reason 未新增 mechanism surface;僅依 §2 義務 3 關閉既有 open entry

🤖 Generated with Claude Code

https://claude.ai/code/session_01GSyeoncjEm8rcfRDgnS6CB

…entry

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GSyeoncjEm8rcfRDgnS6CB

@monkey1sai-blip monkey1sai-blip left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{"kind":"ai-bim-automated-approve-only","version":1,"automated":true,"repo":"monkey1sai/AI-BIM-governance","prNumber":658,"headOid":"df3e6dd152c2bb6a231592c16f050a7dbf256c68","baseOid":"88b7fb868c9837c560cf7fd87aa4039696d15708","action":"approve-only"}

@monkey1sai
monkey1sai merged commit 26d8f23 into main Aug 20, 2026
23 checks passed
@monkey1sai
monkey1sai deleted the chore/close-orphan-kit-liveness-entry branch August 20, 2026 01:58
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.

2 participants