@hearsay-tools/squawk 0.18.0-pr3633.6595 → 0.18.0-pr3636.6601
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 +12 -994
- package/dist/delegation/routes.d.ts +77 -77
- package/dist/delegation/transport.d.ts +4 -4
- package/dist/project-migration/steps.js +1 -2
- package/dist/project-migration/steps.js.map +1 -1
- package/dist/runs/project-run-connection.js +2 -8
- package/dist/runs/project-run-connection.js.map +1 -1
- package/dist/runs/run-database-version.d.ts +1 -1
- package/dist/runs/run-database-version.js +1 -1
- package/dist/runs/run-database.d.ts +0 -8
- package/dist/runs/run-database.js +190 -12
- package/dist/runs/run-database.js.map +1 -1
- package/dist/runs/run-row.d.ts +0 -3
- package/dist/runs/run-row.js +0 -9
- package/dist/runs/run-row.js.map +1 -1
- package/dist/runs/store.d.ts +2 -2
- package/dist/runs/store.js +4 -3
- package/dist/runs/store.js.map +1 -1
- package/dist/server/activity-routes.d.ts +23 -23
- package/dist/server/server.d.ts +1376 -1376
- package/dist/workflows/run/wait-engine.d.ts +72 -72
- package/package.json +4 -5
- package/scripts/benchmark-worktree-retention.ts +45 -20
- package/dist/runs/conversation-members.d.ts +0 -27
- package/dist/runs/conversation-members.js +0 -76
- package/dist/runs/conversation-members.js.map +0 -1
- package/dist/runs/run-database-migrations.d.ts +0 -8
- package/dist/runs/run-database-migrations.js +0 -192
- package/dist/runs/run-database-migrations.js.map +0 -1
- package/scripts/benchmark-conversation-lookup.ts +0 -105
- package/scripts/benchmark-store-fixture.ts +0 -43
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ and a run never stops to ask; it just finishes. Leave it on a VPS and you get
|
|
|
22
22
|
a dev team that's *always on* — a mobile-friendly cockpit you can check from
|
|
23
23
|
your phone, working your backlog while you're away.
|
|
24
24
|
|
|
25
|
-
[A look inside](#a-look-inside) · [What Squawk does best](#what-squawk-does-best-) · [What it solves](#what-it-solves) · [Who it's for](#who-its-for) · [Quick start](#quick-start) · [How it works](#how-it-works) · [Core concepts](#core-concepts) · [Cockpit tour](#cockpit-tour) · [Agent backends](#coding-agent-backends) · [Remote access](#remote-access-host-squawk-on-a-server)
|
|
25
|
+
[A look inside](#a-look-inside) · [What Squawk does best](#what-squawk-does-best-) · [What it solves](#what-it-solves) · [Who it's for](#who-its-for) · [Quick start](#quick-start) · [How it works](#how-it-works) · [Core concepts](#core-concepts) · [Cockpit tour](#cockpit-tour) · [Agent backends](docs/areas/runners.md#coding-agent-backends) · [Remote access](docs/remote-access.md#remote-access-host-squawk-on-a-server)
|
|
26
26
|
|
|
27
27
|
[](LICENSE)
|
|
28
28
|

|
|
@@ -140,7 +140,7 @@ and an orchestrator keeps a whole queue of them moving.
|
|
|
140
140
|
with one agent, review with another) — and through **OpenCode**, **pi** or
|
|
141
141
|
**OMP** you can point a run at **open-source or local models**, not just the
|
|
142
142
|
big vendors. See
|
|
143
|
-
[Agent backends](#coding-agent-backends).
|
|
143
|
+
[Agent backends](docs/areas/runners.md#coding-agent-backends).
|
|
144
144
|
- 🖥️ **Close the laptop and the work stops.** A local agent only runs while your
|
|
145
145
|
machine is on and awake. Put Squawk on a **VPS, cloud box, or dedicated server**
|
|
146
146
|
and the cockpit becomes the GUI for an **always-on AI coding team** — kick off,
|
|
@@ -205,7 +205,7 @@ The old `cez` and `cezarion` commands still work during the
|
|
|
205
205
|
[deprecation window](docs/migration.md#rollback-and-the-deprecation-window), with one stderr notice per process. No API key is ever used — Squawk shells out to whichever agent
|
|
206
206
|
CLIs you are already logged into, `claude` by default.
|
|
207
207
|
|
|
208
|
-
> **Contributing?** [Local development](#local-development) shows how to get a
|
|
208
|
+
> **Contributing?** [Local development](docs/development.md#local-development) shows how to get a
|
|
209
209
|
> global `hsq` command straight off your checkout (`npm run install-as-command`)
|
|
210
210
|
> — no publish needed.
|
|
211
211
|
|
|
@@ -427,1021 +427,39 @@ See [Owned workers](docs/workers.md).
|
|
|
427
427
|
|
|
428
428
|
## From the terminal: `hsq task` and `hsq message`
|
|
429
429
|
|
|
430
|
-
`hsq task`
|
|
431
|
-
for a bot driving one. Every command prints one JSON object and exits with a code the caller can
|
|
432
|
-
branch on, so nothing has to parse prose. It never starts a server: it finds the cockpit whose
|
|
433
|
-
project registry holds this checkout (ports 4321–4370; a task worktree resolves to its parent
|
|
434
|
-
project), or you point it at one with `--url` / `HSQ_URL` (`CEZ_URL` fallback).
|
|
435
|
-
|
|
436
|
-
```text
|
|
437
|
-
hsq task [--url <origin> | --repo <dir>] <operation> …
|
|
438
|
-
```
|
|
439
|
-
|
|
440
|
-
The shared `--url`, `--repo` and `--help`/`-h` flags also work before the operation;
|
|
441
|
-
`--url` and `--repo` accept both `--flag value` and `--flag=value`. A shared flag repeated
|
|
442
|
-
before the operation or on both sides is a usage error. Operation flags stay after the
|
|
443
|
-
operation. `hsq task --help <operation>` shows that operation's help without discovery.
|
|
444
|
-
An explicit `--url` wins over `HSQ_URL` (`CEZ_URL` fallback); `--repo` selects the checkout to discover.
|
|
445
|
-
|
|
446
|
-
`hsq task send` is human input. It can answer a pending human question. It refuses
|
|
447
|
-
inside a task (`HSQ_TASK_ID` (`CEZ_TASK_ID` fallback) is set). Agents use `hsq message` for task messages,
|
|
448
|
-
including peer and parent/worker conversations; see [Owned workers](docs/workers.md#owned-workers).
|
|
449
|
-
|
|
450
|
-
```bash
|
|
451
|
-
id=$(hsq task start --task-file - <<'EOF' | jq -r .id
|
|
452
|
-
Fix the `hsq task` docs. Keep $(example) and "quotes" literal.
|
|
453
|
-
EOF
|
|
454
|
-
)
|
|
455
|
-
hsq task wait "$id" --timeout-seconds 900 # 0 done/review/needs you · 1 failed · 3 timeout
|
|
456
|
-
hsq task list # currentStepId (running), pullRequestUrl (done/review), capped error (failed)
|
|
457
|
-
hsq task status "$id" # slim JSON: status, attention, question, branch, handoffUrl…
|
|
458
|
-
hsq task send "$id" 'Use the retry helper instead' # delivered live, queued before start
|
|
459
|
-
hsq task send "$id" --resume 'Continue with the next step' # resumed: reopen a settled session
|
|
460
|
-
hsq task log "$id" --follow --timeout-seconds 300 # JSON lines until it needs you or ends
|
|
461
|
-
```
|
|
462
|
-
|
|
463
|
-
`list --status` accepts comma-separated values: `queued`, `running`, `waiting`, `review`,
|
|
464
|
-
`done`, `failed`, `cancelled`. Default rows include only the next-action field for their status
|
|
465
|
-
when defined; errors use the first line, at most 200 characters including `…` when cut.
|
|
466
|
-
Default `status` includes `handoffUrl`, a URL to the existing handoff endpoint even before
|
|
467
|
-
contents are seeded, and keeps the full error. `--full` still prints the contract unchanged.
|
|
468
|
-
To answer a pending `question`, use the same `send` with the answer text. Without `--resume`,
|
|
469
|
-
a closed session returns `delivery: not-delivered` and the `next` command. For multi-line or
|
|
470
|
-
shell-sensitive messages use `send <id> --text-file <path|->` (`-` reads stdin); the quoting
|
|
471
|
-
rules below apply to messages too.
|
|
472
|
-
|
|
473
|
-
Use `--task-file PATH` to read a saved task (for example, `hsq task start --task-file task.md`),
|
|
474
|
-
or `--task-file -` to read stdin as above. The quoted heredoc delimiter (`<<'EOF'`) keeps
|
|
475
|
-
backticks and `$()` literal in the task text.
|
|
476
|
-
|
|
477
|
-
POSIX shells, including Bash, expand backticks and `$()` in double-quoted arguments before
|
|
478
|
-
hsq receives the text. **Do not put raw backticks in double-quoted task arguments.** This can
|
|
479
|
-
execute parts of your prompt as shell commands and leave holes in the stored task, including
|
|
480
|
-
when starting tasks through SSH and `bash -lc`. Prefer a task file or stdin with a quoted
|
|
481
|
-
heredoc delimiter. A single-quoted positional argument still works for short tasks:
|
|
482
|
-
`hsq task start 'Fix the typo'`.
|
|
483
|
-
|
|
484
|
-
`hsq task start --task-file task.md --skill <name>` names one skill as the task's agent step;
|
|
485
|
-
`--skill` and `--workflow` are mutually exclusive. The CLI checks `GET /skills` first and
|
|
486
|
-
includes a `warning` in its JSON result if the skill is missing or the catalog cannot be
|
|
487
|
-
checked; it still starts the run. Like a cockpit skill start, if the skill is missing at
|
|
488
|
-
execution, the agent uses the plain prompt and the run logs a note. CLI starts do not change
|
|
489
|
-
the cockpit composer's recent picks or skill-usage ranking.
|
|
490
|
-
Without either flag, `start` still runs `quick-task`.
|
|
491
|
-
|
|
492
|
-
`--runner <claude|codex|opencode|pi|cursor|omp>` picks the runner, as in a workflow step and
|
|
493
|
-
`hsq discover --runner`; `--model` and `--effort` pin the rest. `--backend` is a permanent
|
|
494
|
-
alias of `--runner` with no warning. Giving both with different values exits 64.
|
|
495
|
-
|
|
496
|
-
`--archive-when-done` archives the task after **Done**. `--auto-merge-pr` merges its
|
|
497
|
-
PR after **Done** only when current-head CI and GitHub rules pass. It can mark a
|
|
498
|
-
draft PR ready. Both controls are off by default. They also appear as switches in
|
|
499
|
-
the task composer and task details. With both on, Squawk merges before it archives;
|
|
500
|
-
without a PR, it archives on Done. Pending or blocked completion actions show their
|
|
501
|
-
reason in task details. Use `status <id> --full` to read the saved `archiveWhenDone`,
|
|
502
|
-
`autoMergePr` and `completionAction` fields. Existing task choices can be changed
|
|
503
|
-
through `PATCH /api/v1/p/:projectId/runs/:id` with the matching boolean fields.
|
|
504
|
-
|
|
505
|
-
`start` is retry-safe: it sends a request id (`--request-id <UUID>` to pick your own), and a
|
|
506
|
-
retry with the same id and start options answers with the run the first one created
|
|
507
|
-
(`created: false`) instead of starting a second. Changing a completion control on that
|
|
508
|
-
retry is a payload conflict. Also: `list`, `stop`, `finish`, `diff [--stat]`, `open`.
|
|
509
|
-
Use `archive <id>` to hide a task from `list`, `unarchive <id>` to restore it, and
|
|
510
|
-
`list --all` to include archived tasks. `list` never shows owned workers, with or without
|
|
511
|
-
`--all`: they are steer targets of their parent task. Id-addressed commands (`status`, `wait`,
|
|
512
|
-
`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
|
|
513
|
-
`{"archived": count, "ids": [...], "pinnedIds": [...]}`. The single-task commands print `{"id": "…", "archived": true|false}`.
|
|
514
|
-
Exit codes:
|
|
515
|
-
`0` ok (`wait`/`start --wait`/`log --follow`: the task ended `done`/`review` or stopped for attention), `1` task
|
|
516
|
-
failed/cancelled or a message was not delivered, `2` no cockpit or the cockpit refused (its `error`
|
|
517
|
-
is passed through), `3` timed out, `64` usage error. `hsq task --help` lists every flag.
|
|
518
|
-
|
|
519
|
-
**When a task needs you.** `status`, `list`, `wait` and the final `log --follow` line carry `attention` and `attentionLabel`,
|
|
520
|
-
derived by the same function the cockpit's Needs You uses, so the CLI and the cockpit cannot
|
|
521
|
-
disagree. Read those rather than the raw status:
|
|
522
|
-
|
|
523
|
-
- `attention: waiting` (`attentionLabel` "needs you" / "needs review"), `error` or `permission`
|
|
524
|
-
means the task wants a human. A `waiting` task is attention **even when no question is
|
|
525
|
-
pending** — a finished turn parks the task for follow-up without a structured question —
|
|
526
|
-
unless its top open wait is CI or a timer (below). A pending question shows as `question`
|
|
527
|
-
on `status`, with the agent's Markdown context as `questionContext` when it sent one, and as
|
|
528
|
-
`waitingOn` `{ kind: 'human' }`; never clear a task on its absence alone.
|
|
529
|
-
- `attention: running` with `attentionLabel` "waiting for CI", "waiting for merge" or "monitoring"
|
|
530
|
-
(`status: waiting` with an open PR wait or timer in `waitingOn`) is neither settled nor attention: the agent is
|
|
531
|
-
still working on its own sub-agents or a watched command, whatever its last log line says.
|
|
532
|
-
- `attention: none` with "waiting on 2 workers" is a task parked on its own workers; it will wake
|
|
533
|
-
by itself.
|
|
534
|
-
|
|
535
|
-
`wait`, `start --wait` and `log --follow` stop as soon as a task needs you or ends
|
|
536
|
-
(`--until attention`, the default); `--until settled` waits for a terminal status only — for
|
|
537
|
-
`--autonomous` runs, or a bot that wants an outcome:
|
|
538
|
-
|
|
539
|
-
```bash
|
|
540
|
-
hsq task wait "$id" # stops when the task needs you, or ends
|
|
541
|
-
hsq task wait "$id" --until settled # done/review/failed/cancelled only
|
|
542
|
-
hsq task start --task-file task.md --wait # returns as soon as the agent parks
|
|
543
|
-
hsq task start --task-file task.md --wait --autonomous --until settled # runs to completion
|
|
544
|
-
hsq task log "$id" --follow # streams until the task needs you, or ends
|
|
545
|
-
hsq task log "$id" --follow --until settled # streams until done/review/failed/cancelled
|
|
546
|
-
```
|
|
547
|
-
|
|
548
|
-
*Migrating from `--until settled`.* Before 0.16, `wait` and `start --wait` defaulted to
|
|
549
|
-
`settled`, so an ordinary interactive task ran out the timeout (exit 3) although the agent had
|
|
550
|
-
parked within seconds. The default is now `attention`. A bot that polls for terminal state adds
|
|
551
|
-
`--until settled` to its `wait` / `start --wait` calls; nothing else about `settled` changed. Each
|
|
552
|
-
run in the `wait` output (and the `start --wait` object) now carries `attention` +
|
|
553
|
-
`attentionLabel`, and the output's top level says which `until` was in force, so a caller can tell
|
|
554
|
-
"parked for follow-up" (`status: waiting`, `attention: waiting`) from "finished" (`status: done`,
|
|
555
|
-
`attention: none`) without knowing Squawk's status vocabulary.
|
|
556
|
-
|
|
557
|
-
*`log --follow` (#931).* `log --follow` used to stop on a terminal status only, so tailing an
|
|
558
|
-
interactive task streamed until `--timeout-seconds` and exited 3 after the agent had parked. It
|
|
559
|
-
now takes the same `--until` with the same `attention` default, judged by the same function as
|
|
560
|
-
`wait`; `--until` without `--follow` is a usage error. Every event is still printed before the
|
|
561
|
-
final line, which is now `{"id", "status", "attention", "attentionLabel", "until", "timedOut"}`. A
|
|
562
|
-
bot that tails to terminal state adds `--until settled`. `log` without `--follow` is unchanged.
|
|
563
|
-
|
|
564
|
-
**A bot that lives behind an HTTP endpoint** does not have to poll. Add a webhook (a name, a
|
|
565
|
-
description, a URL and an optional Bearer token) under **Webhooks** in the project's **Settings →
|
|
566
|
-
General** and turn on **Task notifications**. Every task that opts in then POSTs one delivery to
|
|
567
|
-
each such webhook when it enters a state that webhook selects: **Needs you**, **Failed**,
|
|
568
|
-
**Done** and **Cancelled** by default, plus **Running**, **Waiting for agents**, **Waiting on CI**,
|
|
569
|
-
**Waiting** (a timer) and **Any other wait** when you tick them. A question that puts the task in
|
|
570
|
-
Needs you is `task.question`; every other entry is `task.status`, and the body's `state` names the
|
|
571
|
-
state. `task.subscribed` (when it opts in, at start or on hand-off) and **Send test** always go out.
|
|
572
|
-
Each body carries the same slim projection `hsq task status` prints, under `task`. `hsq task start`
|
|
573
|
-
opts in only with `--notify` (off by default); the cockpit's New task form
|
|
574
|
-
has a **Notify webhook** toggle; and a running task's **Hand off** button (or
|
|
575
|
-
`hsq task notify <id> --message '…'`) turns it on later with a note for the bot. `notify` (and
|
|
576
|
-
`send --notify`) on a worker's id is a usage error that names the parent to notify instead;
|
|
577
|
-
`notify --off` still works on one. The note goes to
|
|
578
|
-
the webhook only, never to the agent. Delivery is best-effort: 10 s timeout, 3 attempts, and a
|
|
579
|
-
failure shows in the thread without touching the task. The token is stored in `<config>` and never
|
|
580
|
-
sent back to a browser. Under `HSQ_DRY_RUN=1` (`CEZ_DRY_RUN` fallback) nothing is sent; the payload is logged in the thread.
|
|
581
|
-
|
|
582
|
-
A project can hold several webhooks, each with its own states, and each body names the webhook it
|
|
583
|
-
went to under `webhook`. One failing webhook never delays or stops another.
|
|
584
|
-
|
|
585
|
-
### Reports from agents: `hsq webhook`
|
|
586
|
-
|
|
587
|
-
Turn on **Let agents send reports** for a webhook, and agents in that project can send it a report
|
|
588
|
-
on demand: a friction report to a triage bot instead of a new GitHub issue, for example. Agents see
|
|
589
|
-
each such webhook's name and description in their system prompt, so write the description as
|
|
590
|
-
instructions ("Send friction you hit with tools here instead of filing a GitHub issue"). A webhook
|
|
591
|
-
without that switch cannot be reached this way.
|
|
592
|
-
|
|
593
|
-
```sh
|
|
594
|
-
hsq webhook list # the webhooks open to agents
|
|
595
|
-
hsq webhook send 'Friction reports' --message-file report.md --title 'Squeal skipped an edit'
|
|
596
|
-
hsq webhook send <name|id> --message 'Short report' [--data '{"severity":"low"}']
|
|
597
|
-
```
|
|
598
|
-
|
|
599
|
-
The body is `event: "agent.report"` with `webhook`, `title`, the Markdown `message`, your `data`,
|
|
600
|
-
and the reporting task's `runId`, thread `url` and `task` projection. The command prints the
|
|
601
|
-
outcome as JSON and exits 0 delivered, 1 not delivered, 2 refused or no cockpit, 64 usage.
|
|
602
|
-
|
|
603
|
-
### Automations from a task: `hsq automation`
|
|
604
|
-
|
|
605
|
-
`hsq automation` creates and manages automations (on by default; `HSQ_AUTOMATIONS=0` (`CEZ_AUTOMATIONS` fallback) disables them) on the cockpit that
|
|
606
|
-
runs the task, so an agent asked to "do X every morning" or "whenever a PR opens" sets up an
|
|
607
|
-
automation instead of a cron job. Like `hsq task`, it prints one JSON object per invocation and
|
|
608
|
-
exits 0 ok, 1 check failed, 2 refused or no cockpit, 3 check timed out, 64 usage.
|
|
609
|
-
|
|
610
|
-
```sh
|
|
611
|
-
hsq automation schema # the definition reference (needs no cockpit)
|
|
612
|
-
hsq automation add --name 'Weekday triage' --cron '0 7 * * 1-5' --prompt 'Triage new issues'
|
|
613
|
-
hsq automation add --name 'Review PRs' --on pull_request.opened --every 5m --label bug --prompt-file p.md
|
|
614
|
-
hsq automation add --name 'Agent triage' --on issue.labeled --changed-label needs-agent --prompt 'Triage #{{github.number}}'
|
|
615
|
-
hsq automation create --file def.json [--enable] # full JSON form; stdin when no flag is given
|
|
616
|
-
hsq automation update <id> --json '{"task":{"prompt":"…"}}'
|
|
617
|
-
hsq automation add --name 'Check the rollout' --at 2026-10-29T09:00 --tz Europe/Warsaw --prompt 'Check the rollout'
|
|
618
|
-
hsq automation add --name 'Follow up' --in 7d --latest-start 6h --prompt 'Follow up on the migration'
|
|
619
|
-
hsq automation check <id> [--execute] · run <id> · list [--archived include|only] · show <id> · enable <id> · pause <id> · cancel <id> · delete <id>
|
|
620
|
-
```
|
|
621
|
-
|
|
622
|
-
`add` and `create` send the same body and create the automation **paused** unless `--enable` is
|
|
623
|
-
given; `--cron` accepts the four shapes a schedule can take (daily, weekdays, one weekday, every N
|
|
624
|
-
hours) and anything else is a usage error pointing to the JSON form. `update` replaces each key
|
|
625
|
-
it is given, except `task`, which merges key by key (`null` removes one); it restates `enabled`
|
|
626
|
-
and echoes the revision it read, so a concurrent edit in the cockpit is refused (exit 2), never
|
|
627
|
-
overwritten. Mutating commands print the automation's cockpit page as `url`.
|
|
628
|
-
|
|
629
|
-
`add` accepts `--archive-when-done` and `--auto-merge-pr` with the same behavior as
|
|
630
|
-
`hsq task start`. The JSON keys are `task.archiveWhenDone` and `task.autoMergePr`.
|
|
631
|
-
Both are optional booleans and default to off. The automation editor has the same
|
|
632
|
-
switches. Editing these choices affects future tasks only; it does not change tasks
|
|
633
|
-
the automation already launched. Enabling an automation or making its tasks autonomous
|
|
634
|
-
does not enable either completion control.
|
|
635
|
-
|
|
636
|
-
GitHub automations exclude events before enablement by default. Turn on **Include existing items**
|
|
637
|
-
in the editor, pass `--include-existing` to `add`, or set `"filters": {"includeExisting": true,
|
|
638
|
-
"lookbackDays": 7, "maxRecords": 25}` in a JSON definition to include older matches within the
|
|
639
|
-
lookback (1–90 days). Turning this on for an enabled automation reopens that window on its next
|
|
640
|
-
check. Changing only the lookback preserves the completed cursor; pause and re-enable to
|
|
641
|
-
reopen the wider history window. Previously processed matches stay deduplicated across edits, pauses and restarts, and
|
|
642
|
-
per-check limits still apply. Historical scans resume across checks and restarts when capped.
|
|
643
|
-
GitHub search is limited to 1,000 items per window and label timelines to 100 events per item;
|
|
644
|
-
reaching either limit reports an error with guidance to narrow the filters or lookback. **Test filter** previews the selected window independently of the
|
|
645
|
-
execution cursor; it never launches tasks. For label triggers, the window applies to the label
|
|
646
|
-
event's time, so a newly added label can match an old issue even with history off. Historical
|
|
647
|
-
label discovery revisits the rolling window because later comments can move issues between pages;
|
|
648
|
-
receipts prevent those repeated observations from launching duplicate tasks.
|
|
649
|
-
|
|
650
|
-
A **one-time schedule** (**Once** in the editor, `--at` or `--in` on `add`, `"schedule":
|
|
651
|
-
{"type": "once", "at": "2026-10-29T09:00", "timeZone": "Europe/Warsaw"}` in JSON) starts one
|
|
652
|
-
ordinary task at a wall-clock time in an explicit IANA zone. It is created paused like every
|
|
653
|
-
automation; **Enable** arms it. When it is due, Squawk starts the task and moves the schedule to
|
|
654
|
-
**Archived** with a link to that task; **Run now** does the same at once, so it never runs twice.
|
|
655
|
-
**Cancel** archives it without a task. An archived schedule cannot change, and the list hides it
|
|
656
|
-
until you pick the **Archived** filter. Squawk must be running at the due time. If it was not,
|
|
657
|
-
the schedule starts on the next boot only within its **Latest start** (no limit by default; 10
|
|
658
|
-
minutes to 30 days); after that it is marked **Missed** and stays until you edit, cancel or run it.
|
|
659
|
-
A launch that fails marks it **Failed**, and nothing retries on its own; **Retry** or **Run now**
|
|
660
|
-
relaunches the same receipt, so one schedule starts at most one task. Agents can create and manage
|
|
661
|
-
one-time schedules with the `cezar_schedule_task` and `cezar_scheduled_tasks` tools, which exist
|
|
662
|
-
by default unless `HSQ_AUTOMATIONS=0` (`CEZ_AUTOMATIONS` fallback) and also create schedules paused unless the user asked for them to run.
|
|
663
|
-
These tools take and answer the due time in UTC, like every other time in a Squawk tool; the
|
|
664
|
-
schedule keeps a wall time in the cockpit's time zone, so the cockpit shows it in local time.
|
|
665
|
-
|
|
666
|
-
Automation list counters use two windows. **Launched** counts every stored task with that
|
|
667
|
-
automation's provenance, across definition revisions, including historical variants, completed and
|
|
668
|
-
archived tasks. Restarting or compacting automation logs and receipts does not change it;
|
|
669
|
-
deleting a task removes it from the count. **Matches**, **Duplicates** and **Errors** describe
|
|
670
|
-
only that automation's latest 100 activity-log rows. Recent activity remains a separate log view.
|
|
671
|
-
|
|
672
|
-
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
|
|
673
|
-
environment. Without them, only an explicit `--url`, `--repo` or `HSQ_URL` (`CEZ_URL` fallback) looks for a cockpit;
|
|
674
|
-
otherwise the command exits 2 and never starts a server. With automations off, the cockpit's `409`
|
|
675
|
-
is relayed verbatim (exit 2).
|
|
430
|
+
See [From the terminal: `hsq task` and `hsq message`](docs/areas/cli.md).
|
|
676
431
|
|
|
677
432
|
## Workflow format
|
|
678
433
|
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
```yaml
|
|
682
|
-
name: fix-and-verify
|
|
683
|
-
description: Implement the task, then verify; retry with failing output on red.
|
|
684
|
-
steps:
|
|
685
|
-
- id: implement
|
|
686
|
-
name: Implement
|
|
687
|
-
prompt: "{{task}}"
|
|
688
|
-
skill: project-conventions # optional — from .ai/skills or .ai/cezar/skills
|
|
689
|
-
# model: opus # optional per-step model override
|
|
690
|
-
# effort: high # optional per-step effort: low · medium · high · xhigh · max
|
|
691
|
-
# runner: codex # optional per-step backend: claude · codex · opencode · cursor · pi · omp
|
|
692
|
-
# timeoutMs: 7200000 # optional agent-step wall-clock cap (2 hours); 0 = no limit
|
|
693
|
-
# allowedTools: [Read, Edit, Write, Grep, Glob, Bash]
|
|
694
|
-
- id: verify
|
|
695
|
-
name: Verify
|
|
696
|
-
command: "npm test" # a check step: exit 0 passes
|
|
697
|
-
onFail:
|
|
698
|
-
retry: implement # loop back to an earlier step…
|
|
699
|
-
max: 2 # …at most twice
|
|
700
|
-
```
|
|
701
|
-
|
|
702
|
-
`{{task}}` is replaced with the task text you typed. When a check fails and loops
|
|
703
|
-
back, its failing output is appended to the retried agent's prompt so the next
|
|
704
|
-
attempt can see what broke.
|
|
705
|
-
|
|
706
|
-
Agent steps have no wall-clock limit by default, including steps before a check or
|
|
707
|
-
another agent. This applies to cockpit tasks, owned workers and `hsq run`, on every
|
|
708
|
-
runner. Non-final agent steps still close after their turn and advance the chain.
|
|
709
|
-
An authored agent step may opt into `timeoutMs`: an integer from `0` to `2147483647`
|
|
710
|
-
milliseconds, with `0` disabling the cap. A positive limit measures the entire
|
|
711
|
-
session from startup, including waiting; expiry fails the step and stops the chain.
|
|
712
|
-
It does not add workflow retry/resume behavior. Check steps reject this field.
|
|
713
|
-
Skill shorthand, default tasks and free-form Continue have no wall-clock cap.
|
|
714
|
-
All managed sessions have a separate 30-minute no-progress safeguard: while a turn
|
|
715
|
-
is open, native stream, tool or heartbeat activity refreshes it. A silent turn
|
|
716
|
-
fails and its process is terminated, with SIGKILL escalation if needed. Busy turns
|
|
717
|
-
can run longer than 30 minutes. Waiting at a turn boundary or for a human answer
|
|
718
|
-
pauses this safeguard; the next turn or answer rearms it. Standalone runner calls
|
|
719
|
-
keep their 30-minute wall-clock default. Startup protection and the existing
|
|
720
|
-
parked-session lifecycle still apply.
|
|
721
|
-
|
|
722
|
-
Prefer skills over steps? A workflow can also be written in the portable
|
|
723
|
-
shorthand — an ordered list of skill names, each becoming one agent step:
|
|
724
|
-
|
|
725
|
-
```yaml
|
|
726
|
-
name: triage-and-fix
|
|
727
|
-
skills: [reproduce, root-cause, implement, self-review]
|
|
728
|
-
```
|
|
729
|
-
|
|
730
|
-
---
|
|
434
|
+
See [Workflow format](docs/areas/workflows.md).
|
|
731
435
|
|
|
732
436
|
## How it runs agents
|
|
733
437
|
|
|
734
|
-
|
|
735
|
-
**your subscription, no API key**. With the default Claude Code backend that
|
|
736
|
-
means headless `stream-json` mode, tool access via `--allowedTools`, with
|
|
737
|
-
unapproved tools denied without prompting (`--permission-mode dontAsk`) inside
|
|
738
|
-
the task's worktree — but note the zero-config default list (`Read`, `Edit`,
|
|
739
|
-
`Write`, `Grep`, `Glob`, `Bash`) grants unrestricted `Bash` unless a step sets
|
|
740
|
-
`bashAllowlist`, so treat a run as having full shell access in its worktree,
|
|
741
|
-
not a sandboxed allowlist. Set `HSQ_APPROVAL_GATE=1` (`CEZ_APPROVAL_GATE` fallback) to opt into Claude's
|
|
742
|
-
interactive approval UI. Codex, OpenCode and Cursor are driven through their
|
|
743
|
-
own native protocols and don't honor `allowedTools` at all; OpenCode's own
|
|
744
|
-
permission config decides what it asks. pi and OMP map `allowedTools` onto
|
|
745
|
-
their own tool allowlists — see
|
|
746
|
-
[Coding agent backends](#coding-agent-backends) for what each one actually
|
|
747
|
-
locks down. Nothing runs on a server you don't own.
|
|
748
|
-
|
|
749
|
-
Live Preview lets Chromium use host graphics when available. Chromium selects the
|
|
750
|
-
backend and falls back to software when hardware is unavailable or blocked. This
|
|
751
|
-
needs no Squawk setting or VirGL-specific setup. On Linux, GPU access may also
|
|
752
|
-
need a working display in the cockpit process environment. JPEG streaming is
|
|
753
|
-
unchanged; GPU rendering does not guarantee hardware frame encoding.
|
|
754
|
-
|
|
755
|
-
Useful environment variables:
|
|
756
|
-
|
|
757
|
-
| Var | Effect |
|
|
758
|
-
|---|---|
|
|
759
|
-
| `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. |
|
|
760
|
-
| `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). |
|
|
761
|
-
| `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. |
|
|
762
|
-
| `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. |
|
|
763
|
-
| `HSQ_API_PORT`, `CEZ_API_PORT` | Local service port used by the development web proxy; defaults to 4321. |
|
|
764
|
-
| `HSQ_CODEX_NETWORK`, `CEZ_CODEX_NETWORK` | Codex sandbox network access: exact `0` disables it. |
|
|
765
|
-
| `HSQ_CODEX_REASONING`, `CEZ_CODEX_REASONING` | Codex reasoning summary: auto (default), concise, detailed or none. |
|
|
766
|
-
| `HSQ_RELEASE_CHANNEL`, `CEZ_RELEASE_CHANNEL` | Explicitly requests `nightly` in `release-snapshot.mjs`. Other nonempty values, including `stable` and `development`, publish nothing. When unset or empty, the event selects development snapshots. `release.mjs` selects stable releases through its bump argument. |
|
|
767
|
-
| `HSQ_RELEASE_ROOT`, `CEZ_RELEASE_ROOT` | Repository root containing the package manifests that `release.mjs` reads and stamps. |
|
|
768
|
-
| `HSQ_SNAPSHOT_ROOT`, `CEZ_SNAPSHOT_ROOT` | Repository root containing the package manifests that `release-snapshot.mjs` reads and stamps. |
|
|
769
|
-
| `HSQ_ALLOW_TEST_SPAWN`, `CEZ_ALLOW_TEST_SPAWN` | Test harness opt-in for real agent process spawning. Leave unset outside tests. |
|
|
770
|
-
| `HSQ_ARTIFACTS_DIR`, `CEZ_ARTIFACTS_DIR`, `HSQ_HANDOFF_FILE`, `CEZ_HANDOFF_FILE`, `HSQ_TASK_ID`, `CEZ_TASK_ID`, `HSQ_PROJECT_ROOT`, `CEZ_PROJECT_ROOT` | Internal task paths and identity generated by the controller. Do not configure them. |
|
|
771
|
-
| `HSQ_TOOL_SOCKET`, `CEZ_TOOL_SOCKET`, `HSQ_TOOL_TOKEN`, `CEZ_TOOL_TOKEN` | Internal tool transport authority generated for each session. Do not configure or copy it. |
|
|
772
|
-
| `HSQ_AUTOSAVE_OWNER`, `CEZ_AUTOSAVE_OWNER` | Internal process attribution markers. Do not configure them. |
|
|
773
|
-
| `HSQ_DESKTOP`, `CEZ_DESKTOP`, `HSQ_SUPERVISED`, `CEZ_SUPERVISED`, `HSQ_SUPERVISOR_PID`, `CEZ_SUPERVISOR_PID`, `HSQ_SUPERVISOR_STDIN`, `CEZ_SUPERVISOR_STDIN` | Internal desktop and supervisor lifecycle values. The shell's CEZ value wins when present, including empty values; HSQ is used only when CEZ is absent. Do not configure them. |
|
|
774
|
-
| `HSQ_DISCLAIM_EXEC`, `CEZ_DISCLAIM_EXEC` | Desktop executable used to remove inherited macOS execution attribution. A defined CEZ value wins over HSQ. Discovered automatically. |
|
|
775
|
-
| `HSQ_DESKTOP_ENTRY` / `CEZ_DESKTOP_ENTRY` | Native-shell development entry file. The HSQ name wins when present, including an empty value. |
|
|
776
|
-
| `HSQ_DESKTOP_CWD` / `CEZ_DESKTOP_CWD` | Native-shell starting project directory. The HSQ name wins when present. |
|
|
777
|
-
| `HSQ_DESKTOP_NODE` / `CEZ_DESKTOP_NODE` | Native-shell Node executable. The HSQ name wins when present. Empty selects `node` on PATH. |
|
|
778
|
-
| `HSQ_DESKTOP_NO_UPDATE=1` / `CEZ_DESKTOP_NO_UPDATE=1` | Disable signed native-shell updates. The HSQ name wins when present. Debug builds already disable updates. |
|
|
779
|
-
| `HSQ_DESKTOP_DEBUG_IPC` / `CEZ_DESKTOP_DEBUG_IPC` | Debug builds only: exercise native title-bar IPC after loading the cockpit. The HSQ name wins when present. |
|
|
780
|
-
| `HSQ_URL`, `CEZ_URL` | Cockpit origin for `hsq task` and operator `hsq discover` (e.g. a hosted `HSQ_REMOTE`, `CEZ_REMOTE` cockpit). Unset, they find the local cockpit serving this checkout on ports 4321–4370. Parent discovery uses its delegation controller instead. |
|
|
781
|
-
| `HSQ_COCKPIT_URL`, `CEZ_COCKPIT_URL`, `HSQ_PROJECT_ID`, `CEZ_PROJECT_ID` | Set by the cockpit in every agent's environment once it listens: the bound origin and the run's project. `hsq automation` calls that address; a headless `hsq run` sets neither. Do not configure them. |
|
|
782
|
-
| `HSQ_DRY_RUN=1`, `CEZ_DRY_RUN=1` | Use bundled mocks for all five agent backends — the cockpit works offline for demos and development. Explicit backend binary overrides still win. |
|
|
783
|
-
| `HSQ_AGENT_MODELS_LOCKED=1`, `CEZ_AGENT_MODELS_LOCKED=1` | Globally lock each runner to the model configured in its native Claude/Codex/OpenCode settings while keeping runner selection available. Exact `1` also delegates authentication and provider enablement to those native agents, so Squawk skips its credential probes and provider-disable preferences. Existing Squawk presets are preserved but ignored, and an environment change requires a restart. The config-file equivalent is `"modelsLocked": true` in global `<config>/config.json` or one repository's `.ai/cezar/config.json`; config-file locks do not disable provider checks. |
|
|
784
|
-
| `HSQ_APPROVAL_GATE=1`, `CEZ_APPROVAL_GATE=1` | Opt into Claude's interactive approval UI; by default, unapproved tools are denied without interrupting the run. Ignored when `HSQ_CLAUDE_PERMISSION_MODE`, `CEZ_CLAUDE_PERMISSION_MODE` is a recognized value (`dontAsk`, `acceptEdits`, or `bypass`). |
|
|
785
|
-
| `HSQ_CLAUDE_PERMISSION_MODE`, `CEZ_CLAUDE_PERMISSION_MODE` | Claude agent-run permission flag: `dontAsk` (default), `acceptEdits`, or `bypass`. `bypass` passes `--dangerously-skip-permissions` and omits `--permission-mode`. Unset or unknown keeps today's `dontAsk` / `HSQ_APPROVAL_GATE`, `CEZ_APPROVAL_GATE` path. Provider verification commands are never given this flag. |
|
|
786
|
-
| `HSQ_CLAUDE_SETTING_SOURCES`, `CEZ_CLAUDE_SETTING_SOURCES` | When set, Claude agent runs also pass `--setting-sources <value>` (e.g. `user,project,local`). Unset or empty omits the flag. Provider verification is never given this flag. |
|
|
787
|
-
| `HSQ_ARCHIVE_ON_MERGE=1`, `CEZ_ARCHIVE_ON_MERGE=1` | Archive settled task families after all associated pull requests merge. Off by default; only `1` enables this environment default. Saved project settings override global Tasks settings, which override the environment. Runs in the background while the cockpit is open, including unopened projects, without starting agents. Unarchive preserves restored tasks until a later merge. |
|
|
788
|
-
| `HSQ_AUTOMATIONS=0`, `CEZ_AUTOMATIONS=0` | Disable **automations** (GitHub polls and schedules). On by default; only the exact value `0` disables them. Unset, empty, `1` and other values keep them on. The Automations view and agent schedule tools are available by default. New automations start paused; each enabled automation launches an ordinary task per match or occurrence while Squawk is open. Schedules need no GitHub remote. With `0`, nothing polls or fires, automation endpoints answer `409`, and the nav item and schedule tools are hidden. Read at boot: restart after changing it. Existing enabled definitions resume after an upgrade unless you set `HSQ_AUTOMATIONS=0`, `CEZ_AUTOMATIONS=0` before restart. Definitions, receipts and high-watermarks are retained; unset the flag and restart to resume without migration. |
|
|
789
|
-
| `HSQ_PREVIEW=1`, `CEZ_PREVIEW=1` | Turn on **live preview** (experimental): agents register a dev server with the `cezar_preview_serve` tool, and the cockpit opens it in a headless Chromium on the host, docked next to the task. Squawk first runs a registered command after you press Run and open. Agents can then use `cezar_preview_stop({ port, restart?: boolean })` to stop or restart their own Squawk-started server with that unchanged approval; changed command, cwd or path needs Run and open again. Adopted servers cannot be stopped by this tool. Each agent session also gets `HSQ_PREVIEW_CDP_URL`, `CEZ_PREVIEW_CDP_URL`, a cockpit address through which it drives the same browser (`agent-browser --cdp "$CEZ_PREVIEW_CDP_URL" --pin-tab …`) while you watch; Chromium itself opens no debug port. Off by default, and only the exact value `1` enables it — without it the tool is not listed, its route and the preview WebSocket refuse, and `capabilities.preview` is `false`. Read at boot, so restart after changing it. |
|
|
790
|
-
| `HSQ_PREVIEW_NO_SANDBOX=1`, `CEZ_PREVIEW_NO_SANDBOX=1` | Launch the preview's Chromium with `--no-sandbox`. Off by default and never added automatically, not even for root or in a container; use it only where Chromium's sandbox cannot start, and only for pages you trust. Only the exact value `1` applies. Read at boot. |
|
|
791
|
-
| `HSQ_AUTOSAVE=1`, `CEZ_AUTOSAVE=1` | Re-enable the periodic (90 s) autosave commit in task worktrees. Off by default (open-mercato/cezar#471) — turn-end and pre-PR flushes always run, so branches still end complete. Every autosave names its trigger in the commit subject (`cezar autosave (periodic)` vs `(turn end)` / `(run finalize)` / `(pre-PR)`), so the flushes you keep are distinguishable from the timer you disabled. The turn-end / run-finalize flushes and the timer commit only while HEAD is the task's own `cez/<id8>` branch; on a branch the agent checked out they leave the work uncommitted, and the closing flush says so in the handoff's Squawk records block, not its Progress log (hearsay-tools/cezarion#1004, hearsay-tools/cezarion#1809). A turn-end / run-finalize commit is reported there too, with its `git reset --soft` fold-back command, and the timer's commits share one line per run of consecutive periodic commits (count, first and latest sha), with no cockpit note. Draft-PR publish refuses while HEAD is not on the task branch and names both branches; its pre-PR flush commits only onto that branch (hearsay-tools/squawk#1110). |
|
|
792
|
-
| `HSQ_CLAUDE_BIN=/path/to/claude`, `CEZ_CLAUDE_BIN=/path/to/claude` | Override the Claude executable for model discovery and execution. A set `HSQ_CLAUDE_BIN` wins over `CEZ_CLAUDE_BIN`; an explicit binary argument wins over both. |
|
|
793
|
-
| `HSQ_CODEX_BIN=/path/to/codex`, `CEZ_CODEX_BIN=/path/to/codex` | Override which `codex` binary is used. |
|
|
794
|
-
| `HSQ_OPENCODE_BIN=/path/to/opencode`, `CEZ_OPENCODE_BIN=/path/to/opencode` | Override which `opencode` binary is used. |
|
|
795
|
-
| `HSQ_PI_BIN=/path/to/pi`, `CEZ_PI_BIN=/path/to/pi` | Override which `pi` binary is used. |
|
|
796
|
-
| `HSQ_OMP_BIN=/path/to/omp`, `CEZ_OMP_BIN=/path/to/omp` | Override which `omp` (Oh My Pi) binary is used. |
|
|
797
|
-
| `HSQ_CURSOR_BIN=/path/to/agent`, `CEZ_CURSOR_BIN=/path/to/agent` | Override the Cursor CLI (`agent`) executable. |
|
|
798
|
-
| `CLAUDE_CONFIG_DIR`, `CODEX_HOME`, `PI_CODING_AGENT_DIR`, `OMP_PROFILE` | The agents' **own** variables, honoured where the vendor documents one. Setting one moves that agent's **default account** — the config folder (for omp, the profile) Squawk discovers. A *second* login of the same CLI is deliberately not an environment setting, since one process-wide value cannot differ per project: add it under **Settings → Agent accounts** and pick it per project. |
|
|
799
|
-
| `HSQ_BROWSE_ROOT=~/`, `CEZ_BROWSE_ROOT=~/` | Default root for **Add project → Open local folder…**. The picker cannot navigate above it; a saved workspace value overrides the environment default and must name an existing folder. |
|
|
800
|
-
| `HSQ_PROJECTS_DIR=~/cezar/projects`, `CEZ_PROJECTS_DIR=~/cezar/projects` | Default destination for **Clone from GitHub** and **New project**. Saved workspace settings override it, and missing directories are created recursively. |
|
|
801
|
-
| `HSQ_PROJECT_WARMUP=0`, `CEZ_PROJECT_WARMUP=0` | Prepare each registered project only when it is first opened. By default the cockpit prepares every other registered project in the background once it listens, one at a time, most recently opened first: the run store opens and interrupted runs resume, so the first click on a project does not wait. A project another live cockpit serves is skipped. |
|
|
802
|
-
| `HSQ_AUTONOMOUS_DEFAULT=0`, `CEZ_AUTONOMOUS_DEFAULT=0` | Seed the New Task Autonomous default (`0` or `1`). Without a seed, skills default on and workflows off; a saved global Resources setting overrides it. |
|
|
803
|
-
| `HSQ_WORKTREE_DEFAULT=1`, `CEZ_WORKTREE_DEFAULT=1` | Seed the New Task Worktree default (`0` or `1`). Without a seed, eligible runs default on; a saved global Resources setting overrides it. |
|
|
804
|
-
| `HSQ_DISABLE_REPO_LOCK=1`, `CEZ_DISABLE_REPO_LOCK=1` | **Dangerous escape hatch:** allow any run executing in the repository root — an explicit `worktree=false` run, non-Git degradation, or a continuation whose worktree cannot be restored — to proceed without Squawk’s repository-root lease. Agents can overwrite each other’s files or Git state; isolated worktree runs are unaffected. Off by default; only the exact value `1` enables it. |
|
|
805
|
-
| `HSQ_HIDE_TOKEN_USAGE=1`, `CEZ_HIDE_TOKEN_USAGE=1` | Hide raw input/output token counts throughout the browser cockpit while leaving backend-reported cost visible. Only the exact value `1` enables it; telemetry and API payloads are unchanged, and a restart is required after changing it. |
|
|
806
|
-
| `HSQ_HIDE_COST=1`, `CEZ_HIDE_COST=1` | Hide backend-reported monetary cost throughout the browser cockpit while leaving raw input/output token counts visible. Only the exact value `1` enables it; telemetry and API payloads are unchanged, and a restart is required after changing it. |
|
|
807
|
-
| `HSQ_HIDE_TOKEN_METRICS=1`, `CEZ_HIDE_TOKEN_METRICS=1` | Legacy master switch that hides both token usage and cost. It takes precedence over the two independent flags; only the exact value `1` enables it, payloads are unchanged, and a restart is required. |
|
|
808
|
-
| `GITHUB_TOKEN` | Fallback for GitHub reads/PRs when `gh` isn't authenticated. |
|
|
809
|
-
| `HSQ_HOME=/path/to/home` (`CEZ_HOME` fallback) | Selects `config/`, `state/`, `data/`, `cache/`, and `run/` below this directory. With neither set, uses the [platform roots](docs/migration.md#home-directories). A non-default `CEZ_HOME` keeps its permanent one-root fallback; an explicit legacy-default `CEZ_HOME` uses the platform roots. Both home locators are removed from child environments. |
|
|
810
|
-
| `HSQ_ENV_PASSTHROUGH=A,B`, `CEZ_ENV_PASSTHROUGH=A,B` | Forward these extra host env vars to spawned agents. `CEZ_HOME` and `HSQ_HOME` are always removed, including in full-env mode. By default agents get a least-privilege env (safe shell/toolchain vars + the backend's own auth + `GITHUB_TOKEN` + `HSQ_*` and matching `CEZ_*` aliases), not your full environment — use this to add a var an agent needs. A dev server live preview starts gets the same env without the backend's auth and `GITHUB_TOKEN`, plus these names. |
|
|
811
|
-
| `HSQ_AGENT_ENV_FULL=1`, `CEZ_AGENT_ENV_FULL=1` | Escape hatch: give spawned agents, and dev servers live preview starts, the full host environment except `CEZ_HOME` and `HSQ_HOME` (pre-hardening behavior). Off by default; only set it if you understand that this hands every host secret to the agent process. |
|
|
812
|
-
| `HSQ_AGENT_TMPDIR=0`, `CEZ_AGENT_TMPDIR=0` | Stop giving each task its own temp directory and hand agents the host `TMPDIR` again (pre-open-mercato/cezar#785 behavior). On by default: every run gets `TMPDIR`/`TEMP`/`TMP` pointing at `.ai/cezar/t/<task-id8>` (`.ai/cezar/tmp/<task-id>` before hearsay-tools/cezarion#1022), created and write-probed before the agent spawns, kept across session close, Continue, and restart while the task is live, and reaped at terminal completion or history deletion (hearsay-tools/cezarion#515) — and kept short enough for unix-socket paths: a checkout so deep that `.ai/cezar/t/<task-id8>` would leave no room under the kernel's socket-path limit for Chromium's singleton socket resolves it to a `cez-agent-…` directory under the system temp dir instead (hearsay-tools/cezarion#387), with its location recorded so host temp-environment changes cannot move live scratch. So concurrent tasks stop sharing one directory and a task refuses to start rather than run against a temp directory that silently swallows its shell output (see Troubleshooting below). Only an exact `0` disables it, and it disables the whole thing — the pre-spawn check included, so this stays an escape hatch you can actually take. |
|
|
813
|
-
| `HSQ_REDACT_SECRETS=0`, `CEZ_REDACT_SECRETS=0` | Disable scrubbing of credential values/token shapes from the on-disk state (the NDJSON transcript and the free-text fields of the run records in `runs.db`). On by default; leave it on. Controller-generated delegation tokens are always scrubbed. Best-effort defense-in-depth, not a guarantee: it catches known token shapes and the values of your own secret-named env vars, so a credential in neither category can still get through. |
|
|
814
|
-
| `HSQ_TITLE_UPDATES=0`, `CEZ_TITLE_UPDATES=0` | Turn off the live task-title refresh (namer re-runs on each turn end). The Settings → Agents toggle overrides this default. |
|
|
815
|
-
| `HSQ_AUTONAME=0`, `CEZ_AUTONAME=0` | Disable ALL LLM task naming (creation + live) — titles stay heuristic (`437: /om-auto-review-pr`). Under `HSQ_DRY_RUN=1`, `CEZ_DRY_RUN=1` naming is already off unless forced with `HSQ_AUTONAME=1`, `CEZ_AUTONAME=1`. |
|
|
816
|
-
| `HSQ_REVIEW_GATE=1`, `CEZ_REVIEW_GATE=1` | Turn ON the optional diff-first review gate (open-mercato/cezar#489): a successful, non-autonomous run with changes parks at `review` (Accept / Send back / Draft PR) instead of finishing. Off by default — changed runs settle to `done` with the diff left in the worktree. Only `1` enables. The Settings → Agents toggle overrides this; autonomous runs always skip it. |
|
|
817
|
-
| `VITE_HSQ_API_BASE=http://localhost:4321`, `VITE_CEZ_API_BASE=http://localhost:4321` | **Build time only**, and only when the cockpit bundle is deployed apart from the service it talks to. Empty (the default) means "the origin that served this page", which is right for both normal cases: the CLI serves the bundle itself, and `npm run dev` proxies `/api` to the local service. A deployment that must be configured without a rebuild can put `<meta name="cez-api-base" content="…">` in the served HTML instead, which wins over this. |
|
|
818
|
-
| `VITE_HSQ_E2E=1`, `VITE_CEZ_E2E=1` | **Build time only.** The cockpit e2e suite sets this when it builds the bundle it drives. It pins `useNow` and every `refetchInterval` so a wait cannot span a 30s tick or a 4s poll. Leave unset for production. |
|
|
819
|
-
|
|
820
|
-
### Troubleshooting: the agent's shell returns nothing
|
|
821
|
-
|
|
822
|
-
**Symptom.** A task on the Claude backend keeps working, but every shell command
|
|
823
|
-
comes back with no output and a spurious non-zero exit status — `echo hello`
|
|
824
|
-
included. Redirecting into a file inside the worktree still produces the right
|
|
825
|
-
content, so the commands genuinely run; only the *capture* is lost. Codex tasks
|
|
826
|
-
on the same machine are unaffected, because that backend streams over stdio
|
|
827
|
-
pipes instead of round-tripping a command's output through a temp file.
|
|
828
|
-
|
|
829
|
-
**Diagnosis.** The temp directory the agent was given is out of space or out of
|
|
830
|
-
quota. One line tells you:
|
|
831
|
-
|
|
832
|
-
```bash
|
|
833
|
-
echo probe > "${TMPDIR:-/tmp}/probe" # "Disk quota exceeded" / "No space left on device"
|
|
834
|
-
df -i "${TMPDIR:-/tmp}" # a tmpfs can exhaust inodes long before bytes
|
|
835
|
-
```
|
|
836
|
-
|
|
837
|
-
Under quota the file is *created* and the write then fails, so the backend reads
|
|
838
|
-
back a zero-byte capture file and hands the agent an empty result.
|
|
839
|
-
|
|
840
|
-
**Fix.** Since open-mercato/cezar#785 Squawk gives each task its own `TMPDIR` under
|
|
841
|
-
`.ai/cezar/t/<task-id8>` and write-probes it before spawning, so a broken temp
|
|
842
|
-
directory fails the task with `agent temp directory is not writable: …` on the
|
|
843
|
-
task thread instead of corrupting its work. If you see that error, free space on
|
|
844
|
-
the disk holding the repo. `HSQ_AGENT_TMPDIR=0` (`CEZ_AGENT_TMPDIR` fallback) turns the whole mechanism off —
|
|
845
|
-
per-task directory and pre-spawn check alike — and hands agents the host
|
|
846
|
-
`TMPDIR` again, which is the way out if the check itself is wrong on your
|
|
847
|
-
platform.
|
|
848
|
-
|
|
849
|
-
### Troubleshooting: tools inside a task fail with a socket-path error
|
|
850
|
-
|
|
851
|
-
**Symptom.** Inside a task, `npm install`, `npm run typecheck`, or another tool
|
|
852
|
-
dies with `listen EINVAL` or a "socket path too long" / `ENAMETOOLONG` error —
|
|
853
|
-
with `TMPDIR=/tmp` set by hand, the same commands succeed. Tools like `tsx` bind
|
|
854
|
-
*named* unix sockets under `TMPDIR` (its IPC server builds
|
|
855
|
-
`<tmpdir>/tsx-<uid>/<pid>.pipe`), and the kernel caps a socket path at 104–108
|
|
856
|
-
bytes — a temp directory near that length leaves no room for the name.
|
|
857
|
-
|
|
858
|
-
**Fix.** Since hearsay-tools/cezarion#387 Squawk keeps each task's temp directory short
|
|
859
|
-
enough for these sockets: at most 58 bytes since hearsay-tools/cezarion#1022, which
|
|
860
|
-
leaves room for Chromium's `<tmpdir>/org.chromium.Chromium.XXXXXX/SingletonSocket`
|
|
861
|
-
on macOS's 104-byte limit. The repo-local directory is `.ai/cezar/t/<task-id8>`
|
|
862
|
-
(the first 8 characters of the task id), short enough for ordinary checkouts such
|
|
863
|
-
as `/home/<user>/projects/<repo>`. A checkout deep enough to push it past the limit
|
|
864
|
-
gets a short `cez-agent-…` directory under the system temp directory instead —
|
|
865
|
-
still per-task, still write-probed before the agent spawns, still reaped when the
|
|
866
|
-
run ends.
|
|
867
|
-
`HSQ_AGENT_TMPDIR=0` (`CEZ_AGENT_TMPDIR` fallback) reverts the whole mechanism to the host `TMPDIR`.
|
|
868
|
-
|
|
869
|
-
---
|
|
438
|
+
See [How it runs agents](docs/areas/runners.md).
|
|
870
439
|
|
|
871
440
|
## Coding agent backends
|
|
872
441
|
|
|
873
|
-
|
|
874
|
-
`AgentRunner` seam with six built-in backends:
|
|
875
|
-
|
|
876
|
-
| Backend | CLI | How Squawk drives it | Tool access |
|
|
877
|
-
|---|---|---|---|
|
|
878
|
-
| **Claude Code** (default) | [`claude`](https://github.com/anthropics/claude-code) | Headless `stream-json` mode. | Per-tool `--allowedTools` (`bashAllowlist` scopes `Bash`); an empty `allowedTools` sends `--tools ""`, which removes every built-in tool, and pre-approves Squawk's own tools (other MCP tools follow the permission mode); `dontAsk` denies unapproved tools without prompting (`HSQ_APPROVAL_GATE=1` (`CEZ_APPROVAL_GATE` fallback) → `acceptEdits` + approval UI; `HSQ_CLAUDE_PERMISSION_MODE=bypass` (`CEZ_CLAUDE_PERMISSION_MODE` fallback) → `--dangerously-skip-permissions`). |
|
|
879
|
-
| **Codex** | [`codex`](https://github.com/openai/codex) | `codex app-server` — JSON-RPC over stdio, the same transport the Codex IDE extensions use. | Ignores `allowedTools`; inherits managed permissions and Codex approval defaults. Confirmed unmanaged sessions use `danger-full-access`. `HSQ_CODEX_NETWORK=0` (`CEZ_CODEX_NETWORK` fallback) requires network restriction: unmanaged sessions use network-blocked `workspace-write`; managed filesystem rules remain intact, and an unconfirmed network restriction stops before any turn. If requirements discovery is unavailable, Codex permission defaults apply. |
|
|
880
|
-
| **OpenCode** _(experimental)_ | [`opencode`](https://opencode.ai) | `opencode serve` — a local HTTP server with an SSE event stream. | Ignores `allowedTools` entirely; OpenCode's own permission config governs. Squawk answers OpenCode's built-in asks (outside-worktree reads, `.env` reads, the repeated-call guard) once, unless your config has a rule for that permission. Any other ask shows a permission card in the cockpit, and the run waits for your answer. |
|
|
881
|
-
| **Cursor** | [`agent`](https://cursor.com/docs/cli/installation) | Resumable `--print --output-format stream-json` turns on a qualified build; an unqualified build fails the task before inference. | Print mode admits marketplace plugins, including user and team plugins. Per-run `allowedTools` and `bashAllowlist` are unsupported. |
|
|
882
|
-
| **pi** _(experimental)_ | [`pi`](https://github.com/badlogic/pi-mono) | Persistent `--mode rpc` over JSONL; models are picked with the `provider/model` convention. | Maps `allowedTools` onto pi tool names. The default list, which adds the harness extras `Subagent`, `SubagentSupervisor` and `SubagentWait`, sends no allowlist: `--no-builtin-tools` plus a bundled extension that activates those built-ins, so MCP servers (`direct`, `codemode` and `deferred` exposure) and other pi extensions' tools stay callable. The six base tools alone, the list a worker inherits from a Claude parent, take the same path. A narrowed `allowedTools`, or one that names any tool outside that default set (an `mcp__` tool, `WebFetch` or a custom tool), uses pi's `--tools` allowlist, so a step that grants named tools reaches only those; a list that maps to nothing becomes `--no-tools` (or only the Squawk tools). A configured `bashAllowlist` disables Bash because pi cannot express command-prefix rules. |
|
|
883
|
-
| **OMP** _(experimental)_ | [`omp`](https://github.com/can1357/oh-my-pi) | Persistent `--mode rpc` over JSONL (Oh My Pi, a pi fork); models use the `provider/model` convention and are discovered from `omp models --json`. | Maps `allowedTools` onto OMP's `--tools` allowlist (`[]` becomes `--no-tools`); default sessions also pass `todo`, `lsp`, `ast_edit`, `task` and `wait`. A configured `bashAllowlist` disables `bash` because OMP cannot express command-prefix rules. `--tools` filters built-in tools only, so MCP and extension tools stay callable under a narrowed list. |
|
|
884
|
-
|
|
885
|
-
> ⚠️ **OpenCode, pi and OMP support are experimental.** These runners work but are less
|
|
886
|
-
> battle-tested than the Claude Code and Codex backends, and OpenCode ignores
|
|
887
|
-
> `allowedTools` (its own permission config governs what it asks). Treat them as
|
|
888
|
-
> previews and expect rough edges.
|
|
889
|
-
|
|
890
|
-
On startup Squawk probes which CLIs are installed and the cockpit only offers
|
|
891
|
-
the backends it found — install any one of the six and you're operational.
|
|
892
|
-
|
|
893
|
-
### Cursor CLI
|
|
894
|
-
|
|
895
|
-
Install [Cursor CLI](https://cursor.com/docs/cli/installation) and run `agent login`,
|
|
896
|
-
or set `CURSOR_API_KEY`. Squawk discovers `agent` on PATH; `HSQ_CURSOR_BIN` (`CEZ_CURSOR_BIN` fallback) overrides
|
|
897
|
-
its location. Select **Cursor** in the runner picker. On build
|
|
898
|
-
`2026.10.01-e373342` or newer, new sessions use print mode so marketplace plugins
|
|
899
|
-
are available. Squawk checks `agent --version` and the native tool catalog before
|
|
900
|
-
the first turn; `agent --version` is also the quick way to check your installation.
|
|
901
|
-
Squawk starts the CLI with `--disable-auto-update`, so a task never updates it;
|
|
902
|
-
update it yourself with `agent update`. An older build, or a build missing a core
|
|
903
|
-
tool, fails the task before any inference, with the reason and the fix: run
|
|
904
|
-
`agent update`, or update Squawk if your build is newer than it supports.
|
|
905
|
-
ACP-tagged and untagged Cursor sessions cannot resume after ACP removal: Continue
|
|
906
|
-
on one reports that, and you start a new task to carry the work on. Existing
|
|
907
|
-
print-tagged sessions can still resume.
|
|
908
|
-
A missing CLI leaves the other backends available. `HSQ_DRY_RUN=1` (`CEZ_DRY_RUN` fallback) uses the mock.
|
|
909
|
-
Cursor questions from a plugin may be automatically skipped by print mode. Squawk's
|
|
910
|
-
own `cezar_ask` questions remain answerable in the cockpit; plugins that require
|
|
911
|
-
native questions may not work fully. Project-local Claude plugin settings may
|
|
912
|
-
not disable a user or team marketplace copy. A previously confirmed Cursor
|
|
913
|
-
session ID can also lose history inside Cursor without an error; Squawk resumes
|
|
914
|
-
the recorded ID and checks that Cursor returns the same ID.
|
|
915
|
-
Cursor provides no qualified token-usage telemetry; Squawk leaves usage unavailable
|
|
916
|
-
instead of estimating it. Squawk discovers Cursor's canonical model IDs and advertised
|
|
917
|
-
effort levels through Cursor's read-only ACP model catalog (`agent acp`), which opens
|
|
918
|
-
no session. Print mode accepts those IDs and applies effort using a complete native
|
|
919
|
-
parameter selection passed with `--model`, retaining the account catalog's defaults for
|
|
920
|
-
other parameters. Advertised legacy print variants remain supported. An unsupported
|
|
921
|
-
explicit effort fails instead of silently choosing another level.
|
|
922
|
-
|
|
923
|
-
Settings → Agent config exposes Cursor’s global `cli-config.json`, project
|
|
924
|
-
`.cursor/cli.json` permissions, `.cursor/mcp.json`, and shared `AGENTS.md`.
|
|
925
|
-
[Cursor’s configuration reference](https://cursor.com/docs/cli/reference/configuration)
|
|
926
|
-
documents `CURSOR_CONFIG_DIR` and the Linux/BSD `XDG_CONFIG_HOME/cursor` override.
|
|
927
|
-
These select configuration; Squawk does not offer alternate Cursor account profiles
|
|
928
|
-
because a complete credential-and-session home override has not been verified.
|
|
929
|
-
|
|
930
|
-
### OMP (Oh My Pi)
|
|
931
|
-
|
|
932
|
-
Install [OMP](https://github.com/can1357/oh-my-pi) (`curl -fsSL https://omp.sh/install | sh`
|
|
933
|
-
installs a prebuilt binary; Bun is needed only for `--source`) and run `omp login`. Squawk discovers `omp` on PATH;
|
|
934
|
-
`HSQ_OMP_BIN` (`CEZ_OMP_BIN` fallback) overrides its location. `omp` is a separate backend from `pi`: a host with
|
|
935
|
-
both binaries keeps both, and `HSQ_PI_BIN` (`CEZ_PI_BIN` fallback) never selects OMP. Select **OMP** in the runner
|
|
936
|
-
picker to use a persistent `--mode rpc` session. A missing CLI leaves the other backends
|
|
937
|
-
available and shows OMP as unavailable. `HSQ_DRY_RUN=1` (`CEZ_DRY_RUN` fallback) uses the mock.
|
|
938
|
-
|
|
939
|
-
Agents ask questions through Squawk's `cezar_ask` tool, and OMP's own sub-agents appear in the
|
|
940
|
-
Agents drawer. Settings → Agent config exposes OMP's `config.yml`, `mcp.json` and
|
|
941
|
-
`AGENTS.md` files. Named OMP profiles and accounts are not supported yet.
|
|
942
|
-
|
|
943
|
-
**Pick a backend at three levels** (most specific wins):
|
|
944
|
-
|
|
945
|
-
1. **Config default** — `"defaultRunner": "codex"` in `.ai/cezar/config.json`.
|
|
946
|
-
2. **Per task** — the backend picker next to the task box in the cockpit.
|
|
947
|
-
3. **Per workflow step** — `runner:` on any step in the YAML.
|
|
948
|
-
|
|
949
|
-
Per-step overrides are what make **mixed-agent strategies** a one-liner:
|
|
950
|
-
implement with one agent, review with another, and let a shell check referee:
|
|
951
|
-
|
|
952
|
-
```yaml
|
|
953
|
-
name: implement-and-cross-review
|
|
954
|
-
steps:
|
|
955
|
-
- id: implement
|
|
956
|
-
name: Implement
|
|
957
|
-
prompt: "{{task}}"
|
|
958
|
-
runner: codex # one vendor writes the code…
|
|
959
|
-
effort: medium # …with a cheaper reasoning pass
|
|
960
|
-
- id: review
|
|
961
|
-
name: Cross-review
|
|
962
|
-
prompt: "Review the diff produced for: {{task}}. Fix real issues only."
|
|
963
|
-
runner: claude # …another one reviews it
|
|
964
|
-
effort: high # …with more reasoning for review
|
|
965
|
-
- id: verify
|
|
966
|
-
name: Verify
|
|
967
|
-
command: "npm test"
|
|
968
|
-
onFail: { retry: implement, max: 2 }
|
|
969
|
-
```
|
|
970
|
-
|
|
971
|
-
Owned workers can compare approaches in separate worktrees. Each worker has its own
|
|
972
|
-
runner and model selection; see [Owned workers](docs/workers.md#owned-workers).
|
|
973
|
-
|
|
974
|
-
**Models come from your own machine.** For Claude, Codex, OpenCode, and Pi, the model picker
|
|
975
|
-
is not a list Squawk ships — it asks the installed CLI what it can actually run
|
|
976
|
-
(Claude stream-json `list_models`, `codex app-server`'s `model/list`,
|
|
977
|
-
`opencode models`, and `pi --list-models`), caches the answer in
|
|
978
|
-
memory for five minutes, and shows it. A model your provider rolled out
|
|
979
|
-
yesterday is selectable without a Squawk release, and one it retired stops being
|
|
980
|
-
offered. Claude discovery starts no model turn and uses safe mode with no session
|
|
981
|
-
persistence. It has a 15-second deadline and a 200-model cap, with child cleanup
|
|
982
|
-
on every outcome. Unsupported or unavailable Claude CLIs fall back to the
|
|
983
|
-
`opus`, `sonnet`, and `haiku` aliases. `auto` (let the agent decide) is always
|
|
984
|
-
available, including when the CLI is missing, logged out, or slow — discovery
|
|
985
|
-
never blocks the cockpit, and a model you pinned yourself stays selectable even
|
|
986
|
-
if it is absent from the discovered list.
|
|
987
|
-
|
|
988
|
-
The seam is deliberately small: a backend is one class implementing the
|
|
989
|
-
`AgentRunner` interface (`packages/cezar/src/core/agent-runner.ts`) that turns a prompt into
|
|
990
|
-
a stream of normalized events. Other CLIs — pi, aider, whatever ships next —
|
|
991
|
-
can slot in the same way.
|
|
992
|
-
|
|
993
|
-
---
|
|
442
|
+
See [Coding agent backends](docs/areas/runners.md).
|
|
994
443
|
|
|
995
444
|
## Desktop app
|
|
996
445
|
|
|
997
|
-
|
|
998
|
-
or connect to a remote HTTPS cockpit (loopback HTTP supports SSH tunnels). Remote
|
|
999
|
-
windows have no native command permissions and need no local Node or agent install.
|
|
1000
|
-
Local mode needs Node.js 24.21.0+ and npm, then installs `@hearsay-tools/squawk` on first use.
|
|
1001
|
-
|
|
1002
|
-
See [desktop installation, development and testing](docs/desktop.md). PR builds
|
|
1003
|
-
provide test installers; public releases require platform signing and notarization.
|
|
446
|
+
See [Desktop app](docs/desktop.md).
|
|
1004
447
|
|
|
1005
448
|
## Remote access (host Squawk on a server)
|
|
1006
449
|
|
|
1007
|
-
|
|
1008
|
-
a shared team box, a VPS, your phone — put an **authenticated public front** in
|
|
1009
|
-
front of it. The built-in installer does this interactively, per **platform
|
|
1010
|
-
strategy**, and never escalates silently: every privileged command is printed
|
|
1011
|
-
and verified, and it ends with a real authenticated end-to-end check.
|
|
1012
|
-
|
|
1013
|
-
```bash
|
|
1014
|
-
npx -p @hearsay-tools/squawk hsq server-install --platform ubuntu-vps # stand it up
|
|
1015
|
-
npx -p @hearsay-tools/squawk hsq server-deploy --platform ubuntu-vps # roll out a new version (reload the service)
|
|
1016
|
-
npx -p @hearsay-tools/squawk hsq server-uninstall --platform ubuntu-vps # reverse it
|
|
1017
|
-
|
|
1018
|
-
# host a SECOND cockpit for another domain on the same box (ubuntu-vps):
|
|
1019
|
-
|
|
1020
|
-
npx -p @hearsay-tools/squawk hsq server-install --platform ubuntu-vps --domain shop.example.com
|
|
1021
|
-
```
|
|
1022
|
-
|
|
1023
|
-
On `ubuntu-vps` a single host can run several independent cockpits — add
|
|
1024
|
-
`--domain <host>` and each gets its own port, nginx site, login and service; a
|
|
1025
|
-
new domain never resumes or clobbers the first install.
|
|
1026
|
-
|
|
1027
|
-
**Already running a reverse proxy?** If Dokploy, Coolify, Caddy or your own
|
|
1028
|
-
nginx already owns `:80/:443`, Squawk's would fight it for the ports. Install the
|
|
1029
|
-
service only and let your proxy front it:
|
|
1030
|
-
|
|
1031
|
-
```bash
|
|
1032
|
-
npx -p @hearsay-tools/squawk hsq server-install --platform ubuntu-vps \
|
|
1033
|
-
--external-proxy --domain Squawk.example.com --bind-host 172.17.0.1
|
|
1034
|
-
```
|
|
1035
|
-
|
|
1036
|
-
`--bind-host` is only needed when the proxy runs in a **container** (Traefik
|
|
1037
|
-
can't reach the host's loopback); a host-installed proxy uses the `127.0.0.1`
|
|
1038
|
-
default. In this mode **your proxy must enforce authentication** — Squawk has
|
|
1039
|
-
none of its own. [Details →](docs/server-install/ubuntu-vps.md#the-box-already-has-a-reverse-proxy-dokploy-coolify-caddy)
|
|
1040
|
-
|
|
1041
|
-
| Provider | `--platform` | Public front | Guide |
|
|
1042
|
-
|----------|--------------|--------------|-------|
|
|
1043
|
-
| Ubuntu / Debian VPS | `ubuntu-vps` | nginx + Let's Encrypt HTTPS, htpasswd login, systemd | [Step-by-step →](docs/server-install/ubuntu-vps.md) |
|
|
1044
|
-
| Ubuntu + existing proxy | `ubuntu-vps --external-proxy` | your Dokploy/Traefik/Caddy front; Squawk ships the service only | [Step-by-step →](docs/server-install/ubuntu-vps.md#the-box-already-has-a-reverse-proxy-dokploy-coolify-caddy) |
|
|
1045
|
-
| macOS + ngrok | `macosx-ngrok` | ngrok tunnel + `--basic-auth`, launchd | [Step-by-step →](docs/server-install/macosx-ngrok.md) |
|
|
1046
|
-
|
|
1047
|
-
See the **[Remote access overview](docs/server-install/README.md)** for how it
|
|
1048
|
-
works and how to redeploy new versions. A remote cockpit keeps Agent config and
|
|
1049
|
-
worktree setup read-only; to edit them from the browser, see
|
|
1050
|
-
**[Remote settings administration](docs/server-install/remote-settings.md)**.
|
|
1051
|
-
|
|
1052
|
-
---
|
|
450
|
+
See [Remote access (host Squawk on a server)](docs/remote-access.md).
|
|
1053
451
|
|
|
1054
452
|
## Reviewing task files
|
|
1055
453
|
|
|
1056
|
-
|
|
1057
|
-
navigating to a host path under the cockpit URL. The selection stays in the URL,
|
|
1058
|
-
so bookmarks and browser Back work. This works with local and remote cockpits.
|
|
1059
|
-
|
|
1060
|
-
For a deliverable outside the project, an agent must explicitly publish a snapshot:
|
|
1061
|
-
|
|
1062
|
-
```sh
|
|
1063
|
-
hsq artifact publish /tmp/decision.md
|
|
1064
|
-
```
|
|
1065
|
-
|
|
1066
|
-
An agent starts a long command, such as a benchmark or a full test run, with `hsq job start`:
|
|
1067
|
-
|
|
1068
|
-
```sh
|
|
1069
|
-
hsq job start bench -- npm run benchmark
|
|
1070
|
-
hsq job status bench
|
|
1071
|
-
```
|
|
1072
|
-
|
|
1073
|
-
The command keeps running after the agent's shell call, turn and session end. It prints the
|
|
1074
|
-
paths of its log file and its exit-code file, which are in the task's temp directory unless
|
|
1075
|
-
`--dir` names another one. The agent waits for it with a process wait. A second start of a
|
|
1076
|
-
name that still runs is refused.
|
|
1077
|
-
|
|
1078
|
-
Squawk supplies the bundled command and task context to agent sessions automatically
|
|
1079
|
-
(`HSQ_TASK_ID` (`CEZ_TASK_ID` fallback) and `HSQ_ARTIFACTS_DIR` (`CEZ_ARTIFACTS_DIR` fallback); do not configure these yourself). The command
|
|
1080
|
-
returns JSON with a Markdown link for the agent to share. When the owning project
|
|
1081
|
-
is registered, the link keeps that project when copied or opened from another
|
|
1082
|
-
project. If ownership cannot be discovered, publication keeps the legacy task link.
|
|
1083
|
-
The Files tab also lists published artifacts. It previews text, Markdown and raster
|
|
1084
|
-
images; other formats can be downloaded. Published HTML links in assistant replies also
|
|
1085
|
-
show report cards. **Read report** opens the sandboxed reader beside the conversation
|
|
1086
|
-
on wide screens, in the main area on medium screens, and full screen on phones.
|
|
1087
|
-
Back returns to the source card. Unopened cards fetch metadata only.
|
|
1088
|
-
Report scripts never execute, and embedded images in Markdown documents do not load
|
|
1089
|
-
automatically.
|
|
1090
|
-
|
|
1091
|
-
Snapshots do not change when the original file changes. They survive worktree
|
|
1092
|
-
removal and are removed with task history, including normal history retention.
|
|
1093
|
-
Publication is limited to 10 MiB per file, 64 snapshots and 64 MiB per task; reaching
|
|
1094
|
-
a limit refuses the new publication without evicting earlier files. There is no
|
|
1095
|
-
arbitrary host-file reader or automatic collection of mentioned paths. Publish
|
|
1096
|
-
only intended review material, never credentials or unrelated private files.
|
|
454
|
+
See [Reviewing task files](docs/task-files.md).
|
|
1097
455
|
|
|
1098
456
|
## Configuration (optional)
|
|
1099
457
|
|
|
1100
|
-
|
|
1101
|
-
`config.json` in `.ai/squawk/` (`.ai/cezar/` before the project moves). A missing
|
|
1102
|
-
or malformed file uses the defaults, a bad value falls back to its own default,
|
|
1103
|
-
nothing blocks startup, and the cockpit never saves over a file that is not valid
|
|
1104
|
-
JSON:
|
|
1105
|
-
|
|
1106
|
-
```jsonc
|
|
1107
|
-
{
|
|
1108
|
-
"skillsRepos": [], // team skills; none by default. Example: [{ "repo": "open-mercato/skills", "ref": "main" }]
|
|
1109
|
-
// Team-skill repos are code-trusted: a skill body becomes an agent system prompt.
|
|
1110
|
-
// Only owner/name, https/ssh URLs, or local paths (`/abs`, `./rel`, `~/dir`,
|
|
1111
|
-
// `C:\dir`) are accepted — no ext::/fd:: transport helpers. Write a relative
|
|
1112
|
-
// path as `./name`, not a bare `name`. Pin `ref` to a full commit SHA to freeze
|
|
1113
|
-
// the source against a moving branch head — Squawk verifies it resolves to
|
|
1114
|
-
// exactly that commit, and reports it as `team.commit`. `"enabled": false` keeps
|
|
1115
|
-
// a source listed but loads none of its skills. The Skills page edits this list,
|
|
1116
|
-
// keeps every other key, and refuses to write a file it cannot read.
|
|
1117
|
-
"worktreeRetention": 10, // keep the last N finished worktrees on disk; 0 = unlimited (no reclaim, no branch sweep)
|
|
1118
|
-
"defaultRunner": "claude", // agent backend: "claude" (default) · "codex" · "opencode" · "cursor" · "pi" · "omp"
|
|
1119
|
-
"modelsLocked": true, // optional: native per-runner model is fixed/read-only; runner stays selectable
|
|
1120
|
-
"plannerModel": "sonnet", // model the "Plan first" button uses to draft chains
|
|
1121
|
-
"baseBranch": "develop", // branch worktrees fork from + PRs target (also settable in the Git view)
|
|
1122
|
-
"worktreeSetup": { "commands": ["npm ci"] }, // prepare each new worktree before the agent starts (below)
|
|
1123
|
-
"worktreeTeardown": { "commands": ["docker compose down"] } // stop a worker worktree's own services before destroy (below)
|
|
1124
|
-
}
|
|
1125
|
-
```
|
|
1126
|
-
|
|
1127
|
-
Put the same `"modelsLocked": true` key in `<config>/config.json` to apply it
|
|
1128
|
-
to every registered project. When the key is absent or `false` in both config
|
|
1129
|
-
files (and `HSQ_AGENT_MODELS_LOCKED` (`CEZ_AGENT_MODELS_LOCKED` fallback) is not `1`), each runner's normal model
|
|
1130
|
-
selector uses that runner's discovered model list. While locked, the model is
|
|
1131
|
-
shown read-only and follows the selected runner's native settings; the runner
|
|
1132
|
-
itself remains selectable.
|
|
1133
|
-
|
|
1134
|
-
Run data (`runs.db` and its `-wal`/`-shm` files, the `runs.json.pre-sqlite*.bak`
|
|
1135
|
-
backups, NDJSON event logs, worktrees, `todos.json`) is git-ignored
|
|
1136
|
-
automatically; your workflows and skills stay committable. See [run history recovery](https://github.com/hearsay-tools/cezarion/blob/main/docs/run-history-recovery.md) for backup and repair steps.
|
|
1137
|
-
|
|
1138
|
-
Settings that belong to *you* rather than to a repo — the parallel cap
|
|
1139
|
-
(`maxParallel`, default **2**), the per-task memory ceiling and the checkout
|
|
1140
|
-
root — live once in `<config>/config.json`, alongside the
|
|
1141
|
-
[project registry](docs/areas/workspace-registry.md#multiple-projects-one-cockpit), and are edited from
|
|
1142
|
-
**Settings → Resources** and **Settings → Projects**. A `maxParallel` left over
|
|
1143
|
-
in a repo's `.ai/cezar/config.json` is imported into the workspace file the
|
|
1144
|
-
first time Squawk boots there, and ignored afterwards.
|
|
1145
|
-
|
|
1146
|
-
### Session-start context
|
|
1147
|
-
|
|
1148
|
-
Every session Squawk launches — a fresh step, a retry, **Continue**, recovery, an owned
|
|
1149
|
-
worker — opens with the run's whole handoff file, so the agent has its notes without a tool
|
|
1150
|
-
call. Add your own context, such as a vision document, with an optional
|
|
1151
|
-
`.ai/cezar/context.yaml`:
|
|
1152
|
-
|
|
1153
|
-
```yaml
|
|
1154
|
-
version: 1
|
|
1155
|
-
rules:
|
|
1156
|
-
- id: project-vision
|
|
1157
|
-
on: session_start
|
|
1158
|
-
target: both # parent · worker · both
|
|
1159
|
-
template: |
|
|
1160
|
-
Project vision:
|
|
1161
|
-
{{file:docs/vision.md}}
|
|
1162
|
-
```
|
|
1163
|
-
|
|
1164
|
-
The whole prefix is capped at 64 KiB, blocks that do not fit are skipped whole, and each launch
|
|
1165
|
-
logs which blocks it applied or skipped. See [docs/context-injection.md](docs/context-injection.md)
|
|
1166
|
-
for the variables, the limits and the error handling.
|
|
1167
|
-
|
|
1168
|
-
### Preparing new worktrees
|
|
1169
|
-
|
|
1170
|
-
Every task and worker runs in a fresh worktree, and a fresh worktree has nothing installed. Give
|
|
1171
|
-
the project a `worktreeSetup` and Squawk runs those commands in each new worktree before the
|
|
1172
|
-
agent's first turn, so the agent (and anything that runs beside it, such as a test watcher)
|
|
1173
|
-
starts in a ready tree:
|
|
1174
|
-
|
|
1175
|
-
```jsonc
|
|
1176
|
-
// .ai/squawk/config.json (.ai/cezar/config.json before the project moves)
|
|
1177
|
-
"worktreeSetup": {
|
|
1178
|
-
"commands": ["npm ci", "cp \"$HSQ_PROJECT_ROOT/.env\" .env"],
|
|
1179
|
-
"timeoutSeconds": 900 // optional, per command; default 900, max 7200
|
|
1180
|
-
}
|
|
1181
|
-
```
|
|
1182
|
-
|
|
1183
|
-
Or edit it in **Settings → Worktrees → Prepare new worktrees**, one command per line. These are
|
|
1184
|
-
commands the host runs, so a hosted cockpit (`HSQ_REMOTE=1` or `CEZ_REMOTE=1`) shows it read-only until the host
|
|
1185
|
-
operator runs `hsq remote-settings enable` ([Remote settings administration](docs/server-install/remote-settings.md)).
|
|
1186
|
-
|
|
1187
|
-
- **When it runs.** In every new task worktree and every worker worktree, and again when Continue
|
|
1188
|
-
rebuilds a worktree that retention reclaimed. Never for a task that runs in the repo working
|
|
1189
|
-
tree (worktree off), and never for a non-git directory.
|
|
1190
|
-
- **How it runs.** Each command runs as `bash -lc '<command>'` in the worktree root, in order,
|
|
1191
|
-
and the setup stops at the first command that fails or times out. Up to 20 commands.
|
|
1192
|
-
- **What it can see.** The same curated environment the live preview gives a dev server: your
|
|
1193
|
-
`PATH`, `HOME` and the shell basics, but no agent API keys and no GitHub token. A private
|
|
1194
|
-
registry token reaches it through `HSQ_ENV_PASSTHROUGH=NPM_TOKEN` (`CEZ_ENV_PASSTHROUGH` fallback) (or the tool's own config
|
|
1195
|
-
file under `HOME`). It also gets `HSQ_PROJECT_ROOT` (`CEZ_PROJECT_ROOT` fallback) (the main checkout, for copying untracked
|
|
1196
|
-
files like `.env`) and `HSQ_TASK_ID` (`CEZ_TASK_ID` fallback).
|
|
1197
|
-
- **What you see.** The task thread shows a "Ran `<command>`" card per command with its output
|
|
1198
|
-
(the last 20 KB) and a line with the outcome and duration.
|
|
1199
|
-
- **What the agent sees.** Its first message says what ran, so it doesn't repeat the install.
|
|
1200
|
-
If a command fails or times out, the agent still starts and its first message names the
|
|
1201
|
-
command, the exit code and the end of the output, so it can fix the cause or work around it.
|
|
1202
|
-
- **Keep generated files gitignored.** Autosave commits whatever Git doesn't ignore, so anything
|
|
1203
|
-
setup creates outside `.gitignore` becomes part of the task's changes. `node_modules/` and
|
|
1204
|
-
`.venv/` are usually ignored already.
|
|
1205
|
-
|
|
1206
|
-
Without the key nothing runs, exactly as before. Examples:
|
|
1207
|
-
|
|
1208
|
-
| Project | `commands` |
|
|
1209
|
-
| --- | --- |
|
|
1210
|
-
| npm | `["npm ci"]` |
|
|
1211
|
-
| pnpm | `["pnpm install --frozen-lockfile"]` |
|
|
1212
|
-
| Python (uv) | `["uv sync --frozen"]` |
|
|
1213
|
-
| Go | `["go mod download"]` |
|
|
1214
|
-
| Rust | `["cargo fetch"]` |
|
|
1215
|
-
| Copy local env | `["cp \"$CEZ_PROJECT_ROOT/.env\" .env"]` |
|
|
1216
|
-
|
|
1217
|
-
### Stopping a worker worktree's services before destroy
|
|
1218
|
-
|
|
1219
|
-
A worker's worktree can start things that keep running after the worker settles: a test
|
|
1220
|
-
server, a file watcher, a container. Worker destroy refuses while a process still works in
|
|
1221
|
-
the worktree, and names each one by its pid and executable name, never its arguments. Give the project a
|
|
1222
|
-
`worktreeTeardown` and destroy runs those commands in the worker's worktree first:
|
|
1223
|
-
|
|
1224
|
-
```jsonc
|
|
1225
|
-
// .ai/squawk/config.json (.ai/cezar/config.json before the project moves)
|
|
1226
|
-
"worktreeTeardown": {
|
|
1227
|
-
"commands": ["command -v my-watcher >/dev/null 2>&1 && my-watcher stop . || true"],
|
|
1228
|
-
"timeoutSeconds": 120 // optional, per command; default 900, max 7200
|
|
1229
|
-
}
|
|
1230
|
-
```
|
|
1231
|
-
|
|
1232
|
-
The key has the shape, the limits and the environment of `worktreeSetup`. The commands run
|
|
1233
|
-
only in a worktree whose ownership destroy has proven, before it looks for holders. A failed
|
|
1234
|
-
command or a timeout is recorded in the worker's events, and destroy goes on: a process that
|
|
1235
|
-
still holds the worktree is named in the refusal and never signalled, and the next retry runs
|
|
1236
|
-
the teardown again. The key is edited in the config file only; Settings does not show it.
|
|
1237
|
-
Without the key nothing runs, exactly as before.
|
|
1238
|
-
|
|
1239
|
-
### Editing the agents' own config (Settings → Agent config)
|
|
1240
|
-
|
|
1241
|
-
Squawk picks *which* agent runs; **Settings → Agent config** lets you edit *how* it
|
|
1242
|
-
behaves — the raw config files Claude, Codex, OpenCode, Cursor, pi and OMP read
|
|
1243
|
-
for settings, MCP, and memory. In the multi-project cockpit the section is project-scoped:
|
|
1244
|
-
repo-relative files resolve from the selected project's root, while user-scope
|
|
1245
|
-
files continue to resolve from the agent's home.
|
|
1246
|
-
|
|
1247
|
-
Each file keeps its native format and vendor-documented precedence. Tracked
|
|
1248
|
-
files reach task worktrees after commit; Claude's gitignored personal layer is
|
|
1249
|
-
seeded into each run's worktree. Config files can define hooks and MCP commands that run
|
|
1250
|
-
on the host, so a hosted cockpit (`HSQ_REMOTE=1` or `CEZ_REMOTE=1`) is read-only and never serves home-file
|
|
1251
|
-
contents until the host operator runs `hsq remote-settings enable`
|
|
1252
|
-
([Remote settings administration](docs/server-install/remote-settings.md)).
|
|
1253
|
-
|
|
1254
|
-
---
|
|
458
|
+
See [Configuration (optional)](docs/configuration.md).
|
|
1255
459
|
|
|
1256
460
|
## Local development
|
|
1257
461
|
|
|
1258
|
-
|
|
1259
|
-
repo on your machine — no npm publish required.
|
|
1260
|
-
|
|
1261
|
-
**1. Prerequisites** — Node 24.21.0+ and `git` (plus at least one logged-in agent CLI,
|
|
1262
|
-
as in [Quick start](#quick-start)).
|
|
1263
|
-
|
|
1264
|
-
**2. Clone & install**
|
|
1265
|
-
|
|
1266
|
-
The npm global prefix must be writable by your user. On Unix, use Node installed
|
|
1267
|
-
with nvm, or set a user-owned prefix (`npm config set prefix ~/.npm-global`) and
|
|
1268
|
-
add `~/.npm-global/bin` to your `PATH`. On Windows, use a user-owned npm prefix
|
|
1269
|
-
and add the prefix itself (reported by `npm prefix -g`) to `PATH`; npm puts
|
|
1270
|
-
Windows executables directly there. Set `PATH` before these commands.
|
|
1271
|
-
|
|
1272
|
-
```bash
|
|
1273
|
-
git clone https://github.com/hearsay-tools/cezarion.git
|
|
1274
|
-
cd cezarion
|
|
1275
|
-
npm install --global pnpm@12.11.2
|
|
1276
|
-
pnpm install --frozen-lockfile
|
|
1277
|
-
```
|
|
1278
|
-
|
|
1279
|
-
Dependency installation uses pnpm 12.11.2 (pinned in `packageManager`) and
|
|
1280
|
-
`pnpm-lock.yaml`. Use pnpm for dependency changes; keep npm for the existing
|
|
1281
|
-
build/test scripts. Workspace dependencies are linked locally and esbuild's
|
|
1282
|
-
install hook is approved in `pnpm-workspace.yaml`. The store uses hardlinks when
|
|
1283
|
-
the checkout and store share a filesystem. Publishing and end-user installation
|
|
1284
|
-
continue to use npm. For this repository's Worktrees setup, use
|
|
1285
|
-
`pnpm install --frozen-lockfile` after the checked-out base branch contains the migration.
|
|
1286
|
-
|
|
1287
|
-
**3. Build** — compiles the api-client and the server (`tsc → packages/cezar/dist/`) and the cockpit
|
|
1288
|
-
(`vite build → packages/cezar/web/dist/`), then runs the pack gate:
|
|
1289
|
-
|
|
1290
|
-
```bash
|
|
1291
|
-
npm run build
|
|
1292
|
-
```
|
|
1293
|
-
|
|
1294
|
-
**4. Install as a global command** — build + put `hsq` on
|
|
1295
|
-
your PATH pointing at *this checkout*:
|
|
1296
|
-
|
|
1297
|
-
```bash
|
|
1298
|
-
npm run install-as-command # live link (default) — see the change loop below
|
|
1299
|
-
# or: npm run install-as-command:global # self-contained snapshot copy
|
|
1300
|
-
|
|
1301
|
-
```
|
|
1302
|
-
|
|
1303
|
-
Now `cd` into any other repo and run it:
|
|
1304
|
-
|
|
1305
|
-
```bash
|
|
1306
|
-
cd ~/some-other-project
|
|
1307
|
-
hsq # cockpit for that repo, straight off your checkout
|
|
1308
|
-
hsq --help # the same command as `npx -p @hearsay-tools/squawk hsq`
|
|
1309
|
-
```
|
|
1310
|
-
|
|
1311
|
-
**5. The change loop**
|
|
1312
|
-
|
|
1313
|
-
- **Link mode** (default): edit source → `npm run build` → the global command
|
|
1314
|
-
reflects it immediately. No relink needed. (It is a live symlink into this
|
|
1315
|
-
checkout — don't move or delete the checkout while it's linked.)
|
|
1316
|
-
- **Snapshot mode** (`:global`): re-run `npm run install-as-command:global` to
|
|
1317
|
-
refresh the installed copy. It survives moving/deleting the checkout.
|
|
1318
|
-
|
|
1319
|
-
**6. Uninstall**
|
|
1320
|
-
|
|
1321
|
-
```bash
|
|
1322
|
-
npm run uninstall-as-command # removes hsq and the compatibility commands (either flavor)
|
|
1323
|
-
```
|
|
1324
|
-
|
|
1325
|
-
**7. Troubleshooting**
|
|
1326
|
-
|
|
1327
|
-
- **`hsq: command not found`** after install → your npm global bin dir isn't on
|
|
1328
|
-
PATH. The script prints the exact dir; add it to your shell profile
|
|
1329
|
-
(Unix: `export PATH="$(npm prefix -g)/bin:$PATH"`; Windows: add the directory
|
|
1330
|
-
reported by `npm prefix -g` itself to `PATH`, without a `bin` suffix).
|
|
1331
|
-
- **`EACCES` / permission denied** → your global prefix is root-owned. Point npm
|
|
1332
|
-
at a user-writable one and retry — **never** sudo:
|
|
1333
|
-
`npm config set prefix ~/.npm-global`.
|
|
1334
|
-
- **Already installed the published `@wjarka/cezarion` globally?** The
|
|
1335
|
-
link/snapshot install replaces it; `uninstall-as-command` removes ours, and
|
|
1336
|
-
`npm i -g @hearsay-tools/squawk` brings the published one back.
|
|
1337
|
-
|
|
1338
|
-
### In-checkout scripts
|
|
1339
|
-
|
|
1340
|
-
```bash
|
|
1341
|
-
npm run dev # server (API :4321) + Vite dev server, opens the cockpit in the browser
|
|
1342
|
-
npm run dev:server # tsx packages/cezar/src/index.ts — the API server alone
|
|
1343
|
-
npm run dev:web # Vite dev server alone (proxies /api to :4321)
|
|
1344
|
-
npm run build # tsc → packages/cezar/dist/, vite build → packages/cezar/web/dist/, then the pack gate
|
|
1345
|
-
npm run typecheck # check all four workspaces without building
|
|
1346
|
-
npm run typecheck:web # check web sources without building
|
|
1347
|
-
npm test # vitest — server + cockpit unit suites
|
|
1348
|
-
npm run test:changed # iteration only: tests related to branch + working-tree changes
|
|
1349
|
-
pnpm metrics <file> # function complexity; add --test <test-file> for coverage and CRAP
|
|
1350
|
-
npm run test:unit # node:test — fast core-module tests
|
|
1351
|
-
npm run test:package # pack/install and exercise the built CLI
|
|
1352
|
-
npm run test:e2e # real-browser cockpit suite (agent-browser)
|
|
1353
|
-
npm run test:e2e:local # full browser suite in four isolated, concurrent lanes
|
|
1354
|
-
```
|
|
1355
|
-
|
|
1356
|
-
The four-lane local browser run needs roughly 8 GiB of RAM at peak. It keeps CI's
|
|
1357
|
-
serial-per-shard policy unchanged. See [cockpit E2E testing](packages/web/e2e/README.md#full-local-suite-in-four-lanes)
|
|
1358
|
-
for lane isolation, logs, and cleanup.
|
|
1359
|
-
|
|
1360
|
-
Calculate metrics for one JavaScript or TypeScript file, or select a function:
|
|
1361
|
-
|
|
1362
|
-
```bash
|
|
1363
|
-
pnpm metrics packages/contract/src/attention.ts
|
|
1364
|
-
pnpm metrics packages/contract/src/attention.ts --function deriveAttention
|
|
1365
|
-
pnpm --silent metrics packages/contract/src/attention.ts --line 150 --json
|
|
1366
|
-
pnpm metrics packages/contract/src/attention.ts --function deriveAttention --test packages/contract/src/attention.test.ts
|
|
1367
|
-
pnpm metrics packages/contract/src/attention.ts --coverage coverage/coverage-final.json
|
|
1368
|
-
```
|
|
1369
|
-
|
|
1370
|
-
Complexity follows ESLint's classic convention, including short-circuit operators,
|
|
1371
|
-
optional chaining, default parameters and each non-default switch case. Functions,
|
|
1372
|
-
methods and arrow functions have separate scores. Module and class initialization
|
|
1373
|
-
are excluded. Use `Class.method` or `--line` when a name is ambiguous.
|
|
1374
|
-
|
|
1375
|
-
CRAP is `C² × (1 − coverage)³ + C`, using executable line coverage within each
|
|
1376
|
-
function body. This is the line-coverage variant; the original proposal used
|
|
1377
|
-
basis-path coverage. An empty function uses its call counter. Missing coverage
|
|
1378
|
-
shows `unavailable`, or `null` for CRAP in JSON. It never assumes zero coverage.
|
|
1379
|
-
The command discovers `coverage/coverage-final.json` from the source directory
|
|
1380
|
-
up to the checkout root, then the current directory. An explicit `--coverage`
|
|
1381
|
-
selects an Istanbul JSON report. Reports older than the source leave CRAP unavailable;
|
|
1382
|
-
reports must describe the current source, so regenerate them after source changes.
|
|
1383
|
-
|
|
1384
|
-
Repeat `--test` to collect coverage from several Vitest test files. This runs only
|
|
1385
|
-
the supplied tests in the unit projects, with two workers and a ten-minute limit.
|
|
1386
|
-
Coverage files are temporary and are removed after the calculation. A failed test
|
|
1387
|
-
run exits nonzero and produces no scores. Without `--test`, no tests run. Test logs
|
|
1388
|
-
go to stderr, so `--json` stdout contains only the report. This tool belongs to the
|
|
1389
|
-
checkout and is available after the normal dependency installation. Use
|
|
1390
|
-
`pnpm --silent metrics ... --json` to also suppress pnpm's command banner.
|
|
1391
|
-
|
|
1392
|
-
The tool is bundled in the [check-code-quality skill](.ai/skills/check-code-quality/SKILL.md).
|
|
1393
|
-
Ask an agent to measure a file, function or module for a scoped stats report.
|
|
1394
|
-
That path uses available coverage and reports missing CRAP without starting the
|
|
1395
|
-
PR process. Ask explicitly for fresh coverage when needed.
|
|
1396
|
-
|
|
1397
|
-
The local pre-PR gate uses Squeal 0.1.423's one-shot changed-function check:
|
|
1398
|
-
|
|
1399
|
-
```bash
|
|
1400
|
-
quality_report=$(mktemp "${TMPDIR:-/tmp}/code-quality.XXXXXXXX") || exit 2
|
|
1401
|
-
squeal code --base origin/main --json > "$quality_report"
|
|
1402
|
-
quality_status=$?
|
|
1403
|
-
printf 'Report: %s; exit: %s\n' "$quality_report" "$quality_status"
|
|
1404
|
-
```
|
|
1405
|
-
|
|
1406
|
-
It checks changed JS/TS functions, including test callbacks and nested functions,
|
|
1407
|
-
with complexity at most 20 and CRAP at most 30. Equality passes. The default
|
|
1408
|
-
budget is 600 seconds. The base commit supplies the policy.
|
|
1409
|
-
|
|
1410
|
-
A pass requires complete evidence: no skipped, incomplete or uncounted functions,
|
|
1411
|
-
failed or unfinished tests, or exhausted budget. Exit 0 alone is insufficient
|
|
1412
|
-
because a report can contain skipped functions. Exits 1, 3 and 2 mean violations,
|
|
1413
|
-
incomplete measurement and usage/setup errors. Missing Squeal or unsupported
|
|
1414
|
-
evidence blocks the PR. There is no bundled fallback or inherited-refactor
|
|
1415
|
-
deferral. See the [pre-PR procedure](.ai/skills/check-code-quality/references/pre-pr.md)
|
|
1416
|
-
for report identity, completeness checks and reviewable evidence.
|
|
1417
|
-
|
|
1418
|
-
CI and explicit statistics commands keep their existing paths during this
|
|
1419
|
-
local-first rollout. CI artifact reuse and supported exceptions await the
|
|
1420
|
-
remaining work in hearsay-tools/squeal#167.
|
|
1421
|
-
|
|
1422
|
-
For iteration, run affected test files or `npm run test:changed` (inspect with
|
|
1423
|
-
`-- --plan`; override the local main comparison with `-- --base=<ref>`).
|
|
1424
|
-
The changed-test command includes staged, unstaged and untracked changes and
|
|
1425
|
-
falls back to full Vitest on shared/configuration/unknown input or missing Git
|
|
1426
|
-
history. It is not a substitute for final verification. See [AGENTS.md § Validation](AGENTS.md#validation)
|
|
1427
|
-
for targeted browser commands and the [CI guide](docs/sdlc/ci.md) for the final-gate/evidence-reuse policy.
|
|
1428
|
-
|
|
1429
|
-
`npm run typecheck` checks all four workspaces from source without writing build
|
|
1430
|
-
output. `npm run typecheck:web` checks the cockpit and reads the server route types
|
|
1431
|
-
from this checkout. Run `pnpm install --frozen-lockfile` in each new worktree first.
|
|
1432
|
-
Packaged CLI tests import built modules; CI checks them with
|
|
1433
|
-
`npm run typecheck:package` after `npm run build`.
|
|
1434
|
-
|
|
1435
|
-
CI runs eight duration-balanced Vitest shards alongside the build and package checks.
|
|
1436
|
-
See [CI verification](docs/sdlc/ci.md) for the job graph and local commands.
|
|
1437
|
-
|
|
1438
|
-
The stack is deliberately small: **TypeScript** (strict, ESM), **Hono** + SSE for
|
|
1439
|
-
the server, **Zod** at every boundary, **YAML** for workflows, and a **React 19 +
|
|
1440
|
-
Vite + Tailwind v4 + shadcn/ui** cockpit shipped pre-built in `packages/cezar/web/dist/` — the
|
|
1441
|
-
published package carries the built app, so `npx` users never run a bundler.
|
|
1442
|
-
Every module is meant to be read in one sitting.
|
|
1443
|
-
|
|
1444
|
-
---
|
|
462
|
+
See [Local development](docs/development.md).
|
|
1445
463
|
|
|
1446
464
|
## License
|
|
1447
465
|
|