Skip to content

docs(loop): seven dangling why.md anchors, and the base-merge rule's reason - #161

Merged
Ardnived merged 3 commits into
mainfrom
claude/docs-160-why-anchors
Oct 7, 2026
Merged

Ardnived merged 3 commits into
mainfrom
claude/docs-160-why-anchors

Conversation

@sydevs-bot

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

Copy link
Copy Markdown
Contributor

Summary

  • Seven docs/why.md#<slug> citations resolved to no heading. All seven resolve now, checked repo-wide.
  • The two skills citing them stated the base-merge rule on a merge queue four of five repos have.

Change outline

Contract — every cited slug now resolves

Each (why: docs/why.md#<slug>) is a contract between a rule and its story. Seven were dangling, so
those rules had no statement anywhere but their own one-line rationale, and one rationale was false.
Nothing was broken at runtime — every affected rule survives inline as an imperative.

 docs/why.md
   # finalize-pr
+    ## Construct a number, discover a slug          ← finalize-pr/SKILL.md:215, SahajCloud previewUrl.$comment
+    ## Staleness is not yours, conflicts are        ← resolve-conflicts ×1, address-review ×1  (renamed)
   # The plugin itself
+    ## GitHub owns the merge                        ← README.md:120, decide.mjs ×2, gather.mjs:160
+    ## blocked and awaiting are exclusive           ← decide.mjs:294
+    ## A closed item is nobody's turn               ← decide.mjs:454
+    ## A proposal is reviewed before you read it    ← loop-config.json:78, decide.mjs:304
+    ## Quote the refusal, do not name a cause       ← apply.mjs:89
-    (the-queue-owns-staleness-you-own-conflicts)    ← cited 3×, never written

Two citations are not simply retargeted:

  • construct-a-number-discover-a-slug is kept byte-for-byte — SahajCloud's .claude/workflow.json → previewUrl.$comment cites it across repos.
  • the-queue-owns-staleness-you-own-conflicts is renamed. Its title names the queue as the rule's owner, which is the premise the entry has to withdraw. Two of its three citations move to the new slug; the third is dropped, below.

Behaviour — what a session decides about the base branch

The rule is unchanged. Its reason is now one that needs no per-repo knowledge, and the permitted
case is keyed on a state rather than implied by which handler you are in.

 a session holds a PR GitHub reports as behind
-  why not merge the base in?  the merge queue rebases before it lands   # true in 4 of 5 repos
-                              so being behind costs nothing             # too strong, see below
+  why not merge the base in?  the base ref belongs to a trigger, not to a session's judgement
+                              decide.mjs fires resolve-conflicts only on CONFLICTING
+                              address-review reaches a behind PR and was merging anyway

 resolve-conflicts/SKILL.md
+  lead:       merge the base in ONLY on CONFLICTING, never to freshen a behind PR
   hard rule:  never merge main in unless GitHub reports the PR conflicting   # unchanged

 address-review/SKILL.md
   never merge main in to bring the branch up to date
+  …even when a reviewer asks — a base merge belongs only to a PR GitHub reports CONFLICTING

The carve-out the ticket raises is not added. Its first open question — whether a respondTo
human's @sydevs-bot request authorises a base merge — is unanswered, and the ticket says the
carve-out becomes a behaviour change only if that answer is yes. Both skills still forbid the merge
unconditionally, and the new entry records the question as open rather than leaning either way.

Test results

  • Lean gate: ✓ claude plugin validate ./workflow --strict — validation passed
  • Every cited slug resolves: ✓ the ticket's repo-wide comm check prints nothing (7 on main)
  • Every in-file ](#anchor) link resolves: ✓ prints nothing, on the branch and on commit 1 alone
  • node --test dispatcher/test/*.test.mjs: ✓ 145 passed, 0 failed — unchanged, no dispatcher file touched
  • node workflow/lib/rule-delta.mjs --base main workflow/skills: 62 → 61 directives, 1 removal, adjudicated below
  • comment-lint.mjs --base origin/main: 0 changed code files, nothing to check
  • Security review: run — two SKILL.md paths match securityReview.triggerPattern. No findings: no frontmatter changed, allowed-tools byte-identical on both skills, and the net authority a session holds is unchanged.
  • Build: N/A — no package manager, no test suite for prose

The one removed directive

rule-delta.mjs reports - Never merge the base branch in to keep a PR fresh. Meant. It was
resolve-conflicts' lead — a bare prohibition inside the skill whose whole job is that merge. It is
now stated as the condition, and its negative half still stands unchanged in that skill's Hard
rules: "Never merge main in unless GitHub reports the PR conflicting." Net authority is identical.

Manual verification

  1. Grep the other four repos for the renamed slug: grep -rn 'the-queue-owns-staleness' . in each. This PR cannot see them (GitHub access is scoped to claude-workflow), so it cannot prove the rename broke no citation. The ticket's own research found exactly one cross-repo citation — SahajCloud's previewUrl.$comment — which is why only that slug is pinned; if another turns up, the fix is a one-line retarget there.
  2. Open each of the seven new headings from its citation and check the story matches the rule it is cited from. A story that contradicts its imperative is worse than a missing link, and "the slug resolves" does not prove it (see the dropped citation below).
  3. Decide the ticket's first open question: does a respondTo human's @sydevs-bot request authorise a base merge on a behind-but-mergeable PR? Both skills say no today.
  4. Spot-check all three SahajCloud incidents the new entries name — #769 (three conflict essays), #780 (both labels two seconds apart), #747 (a merged PR given awaiting). Every SahajCloud number in these entries is recovered from feat(loop)!: GitHub owns the merge, and five frictions it exposed #98's commit message, not read, because SahajCloud is unreadable from this repo. None of the three is verified, not just the first.

Notes for reviewer

  • The root cause, for the record. feat(loop)!: GitHub owns the merge, and five frictions it exposed #98 added all seven citations and never touched docs/why.md, though its own message says "docs/why.md also gains the stories behind the four commits on this branch." git show 138d613 --stat lists fifteen files and docs/why.md is not among them. Every story here is recovered from that commit's message and checked against the current tree.
  • A factual claim in the ticket is over-broad, and I did not carry it over. The ticket's Phase 1 says "a behind-but-mergeable PR reaches no handler except address-review." It reaches three: adversarial-review (decide.mjs:218, :248), address-review (:221) and fix-ci (:228). The true and load-bearing claim is narrower — it never reaches resolve-conflicts, and address-review was the one merging. The entry says that instead. The guard at :223 is also !pr.draft && mergeable === 'CONFLICTING', so the entry names both halves.
  • One citation is dropped rather than retargeted. resolve-conflicts/SKILL.md:42's comment-brevity rule ("a sentence, not a section") cited the dangling queue slug. The new entry tells a duplication story, not a brevity one, so pointing it there would have satisfied the ticket's check while leaving the real defect — a rule whose cited story is not its story. AGENTS.md sanctions the imperative standing alone, and it does. This is the one place the ticket's acceptance criterion is one notch too shallow, and it is worth knowing before closing on "every slug resolves".
  • A recurrence tripwire is recommended, not built. Every other prose invariant in AGENTS.md has a development-only checker behind it — rule-delta.mjs, comment-lint.mjs, comment-rule-sync.mjs, budget.mjs. "Every citation resolves" is the only one still held by memory, and memory demonstrably failed: seven at once, and the filing's own verification grep was scoped to workflow/skills and would have passed with five still dangling. A workflow/lib/why-anchors.mjs beside its siblings, taking a workspace dir so it can see the other four repos' citations, would close the class. I did not add it: it is a second behaviour, it is not in the acceptance criteria, and this repo's throttle is the person who types the verb. Say the word and it is a one-file PR.
  • Two surviving queue claims, out of scope, unfixed. finalize-pr/SKILL.md:293 ("GitHub's ruleset and queue do the rest") and cut-release/SKILL.md:105-106 ("tags only a commit on main that the merge queue ran CI on") still assume a queue. The first reads as the general arming case and is probably fine; the second describes the SahajAtlasWordpress release flow, which does have a queue, so it is likely correct as written — I could not settle it from here. Flagged because the sweep that finds them is grep -rn 'merge queue' workflow/, not this ticket's file list.
  • Three commits — two phases, each separately revertable, plus one review adoption. Commit 1 adds no link to a heading commit 2 creates:
    • 08f1b92 fix(loop): the base-merge rule rests on the trigger, not on a queue four repos have — the two slugs cited from workflow/skills/, the skill rewrites, the manifest bump.
    • ceec4b8 docs(loop): the five why.md stories #98 cited and never wrote — the five slugs outside workflow/skills/, docs/why.md only.
    • 5255dd7 fix(docs): a behind PR's cost is its preview — adopts the review's should-fix. The cost claim cited an entry that says the opposite, so the CI-run half goes and the preview carries the point alone. docs/why.md only.
      ## Phases is omitted per pr-template.md: both phases shipped in one session, so there is no unticked box for the dispatcher to continue.
  • The manifest version is bumped (2.8.0 → 2.8.1) because two skill bodies changed and the install cache is keyed on it. grep for 2.8.0 finds no second declaration.
  • Title scope. The issue title ends "and a base-merge carve-out"; no carve-out is added, so the title says what the PR does instead.
Detail

What the review passes changed. Four cleanup agents plus the security review ran over the branch.
Adopted: the over-broad handler claim above; a story/imperative contradiction I had introduced
(the entry said a reviewer wanting the base merged "makes it their call" while the skill said a
reviewer's request does not authorise it — the entry now says they can merge it themselves, that a
session still never does, and that the channel question is open); the load-bearing reason moved from
"GitHub computes the merge" to trigger ownership, because the first conflates computing a merge
commit with GitHub admitting one, which a per-repo "require branches up to date" setting decides
and nothing in the tree records; an unverifiable claim about the merge button on a behind PR,
deleted; address-review's "resolve-conflicts owns the one case that needs a base merge,"
corrected because finalize-pr/SKILL.md:299 also instructs a base merge on the same CONFLICTING
condition; the queue clause in ## GitHub owns the merge scoped to the four repos that have one,
since README.md:120 points the public at that entry; and several passages trimmed where they
restated a neighbouring entry immediately before linking it.

Rejected: a proposal to delete resolve-conflicts' opening rule outright as redundant with its Hard
rules — acceptance criterion 3 asks for the permitted case stated inline, and the lead is where a
session reads it first. Deferred to the reviewer: the tripwire, the two surviving queue claims, and
a suggestion to add a # The handlers level-1 section to docs/why.md and move three entries under
it (a reorganisation this PR should not carry).

The adversarial review's own two findings, both adopted. The should-fix is commit 5255dd7
above. The consider — three entries resting on SahajCloud incidents this repo cannot read, while
Manual verification listed one — is answered in item 4, which now names all three and says once that
every SahajCloud number here is recovered from #98's commit message rather than read.

Facts the stories are built from, each checked against the tree rather than recalled.

  • dispatcher/decide.mjs:223 fires resolve-conflicts only on !pr.draft && mergeable === 'CONFLICTING'.
  • dispatcher/decide.mjs:409 makes a bot push on pull_request.synchronize a note, and a human push removes awaiting. The re-flag cost at docs/why.md:834-836 is therefore retired, and the new entry states it as history, scoped to that handler — evaluatePr can still add awaiting on the same event by another route, so the entry does not claim no bot push ever re-adds it.
  • ci.noCi lists claude-workflow; docs/rollback/README.md:148-149 says "claude-workflow has no queue and needs nothing."
  • A conflicted PR schedules zero CI runs records that a non-Actions deploy builds the branch head, so a behind PR's cost is a stale preview. Actions CI builds the merge ref, which is why "and a CI run" no longer appears beside it.
  • issues.opened computes bornBlocked before it writes, and the blocked write removes awaiting in the same plan.
  • The unlock arm tests s.pr?.state !== 'open'; evaluatePr's own first guard at :209 returns status('done') on a closed PR.
  • dispatcher/apply.mjs:83-90 treats 403, 405 and 422 as denied — plus a message regex — and carries 220 characters of GitHub's own words.

A proposal is reviewed before you read it has no recorded incident, unlike the other six. #98
introduced it as a change the queue made possible, not as a fix. Rather than invent a failure, the
entry uses this ticket: #160 was filed naming two dangling anchors, and its revision found seven and
reported that the filing's own check searched workflow/skills only. That is on the record in the
revision comment on #160.

Placement. Each heading sits next to the entry a reader would arrive from: Construct a number
beside Link the branch alias; Staleness is not yours beside A conflicted PR schedules zero CI runs; GitHub owns the merge after Actions observes, classifies, locks, and fires; the two label
entries after awaiting has one writer; A proposal is reviewed after The critic skips small PRs;
Quote the refusal after A write we cannot make is handed over, not thrown.

One verification line in the ticket cannot pass as written. grep -n 'construct-a-number-discover-a-slug' docs/why.md prints nothing, and would for any human-readable
heading — why.md headings are prose and GitHub derives the slug. The repo-wide comm check is the
authoritative one, and it passes.

Closes #160

🤖 Generated with Claude Code

https://claude.ai/code/session_01862uUBQgqktfXgU3N92Kjq


Generated by Claude Code

claude added 2 commits October 6, 2026 20:39
…our repos have

Two of the seven dangling `docs/why.md` anchors were cited from `workflow/skills/`,
so each cited rule's only statement was its own one-line rationale. One of those
rationales was false.

`resolve-conflicts` and `address-review` both forbade merging the base branch in,
and both gave the merge queue as the whole reason: "the queue rebases before it
lands, so being behind costs nothing." The queue covers four repos. This one has
no queue and no CI at all. The rule was right and its reason was not portable.

Both now rest on ownership, which needs no per-repo knowledge: the base ref
belongs to a trigger, not to a session's judgement. `dispatcher/decide.mjs` fires
`resolve-conflicts` only on a non-draft PR GitHub reports `CONFLICTING`, and that
is the one state in which merging a base is anyone's job. `address-review` also
reaches a behind-but-mergeable PR, and it was merging anyway.

Both skills also say inline when a base merge is allowed, keyed on that state
rather than on a handler name - `finalize-pr` step 8 instructs one too, on the
same `CONFLICTING` condition. `address-review` adds that a reviewer asking in a
thread does not change it, which is what both skills already did
unconditionally. The ticket's open question about the `@sydevs-bot` channel is
recorded as open rather than decided here.

`## Staleness is not yours, conflicts are` replaces the cited
`the-queue-owns-staleness-you-own-conflicts`, because that title names the queue
as the rule's owner and the entry's own argument withdraws it. The three
citations are retargeted, except the comment-brevity rule at
`resolve-conflicts/SKILL.md:42`: that pointer was dangling on main, and the new
entry does not tell its story, so it is dropped rather than aimed somewhere it
does not belong. The imperative survives inline.

The entry keeps the recoverable cost - three conflict essays on one PR in
twenty-five minutes - and records that the `synchronize` re-flag it used to cite
is dead in `dispatcher/decide.mjs`.

`## Construct a number, discover a slug` keeps its slug exactly, because
SahajCloud's `previewUrl.$comment` cites it across repos. It sits beside its pair
and writes only the half that pair does not: why a unique key and a truncated one
fail in opposite directions. `finalize-pr/SKILL.md` keeps the mechanism, as the
sibling entry twenty lines up already says it does.

The manifest version is bumped because two skill bodies changed, and the install
cache is keyed on it (`docs/why.md#an-installed-plugin-does-not-track-main`).

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01862uUBQgqktfXgU3N92Kjq
The remaining five dangling anchors, all cited from outside
`workflow/skills/` - `README.md`, `loop-config.json` and three in
`dispatcher/`. Same defect as the two in the previous commit, one level out.

#98 is the single origin of all seven. It added every citation and never
touched `docs/why.md`, though its own message says "docs/why.md also gains
the stories behind the four commits on this branch." `git show 138d613
--stat` lists fifteen files and `docs/why.md` is not among them.

So every story here is recovered from that commit's message and checked
against the current tree, not invented:

- **GitHub owns the merge** - the dispatcher's old merge verdict failed three
  ways, each already a heading, and all three were bugs in re-deriving what
  the ruleset computes. Arming is the one write left. Scoped the queue clause
  to the four repos that have one, since `README.md:120` points the public
  at this entry and `claude-workflow` has neither queue nor CI.
- **blocked and awaiting are exclusive** - SahajCloud#780 carried both, two
  seconds apart, from one `issues.opened` plan.
- **A closed item is nobody's turn** - SahajCloud#747 merged under a held
  lock, and the unlock path's idle test inverts on a closed PR.
- **A proposal is reviewed before you read it** - the only one of the seven
  with no recorded incident. Rather than invent a failure, it uses this
  ticket: #160 was filed naming two dangling anchors and its revision found
  seven, because the filing's own check searched `workflow/skills` only.
- **Quote the refusal, do not name a cause** - the hand-over comment blamed
  the token for every refusal, and three merges failed with no usable
  explanation.

No dispatcher file is touched. The ticket expected some citations to need
retargeting into `dispatcher/` comments; all five stories turned out to be
recoverable, so the headings are written and the comments stand as they are.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01862uUBQgqktfXgU3N92Kjq
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Oct 6, 2026
@sydevs-bot

sydevs-bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 23:43Z address-review · attempt 1 · session · done
  • 23:43Z address-review · attempt 1 · session
  • 23:31Z adversarial-review · attempt 1 · session · done
  • 23:31Z adversarial-review · 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 diff is the size of its ticket and no larger. Both expansions the ticket invited — the carve-out
and a tripwire — are declined with reasons. Re-basing the rule on "the base ref belongs to a trigger"
rather than the merge queue is right, and decide.mjs:223 backs it exactly.

One story contradicts the entry it cites, the defect class this ticket is about. Every other claim I
checked against the tree held, the body's own test results included.

The cross-repo half the body says it cannot prove, I could. Read-only clones of all four product
repos: none cites the renamed slug, so the rename is safe, and the pinned slug is as described.
github-owns-the-merge is cited from all four ci.yml files and dangles on main — so this PR
repairs two cross-repo citations, not one.

Findings

  • should-fix — docs/why.md:885: "a preview and a CI run both build the branch head" is the
    opposite of what the cited entry says. Thread below.
  • consider — docs/why.md:1163: three entries rest on unreadable SahajCloud incidents; Manual
    verification lists one. Thread below.

What was checked

  • Anchors. The ticket's comm check prints nothing. Every in-file ](#anchor) resolves on the
    branch and on 08f1b92 alone, so commit 1 is independently revertable.
  • Each story against the code, not #98's commit message. decide.mjs:223, :409,
    :295-300, :455-457, :304; apply.mjs:83-90 (403/405/422 plus regex, slice(0, 220));
    mergeVerdict absent. Queue scoping matches docs/cleanup.md:67. #160's revision comment says
    what its entry claims.
  • Body claims re-run. Lean gate passes. rule-delta --base origin/main gives 62 → 61 and the one
    adjudicated removal. Against a routine clone's stale local main it invents a second pair — a
    trap for the next run, not a defect.

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


Generated by Claude Code

Comment thread docs/why.md Resolved
Comment thread docs/why.md 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 6, 2026
The cost claim in `Staleness is not yours, conflicts are` said a preview and
a CI run both build the branch head, and cited `A conflicted PR schedules
zero CI runs` for it. That entry says the opposite: it explains the zero by
there being no computable merge commit, and names non-Actions deploys as the
things that build the branch head. Actions CI builds the merge ref, so a
behind-but-mergeable PR's CI already has the base.

A story contradicting the entry it cites is the defect class this PR exists
to close, so the half that does not survive its own citation goes. The
preview carries the point alone, and the citation now supports what it is
cited for.

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

Copy link
Copy Markdown
Contributor Author

Both review findings adopted. Pushed 5255dd7.

Nothing rebutted, nothing asked.

Re-ran the gates against a freshly fetched origin/main, per the review's warning about a stale local ref: rule-delta gives 62 → 61 with the one adjudicated removal, the lean gate passes, and every in-file and repo-wide anchor resolves.

The review's four read-only product clones discharge Manual verification item 1. I left that item's wording as it is, because this run is scoped to claude-workflow and cannot re-check it.

🤖 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 6, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review October 6, 2026 23:50
@sydevs-bot
sydevs-bot requested a review from Ardnived October 6, 2026 23:50
@Ardnived
Ardnived merged commit 262fde5 into main Oct 7, 2026
37 of 39 checks passed
@Ardnived
Ardnived deleted the claude/docs-160-why-anchors branch October 7, 2026 13:13
Ardnived pushed a commit that referenced this pull request Oct 9, 2026
The version string is the installed plugin's cache directory name, so an
unchanged one keeps serving the old skills however far main has moved. It
has stood at 2.8.1 since #161 while #165 and #167 rewrote 47 files under
workflow/skills, workflow/hooks and workflow/lib — every installed copy
still runs the pre-#165 skill names.

Major, not minor: #165 is `feat(loop)!`, and it renamed or deleted nearly
every skill, so an installed copy's command names are gone. The two prior
`feat(loop)!` commits each took a major bump — #71 to 1.0.0 and #101 to
2.0.0.

Found by Friday's cut-release audit.


Claude-Session: https://claude.ai/code/session_0134LSrTLenQog7g9n7TShtV

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.

docs(loop): seven dangling why.md anchors, and a base-merge carve-out

3 participants