Skip to content

chore(public-face): 公开面脱敏——测试夹具里的 operator 个人名/家目录 38 处改中性名、内部迭代编号 round-NN 8 处删除但保留 issue 与日期锚点、1 处畸形 Windows 路径夹具修正(16 文件净 0 行,历史暴露面已量化未清洗) - #2284

Merged
DeliciousBuding merged 5 commits into
masterfrom
chore/public-face-redaction
Sep 3, 2026

Conversation

@DeliciousBuding

Copy link
Copy Markdown
Collaborator

做了什么

round-70「不值得公开的面」轴的脱敏批(下文用 U 指代被替换掉的 operator 个人名,本 PR 刻意不再复写它):

类别 处置 处数
Windows 家目录夹具 C:\Users\U C:\Users\Example(仓库既有中性名,双层 \\ 转义保留) 4 文件 / 22 处
Linux 家目录夹具 /home/u/... /home/example/...(与既有 /Users/example 一致) 2 文件 / 8 处
前端夹具显示名 / currentUserId Alice / alice(authStateMachine、pipeline-integration 已有先例) 4 文件 / 13+1 处
内部迭代编号 round-NN 删编号、保留同句的 issue 号与日期锚点 7 文件 / 8 处
畸形夹具路径 C:\Users\file.ts C:\Users\Example\file.ts(同文件无等价 Windows 用例,修不删) 1 文件 / 1 处

16 files changed, 52 insertions(+), 52 deletions(-) —— 净 0 行,纯字面替换,无行为改动。

hub-server/internal/service/device/device.go 是唯一非测试文件:改的是注释里的 round-NN

为什么这些算「不该公开」

  • 家目录/用户名是操作者身份,不是被测契约:脱敏正则 subagent_result_sanitize.go:25 与用户名无关(已实测),生产代码 0 命中(git grep -n "U" -- ':!*_test.go' ':!*.test.ts*' rc=1)。也就是说这些字面量对断言的意义只是「一个 Windows/Unix 绝对路径」,换成中性名不损失任何覆盖。
  • round-NN 是内部迭代计数,对公开仓库的读者是不可解引用的噪声;issue 号才是可解引用锚点,所以留 issue 删编号。

证据(主机独立复跑,不采信车道自述)

$ git grep -nE "\bU\b|/home/u\b|Users[\\/]+U" -- .        → 0 命中
$ git grep -noE "round-[0-9]+" -- .                        → 仅剩 AGENTS.md(1) 与 scripts/verify/**(8)
$ python3 scripts/verify/verify-doc-ssot.py                → rc=0(doc SSOT ok / self-test wiring 29 ok)
$ bash scripts/verify/verify-commit-messages.sh master HEAD → rc=0(6 commits)
$ bash scripts/verify/check-secrets.sh --range origin/master...HEAD → Secret guard passed
$ git diff --check origin/master...HEAD                    → rc=0(带 range,round-69 教训)

edge-server: go build ./... rc=0
  go test ./internal/adapters/claude/... ./internal/adapters/sdk/... ./internal/api/... ./internal/lifecycle/...
  ok claude 9.397s / sdk 14.759s / api 3.488s / lifecycle 11.932s   → rc=0
hub-server:
  go test ./internal/router/... ./internal/service/device/...        → ok 0.136s / 0.042s
前端(真跑,非 grep):
  desktop vitest.desktop-ci.config.ts src/__tests__/attachment.test.ts   → 14 passed (14)
  shared  src/chatview/components/UserMessage.rendering.test.tsx          → 9 passed (9)
  workbench inspector + workbenchRoutesHelpers + workbenchTasksRouteHelpers → 46 passed (46)

rebase 到 a15bf7dc#2283 testkit shim 消融)后复跑:process_executor_test.go 同时含 pkg/testkit import 与 /home/example 夹具,edge build + lifecycle/sdk 测试仍全绿。

暗卷(变异测试,证明断言真的在管这些字面量)

  • A:破坏 lifecycle 脱敏正则 → TestSanitizeSubAgentResult_FilePath 变红 ✅
  • B:A 之后 sdk mapper 测试仍绿 —— 说明 sdk_fixture_mapper_test.go 走的是 sdk 包自己的 sdkWindowsPathPattern,不经 lifecycle 正则;补做破坏 sdkWindowsPathPattern → SDK 脱敏断言真变红(replay 裸漏路径)✅
  • 两项变异均已 revert 并全量复跑绿。

历史暴露面(只量化,清洗)

  • 精确 C:\Users\U2 个提交(2026-08-14 372a2119、2026-08-20 f296ad02),仅在 4 个 edge-server 测试文件。
  • 任意大小写 U6 个提交,最早 2026-08-14、最新 2026-08-25 3b2b527a,跨 8 个文件(4 Go + 4 前端测试)。
  • 本 PR 没有git filter-repo没有 force-push:历史重写不可逆且会打乱所有下游 clone,属 operator 决策项。合入本 PR 后,工作树 HEAD 已不含该字面量,但历史仍可检出。

Negative constraints(刻意没做)

  • 禁区一字未动:AGENTS.mdscripts/verify/**(其中 2 处 round-NN载荷性夹具——verifier 自己的测试用例,删了会让门禁失去被测目标)、.github/**Makefileapi/openapi.yaml。已用 git diff --name-only 逐一确认。
  • 判定为合法、不改的相邻命中:100.64.0.0/10(CGNAT 网段,不是个人信息)、bench 里的 Kunpeng 硬件注记(性能数据的必要上下文)、tailscale(产品功能名)、/root/.ssh/authorized_keys 示例(文档必需路径)。
  • (#2241 lane A) / (#2250 wave lane A) 里的 lane A 属内部词但不是 round-NN 范围,本 PR 未动(列为后续候选)。

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: f87eb46d-0d15-43d6-8dfb-06e6af399dcc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@DeliciousBuding
DeliciousBuding enabled auto-merge (squash) September 3, 2026 10:52
@DeliciousBuding
DeliciousBuding merged commit d74bd77 into master Sep 3, 2026
47 checks passed
@DeliciousBuding
DeliciousBuding deleted the chore/public-face-redaction branch September 3, 2026 11:00
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