From 30d869b388ec84e05ab2d99a3188d7351665b9d8 Mon Sep 17 00:00:00 2001 From: hexin <372726039@qq.com> Date: Fri, 24 Jul 2026 16:54:34 +0800 Subject: [PATCH 1/3] =?UTF-8?q?chore(security):=20=E9=85=8D=E7=BD=AE=20for?= =?UTF-8?q?k=20=E5=85=A8=E5=8E=86=E5=8F=B2=E5=AF=86=E9=92=A5=E6=89=AB?= =?UTF-8?q?=E6=8F=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对两个上游安全测试夹具使用路径和精确字面量联合豁免,并在 Pinvou fork CI 中扫描完整 Git 历史。 Signed-off-by: hexin <372726039@qq.com> --- .github/workflows/pinvou-fork-ci.yml | 12 ++++++++++++ .gitleaks.toml | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 .gitleaks.toml diff --git a/.github/workflows/pinvou-fork-ci.yml b/.github/workflows/pinvou-fork-ci.yml index 64ae079dee..3f37a14153 100644 --- a/.github/workflows/pinvou-fork-ci.yml +++ b/.github/workflows/pinvou-fork-ci.yml @@ -18,6 +18,18 @@ env: CARGO_INCREMENTAL: 0 jobs: + secrets: + name: Gitleaks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Scan repository and history + uses: docker://ghcr.io/gitleaks/gitleaks:v8.30.1 + with: + args: detect --source=/github/workspace --redact --verbose + check: runs-on: ubuntu-latest timeout-minutes: 45 diff --git a/.gitleaks.toml b/.gitleaks.toml new file mode 100644 index 0000000000..26a3621d6c --- /dev/null +++ b/.gitleaks.toml @@ -0,0 +1,16 @@ +[extend] +useDefault = true + +[[allowlists]] +description = "Upstream security tests use explicit non-production credential fixtures" +targetRules = ["generic-api-key"] +condition = "AND" +regexTarget = "line" +paths = [ + '''^crates/tui/src/runtime_api/web\.rs$''', + '''^crates/tui/src/tui/onboarding/api_key\.rs$''', +] +regexes = [ + '''let session_token = "cwws_0123456789abcdef0123456789abcdef";''', + '''app\.api_key_input = "sk-1234567890abcdef"\.to_string\(\);''', +] From 2930fa63842f6e282c615af2f050b7e8e049aaee Mon Sep 17 00:00:00 2001 From: hexin <372726039@qq.com> Date: Fri, 24 Jul 2026 16:54:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?docs(fork):=20=E8=AE=B0=E5=BD=95=20Pinvou?= =?UTF-8?q?=20=E5=85=AC=E5=BC=80=E5=9F=BA=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 说明 v0.9.0 上游来源、六个长期 patch 主题、同步流程、稳定 tag 和验证要求。 Signed-off-by: hexin <372726039@qq.com> --- PINVOU_FORK.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 6 +++++ 2 files changed, 79 insertions(+) create mode 100644 PINVOU_FORK.md diff --git a/PINVOU_FORK.md b/PINVOU_FORK.md new file mode 100644 index 0000000000..8137f49be9 --- /dev/null +++ b/PINVOU_FORK.md @@ -0,0 +1,73 @@ +# Pinvou Fork Baseline + +This repository is the public CodeWhale fork embedded by +[Pinvou Agent](https://github.com/Pinvou/pinvou-agent). CodeWhale remains an +independent upstream project; general-purpose fixes should be contributed to +[Hmbown/CodeWhale](https://github.com/Hmbown/CodeWhale) whenever possible. + +## Pinned baseline + +- Upstream release: `v0.9.0` +- Upstream commit: `d167c07c96282411956ea7f35ddb8227afa1402f` +- Pinvou maintenance branch: `pinvou3-clean` +- Pinvou baseline tag: `pinvou-v0.9.0-r1` + +Pinvou Agent pins the exact commit identified by the baseline tag. It does not +follow the maintenance branch automatically. + +The fork was rebuilt on the public upstream release history. It preserves +upstream commits, authorship, copyright, and the MIT license; it does not reuse +the history of Pinvou's former private fork. + +## Maintained patch themes + +Pinvou keeps six long-lived patch themes: + +1. A library facade for embedding CodeWhale in a desktop host. +2. Host-specific tool exposure, bounded file writes, and execution safety. +3. A sealed prompt composer with host-controlled context and skill sources. +4. Automation scheduling, stable conversation identity, and run retention. +5. Host orchestration, structured workflow completion, cancellation, and OAuth + cancellation. +6. Runtime route, context-budget, and shared automation APIs for the host. + +Small fixes are folded into the nearest theme instead of creating an +unbounded patch stack. Product UI, platform integration, connectors, and +distribution logic stay in Pinvou Agent rather than this fork. + +## Sync policy + +For an upstream update: + +1. Fetch upstream tags and select a public release baseline. +2. Compare each Pinvou theme with the new upstream behavior. +3. Remove patches already implemented upstream. +4. Move host-only behavior to Pinvou Agent when it does not require an atomic + CodeWhale lifecycle change. +5. Reapply the remaining themes as reviewable commits on the new baseline. +6. Run formatting, all-target checks, `forkguard_` tests, and a full history + secret scan. +7. Create a new immutable `pinvou-v-r` tag and update Pinvou + Agent's submodule pointer in a separate pull request. + +Never move or reuse an existing Pinvou baseline tag. + +## Verification + +The fork CI runs: + +```bash +cargo fmt --all -- --check +cargo check --workspace --all-targets --locked +cargo test -p codewhale-tui --lib forkguard_ --locked +gitleaks detect --source=. --redact --verbose +``` + +The parent repository additionally verifies that the pinned gitlink is +reachable from this public repository and that a recursive clone succeeds. + +## License and attribution + +CodeWhale and these fork changes are available under the repository's +[MIT License](LICENSE). Upstream copyright and contributor attribution are +preserved. diff --git a/README.md b/README.md index 41aa53d175..cb1c3c0381 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,12 @@ commands, checks the results, and keeps going until the task is done or it needs you. TUI for interactive work, `codewhale exec` for scripts and CI. Rust, MIT, runs entirely on your machine. +> **Pinvou fork notice:** the `pinvou3-clean` branch contains the small, +> documented patch set used by +> [Pinvou Agent](https://github.com/Pinvou/pinvou-agent). See +> [PINVOU_FORK.md](PINVOU_FORK.md) for the upstream baseline, maintained patch +> themes, sync policy, and verification commands. + It started as `deepseek-tui`. The community that formed around it needed more providers, so now DeepSeek, Claude, GPT, Kimi, GLM, and 30+ others run through the same runtime and tools. From 2f60e008336a145e18b62bf540fd8c1fd501beaa Mon Sep 17 00:00:00 2001 From: hexin <372726039@qq.com> Date: Fri, 24 Jul 2026 16:54:34 +0800 Subject: [PATCH 3/3] =?UTF-8?q?chore(fork):=20=E6=B8=85=E7=90=86=E5=86=85?= =?UTF-8?q?=E9=83=A8=E9=A1=B9=E7=9B=AE=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 保留多行安全命令回归的技术背景,移除不应出现在公开 fork 中的内部项目代号。 Signed-off-by: hexin <372726039@qq.com> --- crates/tui/src/command_safety.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tui/src/command_safety.rs b/crates/tui/src/command_safety.rs index 5e99c5583f..1aab1adada 100644 --- a/crates/tui/src/command_safety.rs +++ b/crates/tui/src/command_safety.rs @@ -1707,7 +1707,7 @@ mod tests { // pinvou3-fork: 多行命令逐行分析,不再一刀切 Dangerous。 // 原硬规则 (commit b2f6ef56 在 pinvou3-patches 上加的 careful hook) 误伤 - // LLM 用 `\n` 串多个 cp / mkdir / mv 的合理批量操作 — h3c-ppt P7 阶段 + // LLM 用 `\n` 串多个 cp / mkdir / mv 的合理批量产物操作 // "拷贝 5 个 template 文件" 被无差别拦死。改成逐行 recurse 评估,任一行 // Dangerous 才拦。 #[test]