Repository navigation
Description
Summary
Three marker readers in dispatcher/ act on text without checking who wrote it or where it sits. Anyone who can comment on an issue can silence a dispatcher advisory or seed a forged dispatch record, and a ticket body that documents the Blocked by: format inside a code fence has that example converted into a real relationship. None of the three is reachable only through a new feature; all predate #198, which found them.
Approach
Two parts, one commit each. They share a root — a reader trusting bytes it should qualify — but the qualifications differ: who wrote it for part 1, where it sits for part 2.
1. Qualify the author of a dispatcher-owned marker.
commentOnce(dispatcher/apply.mjs:20) dedupes oncomments.some((c) => String(c.body || '').startsWith(mark))(:23) with no author filter. Anyone who can comment on an item can pre-post<!-- sydevs-dispatcher: <key> -->and permanently suppress that advisory — the dispatcher then logscomment "<key>" already postedand moves on.loadRecord(dispatcher/record.mjs:60) returns the first commentparseRecordaccepts (:16), which tests onlybody.startsWith(MARKER)(:18). A comment posted before the dispatcher creates its own record would be read as the record, seedingcurrent,pending,fixCi,continuesanddispatches.
The keys are predictable. decide.mjs carries 18 commentOnce keys on main. Two are bare fixed strings: approve-open-questions (decide.mjs:825) and blocked (:524, :558). The other 16 prefix a fixed word with a value anyone reading the item can see — a head sha, a comment id, a PR number — so every one of them is guessable from the item itself. The open-questions advisory on this ticket (:499) is one of them.
Both filters are one clause: the comment's author must be identity.expectedLogin. isBot(login, config) is exported from dispatcher/decide.mjs:43 and already used this way across gather.mjs, sweep.mjs and deps.mjs. The listings both seams already make return user.login, so neither needs a new GitHub call. What each one does need is the login threaded in, because neither function takes config today:
commentOnce(gh, t, key, body, dryRun, log)— all four call sites (apply.mjs:164,:329,:344,:440) sit insideapply(), whereconfigis in scope.apply.mjsdoes not importdecide.mjstoday;decide.mjsimports onlyverbs.mjsand../workflow/lib/railway.mjs, so the import adds no cycle.loadRecord(gh, { owner, repo, number })— the filter belongs here, not inparseRecord, which sees a body and no author. Three of its four call sites haveconfigin scope (sweep.mjs:57,sweep.mjs:65,gather.mjs:192, whereconfig.identity.expectedLoginis already bound at:187). The fourth,gather.mjs:105, sits ininSetBuild(gh, goal, childRef, lock), which receives only the lock label — its two callers (gather.mjs:230,:318) both passconfig.labels.lockwithconfigin scope, so that helper takes the login too.
What the decision settled. A comment the bot wrote under a different login — a renamed bot, a migrated PAT — stops being recognised, so every advisory re-posts once and every record is re-created once on first contact. That one-off duplicate across the open items in five repos is accepted (## Decisions 1). Build no reconciliation path for it.
2. Skip fenced code when reading a blocker line.
parseBlockedBy (dispatcher/markers.mjs:57) has no fence state, unlike parseOpenQuestions (:155), which carries exactly the three lines needed (:157, :161, :162). So a ticket body that shows the marker format as documentation has the example read as live, converted into a native relationship, labelled blocked, and then stripped from the body by stripBlockedBy.
Measured on main (569dd90):
- A body that is nothing but a fenced
Blocked by:line returns that ref fromparseBlockedBy, andstripBlockedBydrops the line. - Running both readers over every tracked
.mdin this repo hits exactly one file:workflow/skills/format-ticket/SKILL.md, whose own fenced example would relatesydevs/SahajCloud#632.
No ticket body observed today does this, so the failure is real but unwitnessed — which is why this is filed rather than folded into #198, whose ## Notes scope it explicitly ("This changes nothing about what counts as a blocker").
The seam depends on what has merged. blockerLines does not exist on main — #204 introduces it, and #204 is open. Write the fix against whichever shape is current at build time: the shared blockerLines pass if #204 has merged, else parseBlockedBy's own lines(body) loop (markers.mjs:61). Either way stripBlockedBy (:99) needs the fence flag added independently, because it splits on /(?<=\n)/ so each unit keeps its own line ending — one flag cannot serve both loops.
Decisions
- 1. How should an author filter treat a marker the bot wrote under a former login? → A, filter on
identity.expectedLoginonly and accept the one-off duplicate (Ardnived, 2026-10-21)
Acceptance criteria
-
commentOncetreats a comment as already posted only when its author isidentity.expectedLogin; a non-bot comment carrying the same marker does not suppress it. -
loadRecordaccepts a status comment only fromidentity.expectedLogin; a non-bot comment starting withMARKERis skipped, and the record is created as if absent. - Every caller of both passes the expected login,
inSetBuildincluded, and no call site reads it from anywhere butconfig.identity. - Neither change adds a GitHub call: both read the login already present on the comments each one lists.
-
parseBlockedByignores aBlocked by:line inside a triple-backtick fence, and so doesstripBlockedBy, so a fenced line is neither related nor stripped. - A
Blocked by:line outside a fence behaves exactly as today, fenced content elsewhere in the body notwithstanding —markers.test.mjs's existing shared fixture keeps its current results. - Every new test has been watched failing against the unfixed reader before being kept.
Verification checklist
-
node --test dispatcher/test/*.test.mjs -
claude plugin validate ./workflow --strict && node --test workflow/lib/*.test.mjs - The fenced-body probe prints
[], where today it prints the ref (Fis the fence, built without a backtick so the line pastes into a shell as written):
node -e "const F=String.fromCharCode(96).repeat(3); import('./dispatcher/markers.mjs').then(m=>console.log(m.parseBlockedBy(F+'markdown\nBlocked by: https://github.com/sydevs/SahajCloud/issues/632\n'+F,'sydevs')))" - The same body through
stripBlockedBy, with that target related, leaves the fenced line in place — today itsdroppedis that line:
node -e "const F=String.fromCharCode(96).repeat(3); import('./dispatcher/markers.mjs').then(m=>console.log(m.stripBlockedBy(F+'markdown\nBlocked by: https://github.com/sydevs/SahajCloud/issues/632\n'+F,'sydevs','Blocked by',[{repo:'SahajCloud',number:632}]).dropped))" - Sweep both readers over
git ls-files "*.md": no file reports a would-relate target, whereworkflow/skills/format-ticket/SKILL.mdreportsSahajCloud#632today -
grep -rn "loadRecord\|commentOnce(" dispatcher/*.mjs: every call site passes a login - A supervised
BOT_DISPATCH=drydispatch over a scratch issue carrying a hand-posted<!-- sydevs-dispatcher: blocked -->comment from a human login: the plannedblockedcomment still appears in the run log
Notes
- Found while implementing fix(dispatcher): refuse a Blocked by line that names no issue #198 (PR fix(dispatcher): refuse a Blocked by line that names no issue #204). That PR's security review confirmed both part-1 paths and established that fix(dispatcher): refuse a Blocked by line that names no issue #204 does not widen either: the issue-body text it echoes into a bot comment never lands at offset 0, so it can neither suppress a sibling advisory nor be read as a record.
- Not a reason to delay fix(dispatcher): refuse a Blocked by line that names no issue #204. Part 1 is reachable today without it, and part 2 is in the half of
parseBlockedByfix(dispatcher): refuse a Blocked by line that names no issue #204 leaves alone. - This is not blocked on fix(dispatcher): refuse a Blocked by line that names no issue #204, but part 2 touches the function fix(dispatcher): refuse a Blocked by line that names no issue #204 is rewriting. No
Blocked by:line, because the fix is writable against either shape and the work can start now. Expect amarkers.mjsconflict if both are in flight; build part 2 after fix(dispatcher): refuse a Blocked by line that names no issue #204 merges where the choice is free. - Also noticed, and deliberately not in scope:
relationships.bodyMarkerFormat(loop-config.json:362) is read by no code — onlydocs/why.md:1005cites it, as prose. It is a dead value, not a defect, and belongs in whatever next edits that block. - Part 2's
stripBlockedByclause is the easy thing to miss. The two functions iterate the body differently on purpose — the stripper splits after each newline so each line keeps its own\nor\r\n— so one fence flag cannot serve both, and a fix that adds it to the reader alone would relate nothing and still delete the author's documentation.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Hold Until
Projects
- StatusShow more project fieldsDone
Activity
Ardnived commentedon Oct 21, 2026
@sydevs-bot implement
sydevs-bot commentedon Oct 21, 2026
Not started: 1 open question(s) in the body still need an answer. Reply
@sydevs-bot revisewith your choices (for example1A), then say@sydevs-bot implementagain.🤖 sydevs dispatcher
Ardnived commentedon Oct 21, 2026
@sydevs-bot revise 1A
sydevs-bot commentedon Oct 21, 2026
🤖 no session running
recent dispatches
Written by the sydevs dispatcher. Sessions never edit this comment.
sydevs-bot commentedon Oct 21, 2026
Answered 1A: the filter is
identity.expectedLoginalone, and the one-off duplicate at a login change is accepted. It is in## Decisions, folded into Approach part 1, and the "chosen option ships" criterion is gone.Three things the code disproved while I was in there:
isBotis exported fromdecide.mjs:43, notgather.mjs, which imports it.apply.mjsdoes not importdecide.mjstoday, and adding it makes no cycle.config, so the login needs threading.gather.mjs:105is the awkward one —inSetBuildreceives only the lock label. A new criterion covers every caller.mainhas 18 keys, two of them bare strings:approve-open-questionsandblocked. Theopen-questionsadvisory above is one.Part 2's seam waits on #204:
blockerLinesis not onmainyet. The Approach now names both shapes, so this is buildable today. I added noBlocked by:line, so expect amarkers.mjsconflict if both run at once.No code written.
@sydevs-bot implementstarts it.🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Ardnived commentedon Oct 26, 2026
@sydevs-bot implement
Merge origin/main into claude/fix-205-qualify-marker-reads
fix(dispatcher): a marker reader trusts bytes it should qualify (#215)