Skip to content

fix(dispatcher): refuse a Blocked by line that names no issue - #204

Merged
Ardnived merged 11 commits into
mainfrom
claude/fix-198-blocked-by-names-no-issue
Oct 27, 2026
Merged

Ardnived merged 11 commits into
mainfrom
claude/fix-198-blocked-by-names-no-issue

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • A Blocked by: line that names a target the dispatcher cannot relate now earns one comment saying so, instead of being dropped in silence while the line keeps advertising a blocker nothing enforces.
  • format-ticket says the target is an issue, never the PR that closes it — the rule was only under the reading half; plugin.json moves to 4.0.1 with it.
  • Joined, not listed: the dead LOCK_FREE_STATUS_ONLY constant is deleted (the ticket joins it — same file, same reader, same test command), a docs/routine-setup.md clause names the third outcome a line can have, and one test pins that a dispatcher comment is never read as a session request.

Change outline

Flow — what a body line produces

The reader gains a reject side, and derive turns it into the narrowest action in the vocabulary.

 gather(issue)                                          dispatcher/gather.mjs
   parseBlockedBy(body, org, marker)                    # in-org issues → relationships
+  unresolvedBlockers(body, org, marker)                # targets it could not use
+    blockerLines(body, marker)                         # one scan, shared with parseBlockedBy
+      → { line, bare }                                 # line as written; bare as matched
+    parseRefs(bare, org) non-empty → skip the line     # related, and `blocked` follows
+    bare.match(TARGET)                                 # ref-shaped: issue/PR URL, owner/repo#N, #N
+    none → skip the line                               # prose, not a blocker
+  s.markers.unresolvedBlockers = [{ line, targets }]
 derive(target, s, config)                              dispatcher/decide.mjs
   issues.opened / issues.edited
     relationships(blockers, strip)
     label([blocked], [awaiting])
+    refuseUnresolvedBlockers(s, config)
+      commentOnce(`blocker-unresolved ${sorted targets}`, …)   # the targets are the key, not the line

Behaviour — the decision per line

Reporting is deliberately narrower than reading. The matcher is loose because people write **Blocked by sydevs/X#9.**; a comment on a live ticket costs more than a run skipping a ticket, which is what that looseness was priced against.

 a live `Blocked by` line
   resolves ≥1 in-org issue
-    relate it, apply `blocked`, strip the line
+    relate it, apply `blocked`, strip the line        # unchanged
   resolves none
     names a ref-shaped target
-      silence                                         # the defect
+      one comment, keyed on the targets               # no label, no relationship, no Status
     names no target at all
+      silence                                         # `Blocked by the lack of staging credentials.`
   struck through, or a non-member's own body
-    silence
+    silence                                           # unchanged

Contract — what the author is told

The comment quotes the line as written and names both accepted spellings. It reports the missing relationship, never the state — a sibling line that did resolve can be applying blocked in the same plan. Rendered from the real SahajCloud#987 line:

No relationship created: https://github.com/sydevs/SahajCloud/pull/912 names no sydevs issue.

> Blocked by: https://github.com/sydevs/SahajCloud/pull/912 — until that PR merges

Name the blocker as a full issue URL or `owner/repo#N`. A PR URL and a bare `#N` are ignored — block on the issue a PR closes.

Test results

  • Lean gate: ✓ claude plugin validate ./workflow --strict passed, node --test workflow/lib/*.test.mjs 97 passed. Run from the .claude/worktrees/ worktree on the first push, and from the checkout on the review round.
  • Targeted specs: ✓ node --test dispatcher/test/*.test.mjs 286 passed (10 new).
  • node workflow/lib/rule-delta.mjs --base origin/main workflow/skills: 88 → 88, no directive disappeared.
  • node workflow/lib/comment-lint.mjs --base origin/main: no banned comment added.
  • grep -rn LOCK_FREE_STATUS_ONLY dispatcher/: nothing.
  • Each new test was watched failing before it was kept. Four of the five behaviour tests fail with the two call sites disabled; the fifth fails only when the !outsider guard is removed, and the request test fails only when latestRequest's !isDispatcherComment term is dropped. The review round's three new assertions were each watched failing too — the "not blocked" one on the old opener, both ordering ones on the unsorted key.

Manual verification

  1. The one checklist item I could not run: a supervised BOT_DISPATCH=dry dispatch over a scratch issue carrying Blocked by: <a PR URL> — the planned comment should appear in the run log and no label action should. A routine cannot reach the Actions dispatch, so this is yours.
  2. Worth confirming on that dry run: the comment posts once, and a later edit to the reason prose after the em dash does not post a second.

Notes for reviewer

The reader changed shape after review, and that is the one judgement call to check. The ticket's Approach said to report "the bare text of each live line whose parseRefs is empty". Built that way first, it reported any line starting with the marker words — so Blocked by the lack of staging credentials. would have earned its author a comment telling them to write an issue URL. docs/why.md#the-marker-reader-matches-words-not-punctuation licensed the loose matching on the grounds that a false positive costs a run one skipped ticket; this would have re-priced every one of those as a public comment. So the reader now matches ref-shaped targets and reports only a line that reaches for one and misses. Measured: across every tracked .md in this repo, including docs/why.md and docs/routine-setup.md, which discuss the format at length, the new reader fires on none and the first draft fired on several. Every acceptance criterion still holds — a line resolving one target and dropping another still stays silent.

Two further consequences of that change, both from review:

  • Keyed on the targets, not the line — and sorted. The whole line made the reason prose part of the dedupe identity, so rewording after the em dash — the edit people actually make — would have re-posted advice already read, and any later tidying of blockerText would have re-nagged every open ticket carrying such a line. The key sorts the targets too, so an author who corrects one of two and rewrites the pair does not earn a second comment. The message still names them in the order written.
  • The quoted line is the line as written. bare strips leading emphasis only, so the first draft quoted Blocked by #12.** back at its author, and quoted it inside a backtick span that a backtick in the reason broke.

The honest running cost. An issues.edited whose only marker is an unresolved line used to be a pure no-op; it now always carries a comment action, so commentOnce paginates the comment list on every later body edit just to rediscover the comment is posted. That is one REST GET per edit for the life of the ticket. It is unavoidable while the dedupe has no comment id to key on, and it is the price of the feature rather than waste.

Security. No finding reached the review's reporting bar, on either round. One point is worth knowing: this is the first thing that puts an issue author's own bytes inside a bot-authored comment, so the !isDispatcherComment term in gather.latestRequest is now load-bearing — a body line can carry a sydevs-request marker, and parseRequest reads it out of the posted comment. Only that filter stops it reaching a replan or a cross-repo transfer. A test pins that composition end to end, reading latestRequest through gather's _internal seam.

Detail

Taken from the adversarial review round, all four findings. Each is its own commit, and docs/why.md and docs/routine-setup.md were corrected wherever they described the old behaviour.

  • 47ea3da — the comment opened with "Not blocked:", which the same plan can contradict: one resolvable line beside an unresolved one yields label add:[blocked] for the first and this comment for the second, on issues.opened and issues.edited alike. The opener is now the next clause, which was already the true, narrower thing.
  • 9ad6f60 — docs/routine-setup.md described the key the branch carried two commits earlier.
  • c6956fd — the key kept document order, so swapping two targets on the line reposted. Both keys sort now: the reader's own line dedupe and the commentOnce key.
  • 1cd0a3e — latestRequest is behind export const _internal, the seam decide.mjs already uses, rather than widening gather's public surface for one test.

Review findings dismissed, with reasons.

  • A shared blockerSpelling(config) helper for the refusal sentence, so blockVerb's and this one cannot drift. Not taken. The two worked examples differ in kind — one is a whole @sydevs-bot block on … command, the other a bare ref — so parameterising costs more readability at both call sites than the drift it prevents. The duplicated SahajCloud#632 constant is gone from the new message instead; owner/repo#N is itself the template.
  • Quote relationships.bodyMarkerFormat from loop-config.json in the refusal, retiring a config key nothing reads. Not taken here. It would change what the message says and wire a previously-dead key into user-facing prose, which is its own change. The dead key is noted on fix(dispatcher): a marker reader trusts bytes it should qualify #205 and journalled as friction.
  • Report per target rather than per line, so a cross-org blocker beside a resolved in-org one is also reported. Not taken: the ticket's criterion requires that line to stay silent, and its ## Notes argues the case. Per-target detection and keying is taken; per-line suppression is kept.
  • Drop the (s.markers.unresolvedBlockers || []) guard, since its blockedBy neighbour is dereferenced unguarded. Not taken. Six existing test fixtures build markers without the new key, so the field is not in practice always present in a hand-assembled snapshot, and decide is a pure function that should stay total over one. The guard carries a comment saying exactly that.
  • A generic marker-diagnostics mechanism covering Re-check: and Sentry: too. Not taken, and not wanted: Blocked by is the only one of the three a human hand-writes. Re-check: is the superseded spelling of the Hold Until field, whose bad values blockVerb already refuses, and Sentry: is written only by the loop.
  • Three efficiency findings, all judged negligible by the reviewer and by me: N comment actions mean N paginated comment fetches (N is 1 in practice, 2 at the edge, and N>1 was already reachable), and gather now walks the body a second time (single-digit microseconds beside the round trips around it).

Taken from the first review, beyond the reader change. parseBlockedBy and unresolvedBlockers share one blockerLines pass, so a line's recognition is asserted in one place rather than two; gather hoists its call beside parseBlockedBy's; the snapshot field is markers.unresolvedBlockers rather than markers.unresolved, leaving the generic name free for a later reader; one word, "unresolved", now spans the reader, the field, the decider and the comment key, so one grep finds the whole path; and the issues.opened / issues.edited call sites each carry the half-line saying why only one of them guards on outsider.

Filed on the way: #205, per start-run's incidental-finding rule. None of it is in this diff, and none of it blocks this PR — all three predate the branch and are reachable without it:

  • commentOnce's dedupe (apply.mjs:23) and parseRecord (record.mjs:16) both trust their marker with no author check, so anyone who can comment can pre-post one and suppress a dispatcher advisory, or seed a forged record. This change does not widen either: the echoed marker is never at offset 0, so it can neither suppress a sibling advisory nor be read as a record.
  • parseBlockedBy does not skip fenced code blocks the way parseOpenQuestions does (markers.mjs:161 has the three lines it lacks), so a ticket body that fences the marker format as documentation would have the line converted into a real relationship. Found by sweeping both readers over every tracked .md: workflow/skills/format-ticket/SKILL.md's own fenced example is read as live and would relate SahajCloud#632. It sits in the half of parseBlockedBy this PR leaves alone, and fix(dispatcher): refuse a Blocked by line that names no issue #198's ## Notes scope it out ("This changes nothing about what counts as a blocker").
  • relationships.bodyMarkerFormat (loop-config.json:362) is read by no code.

Why these commits ride together. Each is separately revertable and named above. Parts 1–3 are the ticket's own three parts; the routine-setup.md clause and the request test are this branch's own consequences, and the four review commits each fix what the round named. Note that reverting this PR wholesale would restore the dead constant along with the behaviour.

Not run: /pr-review-toolkit:review-pr. No routine has the plugin, so the pass was /code-review's four cleanup angles beside /simplify, plus /security-review because the diff matches securityReview.triggerPattern. The review round re-ran /security-review over its four commits, with no finding.

Closes #198

🤖 Generated with Claude Code

https://claude.ai/code/session_01RwNGisqc9vchf9VTr2Gfqf

sydevs-bot and others added 6 commits October 21, 2026 16:05
sydevs/SahajCloud#987 carried `Blocked by: …/pull/912`, naming the PR
rather than the issue that PR closes (#907). `parseBlockedBy` returns `[]`
for that line — GitHub's relationship takes an issue — so no relationship
was created, no `blocked` went on, and nothing was said. `stripBlockedBy`
leaves the line, rightly: it is the only record of the author's intent. The
ticket therefore read as blocked to every human and as ready to the
machinery. The `block on` verb has refused loudly in exactly this
situation since it shipped (decide.mjs blockVerb); the body-marker path
had no equivalent.

`unresolvedBlockers(body, org, marker)` is a sibling of `parseBlockedBy`
over the same `blockerText` pass, returning the bare text of each live
line whose `parseRefs` is empty. `gather` puts it on `s.markers.unresolved`
and `derive` turns each entry into one `commentOnce` on `issues.opened`
and `issues.edited`, naming the line and the two accepted spellings. No
label, relationship or Status moves for it: the item really is not
blocked, and `blocked` follows the relationship. An outsider's own body is
skipped, as its markers already are.

The comment is keyed on the line's own text, not a comment id — there is
none on this path. A body edit elsewhere re-derives the same key and
`commentOnce` posts nothing; a corrected line yields a key never reached.

A line that resolved one target and dropped another stays silent. That
ticket is related and carries `blocked`, so the human and the machinery
agree, and a PR URL beside a resolved issue is as often reason prose as a
second blocker.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RwNGisqc9vchf9VTr2Gfqf
…hat closes it

The Relationships section stated the accepted spellings only in its "Write
the format. Do not rely on it when reading" paragraph — under the reading
half, which a session writing a line has no reason to reach. The writing
instruction above it showed an `issues/632` URL and said nothing about what
the target must be, so the shape was there to copy and the rule was not.
sydevs/SahajCloud#987 named the PR.

One clause on the writing instruction says it, and the reading paragraph
now says the dispatcher comments on a line that names neither spelling
rather than dropping it in silence.

4.0.1: an installed plugin's cache directory is named after `version` and
never revisits the commit it recorded, so a skill edit reaches
`/plugin install workflow@sydevs` only when this string moves. The routines
read main fresh on every dispatch and do not need it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RwNGisqc9vchf9VTr2Gfqf
Nothing in `dispatcher/` or its tests has read it since it arrived dead in
#85. Its name states a rule — on a locked item only these action types run
— that `decide` does not implement: the lock strips `awaiting` and nothing
else. A reader trusting the name would believe comments and fires are
already suppressed on a locked item, which is the belief the part above
had to check against the code.

The rule itself may still be worth having. Suppressing comments and fires
on a locked item changes dispatcher behaviour in all five repos on the next
event, so it needs its own ticket; deleting the constant does not foreclose
it.

It joins #198 as the same file, the same reader and the same test command.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RwNGisqc9vchf9VTr2Gfqf
…opped

The Relationships section described the reader as generous about the line's
shape and stopped there, so it read as if every line either converts or is
ignored. One clause names the third outcome this branch adds.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RwNGisqc9vchf9VTr2Gfqf
From the review of this branch. The first draft reported any live line that
started with the marker words and resolved nothing, which re-priced the
loose matcher's false positives as public comments. `blockerText` matches
`Blocked by the lack of staging credentials.`, so that author would have
been told to write an issue URL.
`docs/why.md#the-marker-reader-matches-words-not-punctuation` licensed the
looseness on the grounds that a false positive costs a run one skipped
ticket; a comment on a live ticket is dearer. Read loosely, report
conservatively — the asymmetry `format-ticket` already states.

So the reader now matches ref-shaped targets (an issue or PR URL in any
org, `owner/repo#N`, a bare `#N`) and reports `{ line, targets }` only for
a line that reaches for one and resolves no in-org issue. Three
consequences:

- The comment is keyed on the targets. The whole line made the reason prose
  part of the dedupe identity, so rewording after the em dash — the edit
  people actually make — re-posted advice already read, and any later
  tidying of `blockerText` would have re-nagged every open ticket carrying
  such a line. A corrected target still yields a key never reached.
- The quoted line is the line as written, bullet off. `bare` strips leading
  emphasis only, so the old draft quoted `Blocked by #12.**` back at its
  author. It also quoted inside a backtick span, which a backtick in the
  reason broke; it is a blockquote now.
- A line naming no target at all is prose and is reported nowhere.

A line that resolves one target and drops another still stays silent, as
the ticket's criterion requires.

Also from the review: `parseBlockedBy` and `unresolvedBlockers` now share
one `blockerLines` pass, so a line's recognition is asserted in one place
rather than two; `gather` hoists its call beside `parseBlockedBy`'s; the
snapshot field is `markers.unresolvedBlockers`, leaving the generic name
free; and one word, "unresolved", now spans the reader, the field, the
decider and the comment key, so one grep finds the whole path.

Measured over every tracked `.md` in this repo, including `docs/why.md`
and `docs/routine-setup.md`, which discuss the format at length: the new
reader fires on none of them. The old one fired on several.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RwNGisqc9vchf9VTr2Gfqf
…ssion request

From the security review of this branch. This is the first thing that puts
an issue author's own bytes inside a bot-authored comment, so one term —
`!isDispatcherComment(c.body)` in `gather.latestRequest` — is now
load-bearing in a way it was not before.

Measured: a body line `Blocked by #1 <!-- sydevs-request {"replan":true,
"transfer":{"repo":"SahajCloud"}} -->` survives the echo intact, and
`parseRequest` reads the marker out of the posted comment. Only that filter
stops it reaching a replan or a cross-repo transfer. Dropping the filter
turns the new test red; nothing else in the suite notices.

So the test asserts the composition end to end on the body `commentOnce`
actually builds, and that the same marker in a session's own comment is
still honoured. `latestRequest` is exported for it, with the invariant
stated above it.

No finding in the review reached its reporting bar. The marker cannot break
out of the dedupe key either: every alternative of the target pattern draws
from `[\w.-]`, `/`, `#` and digits, so no target can contain `>` or a
space, and the ` -->` terminator stops a shorter key prefixing a longer
marker.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RwNGisqc9vchf9VTr2Gfqf
@sydevs-bot

sydevs-bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 18:14Z address-review · attempt 1 · session · done
  • 18:14Z address-review · attempt 1 · session
  • 18:05Z review-pr · attempt 1 · session · done
  • 18:05Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The shape is right and the diff is no bigger than #198. Each part is the ticket's, the two additions are this branch's own consequences, and nothing is an abstraction for one caller — blockerLines removes a duplicate scan rather than adding a layer. The judgement call the body flags, narrowing the reader to ref-shaped targets so Blocked by the lack of staging credentials. stays prose, is the only reading that keeps the loose matcher's false positives out of public comments.

What is wrong is at the edges and in words, not shape: the comment asserts a state it does not read, and routine-setup.md describes the key the branch had two commits ago. The security angle the body raises is genuinely handled.

Findings

  • should-fix dispatcher/decide.mjs:664 — "Not blocked:" can post in the same plan as label add:[blocked].
  • should-fix docs/routine-setup.md:736 — "keyed on the line's own text" contradicts the code and docs/why.md.
  • consider dispatcher/markers.mjs:110 — the key keeps document order, so reordering two targets reposts.
  • consider dispatcher/gather.mjs:123 — latestRequest is exported for one test; decide.mjs uses _internal for that.

What was checked

Read whole: markers.mjs, gather.mjs, the issues.* and blockVerb region of decide.mjs, apply.mjs:1-50, #198, both docs hunks. Followed the echoed line to every reader of a comment body — commentOnce's dedupe, botLastWordAt, pendingVerb, needsAddressReview, latestRequest — each excludes a dispatcher comment or the bot author. Ran node --test dispatcher/test/*.test.mjs in a detached worktree at 3122947: 286 pass. Reproduced the label contradiction and the ordering key by calling decide and unresolvedBlockers. No preview link to open.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread dispatcher/decide.mjs Resolved
Comment thread docs/routine-setup.md Resolved
Comment thread dispatcher/markers.mjs Resolved
Comment thread dispatcher/gather.mjs Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Oct 21, 2026
sydevs-bot and others added 5 commits October 21, 2026 18:16
The refusal opened with "Not blocked:", which the same plan can be
contradicting: a body carrying one resolvable `Blocked by` line beside an
unresolved one gets `label add:[blocked]` for the first and this comment
for the second. `issues.opened` and `issues.edited` both reach it.

The next clause already said the true, narrower thing, so that is now the
opener. Nothing else about the message or its key changes. The existing
test for a resolvable line beside a bare `#N` gains the assertion that
pins it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMybaRuVa8zwvVn4ZAVgE1
This clause described the key the branch carried before 849148d. The key
is `blocker-unresolved ${targets.join(' ')}`, and `docs/why.md` in this
same PR says so. A reader here was told the opposite, and would conclude
that rewording the reason reposts the comment.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMybaRuVa8zwvVn4ZAVgE1
`unresolvedBlockers('Blocked by #12 and #13')` keyed on `#12 #13`, so
swapping the two on the line keyed on `#13 #12` and `commentOnce` posted a
second comment about the same targets. Rewording the reason is the edit
the key was designed around, but an author correcting one of two targets
often rewrites the pair.

Both keys sort now — the reader's own line dedupe and the comment key.
The message is untouched: it still names the targets in the order written.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMybaRuVa8zwvVn4ZAVgE1
`latestRequest` has one in-module caller and one test. Exporting it
widened `gather`'s public surface with nothing marking it test-only, while
`decide.mjs` — the file this branch already edits — carries an
`export const _internal` for exactly that. `gather` gains the same seam.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMybaRuVa8zwvVn4ZAVgE1
Two clauses this branch's own section now got wrong. It claimed "the item
really is not blocked", which is the false assertion the message dropped —
a sibling line that resolved can be applying `blocked` in the same plan.
And the keying bullet did not say the key sorts its targets.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMybaRuVa8zwvVn4ZAVgE1
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Four findings, four commits, all adopted. Head is 8f2196e.

No merge needed: the branch already sits on main.

Gates: claude plugin validate ✓, workflow/lib 97 ✓, dispatcher 286 ✓, comment-lint clean, rule-delta 88 → 88. /security-review found nothing.

8f2196e also fixes the two docs/why.md clauses the first finding made false. The body's Contract block rendered the old message.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 21, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review October 21, 2026 18:25
@sydevs-bot
sydevs-bot requested a review from Ardnived October 21, 2026 18:25
@sydevs-bot sydevs-bot moved this from Revising to Approved in SYDevelopers Technical Roadmap Oct 26, 2026
@Ardnived
Ardnived merged commit a079c1e into main Oct 27, 2026
68 of 73 checks passed
@Ardnived
Ardnived deleted the claude/fix-198-blocked-by-names-no-issue branch October 27, 2026 00:00
@sydevs-bot sydevs-bot moved this from Approved to Done in SYDevelopers Technical Roadmap Oct 27, 2026
sydevs-bot pushed a commit that referenced this pull request Oct 27, 2026
Two conflicts, both the one this PR's body predicted, and both resolved by
keeping each side's behaviour.

dispatcher/markers.mjs — #204 lifted `parseBlockedBy`'s loop into a shared
`blockerLines` pass that `unresolvedBlockers` reads too; this branch had put
the fence rule in `liveLines`. The merged `blockerLines` iterates
`liveLines(body)`, so one line carries both: #204's single scan, and the fence
skip it inherits. A fenced `Blocked by:` line is now neither related, stripped,
nor reported as unresolved — the coherent reading of #205, since a fenced line
is documentation and #204's advisory would otherwise comment on an author's
own example.

dispatcher/apply.mjs — both sides added an import from `decide.mjs`. Both are
used: `isLogin` at the `commentOnce` author test, `isReviewer` at #212's
PR-author check.

Verified: `node --test dispatcher/test/*.test.mjs` 308 passed, lean gate
(`claude plugin validate ./workflow --strict`, `node --test
workflow/lib/*.test.mjs` 97) green from the worktree. #205's fenced-body probes
return `[]` for both readers, a live line still resolves its target, and a live
line naming a PR URL is still reported — so neither side's tests are passing by
losing the other's rule.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MdKgFW395rx3vdPocxnBNt
Ardnived pushed a commit that referenced this pull request Oct 27, 2026
* fix(dispatcher): a dispatcher-owned marker is read only from its own author

`commentOnce` deduped on the marker alone, and every key is guessable from
the item — 16 of the 18 on `main` prefix a fixed word with a head sha, a
comment id or a PR number, and two are bare words. So anyone who could
comment could pre-post `<!-- sydevs-dispatcher: <key> -->` and silence that
advisory for the item's life. `loadRecord` returned the first comment that
parsed, so a comment starting with `MARKER` seeded `current`, `pending`,
`fixCi` and `dispatches`.

Both filters are the one clause `isBot` already applies: the author must be
`identity.expectedLogin`. Neither adds a call — the listings both seams make
already carry `user.login` — so the login is threaded in, and `isLogin` holds
the compare for the two seams that have the login and not the config. The
filter lives in `loadRecord`, not `parseRecord`, which sees a body and no
author.

`isLogin` refuses an unnamed expected login, so a seam that forgets to thread
it rejects every comment rather than accepting every anonymous one.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KjgKczBxjLAu2ggz3a4uB1

* fix(dispatcher): a fenced Blocked by line is documentation, not a blocker

`parseBlockedBy` had no fence state, unlike `parseOpenQuestions`, so a body
that shows the marker format as documentation had the example read as live:
related, labelled `blocked`, then deleted by `stripBlockedBy`. Swept over
every tracked `.md`, `format-ticket/SKILL.md` was the one file that would
have related `SahajCloud#632` and lost its own example.

The flag goes into both loops. It cannot be shared: the stripper splits after
every newline so each unit keeps its own line ending, and a reader-only fix
would relate nothing while still deleting the line.

Built against `main`'s shape. #204 introduces the
shared `blockerLines` pass and is still open, so expect a conflict here if it
merges first; the fence flag moves to that pass unchanged.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KjgKczBxjLAu2ggz3a4uB1

* docs(loop): name the one-off duplicate a bot rename now causes

Only `identity.expectedLogin` is read back from a dispatcher-owned comment,
so an operator who renames the bot or migrates the PAT sees every advisory
re-post once and every status comment duplicated once. That is the accepted
cost of the author filter, and it looks like a loop fault without a row
saying so.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KjgKczBxjLAu2ggz3a4uB1

* fix(dispatcher): the journal's two owned markers are qualified too

Joined to #205 by the same root cause, found while building it. The journal
is a public issue in this repo, and both its dispatcher-owned markers read
back without an author test.

`postAnomaly` deduped on the visible line, so a hand-posted
`⚠️ **<kind>** · <text>` silences that anomaly for the day — its own doc
comment already said "said once a day, like the `commentOnce` beside it",
and the resemblance was exact. `refreshTally` counted every author's
`sydevs-dispatch-done` marker, so a stranger could inflate the day's title
and the tally block `improve-loop` reads as the loop's usage evidence.

Both take `config` already, so both call the existing `isBot`. `allComments`
stays unqualified: a session's own journal entry is a comment too, and only
these two readers act on a marker the dispatcher owns.

Three fixtures gained the author they always had in production.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KjgKczBxjLAu2ggz3a4uB1

* refactor(dispatcher): the fence rule moves under one line reader

The fence skip was a flag in each loop, so adding one to `parseBlockedBy`
left `parseRecheck` and `parseSentry` out — and a ticket fencing an example
`Re-check: 2026-12-01` would have parked itself until that date. Same root
cause as #205's part 2, joined to it.

`liveLines` drops fenced blocks once, and all four line readers go through
it; `parseOpenQuestions` loses the flag it carried. `stripBlockedBy` keeps
its own loop, because it must emit every unit it does not drop and each unit
carries its own line ending — it shares `isFence`, which is now the one
definition of a fence here. That also ends the two spellings the first pass
left: a trimmed `startsWith` in the readers, `unit.trim()` in the stripper.

No behaviour changes for `parseBlockedBy`, `stripBlockedBy` or
`parseOpenQuestions`; `parseRecheck` and `parseSentry` gain the skip.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KjgKczBxjLAu2ggz3a4uB1

* refactor(dispatcher): one config read for the login, and shorter docblocks

From the review round, no behaviour change beyond the first point.

- `apply` and `doFire` read `config.identity.expectedLogin` without the
  optional chain. With it, a config missing `identity` made `isLogin` match
  nothing and every advisory re-post on every dispatch, silently and
  forever; now it throws once. `rerun.test.mjs`'s partial config gains the
  identity it always had in production.
- The `commentOnce` and `loadRecord` docblocks carry the rule and the
  anchor, not the argument — the story belongs in `docs/why.md`.
- `act.test.mjs` shares one `exhaustedTarget` literal with the test that
  already had it, instead of a second factory beside the copies.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KjgKczBxjLAu2ggz3a4uB1

* fix(dispatcher): the journal's author test moves into its listing

`postAnomaly` and `refreshTally` were the only two callers of the journal's
private `allComments`, and both repeated the same `isBot` clause. That is the
argument this branch already makes for `liveLines`, unapplied one file along:
a third journal marker reader would have had to remember the clause.

`ownComments(gh, config, issue_number)` filters at the listing, so it cannot
be forgotten. The reason the old docblock gave for staying unqualified — a
session's own entry is a comment too — does not hold: `finish-run` posts that
entry as `identity.expectedLogin`, so the filter keeps it. The two tests that
feed each reader a comment from `Ardnived` are the regression guard, and both
still pass unchanged.

The config also carries `org` and `journalRepo`, so the two scalar parameters
go with it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVk1affeEKXcQiprsx

* fix(dispatcher): a forgotten login crashes, rather than sweeping a lease

`isLogin` returned false for a missing `expected`, so a seam that forgot to
thread the login refused every comment. That is quiet in the wrong place:
`loadRecord` then returns no record, `sweep.mjs:59` reads a lock with no
record as `sweep-timeout`, and the dispatcher breaks the lease of a live
session. `apply` re-creates the record after it, losing `fixCi` and
`dispatches`.

It throws now, so the mistake is a crash at the forgetful seam. The whole
dispatcher suite passes unchanged except the test that asserted the old
semantics, which this branch added and which now asserts the throw: no
`isBot` call site reaches the predicate without `identity.expectedLogin`,
and `apply` already throws earlier on a config that lacks it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVk1affeEKXcQiprsx

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

fix(dispatcher): refuse a Blocked by line that names no issue

2 participants