Skip to content

Commit 0ea49ba

Browse files
committed
docs(metadata-protocol): the draft judgement's advisories name the connector probe finding; pin a region step's path
The DraftPublishJudgement and draftPublishJudgement docblocks now say that a flow draft's advisories also carry the build probe's flow_connector_action_unresolved finding, which a publish reports under probes.issues[] rather than advisories, and which stays a warning. A new case pins the advisory path of a connector step inside a loop body. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
1 parent fb7a69f commit 0ea49ba

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,12 @@ type DraftVerdictHost = RuntimeRulesHost & Pick<AuthoringGateHost, 'collectBatch
742742
* ADVISORIES — the findings a publish that passes returns on its 2xx, which the
743743
* console otherwise sees only after the publish, in a toast. One judgement, so
744744
* the two halves come from the same run of the same rules.
745+
*
746+
* [#35256] A flow draft's `advisories` also carry one member that is not the
747+
* gate's: the build probe's `flow_connector_action_unresolved` finding
748+
* ({@link draftConnectorAdvisories}), which a publish reports as a build-probe
749+
* finding (`PublishPackageDraftsResponse.probes.issues[]`) rather than under
750+
* `advisories`, and which stays a warning.
745751
*/
746752
export interface DraftPublishJudgement {
747753
refusals: RuntimeAuthoringIssue[];
@@ -766,6 +772,12 @@ export async function draftPublishVerdict(
766772
* `userTextLocales` picks the language of the advisories' user sentences and
767773
* nothing else.
768774
*
775+
* [#35256] For a flow draft, `advisories` also carry the build probe's
776+
* `flow_connector_action_unresolved` finding ({@link draftConnectorAdvisories}):
777+
* a publish reports it as a build-probe finding
778+
* (`PublishPackageDraftsResponse.probes.issues[]`), never under `advisories`,
779+
* and it stays a warning.
780+
*
769781
* [#34766] The class method is PUBLIC: it is the publish verdict a door that
770782
* cannot publish answers with (the open MCP draft door's save and its draft
771783
* list), so its caller can tell its author what a publish would refuse before

‎packages/metadata-protocol/src/protocol.draft-publish-verdict.test.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,6 +1576,32 @@ describe('[#35256] a flow draft whose connector step cannot dispatch reads the p
15761576
expect(warning!.message).toContain('自动化“订单同步”中的步骤“推送订单”调用了连接器“erp”');
15771577
});
15781578

1579+
it('a step inside a loop body: the advisory\'s path is the step\'s place in its region', async () => {
1580+
const { automation } = automationKnowing([]);
1581+
const protocol = protocolWith(automation);
1582+
const loopFlow = regionFlow('order_sweep', {
1583+
id: 'each', type: 'loop', label: 'Each',
1584+
config: {
1585+
collection: [1, 2], iteratorVariable: 'row',
1586+
body: {
1587+
nodes: [
1588+
{ id: 'prep', type: 'assignment', label: 'prep' },
1589+
{ id: 'push', type: 'connector_action', label: 'push', connectorConfig: { connectorId: 'erp', actionId: 'push_order', input: {} } },
1590+
],
1591+
edges: [{ id: 'b1', source: 'prep', target: 'push' }],
1592+
},
1593+
},
1594+
});
1595+
await stageDraft(protocol, 'flow', loopFlow);
1596+
1597+
const judgement = await protocol.draftPublishJudgement({ type: 'flow', name: 'order_sweep', packageId: PKG });
1598+
expect(judgement.refusals).toEqual([]);
1599+
const found = judgement.advisories.filter((a) => a.rule === RULE);
1600+
expect(found.map((a) => [a.path, a.where])).toEqual([
1601+
['flows[0].nodes[1].config.body.nodes[1].connectorConfig', 'flow "order_sweep" · node "push"'],
1602+
]);
1603+
});
1604+
15791605
it('a known connector and action: no advisory, and the lookups were asked', async () => {
15801606
const { automation, asked } = automationKnowing(['erp.push_order']);
15811607
const protocol = protocolWith(automation);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ export class ObjectStackProtocolImplementation implements
19011901
return draftPublishVerdict.call(this.draftVerdictHost(), draft);
19021902
}
19031903

1904-
/** [#34818, #34766] PUBLIC: this judgement with the gate's advisories; no `body` ⇒ the stored draft (see `draftPublishJudgement`). */
1904+
/** [#34818, #34766] PUBLIC: this judgement with its advisories (the gate's, plus a flow's #35256 connector-probe finding); no `body` ⇒ the stored draft (see `draftPublishJudgement`). */
19051905
draftPublishJudgement(draft: {
19061906
type: string; name: string; body?: unknown; packageId: string | null; member?: string;
19071907
userTextLocales?: readonly (string | undefined)[];

0 commit comments

Comments
 (0)