Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -655,7 +655,7 @@ jobs:

# #3280/#3290 org-identifier guard: `organizationId` is the blessed
# developer-facing name for the caller's active org in hook/action bodies;
# the `session.tenantId` alias was REMOVED in v11 (#3290). Keeps our own
# the `session.tenantId` alias was REMOVED in v16 (#3290). Keeps our own
# reference code (examples/, apps/, AND packages/) — which authors and AIs
# copy from — off the removed name. Hard-fail (surfaces carry zero
# occurrences today); tests, comments, skills/ and docs/ are excluded, and
Expand Down
2 changes: 1 addition & 1 deletion content/docs/kernel/runtime-services/sharing-service.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -95,7 +95,7 @@ export async function mayEditContract(
userId: session.userId,
// The execution context names the org `tenantId`; a session exposes the
// same value as `organizationId` (the `session.tenantId` alias was removed in
// v11, #3290).
// v16, #3290).
tenantId: session.organizationId,
positions: session.positions,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/objectql/src/engine.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -535,7 +535,7 @@ describe('ObjectQL Engine', () => {
await engine.insert('task', { title: 'x' }, { context: { userId: 'u1', tenantId: 'org_1' } as any });

// Blessed name carries the org; the deprecated `tenantId` alias was
// removed in v11 (#3290) and must no longer be emitted.
// removed in v16 (#3290) and must no longer be emitted.
expect(session.organizationId).toBe('org_1');
expect(session.tenantId).toBeUndefined();
// `ctx.user` shortcut carries the same org for zero-relearning filtering.
Expand Down
2 changes: 1 addition & 1 deletion packages/objectql/src/engine.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -2906,7 +2906,7 @@ export class ObjectQL implements IObjectQLEngine {
// active org (matches the `organization_id` column, `current_user`
// RLS shape, and seed rows). It comes from `execCtx.tenantId`, which the
// kernel resolves from `session.activeOrganizationId`. The deprecated
// `session.tenantId` alias (#3280) was removed here in v11 (#3290) — the
// `session.tenantId` alias (#3280) was removed here in v16 (#3290) — the
// driver-layer `execCtx.tenantId` knob is a separate axis and stays.
organizationId: execCtx.tenantId,
positions: execCtx.positions,
Expand Down
2 changes: 1 addition & 1 deletion packages/objectql/src/plugin.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -942,7 +942,7 @@ export class ObjectQLPlugin implements Plugin {
}
// Stamp the driver-layer `tenant_id` column from the caller's active org.
// The hook session exposes it as `organizationId` (the `session.tenantId`
// alias was removed in v11, #3290); the column name is a separate axis.
// alias was removed in v16, #3290); the column name is a separate axis.
if (isInsert && session?.organizationId && hasField(objectName, 'tenant_id')) {
record.tenant_id = record.tenant_id ?? session.organizationId;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/plugin-audit/src/audit-writers.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1557,7 +1557,7 @@ describe('audit writers — the record\'s own organization stamps the row (#8707
* `organizationId`, `positions`, `accessToken`, plus the conditional
* `isSystem` / `actor` / `skipTriggers` / `skipAutomations` / `preserveAudit`.
* There is no spread, so no other key can arrive. `session.tenantId` was a
* deprecated alias (#3280) REMOVED repo-wide in the v11 major (#3290).
* deprecated alias (#3280) REMOVED repo-wide in the v16 major (#3290).
*
* The writer nevertheless read `sess.tenantId` for the RLS fallback, so the
* fallback could never fire: on an object with no organization column, or a
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/plugin-audit/src/audit-writers.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -1348,7 +1348,7 @@ export function installAuditWriters(
// [#9516] The fallback arm reads `organizationId` — the ONLY name the
// engine emits. `ObjectQL.buildSession` builds the hook session as a fixed
// key-set literal with no spread, and the `session.tenantId` alias (#3280)
// was removed repo-wide in the v11 major (#3290). This arm spelled the
// was removed repo-wide in the v16 major (#3290). This arm spelled the
// removed name, so it resolved to `undefined` and the guard above could
// never fire: every case it names — no organization column, NULL column —
// stamped `organization_id: null` and went permanently invisible behind the
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/action-execution.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -949,7 +949,7 @@ export function enforceActionParams(deps: ActionExecutionDeps,
*
* `organizationId` is the blessed name for the caller's active org — the
* same value as the `organization_id` column and `current_user.organizationId`
* (RLS). The deprecated `session.tenantId` alias (#3280) was removed in v11
* (RLS). The deprecated `session.tenantId` alias (#3280) was removed in v16
* (#3290); the driver-layer `ExecutionContext.tenantId` it is sourced from is
* a distinct, configurable axis and stays. Returns `undefined` — never `{}` —
* for a genuinely context-less / self-invoked call, so a body can tell "no
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -85,7 +85,7 @@ describe('#5697 — action `ctx.session` matches its declared contract', () => {
it('translates `ExecutionContext.tenantId` to the blessed `organizationId`', () => {
const built = build({ tenantId: 'org_acme' });
expect(built).toEqual({ organizationId: 'org_acme' });
// The v11-removed alias (#3280 / #3290) must not reappear.
// The v16-removed alias (#3280 / #3290) must not reappear.
expect('tenantId' in built!).toBe(false);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/domains/actions.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -320,7 +320,7 @@ export async function handleActionsRequest(deps: DomainHandlerDeps, path: string
// request (falling back to the id, quietly, when there is none).
// `organizationId` remains the blessed developer-facing name for the
// caller's active org (matches columns + `current_user.organizationId`);
// the deprecated `tenantId` alias (#3280) was removed in v11 (#3290).
// the deprecated `tenantId` alias (#3280) was removed in v16 (#3290).
const ec: any = _context?.executionContext;
const userFromAuth = actorUserFromExecutionContext(
ec,
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/src/http-dispatcher.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -3965,7 +3965,7 @@ describe('HttpDispatcher — action body ctx.user identity (#2701)', () => {
expect(user.permissions).toEqual(['convert_lead']);
expect(user.email).toBe('rep@acme.test');
// #3280 made `organizationId` the blessed name; the `tenantId` alias was
// removed in v11 (#3290) and must no longer be emitted on ctx.user.
// removed in v16 (#3290) and must no longer be emitted on ctx.user.
expect(user.organizationId).toBe('org_acme');
expect(user.tenantId).toBeUndefined();
});
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/src/contracts/sharing-service.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -598,7 +598,7 @@ export type HierarchyScope = 'unit' | 'unit_and_below' | 'own_and_reports';
* The name follows the repo-wide convention: #3280 made `organizationId` the
* blessed developer-facing name for the caller's active org (matching the
* `organization_id` column and `current_user.organizationId` in RLS) and #3290
* removed the `session.tenantId` alias in v11; `scripts/check-org-identifier.mjs`
* removed the `session.tenantId` alias in v16; `scripts/check-org-identifier.mjs`
* keeps it that way.
*/
export interface HierarchyScopeContext {
Expand Down
4 changes: 2 additions & 2 deletions packages/spec/src/data/hook.test.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -609,7 +609,7 @@ describe('HookContextSchema', () => {
});

// #3280 made `organizationId` the blessed developer-facing name; the
// `tenantId` alias was removed from this surface in v11 (#3290). A stray
// `tenantId` alias was removed from this surface in v16 (#3290). A stray
// `tenantId` key is now stripped by the schema rather than surfaced.
it('exposes session.organizationId and no longer carries the removed tenantId alias (#3290)', () => {
const context = HookContextSchema.parse({
Expand DownExpand Up@@ -676,7 +676,7 @@ describe('HookContextSchema', () => {
},
session: {
userId: 'user_123',
// `session.tenantId` was removed in v11 (#3280/#3290); the blessed
// `session.tenantId` was removed in v16 (#3280/#3290); the blessed
// developer-facing name is `organizationId`. This fixture kept
// spelling the retired alias for two majors because nothing
// type-checked it — vitest only sees `HookContextSchema.parse`,
Expand Down
2 changes: 1 addition & 1 deletion packages/spec/src/data/hook.zod.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -614,7 +614,7 @@ export const HookContextSchema = lazySchema(() => z.object({
* `organization_id` column, `current_user.organizationId` (RLS/sharing),
* and seed rows. `null`/`undefined` on unscoped (platform/community) calls.
*
* The former `session.tenantId` alias (#3280) was removed in the v11 major
* The former `session.tenantId` alias (#3280) was removed in the v16 major
* (#3290): read the org under this single blessed name. The generic
* driver-layer isolation knob (`ExecutionContext.tenantId`,
* `DriverOptions.tenantId`) is a distinct, configurable axis and is
Expand Down
6 changes: 3 additions & 3 deletions packages/spec/src/ui/action-params.zod.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -252,7 +252,7 @@ export interface ActionEngineFacade {
* under two names. `positions` is canonical — it is the ADR-0090 D3 vocabulary
* the rest of the platform already uses — and `roles` is the alias kept alive
* only for the length of the window, then removed on the path
* `session.tenantId` already walked (#3280 deprecate → #3290 removed in v11).
* `session.tenantId` already walked (#3280 deprecate → #3290 removed in v16).
* The announcement a reader migrates from is the ADR-0087 semantic migration
* `action-session-roles-to-positions`. Two live spellings is the MIGRATION,
* not the destination; phase 1 withheld `positions` precisely so that the
Expand DownExpand Up@@ -331,7 +331,7 @@ export const ActionSessionSchema = lazySchema(() => z.object({
* `current_user.organizationId` (RLS). Sourced from
* `ExecutionContext.tenantId`, which is the distinct driver-level isolation
* axis and keeps its own name; the deprecated `session.tenantId` alias
* (#3280) was removed in v11 (#3290) and must not come back.
* (#3280) was removed in v16 (#3290) and must not come back.
*/
organizationId: z.string().optional().describe('Active organization id (blessed developer-facing name; absent when the call is org-less)'),

Expand DownExpand Up@@ -384,7 +384,7 @@ export const ActionSessionSchema = lazySchema(() => z.object({
* one spelling ADR-0090 D3 forbids. Migration prescription and acceptance
* criteria: the ADR-0087 semantic migration
* `action-session-roles-to-positions`. Removal follows the `session.tenantId`
* alias precedent (#3280 deprecated → #3290 removed in v11), i.e. one
* alias precedent (#3280 deprecated → #3290 removed in v16), i.e. one
* deprecation window after #5613's runtime half lands, not before.
*
* Why it is still declared at all: it is what the runtime produces today,
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -448,7 +448,7 @@ export class RecordChangeTrigger implements FlowTrigger {
// duplicate of what the engine now resolves authoritatively. The
// engine elevates only for `runAs:'system'`. The hook session exposes
// the active org as `organizationId` (the deprecated `session.tenantId`
// alias was removed in v11, #3290); it feeds the automation context's
// alias was removed in v16, #3290); it feeds the automation context's
// driver-layer `tenantId` field unchanged.
...(session.organizationId ? { tenantId: session.organizationId } : {}),
// Expose the record as params too, so flows with named `isInput`
Expand Down
3 changes: 2 additions & 1 deletion scripts/check-org-identifier.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,8 @@
// reads `ctx.user.organizationId` / `ctx.session.organizationId`, matching the
// `organization_id` column and `current_user.organizationId` in RLS. The old
// `ctx.session.tenantId` was a deprecated alias; #3290 REMOVED it from the
// hook/action `ctx.session` surface entirely (v11 major), so any session-borne
// hook/action `ctx.session` surface entirely (the v16 major — see
// `content/docs/releases/v16.mdx`), so any session-borne
// `tenantId` read in an authoring body now resolves to `undefined` and is
// simply a bug.
//
Expand Down
Loading