Repository navigation
Commit d08b859
docs(verify): posture-only docblocks say what the stand-in walls and what it does not (#28760)
<!-- claude-projects-attribution: {"github_login":"marchtian"} -->
_Requested by **田騏** · [project
thread](https://claude.ai/code/project/chan_01VmuUhXU9SSUzqJYyXSmYSi?thread=cmsg_01VmuUhXU9SSUzqJYyXSmYSi9paTx1Lu8ENYwwssthfK3h)_
Fixes #28703
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:只改 `packages/verify/src/harness.ts`
里的注释(`SimulatedOrgScopingPlugin`、`BootOptions.multiTenant:
'posture-only'`、`orgContext` 一段、一行行内注释),外加一条 `@objectstack/verify` patch
changeset;不改任何代码。
- 为什么改:旧注释说 posture-only 启动"不打 organization_id、不做隔离,跨组织测试写了也白写";ADR-0131
之后引擎按姿态落组织、Layer 0 按姿态拦截,注释与代码正相反,会让写测试的人放弃本可低成本钉住的跨组织隔离。
- 风险与回滚:零运行时风险(仅注释,`dist/index.d.ts` 里的 JSDoc 随之变化);回滚即 revert 本 PR。
- 先看:`packages/verify/src/harness.ts` 的 `multiTenant` 文档块("What it
walls" / "What it does NOT give a fixture" 两节);其次文件顶部
`SimulatedOrgScopingPlugin` 文档块。
- 两分钟验证:`git diff origin/main...HEAD --
packages/verify/src/harness.ts`,预期只见注释行变动、无一行代码变化。
- 需要你做的:无,席位落地。
## What changes
Comments only, in `packages/verify/src/harness.ts`, plus a `patch`
changeset for `@objectstack/verify` (the `BootOptions` JSDoc ships in
`dist/index.d.ts`, so the published bytes change).
- **`SimulatedOrgScopingPlugin` docblock.** The "⛔ It stamps no
`organization_id` and scopes no query" sentence is replaced. The
stand-in itself still stamps and scopes nothing, but since ADR-0131 (D8,
D11) the wall is open-core code that keys on the posture the stand-in
makes true. The engine lands an insert in the caller's active
organization (`ObjectQL#driverWriteTarget`), the SQL driver fills an
absent `organization_id` (`SqlDriver#injectTenantOnInsert`), and reads
are scoped by the one Layer 0 verdict (`computeTenantLayer0Verdict`,
`postureEnforcesWall`).
- **`BootOptions.multiTenant` `'posture-only'` section.** "It performs
no tenant isolation whatsoever … would assert nothing and pass" is
removed. Two subsections replace it:
- *What it walls*: insert and read, with the code locations behind each.
- *What it does NOT give a fixture*: no default-organization bootstrap
(the admin resolves org-less), no per-organization seed replay, no
walled membership-policy gate, no deployment declarations on the
service, and the memory driver refuses a walled posture.
The section tells a cross-organization fixture to measure the wall, and
points to the precondition case of
`packages/qa/dogfood/test/create-caller-id-collision-walled.dogfood.test.ts`
as the shape.
- **`orgContext` docblock.** "Cross-tenant isolation has exactly one
honest proof in this repo: `multiTenant: true`" is replaced. A
cross-tenant fixture needs a walled posture, either `'posture-only'` or
`true`. The "asserts nothing on `single`" sentence stays, because it is
still true. It now names the Layer 0 verdict as well as the RLS strip.
- **Inline comment** at the `'posture-only'` branch of `bootStack`:
"activates the POSTURE, never the WALL" now says the open core's wall
follows from the posture.
## Tests
No behaviour changes, so no test was added or changed.
<details><summary>Local runs at head 5b630f0</summary>
- `pnpm --filter '@objectstack/verify...' build` (under
`os-verify-lock`): `VERDICT command-exit 0`.
- `pnpm --filter @objectstack/verify typecheck`: `VERDICT command-exit
0`. `check:test-typecheck: OK`.
- `pnpm --filter @objectstack/verify exec vitest run --maxWorkers=2`:
`Test Files 48 passed (48)`, `Tests 401 passed (401)`, `VERDICT
command-exit 0`.
- Published-surface check after the build: `dist/index.d.ts` contains
"What it does NOT give a fixture" (1 match) and "performs no tenant
isolation whatsoever" (0 matches). The positive control `databaseDriver`
has 2 matches. `files` is `["dist","README.md","CHANGELOG.md"]`.
</details>
## Acceptance notes
- **Changeset level.** os-dev's fast track lists comments as not
published. Here, though, the `BootOptions` JSDoc measurably ships in
`dist/index.d.ts`, so this takes a `patch` changeset, not
`skip-changeset`.
- **Left as is (out of scope).** The `SimulatedOrgScopingPlugin`
docblock still says "The proof that the REAL plugin walls tenants lives
in cloud's `security-enterprise` multi-org integration test". The read
wall is now open-core code that this repo pins too (see the walled pin
above), so that sentence understates where the proof lives. It is not a
defect, and this PR does not touch it.
- **Spec docblock (not edited, out of scope).**
`postureStampsOrganization`'s docblock in
`packages/spec/src/security/tenancy-posture.ts` says the stamper is the
enterprise runtime, "not the open engine". The open engine plus the SQL
driver now stamp the active organization on insert in every posture
(`ObjectQL#driverWriteTarget`, `SqlDriver#injectTenantOnInsert`). This
looks like the same class of drift in another package. It is noted here
and not filed.
## Verification
<details><summary>Derived gate families (dispatch-gates --commands, head
5b630f0)</summary>
- 54 derived families. 53 exited 0.
- 1 is NOT MEASURED: `pnpm check:dual-build-cjs-loads` exited 3 with
`PREREQUISITE NOT MET` because it needs a full `pnpm build` and only the
verify closure was built. CI runs it.
- `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack
--ran FILE` reports `54 derived famil(ies) accounted for — 53 run, 1
NOT-MEASURED (1 DERIVED from a recorded exit 3)` and exits 0.
- Every family CI runs, the repo-wide ones included, is CI's to report
on this PR.
</details>
Session: https://claude.ai/code/session_017ihL2gLghEqeDKTbDTC7Zd
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>1 parent 373081f commit d08b859
2 files changed
Lines changed: 95 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
81 | 88 | | |
82 | 89 | | |
83 | 90 | | |
| |||
235 | 242 | | |
236 | 243 | | |
237 | 244 | | |
238 | | - | |
| 245 | + | |
239 | 246 | | |
240 | 247 | | |
241 | 248 | | |
242 | 249 | | |
243 | 250 | | |
244 | | - | |
| 251 | + | |
| 252 | + | |
245 | 253 | | |
246 | 254 | | |
247 | 255 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
| 256 | + | |
256 | 257 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
264 | 313 | | |
265 | 314 | | |
266 | 315 | | |
| |||
293 | 342 | | |
294 | 343 | | |
295 | 344 | | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
300 | 350 | | |
301 | 351 | | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
306 | 356 | | |
307 | 357 | | |
308 | 358 | | |
| |||
1088 | 1138 | | |
1089 | 1139 | | |
1090 | 1140 | | |
1091 | | - | |
| 1141 | + | |
| 1142 | + | |
1092 | 1143 | | |
1093 | 1144 | | |
1094 | 1145 | | |
| |||
0 commit comments