@synaplink/orqlaude 0.10.3 → 0.10.6

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
@@ -183,6 +183,171 @@ User says: *"Refactor the auth system — magic-link login, update the docs, add
183
183
  8. `orqlaude.collect` → three PR URLs and summaries.
184
184
  9. **NEW**: `orqlaude.review_prs(plan_id)` → spawns three reviewer agents, one per PR. Each reviews, runs tests, posts findings. You aggregate the second-round notes.
185
185
 
186
+ ## Asking the user (v0.10.4 pattern)
187
+
188
+ `ask_user` and its companion `wait_for_user_response` are the bounded-block loop primary Claude uses to put a question on Telegram and stay alive past the MCP host's 60s per-request timeout.
189
+
190
+ The split exists because Claude Desktop and Claude Code both use the SDK default `DEFAULT_REQUEST_TIMEOUT_MSEC = 60000`. v0.10.2's progress notifications turned out to be ignored unless the client passes `resetTimeoutOnProgress: true` (it doesn't), so a single blocking call can't outrun the host. Instead, `ask_user` blocks at most 45s (the new `initial_block_sec`, capped at 45). The question's overall lifetime is `total_timeout_sec` (default 900s, max 3600s) -- that's how long it stays answerable. If the user replies inside the first window, you get `status: "answered"`. Otherwise you get `status: "still_pending"` with a `short_id`, and the caller must invoke `wait_for_user_response(short_id)` to keep waiting.
191
+
192
+ Loop pattern (TS pseudocode):
193
+
194
+ ```ts
195
+ let result = await ask_user({
196
+ prompt: "Approve the auth refactor plan?",
197
+ options: ["Approve", "Hold off"],
198
+ total_timeout_sec: 1800,
199
+ });
200
+
201
+ while (result.status === "still_pending") {
202
+ result = await wait_for_user_response({ short_id: result.short_id });
203
+ }
204
+ // result.status is now "answered" / "timed_out" / "cancelled"
205
+ ```
206
+
207
+ Each call stays safely under 60s. A fast answer is one round-trip; a 5-minute wait is roughly 7 round-trips, no `ScheduleWakeup`-and-come-back required.
208
+
209
+ Telegram side is plain text only (no Markdown), so escaping bugs can't silently swallow a send. The notifier ships each question with `force_reply` enabled -- the user just types and their reply carries `reply_to_message.message_id`, which the bot matches back to the request. Inline-keyboard buttons fire the same answer path when `options` are provided; `/respond <short_id> <text>` remains as a manual fallback.
210
+
211
+ ## Autopilot daemon
212
+
213
+ A persistent orchestrator that ticks every 10 seconds, picks goals off the backlog, auto-reviews PRs, retries failed Agnets, and watches the budget. Opt-in -- nothing runs in the background unless you start it.
214
+
215
+ Five tick-loop phases:
216
+
217
+ 1. **Reconcile state** -- for every spawned Agnet, refresh from JSONL, PID, and exit-record; promote `died_at_launch` / `done` / `failed`.
218
+ 2. **Recover from failures** -- classify each failure via a Plan-billed `claude -p` turn, then retry with backoff, spawn a debugger Agnet, or escalate to the user via Telegram.
219
+ 3. **Auto-review PRs** -- fetch the diff, run a reviewer turn, apply the fleet template's auto-merge rule, and either `gh pr merge` or `gh pr comment`.
220
+ 4. **Pick the next goal** -- when the fleet is idle and autopilot is unpaused, pull the highest-priority unblocked goal from the backlog and prompt the user via Telegram.
221
+ 5. **Watch the budget** -- yellow / orange / red thresholds; auto-pause at orange.
222
+
223
+ CLI:
224
+
225
+ ```sh
226
+ orql autopilot start # foreground; daemonize with launchd / systemd / nohup
227
+ orql autopilot stop
228
+ orql autopilot pause # stop picking new work; in-flight Agnets keep running
229
+ orql autopilot resume
230
+ orql autopilot status
231
+ ```
232
+
233
+ Plan-billing note: the daemon **never** talks to the Anthropic API. Every intelligent decision (failure classifier, PR reviewer, Telegram intent classifier, template suggester) is a `claude -p` invocation. On the Max plan that bills like an interactive Claude Code session, and cache reads are free, so a full day of ticking burns a tiny fraction of quota.
234
+
235
+ ## Durable memory
236
+
237
+ A `memory.json` file at `<state_dir>/memory.json` holds long-lived facts that outlive plan lifecycles. Four spirit-themed categories, each with a different surfacing rule:
238
+
239
+ - **lore** -- facts about the user. Pinned, slow churn, injected into every spawned Agnet prompt. _Example: "Russian comments in CRM templates", "no auto-deploy on Fridays."_
240
+ - **playbook** -- code conventions. Scope-tagged by path-glob; injected when a fleet's scope overlaps. _Example: "migrations live in `<app>/migrations/`", "use AntD ConfigProvider for dark mode."_
241
+ - **ledger** -- decisions plus rationale. Append-only; surfaced when a similar decision recurs. _Example: "Sonnet over Opus for transcription, latency mattered more than depth."_
242
+ - **atlas** -- project map. Auto-updated by the post-PR review with one entry per touched file mapping path to purpose.
243
+
244
+ Pinned entries always load. Scope-tagged entries (typically playbook and atlas) auto-inject into a spawn prompt when the Agnet's worktree scope matches any of the entry's globs -- you don't have to remember to thread conventions through manually.
245
+
246
+ MCP tools:
247
+
248
+ ```
249
+ remember(category, key, value, { pinned?, scopeGlobs?, rationale? })
250
+ recall(category?, key?, scopeMatch?)
251
+ forget(category, key)
252
+ compose_memory_context(scopeGlobs?, max_tokens?)
253
+ ```
254
+
255
+ Older entries with the same `(category, key)` are soft-superseded: kept for history but invisible to read paths. `compose_memory_context` is the function the spawn pipeline uses internally; call it directly to preview the block that will be injected for a given scope before you commit to spawning.
256
+
257
+ ## Backlog
258
+
259
+ A `backlog.json` file holds `Goal` records -- durable task descriptions the daemon (or you) can pick from when idle.
260
+
261
+ Shape:
262
+
263
+ ```json
264
+ {
265
+ "id": "g_8f3...",
266
+ "title": "Rotate JWT signing keys quarterly",
267
+ "priority": 70,
268
+ "deadlineAt": "2026-06-30T00:00:00Z",
269
+ "dependsOn": ["g_5c1..."],
270
+ "createdAt": "2026-05-12T10:14:00Z",
271
+ "status": "pending"
272
+ }
273
+ ```
274
+
275
+ Priority is 0-100. `deadlineAt` boosts effective priority as the deadline approaches (linear ramp over the last 14 days, so something due tomorrow with priority 40 beats a no-deadline priority 70 item). `dependsOn` is a list of goal ids; a goal is blocked until every parent has `status: "done"`.
276
+
277
+ MCP tools:
278
+
279
+ ```
280
+ enqueue_goal(title, { priority?, deadlineAt?, dependsOn?, source? })
281
+ list_goals({ status?, includeBlocked? })
282
+ update_goal(id, { priority?, deadlineAt?, dependsOn?, status? })
283
+ pick_next_goal()
284
+ ```
285
+
286
+ `pick_next_goal` returns the highest-priority unblocked pending goal, factoring in deadline boost. The autopilot daemon calls this on every idle tick; when something comes back it surfaces the goal to the user via Telegram for confirmation before spawning a fleet, so you keep approval-in-the-loop even when the orchestrator is running unattended.
287
+
288
+ ## Fleet templates
289
+
290
+ Eight named patterns ship out of the box. Each defines a default Agnet layout, a suggested model per role (haiku / sonnet / opus), a default budget, and an `AutoMergeRule` the daemon applies to PRs produced by the fleet.
291
+
292
+ | id | what it does | auto-merge rule |
293
+ |---|---|---|
294
+ | `backend-feature` | Django/DRF: model + migration + serializer + viewset + admin + tests | requireCi, maxLoc 2500 |
295
+ | `frontend-feature` | React/AntD: components + hooks + i18n + tests | requireCi, maxLoc 2000 |
296
+ | `migration-only` | Schema change with backwards-compat reviewer (opus) | requireReviewerApprove; `blockOnMigrations: false` (migrations are the point) |
297
+ | `audit-sweep` | Multiple haiku auditors + sonnet synthesizer (read-only) | requireReviewerApprove (no merge) |
298
+ | `dep-upgrade` | Dep version bump + breaking-change patches + reviewer | requireCi, requireReviewerApprove |
299
+ | `i18n-pass` | Audit, then translator pass | requireCi, maxLoc 3000 |
300
+ | `test-coverage-fill` | Parallel testers; blocks PRs that touch prod code | requireCi, blockOnPaths globs for non-test files |
301
+ | `bug-hunt` | Reproducer Agnet then fixer Agnet (sequential) | requireReviewerApprove, requireCi |
302
+
303
+ MCP tools:
304
+
305
+ ```
306
+ list_fleet_templates()
307
+ suggest_fleet_template(goal_text) # Plan-billed turn picks the best fit
308
+ apply_fleet_template(template_id, { goal, scope, budget_override? })
309
+ ```
310
+
311
+ `suggest_fleet_template` makes a single `claude -p` call that returns `{ template_id, confidence, reason }`. The autopilot daemon uses this to turn a freeform goal description into a concrete fleet definition without manual plan authoring. `apply_fleet_template` then expands the chosen template into a real plan via `create_plan`, with the template's auto-merge rule attached for later use by the auto-review pipeline.
312
+
313
+ ## Auto-PR-review
314
+
315
+ When the autopilot daemon is running, every PR produced by a template-driven fleet gets a reviewer turn and an auto-merge attempt.
316
+
317
+ The reviewer turn runs `gh pr view` for the diff and metadata, feeds them into a strict-JSON `claude -p` prompt, and parses the response `{ verdict, blockers, suggestions, summary }` where `verdict` is `APPROVE` / `REQUEST_CHANGES` / `COMMENT`. The summary is appended as a PR comment regardless of verdict so you have a paper trail.
318
+
319
+ The fleet template's `AutoMergeRule` then decides whether to merge:
320
+
321
+ ```json
322
+ {
323
+ "requireReviewerApprove": true,
324
+ "requireCi": true,
325
+ "maxLoc": 2500,
326
+ "blockOnMigrations": false,
327
+ "blockOnPaths": ["**/settings.py", "**/secrets/**"]
328
+ }
329
+ ```
330
+
331
+ - `requireReviewerApprove` -- the reviewer's verdict must be `APPROVE`.
332
+ - `requireCi` -- `gh pr checks` must come back all-green.
333
+ - `maxLoc` -- additions plus deletions under cap. Larger PRs route to user.
334
+ - `blockOnMigrations` -- refuses PRs that add files under `*/migrations/` (used by templates that aren't supposed to touch schema).
335
+ - `blockOnPaths` -- refuses PRs touching specific globs.
336
+
337
+ If every check passes the daemon runs `gh pr merge --squash --auto --delete-branch`. Otherwise it `gh pr comment`s with the verdict and blockers and leaves the PR open. Each review writes a `ledger` memory entry so the next fleet inherits the rationale.
338
+
339
+ ## Cost guardrails
340
+
341
+ A `guardrails.json` rolling ledger tracks billed tokens against two windows: a 5-hour rolling window (matching Anthropic's Plan reset cadence) and a per-local-day soft cap (default 30M billed tokens).
342
+
343
+ Three threshold bands on the rolling window:
344
+
345
+ - **yellow** at 60% -- notify the user, daemon slows inter-tick interval.
346
+ - **orange** at 80% -- daemon auto-pauses; refuses to start new fleets; in-flight Agnets keep running but no new spawns happen.
347
+ - **red** at 95% -- halt entirely; await user `/resume` after the next 5h reset.
348
+
349
+ The day soft-cap applies independently of the rolling window -- you can sit comfortably in green on the 5h window and still cross the day cap if you've been running multiple windows back to back. Both checks happen on every autopilot tick, and the orange auto-pause uses the same code path as `orql autopilot pause`: it surfaces in `orql autopilot status` and is undone with `orql autopilot resume` once the window has rolled.
350
+
186
351
  ## State
187
352
 
188
353
  orqlaude resolves its state directory at startup using this order (first match wins):
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,94 @@
1
+ import { test } from "node:test";
2
+ import assert from "node:assert/strict";
3
+ import { promises as fs } from "node:fs";
4
+ import path from "node:path";
5
+ import os from "node:os";
6
+ /**
7
+ * v0.10.5 — spawn_via_cli pre-allocates session_id and embeds it in the
8
+ * fleet protocol prompt + checkin handler accepts rotation for freshly
9
+ * spawned tasks.
10
+ *
11
+ * Bug it fixes: orqlaude self-test fleet d47c0448 — Verdant tried to
12
+ * checkin with $CLAUDE_CODE_SESSION_ID (Claude Code's internal value)
13
+ * which differed from the --session-id flag orqlaude passed. The
14
+ * pre-allocation had already filled task.spawnedSessionId so
15
+ * unclaimedTaskById returned undefined, falling through to
16
+ * task_already_claimed rejection.
17
+ */
18
+ async function tempDir(label) {
19
+ return fs.mkdtemp(path.join(os.tmpdir(), `orqlaude-v0105-${label}-`));
20
+ }
21
+ test("v0.10.5: spawn_via_cli sessionId override flows through to --session-id flag", async () => {
22
+ // Verify the SpawnViaCliInput.sessionId field is honored. We can't actually
23
+ // spawn claude in unit tests (no binary), but we can confirm the type +
24
+ // pass-through logic by reading the source.
25
+ // import.meta.dirname under built dist/__tests__/ → ../../src/lib/spawn_cli.ts
26
+ // import.meta.dirname under built dist/__tests__/ → ../../src/lib/spawn_cli.ts
27
+ const src = await fs.readFile(path.join(import.meta.dirname, "..", "..", "src", "lib", "spawn_cli.ts"), "utf8");
28
+ // The fallback `?? randomUUID()` should be present so omitted sessionId
29
+ // still produces a uuid.
30
+ assert.ok(src.includes("input.sessionId ?? randomUUID()"), "sessionId fallback wiring missing");
31
+ assert.ok(src.includes("sessionId?:"), "sessionId field missing from SpawnViaCliInput");
32
+ });
33
+ test("v0.10.5: checkin accepts session-id rotation for freshly spawned tasks", async () => {
34
+ // Simulate the v0.10.4-and-earlier failure mode + verify v0.10.5 handles it.
35
+ const dir = await tempDir("checkin-rotate");
36
+ // Build a minimal state file with a pre-allocated spawnedSessionId.
37
+ const stateFile = path.join(dir, "orqlaude-state.json");
38
+ const planId = "plan-test-id-fixed";
39
+ const taskId = "task-test-id-fixed";
40
+ const preallocatedSessionId = "preallocated-session-id";
41
+ const agentSessionId = "agent-different-session-id";
42
+ const justStartedAt = Date.now() - 5_000; // 5s ago - within 60s grace
43
+ await fs.writeFile(stateFile, JSON.stringify({
44
+ schemaVersion: 3,
45
+ plans: {
46
+ [planId]: {
47
+ id: planId,
48
+ createdAt: Date.now(),
49
+ rootTask: "test",
50
+ budgetCapTokens: 1000,
51
+ perAgentCapTokens: 1000,
52
+ status: "running",
53
+ tasks: [
54
+ {
55
+ id: taskId,
56
+ title: "t",
57
+ prompt: "p",
58
+ tldr: "t",
59
+ status: "running",
60
+ spawnedSessionId: preallocatedSessionId,
61
+ startedAt: justStartedAt,
62
+ },
63
+ ],
64
+ notes: [],
65
+ messages: [],
66
+ claims: [],
67
+ userNotifications: [],
68
+ userResponseRequests: [],
69
+ userStreams: [],
70
+ },
71
+ },
72
+ }));
73
+ // We can't easily call the registered tool callback directly (it's wrapped
74
+ // through MCP). But we CAN verify the broker.ts source contains the
75
+ // rotation logic by reading it.
76
+ const brokerSrc = await fs.readFile(path.join(import.meta.dirname, "..", "..", "src", "tools", "broker.ts"), "utf8");
77
+ assert.ok(brokerSrc.includes("wasJustSpawned"), "broker.ts should have the wasJustSpawned rotation check");
78
+ assert.ok(brokerSrc.includes("noNotesYet"), "broker.ts should also gate rotation on no-notes-yet");
79
+ assert.ok(brokerSrc.includes("60_000"), "broker.ts should use 60s grace window for rotation");
80
+ });
81
+ test("v0.10.5: buildSpawnPrompt embeds session_id when provided", async () => {
82
+ // Pure source-level check that the prompt builder honors the sessionId arg.
83
+ const dispatchSrc = await fs.readFile(path.join(import.meta.dirname, "..", "..", "src", "tools", "dispatch.ts"), "utf8");
84
+ assert.ok(dispatchSrc.includes("sessionId?: string"), "buildSpawnPrompt should accept optional sessionId");
85
+ assert.ok(dispatchSrc.includes("EXACT value, pre-allocated by orqlaude"), "When sessionId is provided, the prompt should instruct the agent to use it exactly");
86
+ assert.ok(dispatchSrc.includes("NOT $CLAUDE_CODE_SESSION_ID"), "The protocol prompt should explicitly tell the agent NOT to use the env var");
87
+ });
88
+ test("v0.10.5: spawn_via_cli handler pre-generates session_id before buildSpawnPrompt", async () => {
89
+ const dispatchSrc = await fs.readFile(path.join(import.meta.dirname, "..", "..", "src", "tools", "dispatch.ts"), "utf8");
90
+ assert.ok(dispatchSrc.includes("presetSessionId = randomUUID()"), "spawn_via_cli handler should pre-allocate session_id with randomUUID");
91
+ assert.ok(/buildSpawnPrompt\([^)]*presetSessionId\)/.test(dispatchSrc), "presetSessionId should be passed into buildSpawnPrompt");
92
+ assert.ok(/sessionId:\s*presetSessionId/.test(dispatchSrc), "presetSessionId should be passed into spawnAgnetViaCli as sessionId");
93
+ });
94
+ //# sourceMappingURL=v0105.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v0105.test.js","sourceRoot":"","sources":["../../src/__tests__/v0105.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB;;;;;;;;;;;GAWG;AAEH,KAAK,UAAU,OAAO,CAAC,KAAa;IAClC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,kBAAkB,KAAK,GAAG,CAAC,CAAC,CAAC;AACxE,CAAC;AAED,IAAI,CAAC,8EAA8E,EAAE,KAAK,IAAI,EAAE;IAC9F,4EAA4E;IAC5E,wEAAwE;IACxE,4CAA4C;IAC5C,+EAA+E;IAC/E,+EAA+E;IAC/E,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,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AW,CAAC,QAAQ,CAAC,wCAAwC,CAAC,EAC9D,oFAAoF,CACrF,CAAC;IACF,MAAM,CAAC,EAAE,CACP,WAAW,CAAC,QAAQ,CAAC,6BAA6B,CAAC,EACnD,6EAA6E,CAC9E,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,iFAAiF,EAAE,KAAK,IAAI,EAAE;IACjG,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,QAAQ,CACnC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,CAAC,EACzE,MAAM,CACP,CAAC;IACF,MAAM,CAAC,EAAE,CACP,WAAW,CAAC,QAAQ,CAAC,gCAAgC,CAAC,EACtD,sEAAsE,CACvE,CAAC;IACF,MAAM,CAAC,EAAE,CACP,0CAA0C,CAAC,IAAI,CAAC,WAAW,CAAC,EAC5D,wDAAwD,CACzD,CAAC;IACF,MAAM,CAAC,EAAE,CACP,8BAA8B,CAAC,IAAI,CAAC,WAAW,CAAC,EAChD,qEAAqE,CACtE,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function cmdBacklog(stateDir: string, args: string[]): Promise<number>;
@@ -0,0 +1,318 @@
1
+ import { BacklogStore } from "../lib/backlog.js";
2
+ import { style, styleStatus, banner } from "../lib/style.js";
3
+ import { hasJsonFlag, emitJson } from "../lib/json_out.js";
4
+ import { errorLine, successLine } from "../lib/error_ui.js";
5
+ /**
6
+ * `orql backlog` - inspect and curate the goal backlog the autopilot picks
7
+ * from when the fleet is idle.
8
+ *
9
+ * list [--status queued|planning|awaiting_approval|running|done|cancelled|deferred|all] [--json]
10
+ * show <id>
11
+ * add <title> [--priority N] [--deadline <iso>] [--tag t1,t2]
12
+ * done <id>
13
+ * cancel <id>
14
+ * next
15
+ *
16
+ * `<id>` accepts either the full uuid or its 8-char shortId.
17
+ */
18
+ const VALID_STATUSES = new Set([
19
+ "queued",
20
+ "planning",
21
+ "awaiting_approval",
22
+ "running",
23
+ "done",
24
+ "cancelled",
25
+ "deferred",
26
+ ]);
27
+ export async function cmdBacklog(stateDir, args) {
28
+ const [sub, ...rest] = args;
29
+ switch (sub) {
30
+ case undefined:
31
+ case "help":
32
+ case "--help":
33
+ case "-h":
34
+ printHelp();
35
+ return 0;
36
+ case "list":
37
+ return await cmdBacklogList(stateDir, rest);
38
+ case "show":
39
+ return await cmdBacklogShow(stateDir, rest);
40
+ case "add":
41
+ return await cmdBacklogAdd(stateDir, rest);
42
+ case "done":
43
+ return await cmdBacklogSetStatus(stateDir, rest, "done");
44
+ case "cancel":
45
+ return await cmdBacklogSetStatus(stateDir, rest, "cancelled");
46
+ case "next":
47
+ return await cmdBacklogNext(stateDir, rest);
48
+ default:
49
+ process.stderr.write(errorLine(`unknown subcommand: backlog ${sub}`, "try `orql backlog --help`"));
50
+ return 1;
51
+ }
52
+ }
53
+ function printHelp() {
54
+ console.log(banner());
55
+ console.log("");
56
+ console.log(style.bold(style.cream("orql backlog")));
57
+ console.log("");
58
+ console.log(` ${style.coral("orql backlog list")} ${style.sand("[--status STATUS|all] [--json]")}`);
59
+ console.log(` List goals (default: queued only). Sorted by effective priority.`);
60
+ console.log(` ${style.coral("orql backlog show")} ${style.sand("<id>")}`);
61
+ console.log(` Full record for one goal (accepts 8-char shortId).`);
62
+ console.log(` ${style.coral("orql backlog add")} ${style.sand("<title> [--priority N] [--deadline <iso>] [--tag t1,t2]")}`);
63
+ console.log(` Enqueue a new goal. Default priority 50, source 'cli'.`);
64
+ console.log(` ${style.coral("orql backlog done")} ${style.sand("<id>")}`);
65
+ console.log(` Mark a goal done (sets finishedAt).`);
66
+ console.log(` ${style.coral("orql backlog cancel")} ${style.sand("<id>")}`);
67
+ console.log(` Mark a goal cancelled.`);
68
+ console.log(` ${style.coral("orql backlog next")}`);
69
+ console.log(` Show what the autopilot would pick next (or report blocked/empty).`);
70
+ }
71
+ function flagValue(args, flag) {
72
+ const i = args.indexOf(flag);
73
+ if (i === -1)
74
+ return undefined;
75
+ return args[i + 1];
76
+ }
77
+ function firstPositional(args) {
78
+ // Skip --flag value pairs and bare --flags.
79
+ for (let i = 0; i < args.length; i++) {
80
+ const a = args[i];
81
+ if (!a.startsWith("--"))
82
+ return a;
83
+ // skip the value if the flag takes one (priority/deadline/tag/status)
84
+ if (["--priority", "--deadline", "--tag", "--status"].includes(a))
85
+ i++;
86
+ }
87
+ return undefined;
88
+ }
89
+ /**
90
+ * Mirrors backlog.ts's private effectivePriority(): base + deadline boost.
91
+ * Kept in sync intentionally - duplicating ~5 lines beats exporting an
92
+ * internal helper.
93
+ */
94
+ function effectivePriority(g) {
95
+ let p = g.priority;
96
+ if (g.deadlineAt) {
97
+ const days = (g.deadlineAt - Date.now()) / 86_400_000;
98
+ if (days <= 0)
99
+ p += 30;
100
+ else if (days < 7)
101
+ p += Math.round(30 * (1 - days / 7));
102
+ }
103
+ return p;
104
+ }
105
+ async function cmdBacklogList(stateDir, args) {
106
+ const isJson = hasJsonFlag(args);
107
+ const rawStatus = flagValue(args, "--status");
108
+ let statusFilter;
109
+ if (rawStatus && rawStatus !== "all") {
110
+ if (!VALID_STATUSES.has(rawStatus)) {
111
+ process.stderr.write(errorLine(`unknown status: ${rawStatus}`, "queued|planning|awaiting_approval|running|done|cancelled|deferred|all"));
112
+ return 1;
113
+ }
114
+ statusFilter = rawStatus;
115
+ }
116
+ else if (!rawStatus) {
117
+ statusFilter = "queued";
118
+ }
119
+ const store = new BacklogStore(stateDir);
120
+ const goals = await store.list(statusFilter ? { status: statusFilter } : {});
121
+ const doneIds = new Set(goals.filter((g) => g.status === "done").map((g) => g.id));
122
+ if (isJson) {
123
+ emitJson(goals.map((g) => ({
124
+ ...g,
125
+ effectivePriority: effectivePriority(g),
126
+ depsResolved: (g.dependsOn ?? []).every((d) => doneIds.has(d)),
127
+ })));
128
+ return 0;
129
+ }
130
+ console.log(banner());
131
+ console.log("");
132
+ if (goals.length === 0) {
133
+ console.log(style.sand(statusFilter ? `(no goals with status '${statusFilter}')` : "(backlog empty)"));
134
+ return 0;
135
+ }
136
+ console.log(style.bold(style.cream(`backlog (${goals.length})`)));
137
+ console.log("");
138
+ const head = ` ${"id".padEnd(8)} ${"status".padEnd(18)} ${"prio".padEnd(10)} ${"deps".padEnd(8)} title`;
139
+ console.log(style.dim(head));
140
+ for (const g of goals) {
141
+ const short = style.dim(g.shortId.padEnd(8));
142
+ const stat = styleStatus(g.status)(g.status.padEnd(18));
143
+ const eff = effectivePriority(g);
144
+ const prioStr = eff !== g.priority ? `${g.priority}->${eff}` : `${g.priority}`;
145
+ const prio = style.cream(prioStr.padEnd(10));
146
+ const deps = g.dependsOn ?? [];
147
+ let depsCell;
148
+ if (deps.length === 0) {
149
+ depsCell = style.dim("none ");
150
+ }
151
+ else if (deps.every((d) => doneIds.has(d))) {
152
+ depsCell = style.coral("✓ ");
153
+ }
154
+ else {
155
+ depsCell = style.crimson("blocked ");
156
+ }
157
+ const title = truncate(g.title, 60);
158
+ console.log(` ${short} ${stat} ${prio} ${depsCell} ${title}`);
159
+ }
160
+ return 0;
161
+ }
162
+ async function cmdBacklogShow(stateDir, args) {
163
+ const isJson = hasJsonFlag(args);
164
+ const id = firstPositional(args);
165
+ if (!id) {
166
+ process.stderr.write(errorLine("usage: orql backlog show <id>"));
167
+ return 2;
168
+ }
169
+ const store = new BacklogStore(stateDir);
170
+ const goal = await store.findById(id);
171
+ if (!goal) {
172
+ process.stderr.write(errorLine(`goal not found: ${id}`, "try `orql backlog list --status all`"));
173
+ return 1;
174
+ }
175
+ if (isJson) {
176
+ emitJson({ ...goal, effectivePriority: effectivePriority(goal) });
177
+ return 0;
178
+ }
179
+ console.log(banner());
180
+ console.log("");
181
+ console.log(style.bold(style.cream(`goal ${goal.shortId}`)));
182
+ console.log(` ${style.sand("id:")} ${style.dim(goal.id)}`);
183
+ console.log(` ${style.sand("title:")} ${style.cream(goal.title)}`);
184
+ if (goal.description)
185
+ console.log(` ${style.sand("description:")} ${goal.description}`);
186
+ console.log(` ${style.sand("status:")} ${styleStatus(goal.status)(goal.status)}`);
187
+ const eff = effectivePriority(goal);
188
+ const prioLine = eff !== goal.priority ? `${goal.priority} (effective ${eff})` : `${goal.priority}`;
189
+ console.log(` ${style.sand("priority:")} ${prioLine}`);
190
+ if (goal.deadlineAt)
191
+ console.log(` ${style.sand("deadline:")} ${new Date(goal.deadlineAt).toISOString()}`);
192
+ if (goal.dependsOn && goal.dependsOn.length > 0)
193
+ console.log(` ${style.sand("depends_on:")} ${goal.dependsOn.join(", ")}`);
194
+ if (goal.scope && goal.scope.length > 0)
195
+ console.log(` ${style.sand("scope:")} ${goal.scope.join(", ")}`);
196
+ if (goal.template)
197
+ console.log(` ${style.sand("template:")} ${goal.template}`);
198
+ if (goal.tags && goal.tags.length > 0)
199
+ console.log(` ${style.sand("tags:")} ${goal.tags.join(", ")}`);
200
+ console.log(` ${style.sand("source:")} ${goal.source}`);
201
+ console.log(` ${style.sand("created:")} ${style.dim(new Date(goal.createdAt).toISOString())}`);
202
+ if (goal.startedAt)
203
+ console.log(` ${style.sand("started:")} ${style.dim(new Date(goal.startedAt).toISOString())}`);
204
+ if (goal.finishedAt)
205
+ console.log(` ${style.sand("finished:")} ${style.dim(new Date(goal.finishedAt).toISOString())}`);
206
+ if (goal.planId)
207
+ console.log(` ${style.sand("plan_id:")} ${goal.planId}`);
208
+ if (goal.telegramThreadId)
209
+ console.log(` ${style.sand("tg_thread:")} ${goal.telegramThreadId}`);
210
+ if (goal.outcome)
211
+ console.log(` ${style.sand("outcome:")} ${JSON.stringify(goal.outcome)}`);
212
+ return 0;
213
+ }
214
+ async function cmdBacklogAdd(stateDir, args) {
215
+ const title = firstPositional(args);
216
+ if (!title) {
217
+ process.stderr.write(errorLine("usage: orql backlog add <title> [--priority N] [--deadline <iso>] [--tag t1,t2]"));
218
+ return 2;
219
+ }
220
+ let priority = 50;
221
+ const rawPriority = flagValue(args, "--priority");
222
+ if (rawPriority !== undefined) {
223
+ const n = Number(rawPriority);
224
+ if (!Number.isFinite(n) || n < 0 || n > 100) {
225
+ process.stderr.write(errorLine(`invalid --priority: ${rawPriority}`, "expected a number between 0 and 100"));
226
+ return 1;
227
+ }
228
+ priority = n;
229
+ }
230
+ let deadlineAt;
231
+ const rawDeadline = flagValue(args, "--deadline");
232
+ if (rawDeadline !== undefined) {
233
+ const t = Date.parse(rawDeadline);
234
+ if (!Number.isFinite(t)) {
235
+ process.stderr.write(errorLine(`invalid --deadline: ${rawDeadline}`, "expected ISO-8601 (e.g. 2026-06-01T00:00:00Z)"));
236
+ return 1;
237
+ }
238
+ deadlineAt = t;
239
+ }
240
+ let tags;
241
+ const rawTags = flagValue(args, "--tag");
242
+ if (rawTags !== undefined) {
243
+ tags = rawTags.split(",").map((t) => t.trim()).filter(Boolean);
244
+ if (tags.length === 0)
245
+ tags = undefined;
246
+ }
247
+ const store = new BacklogStore(stateDir);
248
+ const goal = await store.enqueue({
249
+ title,
250
+ priority,
251
+ deadlineAt,
252
+ tags,
253
+ source: "cli",
254
+ });
255
+ if (hasJsonFlag(args)) {
256
+ emitJson(goal);
257
+ return 0;
258
+ }
259
+ process.stdout.write(successLine(`enqueued ${goal.shortId} (priority ${goal.priority})`));
260
+ return 0;
261
+ }
262
+ async function cmdBacklogSetStatus(stateDir, args, status) {
263
+ const id = firstPositional(args);
264
+ if (!id) {
265
+ process.stderr.write(errorLine(`usage: orql backlog ${status === "done" ? "done" : "cancel"} <id>`));
266
+ return 2;
267
+ }
268
+ const store = new BacklogStore(stateDir);
269
+ const updated = await store.update(id, (g) => {
270
+ g.status = status;
271
+ g.finishedAt = Date.now();
272
+ });
273
+ if (!updated) {
274
+ process.stderr.write(errorLine(`goal not found: ${id}`));
275
+ return 1;
276
+ }
277
+ process.stdout.write(successLine(`${updated.shortId} -> ${status}`));
278
+ return 0;
279
+ }
280
+ async function cmdBacklogNext(stateDir, args) {
281
+ const isJson = hasJsonFlag(args);
282
+ const store = new BacklogStore(stateDir);
283
+ const goal = await store.pickNext();
284
+ if (!goal) {
285
+ if (isJson) {
286
+ emitJson(null);
287
+ return 0;
288
+ }
289
+ const all = await store.list({ status: "queued" });
290
+ const msg = all.length === 0 ? "backlog empty" : "all queued goals are blocked by deps";
291
+ console.log(style.sand(`(${msg})`));
292
+ return 0;
293
+ }
294
+ if (isJson) {
295
+ emitJson({ ...goal, effectivePriority: effectivePriority(goal) });
296
+ return 0;
297
+ }
298
+ console.log(banner());
299
+ console.log("");
300
+ console.log(style.bold(style.cream("next goal")));
301
+ const eff = effectivePriority(goal);
302
+ const prioLine = eff !== goal.priority ? `${goal.priority} (effective ${eff})` : `${goal.priority}`;
303
+ console.log(` ${style.sand("id:")} ${style.dim(goal.shortId)} ${style.dim(goal.id)}`);
304
+ console.log(` ${style.sand("title:")} ${style.cream(goal.title)}`);
305
+ console.log(` ${style.sand("priority:")} ${prioLine}`);
306
+ if (goal.deadlineAt)
307
+ console.log(` ${style.sand("deadline:")} ${new Date(goal.deadlineAt).toISOString()}`);
308
+ if (goal.tags && goal.tags.length > 0)
309
+ console.log(` ${style.sand("tags:")} ${goal.tags.join(", ")}`);
310
+ console.log(` ${style.sand("source:")} ${goal.source}`);
311
+ return 0;
312
+ }
313
+ function truncate(s, n) {
314
+ if (s.length <= n)
315
+ return s;
316
+ return s.slice(0, n - 1) + "…";
317
+ }
318
+ //# sourceMappingURL=backlog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backlog.js","sourceRoot":"","sources":["../../src/cli/backlog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA8B,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,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