Skip to content

feat(loop): two-hourly cadence, nightly survey, stock ceilings, no pins - #10

Merged
Ardnived merged 1 commit into
mainfrom
claude/cadence-nightly-nopin
Aug 31, 2026
Merged

Ardnived merged 1 commit into
mainfrom
claude/cadence-nightly-nopin

Conversation

@Ardnived

Copy link
Copy Markdown
Contributor

Summary

  • Splits the routines by function: sydevs-loop every 2h through the working day (rungs 0–4, 6), sydevs-survey-nightly once at 1am PT (rung 5 + reconciliation sweeps + journal)
  • Retires the four per-run flow ceilings; wipCapPerRepo bounds implementations, maxWorkItemsPerRun: 3 is the per-run backstop
  • Moves the dropped-baton and stale-claim sweeps into the nightly run
  • Removes journal pinning (impossible from a routine); recency surfaces the current journal
  • Corrects the <details> record: the MCP read path strips the tags — writes are intact
  • Documents the validated Postgres bring-up for the routine environment (SahajCloud#663)

Changes

  • workflow/skills/loop-run/SKILL.md — RUN_KIND loop|nightly; ceilings recounted against maxWorkItemsPerRun; nightly reconciliation section; pin step removed; <details> section rewritten
  • loop-config.json — flow ceilings deleted, maxWorkItemsPerRun added, stock-vs-flow rule in the comment; journal pin keys removed
  • docs/routine-setup.md — working setup script (initdb as postgres, --auth=trust), daily-journal section, new routines table, corrected <details> failure-mode row
  • workflow/skills/reflect/SKILL.md, README.md — cadence prose

Contract impact

Changes both routine prompts and schedules — applied via RemoteTrigger after this merges. The environment setup script must be updated by hand in the claude.ai UI; the exact script is in docs/routine-setup.md §4.

Test results

  • Lean gate: ✓ claude plugin validate ./workflow --strict passes
  • Postgres recipe validated by the 2026-08-31 run: 67 integration files, 1135 tests, green in the routine environment

Manual verification

  1. After the next nightly: one journal for the day, unpinned, survey ran, sweeps reported
  2. After a loop run: no reference to retired ceilings in its journal entry

Notes for reviewer

Evidence for retiring the flow caps: Monday's run hit implementations 1/1 and PR revisions 2/2 with five items rolling over at a 12-hour cadence — the queue was growing faster than it drained, and the caps were denominated in a unit (per run) that the cadence change redefines.

Four changes shipped together because they are one design move: make runs
small and frequent, and make everything once-a-day live in one nightly run.

The routines split by function instead of time of day. sydevs-loop runs rungs
0-4+6 every two hours through the Vancouver working day; sydevs-survey-nightly
runs rung 5, the reconciliation sweeps, and the journal once at 1am. The split
fixes a starvation bug: as a rung below merge/revise/implement, the survey
could be starved for days by a busy queue with nothing looking wrong. Monday's
run proved the pressure — both flow ceilings hit their caps and five items
rolled over on a 12-hour cadence.

The flow ceilings are retired for exactly that cadence change: a per-run quota
silently multiplies by the schedule, so maxImplementationsPerRun,
maxPrRevisionsPerRun, maxTicketRepliesPerRun and maxHumanPrReviewsPerRun go.
What remains is stock caps (wipCapPerRepo bounds implementations,
maxOpenProposals bounds proposals) plus one backstop, maxWorkItemsPerRun: 3,
so a 30-item queue cannot burn a whole run. The rule is recorded in the config
comment: a stock cap survives a cadence change; a flow cap does not.

The nightly run gains the dropped-baton sweep (reviewer replied but kept the
baton -> flag in the journal, never pick up, hold excluded) and the stale-claim
sweep (claude:working older than an hour is a crashed run's residue). Both are
once-a-day by nature - in the two-hourly loop they would re-flag the same
items on every pass.

Journal pinning is removed entirely. pinIssue is GraphQL-only and a routine's
GraphQL serves only PR-review operations, so the loop cannot pin and a stale
pin is worse than none. Recency surfaces the current journal on its own.

Also corrects the <details> record with what two runs' contradictory evidence
finally resolved: writes store the tags intact (REST proves it), but the MCP
READ path strips details/summary while keeping table, sub and a - so a run
verifying its own write via MCP readback will wrongly conclude the write
failed. From a routine the faithful readback does not exist; trust the write's
200. And documents the working Postgres bring-up for the routine environment,
validated by SahajCloud#663's investigation: the image ships Postgres 16 off
$PATH with no cluster; initdb + pg_ctl as the postgres user yields exactly
DEFAULT_TEST_DATABASE_URL and the integration lane runs unmodified - 67 files,
1135 tests, green.

Co-Authored-By: Claude Opus 5 <[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