Skip to content

refactor(loop): split the routines into work-routine and survey-routine over shared bookends - #35

Merged
Ardnived merged 4 commits into
mainfrom
claude/refactor-split-nightly-run
Sep 2, 2026
Merged

Ardnived merged 4 commits into
mainfrom
claude/refactor-split-nightly-run

Conversation

@Ardnived

@Ardnived Ardnived commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • "Rung" is now exclusively a step of the work routine's ladder, and the two run skills are named for what they do: work-routine advances the work queue (merge · revise · implement · adversarially review); survey-routine surveys (the day's calendar survey + the reconciliation sweeps) — a fixed set of once-a-day tasks, not a ladder.
  • Shared bookends extracted: /workflow:preflight (ground rules + auth/identity/census — explicitly both runs', fixing the survey routine's formal omission of preflight) and /workflow:journal (the journal spec + ending).
  • Cutover is by replacement routines, not a path shim: sydevs-work-hourly (trig_01BUwH4WjazMXjG2bnC3TVRL) and a new sydevs-survey-nightly (trig_01WzJ2EnTKEk9BJ2Xf6AQ4x6) already exist, paused, with identical schedules/environment/tools and prompts pointing straight at the new skills.

Changes

  • workflow/skills/preflight/SKILL.md, workflow/skills/journal/SKILL.md — extracted verbatim-in-substance from the old loop-run, generalised to both runs.
  • workflow/skills/work-routine/ (renamed from loop-run, carries merge-verdict.mjs) — the ladder alone, rungs 1–5 keeping their numbers; also deduplicates rung 1's verdict table and mergePolicy paragraphs (a feat(loop): discover branch preview aliases, compute journal titles #30/feat(loop): adversarial review rung, reviewer profile, and a learning reflect #32 merge artifact stated everything twice).
  • workflow/skills/survey-routine/ — survey dispatch + reconciliation sweeps.
  • docs/why.md#the-survey-routine-is-not-a-ladder — the story; README, routine-setup (now recording the real stored prompt verbatim, the new routine ids, and which predecessors to delete), AGENTS.md, loop-config comments, reflect, reviewer-profile all pick up the vocabulary. The system-level name "the loop" (loop-config.json, identity marker) deliberately stays — it names the machine, not a skill.

Test results

  • Lean gate: ✓ claude plugin validate ./workflow --strict
  • JSON: ✓ loop-config.json parses
  • Reference sweep: zero remaining loop-run, nightly-run, queue-routine, sydevs-loop (outside the predecessors note), rung 0/6/7, or RUN_KIND references
  • New routines created and verified paused (enabled: false), same cron/env/model/sources/tools as the originals

Manual verification (cutover order)

  1. Merge this PR first — the new routines read the new skill paths from main.
  2. Enable sydevs-work-hourly and the new sydevs-survey-nightly at claude.ai/code/routines.
  3. Delete the old sydevs-loop (trig_01GyUCMWmPLekwTzYL7Xzobi) and old sydevs-survey-nightly (trig_016XeEsVa7dfSCum7t4Vmeuw) — their stored prompts point at the deleted loop-run path and had drifted anyway ("rungs 0 through 4, then rung 6").
  4. /workflow:work-routine --dry-run locally: preflight → rungs 1–5 worklists → stops before journal writes.
  5. First new-routine transcripts: preflight ran (identity + census), correct skill followed, journal entry marked loop/nightly.

Notes for reviewer

  • Rung numbers 1–5 were deliberately preserved (preflight simply lost its "rung 0" label), so why.md#rung-2…, finalize-pr's "rung 1", and adversarial-review's "rung 5" needed no edits — the blast radius of future rung insertions is now confined to work-routine.
  • Judgement call to check: the ground rules (non-negotiables, writing style, never-subscribe) moved into preflight so both runs load them first; the alternative — duplicating them into the survey routine — is the drift pattern this repo exists to kill.
  • The new routines were created with clear_mcp_connections: true, per routine-setup's own guidance (GitHub comes from the session proxy; connectors cost context every turn). The originals carried no connectors either, so behaviour is identical.

🤖 Generated with Claude Code

…o run skills

The survey routine and the working-day loop diverged long ago — the survey was
split out precisely so a busy queue could not starve it — but both kept
sharing one skill file and one rung numbering. That numbering described a
ladder no run ever descended: the nightly run executed "rung 6" without
climbing 1-5, the loop run stepped over 6 on its way to 7, and preflight and
journal wore rung numbers despite being every run's bookends rather than
priority steps of anything. The costs were concrete: adding one loop rung
(#32) forced a renumbering sweep across four files for a nightly run that had
not changed, and the nightly run's spec formally omitted preflight - auth,
identity, ceilings - because "rung 0" read as the ladder's business.

Now: two run skills over shared bookends.

- preflight - ground rules (prompt-not-spec, writing style, non-negotiables,
  never-subscribe) plus run start (auth, identity, capability limits, census).
  Explicitly both runs': the nightly run's missing preflight is fixed by
  construction.
- journal - the whole journal spec and the run's ending, shared verbatim.
- loop-run - the ladder alone, rungs 1-5 keeping their numbers, so every
  existing rung citation (docs/why.md#rung-2-competes-for-the-same-budget,
  finalize-pr's "rung 1", adversarial-review's "rung 5") stays true. Keeps a
  redirect: a prompt still carrying RUN_KIND=nightly is sent to nightly-run,
  so the stored nightly prompt cannot silently lose its survey while it
  awaits updating.
- nightly-run - survey dispatch and the reconciliation sweeps, stated as what
  it is: a fixed set of once-a-day tasks, not a ladder, no rungs.

In passing: deduplicates rung 1's verdict table and mergePolicy paragraphs
(a #30/#32 merge artifact stated everything twice), removes the duplicated
"GitHub metadata" heading in routine-setup, and corrects surveyCalendar's
comment - surveys are dispatched by the nightly run, not "morning runs".

The nightly routine's stored prompt should be repointed at
nightly-run/SKILL.md after this merges; routine-setup documents that, and the
redirect covers the gap.

Co-Authored-By: Claude Fable 5 <[email protected]>
…and survey-routine

loop-run and nightly-run named when and how the skills ran, not what they
did — and "loop-run" doubly so once the nightly routine stopped being part
of any loop pass. The queue routine advances the work queue (the assignee
field IS the worklist): merge, revise, implement, review. The survey routine
surveys: the day's calendar survey plus the reconciliation sweeps that keep
the queue honest.

Directory renames carry merge-verdict.mjs along; frontmatter names, the
${CLAUDE_PLUGIN_ROOT} script path, the nightly-prompt redirect, loop-config
comments, README, routine-setup, AGENTS.md, and the why.md section heading
(now covering all four run-adjacent skills) all follow. The system-level
name — "the loop", loop-config.json, the identity marker — stays: that names
the whole machine, not a skill.

Co-Authored-By: Claude Fable 5 <[email protected]>
@Ardnived Ardnived changed the title refactor(loop): rung means one thing — split the two routines into two run skills refactor(loop): split the routines into queue-routine and survey-routine over shared bookends Sep 2, 2026
Ardnived and others added 2 commits September 2, 2026 16:47
Both stored routine prompts name the path workflow/skills/loop-run/SKILL.md,
and routines clone main fresh each run - so the moment the rename merges,
every run would open a path that no longer exists, hourly, until someone
updates the prompts. The stub redirects each routine to its new skill,
journals that it was used (the signal the prompts still need updating), and
says to delete itself once both prompts point at the new paths.

Co-Authored-By: Claude Fable 5 <[email protected]>
…lace the prompt shim

Renamed the working-day skill to work-routine and removed the loop-run
transition stub: instead of shimming the old path, the cutover is two new
cloud routines created alongside the old ones - sydevs-work-hourly
(trig_01BUwH4WjazMXjG2bnC3TVRL) and sydevs-survey-nightly
(trig_01WzJ2EnTKEk9BJ2Xf6AQ4x6) - same schedules, same environment, same
tool set, created paused. Their prompts point straight at the new skills and
enumerate no rungs; the old routines' prompts had drifted ("rungs 0 through
4, then rung 6"), which is the staleness their own text warns about. The
reviewer enables the new pair and deletes the old pair, so no run ever reads
a path that does not exist.

routine-setup now records the real stored prompt verbatim, the new ids, and
which predecessors to delete; the RUN_KIND redirect is gone from
work-routine along with the rest of the shim.

Co-Authored-By: Claude Fable 5 <[email protected]>
@Ardnived Ardnived changed the title refactor(loop): split the routines into queue-routine and survey-routine over shared bookends refactor(loop): split the routines into work-routine and survey-routine over shared bookends Sep 2, 2026
@Ardnived
Ardnived merged commit 13a34a0 into main Sep 2, 2026
@Ardnived
Ardnived deleted the claude/refactor-split-nightly-run branch September 2, 2026 23:56
Ardnived added a commit that referenced this pull request Sep 3, 2026
…t flag (#36)

Assignment stops moving. `assignee:sydevs-bot` still IS the worklist, but only
the user writes it, and it stays put until they take it back — so assignment
answers exactly one question, *is this the loop's to touch*, and never drifts.
The hand-back it replaces cost a round trip on every unit of work: the loop
reassigned to say "done", and the user reassigned back to say "continue".

What kind of turn it is moves to two new org-level issue fields alongside
Priority and Effort:

  Stage       Proposed · Revising · Blocked · Implement · Implemented
  Hold Until  a date; while it is in the future the item is invisible

That retires five labels whose meanings overlapped and, in one case,
contradicted each other outright — triage-issue said `blocked-upstream` had no
bot meaning while the ladder made it a hard implementation gate. It also
retires `claude:working`, which existed in one repo, carried zero issues, and
was never applied by anything: only swept.

Four findings shaped this, all measured rather than assumed:

  1. Date fields exist and MCP can write them — `issue_write` takes `value` for
     text/number/date and `delete:true` to clear one field, so Hold Until can be
     cleared without the PUT-replaces-everything trap.
  2. Fields are NOT searchable. `field.priority:high` returns 0 through the REST
     search a routine has, against a control of 24, with the negation also 0.
     So no worklist query filters on a field; candidates come from indexed
     qualifiers and field values are attached from list_issues, five calls.
  3. No MCP tool reads an issue timeline, and the REST field-change event
     carries no field name and no old value — so a blocked ticket's previous
     Stage is written into the `Blocked by:` marker as `(was: X)`. Unblocking
     restores it, except `Implement`, which becomes `Revising`: a blocker
     usually changes the shape of the work.
  4. Every PR qualifier IS indexed. draft:, review:, -reviewed-by: all work.

So a PR's baton is its `draft` flag. Every loop PR opens as a draft and is
marked ready exactly once, at green CI; the assignee never changes. `draft:false`
therefore means "has been ready at least once", which is what keeps the
adversarial review firing once and only once.

The safety property is unchanged and restated on the new mechanism: the loop may
never write `Stage: Implement`. It may move a ticket off it — revoking only ever
reduces its own autonomy — and the danger of the field version is that four
other Stage writes are routine, so the prohibition is a bare imperative in
preflight, triage-issue and implement-issue rather than inferred.

Feedback is now an allowlist, `assignment.respondTo`, replacing "the author is
not me". That test was a blocklist with one entry: of the 200 most recent
comments across two repos, 93 were cloudflare-workers-and-pages[bot], which
under the old rule would have been the largest single source of work. An
allowlist fails closed and is how Copilot gets adopted later — one config entry.

Also: journal title terms are now filed/opened/merged/closed, because `revised`
was defined as hand-backs and was never measurable anyway (finding 3); the
dropped-baton sweep becomes an unheard-replies sweep, since "replied but forgot
to reassign" means nothing once nothing is handed back; and the legacy-identity
exception is deleted rather than carried, per the maintainer.

Org fields are already created (Stage=46423931, Hold Until=46423871) and 17 open
issues backfilled from their labels, so this merge is the only remaining step
before the labels can be deleted. `Status` and `State` are both reserved names
on GitHub, which is why the field is `Stage`.

Drive-by: repairs the AGENTS.md sentence #35's search-and-replace clobbered.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant