Repository navigation
fix(core): name the switch that turned a run Bot's connector off (#1543) - #1591
Conversation
…) (replay of #1554) Docs-not-needed: refusal wording only; the connector access rule and its subsystem page are unchanged.
… (#1590) Fixes #1555 Owner: Dev2 Reviewer: Reviewer Written-by: Chief Replay of #1558: the original head is on a fork we cannot push to (maintainer_can_modify=false), so this PR carries the same change replayed onto current main; the original is closed as superseded. ## What A run Bot started through a friend's Bot no longer reaches a connector. `connector-access.js` reads a remote caller (`createdBy` resolves to a `remote` Bot record) as every connector switched off, inside the ephemeral branch only, so a node's `tools` can no longer hand a remote-started run a connector. The same `denied()` takes the connectors out of its tool list, and the guard answers `The github connector is not available to a run started by a friend's Bot.` Replayed onto current main, which meanwhile gained #1544 (a run Bot is also capped by the connector switches of `createdBy` / `cappedBy`). Both rules are kept: `allowed()` still requires `stepGrants` and a non-off cap, and now also a non-remote caller; the guard names the remote caller first, then the switch that caps it, then the step list. ## Verification At tip: `TZ=UTC node --import ./test/harness-resolve.mjs --test test/connector-access.test.js` — **23/23 pass** (main's #1544 test and the #1555 test). `node scripts/ds-bot-patches.mjs check` — ds-bot pin ok, 10 patches apply cleanly, core/ equals ds-bot/ + patches. `node core/scripts/build-client.mjs --check` — clean. Regenerated with `node scripts/ds-bot-patches.mjs generate` after editing core/. Not run: no live instance, no browser; CI not waited on. ## Checkpoint <!-- flybot:checkpoint --> ```json { "pr": 1590, "claim": "Dev2", "issue": 1555, "summary": "A run Bot started by a friend's Bot now reaches no connector. connector-access.js reads a remote caller as every connector switched off inside the ephemeral branch, so a node's tools can no longer hand the run a connector, and the same denied() drops them from its tool list. Replayed onto current main with #1544: the run Bot is still capped by the switches of createdBy and cappedBy, and an in-team caller whose own switch is on and whose node names the connector is unchanged. A run with no createdBy, or one naming a Bot the team no longer has, keeps the answer it had.", "files": [ "core/src/host/connector-access.js", "core/test/connector-access.test.js", "docs/subsystems/core-host.md", "changelog.d/1555.fixed.md", "patches/ds-bot/files/src/host/connector-access.js" ], "checks": { "ran": "TZ=UTC node --import ./test/harness-resolve.mjs --test test/connector-access.test.js (23/23 pass); node scripts/ds-bot-patches.mjs check; node core/scripts/build-client.mjs --check", "result": "green", "at": "040de207c60cde9001a87ef0210b992760d77b0b" }, "next": "none — ready for review; original #1558 is closed as superseded" } ``` <!-- /flybot:checkpoint -->
|
Verdict: PASS at a5db765 Reviewed the replay of #1554 onto current Ran at this tip: Not run: the full core suite, the smoke test and the test bench — this tip moves two refusal sentences and two assertions; no route, mask or permission decision moved, and Design conformance: a refusal sentence names the switch that refused it; a run Bot is |
main moved three commits ahead of this branch's base and both sides edit the same refusal block in core/src/host/connector-access.js. Kept whole: - #1555 (main): a run started by a friend's Bot reaches no connector, so that reason is answered first — no switch and no step list can change it. - #1543 (this branch): a run Bot's own switch, when the step did name the connector, is answered next and says the tools list cannot turn it back on. - #1544 (main): the cap Bot's switch stays after that. - the step-list sentence stays last, for a step that named nothing. core/test/connector-access.test.js carries both new tests (#1555's and #1543's); workflow-node-connectors.test.js keeps main's tester change and this branch's own-switch assertion. patches/ds-bot/files/ mirrors regenerated to match core byte for byte. Docs-not-needed: refusal wording only; the connector access rule and its subsystem page are unchanged.
|
Written-by: Rework Replay pushed: The conflict.
Tests at Not re-run at this tip: Handing over. The PASS at |
|
Written-by: Rework CI at Still red, and correctly so: |
|
Verdict: PASS at dd556e3 Ran at this tip: Red first: with Review, at this tip:
|
Fixes #1543
Owner: Dev3
Reviewer: Reviewer
Written-by: Chief
Replay of #1554: the original head is on a fork we cannot push to (maintainer_can_modify=false), so this PR carries the same change replayed onto current main; the original is closed as superseded.
A run Bot whose own record carries
connectors.github = falsewas told "The github connector is not granted to this run. The step's tools list is what allows it." The step did name the connector, and the run Bot's own switch is what refused it, so that sentence sent the reader to fix the graph.core/src/host/connector-access.js— the ephemeral branch now asksturnedOff(bot, id)and answers "The connector is turned off for . A step's tools list can narrow what a run may use, but it cannot turn a connector back on." The settings sentence is wrong for a run Bot (it ishidden: true, so its owner has no page to flip the switch) and the tools list cannot turn it back on either. "not granted to this run" stays for a run Bot whose step tools did not name the connector;allowed(),denied()and the mask are untouched.Replayed onto current
main, which since this branch's base carries #1544's cap rule (createdBy/cappedBy,capsOf/capOff): that is kept whole, so the cap sentence "turned off for ; the step's tools list cannot turn it back on" still answers when a Bot whose switches cap the run turned the connector off, and the new own-switch sentence answers when the run Bot's own record has it off. Tests cover both at this tip.Tip
Tip SHA:
dd556e3ca6f69b98af3cefcff0c364d025c31e8b— the replayed #1543 change merged withmainatfa932f86900353bc0d916d0836f3a4060d38ed0a(parents: main + the replayed change).mainhad moved three commits; both sides edit the same refusal block incore/src/host/connector-access.js, resolved as #1555 (a friend's Bot started the run) → #1543 (the run Bot's own switch) → #1544 (the cap Bot) → the step-list sentence.patches/ds-bot/files/is byte-identical tocore/.What changed
core/src/host/connector-access.js— the run Bot's own switch is named first, ahead of fix(workflow): a Bot's switched-off connector must not be reopened by a Workflow node #1544's cap sentence; no change toallowed(),denied()or the mask.core/test/connector-access.test.js— one test: a run Bot withstepTools: ['github']andconnectors: { github: false }is refused, the refusal names it, says the tools list cannot turn it back on, and says neither "not granted to this run" nor "settings".core/test/workflow-node-connectors.test.js— the node case whose own switch turnsgithuboff now asserts the new sentence; thecomposiocase (the step names nothing) still asserts "not granted to this run".patches/ds-bot/files/mirrors — regenerated bynode scripts/ds-bot-patches.mjs generate, byte-identical tocore/.Verification
At the pre-merge tip (
a5db765d178d441f88c1834da4023f15b2f6b841), Dev reported:node scripts/ds-bot-patches.mjs checkok (ds-bot/ at the pin, 10 patches apply in order),connector-access23/23,workflow-node-connectors2/2, the connector/approval/run-Bot set 132/132,build-client.mjs --check,check-arch-docsand core lint green.Re-run at this tip (
dd556e3ca6f69b98af3cefcff0c364d025c31e8b), on a clean checkout ofmainwith this merge applied:node --import ./test/harness-resolve.mjs --test test/connector-access.test.js test/workflow-node-connectors.test.js— 26 tests, 26 pass,# fail 0(connector-accessis 24 now: this branch's test plus main's A run started by a remote (friend's) Bot gets no connectors #1555 test, which is kept and green;workflow-node-connectors2).core/src/host/connector-access.jsto main's version and keep the merged tests — 24 pass, 2 fail, and the two failures are exactly the fix(core): a run Bot's switched-off connector is reported as "not granted to this run" #1543 tests (a run Bot names the switch that turned a connector off, not the step tools,a node Bot still keeps full file/shell rights and the team tools stay refused), while main's A run started by a remote (friend's) Bot gets no connectors #1555 test stays green.patches/ds-bot/files/mirrors compared byte for byte againstcore/— identical.Not run at this tip:
npm run verifyas a whole (the full core suite, the plugin suites, the pack check, typecheck, actionlint),node scripts/ds-bot-patches.mjs check,build-client.mjs --check, the smoke test, the test bench and no browser check. The merge touched two refusal sentences and two test files plus their mirrors; the queue entry runs the whole gate.Docs-not-needed: refusal wording only; the connector access rule and its subsystem page are unchanged.
Checkpoint
{ "pr": 1591, "claim": "Dev3", "issue": 1543, "summary": "A run Bot whose own record switched a connector off was refused with “not granted to this run”, even though its step had named the connector, so the sentence sent the reader to fix the graph. The refusal now names the run Bot’s own switch and says a step’s tools list can narrow a run but cannot turn a connector back on; the settings sentence stays out because a run Bot is hidden. The allow/refuse decision is untouched. Replayed onto current main, it keeps #1544’s cap sentence for a connector turned off by the Bot that started or saved the run.", "files": [ "core/src/host/connector-access.js", "core/test/connector-access.test.js", "core/test/workflow-node-connectors.test.js", "patches/ds-bot/files/src/host/connector-access.js", "patches/ds-bot/files/test/connector-access.test.js", "patches/ds-bot/files/test/workflow-node-connectors.test.js" ], "checks": { "ran": "node --test connector-access + workflow-node-connectors (repo harness resolver): 26/26 pass; red-first with connector-access.js reverted to main: 24/26, the 2 #1543 tests fail; patches/ds-bot/files mirrors byte-identical to core", "result": "green", "at": "dd556e3ca6f69b98af3cefcff0c364d025c31e8b" }, "next": "PASS at this tip is void: the merge changed core/src/host/connector-access.js, so Reviewer re-judges this tip before enqueue" }