@oakgreencc/cambium 0.0.25 → 0.0.26

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/README.md CHANGED
@@ -101,7 +101,15 @@ One JSON file. Everything but `repos` is optional; these are the defaults:
101
101
  "repos": [{ "slug": "oakgreencc/monorepo", "path": "~/OGCC/monorepo", "baseBranch": "main" }],
102
102
  "phases": {
103
103
  "task": { "cap": 2, "wallClockMinutes": 60, "maxTurns": 200, "maxAttempts": 3 },
104
- "dispatch": { "cap": 0, "wallClockMinutes": 15, "maxTurns": 50, "maxAttempts": 3, "maxRounds": 3 }
104
+ "dispatch": {
105
+ "cap": 0,
106
+ "wallClockMinutes": 15,
107
+ "maxTurns": 50,
108
+ "maxAttempts": 3,
109
+ "maxRounds": 3,
110
+ "deferHours": 6,
111
+ "maxDefers": 8
112
+ }
105
113
  },
106
114
  "mergeQueueMinutes": 120,
107
115
  "merge": "none",
@@ -334,7 +342,7 @@ Every Task PR lands on `baseBranch`, so a red base fails every worker for a reas
334
342
 
335
343
  ## The dispatch graph
336
344
 
337
- With `"engine": "graph"` and `phases.dispatch.cap > 0`, each `q:intake` issue is triaged by a one-shot `claude -p` worker (`src/graphs/dispatch.mjs`, steps in `src/dispatch-engine.mjs`, prompt and result in `src/phases/dispatch.mjs`), then moved to `q:task`, moved to `q:human`, or closed as a duplicate.
345
+ With `"engine": "graph"` and `phases.dispatch.cap > 0`, each `q:intake` issue is triaged by a one-shot `claude -p` worker (`src/graphs/dispatch.mjs`, steps in `src/dispatch-engine.mjs`, prompt and result in `src/phases/dispatch.mjs`), then moved to `q:task`, moved to `q:human`, closed as a duplicate or obsolete, or deferred to be triaged again later.
338
346
 
339
347
  ```mermaid
340
348
  flowchart TD
@@ -345,6 +353,8 @@ flowchart TD
345
353
  n3["to-task"]
346
354
  n4["to-human"]
347
355
  n5["close-duplicate"]
356
+ n6["deferred"]
357
+ n7["close-obsolete"]
348
358
  end_(("end"))
349
359
  start_ --> n0
350
360
  n0 -->|"started"| n1
@@ -354,6 +364,8 @@ flowchart TD
354
364
  n1 -->|"leaseLost"| n2
355
365
  n1 -->|"actionable"| n3
356
366
  n1 -->|"duplicate"| n5
367
+ n1 -->|"defer"| n6
368
+ n1 -->|"obsolete"| n7
357
369
  n1 -->|"needsHuman"| n4
358
370
  n1 --> n4
359
371
  n2 -->|"attemptsLeft"| n0
@@ -361,6 +373,9 @@ flowchart TD
361
373
  n3 --> end_
362
374
  n4 --> end_
363
375
  n5 --> end_
376
+ n6 -->|"budgetSpent"| n4
377
+ n6 --> end_
378
+ n7 --> end_
364
379
  ```
365
380
 
366
381
  | Node | Kind | Queue label | Holds `running` |
@@ -371,11 +386,14 @@ flowchart TD
371
386
  | `to-task` | step | `q:task` | no |
372
387
  | `to-human` | step | `q:human` | no |
373
388
  | `close-duplicate` | step | none | no |
389
+ | `deferred` | step | `q:intake` | no |
390
+ | `close-obsolete` | step | none | no |
374
391
 
375
- - **The verdict.** The worker's final message must end with a JSON block, validated by zod (`TriageResult`): `{ verdict: 'actionable' | 'needs-human' | 'duplicate', duplicateOf?, reason, title?, acceptance? }` (`duplicateOf` is required on a duplicate and cannot be the issue itself). cambium reads it from the worker's stdout log: the last `result` event's `result` text, its last fenced block (else the bare JSON).
376
- - **Outcomes.** `actionable` → a comment with the reason, the task title and acceptance checks (when given), then `q:task` with a task-graph marker at `start-worker`, attempt 1, history kept; the checks also ride in the marker (`triage`) into the task worker's prompt. The issue body is never rewritten: cambium's write path has no issue edit, and the author's text stays as written. `needs-human` → `q:human` + `why:triage`, the reason as the state comment's last failure. `duplicate` → closed with reason `duplicate` and `Duplicate of #n (<link>). <reason>`. A missing or invalid verdict (no `result` event, no JSON, a schema error) or a worker killed at `wallClockMinutes` (the unlabelled `triaging → to-human` edge) → `q:human` + `why:triage` with the error.
392
+ - **The verdict.** The worker's final message must end with a JSON block, validated by zod (`TriageResult`): `{ verdict: 'actionable' | 'needs-human' | 'duplicate' | 'obsolete' | 'defer', duplicateOf?, recheckHours?, reason, title?, acceptance? }` (`duplicateOf` is required on a duplicate and cannot be the issue itself). cambium reads it from the worker's stdout log: the last `result` event's `result` text, its last fenced block (else the bare JSON).
393
+ - **Outcomes.** `actionable` → a comment with the reason, the task title and acceptance checks (when given), then `q:task` with a task-graph marker at `start-worker`, attempt 1, history kept; the checks also ride in the marker (`triage`) into the task worker's prompt. The issue body is never rewritten: cambium's write path has no issue edit, and the author's text stays as written. `needs-human` → `q:human` + `why:triage`, the reason as the state comment's last failure. `duplicate` → closed with reason `duplicate` and `Duplicate of #n (<link>). <reason>`. `obsolete` (the work no longer applies, verified: the code path is gone, already fixed, its check already passed) → closed as `not_planned` with `Obsolete: <reason>`. `defer` → stays in `q:intake` at `deferred` (see below). A missing or invalid verdict (no `result` event, no JSON, a schema error) or a worker killed at `wallClockMinutes` (the unlabelled `triaging → to-human` edge) → `q:human` + `why:triage` with the error.
377
394
  - **Read-only checkout.** Triage reads code to judge feasibility and duplicates, so it gets a checkout, but a disposable one: a detached worktree at `<root>/triage-<n>` on `origin/<base>` (the repo's worktree root), no install, hydrate or `prepare`, tools `Read,Glob,Grep,Bash` with Edit/Write and every graft/git write verb denied. It is removed outright after the verdict (no `graft status`: nothing in it is worth keeping).
378
395
  - **Retries.** A worker that cannot start, or a lost `running` lease on a `q:intake` issue (Sweep), goes back to `q:intake` with attempt + 1, then to `q:human` once `phases.dispatch.maxAttempts` are spent. A marker from another graph or a finished triage starts over at attempt 1.
396
+ - **Defer, not a human.** A verdict that hangs on something a machine can check later (a CD run that has not happened, a release, a merge, a deploy) is `defer`, never `needs-human`: asking a human to verify what a machine can is what the factory exists to avoid. The issue rests at `deferred` with `deferUntil` (now + `recheckHours`, else `phases.dispatch.deferHours`, default 6) and `deferReason` in its marker; Schedule skips it until then, and the next triage gets the reason in its prompt ("check it now"). A defer is not a failed attempt. After `phases.dispatch.maxDefers` (default 8) it goes to `q:human` + `why:triage` with the last reason.
379
397
  - **Leaving intake.** If the issue is closed or relabelled while triage runs, the verdict is dropped and the checkout removed.
380
398
  - **Tracing.** Call sites are marked (`TRACING (follow-up)`) as in the task graph: the worker's `TRACEPARENT`, its stream-json spans, and `advanceHooks` in the driver, whose `cambium.issue` root continues mycelium's intake span from the issue body.
381
399
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oakgreencc/cambium",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
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",
package/src/config.mjs CHANGED
@@ -29,7 +29,7 @@ import { join, resolve } from 'node:path'
29
29
  * tickSeconds: number,
30
30
  * stepTimeoutSeconds: number,
31
31
  * repos: Repo[],
32
- * phases: { task: PhaseCaps, dispatch: PhaseCaps & { maxRounds: number } },
32
+ * phases: { task: PhaseCaps, dispatch: PhaseCaps & { maxRounds: number, deferHours: number, maxDefers: number } },
33
33
  * mergeQueueMinutes: number,
34
34
  * merge: MergePolicy,
35
35
  * priorityLabels: string[],
@@ -62,7 +62,15 @@ export function defaults(home = DEFAULT_HOME) {
62
62
  repos: [],
63
63
  phases: {
64
64
  task: { cap: 2, wallClockMinutes: 60, maxTurns: 200, maxAttempts: 3 },
65
- dispatch: { cap: 0, wallClockMinutes: 15, maxTurns: 50, maxAttempts: 3, maxRounds: 3 },
65
+ dispatch: {
66
+ cap: 0,
67
+ wallClockMinutes: 15,
68
+ maxTurns: 50,
69
+ maxAttempts: 3,
70
+ maxRounds: 3,
71
+ deferHours: 6,
72
+ maxDefers: 8,
73
+ },
66
74
  },
67
75
  mergeQueueMinutes: 120,
68
76
  merge: 'none',
@@ -6,7 +6,7 @@
6
6
  * - Reconcile: every tracked triage worker's issue at `triaging`.
7
7
  * - Sweep: a stale `running` lease on a `q:intake` issue runs `retry-triage`.
8
8
  * - Schedule: `q:intake` issues without a lease, by priority then age, up to `phases.dispatch.cap` counted from
9
- * live triage workers; each starts at `start-triage`.
9
+ * live triage workers, skipping one deferred until later; each starts at `start-triage`.
10
10
  *
11
11
  * A turn advances one transition at a time and stops on entering a wait, at the entry node again (only Schedule
12
12
  * admits entries), at a wait that is not ready, or at the end.
@@ -119,7 +119,8 @@ export function intakeCandidates(deps, ctx) {
119
119
  issue.state === 'OPEN' &&
120
120
  issue.labels.includes(Q.intake) &&
121
121
  !issue.labels.includes(RUNNING) &&
122
- !store.worker(slug, issue.number)
122
+ !store.worker(slug, issue.number) &&
123
+ !deferredPast(issue, ctx.now)
123
124
  )
124
125
  candidates.push({ slug, issue, snap })
125
126
  const order = byPriorityThenAge(config.priorityLabels)
@@ -127,6 +128,15 @@ export function intakeCandidates(deps, ctx) {
127
128
  return candidates.slice(0, free)
128
129
  }
129
130
 
131
+ /**
132
+ * Resting at `deferred` with its recheck time still ahead: triage waits for it.
133
+ * @param {import('./github.mjs').Issue} issue @param {number} now
134
+ */
135
+ const deferredPast = (issue, now) => {
136
+ const m = issue.stateComment?.marker
137
+ return m?.graph === dispatch.name && m.node === 'deferred' && !!m.deferUntil && Date.parse(m.deferUntil) > now
138
+ }
139
+
130
140
  /** @param {Deps} deps @param {Ctx} ctx */
131
141
  async function schedule(deps, ctx) {
132
142
  await each(
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * The Dispatch phase as a graph: a `q:intake` issue is triaged by a one-shot `claude -p` worker whose final
4
4
  * message carries a typed verdict ({@link TriageResult}), then moved to `q:task`, moved to `q:human`, or closed as
5
- * a duplicate. Same conventions as the task graph (graphs/task.mjs): each node declares its queue label and
5
+ * a duplicate or obsolete, or deferred to be triaged again later. Same conventions as the task graph (graphs/task.mjs): each node declares its queue label and
6
6
  * whether it holds `running`, and a node's write is the marker first, then the labels via `move()`.
7
7
  *
8
8
  * The triage worker runs in a read-only checkout (workers.mjs `readOnly`): detached at the base branch, no install,
@@ -28,7 +28,7 @@ import { task } from './task.mjs'
28
28
  */
29
29
 
30
30
  /** The nodes an issue in `q:intake` can rest at; a marker elsewhere starts triage over at attempt 1. */
31
- const INTAKE_NODES = new Set(['start-triage', 'triaging', 'retry-triage'])
31
+ const INTAKE_NODES = new Set(['start-triage', 'triaging', 'retry-triage', 'deferred'])
32
32
 
33
33
  /** The pseudo-branch that names an issue's triage checkout (`<root>/triage-<n>`); never created. @param {number} n */
34
34
  export const triageBranch = (n) => `cambium/triage-${n}`
@@ -107,6 +107,8 @@ const verdictOf = (/** @type {Triaged} */ o) => (o.exit === 'triaged' ? o.result
107
107
  const actionable = (/** @type {Triaged} */ o) => verdictOf(o) === 'actionable'
108
108
  const needsHuman = (/** @type {Triaged} */ o) => verdictOf(o) === 'needs-human'
109
109
  const duplicate = (/** @type {Triaged} */ o) => verdictOf(o) === 'duplicate'
110
+ const obsolete = (/** @type {Triaged} */ o) => verdictOf(o) === 'obsolete'
111
+ const defer = (/** @type {Triaged} */ o) => verdictOf(o) === 'defer'
110
112
 
111
113
  /** @param {DispatchCtx} ctx */
112
114
  export const lostLeaseOf = (ctx) => ({
@@ -148,6 +150,7 @@ const startTriage = declare(
148
150
  }
149
151
  await land(ctx, 'triaging', {
150
152
  ...m0,
153
+ deferUntil: null,
151
154
  host: config.host,
152
155
  start: iso(ctx.tick.now),
153
156
  input: { attempt: m0.attempt },
@@ -170,7 +173,16 @@ const startTriage = declare(
170
173
  readOnly: true,
171
174
  // This node's cambium.node span, so Claude Code's own spans (when worker.env turns them on) join the trace.
172
175
  env: ctx.traceparent ? { TRACEPARENT: ctx.traceparent } : undefined,
173
- buildPrompt: (agentsMd) => triagePrompt({ repo: slug, baseBranch: repo.baseBranch, issue, queued, agentsMd }),
176
+ buildPrompt: (agentsMd) =>
177
+ triagePrompt({
178
+ repo: slug,
179
+ baseBranch: repo.baseBranch,
180
+ issue,
181
+ queued,
182
+ agentsMd,
183
+ deferHours: caps.deferHours,
184
+ deferred: m0.deferReason ? { count: m0.defers ?? 0, reason: m0.deferReason } : null,
185
+ }),
174
186
  })
175
187
  } catch (err) {
176
188
  return {
@@ -416,6 +428,98 @@ const closeDuplicate = declare(
416
428
  { queue: null, running: false },
417
429
  )
418
430
 
431
+ const DeferIn = z.object({ reason: z.string(), recheckHours: z.number().optional(), log: z.string() })
432
+ const deferred = declare(
433
+ defineNode({
434
+ name: 'deferred',
435
+ input: DeferIn,
436
+ output: z.discriminatedUnion('to', [
437
+ z.object({ to: z.literal('wait'), until: z.string() }),
438
+ z.object({ to: z.literal('human'), ...failure }),
439
+ ]),
440
+ /**
441
+ * Defer: the verdict hangs on something a machine can check later (a CD run, a release, a merge). The issue stays
442
+ * in `q:intake`, resting here until `deferUntil`; Schedule skips it until then, then triage runs again with this
443
+ * reason in its prompt. A defer is not a failed attempt; `phases.dispatch.maxDefers` bounds them.
444
+ * @param {z.infer<typeof DeferIn>} d @param {DispatchCtx} ctx
445
+ */
446
+ run: async (d, ctx) => {
447
+ const issue = issueOf(ctx)
448
+ const m = markerOf(issue)
449
+ const { deferHours, maxDefers } = ctx.config.phases.dispatch
450
+ const defers = (m.defers ?? 0) + 1
451
+ if (defers > maxDefers)
452
+ return {
453
+ to: 'human',
454
+ reason: `deferred ${maxDefers} times without an answer. Last: ${d.reason}`,
455
+ outcome: 'budget',
456
+ }
457
+ const hours = d.recheckHours ?? deferHours
458
+ const until = iso(ctx.tick.now + hours * 60 * MIN)
459
+ await land(ctx, 'deferred', {
460
+ ...withHistory(m, {
461
+ at: iso(ctx.tick.now),
462
+ attempt: m.attempt,
463
+ outcome: 'defer',
464
+ reason: d.reason,
465
+ log: d.log,
466
+ }),
467
+ defers,
468
+ deferUntil: until,
469
+ deferReason: d.reason,
470
+ host: null,
471
+ start: null,
472
+ input: null,
473
+ })
474
+ ctx.log('info', `triage deferred until ${until} (${defers}/${maxDefers}): ${d.reason.split('\n')[0]}`, {
475
+ repo: ctx.subject.slug,
476
+ issue: issue.number,
477
+ })
478
+ return { to: 'wait', until }
479
+ },
480
+ }),
481
+ { queue: Q.intake, running: false },
482
+ )
483
+
484
+ const ObsIn = z.object({ reason: z.string(), log: z.string() })
485
+ const closeObsolete = declare(
486
+ defineNode({
487
+ name: 'close-obsolete',
488
+ input: ObsIn,
489
+ output: Empty,
490
+ /** Out of every queue, closed as not planned with triage's evidence. @param {z.infer<typeof ObsIn>} d @param {DispatchCtx} ctx */
491
+ run: async (d, ctx) => {
492
+ const { slug } = ctx.subject
493
+ const issue = issueOf(ctx)
494
+ const m = markerOf(issue)
495
+ await land(
496
+ ctx,
497
+ 'close-obsolete',
498
+ {
499
+ ...withHistory(m, {
500
+ at: iso(ctx.tick.now),
501
+ attempt: m.attempt,
502
+ outcome: 'obsolete',
503
+ reason: d.reason,
504
+ log: d.log,
505
+ }),
506
+ host: null,
507
+ start: null,
508
+ input: null,
509
+ },
510
+ { status: 'done' },
511
+ )
512
+ await ctx.github.close(slug, issue.number, `Obsolete: ${d.reason}\n\nClosed by cambium.`, {
513
+ reason: 'not_planned',
514
+ })
515
+ issue.state = 'CLOSED'
516
+ ctx.log('info', 'obsolete; closed as not planned', { repo: slug, issue: issue.number })
517
+ return {}
518
+ },
519
+ }),
520
+ { queue: null, running: false },
521
+ )
522
+
419
523
  /** @param {unknown} err */
420
524
  const errText = (err) => /** @type {Error} */ (err)?.message ?? String(err)
421
525
 
@@ -424,7 +528,7 @@ export const dispatch = defineGraph({
424
528
  name: 'dispatch',
425
529
  version: 1,
426
530
  entry: { queue: Q.intake, node: 'start-triage', input: () => ({}) },
427
- nodes: [startTriage, triaging, retryTriage, toTask, toHuman, closeDuplicate],
531
+ nodes: [startTriage, triaging, retryTriage, toTask, toHuman, closeDuplicate, deferred, closeObsolete],
428
532
  edges: [
429
533
  ['start-triage', 'triaging', started, (o) => ({ attempt: o.attempt })],
430
534
  ['start-triage', 'to-human', budgetSpent],
@@ -433,6 +537,8 @@ export const dispatch = defineGraph({
433
537
  ['triaging', 'retry-triage', leaseLost],
434
538
  ['triaging', 'to-task', actionable, (o) => ({ ...pick(o.result, ['reason', 'title', 'acceptance']), log: o.log })],
435
539
  ['triaging', 'close-duplicate', duplicate, (o) => ({ ...pick(o.result, ['duplicateOf', 'reason']), log: o.log })],
540
+ ['triaging', 'deferred', defer, (o) => ({ ...pick(o.result, ['reason', 'recheckHours']), log: o.log })],
541
+ ['triaging', 'close-obsolete', obsolete, (o) => ({ reason: o.result.reason, log: o.log })],
436
542
  ['triaging', 'to-human', needsHuman, (o) => ({ reason: o.result.reason, outcome: 'needs-human', log: o.log })],
437
543
  ['triaging', 'to-human'],
438
544
  ['retry-triage', 'start-triage', attemptsLeft, () => ({})],
@@ -440,6 +546,9 @@ export const dispatch = defineGraph({
440
546
  ['to-task', END],
441
547
  ['to-human', END],
442
548
  ['close-duplicate', END],
549
+ ['deferred', 'to-human', budgetSpent],
550
+ ['deferred', END],
551
+ ['close-obsolete', END],
443
552
  ],
444
553
  })
445
554
 
package/src/marker.mjs CHANGED
@@ -43,8 +43,13 @@
43
43
  * lastFailure?: string | null,
44
44
  * mergeRefusal?: { sha: string | null, at: string, reason: string } | null,
45
45
  * triage?: { title?: string, acceptance?: string[] } | null,
46
+ * defers?: number,
47
+ * deferUntil?: string | null,
48
+ * deferReason?: string | null,
46
49
  * }} Marker
47
50
  * `mergeRefusal`: the last `graft pr merge` cambium was refused (task graph `merge`), and on which head.
51
+ * `defers`, `deferUntil`, `deferReason`: the dispatch graph's `deferred` node: how many times triage deferred, until
52
+ * when, and what the next triage should check.
48
53
  * `triage`: what the dispatch graph's triage added when it handed the issue to `q:task`; the task prompt shows it.
49
54
  * @typedef {{ graph: string, entryNode: string, nodes?: Iterable<string> }} QueueOwner
50
55
  */
@@ -172,7 +177,8 @@ export function renderMarker(input, { maxAttempts } = {}) {
172
177
  ` · attempt ${marker.attempt}${of}` +
173
178
  (marker.pr ? ` · PR #${marker.pr}` : '') +
174
179
  (marker.host ? ` · host \`${marker.host}\`` : '') +
175
- (marker.start ? ` · started ${marker.start}` : ''),
180
+ (marker.start ? ` · started ${marker.start}` : '') +
181
+ (marker.node === 'deferred' && marker.deferUntil ? ` · re-triage after ${marker.deferUntil}` : ''),
176
182
  ]
177
183
  if (marker.lastFailure)
178
184
  lines.push(
@@ -21,8 +21,9 @@ export const DISPATCH_NOT_BUILT = 'dispatch phase is not built yet; q:intake iss
21
21
  /** The verdict a triage worker ends with, as the last JSON block of its final message. */
22
22
  export const TriageResult = z
23
23
  .object({
24
- verdict: z.enum(['actionable', 'needs-human', 'duplicate']),
24
+ verdict: z.enum(['actionable', 'needs-human', 'duplicate', 'defer', 'obsolete']),
25
25
  duplicateOf: z.number().int().positive().optional(),
26
+ recheckHours: z.number().positive().max(168).optional(),
26
27
  reason: z.string().trim().min(1),
27
28
  title: z.string().trim().min(1).optional(),
28
29
  acceptance: z.array(z.string().trim().min(1)).optional(),
@@ -109,34 +110,37 @@ export function readTriage(log, issue) {
109
110
  * @param {{
110
111
  * repo: string, baseBranch: string, issue: import('../github.mjs').Issue,
111
112
  * queued: { number: number, title: string, labels: string[] }[], agentsMd: string | null,
113
+ * deferred?: { count: number, reason: string } | null, deferHours?: number,
112
114
  * }} input
113
115
  */
114
- export function triagePrompt({ repo, baseBranch, issue, queued, agentsMd }) {
116
+ export function triagePrompt({ repo, baseBranch, issue, queued, agentsMd, deferred = null, deferHours = 6 }) {
115
117
  const others = queued
116
118
  .filter((q) => q.number !== issue.number)
117
119
  .map((q) => `- #${q.number} ${q.title} (${q.labels.filter((l) => l.startsWith('q:')).join(', ') || 'no queue'})`)
118
120
  .join('\n')
119
121
  return `You are a triage worker started by cambium, the scheduler, in a read-only checkout of ${repo} at origin/${baseBranch}.
120
- Nobody is watching this session and nobody will answer a question: never ask one and wait. Where you would ask a human, that is your verdict (needs-human).
122
+ Nobody is watching this session and nobody will answer a question: never ask one and wait. Where you would ask a human about a decision only a human can make, that is your verdict (needs-human). Where you would ask a human to check something, check it yourself, or defer until it can be checked: a human is never the way to verify what a machine can.
121
123
 
122
124
  Your one job: decide what happens to GitHub issue #${issue.number} (below), which is waiting in the intake queue. You do not do the work. You do not edit files, commit, publish, comment, label or close anything; cambium makes every move on your verdict.
123
125
 
124
126
  Verdicts:
125
127
  - actionable: a worker could do it unattended from what is written (plus what you add), and would know when it is done. It goes to the task queue. When the issue lacks a clear task or checkable acceptance criteria, give \`title\` (an imperative task title) and \`acceptance\` (checks a reviewer can verify; CI green is always required, so do not list only that). cambium posts them on the issue and hands them to the task worker.
126
- - needs-human: too foggy to ticket; a decision only a human can make (direction, priority, money, access, policy); information you cannot find; or work that is not a code change in this repository. \`reason\` says exactly what the human must decide or supply.
128
+ - needs-human: too foggy to ticket; a decision only a human can make (direction, priority, money, access, policy); information no one but a human has; or work that is not a code change in this repository. \`reason\` says exactly what the human must decide or supply. Never for something a machine can check, now or later.
127
129
  - duplicate: the same work as another issue, open or closed. \`duplicateOf\` is that issue's number (never #${issue.number}); \`reason\` says why they are the same.
130
+ - obsolete: the work no longer applies, and you verified it: the code path is gone, the bug is already fixed on ${baseBranch}, or its verification already passed. cambium closes it as not planned. \`reason\` gives the evidence (commit, file, run).
131
+ - defer: the verdict hangs on something a machine can check later but not yet: a CI or CD run that has not happened, a release, a PR still merging, a deploy, an upstream fix. cambium triages it again after \`recheckHours\` (default ${deferHours}). \`reason\` says exactly what to check next time and what each answer means (e.g. "next main cd run green → obsolete; red → actionable").
128
132
 
129
133
  How to look:
130
134
  - Read the code here (Read, Glob, Grep) to judge what the change touches and whether it already exists.
131
135
  - Read an issue with \`graft issue read <n>\`; search with \`graft api GET '/search/issues?q=repo:${repo}+is:issue+<words>'\`. Never \`gh\`.
132
- - Be quick: a verdict, not an investigation. When in doubt between actionable and needs-human, choose needs-human.
136
+ - Be quick: a verdict, not an investigation. When in doubt whether the work is clear enough to do, choose needs-human; when in doubt whether something is true, check it, or defer until it can be checked.
133
137
 
134
138
  End your final message with exactly one fenced JSON block, and nothing after it:
135
139
  \`\`\`json
136
- { "verdict": "actionable" | "needs-human" | "duplicate", "duplicateOf": 123, "reason": "…", "title": "…", "acceptance": ["…"] }
140
+ { "verdict": "actionable" | "needs-human" | "duplicate" | "obsolete" | "defer", "duplicateOf": 123, "recheckHours": 6, "reason": "…", "title": "…", "acceptance": ["…"] }
137
141
  \`\`\`
138
- \`duplicateOf\` only for duplicate; \`title\` and \`acceptance\` only for actionable, and optional. A missing or malformed block sends the issue to a human with the error.
139
- ${others ? `\nOther issues in cambium's queues right now:\n${others}\n` : ''}
142
+ \`duplicateOf\` only for duplicate; \`recheckHours\` only for defer, and optional; \`title\` and \`acceptance\` only for actionable, and optional. A missing or malformed block sends the issue to a human with the error.
143
+ ${deferred ? `\nThis is re-triage ${deferred.count + 1}: an earlier triage deferred it to check this:\n${deferred.reason}\nCheck it now. If it still cannot be checked, defer again.\n` : ''}${others ? `\nOther issues in cambium's queues right now:\n${others}\n` : ''}
140
144
  --- Issue #${issue.number}: ${issue.title} (${issue.url})
141
145
  ${issue.body}
142
146
  ${agentsMd ? `\n--- AGENTS.md (the contract a task worker will follow)\n${agentsMd}` : ''}`