Skip to content

Commit 5e53d73

Browse files
hotlongclaude
andauthored
test(organizations): the open-only wall acceptance — raise the posture through the real open registrar, not a stub (#16137) (#16719)
The two REST matrices (`single-kernel-isolated-api-key-matrix.test.ts`, `single-kernel-isolated-session-org-claim-matrix.test.ts`) drive the whole matrix under a live `isolated` posture, and both MANUFACTURE that posture with `async () => ({ posture: 'isolated' })`. They prove the wall behaves correctly GIVEN a posture and say nothing about whether anything open can PRODUCE one. `open-only-wall-acceptance.test.ts` is the other half. It boots a real `LiteKernel` with the real `AuthPlugin` and the real `OrganizationsPlugin` under `OS_TENANCY_POSTURE=isolated` and `OS_ALLOW_DEGRADED_TENANCY` UNSET, reads the posture back out of the `tenancy` service that boot RESOLVED, and runs the matrix against it through a real `RestServer`. - §0 asserts the deployment shape through the same resolvers `serve.ts` reads. - §1 is the card's ⭐: `org-scoping` resolves and IS the mounted plugin instance; the effective posture is `isolated`, `isolationActive`, NOT degraded. - §2 runs the matrix: ex-member API key refused (401, nothing lands), organization-less caller refused, ex-member session dropped-not-refused (ADR-0123 D2 403 on write) — and, as the control without which the refusals prove nothing, a healthy member still reads and writes over both a key and a session. - §3 measures acceptance clause 3 twice: a recording service registry shows no licence-shaped lookup over boot AND request time, and the composition's transitive workspace closure is Apache-2.0 throughout. Each half carries a positive control. - §4 ablates the mount: `org-scoping` stops resolving, the posture degrades to `single`, and the measured leak returns — so §1 and §2 are measuring the mount rather than the fixture. The acceptance lives in this package because `no-framework-dependents.pin.test.ts` refuses any `packages/**` package declaring `@objectstack/organizations`; the prohibition is asymmetric, so the acceptance comes to the plugin. The stub suites are untouched (acceptance clause 4), which is why the fixture is a deliberate second copy rather than an extraction. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent cfb64a6 commit 5e53d73

5 files changed

Lines changed: 986 additions & 0 deletions

File tree

packages/plugins/organizations/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
},
2828
"devDependencies": {
2929
"@objectstack/metadata-core": "workspace:*",
30+
"@objectstack/rest": "workspace:*",
3031
"@types/node": "^26.2.0",
3132
"tsx": "^4.23.12",
3233
"typescript": "^6.0.3",

0 commit comments

Comments
 (0)