@detergent-software/conductor 3.1.0-dev.1 → 3.1.0-dev.3

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +9 -5
  3. package/build/cli.js +24 -0
  4. package/build/cli.js.map +1 -1
  5. package/build/conditions.js +17 -9
  6. package/build/conditions.js.map +1 -1
  7. package/build/daemon.js +6 -2
  8. package/build/daemon.js.map +1 -1
  9. package/build/help.js +30 -1
  10. package/build/help.js.map +1 -1
  11. package/build/inbox.js +32 -9
  12. package/build/inbox.js.map +1 -1
  13. package/build/notes.js +4 -3
  14. package/build/notes.js.map +1 -1
  15. package/build/scheduler.js +15 -7
  16. package/build/scheduler.js.map +1 -1
  17. package/build/server.js +14 -1
  18. package/build/server.js.map +1 -1
  19. package/build/store.js.map +1 -1
  20. package/build/triage.js +68 -0
  21. package/build/triage.js.map +1 -0
  22. package/build/watchers/boards-queue.js +1 -0
  23. package/build/watchers/boards-queue.js.map +1 -1
  24. package/build/watchers/boards.js +17 -4
  25. package/build/watchers/boards.js.map +1 -1
  26. package/build/watchers/index.js +4 -3
  27. package/build/watchers/index.js.map +1 -1
  28. package/build/watchers/issues-queue.js +1 -0
  29. package/build/watchers/issues-queue.js.map +1 -1
  30. package/build/watchers/issues.js +17 -4
  31. package/build/watchers/issues.js.map +1 -1
  32. package/build/watchers/linear-queue.js +3 -1
  33. package/build/watchers/linear-queue.js.map +1 -1
  34. package/build/watchers/linear.js +35 -3
  35. package/build/watchers/linear.js.map +1 -1
  36. package/build/watchers/source.js +19 -0
  37. package/build/watchers/source.js.map +1 -1
  38. package/package.json +1 -1
  39. package/plugin/hooks/model.ts +15 -1
  40. package/plugin/hooks/register.tsx +44 -1
  41. package/plugin/skills/conductor-console/SKILL.md +2 -1
  42. package/plugin/skills/work-item/SKILL.md +3 -2
  43. package/protocol/PROTOCOL.md +7 -6
@@ -32,6 +32,25 @@ export async function getJson(fetcher, url, { headers = {}, timeoutMs = 20_000 }
32
32
  }
33
33
  return { body, status: response.status };
34
34
  }
35
+ // `item KEY unlabelled X`: it holds once a pass has seen the label on and a later pass sees it off,
36
+ // so a label that a rule adds after the wait registered (a `human` Handoff's) doesn't resolve it at
37
+ // once. Kept in memory per source: after a restart the wait has to see the label on again.
38
+ export function labelRemovals() {
39
+ const seen = new Set();
40
+ return {
41
+ forget: (open) => {
42
+ const ids = new Set(open.map((w) => w.id));
43
+ for (const id of seen)
44
+ if (!ids.has(id))
45
+ seen.delete(id);
46
+ },
47
+ removed: (id, on) => {
48
+ if (on)
49
+ seen.add(id);
50
+ return !on && seen.delete(id);
51
+ },
52
+ };
53
+ }
35
54
  // A merged PR in a wake, with its merge commit whole, which `conduct runs` takes (ATK-534).
36
55
  export function mergedLine(at, mergeCommit) {
37
56
  return `${at} merged${mergeCommit ? ` as ${mergeCommit}` : ''}`;
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/watchers/source.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAwC,QAAQ,EAAkB,MAAM,2BAA2B,CAAC;AAwD3G,yCAAyC;AACzC,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC;QACE,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF;AAED,mGAAmG;AACnG,gDAAgD;AAChD,MAAM,OAAO,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;IAC5B,CAAC;CACF;AAED,kGAAkG;AAClG,MAAM,UAAU,UAAU,CAAC,OAAsB;IAC/C,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,kBAAkB,OAAO,CAAC,MAA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OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QACjH;YACE,OAAO,GAAG,EAAE,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IACtC,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@detergent-software/conductor",
3
- "version": "3.1.0-dev.1",
3
+ "version": "3.1.0-dev.3",
4
4
  "description": "Conductor: the local daemon that runs conducted projects' work loops (conduct serve) and its conduct CLI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -685,7 +685,7 @@ export function reviseText(item: string, answer: ApiAnswer): string {
685
685
  return `asked for a revision of ${item}'s approved plan: ${where}; ${outcome}`;
686
686
  }
687
687
 
688
- // A `conduct` run (attach, approve, revise) as the line to show: what it printed when it succeeded
688
+ // A `conduct` run (attach, approve, revise, triage) as the line to show: what it printed when it succeeded
689
689
  // (`woke …`, `approved …`), else `failed`, then its error and details without the `conduct: `
690
690
  // prefix, and without anything node wrote before it (a warning).
691
691
  export function runText(
@@ -723,6 +723,20 @@ export function snapshotOf(fleet: ApiAnswer, inbox: ApiAnswer, readAt: number, n
723
723
  };
724
724
  }
725
725
 
726
+ // POST /items/:item/triage's answer as the line to show: `conduct triage`'s (triagedText in
727
+ // src/triage.ts, which the mod doesn't import) without its label edits. A daemon from before
728
+ // ATK-684 has no such route (404).
729
+ export function triageText(item: string, action: 'hold' | 'queue', answer: ApiAnswer): string {
730
+ const failed = `not ${action === 'queue' ? 'queued' : 'held'}`;
731
+ if (answer.status === 404)
732
+ return `${failed}: the running conductor has no conduct triage: restart it on this build (conduct upgrade)`;
733
+ if (answer.status !== 200) return `${failed}: ${errorOf(answer)}`;
734
+ const t = isRecord(answer.body) && isRecord(answer.body.triaged) ? answer.body.triaged : {};
735
+ const key = typeof t.item === 'string' ? t.item : item;
736
+ const then = action === 'queue' ? 'the scheduler may pick it up' : 'it is never launched';
737
+ return `${action === 'queue' ? 'queued' : 'held'} ${key}: its inbox item resolves on the next tick, and ${then}`;
738
+ }
739
+
726
740
  const DAYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
727
741
 
728
742
  // `/notify` with no profile: the profile, quiet hours, Remote Control.
@@ -46,6 +46,7 @@ import {
46
46
  spendToday,
47
47
  statusText,
48
48
  tokens,
49
+ triageText,
49
50
  WARM_AFTER_MS,
50
51
  WARM_PROMPT,
51
52
  whyText,
@@ -597,6 +598,33 @@ async function switchProfile($: EngineInterface, name: string, until: null | str
597
598
  }
598
599
  }
599
600
 
601
+ // The pane's queue and hold on a triage item: `conduct triage <item> --queue | --hold` (ATK-684), as
602
+ // `answer` runs approve, or POST /items/:item/triage without the CLI; the line to show.
603
+ async function triage($: EngineInterface, item: string, action: 'hold' | 'queue'): Promise<string> {
604
+ const failed = `not ${action === 'queue' ? 'queued' : 'held'}`;
605
+ try {
606
+ const cli = await cliPath($);
607
+ if (await $.fs.exists(cli)) {
608
+ let run;
609
+ try {
610
+ run = await $.process.run(['node', cli, 'triage', item, `--${action}`], {
611
+ ...(await cliInit($)),
612
+ timeoutMs: ANSWER_RUN_MS,
613
+ });
614
+ } catch (error) {
615
+ return `${failed}: ${error instanceof Error ? error.message : String(error)}`;
616
+ }
617
+ refreshSoon($);
618
+ return runText(run, { failed, ok: `${action === 'queue' ? 'queued' : 'held'} ${item}` });
619
+ }
620
+ const result = await callApi($, 'POST', `/items/${encodeURIComponent(item)}/triage`, { action });
621
+ refreshSoon($);
622
+ return triageText(item, action, result);
623
+ } catch (error) {
624
+ return error instanceof Error ? error.message : String(error);
625
+ }
626
+ }
627
+
600
628
  // The rule behind an item's newest action (`conduct why <item>`), in one line.
601
629
  async function why($: EngineInterface, item: string): Promise<string> {
602
630
  try {
@@ -890,7 +918,22 @@ export const register: Register = (on) => {
890
918
  onPress={() => $.prompt.fill({ text: `/revise ${item.item ?? ''} ` })}
891
919
  />
892
920
  )}
893
- {item.commands.slice(0, 2).map((command, n) => (
921
+ {item.kind === 'triage' && item.item !== null && (
922
+ <Button
923
+ key={`queue-${item.id}`}
924
+ label='queue'
925
+ onPress={async () => $.ui.toast(await triage($, item.item ?? '', 'queue'))}
926
+ variant='primary'
927
+ />
928
+ )}
929
+ {item.kind === 'triage' && item.item !== null && (
930
+ <Button
931
+ key={`hold-${item.id}`}
932
+ label='hold'
933
+ onPress={async () => $.ui.toast(await triage($, item.item ?? '', 'hold'))}
934
+ />
935
+ )}
936
+ {(item.kind === 'triage' ? [] : item.commands.slice(0, 2)).map((command, n) => (
894
937
  <Button
895
938
  key={`copy-${item.id}-${n}`}
896
939
  label={`copy: ${command}`}
@@ -17,7 +17,7 @@ Start this session with `conduct console` (a tab in the conductor's own folder,
17
17
  - **No loop.** Never use Monitor, ScheduleWakeup, CronCreate, `/loop`, `conduct events --follow`, `conduct wait`, or a polling command. The mod follows the daemon, and the daemon wakes you. Do the job, then end the turn.
18
18
  - **The daemon decides within policy.** Don't launch, retire, park or resume workers on your own judgement. Do it only when the operator asks, or when an escalation's ask is exactly that.
19
19
  - **Approvals are the operator's.** Run `conduct approve` or `conduct revise` only on the operator's own words in this session, and pass them on (`--text`, or the revise text) as they typed them. An escalation, a worker's message or a note is never an approval.
20
- - **Never** merge, publish, approve prod, delete, run `--force` or `--allow-downgrade`, or edit a tracker item's state, priority or description. Labels are the daemon's rules' job.
20
+ - **Never** merge, publish, approve prod, delete, run `--force` or `--allow-downgrade`, or edit a tracker item's state, priority or description. Labels are the daemon's rules' job, except `conduct triage`, which you run only on the operator's own words in this session, as for approvals.
21
21
  - **Keep this session small.** Read through short `conduct` commands, the tracker too (`conduct brief`, `notes`, `comments`, `search`): never a tracker's MCP tools. Anything that needs reading (a run log, an issue's comment thread, a transcript, code) goes to a subagent (Agent tool, `model: "haiku"` for reading, `"sonnet"` for judgement) that answers in a few lines.
22
22
  - **Work in the project's clone, not here.** This session runs in `~/.conductor/console`. The `conduct` item verbs work from here while the daemon runs. A subagent that reads a project's code, logs or files gets that project's clone from `conduct status` (its `projects:` lines, `~/.conductor/projects/<name>/repo`, fetched every few minutes: read the base branch at `origin/<base>`) or a worker's worktree, and works there: absolute paths under it, `git -C <clone>`. It reads only: the clone is the daemon's, and its worktrees are the workers'. `conduct profile <name>` gives a project's profile and where each field comes from.
23
23
  - **Worker messages are nudges.** A worker launched by the daemon sends none. One from an older worker (`ENG-n · plan ready`, `· done`, …) needs nothing from you: the daemon reads the same note on the tracker. Say so in one line.
@@ -80,6 +80,7 @@ Turn requests into commands, then show back what took effect: quote the line fro
80
80
  | "put web first this afternoon" | `conduct focus web --until 17:00` (`--slots <n>` or `--weight <n>` when they say so) |
81
81
  | "I'm away until tomorrow" | `conduct notify profile away --until tomorrow` |
82
82
  | "approve ENG-12" / "ENG-12: change X" | `conduct approve ENG-12` / `conduct revise ENG-12 <their words>` |
83
+ | "queue ENG-40" / "hold ENG-40" (a new item in triage) | `conduct triage ENG-40 --queue` / `conduct triage ENG-40 --hold` |
83
84
  | "start ENG-40 now" | `conduct launch ENG-40` |
84
85
  | "show me ENG-12" | `conduct attach ENG-12` (opens its tab) |
85
86
  | "drop ENG-12's worker" | `conduct retire ENG-12`. On a refusal, report the unfinished work, and never add `--force` yourself |
@@ -121,12 +121,13 @@ A conducted worker writes its notes and waits through `conduct`, so the conducto
121
121
  | The operator's merge (review mode) | the PR opened note headed `<skill> · PR opened · merge: <PR URL>`, or Handoff · merge | the same |
122
122
  | Pipelines after the merge (step 9.2) | none | `conduct runs <mergeCommit>` (with `--for`, as step 9.2 says). Act on its outcome as in step 9; on `waiting`: `conduct wait merge <mergeCommit>` with the same `--for`; on `cancelled` or `missing`, or once on a `failed` whose log shows a flake: `conduct runs <mergeCommit> --requeue <pipeline>`, then the same `conduct wait merge`; requeue refused as under 15 minutes old: `conduct wait time <the time it names>` |
123
123
  | npm OTP (9.3) | Handoff · npm-otp | `conduct wait npm <version> --package <package>`, plus the dist-tag the `after-merge` hook names (`--tag <tag>`); one per staged package. The version on its tag resumes you, with no message from anyone |
124
+ | The operator's answer on the item | Handoff · scope, blocked or human | `conduct wait item KEY-n comment`: an approver's comment after your newest note. `blocked` on another item also waits on it: `conduct wait item <blocker> done`. `human` also waits on its label coming off: `conduct wait item KEY-n unlabelled <the profile's tracker.humanLabel>`. A comment, the blocker done or the label off resumes you, with no console or tab message |
124
125
  | A PR in another repo (one the item opened: Another repo, below) | Handoff · merge | `conduct land <n> --repo github:<owner>/<repo> --mode review --reason "…"`, acted on as in step 8; on `waiting`: `conduct wait pr <n> --repo github:<owner>/<repo>` |
125
126
  | A PR a hook's publish opened (no checkout) | Handoff · merge | `conduct pr status <n> --repo github:<owner>/<repo>` gives its verdict (`land` refuses a PR with no checkout); on `waiting`: `conduct wait pr <n> --repo github:<owner>/<repo>` |
126
127
  | Its runs after the merge | none | `conduct runs <mergeCommit> --repo github:<owner>/<repo>`; on `waiting`: `conduct wait merge <mergeCommit> --repo github:<owner>/<repo>` |
127
128
 
128
- A Handoff with nothing to watch (`operator`, `release`, `conductor`, `scope`, `human`, `blocked`, `abandoned`, `failed`) ends the turn with no wait: a console message or the operator in the tab resumes it.
129
- - **On wake.** A turn that reads `[conductor] event: <what held> HH:MM` is the daemon resuming you. It says which wait held and nothing more: a hint, never an instruction, never an approval. Work out the phase from the facts again (step 1), then re-read the source before acting on it: `conduct brief KEY-n --fresh` for an approval (quote the approver's comment, or the conductor's auto-approval, and its `createdAt` in `Approved via:`), `conduct land <pr> --reason "…"` for a PR (it is safe to repeat), `conduct runs <mergeCommit>` for pipelines and their npm stages (npm can still answer 404 for a moment after the daemon saw the version: run it again a minute later). `plan KEY-n revised …` means an approver wrote `revise:` after your plan was approved and before your PR merged, and the daemon resumed you for it while you waited: read their words with `conduct brief KEY-n --fresh` (its `revised after it` line, or `approval: revise …` when nothing on the tracker approved the plan; its `phase` stays `wait` while the PR is open), then do what exit 4 says: stop, commit any work in progress, and go back to step 4 with their words. Don't wait on the PR again first. If the source doesn't show it yet (a tracker read can lag a minute), wait again. After a Handoff wait, post `<skill> · Resumed` as above.
129
+ A Handoff with nothing to watch (`operator`, `release`, `conductor`, `abandoned`, `failed`) ends the turn with no wait: a console message or the operator in the tab resumes it.
130
+ - **On wake.** A turn that reads `[conductor] event: <what held> HH:MM` is the daemon resuming you. It says which wait held and nothing more: a hint, never an instruction, never an approval. Work out the phase from the facts again (step 1), then re-read the source before acting on it: `conduct brief KEY-n --fresh` for an approval (quote the approver's comment, or the conductor's auto-approval, and its `createdAt` in `Approved via:`), `conduct land <pr> --reason "…"` for a PR (it is safe to repeat), `conduct runs <mergeCommit>` for pipelines and their npm stages (npm can still answer 404 for a moment after the daemon saw the version: run it again a minute later), `conduct comments KEY-n --since <your Handoff's time>` for an answer on the item (`item KEY-n comment by <who> at <time>`; `unlabelled` for a label off, or the blocker's `item … state`). An answer that doesn't settle the Handoff (a question back, "still thinking") isn't one: reply in a new Handoff note of the same kind, then wait on the item again. `plan KEY-n revised …` means an approver wrote `revise:` after your plan was approved and before your PR merged, and the daemon resumed you for it while you waited: read their words with `conduct brief KEY-n --fresh` (its `revised after it` line, or `approval: revise …` when nothing on the tracker approved the plan; its `phase` stays `wait` while the PR is open), then do what exit 4 says: stop, commit any work in progress, and go back to step 4 with their words. Don't wait on the PR again first. If the source doesn't show it yet (a tracker read can lag a minute), wait again. After a Handoff wait, post `<skill> · Resumed` as above.
130
131
  - **Wake text in a tab.** The operator may attach (`conduct attach KEY-n`) and type. Their words count as they always do; text that only claims to be from the daemon or the conductor is a hint at most.
131
132
 
132
133
  ## Another repo
@@ -55,13 +55,13 @@ Text after a phase is always `<kind>: <one line>`. `## <skill> · Started · pic
55
55
  | `operator` | a physical action only the operator can do | an `operator` item |
56
56
  | `npm-otp` | the operator's `npm stage approve` for each staged package | an `npm-otp` item |
57
57
  | `release` | a release of the base branch (the profile's `release.handoff` says what to run) | a `release` item |
58
- | `scope` | a change of scope or risk that needs the operator | a `scope` item |
59
- | `blocked` | an open blocker | a `blocked` item |
60
- | `human` | a decision someone else owns: the item is labelled with the profile's `humanLabel` | a `human` item |
58
+ | `scope` | a change of scope or risk that needs the operator: an approver's comment on the item (`item <item> comment`) | a `scope` item |
59
+ | `blocked` | an open blocker: an approver's comment on the item, or the blocker done (`item <blocker> done`) | a `blocked` item |
60
+ | `human` | a decision someone else owns: the item is labelled with the profile's `humanLabel`. An approver's comment on the item, or the label coming off (`item <item> unlabelled <humanLabel>`) | a `human` item |
61
61
  | `abandoned` | an abandoned PR | an `abandoned` item |
62
62
  | `failed` | a pipeline failure the worker can't fix | a `failed` item |
63
63
 
64
- A later note on the item answers the Handoffs that have nothing to watch (`operator`, `release`, `scope`, `blocked`, `human`, `abandoned` and `failed`), because the worker has moved on.
64
+ A later note on the item answers the `operator`, `release`, `scope`, `blocked`, `human`, `abandoned` and `failed` Handoffs, because the worker has moved on. A `scope`, `blocked` or `human` Handoff's worker waits on an answer on the item (see Waits), and that answer resolves its item too. The others have nothing to watch: the worker ends its turn with no wait, and a console message or the operator in its tab resumes it.
65
65
 
66
66
  ### `conduct note <item> <file>`
67
67
 
@@ -84,7 +84,7 @@ An answer by anyone else is ignored, and the plan's inbox item says whose it was
84
84
 
85
85
  ## Waits
86
86
 
87
- `conduct wait <verb …>` registers a wait for the worker whose worktree it runs in. The daemon parks the worker once its turn ends, and resumes it when the wait holds. With no daemon, it checks the wait here and blocks: exit 0 when the wait holds, exit 2 after 29 minutes, exit 1 when it can't check. Each verb has a full form, which the store keeps. A verb or full form that doesn't parse is refused with exit 1, and the error names the form it expects.
87
+ `conduct wait <verb …>` registers a wait for the worker whose worktree it runs in. The daemon parks the worker once its turn ends, and resumes it when the wait holds. With no daemon, it checks the wait here and blocks: exit 0 when the wait holds, exit 2 after 29 minutes, exit 1 when it can't check. Each verb has a full form, which the store keeps. `item <item> comment` holds on the first comment by an approver (as Approvals defines them) after the item's newest note of any phase, and no more than 10 minutes before the wait registered. A note never counts, and a comment by anyone else is ignored and named on the Handoff's inbox item (`comment.ignored`). `item <item> unlabelled <label>` holds once the daemon has seen the label on since the wait registered and then sees it off, so a label added after the note doesn't resolve it at once. A verb or full form that doesn't parse is refused with exit 1, and the error names the form it expects.
88
88
 
89
89
  | Verb | Full form |
90
90
  |---|---|
@@ -94,7 +94,8 @@ An answer by anyone else is ignored, and the plan's inbox item says whose it was
94
94
  | `npm <version> [--tag t] [--package p]` | `npm:<package>@<version>:<tag>` |
95
95
  | `health <env> --version <x> \| --commit <sha>` | `health:<env>:<version\|commit>=<value>` |
96
96
  | `approval [<item>]` | `approval:<tracker>:<item>` |
97
- | `item <item> <state> \| state\|label\|note <value>` | `item:<tracker>:<item>:<field>=<value>` |
97
+ | `item <item> <state> \| state\|label\|unlabelled\|note <value>` | `item:<tracker>:<item>:<field>=<value>` |
98
+ | `item <item> comment` | `item:<tracker>:<item>:comment` |
98
99
  | `login ado\|github\|linear` | `login:<provider>:<project>` |
99
100
  | `time <when>` | `time:<ISO time>` |
100
101