Repository navigation
feat(loop): findings join the work in flight, PR questions are threads with options, and ~40 rule conflicts resolved - #189
Merged
Merged
Conversation
…th options A decision a branch could not settle had no home. The docs route said "## Open questions in the PR body", which pr-template forbade, and a body section is read once and blocks nothing. implement-ticket commented a question and stopped the whole build for a decision only part of it turned on. - finalize-pr step 7c: each decision is an inline thread on the line it lands on, posted as one COMMENT review, shaped as format-ticket's options (what each implies, recommendation first and already built). The root carries review.questionMarker, so the dispatcher reads it as the person's turn rather than an unanswered critic finding. - format-ticket: the options shape is the one shape for every question the loop asks a person, tickets, PR threads and address-review asks. - address-review: an answer in a question thread is built and resolved; an ask is shaped as options; a review-body ask becomes a question thread, the one thread it may start. - review-pr: question threads are exempt from its exclusive channel. - implement-ticket: a decision only part of the work turns on no longer stops the build, and the escalated case names where awaiting lands. Review state cannot separate questions from critic findings: GitHub refuses REQUEST_CHANGES on the author's own PR, so both are COMMENT reviews by the bot. The marker does it. The dispatcher half lands in its own commit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The incidental-finding table told a run to fold a finding into its PR only when it was "part of" the ticket, and "Never widen a PR" otherwise. Runs read that as "listed in the ticket". SahajCloud#920 (same root cause as #899) and #939 (same files, same verification, and a disproved premise of #938) both became tickets instead of commits. review-pr flagged unlisted work as scope creep, and address-review filed a ticket for anything that "generalises" — against the reviewer's habit of asking for a fix to be applied across the system. Rather than layer a PR rule over the ticket rule, format-ticket's join rule now decides membership for both, gaining two joins (same root cause, a disproved premise) and a paragraph saying it binds work in flight. The docs-only "same subject or stale premise" clauses in start-run, implement-ticket, review-pr and address-review collapse into it. A joined change gets a Summary bullet; its decision is a question thread. pr-template's "known follow-up" must link where it was routed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ts the loop SahajAtlasWeb#285 and #286 changed only specs, test helpers and test config, yet became tickets: the only ticketless routes were docs-only and prAllowlistGlobs. A change that cannot alter what ships needs a review, not an approval plus a session. - start-run: the docs-only row also takes test-only fixes. Tests never batch into an open test PR: each is its own claude/test-* PR unless the join rule sends it to the work in flight. No product code, never both kinds in one PR. - findings.testGlobs in loop-config, and workflow/lib/test-only.mjs to prove a branch stays inside it (with tests over the four repos' real layouts; seen red with a glob removed). - write-ticket, format-ticket, file-ticket, revise-roadmap, audit-code, README and AGENTS.md follow. write-ticket's guard test for a docs drift is now a test-only PR rather than a ticket. - Neither route may touch claude-workflow's workflow/** or loop-config.json: there the docs are the behaviour, and a drive-by PR would skip the version bump, rule-delta and improve-loop's bar. Those findings go to Friction. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…vives filing Four places contradicted "write-ticket only" or let its new home search undo a plan: - A roadmap child is approved by its goal's implement, not a verb of its own, so a blocked child passed the home test and could absorb scope nobody approved. A child is never a home now. - implement-roadmap files each child in parallel through write-ticket create, whose home search could fold sibling B into sibling A, or a child into another goal's ticket. A caller passing a parent and siblings skips the search. - implement-roadmap's replan and adoption told write-ticket to update a ticket, but callers only had create, which stops at the duplicate. A new update mode runs revise's deep pass on the caller's intent. - improve-loop filed structural proposals outside write-ticket and ran file-ticket's interactive Ask with nobody present; settle-roadmap hand-edited children instead of requesting a replan. Both now go through the sanctioned path, and format-ticket lists every goal author. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d over Each pair below told a run two different things, with no precedence: - A docs defect where the code may be wrong was a Bug in start-run and a Task in audit-contracts. format-ticket owns it: known-wrong doc is a Bug, an open which-side question is a Task. - format-ticket said Phases live in the ticket "and nowhere else"; implement-ticket planned its own in the PR body. The build now copies the ticket's phases and changes only what the code disproves. - Audits attached proposals to goals, and a planned goal's implement approves every open child, so a proposal was approved unseen. Attach only to a goal with no children yet. - The split rule said both "cross-repo is always split" and "never split coupled work", and a Bug "is always direct". The cross-repo split wins; a cross-repo Bug is sibling direct Bugs. - The audits may not file a goal, but classify sent roadmap-sized work there. They file it direct and flag it for Promote. - implement-roadmap turned any unsettled fact into a question; it may now experiment without pushing, and asks only for a person's access. - file-ticket hard-coded Priority Medium, and gated the hand-over on `reviewer` where every other skill gates authority on respondTo. - "MCP everywhere" is scoped to handlers; the two attended skills' gh use is named. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The "never write these markers" rule had about a dozen copies, each a different subset: start-run's (read on every dispatch) had no Status and no proposal, implement-ticket's no stuck, and fix-ci and resolve-conflicts read "never touch a label other than the lock, the draft flag, or an assignee" — which parses as permission for the last two. format-ticket's "never write bot:working" forbade the lock release finish-run must do. start-run now holds the one list, names finish-run's lock release as the exception, and says fields, body markers and milestones are not state. Every handler copy cites it. The two attended local skills keep their own one-liners, since they never load start-run. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The ceilings read three ways: audit-sentry's "over the ceiling, file nothing" (all-or-nothing), audit-code's "fewer, better findings win" (best N), and run-audit's single pre-filing check that a batch could cross. The config comment said the dispatcher enforces them; it never reads them. run-audit now states one rule — at most maxProposalsPerSurvey, best first, stopping at maxOpenProposals — and the audits cite it. No value changes, so this is not a ceiling change in AGENTS.md's sense. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t is set start-run says CLAUDE_PLUGIN_ROOT is set only for an installed plugin, and a routine reads the skills from the claude-workflow checkout. Yet finalize-pr (comment-lint, branch-preview-url), address-review (merge-verdict), dev-server and settle-roadmap ran scripts through the bare variable. In a routine that expands to /lib/... and fails. The worst case was silent: branch-preview-url's non-zero exit reads as "no alias yet", so a Cloudflare PR's body said "preview pending" for good. Every path now falls back to <claude-workflow>/workflow, and AGENTS.md prescribes that form. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The timeout path removes the lock and re-fires the handler, which adds the same label back. A lingering session's lock re-check found the label and kept pushing onto attempt 2's branch, then finish-run stripped attempt 2's lock. The re-check now reads the label and the record's deadline; finish-run leaves the lock alone once the deadline has passed. The rule also said "every handler" while cron, repo and local runs hold no lock, so read literally it stopped them at their first push. It now applies where the run holds a lock. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- review-pr said "the preview has built by the time you run" and made a no-data link a should-fix. The critic fires on required checks, which exclude the preview deploy, and finalize-pr explicitly allows a link with a line saying why (every SahajCloud PR carries "cannot seed"). Each such PR got a should-fix no address-review round could fix. - review-pr and implement-ticket deferred test coverage to the toolkit's pr-test-analyzer, which finalize-pr says no routine has. implement- ticket now owns the check; review-pr names the pass that actually ran. - review-pr's "naming taste is not yours" contradicted its own reviewer profile, which flags a misleading name. The ban is now spelling and casing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ack on a real base - address-review answered any newest respondTo comment, though the dispatcher deliberately ignores an unmentioned one on a bot PR. A run fired for a thread also replied to "thanks". It now needs the mention. - finalize-pr re-derived a refreshed body from the diff; address-review re-sent the read body with a delta. Neither said which wins, and the re-derive could wipe Phases ticks and preview lines. pr-template's new Refresh section is the one rule both cite. - address-review asked finalize-pr for a stacked PR with base:<their branch>, but finalize-pr took no arguments and hard-coded main in every diff, the comment-lint call and create_pull_request. It now takes a base, defaulting to the default branch. - address-review skipped finalize-pr's security review although a reviewer's ask can widen allowed-tools; it now runs step 3 when the trigger pattern matches. finalize-pr's description named "reflect" and claimed to be address-review's whole final step. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- start-run treated gh and curl as absent everywhere, while review-pr allows gh locally and fix-ci's deploy mode curls Railway. Scoped to GitHub, in a routine. - start-run put the marker on "every comment"; budget.mjs exempts the journal entry by design. It now names writing.markerRequired. The critic's inline findings had no budget kind; they use reviewReply. - finalize-pr told a local run to mark its PR ready "when CI is green", which is both a wait and a draft-flag write. It now tells the person. - fix-ci and resolve-conflicts cited implement-ticket step 6 for checking out the PR's branch; that step creates a new branch off the default. - audit-deps' vulnerability job is a dispatched handler but never named start-run or finish-run. - settle-roadmap searched the whole org, which run-audit and improve-loop forbid because it reaches retired repositories. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- AGENTS.md: the routines table, loop-config key list and lib list caught up with what exists. README's per-repo key list gains previewUrl, worktreeNotes and deployTarget. - loop-config: the assignment $comment described the retired assignee worklist; the handlers $comment missed audit-nightly's own routine. - why.md: "the merge gate" is now auto-merge armed at mark-ready; "A request in prose" flags its retired Stage/rung-4 mechanism. - docs/code-comments.md: audit-contracts runs on alternate Mondays, not Thursdays. reviewer-profile: claude-workflow is ticketless, so its feedback is in PR comments, not ticket comments. - improve-loop recommended a Re-check: date (now Hold Until). - Hard-coded ops-journal, the Sentry org and token name, and Mailpit's retention now name their loop-config keys. - finalize-pr promised that "the next run seeds the preview", which no skill owns; the line is now a disclosure. Its references named a pr-prep check.sh that two repos lack. improve-loop's own thresholds (2+ days, 3+ sessions, perPage 20) stay inline: they are heuristics of one skill, not values another reads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
needsAddressReview read every unresolved thread the bot rooted, with no
bot reply after the root, as "own-rooted thread unanswered" and fired
address-review. That is right for a critic finding, but wrong for a
question the bot put to a human: address-review would wake to answer
its own question, find nothing to do, and the next unlock would fire it
again.
A root comment carrying review.questionMarker ("<!-- sydevs-question -->",
the same literal when the key is absent) now marks the thread as a
question. It is skipped by the own-rooted rule, so it waits on the
human. Once a respondTo human replies in it, the existing "a thread
waits on a reply" rule fires address-review as before, because that
rule is checked first. A plain own-rooted thread beside a question is
still owed an answer.
Nothing else reads threads as the bot's turn: evaluateGreenPr,
sweep-pr and sweep-orphan all go through evaluatePr, so an unanswered
question on a green draft now lets it be marked ready, and the human
answers it in review (the ruleset still requires the thread resolved
before merge).
Tests: four new cases in decide.test.mjs. The unanswered-question and
configured-marker cases failed before the change and pass after.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
When the pending-review MCP tools fail, review-pr posts its review as
one PR issue comment led by review.bodyHeader. ownReview read only
snapshot.reviews, so after a fallback the dispatcher saw no critic
review: every unlock re-fired review-pr, and the draft was never marked
ready.
criticReviewTimes now collects both shapes: a bot review whose body
leads with the header, and a bot issue comment whose body, trimmed at
the start, leads with it. ownReview reads it, and so does
pendingReviewVerb's newestBotReview, so a `review` verb answered by a
fallback comment is not owed a second review either. A human comment,
or a bot comment with the header anywhere but the lead, does not count.
The bot's own issue_comment event is still ignored ("own comment"); the
unlock that ends the review-pr session is what re-derives the PR and
marks it ready, as it does after a submitted review.
Limit: gather reads only the newest page or two of issue comments, so a
fallback review buried under many later comments on a still-draft PR
would age out of the snapshot. A submitted review never does.
Tests: three new cases in decide.test.mjs. The mark-ready and
answered-verb cases failed before the change and pass after.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
evaluatePr fired resolve-conflicts only for a ready PR, conflict-scan
answered a draft with "another session owns it", and gather left drafts
out of the post-merge conflict scan. But almost every loop PR is a
draft until mark-ready, and a conflicted branch schedules no CI at all:
fix-ci stands down saying Actions dispatches resolve-conflicts, the
critic and the next phase both wait for green, and the draft sat until
the orphan sweep handed it to a person.
Now a conflict fires resolve-conflicts whether the PR is a draft or
not. The guards above it are unchanged: s.locked records a recheck, and
a locked linked issue (implement still building it) leaves the branch
to that session. The check stays before the CI-red branch, so a red,
conflicted draft gets resolve-conflicts, not fix-ci.
Conflict resolution precedes phase-continue. A phased draft continues
only after green CI, and a conflicted branch never goes green, so
continuing first would deadlock; the next implement session also
builds on a branch that merges. One exception: a stalled phased draft
already labelled awaiting ("phase N waits on you") stays your turn, and
a stale red check on it does not fire fix-ci either.
conflict-scan now re-derives drafts like any other PR, and gather's
otherOpenBotPrs includes drafts, so a merge reaches them.
Because this widens resolve-conflicts to nearly every loop PR, it is
now keyed to its head, as fix-ci is: a resolve-conflicts session that
ended on this head (or is ending now, in record.current at unlock) and
left it conflicting stopped on a conflict it would not guess. That is
labelled awaiting instead of fired again on every unlock. A push to a
new head asks again. This also bounds the same loop that already
existed for ready PRs.
Tests: six new cases in decide.test.mjs and one in gather-ci.test.mjs.
All but the locked/linked-locked case failed before the change and
pass after.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
deps.branchPrefix ("claude/chore-deps-") named the branch of both the
dispatched vulnerability job and the alternate-Monday routine-updates
job, and depsPrInFlight suppressed the daily vulnerability fire
whenever any open bot PR sat on that prefix. So a routine minor/patch
PR waiting on review held back a critical CVE fix in the same repo for
as long as it stayed open.
deps.branchPrefix is now "claude/fix-deps-", the vulnerability job's
alone and the only prefix the dispatcher reads. The routine job moves
to the new deps.routineBranchPrefix, "claude/chore-deps-", which the
dispatcher ignores. Neither is a prefix of the other, so startsWith
cannot confuse them; a test pins that. The code fallback follows the
vulnerability prefix. Nothing else in dispatcher/, workflow/lib/ or
.github/ reads the key or the literal; audit-deps/SKILL.md is the prose
side.
Tests: deps.test.mjs now expects a fix-deps PR to block, and a
chore-deps PR on SahajCloud not to block its due alert. The in-flight,
tick and prefix cases failed before the change and pass after.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On a bot PR a plain comment is ignored: only a mention, a review or a thread reply reaches the bot (needsAddressReview's mention rule). Three dispatcher notices promised otherwise, so a person who did as told got silence: - orphan (a bot draft): "Comment or push to wake me." Now "A mention (`@sydevs-bot`) or a push from you starts me again." Both do: a push is a synchronize event that re-derives the PR. - phases-stalled (a bot draft): "Comment here and I will pick it up again." Now "A mention (`@sydevs-bot`) or a review from you starts me again." Not a push: phase-continue re-arms only on a human word newer than the stalled session (humanAt), and a push is not one. - attempts-exhausted (apply.mjs, either surface): "A comment, a verb, or a push". On a PR it now reads like ci-capped, "A mention (`@sydevs-bot`) or a push from you starts me again."; on an issue, where a push means nothing and a bare mention is a revise, "A `@sydevs-bot` verb or mention from you starts me again." The mention is shown with config.dispatch.commandPrefix. Every commentOnce key is unchanged, so an item already told is not told again. Tests: two new cases in decide.test.mjs and two in act.test.mjs (one per surface for attempts-exhausted, through act end to end). All four failed on the old wording and pass after; they also pin the keys. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The timeout case in apply.mjs posted a journal anomaly only when the attempts ran out. A session that timed out and was re-fired left nothing in the journal but the record on the item. improve-loop reads "timed out" anomalies for one handler as its evidence for raising dispatch.timeoutsMinutes, so it never saw the timeouts that matter most: the ones that recover on a second attempt, every day. Every timeout with a recorded session now posts an anomaly of kind `timed-out`, text `<repo>#<n> <handler> attempt <k>` (k is the attempt that timed out) and id the timed-out dispatch's id. That includes the last one, so the per-handler count is the true number of timeouts; the exhausted case still posts attempts-exhausted after it. A lock with no record is not a session timing out and posts only attempts-exhausted, as before. Not on dryRun, and wrapped like the other best-effort anomalies so a journal failure never costs the re-fire. journal.mjs keeps no list of anomaly kinds: postAnomaly takes any kind, tallyFrom counts every anomaly marker, and nothing validates or renders kinds by name, so there is nowhere else to add it. The text carries the attempt, so postAnomaly's once-a-day key never folds two attempts into one line. Tests: three new cases in act.test.mjs (re-fired, last timeout, dry run). The first two failed before the change and pass after. Co-Authored-By: Claude Opus 5.5 <[email protected]>
improve-loop writes its weekly usage report into the journal entry when no reflection PR opens, and the skill puts it under `📄 Did`. fit() cuts list lines from the END of Did first, so on any over-budget entry the usage report, written last, was the first thing cut: the one weekly number the humans read was the one the fitter removed. A heading `📊 Usage` (or plain `Usage`) at depth 2 to 4 now ends the Did section wherever it appears, so fit() never shortens or drops it, exactly as it already never touches Failed, Friction or any other section. That holds for `### 📊 Usage` as its own section and for `#### 📊 Usage` nested under Did, the shape a run following today's "under 📄 Did" prose writes. Did still pays for the cut, last line first, so the PR line is still the last to go. It is counted honestly: the section is not exempt from the budget. An entry still over once every Did line is gone gets fit()'s existing OVER verdict, with the report whole, as any unfittable entry does. Tests: two new cases in budget.test.mjs. The "never cut, wherever it sits" case failed before the change (the nested report's first line was cut) and passes after; the OVER case pins the unfittable path. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- audit-deps: routine updates branch on deps.routineBranchPrefix, so an open routine PR no longer holds back a vulnerability fire. - improve-loop: the anomaly kind is timed-out; the usage report is its own `### 📊 Usage` section, which the fitter keeps; journals close every week, PR or not, and $WINDOW is the oldest open journal, which stays defined while last week's PR is unmerged. - resolve-conflicts and README: drafts are resolved too, once per head; a semantic conflict is asked in options shape and waits on a person. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rget tells the truth The trigger pattern matched one level under workflow/skills, so audit-code/families/*.md and revise-roadmap/lenses/*.md — instructions like any SKILL.md — skipped the security review, as did workflow/lib (railway.mjs handles a token), dispatcher/ and .github/workflows, which AGENTS.md says carry a skill's blast radius. deployTarget said an installed plugin reads main live; AGENTS.md and cut-release say it is pinned until version changes. Edited attended: .claude/ is protected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-ups From a review of this branch: - A question review (finalize-pr step 7c) on a draft made review-pr see "an own-login review" and post nothing, while the dispatcher, which counts only header-led reviews, fired it again on every unlock. review-pr now stops only on a header-led review or fallback, and pendingReviewVerb counts only the critic, so a question review cannot swallow a `review` verb either. Test seen red before the fix. - start-run still typed a "code may be wrong" docs defect as a Bug; format-ticket owns it. - The attach rule, read literally, forbade implement-roadmap from filing its own plan. It now names proposals. - adoption still reshaped children by hand; it goes through update mode. - improve-loop closing journals every week would have lost a week held back by an unreviewed reflection PR. Those stay open. - audit-sentry's token line could not run; the address-review mention rule missed the revise alias; three places still called hygiene the one prAllowlistGlobs exception; two descriptions missed new callers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Change outline
Where a finding goes, before → after
review-pr no longer flags declared joined work as scope creep. A defect that joins is posted as a finding on the PR rather than filed. address-review never rebuts a joined point on scope.
Question threads
Review state can't tell a question from a critic finding. GitHub refuses
REQUEST_CHANGESon the author's own PR, so both are botCOMMENTreviews. The marker is what separates them.Dispatcher fixes (code, each with tests seen red first)
reviewverbdeps.branchPrefix→claude/fix-deps-; routine updates ondeps.routineBranchPrefixtimed-outanomalytimeoutsMinutesnever existedbudget.mjs --fitnever cuts### 📊 UsageCommits, by behaviour
One commit per behaviour, so each can be reverted on its own. They go in one PR at the maintainer's request.
All 26, with the failure each prevents
test-only.mjsandfindings.testGlobs. Also: the docs/test routes can't edit the loop's own skills.updatemode.Medium, and its gating of the hand-over onreviewerinstead ofrespondTo.${CLAUDE_PLUGIN_ROOT}is unset in routines, so the preview lookup, comment-lint and merge-verdict all failed silently.pr-test-analyzer.pr-templateRefresh).base, which the stacked-PR path needed.$comments;14–20. The seven dispatcher fixes in the table above.
timed-outkind, the Usage section and journal closing, resolve-conflicts on drafts..claude/workflow.json..md,workflow/lib, the dispatcher and the workflows.deployTargetno longer claims an installed plugin tracksmain.why.mdentries.Test results
claude plugin validate ./workflow --strict, ✓node --test workflow/lib/*.test.mjs(95)node --test dispatcher/test/*.test.mjs(265)workflow/lib/test-only.test.mjsasserts against the real globs and all four repos' test layouts. It was seen red with a glob removed.why.md#anchorcited in the repo resolves (checked by script).rule-delta.mjs --base origin/main workflow/skills90 → 88 directives, 4 added, 4 removed. Every removal is intentional and restated elsewhere:
ceilings.maxOpenProposals.Notes for reviewer
ceilingsvalue moved. That honours AGENTS.md's skill/ceiling split.writing.budgetsis unchanged too.claude/chore-deps-stops suppressing the daily fire after merge, so one duplicate audit-deps run is possible once.journalEntryalone. improve-loop now treats thatOVERas expected, rather than reporting it underperPage20). They are one skill's judgement, not values another skill reads.prAllowlistGlobsinclude.claude/**, a protected path no run can write. That is a per-repo edit, outside this repo.🤖 Generated with Claude Code