Repository navigation
Commit 89d815c
docs(adr-0135): D4 gains a dated note for the SCIM provisioning writer and its boot backfill (#32484)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgSnFirZ8ynCmAemTPrCvXpF)_
Fixes #32450
Clause-②: no
Metadata-protocol: none
Skills-docs: none — ADR bookkeeping only
## 维护者速读
- 改了什么:ADR-0135 D4 下新增一条带日期的 Note,记录 `sys_user.source` 的第三个写入方(SCIM
开通写入)、它的两种失败姿态,以及启动时的一次性补标。只动这一个 ADR 文件,51 行纯新增。
- 为什么改:D4 正文只写了「两个写入方、都 fail open」。上一个已合并的 SCIM 改动加了第三个写入方,而且它在激活态是 fail
closed;读 ADR 的人要靠这份写入方清单知道标记从哪来。
- 风险与回滚:纯文档,无行为变化、无发布内容。回滚即 revert 本 PR。
- 先看:`docs/adr/0135-identity-and-access-architecture.md` 中 D4 末尾新增的
Note,重点是最后一段「为什么 SCIM 写入不 fail open」的理由是否与您的判断一致。
- 两分钟验证:`pnpm check:adr-symbol-anchors`,预期末行 `3544 anchors across 156
records resolve`(Note 里三个代码锚点都能解析)。
- 需要你做的:审阅并合并(`docs/adr/**` 是 Tier H,由您落地)。
## What changes
One dated Note is added under `### D4 — Source-of-truth marking: managed
vs env-native` in `docs/adr/0135-identity-and-access-architecture.md`,
after the existing 2026-10-23 note and in its form. D4's own paragraphs
are not edited. The note:
- **Names the SCIM provisioning writer.**
`auth-manager.ts#reconcileScimUserLifecycle` (the vendor's
`identity.reconcileUser` host callback) calls
`scim-identity-source.ts#markDirectoryProvisionedUsers` through the data
engine, inside the vendor's SCIM transaction. It also says why the two
existing writers never see a SCIM create: the vendor writes no
`sys_account` row.
- **Names its two postures.** Active state: the mark is written first
and fails closed. Inactive state (a deactivation, a `DELETE`, a create
with `active: false`): the deprovision write goes first and the mark
after it is best-effort, logged at `error` when refused and re-run by
the next active write and the boot backfill.
- **Names the boot backfill.** The `kernel:ready` pass in
`auth-plugin.ts` running
`scim-identity-source.ts#backfillScimProvisionedIdentitySource`, keyed
on the stored `sys_scim_subject` row, idempotent, run on every boot.
- **Gives the reason for the posture.** A sign-in is a person's act that
nothing retries, so the first two writers let it succeed and log. A
provisioning request is one transaction the identity provider retries,
so refusing it costs a delay and leaves nothing half-written, while
letting it through unmarked would create a managed user who is offered
the local-credential actions D5.2 hides.
- **Cites** #32400 (merge commit `2830f31d75`), the contract review
record `6792533556` on it, and this card.
The note is read from the code at merge commit
`2830f31d7510bacbfad4df79786aadea3a31d9f4`, not from the card's prose.
`git diff 2830f31 HEAD` over `scim-identity-source.ts`,
`auth-manager.ts`, `auth-plugin.ts` and `auth-manager-database-hooks.ts`
is empty at this head, so the note describes today's tree as well.
No changeset: `docs/adr/**` publishes nothing from any released package,
so the PR carries `skip-changeset` (AGENTS.md, Post-Task Checklist step
3).
## Tests
None owed. The diff is prose in one ADR; no package is touched, so there
is no build closure, no package test and no ablation.
## Acceptance notes
- **Where the code is more exact than the card.** The card says the mark
is best-effort "on deactivation and delete". The code's branch is the
inactive state, which also covers a create with `active: false`; the
note says so. The card says the writer runs "inside the directory's
transaction"; the code writes through the data engine, which joins the
vendor's SCIM transaction as its ambient one; the note says "inside the
vendor's SCIM transaction".
- **A reading left out of the note.** `reconcileScimUserLifecycle`
throws when the host has no data engine, before it branches on the
state, so with no engine a deprovision request fails too. Read from the
source only, not exercised; a composition with no data engine has no
identity tables. Noted here, not written into the ADR.
- **`docs/adr/README.md` is stale on `main`, and is not touched here.**
`pnpm check:adr-index` (report-only, exit 0) warns that the index is
behind. Regenerating it on this branch changes only the record counts
(154 to 155) and adds the row for ADR-0150, none of it from this note;
the file was restored (`git diff HEAD` empty) because the card's file
surface is the one ADR.
- **Pre-existing D4 wording, untouched.** D4 places the
`account.create.after` stamp in `auth-manager.ts`; the method
`AuthManager#stampIdentitySource` is declared there and its body now
lives in `auth-manager-database-hooks.ts`. Not a false sentence, and not
this card's.
## Round 2 (head `887b96d5a`, after contract review 6810927430)
The contract review of record on `79633651b` passed with two should-fix
findings and three nits; all five are fixed in one commit and the delta
review 6810994159 on `887b96d5a` is PASS with no remaining finding:
- the rollback claims are bounded to a datasource that honours
transactions, and the declared degrade (ADR-0119 D1: no `transaction`
API, or a driver that cannot open one) is named: the request still
fails, nothing rolls back, the rows are marked by the next SCIM write or
boot;
- the inactive-state bullet claims only that the deprovision write
already made stands, and names the two cases outside that (a mark
failure that aborts the driver transaction; the no-engine throw ahead of
the state branch);
- the backfill reads "once a pass has completed, a later boot writes
only a mark missed since"; the local-password rule is cited at D5.2's
second bullet; "no user is left active and unmarked" replaces "no SCIM
user is created unmarked".
Round-2 gates at `887b96d5a`: `check-adr-links` exit 0 (1124
destinations), `check-adr-symbol-anchors` exit 0 (3544 anchors, 156
records), `check-nul-bytes` exit 0. The Verification block below is the
round-1 record at `79633651b`.
## Verification
All on `objectstack-ai/objectstack`, head `79633651b` (`origin/main` at
`f0f729e71` merged: already up to date).
<details><summary>Derived gates: 21 of 21 exit 0</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 21 commands from the change set (1
path against merge base `f0f729e71`). Each was run with its exit code
captured before any pipe:
- exit 0: `node scripts/check-adr-links.mjs` (and `--self-test`), `node
scripts/check-closing-keyword-parity.mjs` (and `--self-test`), `node
scripts/check-comment-mask-corpus.mjs`, `node
scripts/ci/plan-test-core-shards.mjs --self-test`, `pnpm
check:adr-anchors`, `pnpm check:adr-index`, `pnpm
check:adr-symbol-anchors`, `pnpm check:ci-filter-parity`, `pnpm
check:closed-ceremony-text`, `pnpm check:cross-package-test-inputs`,
`pnpm check:doc-authoring`, `pnpm check:driver-memory-census`, `pnpm
check:gitlink-declared`, `pnpm check:nul-bytes`, `pnpm
check:pm-governed-merges`, `pnpm check:pm-prior-rulings`, `pnpm
check:refd-timer-probe`, `pnpm check:watch-hint-literal`.
- `pnpm --filter @objectstack/lint run check:doc-formula-expressions`:
first run exit 3, PREREQUISITE NOT MET (`@objectstack/formula` and
`@objectstack/lint` not built), read as NOT MEASURED. After `pnpm exec
turbo run build --concurrency=2 --filter=@objectstack/formula
--filter=@objectstack/lint` under `scripts/pm/os-verify-lock.sh`
(VERDICT command-exit 0), the re-run is exit 0.
- Verdict lines: `check-adr-links: 1123 relative link destination(s)
under docs/adr/ resolve`; `check-adr-symbol-anchors: 3543 anchors across
156 records resolve`; `check:doc-formula-expressions: 25 record-scoped
formula example(s) across 566 files / 1840 TS blocks judged clean`.
- Reconciliation: `dispatch-gates --ran`: `21 derived famil(ies)
accounted for — 21 run, 0 NOT-MEASURED (a DERIVED zero — all 21 recorded
an exit code and none of them is 3)`.
- NOT MEASURED locally, left to CI: the path-scheduled `Plan Test Core
shards` job and the whole-root families the derivation names as too wide
to place.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CaqHXh17Qc3C7MRAQw)_
<!-- signed: domain:skills#3 · os-bill ·
session_01Utp6CaqHXh17Qc3C7MRAQw -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent e424552 commit 89d815c
1 file changed
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
154 | 205 | | |
155 | 206 | | |
156 | 207 | | |
| |||
0 commit comments