Repository navigation
Commit da9b5f7
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wg7PpRrnuu2FgdSkRXPUGd2w)_
domain:server#2 · os-bill · session_01Utp6Cbvcmv8YWFhFJwzjKL
## 维护者速读
- 改了什么:ADR-0007 状态行加「已修订」;D6 补一句「环境变量锁定不拒绝清除(`null`),行锁和写入规则照常判」;REST 表
409 一栏、架构草图和服务接口注释各加同样的例外;新增一个 ADR 锚点文件,把 `settings-service.ts` 钉到
ADR-0007。
- 为什么改:执行 #30385 裁定 A(2026-11-05「同意」)。代码 PR #30448 允许清掉锁定键底下存的旧值,ADR
原文写的是「一律 409」,须先修订 ADR。
- 风险与回滚:纯文档,不动代码;生效值仍是环境变量,锁定标记不变。回滚即还原本 PR 一次提交。
- 先看:`docs/adr/0007-settings-manifest-and-kv-store.md` 第 3 行、第 86 行、第
101 行(D6)、第 303 行、第 323 行(REST 表),以及新锚点文件。
- 两分钟验证:`node scripts/check-adr-links.mjs && pnpm check:adr-anchors &&
pnpm check:adr-index`,预期全绿。
- 需要你做的:Tier H,审阅人 os-zhuang + hotlong;本 PR 先合,之后 #30448 再落地。
Refs #30385
Clause-②: no
Metadata-protocol: none
## What changes
ADR-0007 D6 said every UI write to an env-pinned key is refused with
HTTP 409 `locked-by-env`. PR #30448 lets exactly one write through the
pin: a clear (`null` / absent), which nulls the stored row beneath the
override. The value in force does not move — the resolver still answers
`source='env', locked=true` — and every other write stays 409
(`settings-service.ts` pre-flight: `const clears = patch[key] === null
|| typeof patch[key] === 'undefined'; if (!clears &&
this.effectiveEnvOverride(...)) throw new SettingsLockedError(...)`).
Per AGENTS.md (a decision change amends the original ADR's status line),
and per contract review 6671549520's three should-fixes:
1. **Status line** — `· **Amended (2026-11-05, #30385)** — D6: a clear
(null) of an env-pinned key is not refused; it clears the stored value
beneath the override and changes nothing in force.`
2. **D6** — the exception sentence (the pin does not refuse a clear; the
row locks and the key's write predicates still judge it like any clear),
with the superseded wording kept inline as an *Amended* note.
3. **REST table** — `PUT /api/settings/:namespace` row: `(409 if any key
locked-by-env, except a null clear)`.
4. **Architecture sketch (L86) and the service-surface comment (L303)**
— the same exception, `(a null clear excepted — D6)`, so the ADR does
not contradict D6.
Out of scope (known drift, untouched): `resetNamespace` wording (reset
still skips pinned keys; widening it is #30664), D-tier drift, env-var
prefixes.
## ADR anchor
New
`scripts/adr-anchors/packages__services__service-settings__src__settings-service.ts.json`
(`ADR-0007`), as ruling 6670154789 item 3 names. Its invariant: an env
override in force refuses every write but a clear; the clear nulls the
stored row and changes nothing in force. `settings-service.ts` already
cites ADR-0007 on `main`, so `pnpm check:adr-anchors` is green on `main`
and on this branch.
## Verification
At head `27a3e1c9`: derived gates for the two files, 29 of 29 exit 0;
`--ran` reconcile 0 NOT-MEASURED. The first head (`26da6f27`) ran 21 of
21. Contract review PASS 6671549520 on the first head; the delta review
covers the fix commit.
No changeset: docs/adr only (`skip-changeset`).
<!-- signed: domain:server#2 · os-bill ·
session_01Utp6Cbvcmv8YWFhFJwzjKL -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3dcea42 commit da9b5f7
2 files changed
Lines changed: 12 additions & 5 deletions
File tree
- docs/adr
- scripts/adr-anchors
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
| 303 | + | |
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments