Engine: check stages, harness-agnostic delivery, read-only enforcement, complete captures

- New `type=check` stage: the server runs a `commands` block (sh -c, per
  command_timeout, workspace env) and routes on pass/fail; per-command status,
  exit code, duration and bounded output are recorded and the failing output is
  the handoff. With delivery=true it is the landing gate (commit leftovers,
  merge moved main, checks in a fresh candidate worktree, fast-forward main).
  Parser/registry, lint (silent guards), format docs, CLI inspect, app graph and
  run detail rendering.
- delivery=true is accepted on every harness (and on check stages).
- permissions.shell on claude stages maps to Bash(cmd) / Bash(prefix:*) rules
  instead of a bare Bash allow; stages without edit that change the workspace
  fail the visit with the changed files listed (allow_workspace_changes=true
  opts out; artifacts, public and harness state dirs are ignored).
- File-change capture: symlinks compared by target, untouched protected files no
  longer make captures partial, untracked caches/dependency/build output left
  out, lockfiles listed without patch, huge files compared by metadata, raised
  patch/line limits. Outcome repair follow-ups are logged and counted on the
  step (control.outcome_repairs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 12:52:16 +00:00
parent c4de1de27b
commit 87016ef5dc
47 changed files with 2674 additions and 129 deletions
+27 -12
View File
@@ -30,15 +30,26 @@ includes the same evidence under each step's `file_changes` field.
conversion, `assume-unchanged`) is listed with `no_patch_reason: "baseline"`.
- Added/deleted files and permission changes are recorded. Renames appear as
deletion/addition. Binary changes retain metadata, not binary contents.
- Symlinks, special files, common credential/environment/key/database paths,
`secrets/`, Git internals and `node_modules/` are excluded. This is a path-based
- Common credential/environment/key/database paths and `secrets/` are protected:
never opened or listed. They are fingerprinted by metadata (size, mtime, mode)
only, so an untouched `.env` no longer makes a capture partial; a change to one
makes the visit `partial` (counted in `skipped`). This is a path-based
precaution, **not secret-content scanning**; ordinary source patches may contain
sensitive text and become part of retained history.
- Limits: 10,000 inventoried entries, 1 MiB per file and 32 MiB per snapshot of
retained text, 256 MiB per hashed file, five seconds per snapshot, 5,000
combined lines per textual comparison, 64 KiB per patch and 128 KiB serialized
file evidence per visit. Oversized, unreadable, omitted or truncated evidence
is explicitly flagged partial.
- Tool output is not stage work: untracked files below cache and dependency
directories (`node_modules/`, `.git/`, `__pycache__/`, `.venv/`, `.mypy_cache/`,
`.pytest_cache/`, `.ruff_cache/`, `.next/`, `.dart_tool/`, `.gradle/`, ...),
untracked `*.pyc`, and untracked files below `build/`, `dist/`, `out/`,
`target/` or `coverage/` where Git tracks nothing are left out of the
inventory entirely. Outside Git the cache directories are not walked.
- Symlinks are compared by their target (never followed) and listed with
`no_patch_reason: "symlink"`; a path through a symlinked directory is skipped.
- Limits: 20,000 inventoried entries, 1 MiB per file and 32 MiB per snapshot of
retained text, five seconds per snapshot, 20,000 combined lines per textual
comparison, 128 KiB per patch and 512 KiB serialized file evidence per visit.
Files over 256 MiB are compared by size, mtime and mode
(`no_patch_reason: "large"`). Unreadable, omitted or truncated evidence is
explicitly flagged partial.
- Over-budget content degrades to a listing, not silence: a text file over 1 MiB,
or beyond the 32 MiB snapshot budget, is still compared by SHA-256 and a change
is listed with `no_patch: true` (and `truncated`) but no patch. In a Git working
@@ -46,12 +57,16 @@ includes the same evidence under each step's `file_changes` field.
or past the time/file limit) is listed the same way when its
`git status --porcelain` entry changed during the visit; a path dirty with the
same status before and after cannot be proven changed and stays in `skipped`.
Git is only read (`--no-optional-locks`); protected paths are never listed.
Git is only read (`--no-optional-locks`); protected and excluded paths are
never listed.
- Each content change without a (complete) patch carries `no_patch_reason`:
`binary`, `file_size` (text over 1 MiB), `budget` (32 MiB snapshot text
budget), `lines` (over 5,000 combined lines), `evidence_size` (per-visit
retained evidence limit), `git_status` (seen only in Git status) or `baseline`.
Binary changes stay `complete`; the others make the visit `partial`.
`binary`, `symlink`, `large`, `generated` (lockfiles such as `go.sum` or
`package-lock.json`, `*.min.js`, source maps, files below a cache directory),
`file_size` (text over 1 MiB), `budget` (32 MiB snapshot text budget), `lines`
(over 20,000 combined lines), `evidence_size` (per-visit retained evidence
limit), `git_status` (seen only in Git status) or `baseline`. `binary`,
`symlink`, `large` and `generated` changes are listed completely and stay
`complete`; the others make the visit `partial`.
- `pipelines inspect RUN_ID --json` carries a top-level `warnings` list (also
printed to stderr) naming every visit whose capture was partial or unavailable.
- Failed/canceled stages still retain changes when execution returns. Unconfirmed