Skip to content

fix(loop): strip a Blocked by line once it becomes a relationship #178

Closed

Description

@sydevs-bot

Summary

The dispatcher converts a Blocked by: line into a native relationship and then leaves the line
in the body, so the body becomes a second, drifting copy of the relationship. Every later
issues.edited pass re-reads it, and a cleared blocker is re-POSTed with blocked re-applied —
the failure first seen as - ~~Blocked by: …~~ parsed as live.

Remove the line once the relationship exists. Then nothing has to be struck through, nothing is
re-read, and a reviewer who clears a blocker is not undone by the next body edit.

Approach

1. A pure strip helper in dispatcher/markers.mjs. stripBlockedBy(body, org, marker, related) returns the body with every Blocked by line removed whose in-org targets are all in
related. It lives beside parseBlockedBy (:37) because the two must match the same lines, and
it takes no network, so the tests cover it directly.

  • Work on the original lines, not the trimmed copies lines() (:15) produces, so the rest of
    the body survives byte for byte.
  • Drop the line, collapse the blank run it leaves to one, and leave the ## Notes heading even
    when it empties.

2. Strip at the write site, in apply.mjs's relationships case (:245-257). Collect the
targets that ended related — already present, or POSTed without error — then GET the issue and PUT
the stripped body. Only this case knows whether a POST succeeded, so the strip cannot move into
decide.mjs.

  • Re-read the body immediately before the PUT. Never build it from the gathered snapshot:
    issues.edited carries no lock guard (decide.mjs:534-542), so a session holding
    bot:working may have rewritten the body since gather.
  • A line naming two blockers goes only when every in-org target on it is related. One failed
    POST leaves the whole line.
  • dryRun logs the lines it would drop and writes nothing.
  • No new permission: the same client already does issues.update for a milestone (:160).

3. gather must see closed blockers too. s.blockedByOpen keeps only open ones
(gather.mjs:204), so a line whose blocker has since closed never looks related, and would be
re-POSTed and never stripped. Carry the full list as well — dependencies() (:60-67) already
returns every state — and count a closed blocker as related. Additive; nothing reading
blockedByOpen changes.

4. Keep the struck-line read, and fix its ordering. STRUCK (markers.mjs:13) is tested at
:42 against the trimmed line, while LEAD (:20) strips the bullet and the ~~ at :43, so
- ~~Blocked by: …~~ reaches the startsWith test at :44 looking live. Test STRUCK after
LEAD has removed the bullet. This matters more once the line is stripped, not less: a mis-read
struck line now creates a relationship and deletes the evidence in the same pass.

Both spellings must be skipped, and - **Blocked by sydevs/X#9.** must still read.
parseRecheck (:73) shares the same test; Re-check: is the superseded spelling of the
Hold Until field and is never written as a list item, so leave it with a one-line note rather
than changing it.

Constraint: no sender filter. The bot's own body edits must keep firing issues.edited —
that is how a line a session writes gets converted at all. The strip's own echo pass finds no
marker and ends at note('no marker change') (decide.mjs:542). One extra dispatcher pass per
strip is the accepted cost.

5. The prose that still describes the old behaviour. The relationship is the state; the line
is write-only and disappears once converted.

  • format-ticket/SKILL.md:193-224 — the Relationships section, including :212-216 on reading a
    struck line.
  • write-ticket/SKILL.md:68 — "Keep every Blocked by: line" means a line not yet converted.
  • implement-ticket/SKILL.md:41 — the body read only catches a line the dispatcher has not
    converted yet. blocked and blockedByOpen stay the gate.
  • markers.mjs:22-35 — the header comment, plus one docs/why.md anchor for the story.

Acceptance criteria

  • After the pass that creates the relationship, the converted line is gone from the body.
  • A line whose target is already related is stripped too, including when that blocker is
    closed.
  • A line is kept whenever any in-org target on it is not related after the pass.
  • The body written differs from the live body by the stripped lines alone.
  • A non-member author's own line is never converted and never stripped
    (decide.mjs:511-516, :534-540).
  • BOT_DISPATCH=dry names the lines it would strip and edits no body.
  • parseBlockedBy returns [] for a struck blocker line written as a list item, still
    returns [] for an unbulleted struck line, and still reads a live line written with a
    bullet or leading bold.
  • parseRecheck is fixed with it, or carries a one-line note saying why a list item cannot
    reach it.
  • format-ticket, write-ticket, implement-ticket and the markers.mjs header describe
    the behaviour that now holds.

Verification checklist

  • node --test dispatcher/test/*.test.mjs passes.
  • New dispatcher/test/markers.test.mjs cases: a converted line stripped, a two-target line
    kept when one target is unrelated, and - ~~Blocked by: <url>~~ → [] beside the existing
    unbulleted case.
  • A new dispatcher/test/act.test.mjs case asserting the relationships action PUTs the
    stripped body, and PUTs nothing under dryRun.
  • claude plugin validate ./workflow --strict passes.
  • node workflow/lib/rule-delta.mjs --base origin/main workflow/skills accounts for every
    directive the skill edits remove.
  • version in workflow/.claude-plugin/plugin.json patch-bumped from 3.2.1.

Notes

Reshaped on Ardnived's instruction of 2026-10-11: strip the line after conversion rather than rely
on striking it. No skill ever told a writer to strike one — the spelling appears only at
format-ticket/SKILL.md:215 — so the struck line on sydevs/SahajAtlasWeb#266 was a run
improvising a clear. Stripping makes the convention mechanical instead.

The line's — <reason> prose goes with it, and nothing reads that prose: whyBlocked names
blockers by number (decide.mjs:380). The issue's edit history keeps the words, and GitHub's
relationship panel keeps the link.

The blocked label does not depend on the line. It follows the relationship (decide.mjs:84,
gather.mjs:204, sweep.mjs:17-38), so stripping changes no gate.
(why: docs/why.md#blocked-follows-the-relationship)

apply.mjs:253 only ever POSTs, and nothing in dispatcher/ or workflow/ DELETEs a
relationship, so a wrongly created one is still cleared by hand. Out of scope here, as is the
stale relationship on sydevs/SahajAtlasWeb#266.

Distinct from #3, which waits on the dependency MCP tools so a session
can read relationships. This is the dispatcher's write side. The two meet at one point: once the
line is gone, a session loses its only in-body sight of a blocker, which is the gap #3 closes.
Until then, blocked and the dispatcher's own pre-fire check are the guard.

A SKILL.md edit rides along, so version needs the patch bump cut-release/SKILL.md:31-32
requires.

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

Activity

  1. added theissue type on Oct 11, 2026
  2. added
    proposal
    on Oct 11, 2026
  3. moved this from Revising to Proposed in SYDevelopers Technical Roadmapon Oct 11, 2026
  4. Ardnived commented on Oct 11, 2026

    @Ardnived
    Contributor

    @sydevs-bot revise this to simply remove the "Blocked by" line after it's been converted to a github relationship

  5. removed
    proposal
    on Oct 11, 2026
  6. sydevs-bot commented on Oct 11, 2026

    @sydevs-bot
    ContributorAuthor

    🤖 no session running

    recent dispatches
    • 19:28Z revise · attempt 1 · session · done
    • 19:28Z revise · attempt 1 · session

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

  7. added
    bot:working
    on Oct 11, 2026
  8. changed the title [-]fix(loop): a struck-through `Blocked by` line written as a list item is still read as a live blocker[/-] [+]fix(loop): strip a Blocked by line once it becomes a relationship[/+] on Oct 11, 2026
  9. sydevs-bot commented on Oct 11, 2026

    @sydevs-bot
    ContributorAuthor

    Reshaped: the dispatcher strips the Blocked by line once the relationship exists, instead of relying on a struck line being read as cleared. Retitled to fix(loop): strip a Blocked by line once it becomes a relationship — type stays Bug, Priority High.

    Three things the code forced into the approach:

    • The strip goes in apply.mjs's relationships case. Only it knows whether a POST succeeded.
    • It must re-read the body before writing. issues.edited carries no lock guard, so a session may have rewritten the body since gather.
    • gather keeps only open blockers, so a line whose blocker has closed never looks related. The full list has to be carried.

    The struck-line ordering fix stays, now as a guard: a mis-read struck line would create a relationship and delete the evidence in one pass.

    @sydevs-bot implement starts it.

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


    Generated by Claude Code

  10. added and removed
    bot:working
    on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    High

    Hold Until

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions