Repository navigation
Commit 78fd762
feat(metadata-protocol): a flow draft's verdict carries the connector-action probe as an advisory (#35843)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDxdrYJq965rUfrZBso8FS3)_
Fixes #35256
Clause-②: yes — widening: the draft verdict gains an advisory for a
draft flow whose `connector_action` names a connector or action the
runtime cannot dispatch; advisory only, never a refusal (the probe
"never fails the publish"), so no save or publish accepted today is
refused. Seat runs a contract read before ready.
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:在 Studio 的流程草稿和 AI
的草稿工具里,如果某一步调用了本环境没有的连接器或动作,发布之前就会在那一步上看到一条提醒(以前要等发布之后才提示)。
-
为什么做:草稿发布前检查(让作者在按“发布”之前就知道发布会说什么);修的是“连接器步骤写错,草稿显示无问题,发布后每次运行都在那一步失败”。
- 出错会怎样:这只是提醒,不拦截保存或发布;若误报,作者照常发布即可;撤回本次合并即可恢复旧行为。
- 要你做什么:无。
## What changes
The publish's build probe `flow_connector_action_unresolved` (PR #35244)
reads no landed data, only the flow body and the automation engine's
connector lookups. The draft verdict now asks the same lookups, so a
flow draft hears what its publish will report before Publish is pressed.
- `build-probes.ts`: the probe's connector judgement moves into one
exported function, `unresolvedConnectorSteps(flowName, body, automation,
packageId, userTextLocales)`: the same three lookups in the executor's
order (`resolveConnectorInstanceFor` for the package,
`resolveConnectorAction`, `getConnectorDegradedReason`), the same
`message`, `fix` and user sentence, plus the step's position in the
body. The probe now maps its result to the same finding it built before
(same code, severity, artefact, ref and words). Not exported from the
package index; the published surface does not move.
- `protocol-authoring-gate.ts`: `draftPublishJudgement` maps each
unresolved step of a FLOW draft into its `advisories` in the gate-issue
shape: `rule: 'flow_connector_action_unresolved'` (the probe's code),
`path: flows[0].nodes[N].connectorConfig` (served on the draft read as
`nodes.N.connectorConfig`, which Studio's flow problems map to the
node), `where`, `message` (the probe's, the cause readable in it),
`hint` (the probe's `fix`), `severity: 'warning'`, `userMessage` (the
probe's sentence in the read's `userTextLocales`). It is judged on the
body the promotion judges (`storedFlowVerdictBody`) for the draft's own
package. Never a refusal. Only the draft door asks it:
`judgeRuntimeAuthoringRules` / `assertRuntimeAuthoringRules` (the
publish gate) are not touched.
- `protocol.ts`, under claim amendment 1 (comment 7036574060),
`draftVerdictHost()` only: one host member, `servicesRegistry: () =>
this.getServicesRegistry`, a forwarding reader. The gate module reads
`automation` from it per call and records nothing, as
`sealedFlowNodeTypeVocabulary` does; no service, or one without
`resolveConnectorAction`, judges nothing. `protocol.ts` sits exactly at
its facade line ceiling (11705, ruling 6897467376), so the member is
paid for by writing the host's two reader `const`s as one statement: the
file stays 11705 lines and `check:facade-delegation-only` stays green.
- Cost: the lookups are synchronous in-memory registry calls with no
storage read, so the MCP draft list, which judges many drafts, needs no
new per-pass cache beyond `packageClosures`.
## Clause-② reading
Widening only. The draft verdict gains advisories; it gains no refusal,
and nothing on the save, publish or package-publish path refuses
anything it accepted before. `assertRuntimeAuthoringRules` and the build
probe answer exactly what they answered before; the pins below hold
both.
## Tests
New top-level describe in the existing draft-verdict harness,
`protocol.draft-publish-verdict.test.ts` ("[#35256] a flow draft whose
connector step cannot dispatch reads the probe's advisory"), 7 cases (6
in round 1, 1 in round 2), with a real
`ObjectStackProtocolImplementation` and a stub automation service in its
services registry:
- unknown connector action: exactly one advisory, rule
`flow_connector_action_unresolved`, path
`flows[0].nodes[1].connectorConfig`, `severity: 'warning'`, no refusal,
lookups asked for the draft's package; the Studio draft read shows it as
a warning at `nodes.1.connectorConfig` in Chinese, and the draft still
reads valid;
- a step inside a loop body (round 2): the advisory's path is the step's
place in its region,
`flows[0].nodes[1].config.body.nodes[1].connectorConfig`, with `where`
naming the step;
- known connector and action: no advisory;
- degraded and refused causes each stay readable in `message` and
`hint`;
- no automation service, or one without the lookup: nothing;
- the publish gate (`assertRuntimeAuthoringRules`) does not carry it,
and `publishMetaItem` succeeds with no such advisory;
- one judgement: the advisory's `message`, `hint` and `userMessage`
equal the landed probe's `message`, `fix` and `userMessage` for the same
body.
The landed probe's own pins (`build-probes-landed-data.test.ts`,
`build-probes-user-message.test.ts`) pass unchanged.
## Acceptance notes
- The `Clause-②:` line is copied from the claim verbatim.
`scripts/pm/clause2-line.mjs` reads it as `yes` with no arm (the arm is
read only in the parenthesised spelling); `check-changeset-no-major` and
`check-adr-0087-registration` exit 0 on it.
- A step inside a structured region (loop, parallel, try_catch) is
located inside the region (`nodes[N].config.body.nodes[M]...`), pinned
for a loop body in round 2; Studio's flow problems map any `nodes.N...`
path to the top-level container node.
Read first (by risk): `protocol-authoring-gate.ts`
`draftConnectorAdvisories` (the mapping and the never-refuse line);
`build-probes.ts` `unresolvedConnectorSteps` (the moved lookup,
byte-equal words); `protocol.ts` `draftVerdictHost()` (the forwarding
member and the merged `const`).
Two-minute check: `pnpm --filter @objectstack/metadata-protocol exec
vitest run --maxWorkers=2 src/protocol.draft-publish-verdict.test.ts -t
35256` shows 7 passed.
## Verification
All at head fb7a69f unless stated.
<details><summary>Package suite and typecheck</summary>
- `pnpm --filter @objectstack/metadata-protocol test` (after build):
Test Files 362 passed, 9 skipped (371); Tests 23304 passed, 45 skipped
(23349); lock VERDICT command-exit 0.
- `pnpm --filter @objectstack/metadata-protocol typecheck`: exit 0 (its
tsconfig includes the test files).
- Touched files: 3 files, 143 tests passed. `eslint --no-inline-config`
on the four touched source files: exit 0.
</details>
<details><summary>Ablation (at 113f00f + tests, sources read from
src)</summary>
`scripts/ablation-replace.mjs` replaced the advisory join in
`draftPublishJudgement` with `advisories: verdict.advisories,` (anchor 1
to 0, blob ab08e68 to add99735): the new describe went 3 failed, 3
passed (the unknown-action, cause and one-judgement pins red; the three
silence pins green, as expected). Restored: blob equals HEAD (ab08e68),
`git diff HEAD` empty.
</details>
<details><summary>Gates</summary>
- `dispatch-gates --ran` (exit codes recorded): 75 derived, 74 run with
exit 0, 1 NOT MEASURED: `check-plugin-teardown-shape.mjs --self-test`
exit 3, PREREQUISITE NOT MET (its fixture needs an unshallow clone); CI
runs it.
- `check:dts-closure` and `check:dual-build-cjs-loads` first read exit 1
while a build of this package ran beside them; re-run after the build,
both exit 0.
- `check:facade-delegation-only`: exit 0, `protocol.ts` 11705 lines
within its ceiling.
- `overlap-check --branch=claude/area-a4C-35256`: origin/main merges
cleanly, 0 PR heads, VERDICT clean exit 0.
- Dogfood not run locally: no `!` in the title and no narrowing arm.
</details>
## Round 2
Round 2 (head 0ea49ba, contract review 7038751715): S1 and N3.
- **S1 (prose only):** the `DraftPublishJudgement` and
`draftPublishJudgement` docblocks in `protocol-authoring-gate.ts` each
gain one paragraph: a flow draft's `advisories` also carry the build
probe's `flow_connector_action_unresolved` finding, which a publish
reports as a build-probe finding
(`PublishPackageDraftsResponse.probes.issues[]`) rather than under
`advisories`, and which stays a warning. The one-line comment on
`draftPublishJudgement` in `protocol.ts` is reworded on the same line;
the file stays 11705 lines (`check:facade-delegation-only` exit 0).
- **N3 (pin):** one case in the #35256 describe, a `connector_action`
step at index 1 of a `loop` body at `nodes[1]`, asserts the advisory's
path `flows[0].nodes[1].config.body.nodes[1].connectorConfig`. Positive
control: `scripts/ablation-replace.mjs` replaced the step path's region
prefix in `unresolvedConnectorSteps` (`build-probes.ts`) with a bare
`nodes[` (anchor 1 to 0, blob e342534 to d3d949c4); the describe went 1
failed, 6 passed (only the new case red). Restored: blob equals HEAD
(e342534), `git diff HEAD` empty.
- N1: the `Clause-②:` spelling is unchanged.
<details><summary>Round 2 verification (head 0ea49ba)</summary>
- `src/protocol.draft-publish-verdict.test.ts`: 69 passed; lock VERDICT
command-exit 0.
- `pnpm --filter @objectstack/metadata-protocol test`: Test Files 362
passed, 9 skipped (371); Tests 23305 passed, 45 skipped (23350); lock
VERDICT command-exit 0.
- `pnpm --filter @objectstack/metadata-protocol typecheck`: lock VERDICT
command-exit 0.
- `dispatch-gates --ran`: 75 derived, 75 accounted for; 72 exit 0; 3 NOT
MEASURED (exit 3, PREREQUISITE NOT MET):
`check-plugin-teardown-shape.mjs --self-test` (shallow clone),
`check:dual-build-cjs-loads` and `check:lean-entry-closure` (no full
`pnpm build` in this worktree). CI runs all three.
- `overlap-check --branch=claude/area-a4C-35256`: origin/main merges
cleanly, 0 PR heads, VERDICT clean exit 0.
</details>
Session: https://claude.ai/code/session_016WV4d1k1GRsQbF3vCPKxhz
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- signed: repo:objectstack#4 · os-elon-musk ·
session_016WV4d1k1GRsQbF3vCPKxhz -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 3c038eb commit 78fd762
5 files changed
Lines changed: 392 additions & 68 deletions
File tree
- .changeset
- packages/metadata-protocol/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1259 | 1259 | | |
1260 | 1260 | | |
1261 | 1261 | | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
1268 | | - | |
| 1262 | + | |
| 1263 | + | |
1269 | 1264 | | |
1270 | | - | |
1271 | 1265 | | |
1272 | 1266 | | |
1273 | 1267 | | |
1274 | 1268 | | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
1290 | | - | |
1291 | | - | |
1292 | | - | |
1293 | | - | |
1294 | | - | |
1295 | | - | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
1300 | | - | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
1304 | | - | |
1305 | | - | |
1306 | | - | |
1307 | | - | |
1308 | | - | |
1309 | | - | |
1310 | | - | |
1311 | | - | |
| 1269 | + | |
1312 | 1270 | | |
1313 | 1271 | | |
1314 | 1272 | | |
1315 | 1273 | | |
1316 | | - | |
| 1274 | + | |
1317 | 1275 | | |
1318 | | - | |
1319 | | - | |
1320 | | - | |
1321 | | - | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
1325 | | - | |
1326 | | - | |
1327 | | - | |
1328 | | - | |
1329 | | - | |
1330 | | - | |
1331 | | - | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
1332 | 1279 | | |
1333 | 1280 | | |
1334 | 1281 | | |
| |||
1337 | 1284 | | |
1338 | 1285 | | |
1339 | 1286 | | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
1340 | 1399 | | |
1341 | 1400 | | |
1342 | 1401 | | |
| |||
0 commit comments