@@ -5,11 +5,7 @@ import type {
55} from '@objectstack/spec/api';
66import { IDataEngine, engineCanRollBack, recordNotFoundError } from '@objectstack/core';
77import { declaredHttpStatus, declaredUserMessage, isSandboxOrigin, resolveTenancyPosture, resolveThrownHttpError, sandboxBusinessMessage } from '@objectstack/types';
8- // [#6285] ADR-0105 D1's authority on "does this deployment wall organizations?".
9- // `resolveMultiOrgEnabled()` is DEMOTED and its own doc comment says answering
10- // this question with it is a bug (cloud#1020, #5233) — so the posture, and only
11- // the posture, is what the runtime authoring gate is told.
12- import { judgePermissionSetOwnerBinding, postureEnforcesWall, type TenancyPosture } from '@objectstack/spec/security';
8+ import { judgePermissionSetOwnerBinding, type TenancyPosture } from '@objectstack/spec/security';
139// [commit 376c70f98] The derived `version` this file's `getDiscovery()` serves as the
1410// `DiscoverySchema` "System Identity" field — never a literal again.
1511import { resolveDiscoveryVersion } from './discovery-version.js';
@@ -27,7 +23,6 @@ import { stripUnauthorableProperties } from './unauthorable-nodes.js';
2723// admits anything. See the module header for the predicate and its controls.
2824import { markErasedAuthoringInput } from './erased-authoring-mark.js';
2925import {
30- HIERARCHY_SCOPE_RESOLVER_SERVICE,
3126 SDUI_MANIFEST_SERVICE,
3227 isUsableSduiManifest,
3328 stampHtmlPageRequires,
@@ -105,10 +100,6 @@ import {
105100 // {@link ObjectStackProtocolImplementation.getMetaItemLayered}'s code-layer
106101 // fallback so a hydrated row is never answered as the code layer.
107102 isTenantAuthored,
108- // [#21476] The posture IN FORCE, read off the `tenancy` service the one way
109- // the anonymous form doors read it — the runtime authoring gate's input for
110- // its public-form intake advisory (see `tenancyPostureInForce()`).
111- anonymousFormIntakePosture,
112103 // [ADR-0131 D6/D7] A legacy organization's rows, off the physical column,
113104 // on a database the ceremony has not migrated — see migrateStoredMetadata.
114105 readLegacyOrganizationRows,
@@ -166,7 +157,7 @@ import { PLURAL_TO_SINGULAR, SINGULAR_TO_PLURAL, canonicalMetaUrlType, metaUrlSp
166157// depends on `@objectstack/service-cluster`; a bridge plugin there hands the
167158// live transport in through `attachMetadataMutationPubSub`.
168159import type { IFieldFileService, IPubSub } from '@objectstack/spec/contracts';
169- import { FIELD_FILE_SERVICE, RLS_MEMBERSHIP_RESOLVER_SERVICE } from '@objectstack/spec/contracts';
160+ import { FIELD_FILE_SERVICE } from '@objectstack/spec/contracts';
170161import { applyConversionsToFlow, type ConversionNotice, type ConversionTodoNotice } from '@objectstack/spec';
171162import { type FormView, type I18nLabel, isAggregatedViewContainer, expandViewContainer } from '@objectstack/spec/ui';
172163// [commit ece4dad31] Emitted-specifier pin. This module's inferred public declarations
@@ -419,6 +410,8 @@ import { listLiveMetadataTypes } from './protocol-live-metadata-types.js';
419410import { saveConflict } from './protocol-save-conflict.js';
420411// [#25467 cut 25] The post-persistence mutation fan-out: projector, local listeners, cluster publish, publish listeners.
421412import { emitMetaItemPublished, notifyMutationListenersLocal, publishMetadataMutation, runMutationProjector } from './protocol-mutation-fan-out.js';
413+ // [#25467 cut 26] The runtime authoring gate's deployment-posture probes: org wall, tenancy, RLS keys, hierarchy.
414+ import { hierarchyResolverMounted, orgWallEnforced, rlsMembershipResolverKeys, tenancyPostureInForce } from './protocol-authoring-posture-probes.js';
422415
423416/**
424417 * Canonical Zod schema per metadata type lives in
@@ -7392,11 +7385,8 @@ export class ObjectStackProtocolImplementation implements
73927385 * refusal combination to be turned away.
73937386 */
73947387 private orgWallEnforced(): boolean {
7395- try {
7396- return postureEnforcesWall(resolveTenancyPosture());
7397- } catch {
7398- return true;
7399- }
7388+ // [#25467 cut 26] The body moved to `protocol-authoring-posture-probes.ts`; it reads no member.
7389+ return orgWallEnforced();
74007390 }
74017391
74027392 /**
@@ -7426,11 +7416,12 @@ export class ObjectStackProtocolImplementation implements
74267416 * reports none, and the advisory is simply not raised.
74277417 */
74287418 private tenancyPostureInForce(): TenancyPosture | undefined {
7429- try {
7430- return anonymousFormIntakePosture(this.getServicesRegistry?.().get('tenancy'));
7431- } catch {
7432- return undefined;
7433- }
7419+ // [#25467 cut 26] The body moved to `protocol-authoring-posture-probes.ts` (see `AuthoringPostureProbesHost`).
7420+ const readGetServicesRegistry = () => this.getServicesRegistry;
7421+ const host: ThisParameterType<typeof tenancyPostureInForce> = {
7422+ get getServicesRegistry() { return readGetServicesRegistry(); },
7423+ };
7424+ return tenancyPostureInForce.call(host);
74347425 }
74357426
74367427 /**
@@ -7448,18 +7439,12 @@ export class ObjectStackProtocolImplementation implements
74487439 * wrong ones.
74497440 */
74507441 private rlsMembershipResolverKeys(): readonly string[] | undefined {
7451- const registry = this.getServicesRegistry?.();
7452- if (!registry) return undefined;
7453- let resolver: unknown;
7454- try {
7455- resolver = registry.get(RLS_MEMBERSHIP_RESOLVER_SERVICE);
7456- } catch {
7457- return undefined;
7458- }
7459- if (resolver === undefined || resolver === null) return [];
7460- const keys = (resolver as { keys?: unknown }).keys;
7461- if (!Array.isArray(keys) || !keys.every((k) => typeof k === 'string')) return undefined;
7462- return keys as readonly string[];
7442+ // [#25467 cut 26] The body moved to `protocol-authoring-posture-probes.ts` (see `AuthoringPostureProbesHost`).
7443+ const readGetServicesRegistry = () => this.getServicesRegistry;
7444+ const host: ThisParameterType<typeof rlsMembershipResolverKeys> = {
7445+ get getServicesRegistry() { return readGetServicesRegistry(); },
7446+ };
7447+ return rlsMembershipResolverKeys.call(host);
74637448 }
74647449
74657450 /**
@@ -7476,14 +7461,12 @@ export class ObjectStackProtocolImplementation implements
74767461 * throws.
74777462 */
74787463 private hierarchyResolverMounted(): boolean | undefined {
7479- const registry = this.getServicesRegistry?.();
7480- if (!registry) return undefined;
7481- try {
7482- const resolver = registry.get(HIERARCHY_SCOPE_RESOLVER_SERVICE);
7483- return resolver !== undefined && resolver !== null;
7484- } catch {
7485- return undefined;
7486- }
7464+ // [#25467 cut 26] The body moved to `protocol-authoring-posture-probes.ts` (see `AuthoringPostureProbesHost`).
7465+ const readGetServicesRegistry = () => this.getServicesRegistry;
7466+ const host: ThisParameterType<typeof hierarchyResolverMounted> = {
7467+ get getServicesRegistry() { return readGetServicesRegistry(); },
7468+ };
7469+ return hierarchyResolverMounted.call(host);
74877470 }
74887471
74897472 /**
0 commit comments