@@ -111,18 +111,6 @@ export interface AuthoringGateHost {
111111 formRestoreRefusal : ( type : string , item : unknown , name : string , binding : string | null ) => Promise < Error | undefined > ;
112112 /** [#34776] The automation engine's sealed node-type vocabulary ({@link sealedFlowNodeTypeVocabulary}). */
113113 sealedFlowNodeTypeVocabulary : ( ) => readonly string [ ] | undefined ;
114- /**
115- * The names of every flow the automation engine holds
116- * ({@link automationFlowNames}). Optional: a host that does not state it
117- * gets no `subflow` / `map` target judgement at the publish gate.
118- */
119- automationFlowNames ?: ( ) => Promise < readonly string [ ] | undefined > ;
120- /**
121- * The environment's `sys_metadata` rows, read as the stored-collection
122- * fold reads them. Optional for the same reason; read by
123- * {@link deploymentFlowNamesOf} for the stored flows of every state.
124- */
125- findEnvironmentRows ?: ObjectStackProtocolImplementation [ 'findEnvironmentRows' ] ;
126114}
127115
128116/** The body of `ObjectStackProtocolImplementation#restoredBodyDerivation`; the method's docblock there is its contract. */
@@ -354,7 +342,15 @@ export function withTargetFoldedWithout(
354342 * The members {@link judgeRuntimeAuthoringRules} reads: the host facts and
355343 * collections every judgement of the shared rules is made against.
356344 */
357- type RuntimeRulesHost = Pick < AuthoringGateHost , 'authoringChannel' | 'automationFlowNames' | 'engine' | 'findEnvironmentRows' | 'foldStoredCollection' | 'hierarchyResolverMounted' | 'orgWallEnforced' | 'resolveSduiManifest' | 'resolveWritePackageScope' | 'rlsMembershipResolverKeys' | 'sealedFlowNodeTypeVocabulary' | 'tenancyPostureInForce' > ;
345+ type RuntimeRulesHost = Pick < AuthoringGateHost , 'authoringChannel' | 'engine' | 'foldStoredCollection' | 'hierarchyResolverMounted' | 'orgWallEnforced' | 'resolveSduiManifest' | 'resolveWritePackageScope' | 'rlsMembershipResolverKeys' | 'sealedFlowNodeTypeVocabulary' | 'tenancyPostureInForce' > & {
346+ /**
347+ * [#35143] The protocol's services registry reader, read per call and
348+ * recorded nowhere: {@link deploymentFlowNamesOf} asks its `automation`
349+ * service for the flows the engine holds. Optional: a host that does not
350+ * state it gets no `subflow` / `map` target judgement at the publish gate.
351+ */
352+ servicesRegistry ?: ( ) => ( ( ) => Map < string , any > ) | undefined ;
353+ } ;
358354
359355/** The body of `ObjectStackProtocolImplementation#assertRuntimeAuthoringRules`; the method's docblock there is its contract. */
360356export async function assertRuntimeAuthoringRules (
@@ -730,16 +726,16 @@ export async function judgeRuntimeAuthoringRules(
730726 *
731727 * Union only: every source can only make more names resolvable, never fewer.
732728 * `undefined`, and so no judgement, when the host cannot state one of the
733- * sources: no stored-row reader or engine reader , or a read that fails (said
729+ * sources: no store or no automation service , or a read that fails (said
734730 * once, at `warn`). Judging against a partial universe would refuse a call to
735731 * a flow the missing source holds.
736732 */
737733async function deploymentFlowNamesOf (
738- this : Pick < AuthoringGateHost , 'automationFlowNames ' | 'findEnvironmentRows ' > ,
734+ this : Pick < RuntimeRulesHost , 'engine ' | 'servicesRegistry ' > ,
739735 registered : readonly unknown [ ] ,
740736) : Promise < readonly string [ ] | undefined > {
741- if ( typeof this . findEnvironmentRows !== 'function' || typeof this . automationFlowNames !== 'function' ) return undefined ;
742- const engineNames = await this . automationFlowNames ( ) ;
737+ if ( typeof this . engine ?. find !== 'function' ) return undefined ;
738+ const engineNames = await automationFlowNames . call ( { getServicesRegistry : this . servicesRegistry ?. ( ) } ) ;
743739 if ( engineNames === undefined ) return undefined ;
744740 const names = new Set < string > ( engineNames ) ;
745741 for ( const item of registered ) {
@@ -748,12 +744,13 @@ async function deploymentFlowNamesOf(
748744 }
749745 try {
750746 for ( const type of [ 'flow' , 'flows' ] ) {
751- // [ADR-0131 D6] The environment's rows, every state, as the
752- // stored-collection fold reads them (that fold reads `active` only).
753- const rows = await this . findEnvironmentRows ( 'sys_metadata' , {
747+ // Every state (the stored-collection fold reads `active` only).
748+ // Unfiltered for legacy organization rows: a name too many can
749+ // only let a call through, never refuse one.
750+ const rows = await this . engine . find ( 'sys_metadata' , {
754751 where : { type } ,
755752 context : { isSystem : true } ,
756- } ) ;
753+ } as never ) ;
757754 for ( const row of ( rows ?? [ ] ) as Array < { name ?: unknown } > ) {
758755 if ( typeof row ?. name === 'string' && row . name !== '' ) names . add ( row . name ) ;
759756 }
@@ -1064,7 +1061,7 @@ function draftConnectorAdvisories(
10641061 * `undefined` when no automation service is registered (no flow runs here at
10651062 * all) or its read fails; then no `subflow` / `map` call is judged.
10661063 */
1067- export async function automationFlowNames (
1064+ async function automationFlowNames (
10681065 this : { readonly getServicesRegistry ?: ( ) => Map < string , any > } ,
10691066) : Promise < readonly string [ ] | undefined > {
10701067 let automation : unknown ;
0 commit comments