How Squeal Works
Coding agents traditionally validate synchronously: edit a file, decide what test command to run, block while it finishes, read the output, and resume. Run tests too often and half the session is wasted waiting; run them rarely and bugs from edit #2 compound through edit #10.
Squeal turns validation into an ambient sensor attached to the agent’s workspace.
Push transitions. Pull state.
Section titled “Push transitions. Pull state.”Every part of Squeal follows one interaction model:
- Push transitions: Only meaningful state changes enter the agent’s context, delivered at existing harness boundaries (tool results, model turns, Stop hooks) — never mid-generation.
- Pull state: Whenever an agent or human needs full context or a completion verdict,
squeal statusreturns an exact, honest snapshot.
What triggers a notification
Section titled “What triggers a notification”| Transition | Delivered? | Notes |
|---|---|---|
PASS -> FAIL |
Yes | Includes check name, revision, first error line, location, and changed imports. |
FAIL -> PASS |
Yes | Closes the loop without manual re-runs. |
FAIL -> FAIL (same error) |
No | Stays silent unless the failure itself changed. |
PASS -> PASS |
No | Green runs are recorded silently. |
| First observation of a failure | Yes | Reported once on session registration or new test file. |
| First observation of a pass | No | Recorded without interrupting the agent. |
| Validation running late | Once | Squeal announces once if results take more than twice the usual wait, and announces once when caught up. |
Related transitions from a single change (such as a broken import failing 40 tests) are grouped into one concise update.
Revision-aware provenance
Section titled “Revision-aware provenance”Every saved change in a worktree advances a monotonic revision number (separate from Git commits). Every test run and every event carries the exact revision it validated.
At any moment Squeal distinguishes five states for every test file:
- current: produced from the exact bytes currently on disk (either run in this worktree or inherited from a byte-identical run).
- pending: a run for the current files is queued or actively running.
- stale: a result exists for older file contents and nothing is queued for it yet.
- unknown: no trusted result (never run, runner crashed/timed out, or a file was rewritten while the test was in flight).
- not covered: explicitly excluded (
vitest.exclude,vitest.excludeProjects, or outside configured runners).
Content-keyed shared store & runtime observation
Section titled “Content-keyed shared store & runtime observation”Squeal computes a content key for each test file from:
- its static import graph;
- its observed runtime inputs (
observe.runtimeInputs: trueby default) — files the test or any child Node process / Worker reads, stats, lists, loads, or executes at run time; - explicitly declared
inputsinsqueal.config.json; - relevant environment inputs (Node version, platform, runner config, allowlisted env vars).
Results are stored in the repository’s shared store under <git-common-dir>/squeal/. When another linked worktree — or CI via Results from CI — has already produced a result at the exact same content key, Squeal inherits it immediately without re-running the test.
Flake re-runs
Section titled “Flake re-runs”When an eligible fast test fails anew under unchanged tracked inputs, Squeal automatically re-runs it once on its own (up to eight newly failing test files per tier, excluding forced runs, slow files, and already-retried keys). If the re-run passes, Squeal delivers a PASS with Flaky: FAIL -> PASS under the same tracked inputs so the agent does not waste turns manually re-running it to check for flakiness.
Policy-driven boundaries
Section titled “Policy-driven boundaries”Squeal runs local validation automatically because the blast radius is small and reversible. Repository policy in squeal.config.json governs how strongly Squeal intervenes:
interrupt.onRegression(trueby default): denies one subsequent file edit after a regression so the agent addresses the broken check before building on top of it.checks&slow: schedules heavy suites at pause, Stop, commit, or manual moments instead of blocking edit-time feedback.stop.*: configures whether Stop waits for slow/stop check groups or blocks on known failures / missing full-suite checkpoints.