@oakgreencc/cambium 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oakgreencc/cambium",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "The scheduler daemon: reads the q:* queues from GitHub every tick, runs headless claude workers in their own worktrees up to a cap, and makes every queue transition itself.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
@@ -6,8 +6,9 @@
6
6
  * same order; each step only chooses where an issue's turn starts:
7
7
  *
8
8
  * - Reconcile: every tracked worker's issue at `worker-running`.
9
- * - Watch: issues resting at `ci-running` / `merge-queue` (from the marker); a merged PR goes to `close-out`
10
- * from wherever the issue is.
9
+ * - Watch: issues resting at `ci-running` / `merge-queue` (from the marker), and any task issue in no queue with
10
+ * an open PR (a queue label removed by hand), which starts at `ci-running` (`merge-queue` if `queued`); a
11
+ * merged PR goes to `close-out` from wherever the issue is.
11
12
  * - Sweep: a stale `running` lease runs its node's `recover` (default: `requeue`).
12
13
  * - Schedule: the gate on the entry node. Caps and priority pick the issues; each starts at `start-worker`.
13
14
  *
@@ -166,8 +167,13 @@ async function watch(deps, ctx) {
166
167
  }
167
168
  if (pr.state !== 'OPEN' || issue.state !== 'OPEN' || !watched(deps, slug, issue)) return
168
169
  const at = locate(issue, ctx.now)
169
- if (at?.note) return restart(deps, ctx, slug, issue, at.note)
170
- if (at?.node === 'ci-running' || at?.node === 'merge-queue') await drive(deps, ctx, subject, at)
170
+ if (!at) return
171
+ if (at.note) return restart(deps, ctx, slug, issue, at.note)
172
+ if (at.node === 'ci-running' || at.node === 'merge-queue') return drive(deps, ctx, subject, at)
173
+ // Out of every queue with an open PR, but resting elsewhere (a queue label removed by hand): watch the PR
174
+ // from where it is, as the legacy Watch does.
175
+ const node = markerOf(issue).queued ? 'merge-queue' : 'ci-running'
176
+ await drive(deps, ctx, subject, { node, input: { pr: pr.number, branch: pr.branch } })
171
177
  },
172
178
  ([, issue]) => ({ repo: slug, issue: issue.number }),
173
179
  )
package/src/tick.mjs CHANGED
@@ -340,7 +340,8 @@ async function watch(deps, ctx) {
340
340
  pr: pr.number,
341
341
  failedSha: pr.headSha,
342
342
  })
343
- if (pr.inMergeQueue && !m.queued) await setMarker(deps, slug, issue, { ...m, queued: true })
343
+ // `submitted` too: an issue whose queue label was removed by hand is still at its old stage (#38).
344
+ if (pr.inMergeQueue && !m.queued) await setMarker(deps, slug, issue, { ...m, stage: 'submitted', queued: true })
344
345
  const settled = pr.checks !== 'PENDING' && pr.checks !== 'EXPECTED'
345
346
  if (m.queued && !pr.inMergeQueue && !pr.autoMerge && settled)
346
347
  return requeue(deps, ctx, slug, issue, {