Repository navigation
feat(state): a workflow owns the mechanical state; the loop keeps judgement - #44
Merged
Merged
Conversation
…gement Three changes that turned out to be one. **`awaiting` is the primary human-attention signal.** One boolean label in all five repos. It exists because nothing else can span both types: issue fields are issues-only, and unsearchable besides (`field.` returns 0 through the REST search a routine has), so no field can be a worklist query or a board filter. Sub-labels were rejected — a boolean cannot be self-inconsistent, and the KIND of attention is already legible from where the item sits. **A reusable workflow owns every mechanical transition.** Almost every state write the loop made was determined by an event, not by judgement, and the loop made them up to eight hours late and could forget. `state-machine.yml` makes them from the event within seconds and cannot forget: Stage on open, Implemented + unassign when a PR appears, Revising when one is abandoned, and awaiting on every handover and every reply. One copy here, a ~20-line caller in each repo. The prize is larger than punctuality: every "as your final action, reassign / set Stage" rule left the skills entirely. What remains is judgement — choosing a Hold Until date, deciding a block lifted, revoking Implement, deciding the work is done — plus four `awaiting` adds for dead ends no event expresses. The skills now carry an explicit prohibition table rather than a silence, because a deleted instruction is invisible to a run that half-remembers it. Recursion is bounded by idempotency, not an actor guard. An actor guard was written first and was wrong: the bot authors its own issues and PRs, so `github.actor != 'sydevs-bot'` skips the transitions that matter most. **Nothing is ever assigned to the reviewer again.** `awaiting` carries that signal, so the assignment was a second source of truth for one fact — and it was the half nothing ever cleared. An issue's assignee now means exactly one thing everywhere: the bot is present and it is the loop's turn, or it is not. **The journal becomes a flight recorder.** The board answers "what needs me" continuously and cannot go stale, so `📋 Awaiting you` is gone and the did-this lists compress to one line each. What survives is what nothing else records: what failed, which ceiling bound and what it cost, which rule misfired. The title reports health rather than volume. Its reader is Sunday's reflect. **Reflect grades itself.** It now opens by reading last week's reflection PR and stating, per change, whether the failure it addressed recurred — held, did not hold, or too early. A reflection that never checks its own past changes is opinion with a PR attached. Recurrence becomes the gate for every proposal, not just profile edits, and ceiling proposals carry arithmetic over seven days rather than impression. `.github/workflows/` exists here now and is not CI. Editing state-machine.yml changes behaviour in all five repos on the next event, so it carries a skill's blast radius and a skill's rules. Done outside the repo: `awaiting` created in five repos; the reviewer unassigned from the five issues that carried them; the label seeded across the backlog (5 items, including claude-workflow#40 — approved in the one repo the loop may never merge, which is exactly the edge case this adds). Five superseded PRs closed. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…r alone Two corrections, both found by reading the loop's own open work. **The revision handover had no event.** `changes_requested` clears `awaiting` because the ball is the loop's; pushing the fix puts it back with the reviewer, and nothing said so — a revised PR would have waited unlabelled forever. Adds a `synchronize` transition, guarded on the reviewer's latest review still being CHANGES_REQUESTED so ordinary mid-work pushes do not flag a PR nobody is waiting on. Found by the loop in claude-workflow#42, which caught the same gap in the journal query this label replaces: `review:none` silently dropped every PR the loop had reviewed itself, including an approved one in the repo where only a human may merge. That surface is gone, but the gap was real in both. **Approval was gated on respondTo, which is too wide.** Four of the five repos are public, so any account can submit an APPROVED review; respondTo also carries antontcymbal and Copilot. Approval authority is assignment.reviewer's alone, and a list admitting every feedback-giver is wider than the authority it stands in for. respondTo still governs what counts as feedback — only approval narrows. Same reasoning as the open claude-workflow#40, which fixes the mirror of this in rung 1's merge gate. That PR is approved and unmerged; it will need a rebase after this lands, and its docs/why.md anchor is the permanent home for the argument — this states the rule inline meanwhile. Also: journal.titleFormat was still the old volume title while journal/SKILL.md had moved to reporting health. Now they agree. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
8 tasks
Ardnived
added a commit
that referenced
this pull request
Sep 4, 2026
#44 landed the state machine and the flight-recorder journal while this sat approved-and-unmerged, so this brings it current. One real conflict: **journal.titleFormat** — this PR moved it to `filed / opened / merged / closed` to match what journal/SKILL.md then computed. #44 moved the journal to reporting health instead, and the title with it. Resolved to main's `<n> runs · <n> failed · <n> ceiling stops`; volume lives on the board now. Everything else auto-merged, and the security fix is intact and still wired: reviewDecisionFrom is called by merge-verdict.mjs with the config's allowlist applied after the spread, so a snapshot cannot widen its own authority. Verified rather than assumed — all ten cases re-run against the merged tree, including the two that matter: a stranger's APPROVED on a public repo returns null, and so does a respondTo peer's. #44 had the mirror of this hole in the state machine's label transition and states the rule inline; that inline statement is now re-linked to this PR's docs/why.md#only-the-reviewers-approval-counts, which is its permanent home. One rule, both sites where an approval is read. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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
Three asks that turned out to be one change.
1.
awaitingis the primary human-attention signal. One boolean label in all five repos. It exists because nothing else can span both types: issue fields are issues-only, and unsearchable besides (field.returns 0 through the REST search a routine has), so no field can ever be a worklist query or a board filter. Filter any board view bylabel:awaitingand that is your queue.2. A reusable workflow owns every mechanical transition. Your question — "most of these decisions are mechanical, not something which needs an AI" — was right, and the prize is bigger than not-forgetting:
Implemented+ unassigns, up to 8h laterpull_request: opened→ within secondsProposedon a proposal it filedissues: opened→ within secondsRevisingwhen you commentissue_comment: created→ before the run even startsready_for_review/review submitted→ it cannot forgetEvery "as your final action, reassign / set Stage" rule left the skills entirely. What remains is judgement: choosing a
Hold Untildate, deciding a block lifted, revokingImplement, deciding the work is done — plus fourawaitingadds for dead ends no event expresses (CI cap, unrebaseable conflict, a rebutted thread, an investigation's finding).Per your third point, the skills carry an explicit prohibition table rather than a silence — a deleted instruction is invisible to a run that half-remembers it:
ImplementedStage, outside the four judgement casesawaiting, outside the four dead endsStage: Implement, ever3. Nothing is ever assigned to you again.
awaitingcarries that signal, so the assignment was a second source of truth for one fact — and it was the half nothing ever cleared (the accumulation I flagged in #36). An issue's assignee now means exactly one thing everywhere.Journal → flight recorder
The board answers "what needs me" continuously and cannot go stale, so
📋 Awaiting youis gone and the did-this lists compress to one line each. What survives is what nothing else records —⚠️ Failed,⏭️ Ceiling(which cap bound, and what it cost),🧭 Friction. The title reports health (Wed — 8 runs · 2 failed · 3 ceiling stops) rather than volume the board already shows. Its reader is Sunday.Reflect, redesigned
One design bug caught while writing it
I wrote
if: github.actor != 'sydevs-bot'as a recursion guard, then realised it skips the transitions that matter most — the bot authors its own issues and PRs. Recursion is bounded by idempotency instead: every writer reads current state first and returns early when it matches, so a re-firedfield_addedis one free no-op run. Both the workflow androutine-setup.mdsay so, loudly, so it is not re-added.Already done outside this PR
awaitingcreated in all five repos; seeded across the backlog — 5 items, includingclaude-workflow#40: approved in the one repoloopMayNotMergeforbids the loop to merge, which is exactly the edge case this adds.#41,SahajCloud#690,WeMeditateWeb#76,SahajAtlasWeb#193,SahajAtlasWordpress#11) — board membership folds into the same caller.⚠ Needs you before this works
ADD_TO_PROJECT_PATneeds write, not read. Currently repo Issues/PRs read; the state machine needs read/write on both, plus org Projects read/write. Issue-field writes go through a repo endpoint but the field is org-level, and whetherGITHUB_TOKENsuffices is undocumented — hence the PAT throughout.@main).Test results
claude plugin validate ./workflow --strict· ✓loop-config.jsonparses · ✓ both workflow YAMLs parse · ✓ every(why: docs/why.md#…)resolvesassign … reviewer, no📋 Awaiting youtable, no orphaned state-write instructionManual verification, post-merge
Event-by-event on a scratch issue and PR in SahajCloud, asserting after each: bot-authored issue →
Proposed+awaiting; your comment →Revising,awaitinggone;Implementunassigned →awaitingreturns; assign bot → gone; PR opened closing it →Implemented+unassigned; closed unmerged →Revising+awaiting. Then confirm a single transition produces one workflow run, not a cascade.🤖 Generated with Claude Code