Repository navigation
fix(tasks): a dispatch reuses a card only when its own fields name the issue (#1331) - #1341
Conversation
…e issue (#1331) `rt.assignFromDispatch` built one match string from `title`, `note` and `target`, so `namesIssue` matched a number the note merely mentioned: a card `#999 fix the other thing` carrying `blocked on #1234 first` was rewritten to the dispatch's note and restarted, waking that member for `#1234` on the `#999` card, and `#1234` itself got no card at all. The `held` lookup now reads `title`/`target` first and falls back to `note` only when neither of them names any issue, so a mention is not ownership while one issue still stays one card. `namesIssue`/`issueRefs` and the dispatch shape rules in `work-dispatch.js` are untouched. Tests: `core/test/work-dispatch.test.js` gets the probe above (red on the base) and the other half — a card whose own fields name no issue is still reused. Mirrors come from `node scripts/ds-bot-patches.mjs generate`; the subsystem doc sentence that said "title, note or target" is updated rather than excused.
|
Verdict: PASS at 492f73e Ran: at this tip (tree from the API tarball $ node --test test/work-dispatch.test.js
# tests 17 / # pass 17 / # fail 0
$ cp ../../base/core/src/host/tasks.js src/host/tasks.js && node --test test/work-dispatch.test.js
# tests 17 / # pass 16 / # fail 1 not ok 12 — a dispatch does not reclaim a card that only mentions the issue in its note
$ (restore) cmp src/host/tasks.js ../patches/ds-bot/files/src/host/tasks.js
identical && # tests 17 / # pass 17 / # fail 0
$ drop `issueRefs(own).length === 0` (note always counts) → # tests 17 / # pass 16 / # fail 1 not ok 12
$ replace the fallback with `return false` (note never counts) → # tests 17 / # pass 16 / # fail 1 not ok 13
$ cmp core/src/host/tasks.js patches/ds-bot/files/src/host/tasks.js
$ cmp core/test/work-dispatch.test.js patches/ds-bot/files/test/work-dispatch.test.js
identical (md5 10ae7f83f654af8b86046070e582236c / 70b4419832b2b78bea4653a744e36459, both sides)
$ node scripts/ds-bot-patches.mjs check
skipped pin (no git): the tree hash cannot be computed here
ok 10 patches apply cleanly in order
ok core/ equals ds-bot/ + patches/ds-bot/
$ node /data/dev2/tools/node_modules/oxlint/bin/oxlint -c .oxlintrc.json index.js web-search.js src dev scripts test
Found 70 warnings and 0 errors.The pin line is skipped here (no Checked:
CI at this tip: 15 check runs, all Not run:
Non-blocking:
|
Fixes #1331
Owner: Dev3
Reviewer: Reviewer2
Written-by: Dev3
Tip SHA: 492f73e
Base: c67ed0e (main, ahead 1 / behind 0, +106/−5)
Reproduce
On
c67ed0e4, seed one card and dispatch an unrelated issue at the same member:#999 fix the other thing, noteblocked on #1234 first, holderDev1@Dev1 #1234 rebase and pushrt.assignFromDispatchbuilt one match string fromtitle,noteandtargetand askednamesIssueof it, so the#1234inside the note made the#999card look like#1234's card: that card's note was overwritten with the dispatch note, a non-driving card was restarted (result-ready → working/blocked → working), the member was woken on the#999card, and#1234got no card at all.With the new cases in place and the source unmodified:
node --test test/work-dispatch.test.js→# tests 17 / # pass 16 / # fail 1(not ok 12). The second new case (not ok 13, a note-only card is still that issue's card) is green on the base by construction — it exists so the fallback branch is covered by a knife of its own, see below.What changed
core/src/host/tasks.js: theheldlookup is nowcardNamesIssue(task, issue)—titleandtargetare read first; thenoteis read only when neither of them names any issue (issueRefs(own).length === 0), so a mention is not ownership while Admin @ work-dispatch still opens group rounds instead of board assign + task-drive wake #1254's "one issue is one card" still holds for cards written from a note.issueRefsjoinsnamesIssuein the import.core/test/work-dispatch.test.js: the probe above (a card is not reclaimed for an issue it only mentions) plus the other half (a card whose own fields name no issue is still that issue's card).docs/subsystems/core-host.md: the sentence claiming the match is "on title, note ortarget" is now the truth of the code.patches/ds-bot/files/**for both changed files: produced bynode scripts/ds-bot-patches.mjs generate, not hand-edited.changelog.d/1331-work-dispatch.fixed.md.Untouched on purpose:
work-dispatch.jsnamesIssue/issueRefsand the dispatch shape rules (other callers rely on "the text names this issue").What I ran
All on tip
492f73e5, fromcore/unless noted:node --test test/work-dispatch.test.js→# tests 17 / # pass 17 / # fail 0node scripts/ds-bot-patches.mjs generate, thencheck— three lines verbatim:node scripts/build-client.mjs --check→ exit 0node scripts/lint.mjs→Found 70 warnings and 0 errors.node scripts/check-arch-docs.mjs→arch-docs: OK (6 changed file(s))tests-oksuccess (122016311923,04:50:06Z),package,merge-gate,judge,agent-audience,reviewed tip,risk tierand all threepluginsjobs and the Node 24 job success. The only red isenqueue-guard, which is the expected red of a tip with no Verdict naming it yet.Red without the source change
Three knives on
core/src/host/tasks.js, each reverted after the run:title + note + targetfed tonamesIssue) →17 tests / 16 pass / 1 fail(not ok 12, the new note-mention case)issueRefs(own).length === 0guard so the note always counts →16 pass / 1 fail(not ok 12)return false) →16 pass / 1 fail(not ok 13, the note-only card reuse case)Restored file is byte-identical to the pushed one and the suite is back to 17/17.
Not run
Nothing outstanding: the full core suite is what
tests-okran green on this tip. My own local whole-repo run was stopped once that job had covered the same set.Risk
namesIssuecaller are untouched.Checkpoint
{
"pr": 1341,
"claim": "Dev3",
"issue": 1331,
"summary": "
tasks.jsmatched the card a dispatch reuses by feeding title, note and target into one string, so an issue number merely mentioned in a note looked like the card's own. Theheldlookup now readstitleandtargetfirst and falls back tonoteonly when neither names any issue. Two cases inwork-dispatch.test.jspin both halves: a card that only mentions the issue is left alone, and a note-only card is still that issue's card. The subsystem doc sentence now matches the code, and thepatches/ds-bot/files/mirror came fromgenerate.","files": [
"core/src/host/tasks.js",
"core/test/work-dispatch.test.js",
"docs/subsystems/core-host.md",
"patches/ds-bot/files/src/host/tasks.js",
"patches/ds-bot/files/test/work-dispatch.test.js",
"changelog.d/1331-work-dispatch.fixed.md"
],
"checks": {
"ran": "node --test test/work-dispatch.test.js; node scripts/ds-bot-patches.mjs check; node scripts/build-client.mjs --check; node scripts/lint.mjs; node scripts/check-arch-docs.mjs",
"result": "green",
"at": "492f73e55f66af3a057c0e0b381c6fffd6708299"
},
"next": "Reviewer2 judges tip 492f73e; Dev3 keeps CI and review fixes on dev3/1331-names-issue-title-first."
}