Repository navigation
fix(lint)!: the publish gate refuses a subflow or map step that calls a flow the deployment does not hold - #38241
objectstack-fleet[bot] wants to merge 5 commits into
Conversation
…s at the publish gate Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
… changeset Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
… protocol facade Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
📓 Docs Drift CheckThis PR changes 3 package(s): 21 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 10 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 178 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin d2848ed8d91eef16628e512c4b2c6a49e0dd1a76 && git checkout d2848ed8d91eef16628e512c4b2c6a49e0dd1a76
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bd5407ec74b280f92a281ca4f82e5c8f0f8bdd47 bc21970eab3332a4f20d1a84cfcc8bcac173df9c && git checkout -B drift-repro bd5407ec74b280f92a281ca4f82e5c8f0f8bdd47 && git merge --no-ff bc21970eab3332a4f20d1a84cfcc8bcac173df9c
node scripts/docs-audit/affected-docs.mjs --json bd5407ec74b280f92a281ca4f82e5c8f0f8bdd47
|
|
repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK Contract reviewServed-tier: First round on PR #38241, net diff against merge base ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentM1 (must-fix): open.
S1 (should-fix): open.
S2 (should-fix): open.
S3 (should-fix): open.
Severity per door, against #37807 and #38107:
Nits, none with an effect on correctness or the contract:
Open at this head: M1, S1, S2, S3. The next head owes a round by this reviewer. Implemented-by: VERDICT: FAIL |
Fixes #35143
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up owed (#38259) — skills/objectstack-automation/SKILL.md (the
subflowrow saysos validatewarnsflow-subflow-unknown; it does not say the publish refuses a call to a flow nothing in the deployment holds), skills/objectstack-automation/evals/flows-triggers-approvals.json (the eval that namesflow-subflow-unknown)维护者速读
What changes
The card's last two open lines, re-verified on
main(1208460) first.F1, option label in decision-node and edge conditions: already covered on
main, no change here.flow-condition-option-labelreads every edge condition and everydecisionnode'sconditions[].expression(and query filter operands) since #37491 (optionLabelsBeyondStartinvalidate-flow-trigger-readiness.ts, aterror, same id, runtime gate and CLI). Its positive and negative pins are inflow-publish-checks-second-batch.test.ts, describe "past the start condition". The card gets a line saying so.F6, a
subflow/mapstep calling a flow that does not exist: now refused at the publish gate. It was a CLI-only warning because the gate's per-write snapshot holds just the written flow. The gate now judges the call against the names of every flow the deployment holds, which the host states on a flow publish:pending.flows), so a package that ships a flow with its caller publishes;listFlows), so a flow registered straight into the engine with no metadata row resolves.A call that names none of them, and is not the written flow itself, is an
error(flow-subflow-unknown):executeanswersFlow 'X' not foundon every run.Severity per door:
os validate/lint/compile/build):warning, unchanged. The stack is one app, and another installed package may ship the called flow.error. The set is the whole deployment, so "held nowhere" is decided, the lint: an overlay write (no package) of a list view bound to an object that exists nowhere answers 200 with no issue —validateListViewFieldRefsskips it and no other rule judges aviewwrite's binding #24668 reading of a whole collection.warn) and an empty set. An empty set with no closure is no universe (lint: an overlay write (no package) of a list view bound to an object that exists nowhere answers 200 with no issue —validateListViewFieldRefsskips it and no other rule judges aviewwrite's binding #24668).outside-closure) is not judged here. This rule never refuses a call the engine would accept.Wiring:
@objectstack/lint:validateFlowSubflowTargets(stack, { deploymentFlowNames }), theAuthoringRuleContext.deploymentFlowNamesinput, andrunRuntimeAuthoringRules({ deploymentFlowNames }). The rule's registry entry moves totier: 'gating',surfaces: CLI_AND_RUNTIME,runtimeTypes: ['flow']. Its runtime pass judges nothing without stated names. The rule's explanation text is updated.@objectstack/metadata-protocol:evaluateRuntimeAuthoringGate({ deploymentFlowNames })adds the batch's flow drafts.judgeRuntimeAuthoringRulesreads the names on a flow write only (deploymentFlowNamesOf,automationFlowNamesinprotocol-authoring-gate.ts), through the host's existingservicesRegistry.protocol.tsis unchanged, since it is a facade at its line ceiling.@objectstack/spec: the ADR-0087 entrypublish-refuses-flows-that-save-and-do-not-runnow saysflow-subflow-unknownis an error at the publish gate. The old text, "three warnings which refuse nothing", would be false after this change.No rule is added, so no "author-time rules (N)" count moves.
Why
#35143 "Done when": each line is a rule with its pins, or a line on the card saying which rule covers it. F1 is the second case and F6 is now the first. The hosted copy of the subflow check can be deleted.
Tests
Lint: new pins in flow-publish-checks-second-batch.test.ts (describe flow-subflow-unknown)
warning.error, pathflows[0].nodes[1].config.flowName, message opening,rulesRunnames the rule.mapcall inside a loop body:erroratflows[0].nodes[1].config.body.nodes[0].config.flowName.Metadata-protocol: new describe in protocol.runtime-authoring-gate.test.ts (the shared harness), end to end through saveMetaItem
INVALID_METADATA, issueflow-subflow-unknownat the path, nothing stored.evaluateRuntimeAuthoringGate: a flow inpending.flowsresolves; without it the call is refused.deploymentFlowNamesOfto answerundefinedfails the refusal pin (1 failed / 3 passed); restored from the commit, 4/4.Suites (head 3842e18 before the main merge; under os-verify-lock)
@objectstack/linttest: 246 files / 9935 tests passed. typecheck exit 0.@objectstack/metadata-protocoltest: 373 passed / 9 skipped files, 23616 passed / 45 skipped tests. typecheck exit 0. After the facade refactor:protocol.runtime-authoring-gate.test.ts263/263, typecheck exit 0.@objectstack/specsrc/migrations: 5 files / 208 tests.generate-scaffold-validates26/26.generate-scaffold-gates.e2e+generate-scaffolds-reach-stack.e2e(OS_TEST_TIERS=nightly): 2 files / 77 tests. No new finding.examples/app-showcaseauthor-time-advisories: 2/2.Acceptance notes
outside-closurecall still fails at run time. Judging that would need the resolver's verdict at the door.Verification
packages/metadata-protocol/src/protocol-authoring-gate.tsdeploymentFlowNamesOf(the union and the no-verdict exits),packages/lint/src/authoring-rules.tsthevalidateFlowSubflowTargetsentry (runtime pass with no names = nothing),packages/lint/src/validate-flow-trigger-readiness.tsvalidateFlowSubflowTargets.pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.runtime-authoring-gate.test.ts -t 35143. Expect 4 passed, one of them a 422 namingflow-subflow-unknown.Gates
dispatch-gates --ranwith exit codes: 99 derived, 97 exit 0, 2 exit 3 not measured in this container.check-plugin-teardown-shape --self-testneeds an unshallowed clone.check:dual-build-cjs-loadsneeds a full build: no dist for studio, client-react, scenarios.check:facade-delegation-onlywas red on the first tree (protocol.ts over its line ceiling by 12). Fixed by moving the reads intoprotocol-authoring-gate.ts. All 55 rootcheck:*families re-run on that head: exit 0.overlap-check: clean against origin/main and the two open PRs sharing a file (feat(runtime): POST /packages/:id/move-in moves a selection of loose items into a package, each through the save door #38185, perf(metadata-protocol): one form request reads the view list and each type's stored rows once #38164).Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (CI-owned run).main, one pull request.packages/spectouched: only a migration entry's text, no generated artifact moves.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK