Skip to content

test(deploy): 補齊預設匯入探測成功與失敗動態覆蓋 - #525

Merged
monkey1sai-blip merged 2 commits into
mainfrom
test/default-import-probe-dynamic-success-failure
Aug 12, 2026
Merged

test(deploy): 補齊預設匯入探測成功與失敗動態覆蓋#525
monkey1sai-blip merged 2 commits into
mainfrom
test/default-import-probe-dynamic-success-failure

Conversation

@monkey1sai

@monkey1sai monkey1sai commented Aug 12, 2026

Copy link
Copy Markdown
Owner

變更摘要

補齊 Start-HostNativeKitManager 預設 ImportProbeFn 的真實 Python subprocess 成功與失敗動態覆蓋,並保留既有 timeout/descendant cleanup 案例。

本 PR 是使用者指定的 WP-20260811-001-import-probe-dynamic follow-on test slice。Issue #493 已由 PR #502 的 timeout coverage 關閉;本 PR 不重新關閉 #493,也不宣稱 #489#513 或完整 work package 已完成。

修改原因

目前 origin/main 已動態驗證預設 probe timeout,但 success 與 non-zero failure 仍缺少真實 child-process 證據。這個缺口可能讓 import fastapi, uvicorn 的執行順序、失敗阻擋或 service-start wiring 回歸而未被 focused test 發現。

主要變更

  • 修改 scripts/tests/test-host-native-launcher.ps1,production code 零變更。
  • Success fixture 以暫存 fastapi.pyuvicorn.py shim 與 ordered marker 證明兩個 import 都在真實 child interpreter 執行,且 service 僅啟動一次。
  • Failure fixture 讓 fastapi.py 寫 marker 後 raise,證明 documented blocker 被傳遞、service 不啟動、uvicorn 不會被 import。
  • 既有 timeout fixture 保留,繼續驗證 bounded failure 與 parent/child PID cleanup。
  • 所有 test-only environment variables 均在 finally 還原。

Change Classification

Item Result
Change lane G
Behavior contract changed no
Requirement source issue #493(已關閉)+使用者指定 follow-on work package WP-20260811-001-import-probe-dynamic

AI Coding Governance

Item Result
Linked issue Refs #493;已由 #502 關閉,本 PR 不自動關閉任何 issue
Requirement source issue #493(已關閉)+使用者指定 follow-on work package WP-20260811-001-import-probe-dynamic
CODEOWNERS / owner review monkey1sai-blip exact-head approval required;尚未取得
GitNexus evidence risk_level=UNKNOWN — GitNexus 1.6.9 未索引 PowerShell symbol,且 current linked worktree 無 exact-path index;以單檔 test-only diff、production blob unchanged、focused runtime、root contracts 與兩份獨立 read-only review 補強
Browser E2E evidence not applicable — 非 user-facing,frontend/product path 零變更
Agent workflow changed? no
Required checks expected CI、Agent Governance、PR Metadata Contract、Governance Base Audit(diagnostic)

驗證方式

Exact base/head:

  • Base: c152c79d57fbbcf05276e3c1a9bbbaa3ce0d07c3
  • Head: fd886afe4947f2305e49fed149fed0d210881d44

已執行:

  • pwsh -NoProfile -NonInteractive -File scripts/tests/test-host-native-launcher.ps1ALL PASSED;commit 後 exact head 重新執行通過。
  • Mutation self-check:暫時將 production argv 改成只 import fastapi,新 marker 斷言如預期失敗;還原後 focused test 重新通過,production blob 與 HEAD 相同。
  • pwsh -NoProfile -NonInteractive -File scripts/verify-all.ps1 -PlanOnly -ChangedPath scripts/tests/test-host-native-launcher.ps1 → affected plan 產生成功。
  • repo-local TEMP 下 python -m pytest tests -q -p no:cacheprovider483 passed, 9 skipped
  • pwsh -NoProfile -NonInteractive -File scripts/tests/invoke-powershell-static.ps1 → passed。
  • pwsh -NoProfile -NonInteractive -File scripts/tests/test-agent-governance-check.ps1 → all assertions passed。
  • pwsh -NoProfile -NonInteractive -File scripts/tests/scan-secret-patterns.ps1 → passed。
  • pwsh -NoProfile -NonInteractive -File scripts/tests/verify-security-exceptions.ps1 → valid,count=0。
  • merge 最新 main 後,node --test scripts/tests/test-openspec-machine-truth.mjs24 passed, 0 failed
  • merge 最新 main 後,node --test scripts/tests/test-ai-coding-metrics.mjs13 passed, 0 failed
  • git diff --check → clean。

Hosted CI:

  • Exact head fd886afe4947f2305e49fed149fed0d210881d44CI workflow 已通過:changed-path classifier、Linux platform adapter、root contracts/fakes、agent governance contracts、PowerShell static 與 secret scan 均為 success;不適用的 service jobs 依 classifier skip。
  • Exact head 的 Agent Governance / agent-governance 已通過,包含 OpenSpec machine-truth、PR body evidence、self-referential bootstrap、Windows platform adapter、host-native child-launch regression、remote deploy transport、host-native preflight 與 Windows verification scope。
  • Exact head 的 PR Metadata Contract / pr-metadata-contract-diagnostic 已通過。
  • Hosted manifest 不會直接執行 focused test-host-native-launcher.ps1;本 PR 不把本機 focused pass 誤報成 hosted required gate。
  • 既有 ledger provenance defect 已由 chore(openspec): rebind hifi row to the landed #507 squash #524 合併至 mainc152c79);本 branch 以 merge commit fd886af 吸收,fresh local machine-truth 24/24 與 hosted Agent Governance 均通過。重複且已成零 diff 的 chore(openspec): rebind migrate-console-to-hifi-design row to the landed #507 squash #523 已關閉為 superseded。
  • Governance Base Audit 依 repo 契約是 diagnostic;目前 reason 為缺少 monkey1sai-blipfd886af 的 exact-head approval,會在 review submitted 時重跑。本 PR 不把它繞過或誤報為已通過。

風險與影響

回滾方式

若需撤回,revert 本 PR 的單一 test commit 即可;沒有 production state 或資料需要復原。

後續建議

Copilot AI balanced review requested due to automatic review settings August 12, 2026 06:45
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3819974f-6a5e-43f3-8492-163838856785

📥 Commits

Reviewing files that changed from the base of the PR and between c152c79 and fd886af.

📒 Files selected for processing (1)
  • scripts/tests/test-host-native-launcher.ps1

📝 Walkthrough

Walkthrough

The host-native launcher tests now cover successful, failed, and hung Python import probes. They verify marker output, bounded failures, service-start suppression, descendant-process cleanup, and restoration of the marker-file environment variable.

Changes

Host-native import-probe regression coverage

Layer / File(s) Summary
Import-probe outcomes and cleanup
scripts/tests/test-host-native-launcher.ps1
The tests run real Python subprocesses for successful and failed fastapi/uvicorn imports. They verify service-start counts, documented errors, bounded completion, timeout handling, descendant cleanup, and marker-file environment restoration.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: monkey1sai-blip

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the test scope and the added success and failure coverage for the default import probe.
Description check ✅ Passed The description directly explains the test-only changes, objectives, validation results, and remaining approval requirement.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/default-import-probe-dynamic-success-failure

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@monkey1sai-blip
monkey1sai-blip merged commit 7d85190 into main Aug 12, 2026
55 of 57 checks passed
@monkey1sai-blip
monkey1sai-blip deleted the test/default-import-probe-dynamic-success-failure branch August 12, 2026 08:52
@monkey1sai-blip

Copy link
Copy Markdown
Collaborator

{"kind":"ai-bim-single-owner-approval","version":1,"repo":"monkey1sai/AI-BIM-governance","prNumber":525,"headOid":"fd886afe4947f2305e49fed149fed0d210881d44","baseOid":"c152c79d57fbbcf05276e3c1a9bbbaa3ce0d07c3","action":"merge-elevated"}

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.

3 participants