[feature] pb manifest:不含祕密的機器清單,可以進版控 - #24
Merged
Merged
Conversation
manifest.json 本來就是「無祕密、可被 pb plan --manifest 消費」的那一半, 但它只存在於加密 bundle 內部——要拿到安全的那半,得先產出危險的那半再解開。 pb manifest 直接把它單獨寫出來(stdout 或 -o <file>): - 不開任何憑證檔。這不是效能考量,而是這個指令存在的理由:為了產出 一個不含任何憑證的檔案而去讀遍機器上每一把憑證,正是它要避免的事 - vault 只列不解鎖;MCP 只記變數名稱不記值;carried 一律為空 - 新增 kind 欄位(inventory / bundle,預設 bundle 以相容舊檔)—— 宣稱東西搬過去了卻其實沒有,是這個格式唯一不能說的謊 順手修掉 collect_mcp 的不誠實:只要 spec 讀得到就標 carried=true, 在 bundle 情境下剛好成立,在不搬值的情境下是錯的。 另加 write_manifest MCP tool:機器搬遷裡唯一能讓 agent 自己做的一步, 因為它不碰任何憑證。export / import 仍留在 CLI,跟人與密語在一起。
✅ SonarQube Quality Gate passed — pathorsAI_patchbay0 open issues on this PR. |
- 版號回到 0.5.0、CHANGELOG 改回 [Unreleased]。這個 repo 的慣例是功能 PR 只寫 Unreleased,版號由獨立的 [chore] release 一次改六處;我在功能 PR 裡 bump 反而讓 app/src-tauri/Cargo.lock 對不上,panel 的 --locked clippy 掛掉 - Sonar: build 的 cognitive complexity 39 > 15。把每個工具那一圈抽成 tool_record(),檔案複製再抽成 carry_tool_files()。改名 payload→build 讓 整段被當成新程式碼是觸發點,但這函式本來就太長了
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.
為什麼
manifest.json一直是對的東西:無祕密、pb plan --manifest吃得下、schema 穩定。問題是它只存在於加密 bundle 內部。要拿到那份安全、可以進版控的清單,你得先產出「這台機器所有憑證打包在一起」的那個危險檔案,再解開它。這讓一個很常見的需求做不到:我不想搬憑證,我只想留下「我在用什麼」的紀錄,然後在新機器上讓 AI 看著它把 CLI 裝一裝、叫我逐一登入。
做了什麼
carried一律為空。kind欄位(inventory/bundle),#[serde(default)]為bundle所以舊檔照讀。宣稱東西搬過去了卻其實沒有,是這個格式唯一不能說的謊。write_manifestMCP tool:機器搬遷裡唯一能讓 agent 自己做的一步,因為它不碰憑證。export/import仍留在 CLI,跟人與密語在一起。pb exportpb manifest--keys才帶順手修掉的 bug
collect_mcp只要 spec 讀得到就標carried: true。在 bundle 情境下剛好成立,在不搬值的情境下是錯的。既有的 export 沒受影響(兩者恰好重合),是做 inventory 這條路時發現的。驗證
cargo test:754 passed, 0 failed;cargo clippy --all-targets零警告test_an_inventory_manifest_carries_nothing_and_says_so:用一台同時有可攜憑證檔、keychain 綁定工具、以及 env 裡含祕密的 MCP 註冊的假 home,斷言 inventory 什麼都沒帶、但仍列得出東西,且GRAFANA_TOKEN這個名稱在檔案裡、glsa_secret這個值不在一個要相處的事實
key 的
purpose是自由文字,會原封不動進到這個「可以進版控」的檔案。patchbay 自己絕不會把祕密寫在那裡,但人可以。README、docs 與 MCP tool description 三處都寫明了這件事,建議第一次 commit 前掃一眼那個欄位。