Expand dotted setting keys and mask secret pools #181

Merged
weichen merged 12 commits from fix/settings-dotted-keys into main 2026-10-04 13:48:31 +00:00
Owner

fix/settings-dotted-keys 任务卡

任务主记录:Dev #181(Backend #61);状态:进行中;owner:weichen

基线与授权

  • 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 5d3a4b3ee3
  • 工作区:/home/weichen/projects/Agent-System-Dev-wt-fix-settings-dotted-keys(worktree);分支:fix/settings-dotted-keys
  • 授权与交付终点:修复设置点路径死键、密钥明文返回、掩码写回。改 Backend,Dev 仓推进 gitlink。部署到 dev 环境验收,并重测小队入口。合入由所有者执行。不改 Core,不改前端,不改 svc.sh 播种时序。

目标与非目标

  • 目标:PUT /api/settings/user|project/{id} 的点路径键展开成嵌套并生效;嵌套对象与点路径冲突时嵌套胜出;启动时迁移存量点路径键(在注册 Tavily 之前);GET /api/settings 按 schema 掩码 secret(含 apiKeys);写回 •••••• 不覆盖已存密钥。
  • 非目标:不按 schema 校验键名。不改前端。不改 Core。不改 svc.sh 播种时序。不修小队路径 tool.result 恒为 ok。

合同、依赖与兼容

  • 合同:点路径在写入时展开。两种形态并存时嵌套胜出。GET 对 type=secret 或 secret=true 的路径,以及叶子名 apiKey/api_key/apiKeys/secret/token,非空值返回 ••••••。写回该占位符视为未修改。有迁移时日志为 settings: normalized N dotted key(s) in M scope(s)。掩码占位符存量只记路径。
  • 依赖:Backend 先合入,再把本仓 gitlink 改钉到 Backend main 的合入提交。
  • 兼容:以前静默失效的点路径写入,升级后会生效。与已存在的嵌套对象冲突时,已生效的嵌套值保持不变。

同步记录

节点 sync_base_sha tested_head_sha checked_at
启动 5d3a4b3ee3 5d3a4b3ee3 2026-10-04T12:52:50Z
同步前验收 3836ea88e3 f2516ef1ce 2026-10-04T13:04:26Z

结果与验证(完成后填写)

  • 结果:Backend d90b9c0,Backend #61。Dev Dev #181。
  • 验证:Backend go test ./... 通过。Dev worktree make test 通过(boundaries、pins、libs、core、backend、frontend vitest 77、ui vitest 79、agent-command;exit 0,2026-10-04T13:05:13Z)。dev 部署 scripts/svc.sh dev deploy --from dev@8b63e2b 成功(pid 1759380)。库已备份 runtime/dev/data-backup-20261004T130825Z.db。启动日志 normalized 4 dotted key(s) in 2 scope(s),registered (1 key(s))。库中不再有点路径键,context.maxHistoryMessages=30 已是嵌套值。GET 对 Tavily 密钥池返回掩码。点路径写入 runtime.entry 后 GET 读到嵌套值,已改回 direct。写回掩码占位符后主模型密钥长度仍为 126。web_search 探针 3 次 status=ok。
  • 影响与剩余项:这次启动迁移让原先无效的点路径写入生效(dev 库的 deliverables.style、runtime.entry、project 历史窗口)。小队入口重测见仓外报告 §10:入口接通,B6 的 delegation.json 解析失败,C4 停在 HITL。合入由所有者执行。合入后把本仓 gitlink 改钉到 Backend main 的合入提交,再 make test、make task-sync,然后合入 Dev #181。合入后在 worktree 内 make task-finish,并把 dev 重新部署到 main。
# fix/settings-dotted-keys 任务卡 任务主记录:[Dev #181](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/181)([Backend #61](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Backend/pulls/61));状态:进行中;owner:weichen ## 基线与授权 - 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 5d3a4b3ee3e69d9c47eeb2779eb1c7156c42186b - 工作区:/home/weichen/projects/Agent-System-Dev-wt-fix-settings-dotted-keys(worktree);分支:fix/settings-dotted-keys - 授权与交付终点:修复设置点路径死键、密钥明文返回、掩码写回。改 Backend,Dev 仓推进 gitlink。部署到 dev 环境验收,并重测小队入口。合入由所有者执行。不改 Core,不改前端,不改 svc.sh 播种时序。 ## 目标与非目标 - 目标:`PUT /api/settings/user|project/{id}` 的点路径键展开成嵌套并生效;嵌套对象与点路径冲突时嵌套胜出;启动时迁移存量点路径键(在注册 Tavily 之前);`GET /api/settings` 按 schema 掩码 secret(含 `apiKeys`);写回 `••••••` 不覆盖已存密钥。 - 非目标:不按 schema 校验键名。不改前端。不改 Core。不改 svc.sh 播种时序。不修小队路径 `tool.result` 恒为 ok。 ## 合同、依赖与兼容 - 合同:点路径在写入时展开。两种形态并存时嵌套胜出。GET 对 `type=secret` 或 `secret=true` 的路径,以及叶子名 `apiKey`/`api_key`/`apiKeys`/`secret`/`token`,非空值返回 `••••••`。写回该占位符视为未修改。有迁移时日志为 `settings: normalized N dotted key(s) in M scope(s)`。掩码占位符存量只记路径。 - 依赖:Backend 先合入,再把本仓 gitlink 改钉到 Backend main 的合入提交。 - 兼容:以前静默失效的点路径写入,升级后会生效。与已存在的嵌套对象冲突时,已生效的嵌套值保持不变。 ## 同步记录 | 节点 | sync_base_sha | tested_head_sha | checked_at | |---|---|---|---| | 启动 | 5d3a4b3ee3e69d9c47eeb2779eb1c7156c42186b | 5d3a4b3ee3e69d9c47eeb2779eb1c7156c42186b | 2026-10-04T12:52:50Z | | 同步前验收 | 3836ea88e3954878f257b7708ae5ccef947ccd79 | f2516ef1ce2dc3ffc702a3a623711978c90de626 | 2026-10-04T13:04:26Z | ## 结果与验证(完成后填写) - 结果:Backend `d90b9c0`,[Backend #61](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Backend/pulls/61)。Dev [Dev #181](https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/181)。 - 验证:Backend `go test ./...` 通过。Dev worktree `make test` 通过(boundaries、pins、libs、core、backend、frontend vitest 77、ui vitest 79、agent-command;exit 0,2026-10-04T13:05:13Z)。dev 部署 `scripts/svc.sh dev deploy --from dev@8b63e2b` 成功(pid 1759380)。库已备份 `runtime/dev/data-backup-20261004T130825Z.db`。启动日志 `normalized 4 dotted key(s) in 2 scope(s)`,`registered (1 key(s))`。库中不再有点路径键,`context.maxHistoryMessages=30` 已是嵌套值。GET 对 Tavily 密钥池返回掩码。点路径写入 `runtime.entry` 后 GET 读到嵌套值,已改回 direct。写回掩码占位符后主模型密钥长度仍为 126。web_search 探针 3 次 status=ok。 - 影响与剩余项:这次启动迁移让原先无效的点路径写入生效(dev 库的 deliverables.style、runtime.entry、project 历史窗口)。小队入口重测见仓外报告 §10:入口接通,B6 的 delegation.json 解析失败,C4 停在 HITL。合入由所有者执行。合入后把本仓 gitlink 改钉到 Backend main 的合入提交,再 `make test`、`make task-sync`,然后合入 Dev #181。合入后在 worktree 内 `make task-finish`,并把 dev 重新部署到 main。
weichen added 5 commits 2026-10-04 13:07:57 +00:00
Why: dotted setting writes were stored as unread keys, and secret pools were returned in clear text.
Evidence: Backend go test ./... at d90b9c0. Dev make test follows this pin.
Impact: the dev branch tracks Backend fix/settings-dotted-keys until that PR merges, then the pin moves to main.
Refs: fix/settings-dotted-keys
Co-authored-by: Cursor <cursoragent@cursor.com>
Record make test evidence on the settings fix
ci / test (pull_request) Successful in 2m4s
e34db45bfe
Why: the acceptance sync needs the verification result on the task card before review.
Evidence: make test exited 0 after task-sync onto 3836ea88e3.
Impact: documentation only. The backend pin is unchanged.
Refs: fix/settings-dotted-keys
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen added 1 commit 2026-10-04 13:08:27 +00:00
Link the settings fix task card to its pull requests
ci / test (pull_request) Successful in 2m3s
8b63e2bce0
Why: the task card is the review record and needs the Dev and Backend PR links.
Evidence: Dev #181 and Backend #61 exist.
Impact: documentation only.
Refs: fix/settings-dotted-keys
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen added 1 commit 2026-10-04 13:39:33 +00:00
Record dev deployment and squad retest evidence
ci / test (pull_request) Successful in 2m11s
fa16e9d251
Why: acceptance of the settings fix is the deploy log and the live key checks, and that evidence belongs on the task card.
Evidence: dev@8b63e2b logged normalized 4 dotted keys in 2 scopes and registered 1 Tavily key. The web_search probe returned ok.
Impact: documentation only. The backend pin is unchanged. Merging stays with the owner.
Refs: fix/settings-dotted-keys
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen added 4 commits 2026-10-04 13:47:08 +00:00
Why: the Dev branch must record the Backend main commit that contains the settings fix, not the unmerged feature tip.
Evidence: Backend #61 merged as fd17011.
Impact: modules/backend gitlink moves from d90b9c0 to fd17011. Behavior is the merged fix.
Refs: fix/settings-dotted-keys
Co-authored-by: Cursor <cursoragent@cursor.com>
Record the backend merge pin and the post-sync test
ci / test (pull_request) Successful in 2m1s
4df29aa7bc
Why: the task card must show that Backend #61 is on main and the Dev branch was retested after syncing.
Evidence: make test exited 0 at 2026-10-04T13:45:06Z on the pin of fd17011.
Impact: documentation only.
Refs: fix/settings-dotted-keys
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen added 1 commit 2026-10-04 13:47:55 +00:00
weichen merged commit 5e1886dfd3 into main 2026-10-04 13:48:31 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Dev#181