Skip to content

Commit fb7a69f

Browse files
committed
refactor(metadata-protocol): the draft host forwards the services registry reader, within the facade line ceiling
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
1 parent a85c9f3 commit fb7a69f

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

‎packages/metadata-protocol/src/protocol-authoring-gate.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,11 @@ function packagedRuleCopyRefusalOf(
729729
/** The members {@link draftPublishJudgement} and {@link draftPublishVerdict} read. */
730730
type DraftVerdictHost = RuntimeRulesHost & Pick<AuthoringGateHost, 'collectBatchPendingDeclarations' | 'credentialChannelFor' | 'getOverlayRepo' | 'objectNamespaceObjectNameClash' | 'objectNamespacePrefixViolation'> & {
731731
/**
732-
* [#35256] The registered `automation` service, read per call and recorded
733-
* nowhere (as {@link sealedFlowNodeTypeVocabulary} reads it): the engine
734-
* whose connector lookups {@link draftConnectorAdvisories} asks.
732+
* [#35256] The protocol's services registry reader, read per call and
733+
* recorded nowhere: {@link draftConnectorAdvisories} asks its `automation`
734+
* service, as {@link sealedFlowNodeTypeVocabulary} does.
735735
*/
736-
automationService: () => unknown;
736+
servicesRegistry: () => (() => Map<string, any>) | undefined;
737737
};
738738

739739
/**
@@ -913,15 +913,15 @@ export async function draftPublishJudgement(
913913
* without the lookups, judges nothing, as the probe does.
914914
*/
915915
function draftConnectorAdvisories(
916-
host: Pick<DraftVerdictHost, 'automationService'>,
916+
host: Pick<DraftVerdictHost, 'servicesRegistry'>,
917917
name: string,
918918
body: unknown,
919919
packageId: string | null,
920920
userTextLocales: readonly (string | undefined)[] | undefined,
921921
): RuntimeAuthoringIssue[] {
922922
let automation: unknown;
923923
try {
924-
automation = host.automationService();
924+
automation = host.servicesRegistry()?.().get('automation');
925925
} catch {
926926
return [];
927927
}

‎packages/metadata-protocol/src/protocol.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,8 +1912,7 @@ export class ObjectStackProtocolImplementation implements
19121912

19131913
/** The host both draft verdict bodies read: the promotion's own collaborators. */
19141914
private draftVerdictHost(): ThisParameterType<typeof draftPublishJudgement> {
1915-
const readAuthoringChannel = () => this.authoringChannel;
1916-
const readEngine = () => this.engine;
1915+
const readAuthoringChannel = () => this.authoringChannel, readEngine = () => this.engine;
19171916
const host: ThisParameterType<typeof draftPublishJudgement> = {
19181917
get authoringChannel() { return readAuthoringChannel(); },
19191918
get engine() { return readEngine(); },
@@ -1930,8 +1929,7 @@ export class ObjectStackProtocolImplementation implements
19301929
rlsMembershipResolverKeys: (...a) => this.rlsMembershipResolverKeys(...a),
19311930
sealedFlowNodeTypeVocabulary: (...a) => this.sealedFlowNodeTypeVocabulary(...a),
19321931
tenancyPostureInForce: (...a) => this.tenancyPostureInForce(...a),
1933-
// [#35256] Read per call, recorded nowhere: the connector lookups the draft verdict asks.
1934-
automationService: () => this.getServicesRegistry?.().get('automation'),
1932+
servicesRegistry: () => this.getServicesRegistry,
19351933
};
19361934
return host;
19371935
}

0 commit comments

Comments
 (0)