Skip to content

ci: 建立驗證與 develop packaging workflow,更新 lihi production endpoint - #2

Merged
bwayne98 merged 1 commit into
developfrom
feat/ci-check-flow
Aug 11, 2026
Merged

bwayne98 merged 1 commit into
developfrom
feat/ci-check-flow

Conversation

@bwayne98

@bwayne98 bwayne98 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

摘要

這個 PR 為 lihi agent plugin 新增 GitHub Actions CI,將單元測試、Python 語法檢查、Codex/Claude mirrored files parity 與 develop bundle packaging 納入自動化流程。

同時將 production MCP endpoint 從 https://app.lihi.com/mcp/v1/tools 更正為 https://app.lihi.io/mcp/v1/tools。Codex 與 Claude Code plugin 的共同核心版本維持 0.3.0,develop artifact 版本維持 0.3.0-develop.<run>

主要變更

GitHub Actions CI

新增 .github/workflows/ci.yml,支援:

  • push 至 develop
  • 所有 pull request;
  • 手動 workflow_dispatch
  • 同一 workflow/ref 僅保留最新執行,較舊執行會自動取消;
  • job 權限限制為 contents: read
  • 每個 job 設定 10 分鐘 timeout。
  • 所有外部 Actions 均 pin 至各官方 repository 的完整 commit SHA。

執行矩陣:

事件 Unit tests Code checks Develop package
Pull request
Push to main 不觸發 不觸發 不觸發
Push to develop
Manual dispatch on main
Manual dispatch on other refs

test job 使用 Python 3.8 執行完整 unittest suite。

code-check job 會執行:

  • compileall 檢查 scripts、tests 與兩份 URL detector;
  • 比對 Codex/Claude 的 detector scripts;
  • 比對 shortening workflow;
  • 比對 group-switch 與 domain-switch error recovery references;
  • 從空 tree 到目前 HEAD 執行 whitespace error 檢查。

package job 只有在 testcode-check 成功後才會執行,使用 GitHub run number 與 commit SHA 建立隔離的 develop bundle。Workflow 直接上傳 packager 實際產生的 bundle 目錄、明確包含 hidden metadata,並設定 artifact 保留 14 天。

Production endpoint 更正

Production MCP endpoint 統一改為:

https://app.lihi.io/mcp/v1/tools

更新範圍包含:

  • Codex 與 Claude Code 的 .mcp.json
  • 四個 Codex skill 的 agents/openai.yaml MCP dependency;
  • repository、plugin 與雙語使用文件;
  • MCP contract 與 repository agent guide;
  • develop packager 的 production origin;
  • account 與 packaging contract tests。

Develop endpoint 維持不變:

https://app.lihidev.com/mcp/v1/tools

相容性與影響

  • 這次變更不調整 plugin semantic version core;既有四個 skills 與六個 MCP tools 的介面不變。
  • Production MCP host 已變更,舊的 app.lihi.com 不再出現在 runtime、文件、packager 或測試中。
  • CI 與 detector/packager 持續以 Python 3.8 為最低執行環境。
  • Pull request 不建立 develop artifact;只有非 main 的 push 或手動執行會進入 packaging job。

驗證結果

  • python3 -m unittest discover -s tests -v(43 tests passed)
  • Codex/Claude detector scripts byte-for-byte 相同
  • Codex/Claude shortening workflow byte-for-byte 相同
  • Codex/Claude group/domain switch error recovery references byte-for-byte 相同
  • plugin-creator validate_plugin.py 通過
  • 本機成功建立 lihi-agent-0.3.0-develop.999
  • Develop artifact 使用 lihi-dev@lihi-devhttps://app.lihidev.com/mcp/v1/tools
  • Develop artifact 包含 .agents.claude-plugin.codex-plugin.mcp.json hidden metadata
  • GitHub Actions 全部 pin 至完整 commit SHA
  • git diff --check

建議人工驗收

  1. 開啟 pull request,確認只執行 testcode-check
  2. Push 至 develop,確認兩個前置 jobs 成功後才開始 package
  3. Merge 至 main 後,確認不會因 main push 再觸發一次 CI。
  4. 確認 develop artifact 名稱包含 GitHub run number,且保留期為 14 天。
  5. 解開或檢視 develop artifact,確認 hidden metadata 完整,且只包含 lihi-dev identities 與 develop endpoint。
  6. 在 Codex 與 Claude Code 各自載入 production plugin,確認 MCP registration 連線至 app.lihi.io
  7. 確認兩個 manifests 的 core version 均維持 0.3.0,Codex 只包含一個 cachebuster suffix。

Reviewer 重點

  • 確認 CI event/branch 條件符合預期:PR 執行驗證、develop push 執行驗證與 packaging、main push 不觸發。
  • 確認 package job 只在 testcode-check 成功後執行。
  • 確認 artifact upload path 對應 packager 實際產生的目錄,並包含必要的 hidden metadata。
  • 確認所有 production runtime 與 metadata 都使用 https://app.lihi.io/mcp/v1/tools
  • 確認 develop runtime 仍只使用 https://app.lihidev.com/mcp/v1/tools
  • 確認 Codex/Claude version core、最低版本文件與 packaging tests 全部維持 0.3.0
  • 確認 packager 的 README rewrite 同時涵蓋現行與舊 repository URL,但產出內容只呈現 lihi-io

Add GitHub Actions jobs for Python 3.8 unit tests, syntax and mirrored-file checks, whitespace validation, and develop artifact packaging on non-PR develop pushes.

Update the production MCP endpoint from app.lihi.com to app.lihi.io across both host runtimes, Codex dependency metadata, documentation, packaging constants, and contract tests. Refresh the Codex plugin cachebuster so hosts can detect the runtime update.

Teach the develop README rewriter to recognize the lihi-io repository URL while preserving compatibility with the previous weedgood source path.

Validated with:

- python3 -m unittest discover -s tests -v (43 tests)
- Codex/Claude detector, shortening workflow, and switch recovery byte comparisons
- git diff --check
- local develop bundle build
- plugin-creator validate_plugin.py
@bwayne98
bwayne98 merged commit 70c0cf5 into develop Aug 11, 2026
3 checks passed
@bwayne98
bwayne98 deleted the feat/ci-check-flow branch August 31, 2026 03:55
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