From 12c9011ed4d5a315bf9da9bcc47d4ccea6dda77d Mon Sep 17 00:00:00 2001 From: Danyang Chen Date: Tue, 27 Oct 2026 14:02:23 +0800 Subject: [PATCH 1/3] docs(workflow-run): planJob header agrees with the existing-card skip (#1338) The header said a held job puts *every* node in `refused`, but planJob skips a node that already has a card before the hold test (:91 `if (existing.has(nodeId)) continue`), and the paragraph below it already said so. Rewrite both sentences from :91: - a held job refuses every node that has no card yet, with `heldBy` set to the holder name and the definition's own hold sentence (or `refusal: null` when the definition guards no held pull request); - a node that already has a card is in neither list, held job or not. Comment lines only: no behaviour change, no test change. The `heldBy` clause is re-read against the blank-hold contract that landed in #1337 (main 807e592e). --- core/src/shared/workflow-run.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/src/shared/workflow-run.js b/core/src/shared/workflow-run.js index ad0cd954d..5d79ebf29 100644 --- a/core/src/shared/workflow-run.js +++ b/core/src/shared/workflow-run.js @@ -81,12 +81,13 @@ export function cardsOfJob(cards, jobId) { // queue role is `node.role`, and the card carries no assignee, because who does it is the // claim's answer and not the planner's (#1316 pins 1 and 3). // `refused` one entry per node that may not open, with `enterNode`'s sentence and whether it was -// refused because a fact could not be read at all (#1316 pins 2 and 8). For a held job -// every node is here with `heldBy` set and the definition's own hold sentence, or -// `refusal: null` when the definition guards no held pull request. +// refused because a fact could not be read at all (#1316 pins 2 and 8). A held job puts +// every node that has no card yet here, with `heldBy` set to the holder's name and the +// definition's own hold sentence, or `refusal: null` when the definition guards no held +// pull request. // -// A node that already has a card is in neither list: it is open work, and the planner never touches a -// card it did not create. +// A node that already has a card is in neither list, held job or not: it is open work, and the planner +// never touches a card it did not create. export function planJob({ definition, job = {}, cards = [], facts = {}, hold = null } = {}) { const def = normaliseWorkflow(definition) const jobId = job?.id ?? null From db91b7533294645c4f728747acb0301170a820bb Mon Sep 17 00:00:00 2001 From: Danyang Chen Date: Tue, 27 Oct 2026 14:19:09 +0800 Subject: [PATCH 2/3] chore(#1338): regenerate the workflow-run whole-file mirror `nodes scripts/ds-bot-patches.mjs generate` on 12c9011e rewrites one file: `patches/ds-bot/files/src/shared/workflow-run.js` now carries the same header text as `core/src/shared/workflow-run.js`, byte for byte (`cmp` clean). No numbered patch moves, because that module is a whole-file mirror and belongs to no numbered group in `topics.json`. `check` is green at this tree (pin 2b10c70, 10 patches apply in order, core/ equals ds-bot/ + patches); `node --test test/workflow-run.test.js` is 15/15. --- patches/ds-bot/files/src/shared/workflow-run.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/patches/ds-bot/files/src/shared/workflow-run.js b/patches/ds-bot/files/src/shared/workflow-run.js index ad0cd954d..5d79ebf29 100644 --- a/patches/ds-bot/files/src/shared/workflow-run.js +++ b/patches/ds-bot/files/src/shared/workflow-run.js @@ -81,12 +81,13 @@ export function cardsOfJob(cards, jobId) { // queue role is `node.role`, and the card carries no assignee, because who does it is the // claim's answer and not the planner's (#1316 pins 1 and 3). // `refused` one entry per node that may not open, with `enterNode`'s sentence and whether it was -// refused because a fact could not be read at all (#1316 pins 2 and 8). For a held job -// every node is here with `heldBy` set and the definition's own hold sentence, or -// `refusal: null` when the definition guards no held pull request. +// refused because a fact could not be read at all (#1316 pins 2 and 8). A held job puts +// every node that has no card yet here, with `heldBy` set to the holder's name and the +// definition's own hold sentence, or `refusal: null` when the definition guards no held +// pull request. // -// A node that already has a card is in neither list: it is open work, and the planner never touches a -// card it did not create. +// A node that already has a card is in neither list, held job or not: it is open work, and the planner +// never touches a card it did not create. export function planJob({ definition, job = {}, cards = [], facts = {}, hold = null } = {}) { const def = normaliseWorkflow(definition) const jobId = job?.id ?? null From 8f0a68109c1e7a2443797bec17a223f40f7ff9c4 Mon Sep 17 00:00:00 2001 From: Birfy Date: Tue, 27 Oct 2026 06:24:13 +0000 Subject: [PATCH 3/3] chore(#1338): record Docs-not-needed for the planJob header fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The two commits before this one change only the module header comment of core/src/shared/workflow-run.js and its byte-identical mirror under patches/ds-bot/files/. No behavior, no test, no definition and no numbered patch change; the header now states the skip that the planner already makes at the `existing.has(nodeId)` branch, so the comment and the code tell one story. This commit is empty on purpose: the trailer has to live in a branch commit as well as in the pull request body, and the merge queue squashes the title and body into the commit that lands on main. Docs-not-needed: docs/subsystems/core-host.md already describes workflow-run.js at this level (a node that already has a card is in neither list), and this pull request changes a comment to match code that already behaves that way — no architecture change to record.