Repository navigation
refactor(dispatcher): hold approval accounting in its own module - #295
Conversation
Ten functions answered a different question each about who has approved what, scattered through decide.mjs's 86KB alongside every other plan. A rule change moves them together, so they now sit together in dispatcher/approvals.mjs: proxyApproves, stalePlan, standingApprovals, buriedApprovals, botArmedOwnerPr, contractSyncPlan, proxyPlan, proxyVerdict, armedByAuthor and vouched, moved verbatim. Only six cross a module boundary, so the rest are private: the new module exports proxyApproves, proxyVerdict, stalePlan, botArmedOwnerPr, contractSyncPlan and proxyPlan, and nothing else. The cycle is settled before the move, not around it. decide.mjs imports approvals.mjs, and the moved functions call back for the action constructors, the login predicates, nowOf, isQuestion and threadsWaiting. Those are now dispatcher/plan.mjs, which imports nothing and both import — one direction, nothing undefined at module scope. Passing them as arguments would have grown every call site and hidden the dependency in a signature. Each importer now names the real home: status.mjs and gather.mjs read proxyApproves and proxyVerdict from approvals.mjs, and apply, deps, gather, journal, reconcile, record, resolve, status and sweep read their predicates from plan.mjs rather than through decide.mjs. No re-export pass-through is left behind. decide.mjs falls from 86KB to 69KB. No behaviour changes: the only test edit is relay.test.mjs's import line, and the suite is 398 tests before and after. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVMENvk6vPDtXTTWcj
The move put the action constructors and the login predicates in one
`plan.mjs`, on the rule "whatever `decide.mjs` and `approvals.mjs` both
need". That rule described 8 of the file's 37 exports, so it could not
have decided where the next shared helper went, and the file would have
drifted into a grab-bag.
Two audiences, two modules, each with one charter:
actions.mjs every action a plan is made of, constructed nowhere
else. Two importers: decide.mjs and approvals.mjs.
predicates.mjs the predicates a login, a config or a snapshot is read
with. Most of dispatcher/ imports it.
Both still import nothing, so the cycle stays settled either way.
It also fixes the name. "Plan" is this repo's word for what `decide`
returns, and every function that builds one is named `*Plan` and lives
elsewhere, so `plan.mjs` was the one file in the directory with no plan
in it.
Two leftovers of the move go with it: `decide.mjs` kept an import of
`dispatcherMark` that `vouched` had been its only consumer of, and the
`// ---- issue verbs ----` header lost the blank line above it when the
approval block was cut out. Four comments that pointed at functions by
bare name now name the module they moved to.
398 tests pass, unchanged.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjVMENvk6vPDtXTTWcj
`pushRoute` and `relayRefusal` took `fullTreatment` as a trailing parameter for one reason: `relay.mjs` could not import it from `decide.mjs` without a cycle, and `decide.mjs` is where it lived. It lives in `predicates.mjs` now, which imports nothing, so the injection has nothing left to dodge. Taking it as an argument is the alternative this ticket's approach rejected, and it was still standing in the one place the cycle had forced it. Two production call sites and twelve assertions drop their last argument, and the test stops importing a predicate only to hand it straight back. Behaviour is unchanged: every caller passed the same `fullTreatment`. A different one would have silently changed who gets the loop, with nothing in `relay.mjs` to catch it. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVMENvk6vPDtXTTWcj
The move made three one-liners importable, and three callers were still spelling them out. - `lower` had three definitions: `predicates.mjs` plus private copies in `deps.mjs` and `apply.mjs`, both of which now import from `predicates.mjs` already. The `apply.mjs` one was rebuilt on every `reviewerFor` call. - `deriveStatus` spelled the snapshot clock inline as `s.now || new Date()`, which is `nowOf`. Two spellings meant a change to how `s.now` is honoured had to find both. - `standingApprovals` named the state-bearing review states and said "what GitHub counts". `merge-gate.mjs` owns that rule as `STATE_BEARING`, and its `reviewDecisionFrom` comment says in so many words that other files should cite it rather than restate it. It now does. The set itself is left where it is: merge-gate's version allowlists authorised logins and returns a decision string, not the review objects `buriedApprovals` needs. Every body is identical to the copy it replaces, so behaviour is unchanged. 398 tests pass. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVMENvk6vPDtXTTWcj
`proxyApprove`'s rules moved to `dispatcher/approvals.mjs` with the rest of the approval accounting, so the `$comment`'s pointer was half wrong. `loopMayNotMerge` is still `decide.mjs`'s, and the line now says which is which. The pointer is the whole job of a `$comment` under this repo's three-homes rule, so a stale one costs the reader the only navigation aid the config offers. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVMENvk6vPDtXTTWcj
Two claims in the new headers were wrong as written. `predicates.mjs` said nine modules ask it; twelve import it. The count was the only support for the layering claim, so it now says "most of the directory" rather than a number that drifts. `approvals.mjs` said `decide.mjs` imports these, which reads as the whole dependency list and would license an import back into `status.mjs` — the one edit that would give the directory its first cycle. It now names `status.mjs` and `gather.mjs` too, and says the edge may not be reversed. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVMENvk6vPDtXTTWcj
The header said `status.mjs` and `gather.mjs` read "the two that only read", which reads as both reading both. `gather.mjs` takes only `proxyApproves`. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVMENvk6vPDtXTTWcj
sydevs-bot
left a comment
There was a problem hiding this comment.
2 question(s) for the reviewer, one per thread.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The move is what the ticket asked for, and its evidence holds: nine of the ten functions are byte-identical to main, and decide.mjs drops to 70853 bytes. Splitting the shared vocabulary in two, where the ticket said one, is the right deviation.
Membership is what is unsettled, on both sides of each new owner. actions.mjs says it is the only place an action is constructed while four types are still built inline in decide.mjs, and predicates.mjs holds two symbols its own stated rule does not cover. One question about the approach, not four about pieces.
Findings
- should-fix
actions.mjs:2— claims sole ownership;ensure,retry,timeout,unlockedare built inline at nine sites indecide.mjs. - should-fix
approvals.mjs:51— citesmerge-gate.mjs'sSTATE_BEARING, private there, while line 55 retypes its list. - should-fix
predicates.mjs:32(Streamline) —hasAccessandisReviewerhave one reader each. - should-fix
approvals.mjs:12(Streamline) — the header's inventory restates the imports below it.
Second opinion on both question threads: B — neither is what was built, so both stay open.
What was checked
The ticket's five acceptance criteria re-derived, the cycle by walking imports in all 20 dispatcher/*.mjs. The ten functions extracted from origin/main by brace match and diffed: nine identical, standingApprovals' comment reworded — which the body calls identical. Cancelling removals against additions leaves 43 lines: imports, signatures, headers, comments. The three new modules read whole; apply.mjs's case arms compared against actions.mjs's types. workflow/ untouched, so version correctly stays. Streamliner: 53 pieces, 50 kept, 5 findings, all held — 3 posted, 2 in the open threads. Profile read; CI green on arrival, not re-run.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`actions.mjs`'s header claims to be the only place an action is constructed, and four types were still built as literals at nine sites in `decide.mjs`: `ensure` ×4, `timeout` ×3, `retry` and `unlocked`. An owner that leaves four members outside is worse than no owner: a reader who trusts the header stops looking, and the next `ensure` gets spelled a tenth time. The alternative was narrowing the header to the members it had, which keeps the drift and only stops advertising it. `unlocked` keeps its `handler` field. `apply.mjs` does not read it, but the dry-run plan log prints it, and dropping it would change that output. Behaviour-identical: each constructor returns the literal it replaced. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWk74XVfXZFabcixV2
`standingApprovals` pointed at `merge-gate.mjs`'s `STATE_BEARING` and then retyped its three states. The pointer did not resolve — the set was private there — so the comment named an authority a reader could not reach, and nothing would have caught the two lists drifting apart. `merge-gate.mjs` now exports the set and `approvals.mjs` imports it. `gather.mjs` already imports that module, so the edge is not new, and it fetches nothing, so `approvals.mjs` stays pure. This also settles the one place the move was not verbatim: the reworded comment the review flagged is now the whole of that function's difference from `main`. `version` bumps to 5.9.1 because `workflow/lib/**` changed: an installed plugin's cache is keyed by it. (why: 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_01Mg9rjWk74XVfXZFabcixV2
`predicates.mjs`'s rule is "what the cycle forced out", and neither of these was. Each has one reader. `hasAccess` and its `ACCESS` set go back to `decide.mjs`, byte-identical to `main`, beside the only function that calls them. They were an unimported export there too, so the dead-export question stays the one the open thread asks, not one this commit answers. `isReviewer` is inlined at its only call site, `apply.mjs`'s `reviewerFor`, which already imported `lower`. Moving it to `decide.mjs` instead would have put back the `apply.mjs -> decide.mjs` edge this branch removed. Equivalent at the call site: the inline drops an optional chain on `config.assignment`, and the next line already dereferences it, so both spellings throw on the same absent config. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWk74XVfXZFabcixV2
Four lines listed who imports `proxyApproves` and `proxyVerdict`, and that the actions are `actions.mjs` and the predicates `predicates.mjs`. The import lines immediately below say the second half, and a grep says the first, so prose that restates a source above it goes (`docs/documentation.md`). What a reader cannot see stays: the edge back into `decide.mjs` or `status.mjs` is the one this directory must not grow, and nothing here fetches. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWk74XVfXZFabcixV2
|
Four findings adopted, one commit each, on a clean merge of
Nothing rebutted. Both question threads stay open — a second opinion is not your answer. 399 dispatcher and 156 lib tests pass. A differential harness against 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Conflict: workflow/.claude-plugin/plugin.json version. main bumped 5.9.0 -> 5.10.0 for #294's new capability; this branch had bumped 5.9.0 -> 5.9.1 for its merge-gate.mjs export. Resolved to 5.10.1 — main's minor stands, and this branch's workflow/lib change still carries a bump above it, so the plugin cache key moves for both. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWpqKoZPiBkxF32cJB
Both were dead on main, and the move into actions.mjs surfaced them. The reviewer chose B on the thread that asked. archiveCurrent is constructed by no plan, so apply.mjs's arm for it was unreachable rather than latent: plans are built per event and never replayed. Its arm goes with it. decide.mjs's _internal seam has no importer — decide.test.mjs imports gather.mjs's — and a test seam nobody tests through only tells a reader the wrong thing about what is covered. Git history keeps archiveCurrent's behaviour if someone wires the capability up. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWpqKoZPiBkxF32cJB
The reviewer chose B on the membership thread: predicates.mjs holds the whole small, pure family, not only the members the cycle forced out. A rule drawn where a cycle happened to fall cannot place the next helper — the same objection this branch already used to split actions.mjs off. stackedPr and isRoadmap move to predicates.mjs. loopMayNotMerge goes to approvals.mjs instead, as the reviewer's thread asked: it is merge policy, so mergePolicy's $comment in loop-config.json now names one file. needsAddressReview stays in decide.mjs — its dependency tail is decide.mjs's own. status.mjs reads each from its new home, so decide.mjs is down to one export it asks for. Both module headers now state the membership rule they apply. 399 dispatcher tests pass, no cycle in the 22 modules. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjWpqKoZPiBkxF32cJB
|
Both answers built, one commit each, on a base merge that had one conflict.
Your three requirements are now criteria on #291. Nothing rebutted. Both threads resolved, and none is open. 399 dispatcher and 156 lib tests pass, no cycle in the 22 modules. 48,988 differential comparisons against 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
Conflict: workflow/.claude-plugin/plugin.json version. main bumped 5.10.0 -> 5.11.0 for #302's new workflow/lib/contract-paths.mjs; this branch stood at 5.10.1 for its merge-gate.mjs export. Resolved to 5.11.1 — main's minor stands, and this branch's workflow/lib change still carries a bump above it, so the plugin cache key moves for both. Nothing else conflicted, and nothing incoming touches the moved modules: #302 and #297 changed only workflow/lib, the audit-contracts skill, docs/why.md, loop-config.json's WeMeditateWeb contract paths, and two dispatcher tests that import gather.mjs and fire.mjs, neither of which this branch moved a symbol out of. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjVAr3C2hHbsKE6d9bg
|
Merged Nothing incoming touches the moved modules. Lean gate passes, 161 lib tests and 399 dispatcher tests pass, 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
main reached 5.11.1 through #295 while this branch was at 5.11.2, so `workflow/.claude-plugin/plugin.json` was the one conflicted file and the version line the one conflicted hunk. Kept 5.11.2. It is strictly above main's 5.11.1, so merging this PR still moves the string an installed plugin's cache is keyed by (docs/why.md#an-installed-plugin-does-not-track-main). Taking main's 5.11.1 would have left this branch's skill change arriving under a version already published, which is the one thing that keeps a cached plugin on the old prose. Nothing else overlapped: this branch touches docs/why.md and workflow/skills/start-run/SKILL.md, and #295 touches dispatcher/, loop-config.json and workflow/lib/merge-gate.mjs. Lean gate green after the merge: `claude plugin validate ./workflow --strict` passes and `node --test workflow/lib/*.test.mjs` is 161/161, run from this .claude/worktrees worktree. The dispatcher suite that owns the merged code is 399/399, and both JSON manifests parse. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjYqS6P2jFN36nkXuEY
#295 moved the login predicates out of decide.mjs into predicates.mjs and approvals.mjs; this branch rewrote them in place. Both sides are kept: the new module layout, with this branch's behaviour inside it. - predicates.mjs takes isLogin's list form, restLogin and dispatcherLogins, and isBot reads the list. decide.mjs keeps main's deletion. Putting them back in decide.mjs would have re-added the apply -> decide and reconcile -> decide edges #295 removed, and predicates.mjs imports nothing, so nothing new is reachable from it. - apply, deps, gather, reconcile and sweep import each name from its new home. apply.mjs keeps main's inlined isReviewer and its imported lower; deps.mjs keeps both sides' imports. - contracts.mjs and test/record.test.mjs were not textual conflicts: this branch added import lines naming decide.mjs, which still parsed and still resolved to a module that no longer exports those names. Both now name predicates.mjs. - version goes to 5.11.2. Both sides bumped to 5.11.1 independently, and #295 merged first, so this branch's workflow/lib/payload.mjs change would have shipped under a cache key an installed plugin already holds. (why: docs/why.md#an-installed-plugin-does-not-track-main) Lean gate green (plugin validate, 162 lib tests), 425 dispatcher tests, and the root marketplace manifest validates. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Mg9rjZehhisSFVGHJpSzTf
Summary
dispatcher/approvals.mjs— ten functions moved verbatim out ofdecide.mjs, which falls from 86KB to 69KB.actions.mjsandpredicates.mjs, which import nothing.relay.mjstookfullTreatmentas a parameter only because it could not import it without a cycle — the alternative this ticket's approach rejected, still standing in the one place the cycle had forced it. It imports it now.lower×2,nowOf) were still being spelled out by their callers.actions.mjsconstructs all four actions it had left inline,predicates.mjsgives back the two symbols its rule did not cover, andstandingApprovalsimports the review states it had retyped.predicates.mjsholds the whole small, pure predicate family rather than only what the cycle forced out, sostackedPrandisRoadmapjoin it andloopMayNotMergegoes toapprovals.mjs, wheremergePolicy's other half already is. The two dead exports the move surfaced —actions.mjs'sarchiveCurrentanddecide.mjs's_internal— are deleted.Change outline
A responsibility moved out of the file that held every plan, and the vocabulary it shares with that file moved below both.
Files
actions.mjsandpredicates.mjsare one module split in two, not two ideas. One file would have held both, on the rule "whateverdecide.mjsandapprovals.mjsboth need" — a rule that described 8 of its 37 exports, so it could not have decided where the next shared helper went. The two audiences are disjoint:decide.mjsandapprovals.mjsare the only readers of the action vocabulary, while most ofdispatcher/asks the predicates.Flow — the import graph
Everything shared sits below both deciders, so nothing resolves at module scope.
The rejected alternative is the ticket's: pass the action constructors and predicates into each moved function as arguments. It needs no new file, and it grows every call site and hides each dependency in a signature.
relay.mjswas the live example of that cost, which is why its injection went with the move.Behaviour — what moved, and what it exports
Nine of the ten had no importer outside
decide.mjs, so only six are exported.Each importer now names the real home, with no re-export pass-through left in
decide.mjs. Nine modules read their predicates frompredicates.mjsrather than throughdecide.mjs, which also removes theapply.mjs -> decide.mjsedge.status.mjsnow asksdecide.mjsfor one export,needsAddressReview.Membership is what the review, and then the reviewer, moved. Each module now matches its header:
The rule each new module applies is in its header, so the next helper has somewhere to go.
needsAddressReviewstayed behind because its dependency tail isdecide.mjs's own, and merge policy sits with the approvals it overrides.Test results
claude plugin validate ./workflow --strictpasses;node --test workflow/lib/*.test.mjs156 passed. Run from the checkout and again from a.claude/worktrees/worktree, asimplement-ticketdoes.node --test dispatcher/test/*.test.mjs399 passed — the same count asorigin/main, which is the ticket's evidence that no rule was lost.node -e "import('./dispatcher/index.mjs')…"printsok. A walk of everyimportin all 22dispatcher/*.mjsfinds no cycle anywhere in the directory.comment-lint.mjs --base origin/main: no banned comment added.origin/mainmerged in twice: at9582d43, clean, and ated20ab1, one conflict. Both sides had bumpedversionoff5.9.0—mainto5.10.0for feat(finalize-pr): let a session open its PR through finalize-pr #294, this branch to5.9.1for itsmerge-gate.mjsexport. Resolved to5.10.1, so the plugin cache key moves for both changes.securityReview.triggerPatternboth rounds. No findings either time. The second pass checked that every non-comment, non-import line of the three new modules occurs verbatim inorigin/main:dispatcher/decide.mjs— the only exceptions arestandingApprovals'sSTATE_BEARING.hasand the four new constructors — that nothing mutates the now-exportedSTATE_BEARINGSet, and thatapply.mjs'sdefaultarm only logs, so deleting thearchiveCurrentarm opens no fail-open path. The first pass added 42,000 comparisons onevaluatePr,decide,deriveStatus,hasAccessandreviewerFor, with 0 mismatches.Manual verification
Evidence that the move is verbatim and behaviour-identical
Textual. Sorting the whole diff's removals and additions and cancelling them leaves only import lines, the three new module headers, and the declarations that gained
export. Each of the ten functions was also extracted fromgit show origin/main:dispatcher/decide.mjsby brace-matching and compared with its new home:proxyApproves,buriedApprovals,proxyVerdict,armedByAuthor,vouched,HOLD_KEYandARMED_HOLD_KEYare identical;stalePlan,botArmedOwnerPr,contractSyncPlanandproxyPlandiffer only by a leadingexport.standingApprovalsis the one exception, and deliberately so after the review: its three retyped states are nowmerge-gate.mjs's exportedSTATE_BEARING.hasAccessand itsACCESSset are byte-identical tomainindecide.mjs, where they started. This round's three moves were checked the same way:stackedPrandisRoadmapinpredicates.mjs, andloopMayNotMergeinapprovals.mjs, are byte-identical tomain.Behavioural. Re-measured at
2bd4085, after your two answers. A harness importedorigin/main's tree (git worktree add) and this branch's side by side and deep-compareddecide,evaluatePrandderiveStatus, plusapply.mjs'sreviewerFor, on the same snapshots, varying the fields an outsider controls: PR author, head author (including thenullfail-closed case),headCommittedAtabsent,autoMergeArmed/autoMergeBy/draft, twelve review sets with forged logins, a lower-caseapprovedstate, anullreviewer login and stalecommit_ids,prCommitswithnullauthors and off-PR second parents, comment bodies carrying@sydevs-botverbs from eight logins at eleven author associations, waiting question threads, and every record shape a lease can be in.decide: 32 event reasons × 12 records × lock × CI, on a PR and an issuehasAccess: 11 author associations × 8 logins × 6 comment bodiesreviewerFor, exhaustive over the logins and their casingsCoverage was measured rather than assumed. Across 25,460 comparisons the runs emitted
proxyApprove1,584 times,dismissProxy216,dismissStale1,248,disarmAutoMerge1,440, and each of the four newly-constructed actions:ensure690,timeout168,unlocked102,retry12. 622 comparisons threw, identically on both sides — the invalid-config combinations.reviewerForreturned both the configured reviewer and the fallback human.This round's two commits got their own pass, over the axes the three moved predicates read: the repo name, so
loopMayNotMergeanswers both ways; four base refs, sostackedPrsees stacked, unstacked and anulldefaultBranch; and fiveitem.typevalues including a lower-caseroadmap, soisRoadmapsees a near miss.evaluatePr+deriveStatus: 3 repos × 4 bases × 3 CI × 6 review sets × 4 thread sets × 3 PR authors × draft × armeddecide: 17 event reasons × 11 records × lock, on a PR across 3 repos × 2 bases, and on an issue across 5 item types × 4 comment setsisRoadmap's own axis, through every arm that reads itThe arming path is where
decide.mjsreadsloopMayNotMergeandstackedPrtogether, so it was reached deliberately rather than hoped for: it emittedarmAutoMerge324 times andmarkReady486.archiveCurrentwas emitted 0 times in 38,620 plans derived fromorigin/main's own code, which is what makes its deletion unreachable code rather than a removed capability.One input diverges, named here because the harness cannot see it: with
config.assignmentabsent,apply.mjs'sreviewerForthrows onassignment.reviewerwhere it used to throw onassignment.respondTo. Both throw; the config cannot occur.Scope. No file outside
dispatcher/imports any moved name, and.github/workflows/dispatcher.ymlonly ever importsdispatcher/index.mjs, which is unchanged. One file underworkflow/changed —merge-gate.mjsgained anexportkeyword and nothing else — soversioncarries the patch bumpcut-releaseasks for aworkflow/lib/**change — now5.10.1, overmain's5.10.0. No skill changed, sorule-delta.mjsdoes not apply.Notes for reviewer
decide.mjsis 69KB — still the directory's outlier, about twiceapply.mjs, and still holding four concerns behind section rules it draws itself. This ticket moved one of them. Cutting the rest (the issue verbs are a self-contained ~200 lines) is a separate PR, and worth its own ticket if you want it.predicates.mjs's membership is settled, and both question threads are closed. You chose B on each. The rule is now the whole small, pure family, which is a rule that can place the next helper — "what the cycle forced out" could not, ashasAccessshowed.stackedPrandisRoadmapare in, andloopMayNotMergeis inapprovals.mjs, where you asked for it.needsAddressReviewis the one left behind: moving its dependency tail would dwarf this PR.status.mjsandgather.mjsstill import three modules each, which B does not change and I said it would not.contractSyncPlantocontracts.mjs, which already owns that concern. The ticket namesapprovals.mjsfor it, andcontracts.mjsfetches whileapprovals.mjsis pure and only emits plan actions — folding a pure decider into a fetching module cuts against this repo's rule that a script decides and never fetches. Happy to move it if you disagree.isDispatcherCommentis the single symbol keepinggather.mjsdependent ondecide.mjs, and it is a two-line test for markersmarkers.mjsalready owns. Moving it there would drop that edge entirely. Out of this ticket's scope, and a clean follow-up.loop-config.json'smergePolicy$commentnamed two files after the move; withloopMayNotMergeinapprovals.mjsit names one, which is what your thread asked for.docs/why.mdnames these functions without naming their file, and its twodispatcher/decide.mjsreferences point atpendingReviewVerbandconflictPlan, which stayed.decideandevaluatePr, and the harness above covers every commit, this round's two included.fix(dispatcher):commits after the first base merge are the review round, one per finding. The two after the second are your two answers, one each. All six are separately revertable.archiveCurrentis the one deletion worth a second look, because it removes a capability rather than dead weight:apply.mjs's arm archived a session whose end was never seen. It was unreachable, not latent — the harness above derived 38,620 plans onorigin/main's code and emitted the action 0 times — andgit revertbrings both halves back together. You chose B knowing that.Closes #291