@hearsay-tools/squawk 0.18.0-pr3630.6567 → 0.18.0-pr3631.6580

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
@@ -357,11 +357,11 @@ The moves that make the cockpit worth the browser tab:
357
357
  - 🗂️ **Every project in one cockpit.** One `hsq serve` hosts every repo you
358
358
  register; the desktop rail switches between them, and **All tasks** shows every
359
359
  project's tasks in one table. See
360
- [Multiple projects, one cockpit](#multiple-projects-one-cockpit).
360
+ [Multiple projects, one cockpit](docs/areas/workspace-registry.md#multiple-projects-one-cockpit).
361
361
  - 👥 **Owned workers.** A task's agent can spawn its own tracked workers — on the
362
362
  same or another runner — message them, and collect their diffs; you still review
363
363
  the result. Each task has an **Allow Squawk workers** switch, on by default. See
364
- [Owned workers](#owned-workers).
364
+ [Owned workers](docs/workers.md#owned-workers).
365
365
  - 📱 **Runs on your coding server, drives from your pocket.** The cockpit is a
366
366
  responsive web app streaming over SSE, so the box running Squawk can be a
367
367
  **VPS, cloud, or dedicated server** you never sit in front of. Point a browser
@@ -377,7 +377,7 @@ Task and project views share one browser window and live updates over Server-Sen
377
377
  | View | What's in it |
378
378
  |---|---|
379
379
  | **Tasks** | Every task with its status, live event stream (agent text · tool calls · tool results · pasted/generated screenshots and file attachments), tokens and cost. Continue, cancel, open in terminal (`claude --resume`), review the diff, or push a draft PR. |
380
- | **All tasks** | Every *registered project's* tasks in one table, filtered and grouped by tag, project, status or workflow — see [Grouping connected repositories](#grouping-connected-repositories-tags-and-the-all-tasks-page). Appears once a second project is registered. |
380
+ | **All tasks** | Every *registered project's* tasks in one table, filtered and grouped by tag, project, status or workflow — see [Grouping connected repositories](docs/areas/workspace-registry.md#grouping-connected-repositories-tags-and-the-all-tasks-page). Appears once a second project is registered. |
381
381
  | **Activity** | What each active task and worker does or waits for right now, and the open requests between tasks as lines. Live without a reload. **All projects** shows one panel per project. |
382
382
  | **Git** | In **More**. Branch, working-tree status, diff vs HEAD, recent commits (click one for its inline patch + GitHub link), and the configurable base branch that worktrees fork from and PRs target. |
383
383
  | **GitHub** | Open issues and PRs of the repo's origin, read through your logged-in `gh`. Hand an issue straight to the agent — pick a workflow and skills, one click runs it. |
@@ -399,311 +399,11 @@ bypasses the server cache immediately and refreshes the selected thread too.
399
399
 
400
400
  ## Multiple projects, one cockpit
401
401
 
402
- One `hsq serve` hosts **every repo you work in**, not just the one you started
403
- it in. Each repo Squawk boots in registers itself in a per-user registry at
404
- `<config>/config.json` — the workspace file that also holds the global knobs
405
- (the parallel cap, the memory ceiling, the browse root, and the checkout root). Nothing is added to
406
- the repo: per-project state stays in that repo's `.ai/squawk/` (or `.ai/cezar/`
407
- until the project moves).
408
-
409
- Every view is project-scoped:
410
-
411
- ```
412
- /p/<projectId>/ tasks · activity · git · github · skills · workflows · reports · settings
413
- ```
414
-
415
- `<projectId>` is a slug derived from the folder name (`my-app`, then `my-app-2`
416
- on a collision), and `/p/default/…` always means the project Squawk was started
417
- in. The desktop rail selects the project. Its sidebar shows the project header,
418
- view tabs and task list, ordered **Needs you → Finished → Working**.
419
- Pins stay first within their status section and do not spend the default ten-row
420
- budget; Finished takes priority over Working when that budget fills up. Each
421
- section starts expanded and folds independently using its heading (click, Enter
422
- or Space). Folding is remembered per browser, project and section, separately
423
- from folding a project. Folded headings keep full task counts and attention
424
- indicators, including tasks outside the visible row limit. These controls work
425
- in the mobile drawer too. **Archive all** appears only on Finished and archives
426
- all eligible unpinned tasks, including hidden rows; individual archive actions
427
- and Undo remain available. Archived keeps its existing history view.
428
- The view tabs are Tasks, Activity, GitHub, Skills and Settings. More views holds Git,
429
- Workflows and Reports, and Automations when enabled. The project menu
430
- offers Mark all read and project settings; local mode also offers Open in and
431
- Copy path. Active/Archived remains below the Tasks heading. The new-task
432
- composer names the project it will run in.
433
-
434
- **Adding a project** — the **+** button on the desktop rail (or in the mobile
435
- navigation drawer):
436
-
437
- - ✨ **New project…** creates a git repository with one empty commit in the checkout
438
- root and registers it. Optionally — only when you switch it on — it also creates a
439
- **private** GitHub repository under your account or one of your organizations, empty or
440
- from a GitHub template. If GitHub setup fails after the repository exists, the local
441
- project is kept and the dialog shows the command that finishes it. A hosted cockpit
442
- creates local projects only.
443
- - 📂 **Open local folder…** browses from the configured browse root
444
- (**Settings → Projects**, default `~/`) in a folder picker and
445
- registers the folder you pick.
446
- - ⬇️ **Clone from GitHub…** clones with your logged-in `gh` into the checkout
447
- root (**Settings → Projects**, default `~/cezar/projects`) with live progress,
448
- then registers the clone. Close the dialog and the clone is killed and its
449
- partial directory removed. For a SAML-protected organization, follow **Authorize
450
- this GitHub organization**, authorize in GitHub, then return to retry once (or
451
- choose **Retry clone**). Original errors remain available under **Error details**.
452
- Clones use HTTPS and save the GitHub CLI credential helper in the new repository
453
- so later pushes use the same organization grant, even if `gh` prefers SSH.
454
-
455
- Removing a project (**Settings → Projects**) drops the registry entry only — the
456
- repo and its `.ai/cezar/` are never touched, so re-adding it later finds all its
457
- tasks intact. The project Squawk is currently serving can't be removed: it
458
- re-registers itself at the next start.
459
-
460
- **From the terminal** — the same registry, no cockpit required (handy over ssh):
461
-
462
- ```bash
463
- hsq backup list [<file>] # list rotating config.json / agent-accounts.json backups
464
- hsq backup restore <file> [--at <time>] # restore JSON only; account folders are unchanged
465
- hsq projects # list: id, branch or status, path, tags
466
- hsq projects add ~/code/api # register a folder (defaults to the current repo)
467
- hsq projects remove api # drop the registry entry; the repo is untouched
468
- hsq projects tag api storefront backend # set the grouping tags (no tags clears them)
469
- ```
470
-
471
- These read and write `<config>/config.json` directly, so they work with the
472
- server stopped, and `HSQ_HOME` (`CEZ_HOME` fallback) selects which workspace they operate on.
473
-
474
- Settings split along the same line: **General** (the project's folder, its
475
- registry facts, its parallel-task ceiling, and Remove), **Agents**, **Agent config**,
476
- **Worktrees**, **Sidebar** and **Prompt templates** describe one
477
- repo and live under `/p/<projectId>/settings`; **Appearance**,
478
- **Notifications**, **Resources**, **Skills**, **Agent accounts** and **Projects**
479
- are yours or the machine's and live at `/settings/global`.
480
-
481
- **Settings → Sidebar** controls this project's task rows on desktop and mobile.
482
- Set **Overall**, **Needs You**, **Finished**, and **Working** to a positive whole
483
- number or **Unlimited**. Defaults are 10 overall and Unlimited for each section.
484
- The overall budget is allocated in section order (Needs You, Finished, Working),
485
- and each section must also fit its own limit. Unlimited removes only its selected
486
- constraint. Pinned rows and groups containing pins bypass both budgets; a grouped
487
- task counts as one row. Archived uses only the overall limit, with no pin exemption.
488
- Save applies the preferences to this project and keeps them after a reload.
489
- Refreshed preferences update an untouched form; unsaved edits stay in place.
490
- Malformed stored sidebar limits fall back field by field to these defaults,
491
- while valid limits and unrelated preferences are preserved.
492
-
493
- On desktop, Settings replaces the sidebar task list with two groups: **This project**
494
- and **Global · every project**. Each group includes General and its available sections;
495
- the current section is highlighted, and the main page shows its content. On mobile,
496
- the section picker and General page's section cards provide navigation.
497
-
498
- The GitHub sidebar groups **Issues** (Assigned to me, No task yet, Has a task,
499
- All open) and **Pull requests** (Review requested, Mine, Checks failing, All open).
500
- Selecting a filter updates the URL, so reloading keeps that selection. The issue
501
- list, detail pane and Hand to agent action stay in the main area. On mobile, the
502
- GitHub tab opens the filter screen; selecting a row opens its list.
503
-
504
- Has a task and No task yet use issue references from this project's non-archived
505
- tasks, excluding references to other repositories. The list loads 50 rows at a time
506
- and loads the next page as you scroll toward its end. The tabs and All open show
507
- GitHub's exact open totals. A preset count shows a `+` while more pages remain
508
- unloaded, and a search count shows one when the search reaches its result limit;
509
- an unavailable count is not shown as zero. Filtering by search, label, assignee or
510
- board narrows the loaded rows; while it is on, the next page loads only when you press
511
- Load more.
512
-
513
- The `body` field on `GET /api/v1/github` list rows is deprecated. It is still sent,
514
- and a later minor removes it; read an item's body from the comments route's `detail`. Views without their own navigation still show tasks in the sidebar.
515
-
516
- Open an issue to see **Linked tasks (N)** beneath its heading. Each row opens a task
517
- in the current project and shows its title, status and date, newest first. Archived
518
- tasks remain listed with an **Archived** label, so diagnosis and implementation
519
- sessions are both reachable.
520
-
521
- The Git sidebar lists **Task worktrees** that still exist on disk, including retained
522
- worktrees from finished tasks. Each row shows its branch, task title, status and
523
- available diff counts, and opens that task's Changes tab. Reclaimed worktrees disappear
524
- from the list. Changes, Commits and Branches remain tabs in the main repository header.
525
- On mobile, Git sits in the More sheet and opens the worktree list; **Open repository** opens the repository
526
- view, and **Back to worktrees** returns to the list.
527
-
528
- ### Grouping connected repositories: tags and the All tasks page
529
-
530
- Work rarely stops at a repo boundary. A storefront is an API, a web app and a
531
- design system; a platform is a handful of services plus the infra that runs
532
- them. **Tags** are how you say so, and **All tasks** is where saying so pays off.
533
-
534
- **Tag a repo** in **Settings → Projects**: type into the *Tags* cell on its row
535
- and press Enter (comma works too; the × on a chip, or Backspace in an empty
536
- field, removes one). The field **autocompletes from the tags already used in the
537
- workspace** — click the field to see them all, arrow keys and Enter to pick —
538
- which is what keeps the second repo landing on the first one's spelling instead
539
- of inventing `store-front` next to `storefront`. Anything not on the list is
540
- just typed. A tag is a free-form label — `storefront`, `infra`, `client-acme` —
541
- and a project can carry several, because a repo can belong to more than one
542
- piece of work. Tags are trimmed, deduplicated case-insensitively (`API` and
543
- `api` are one tag) and stored in `<config>/config.json` beside the rest of the
544
- registry, so they are yours and this machine's, never something added to the
545
- repo.
546
-
547
- **All tasks** — the layers icon on the desktop rail, `/tasks`, or `⌘K → All tasks` —
548
- then shows every registered project's work in one table:
549
-
550
- - **Filter** by tag, status and workflow. Tags are one-click chips; status and
551
- workflow are searchable multi-selects. Every facet ORs inside itself and ANDs
552
- across, so *"anything running or waiting in storefront or infra"* is one set
553
- of clicks. Each option carries how many tasks it would leave, so a filter that
554
- would empty the table says so before you click it. The search box matches
555
- title, project, workflow, branch and tags.
556
- - **Group by** tag, project, status or workflow — click the pressed one again to
557
- ungroup. Grouping by tag is the reason tags exist: three repos tagged
558
- `storefront` become one section, and a repo tagged twice appears under both —
559
- it genuinely belongs to both.
560
-
561
- The filters, the grouping and the Active/Archived tab live in the **URL**, so a
562
- filtered view survives a refresh, pastes into a chat, and sits in a bookmark —
563
- `/tasks?tag=storefront&status=running&group=tag` is a link to exactly what you
564
- were looking at. Only what you changed shows up: Active is the default, so the
565
- Archived view is `?archived=1` and a normal link carries no key for it.
566
-
567
- Each row shows **every** PR and issue it references — a task opened on an issue
568
- that landed a PR shows both — plus its cost and live CPU/memory, and can be
569
- marked **read/unread** (the eye) or **archived** (or restored) right there. Every task title, project name and project group heading links into that
570
- project, so the thread, its diff and its worktree are one click away and stay
571
- exactly where they were. Returning to a long thread restores its saved row measurements
572
- once the replay has rebuilt the same ordered messages, keeping the same content in view.
573
- Scrolling, jumping to the latest message, or loading different history takes ownership
574
- from that restoration; a thread left at its live tail follows the current tail.
575
-
576
- There is deliberately **no project filter**: narrowing this page to one project
577
- is that project's own Tasks page, which is a better version of the same answer
578
- (live updates, the full column set, the composer). So picking a project *leaves*
579
- for it rather than turning the global view into a worse local one.
580
-
581
- Nothing else in Squawk reads tags, on purpose: a tag is a lens, not a permission,
582
- a queue or a routing rule. Removing one changes what you see and nothing else.
583
-
584
- > The page reads a workspace-wide index capped at the newest 200 tasks per
585
- > project — it says so, and names the projects it capped, rather than showing a
586
- > short list as if it were complete. Older tasks are always in that project's own
587
- > Tasks page.
588
-
589
- **Old page URLs keep working.** Every unprefixed page path — `/`, `/tasks/<id>`,
590
- `/settings` — still answers, bound to the project Squawk was started in; the
591
- cockpit redirects flat paths to their `/p/<boot>/…` twin, so existing bookmarks
592
- need no change. The HTTP API is the exception: it moved to
593
- `/api/v1/…` (see the CHANGELOG), so a script that calls it needs the extra
594
- segment.
595
-
596
- > **Hosted cockpit?** The folder picker is confined to the independent browse
597
- > root. Set `HSQ_BROWSE_ROOT` (`CEZ_BROWSE_ROOT` fallback) narrowly before first boot (or save it in
598
- > **Settings → Projects**) when a remote viewer should not enumerate the host's
599
- > whole home. Clones continue to use the separate checkout root.
600
-
601
- ---
402
+ See [Multiple projects, one cockpit](docs/areas/workspace-registry.md).
602
403
 
603
404
  ## Waiting for PR checks, merges and timers
604
405
 
605
- An agent waits on something outside its turn with `cezar_wait`. With `kind: "pr"` and
606
- a GitHub PR URL in `pr`, Squawk watches the PR outside the model: its checks
607
- (`until: "checks"`, the default), its eventual merge (`until: "merge"`), or a merge
608
- the agent has requested (`until: "merge_or_blocked"`). The last target wakes when
609
- the PR merges, closes, conflicts, or is neither queued nor scheduled for auto-merge.
610
- It includes any known queue-removal or auto-merge-disable reason. A pending queue
611
- slot or enabled auto-merge keeps it open. The ordinary merge target ignores queue
612
- removal; use `wake_on_conflict: false` for a dependency wait that also ignores
613
- conflicts. Only `merged` confirms success. The optional
614
- `timeout_seconds` defaults to 1,800 and accepts 1–7,200. With `kind: "timer"`,
615
- `seconds` (60–7,200) and an optional `note`, Squawk wakes the agent at that time and
616
- hands the note back. No authored configuration or worker delegation permission is
617
- needed. A PR wait requires `gh`, access to the repository, and a supported GitHub
618
- host; GitHub Enterprise hosts must already be recognized by the forge/auth
619
- configuration. Tool startup itself makes no GitHub request. With **Monitoring
620
- wake-up** turned off in **Settings → Resources**, `cezar_wait` refuses a timer
621
- (`timers_disabled`); once the automatic-wake budget of 40 is spent, it refuses one
622
- with `wake_budget_spent`, and a run with nothing else to wait on waits for you. The
623
- budget is kept on the task, so a cockpit restart keeps it; a message from you or a
624
- Continue starts it again.
625
-
626
- A CI wait stays pending while any GitHub Actions workflow run on its captured
627
- head commit is incomplete, even when a rerun temporarily hides that run's checks.
628
- It checks again every 30 seconds within the original deadline. Once those runs
629
- complete, it reads the checks again to decide the result. A result describes what
630
- GitHub reported; it does not predict workflows that have not appeared yet or grant
631
- merge approval.
632
-
633
- A merge wait (`until: "merge"`, hearsay-tools/cezarion#1425) reads the PR's state at
634
- once and then every 30 seconds within its deadline. It ends as `merged` only when
635
- GitHub reports the PR merged, with the merge time and merge commit when GitHub gives
636
- them, and as `closed` when the PR closed without merge. Green checks keep it open,
637
- and so does a new head commit. A merge wait holds none of the four watcher slots, so
638
- long merge waits never delay a checks wait. By default both targets also end as
639
- `conflicting` when the PR has merge conflicts. Set `wake_on_conflict: false` when the
640
- agent watches a PR it does not own, such as another agent's PR its work depends on:
641
- it cannot resolve those conflicts. With `until: "checks"`, GitHub often runs no
642
- workflows on a conflicting PR, so such a wait usually ends as `no_checks` or at its
643
- deadline. A checks wait and a merge wait on the same PR are two waits.
644
-
645
- The agent asks you with `cezar_ask`, a card of one to four questions in the ask
646
- format. A question with two to four options shows them as choices; a question without
647
- options is open, and the card shows a text box for your answer. The task reads Needs
648
- you once the turn ends, and your next message answers it. `cezar_wait` takes PR, worker, request,
649
- peer, process and timer waits only, and points an agent that asks it for a human wait to `cezar_ask`. A run
650
- has one question to you at a time, and the agent cannot cancel it once you have seen
651
- it. A native question opens the same kind of wait. When the work is
652
- done and verified, the agent calls `cezar_done` (an optional `summary`), and the task
653
- finishes at the end of that turn: its open waits are cancelled and the summary is
654
- written as a note. In a workflow step that is not the last, `cezar_done` finishes that step
655
- and Squawk starts the next one. `cezar_done` refuses while owned workers are live or uncollected,
656
- a worker question is unanswered or a question to you is still pending, and says what to do first. An
657
- autonomous task does not wait for you until its automatic-wake budget is spent.
658
-
659
- A run can have several waits open at once, up to 16. Each answer carries the
660
- wait's id, its absolute deadline and the list of waits still open, and
661
- `cezar_cancel_wait` closes one by its id. The agent ends its turn to wait, with no
662
- marker required. The run is then `waiting`, and the pill reads **waiting for CI**,
663
- **waiting for merge** or **monitoring** rather than Needs you. The header lists every open wait: **Waiting
664
- for CI — owner/repo#N** or **Waiting for merge — owner/repo#N** with a PR link and the deadline, or **Next automatic check**
665
- with its time and note. **CI result ready — waiting for capacity** means the
666
- observation is owed to the agent and its wake turn has not started yet. A run parked
667
- on CI or a timer keeps its agent slot, a monitoring slot when one is free, so the
668
- wake usually starts at once. Claude's `ScheduleWakeup` opens a timer in the same list.
669
-
670
- Every agent session needs these tools. Squawk starts a private local socket for them,
671
- in the system temporary directory, when the first session of a cockpit launches. If it
672
- cannot start, for example because that directory is full or not writable, the task fails
673
- before the agent starts. The error names the cause and the fix: free space or fix the
674
- permissions, then Continue the task. A task woken by a wait retries with the usual backoff.
675
- The cockpit and other tasks keep working, and the next launch tries again.
676
-
677
- Squawk reports passed, failed, cancelled or skipped checks, no checks, changed head,
678
- timeout or an operational error. It watches the registered commit: a new PR head
679
- is reported separately, and the agent decides whether to wait again. The first
680
- observation runs immediately. Later check-status and PR-head polls run every 30
681
- seconds, and no setting changes that interval. Four watchers run concurrently;
682
- queued waits retain their original deadline. Results are bounded
683
- observations, not merge approval or evidence that every expected workflow appeared.
684
- The agent still decides its next action; CI success never completes the task or
685
- accepts review. A wait ends only when its own result arrives, its deadline passes,
686
- or someone cancels it: the agent with `cezar_cancel_wait`, or Squawk when the task
687
- is stopped, finished, cancelled or deleted. A human message wakes the agent without
688
- closing any wait, and every delivered turn ends with a list of the waits still open.
689
- CI never answers a pending human question. If the agent's session fails or closes while a
690
- result is owed, Squawk retries the delivery after 15 and then 30 seconds; a third
691
- failure marks the task failed and keeps the result. Continue delivers it, and Stop
692
- discards it and leaves the task failed.
693
- Controller recovery can replay an
694
- observation after an ambiguous delivery checkpoint, identified by its stable
695
- lifecycle input ID.
696
-
697
- The deprecated `cezar_wait_for_ci` tool was removed (hearsay-tools/cezarion#1236):
698
- call `cezar_wait` with `kind: "pr"` instead. `kind: "ci"` itself was replaced by
699
- `kind: "pr"` (hearsay-tools/cezarion#1425) and is refused with a message that names
700
- the new spelling.
701
-
702
- The adapters are bundled for Claude (including `claude-cli`), Codex, OpenCode,
703
- Cursor, Pi and OMP. Internal socket/capability environment values are runtime wiring,
704
- not settings to create or share. If the tool is unavailable or denied, its error
705
- is surfaced while ordinary tasks continue. See [the CI-wait protocol](AGENT_PROTOCOL.md#ci-wait-tool-contract-474)
706
- for the owners of the limits and the harness evidence required before a runner ships.
406
+ See [Waiting for PR checks, merges and timers](docs/waits.md).
707
407
 
708
408
  ## Discover runners and models
709
409
 
@@ -723,379 +423,15 @@ The catalog describes host default accounts, not every named account or the sele
723
423
 
724
424
  ## Owned workers
725
425
 
726
- Every task has two settings, both on by default:
727
-
728
- - **Allow Squawk workers**: the task's agent may start Squawk workers and resume them. Each worker is a separate paid agent session. The worker limits below cap resources, not spending.
729
- - **Allow task messaging**: the task's agent may list, message and wait on other tasks in this project with `hsq message`.
730
-
731
- Set them in the new-task form, in the task's header menu at any time, with `hsq task start` or `hsq run` and `--no-workers` / `--no-messaging`, or in an automation's `task.allowWorkers` / `task.allowMessaging`. A task created before these settings existed counts as on for both. The cockpit and headless `hsq run` start one private loopback listener; each eligible session receives the absolute bundled Node/CLI invocation and its own environment credentials. No `hsq` installation on the agent's PATH, config file, separate daemon, or remembered port is needed. If the listener cannot start, ordinary tasks keep working without delegation tools.
732
-
733
- Turning **Allow Squawk workers** off refuses new `spawn` and `--resume` at once, including through a session's existing credential and for a spawn still waiting to be accepted. The task keeps messaging, waiting on, inspecting, collecting, stopping and destroying the workers it already has, and work already accepted finishes. Turning **Allow task messaging** off refuses peer discovery, new peer waits and new peer messages in both directions; a reply to a request accepted earlier still lands, and messages between a task and its own workers are never blocked. A root task with both off, no worker receipt and no open peer request gets no credential; worker sessions, and roots with a worker receipt (also a deleted worker's, so its retained result stays collectable) or an open peer request, keep theirs. Native subagents inside one session are not Squawk workers, and these settings do not change them. These settings are cooperative supervision, not process isolation.
734
-
735
- `CEZ_DELEGATION` is retired and has no effect. A caller that set `CEZ_DELEGATION=1` needs no change. A caller that relied on it being unset turns the settings off per task, for example `hsq run --no-workers --no-messaging "<task>"`.
736
-
737
- The provisioned command has these forms (the session instructions supply the absolute invocation):
738
-
739
- ```sh
740
- hsq worker spawn --baseline parent-head --request-id <UUID> 'Implement the assigned change'
741
- hsq worker spawn --baseline parent-head --request-id <UUID> --runner codex --effort high --context-file ./selected-context.txt 'Review the parser'
742
- hsq worker spawn --baseline parent-head --request-id <UUID> --workflow review 'Review the parser change'
743
- hsq worker list # All own workers, revisions and cleanup resources (fetches pages automatically)
744
- hsq worker inspect <worker-id>
745
- hsq worker steer <worker-id> 'Consider this additional constraint'
746
- hsq worker diff <worker-id>
747
- hsq worker collect <worker-id>
748
- hsq worker wait <worker-id> --mode one --timeout-seconds 600
749
- hsq worker wait <first-id> <second-id> --mode any --timeout-seconds 600
750
- hsq worker wait <first-id> <second-id> --mode all --timeout-seconds 600
751
- hsq worker cancel-wait <wait-id>
752
- hsq message request <recipient-run-id> 'Please check this decision' --id <message-UUID>
753
- hsq worker resume <worker-id> 'Correct the returned result' --id <new-message-UUID>
754
- hsq message progress <recipient-run-id> 'Parser tests pass' --id <message-UUID>
755
- hsq message follow-up <recipient-run-id> 'Include empty input' --id <message-UUID> --request-id <request-UUID>
756
- hsq message reply <recipient-run-id> 'Checked; empty input is covered' --id <message-UUID> --request-id <request-UUID>
757
- hsq message conversation <recipient-run-id>
758
- hsq message wait --request <request-UUID> --request <another-request-UUID> --mode all
759
- hsq message wait --peer <task-id> --timeout-seconds 1800 # Wake on that peer task's next message, or when it settles
760
- hsq message inbox
761
- hsq message tasks --all
762
- hsq message cancel-wait <wait-id>
763
- hsq message cancel-request <request-UUID>
764
- hsq worker stop <worker-id>
765
- hsq worker destroy <worker-id>
766
- ```
767
-
768
- Use `hsq message --help` for messaging commands. Use `hsq worker --help` to list worker operations and flags, or `hsq worker <operation> --help` for one operation. Explicit help prints human-readable text and exits successfully without an active delegation session. Commands otherwise return bounded JSON and a nonzero exit on failure or incomplete cleanup. Spawn requires a committed baseline (`parent-head` or an explicit ref) and pins its SHA at acceptance; dirty parent edits are excluded. Optional `--context '<text>'` or `--context-file <UTF-8-file>` supplies selected context, not the parent's conversation. The two flags are mutually exclusive, and combined task/context text is limited to 100,000 characters. The API also accepts up to 32 pinned-baseline file or parent-attachment references, with at most 8 MiB of copied attachments. Inspect reports worker-local input locations. Reuse a request ID only with the same task, baseline, context, runner, model, effort and workflow when retrying a lost response. `--runner` and its alias `--backend` count as the same field, so a retry may switch spelling. A parent holds at most 32 outstanding workers: accepted, live, or not yet verifiably destroyed. A verified destroy (`hsq worker destroy`, or **Clean up** on a finished worker in the cockpit's Workers list) frees a slot; incomplete cleanup keeps its slot until a retry completes. A parent can create at most 1,024 workers in total; past that, start a new task. These limits bound disk resources and runaway spawning, not spending: a worker can be resumed with Continue, and destroying it does not undo charges already made. Cost stays bounded by `maxParallel` and by stopping the parent. There are at most 32 undelivered steering messages per worker.
769
-
770
- An incomplete destroy reports the remaining resources and a reason. Squawk retries that recorded request after a delay, including after the project's context recovers on server restart. It removes the owned checkout only after process termination and ownership are verified. If the reason persists, inspect the worker process, Git worktree lock and ownership receipt; correct the blocker and use `hsq worker destroy <worker-id>` or the cockpit Destroy action to retry immediately. Squawk leaves ambiguous or replaced resources in place for operator review.
771
-
772
- `--workflow <name>` runs a catalog workflow inside the worker: the built-in `quick-task` or any `.ai/cezar/workflows/*.yaml` by name, with its agent and check steps, `skill:` bodies and `onFail` loops, so a repo's `review.yaml` becomes a dedicated reviewer. Omitted `--workflow` runs `quick-task` exactly as before. `--runner`, `--model` and `--effort` fill only the steps that leave those fields unset; a step's own `allowedTools`/`bashAllowlist` narrow the parent's grants and never widen them. An unknown name is refused. Agent steps may mix runners: at spawn every agent step is resolved and pinned separately, so an implement-with-codex, review-with-claude chain runs each step under its own runner, account, model, effort and grants. A step's optional `agentProfile` names the account it runs under (an id the registry does not know is refused); same-runner steps otherwise inherit the parent's account and other runners resolve their project/default one. Run-level columns show the first agent step.
773
-
774
- Explicit default-account model pins are checked against a fresh, nonempty host catalog after account/model resolution and before a worker is created. Named accounts retain existing validation because a default-account catalog cannot disprove their model access. A miss returns `invalid_input`, available models with advertised efforts, and other runners listing the requested ID in `modelChoices`. Empty, stale, or unavailable discovery leaves existing selection validation in place. Accepted retries and omitted model defaults are unchanged.
775
-
776
- Omitted `--runner` inherits the parent's active runner. Same-runner workers inherit omitted model/account/effort; `--runner <claude|codex|opencode|pi|cursor|omp>` selecting another runner resolves that runner's project/default account and model without forwarding another provider's settings. `--backend` is a permanent alias of `--runner`; giving both with different values is refused as `invalid_input`. Worker `inspect` and `collect` still report the selected runner in a field named `backend`. `--model <model>` selects a supported model, subject to existing locks. `--effort <low|medium|high|xhigh|max>` pins reasoning effort on same-runner and mixed-runner spawn; omitted `--effort` still inherits the parent pin on same-runner spawn and drops it on mixed-runner spawn. Accepted identity and grants remain fixed across queuing, restart and Continue, including explicit empty grants. Changing or deleting an account registry entry does not rebind a worker. Missing accepted identity evidence or account homes, incompatible Claude state-file layouts, and conflicting later model locks refuse execution explicitly. Credentials and vendor configuration are never copied; each worker receives its own delegation credential, and unspecified native models stay unspecified.
777
-
778
- Wait registers immediately. End the parent turn to release scheduler capacity; Squawk resumes it on a selected settled outcome or the finite deadline. `any` is the default, `one` requires exactly one worker, and `all` waits for every selected worker. Review, completion, failure, cancellation with proven termination, and destruction are outcomes. Timeout defaults to 600 seconds (1–7200 accepted). `cancel-wait` is idempotent for the retained wait ID and cannot cancel a newer wait. Empty dependency-deadline wakes do not spend the automatic-wake budget; explicit timers and native-subagent safety deadlines remain charged. Timeout and wait cancellation report partial outcomes and unresolved workers, never cancel workers, and never automatically re-wait. Steering is attributed agent input and cannot answer a pending human question.
779
-
780
- Parents and owned workers can converse in both directions; a worker may address only its parent. `send --kind request` opens a reply obligation whose ID is the message ID; `send --kind progress` (or `progress`) does not. Follow-ups clarify an existing request; only an explicit correlated `reply` settles it as replied. Retry a message with the same ID and exact payload, including deadline duration; changed payloads are rejected. Acceptance, provider delivery, reply, and task completion are separate facts, visible in the task transcript and `conversation` JSON.
781
-
782
- Messages allow 100,000 characters each, with at most 32 undelivered inputs per recipient, 1,024 messages per family, and 32 pending requests. Request deadlines default to 600 seconds, configurable per message with `--timeout-seconds 1–7200`. Request waits use the same limits and `one`/`any`/`all` modes as worker waits, and each run has one active wait. Incoming conversation can interrupt a parked wait without settling its requests. `cancel-request` cancels an obligation; `cancel-wait` only stops waiting. Completion without a reply, failure, cancellation, destruction, timeout, or sender closure settle obligations distinctly. Late replies remain visible without reopening them.
783
-
784
- Messages reach a live recipient as soon as they are accepted, including mid-turn: Claude, Codex, Pi, OMP and OpenCode steer them into the running turn, and the model reads them at its next step. Cursor delivers at the turn boundary, because a second prompt would cancel its running turn. Pending conversations go together, in order, up to 32 messages and 100,000 formatted characters per batch; a single valid message is never split. Every message keeps its ID, sender, delivery receipt and request outcome; receipts show queued, delivered and read (when the agent's harness can tell) separately. A pending human question holds messages until it is answered, then they follow right behind the answer. The thread's Details distinguish creation, delivery confirmation and event-recording times.
785
-
786
- Sending a message to a review or terminal participant reports `not-delivered` and `continuation-required`, with the reason and next command; the CLI exits 1. An active parent can use `hsq worker resume` to continue its settled done/review/failed worker with that message as the new instruction. No human Continue is needed for this parent-controlled action. A retry with the same payload and ID never creates another continuation; resuming after a rejected message requires a new ID. Stopped or destroyed workers need a new worker. Workers cannot resume parents, and conversation never answers a pending human question. Durable IDs deduplicate accepted queue entries and event replay, but a crash between provider acceptance and its durable delivery checkpoint can leave transport delivery ambiguous; this is not an exactly-once execution guarantee.
787
-
788
- Collect returns the worker's execution revision, status/outcome, `settled` and `partial` flags, and typed availability for assistant summary, HEAD, bounded diff and artifact descriptors. Missing evidence is explicit; running output is partial. An available `diff.path` points to a **JSON result file** containing `{ result, diffSnapshot }`; its `diffSnapshot` field holds the patch. Read and review that field before applying any changes. The latest collected result is stored under the parent and survives restart. Collection acknowledges observation, not Git integration or successful work. Review desired worker commits and deliberately integrate them into the parent before destroying their worktrees/branches; there is no automatic merge.
789
-
790
- Parent completion requires collection of every worker's latest settled execution revision. A worker Continue invalidates older readiness. An early completion attempt waits for outstanding workers and wakes the parent to inspect/collect; it does not silently finish on wake. While workers remain live, markerless replies, completion timeouts, and repeated premature completion park the parent as monitoring with the existing capped wakeups. Once workers settle, repeated completion without collecting their results retains attention. Human Finish also refuses unresolved/uncollected workers. If the parent is already under review, Continue the parent first, then Continue its worker. Human questions remain authoritative.
791
-
792
- Stop requests cancellation; `stopping` does not prove termination. Destroy checkpoints obtainable results, waits up to 30 seconds for proven termination, and removes only verified owned resources. An `incomplete` response lists remaining resources; resolve the cause and retry explicitly. Cleanup order is: collect/integrate desired results, destroy owned resources, explicitly delete child histories through the cockpit/API, then delete parent history. Parent-owned summaries and bounded diff snapshots remain until parent deletion, including after child-history deletion; general artifact bytes are not archived. Branch/path strings and SHAs become historical descriptors after removal, not promises of available Git objects or files. The human cleanup endpoint `POST /api/v1/p/<projectId>/runs/<worker-id>/worker-destroy` stays available when delegation is disabled. The CLI bounds each HTTP request to 45 seconds and rejects endpoint/auth/origin overrides and redirects.
793
-
794
- Provisioned root tasks and workers may use native subagents, and each mechanism has its own purpose. Use native subagents for work that needs no separate worktree: research, code reading and focused analysis, for example a subagent that reads the parser and summarizes its error handling. Native subagents need no worker creation, worktree, collection or destruction. Use Squawk workers for work that needs its own worktree, its own commits or a tracked lifecycle. Workers may use native subagents too, but cannot spawn Squawk workers. An agent may message its own subagents with its runner's tools; it reaches another Squawk task only through `hsq message`. Where a runner's native tool for reaching another session is separate from subagent messaging, a per-run adapter control turns it off: Codex's cross-thread message board, and an OpenCode plugin that refuses a `task` call whose `task_id` names a session outside the caller's own session tree. Claude sessions refuse messages from other sessions on every launch. Known limitations: a Claude session Squawk starts can still list and message Claude sessions that Squawk did not start, and sessions on other machines; an OpenCode session that an older Squawk created under delegation keeps its `task` deny on Continue and restart recovery, because OpenCode cannot remove a session permission rule (new OpenCode sessions allow subagents). These controls are cooperative same-user supervision, not isolation ([Governed delegation controls](AGENT_PROTOCOL.md#governed-delegation-controls-d1)). When the listener is unavailable, ordinary tools/settings stay unchanged. The listener binds to `127.0.0.1`, including hosted cockpit mode. Its session credentials authorize only what that session may do: a root manages its own workers and messages peer roots in the same project, subject to the task's settings and relationship checks; a worker addresses only its parent. This is cooperative local-agent supervision; same-user unrestricted shell and custom tools are not hard isolation. Workers cannot spawn Squawk workers or message peers through Squawk. Review remains a human gate with no automatic acceptance. Never read, echo, forward, or persist the generated token.
426
+ See [Owned workers](docs/workers.md).
795
427
 
796
428
  ## From the terminal: `hsq task` and `hsq message`
797
429
 
798
- `hsq task` starts, watches and steers tasks **in the running cockpit** from a shell — for you, or
799
- for a bot driving one. Every command prints one JSON object and exits with a code the caller can
800
- branch on, so nothing has to parse prose. It never starts a server: it finds the cockpit whose
801
- project registry holds this checkout (ports 4321–4370; a task worktree resolves to its parent
802
- project), or you point it at one with `--url` / `HSQ_URL` (`CEZ_URL` fallback).
803
-
804
- ```text
805
- hsq task [--url <origin> | --repo <dir>] <operation> …
806
- ```
807
-
808
- The shared `--url`, `--repo` and `--help`/`-h` flags also work before the operation;
809
- `--url` and `--repo` accept both `--flag value` and `--flag=value`. A shared flag repeated
810
- before the operation or on both sides is a usage error. Operation flags stay after the
811
- operation. `hsq task --help <operation>` shows that operation's help without discovery.
812
- An explicit `--url` wins over `HSQ_URL` (`CEZ_URL` fallback); `--repo` selects the checkout to discover.
813
-
814
- `hsq task send` is human input. It can answer a pending human question. It refuses
815
- inside a task (`HSQ_TASK_ID` (`CEZ_TASK_ID` fallback) is set). Agents use `hsq message` for task messages,
816
- including peer and parent/worker conversations; see [Owned workers](#owned-workers).
817
-
818
- ```bash
819
- id=$(hsq task start --task-file - <<'EOF' | jq -r .id
820
- Fix the `hsq task` docs. Keep $(example) and "quotes" literal.
821
- EOF
822
- )
823
- hsq task wait "$id" --timeout-seconds 900 # 0 done/review/needs you · 1 failed · 3 timeout
824
- hsq task list # currentStepId (running), pullRequestUrl (done/review), capped error (failed)
825
- hsq task status "$id" # slim JSON: status, attention, question, branch, handoffUrl…
826
- hsq task send "$id" 'Use the retry helper instead' # delivered live, queued before start
827
- hsq task send "$id" --resume 'Continue with the next step' # resumed: reopen a settled session
828
- hsq task log "$id" --follow --timeout-seconds 300 # JSON lines until it needs you or ends
829
- ```
830
-
831
- `list --status` accepts comma-separated values: `queued`, `running`, `waiting`, `review`,
832
- `done`, `failed`, `cancelled`. Default rows include only the next-action field for their status
833
- when defined; errors use the first line, at most 200 characters including `…` when cut.
834
- Default `status` includes `handoffUrl`, a URL to the existing handoff endpoint even before
835
- contents are seeded, and keeps the full error. `--full` still prints the contract unchanged.
836
- To answer a pending `question`, use the same `send` with the answer text. Without `--resume`,
837
- a closed session returns `delivery: not-delivered` and the `next` command. For multi-line or
838
- shell-sensitive messages use `send <id> --text-file <path|->` (`-` reads stdin); the quoting
839
- rules below apply to messages too.
840
-
841
- Use `--task-file PATH` to read a saved task (for example, `hsq task start --task-file task.md`),
842
- or `--task-file -` to read stdin as above. The quoted heredoc delimiter (`<<'EOF'`) keeps
843
- backticks and `$()` literal in the task text.
844
-
845
- POSIX shells, including Bash, expand backticks and `$()` in double-quoted arguments before
846
- hsq receives the text. **Do not put raw backticks in double-quoted task arguments.** This can
847
- execute parts of your prompt as shell commands and leave holes in the stored task, including
848
- when starting tasks through SSH and `bash -lc`. Prefer a task file or stdin with a quoted
849
- heredoc delimiter. A single-quoted positional argument still works for short tasks:
850
- `hsq task start 'Fix the typo'`.
851
-
852
- `hsq task start --task-file task.md --skill <name>` names one skill as the task's agent step;
853
- `--skill` and `--workflow` are mutually exclusive. The CLI checks `GET /skills` first and
854
- includes a `warning` in its JSON result if the skill is missing or the catalog cannot be
855
- checked; it still starts the run. Like a cockpit skill start, if the skill is missing at
856
- execution, the agent uses the plain prompt and the run logs a note. CLI starts do not change
857
- the cockpit composer's recent picks or skill-usage ranking.
858
- Without either flag, `start` still runs `quick-task`.
859
-
860
- `--runner <claude|codex|opencode|pi|cursor|omp>` picks the runner, as in a workflow step and
861
- `hsq discover --runner`; `--model` and `--effort` pin the rest. `--backend` is a permanent
862
- alias of `--runner` with no warning. Giving both with different values exits 64.
863
-
864
- `--archive-when-done` archives the task after **Done**. `--auto-merge-pr` merges its
865
- PR after **Done** only when current-head CI and GitHub rules pass. It can mark a
866
- draft PR ready. Both controls are off by default. They also appear as switches in
867
- the task composer and task details. With both on, Squawk merges before it archives;
868
- without a PR, it archives on Done. Pending or blocked completion actions show their
869
- reason in task details. Use `status <id> --full` to read the saved `archiveWhenDone`,
870
- `autoMergePr` and `completionAction` fields. Existing task choices can be changed
871
- through `PATCH /api/v1/p/:projectId/runs/:id` with the matching boolean fields.
872
-
873
- `start` is retry-safe: it sends a request id (`--request-id <UUID>` to pick your own), and a
874
- retry with the same id and start options answers with the run the first one created
875
- (`created: false`) instead of starting a second. Changing a completion control on that
876
- retry is a payload conflict. Also: `list`, `stop`, `finish`, `diff [--stat]`, `open`.
877
- Use `archive <id>` to hide a task from `list`, `unarchive <id>` to restore it, and
878
- `list --all` to include archived tasks. `list` never shows owned workers, with or without
879
- `--all`: they are steer targets of their parent task. Id-addressed commands (`status`, `wait`,
880
- `send`, `log`, `stop`, …) still accept a worker's id. `archive-finished` sweeps finished tasks (not scheduled runs waiting on a usage limit, and not owned workers, which leave with their parent) and prints
881
- `{"archived": count, "ids": [...], "pinnedIds": [...]}`. The single-task commands print `{"id": "…", "archived": true|false}`.
882
- Exit codes:
883
- `0` ok (`wait`/`start --wait`/`log --follow`: the task ended `done`/`review` or stopped for attention), `1` task
884
- failed/cancelled or a message was not delivered, `2` no cockpit or the cockpit refused (its `error`
885
- is passed through), `3` timed out, `64` usage error. `hsq task --help` lists every flag.
886
-
887
- **When a task needs you.** `status`, `list`, `wait` and the final `log --follow` line carry `attention` and `attentionLabel`,
888
- derived by the same function the cockpit's Needs You uses, so the CLI and the cockpit cannot
889
- disagree. Read those rather than the raw status:
890
-
891
- - `attention: waiting` (`attentionLabel` "needs you" / "needs review"), `error` or `permission`
892
- means the task wants a human. A `waiting` task is attention **even when no question is
893
- pending** — a finished turn parks the task for follow-up without a structured question —
894
- unless its top open wait is CI or a timer (below). A pending question shows as `question`
895
- on `status`, with the agent's Markdown context as `questionContext` when it sent one, and as
896
- `waitingOn` `{ kind: 'human' }`; never clear a task on its absence alone.
897
- - `attention: running` with `attentionLabel` "waiting for CI", "waiting for merge" or "monitoring"
898
- (`status: waiting` with an open PR wait or timer in `waitingOn`) is neither settled nor attention: the agent is
899
- still working on its own sub-agents or a watched command, whatever its last log line says.
900
- - `attention: none` with "waiting on 2 workers" is a task parked on its own workers; it will wake
901
- by itself.
902
-
903
- `wait`, `start --wait` and `log --follow` stop as soon as a task needs you or ends
904
- (`--until attention`, the default); `--until settled` waits for a terminal status only — for
905
- `--autonomous` runs, or a bot that wants an outcome:
906
-
907
- ```bash
908
- hsq task wait "$id" # stops when the task needs you, or ends
909
- hsq task wait "$id" --until settled # done/review/failed/cancelled only
910
- hsq task start --task-file task.md --wait # returns as soon as the agent parks
911
- hsq task start --task-file task.md --wait --autonomous --until settled # runs to completion
912
- hsq task log "$id" --follow # streams until the task needs you, or ends
913
- hsq task log "$id" --follow --until settled # streams until done/review/failed/cancelled
914
- ```
915
-
916
- *Migrating from `--until settled`.* Before 0.16, `wait` and `start --wait` defaulted to
917
- `settled`, so an ordinary interactive task ran out the timeout (exit 3) although the agent had
918
- parked within seconds. The default is now `attention`. A bot that polls for terminal state adds
919
- `--until settled` to its `wait` / `start --wait` calls; nothing else about `settled` changed. Each
920
- run in the `wait` output (and the `start --wait` object) now carries `attention` +
921
- `attentionLabel`, and the output's top level says which `until` was in force, so a caller can tell
922
- "parked for follow-up" (`status: waiting`, `attention: waiting`) from "finished" (`status: done`,
923
- `attention: none`) without knowing Squawk's status vocabulary.
924
-
925
- *`log --follow` (#931).* `log --follow` used to stop on a terminal status only, so tailing an
926
- interactive task streamed until `--timeout-seconds` and exited 3 after the agent had parked. It
927
- now takes the same `--until` with the same `attention` default, judged by the same function as
928
- `wait`; `--until` without `--follow` is a usage error. Every event is still printed before the
929
- final line, which is now `{"id", "status", "attention", "attentionLabel", "until", "timedOut"}`. A
930
- bot that tails to terminal state adds `--until settled`. `log` without `--follow` is unchanged.
931
-
932
- **A bot that lives behind an HTTP endpoint** does not have to poll. Add a webhook (a name, a
933
- description, a URL and an optional Bearer token) under **Webhooks** in the project's **Settings →
934
- General** and turn on **Task notifications**. Every task that opts in then POSTs one delivery to
935
- each such webhook when it enters a state that webhook selects: **Needs you**, **Failed**,
936
- **Done** and **Cancelled** by default, plus **Running**, **Waiting for agents**, **Waiting on CI**,
937
- **Waiting** (a timer) and **Any other wait** when you tick them. A question that puts the task in
938
- Needs you is `task.question`; every other entry is `task.status`, and the body's `state` names the
939
- state. `task.subscribed` (when it opts in, at start or on hand-off) and **Send test** always go out.
940
- Each body carries the same slim projection `hsq task status` prints, under `task`. `hsq task start`
941
- opts in only with `--notify` (off by default); the cockpit's New task form
942
- has a **Notify webhook** toggle; and a running task's **Hand off** button (or
943
- `hsq task notify <id> --message '…'`) turns it on later with a note for the bot. `notify` (and
944
- `send --notify`) on a worker's id is a usage error that names the parent to notify instead;
945
- `notify --off` still works on one. The note goes to
946
- the webhook only, never to the agent. Delivery is best-effort: 10 s timeout, 3 attempts, and a
947
- failure shows in the thread without touching the task. The token is stored in `<config>` and never
948
- sent back to a browser. Under `HSQ_DRY_RUN=1` (`CEZ_DRY_RUN` fallback) nothing is sent; the payload is logged in the thread.
949
-
950
- A project can hold several webhooks, each with its own states, and each body names the webhook it
951
- went to under `webhook`. One failing webhook never delays or stops another.
952
-
953
- ### Reports from agents: `hsq webhook`
954
-
955
- Turn on **Let agents send reports** for a webhook, and agents in that project can send it a report
956
- on demand: a friction report to a triage bot instead of a new GitHub issue, for example. Agents see
957
- each such webhook's name and description in their system prompt, so write the description as
958
- instructions ("Send friction you hit with tools here instead of filing a GitHub issue"). A webhook
959
- without that switch cannot be reached this way.
960
-
961
- ```sh
962
- hsq webhook list # the webhooks open to agents
963
- hsq webhook send 'Friction reports' --message-file report.md --title 'Squeal skipped an edit'
964
- hsq webhook send <name|id> --message 'Short report' [--data '{"severity":"low"}']
965
- ```
966
-
967
- The body is `event: "agent.report"` with `webhook`, `title`, the Markdown `message`, your `data`,
968
- and the reporting task's `runId`, thread `url` and `task` projection. The command prints the
969
- outcome as JSON and exits 0 delivered, 1 not delivered, 2 refused or no cockpit, 64 usage.
970
-
971
- ### Automations from a task: `hsq automation`
972
-
973
- `hsq automation` creates and manages automations (on by default; `HSQ_AUTOMATIONS=0` (`CEZ_AUTOMATIONS` fallback) disables them) on the cockpit that
974
- runs the task, so an agent asked to "do X every morning" or "whenever a PR opens" sets up an
975
- automation instead of a cron job. Like `hsq task`, it prints one JSON object per invocation and
976
- exits 0 ok, 1 check failed, 2 refused or no cockpit, 3 check timed out, 64 usage.
977
-
978
- ```sh
979
- hsq automation schema # the definition reference (needs no cockpit)
980
- hsq automation add --name 'Weekday triage' --cron '0 7 * * 1-5' --prompt 'Triage new issues'
981
- hsq automation add --name 'Review PRs' --on pull_request.opened --every 5m --label bug --prompt-file p.md
982
- hsq automation add --name 'Agent triage' --on issue.labeled --changed-label needs-agent --prompt 'Triage #{{github.number}}'
983
- hsq automation create --file def.json [--enable] # full JSON form; stdin when no flag is given
984
- hsq automation update <id> --json '{"task":{"prompt":"…"}}'
985
- hsq automation add --name 'Check the rollout' --at 2026-10-29T09:00 --tz Europe/Warsaw --prompt 'Check the rollout'
986
- hsq automation add --name 'Follow up' --in 7d --latest-start 6h --prompt 'Follow up on the migration'
987
- hsq automation check <id> [--execute] · run <id> · list [--archived include|only] · show <id> · enable <id> · pause <id> · cancel <id> · delete <id>
988
- ```
989
-
990
- `add` and `create` send the same body and create the automation **paused** unless `--enable` is
991
- given; `--cron` accepts the four shapes a schedule can take (daily, weekdays, one weekday, every N
992
- hours) and anything else is a usage error pointing to the JSON form. `update` replaces each key
993
- it is given, except `task`, which merges key by key (`null` removes one); it restates `enabled`
994
- and echoes the revision it read, so a concurrent edit in the cockpit is refused (exit 2), never
995
- overwritten. Mutating commands print the automation's cockpit page as `url`.
996
-
997
- `add` accepts `--archive-when-done` and `--auto-merge-pr` with the same behavior as
998
- `hsq task start`. The JSON keys are `task.archiveWhenDone` and `task.autoMergePr`.
999
- Both are optional booleans and default to off. The automation editor has the same
1000
- switches. Editing these choices affects future tasks only; it does not change tasks
1001
- the automation already launched. Enabling an automation or making its tasks autonomous
1002
- does not enable either completion control.
1003
-
1004
- GitHub automations exclude events before enablement by default. Turn on **Include existing items**
1005
- in the editor, pass `--include-existing` to `add`, or set `"filters": {"includeExisting": true,
1006
- "lookbackDays": 7, "maxRecords": 25}` in a JSON definition to include older matches within the
1007
- lookback (1–90 days). Turning this on for an enabled automation reopens that window on its next
1008
- check. Changing only the lookback preserves the completed cursor; pause and re-enable to
1009
- reopen the wider history window. Previously processed matches stay deduplicated across edits, pauses and restarts, and
1010
- per-check limits still apply. Historical scans resume across checks and restarts when capped.
1011
- GitHub search is limited to 1,000 items per window and label timelines to 100 events per item;
1012
- reaching either limit reports an error with guidance to narrow the filters or lookback. **Test filter** previews the selected window independently of the
1013
- execution cursor; it never launches tasks. For label triggers, the window applies to the label
1014
- event's time, so a newly added label can match an old issue even with history off. Historical
1015
- label discovery revisits the rolling window because later comments can move issues between pages;
1016
- receipts prevent those repeated observations from launching duplicate tasks.
1017
-
1018
- A **one-time schedule** (**Once** in the editor, `--at` or `--in` on `add`, `"schedule":
1019
- {"type": "once", "at": "2026-10-29T09:00", "timeZone": "Europe/Warsaw"}` in JSON) starts one
1020
- ordinary task at a wall-clock time in an explicit IANA zone. It is created paused like every
1021
- automation; **Enable** arms it. When it is due, Squawk starts the task and moves the schedule to
1022
- **Archived** with a link to that task; **Run now** does the same at once, so it never runs twice.
1023
- **Cancel** archives it without a task. An archived schedule cannot change, and the list hides it
1024
- until you pick the **Archived** filter. Squawk must be running at the due time. If it was not,
1025
- the schedule starts on the next boot only within its **Latest start** (no limit by default; 10
1026
- minutes to 30 days); after that it is marked **Missed** and stays until you edit, cancel or run it.
1027
- A launch that fails marks it **Failed**, and nothing retries on its own; **Retry** or **Run now**
1028
- relaunches the same receipt, so one schedule starts at most one task. Agents can create and manage
1029
- one-time schedules with the `cezar_schedule_task` and `cezar_scheduled_tasks` tools, which exist
1030
- by default unless `HSQ_AUTOMATIONS=0` (`CEZ_AUTOMATIONS` fallback) and also create schedules paused unless the user asked for them to run.
1031
- These tools take and answer the due time in UTC, like every other time in a Squawk tool; the
1032
- schedule keeps a wall time in the cockpit's time zone, so the cockpit shows it in local time.
1033
-
1034
- Automation list counters use two windows. **Launched** counts every stored task with that
1035
- automation's provenance, across definition revisions, including historical variants, completed and
1036
- archived tasks. Restarting or compacting automation logs and receipts does not change it;
1037
- deleting a task removes it from the count. **Matches**, **Duplicates** and **Errors** describe
1038
- only that automation's latest 100 activity-log rows. Recent activity remains a separate log view.
1039
-
1040
- The address comes from `HSQ_COCKPIT_URL` (`CEZ_COCKPIT_URL` fallback) and `HSQ_PROJECT_ID` (`CEZ_PROJECT_ID` fallback), which the cockpit puts in a task's
1041
- environment. Without them, only an explicit `--url`, `--repo` or `HSQ_URL` (`CEZ_URL` fallback) looks for a cockpit;
1042
- otherwise the command exits 2 and never starts a server. With automations off, the cockpit's `409`
1043
- is relayed verbatim (exit 2).
430
+ See [From the terminal: `hsq task` and `hsq message`](docs/areas/cli.md).
1044
431
 
1045
432
  ## Workflow format
1046
433
 
1047
- A workflow is a small YAML file in `.ai/cezar/workflows/`:
1048
-
1049
- ```yaml
1050
- name: fix-and-verify
1051
- description: Implement the task, then verify; retry with failing output on red.
1052
- steps:
1053
- - id: implement
1054
- name: Implement
1055
- prompt: "{{task}}"
1056
- skill: project-conventions # optional — from .ai/skills or .ai/cezar/skills
1057
- # model: opus # optional per-step model override
1058
- # effort: high # optional per-step effort: low · medium · high · xhigh · max
1059
- # runner: codex # optional per-step backend: claude · codex · opencode · cursor · pi · omp
1060
- # timeoutMs: 7200000 # optional agent-step wall-clock cap (2 hours); 0 = no limit
1061
- # allowedTools: [Read, Edit, Write, Grep, Glob, Bash]
1062
- - id: verify
1063
- name: Verify
1064
- command: "npm test" # a check step: exit 0 passes
1065
- onFail:
1066
- retry: implement # loop back to an earlier step…
1067
- max: 2 # …at most twice
1068
- ```
1069
-
1070
- `{{task}}` is replaced with the task text you typed. When a check fails and loops
1071
- back, its failing output is appended to the retried agent's prompt so the next
1072
- attempt can see what broke.
1073
-
1074
- Agent steps have no wall-clock limit by default, including steps before a check or
1075
- another agent. This applies to cockpit tasks, owned workers and `hsq run`, on every
1076
- runner. Non-final agent steps still close after their turn and advance the chain.
1077
- An authored agent step may opt into `timeoutMs`: an integer from `0` to `2147483647`
1078
- milliseconds, with `0` disabling the cap. A positive limit measures the entire
1079
- session from startup, including waiting; expiry fails the step and stops the chain.
1080
- It does not add workflow retry/resume behavior. Check steps reject this field.
1081
- Skill shorthand, default tasks and free-form Continue have no wall-clock cap.
1082
- All managed sessions have a separate 30-minute no-progress safeguard: while a turn
1083
- is open, native stream, tool or heartbeat activity refreshes it. A silent turn
1084
- fails and its process is terminated, with SIGKILL escalation if needed. Busy turns
1085
- can run longer than 30 minutes. Waiting at a turn boundary or for a human answer
1086
- pauses this safeguard; the next turn or answer rearms it. Standalone runner calls
1087
- keep their 30-minute wall-clock default. Startup protection and the existing
1088
- parked-session lifecycle still apply.
1089
-
1090
- Prefer skills over steps? A workflow can also be written in the portable
1091
- shorthand — an ordered list of skill names, each becoming one agent step:
1092
-
1093
- ```yaml
1094
- name: triage-and-fix
1095
- skills: [reproduce, root-cause, implement, self-review]
1096
- ```
1097
-
1098
- ---
434
+ See [Workflow format](docs/areas/workflows.md).
1099
435
 
1100
436
  ## How it runs agents
1101
437
 
@@ -1125,7 +461,7 @@ Useful environment variables:
1125
461
  | Var | Effect |
1126
462
  |---|---|
1127
463
  | `HSQ_*` settings (`CEZ_*` fallback) | Ordinary settings prefer a defined HSQ value, including empty. Home, hosted-mode REMOTE and native shell controls use the separate rules below. Both home locators and inherited controller authority are removed from child environments, even in full-env mode. |
1128
- | `CEZ_DELEGATION` | Retired (hearsay-tools/cezarion#2784); has no effect. Workers and task messaging are per-task settings, both on by default. See [Owned workers](#owned-workers). |
464
+ | `CEZ_DELEGATION` | Retired (hearsay-tools/cezarion#2784); has no effect. Workers and task messaging are per-task settings, both on by default. See [Owned workers](docs/workers.md#owned-workers). |
1129
465
  | `HSQ_DELEGATION_URL`, `CEZ_DELEGATION_URL`, `HSQ_DELEGATION_TOKEN`, `CEZ_DELEGATION_TOKEN` | Internal generated session values; do not configure or copy them. Tokens rotate on Continue/restart and are revoked when the session/controller closes. |
1130
466
  | `HSQ_REMOTE`, `CEZ_REMOTE` | Hosted mode: exact `1` under either name disables local handoff and local settings administration. Empty or `0` cannot cancel the other name's hosted-mode pin. Server installers pin both names. |
1131
467
  | `HSQ_API_PORT`, `CEZ_API_PORT` | Local service port used by the development web proxy; defaults to 4321. |
@@ -1337,7 +673,7 @@ steps:
1337
673
  ```
1338
674
 
1339
675
  Owned workers can compare approaches in separate worktrees. Each worker has its own
1340
- runner and model selection; see [Owned workers](#owned-workers).
676
+ runner and model selection; see [Owned workers](docs/workers.md#owned-workers).
1341
677
 
1342
678
  **Models come from your own machine.** For Claude, Codex, OpenCode, and Pi, the model picker
1343
679
  is not a list Squawk ships — it asks the installed CLI what it can actually run
@@ -1506,7 +842,7 @@ automatically; your workflows and skills stay committable. See [run history reco
1506
842
  Settings that belong to *you* rather than to a repo — the parallel cap
1507
843
  (`maxParallel`, default **2**), the per-task memory ceiling and the checkout
1508
844
  root — live once in `<config>/config.json`, alongside the
1509
- [project registry](#multiple-projects-one-cockpit), and are edited from
845
+ [project registry](docs/areas/workspace-registry.md#multiple-projects-one-cockpit), and are edited from
1510
846
  **Settings → Resources** and **Settings → Projects**. A `maxParallel` left over
1511
847
  in a repo's `.ai/cezar/config.json` is imported into the workspace file the
1512
848
  first time Squawk boots there, and ignored afterwards.