tamperward 2.20.6 → 2.22.0
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 +24 -1
- package/dist/cli/index.js +4790 -2975
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -259,6 +259,7 @@ platforms.
|
|
|
259
259
|
| `check` / policy evaluation | Supported | Supported | Supported |
|
|
260
260
|
| Claude hook / Stop adapter | Supported where Claude Code command hooks are available | Same | Same |
|
|
261
261
|
| `watch` / observer telemetry | Supported; backend health is reported | Supported/degraded according to `fs.watch` health | Supported/degraded according to `fs.watch` health |
|
|
262
|
+
| opt-in `hook-service` | Supported (per-user `0600` unix socket) | Supported (per-user `0600` unix socket) | **Unsupported; `start` refuses, hooks run in-process** |
|
|
262
263
|
| checkpointed-local `verify` | Supported via `/bin/sh` | Supported via `/bin/sh` | **Unsupported; fails before candidate execution** |
|
|
263
264
|
| isolated-container `verify` | Supported when Docker authority preflight passes | Not claimed beyond Docker preflight | Not claimed beyond Docker preflight |
|
|
264
265
|
| advisory `trace-verify` | **Supported with `strace` + `tar`** | **Unsupported; reports no parity** | **Unsupported; reports no parity** |
|
|
@@ -368,13 +369,29 @@ Full assumptions and residual risks: [SPEC.md](./SPEC.md),
|
|
|
368
369
|
## Quick start
|
|
369
370
|
|
|
370
371
|
```bash
|
|
371
|
-
npx tamperward
|
|
372
|
+
npx tamperward onboard
|
|
372
373
|
```
|
|
373
374
|
|
|
374
375
|
Requires Node.js 20.19 or later. JavaScript and TypeScript are the fully
|
|
375
376
|
supported detector surface; the other documented ecosystems get file-level and
|
|
376
377
|
pattern-based protection.
|
|
377
378
|
|
|
379
|
+
`onboard` (2.21.0) is the guided first run: it previews the installation with the
|
|
380
|
+
same planner as `init --dry-run`, explains each enforcement point, asks before writing
|
|
381
|
+
anything, runs the canonical `init`, offers the detected suite command for your
|
|
382
|
+
explicit acceptance (it is never written without one), runs and explains the first
|
|
383
|
+
`verify`, offers a safe demonstration of a weakening move on a disposable worktree that
|
|
384
|
+
leaves your tree byte-for-byte as it was, checks the GitHub controls with
|
|
385
|
+
`doctor --github` (or prints them), and ends with a `READY` / `READY WITH WARNINGS` /
|
|
386
|
+
`BROKEN` / `INCOMPLETE` posture taken from `doctor`. Non-interactive stdin refuses
|
|
387
|
+
rather than hangs; `--yes --verify-command "<cmd>"` is the scripted form.
|
|
388
|
+
|
|
389
|
+
The deterministic primitive underneath is unchanged:
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
npx tamperward init
|
|
393
|
+
```
|
|
394
|
+
|
|
378
395
|
One idempotent command wires the policy, the agent hooks, the pre-commit hook, a
|
|
379
396
|
CI workflow that runs both the diff-time check and pristine verification, and a
|
|
380
397
|
`CODEOWNERS` requirement on the paths that decide whether the gate runs at all.
|
|
@@ -566,7 +583,9 @@ option can never be reinterpreted as the agent command.
|
|
|
566
583
|
| `run` | `--base <rev>` · `--cmd <suite command>` · `--budget <seconds>` (per verifier suite) · `--agent-budget <seconds>` (optional wrapped-agent wall clock) · `--json` (one versioned final envelope document) · `--observe-transients` (start a session-scoped transient observer) · `--allow-dirty` · `--settle <seconds>` (wait before the final quiescence check) · `--allow-dep-drift` · `--cwd <dir>` · then `-- <agent command...>` |
|
|
567
584
|
| `allow` | `<rule>` · `--file <path>` · `--reason "<why>"` (required) · `--cwd <dir>` |
|
|
568
585
|
| `init` | `--cwd <dir>` · `--dry-run` · `--force-workflow` |
|
|
586
|
+
| `onboard` | `--cwd <dir>` · `--base <rev>` · `--repo <owner/repo>` · `--branch <name>` · `--skip-demo` / `--demo` (mutually exclusive) · `--no-github` · `--yes` (scripted: no prompts; the demo runs only with `--demo`) · `--verify-command "<suite command>"` (the only way a scripted run configures `verify.command`) |
|
|
569
587
|
| `watch` | `--dir <dir>` · `--log <file>` — a daemon; it runs until signalled |
|
|
588
|
+
| `hook-service` | `start [--dir <repo>]` (foreground; runs until signalled) · `stop` · `status` — the opt-in persistent hook service (2.22.0): one warm process per user, bound to one repository that evaluates `hook`/`sweep` payloads over a private `0600` unix socket. Hooks consult it only under `TAMPERWARD_HOOK_SERVICE=1`. Before handoff, unavailable/refusing service paths fall back to the same in-process verdict; after handoff, ambiguous transport failure fails closed rather than starting a concurrent second evaluation. Not available on Windows |
|
|
570
589
|
| `hook claude` / `sweep claude` | none — the Claude Code payload arrives on stdin |
|
|
571
590
|
|
|
572
591
|
**Exit codes** — part of the public surface:
|
|
@@ -579,8 +598,10 @@ option can never be reinterpreted as the agent command.
|
|
|
579
598
|
| `doctor` | configured verify job(s) have sufficient static outer time for the trusted policy | — | missing/invalid workflow, no verify job, missing/malformed/insufficient timeout, or trusted policy cannot be loaded | — |
|
|
580
599
|
| `run` | enforcement clean and the agent exited 0 — another non-zero agent exit is passed through unchanged | any blocking finding or masked failure, including a non-quiescent process after timeout | cannot adjudicate: dirty start, policy error, verify cannot run | `AGENT_TIMEOUT`: `--agent-budget` expired and post-timeout enforcement was clean |
|
|
581
600
|
| `hook claude` / `sweep claude` | always — a deny is JSON on stdout at exit 0, never exit 2 | — | only for an unsupported agent name | — |
|
|
601
|
+
| `hook-service` | started, stopped (or nothing to stop), or status printed | — | unsupported platform, a runtime directory another uid owns, or a service already listening | — |
|
|
582
602
|
| `allow` | sign-off recorded | — | no rule or `--reason`, not a git repo, or no current blocking finding to sign off | — |
|
|
583
603
|
| `init` | wired, or already wired | — | an item needs attention | — |
|
|
604
|
+
| `onboard` | posture `READY` or `READY WITH WARNINGS` (from `doctor`) | posture `BROKEN` or `INCOMPLETE`, including a declined write or an unconfigured verifier | refused (not a git repository, non-interactive stdin without `--yes`, a dirty tree the operator would not continue on) or aborted at a prompt | — |
|
|
584
605
|
| no or unknown command | help printed (no command) | — | unknown command, help printed | — |
|
|
585
606
|
|
|
586
607
|
### Environment variables
|
|
@@ -591,6 +612,8 @@ option can never be reinterpreted as the agent command.
|
|
|
591
612
|
| `TAMPERWARD_OOB_HEAD` | the CI workflow (`github.event.pull_request.head.sha`) | the head SHA under adjudication; once set, an approval clears anything only if it names that commit (`@<sha>`, at least 7 characters), so a new push re-blocks |
|
|
592
613
|
| `TAMPERWARD_DENYLOG` | a harness or operator | a file to which `hook claude` and `sweep claude` append the rule ids of every deny, one line per verdict, best effort |
|
|
593
614
|
| `TAMPERWARD_FSEVENTS` | operator or harness | overrides the `tamperward watch` event-log path (default `.git/tamperward/fsevents.jsonl`); the Stop sweep reads the same variable |
|
|
615
|
+
| `TAMPERWARD_HOOK_SERVICE` | the operator, in Claude Code's environment (`=1`) | lets the hooks hand their payload to a running `tamperward hook-service`; off by default. Pre-handoff refusal falls back to in-process evaluation; post-handoff ambiguity fails closed so two evaluations never race one session |
|
|
616
|
+
| `TAMPERWARD_HOOK_SERVICE_DIR` | the operator or tests | overrides the service's runtime directory (default `$XDG_RUNTIME_DIR/tamperward-hook`, else `<tmpdir>/tamperward-hook-<uid>`); it must be the hook's own uid at `0700`, the socket `0600` |
|
|
594
617
|
| `TAMPERWARD_WATCH_NO_RECURSIVE` | CI and tests (`=1`) | forces `tamperward watch` onto its per-directory fallback instead of recursive `fs.watch`, so the fallback is exercised on every platform |
|
|
595
618
|
| `TAMPERWARD_TRANSIENT` | a harness that owns restore semantics (`=block`) | raises `transient-protected-mutation` from warn to block; it can never lower a severity |
|
|
596
619
|
| `NO_COLOR` / `FORCE_COLOR` | the user's shell | any non-empty `NO_COLOR` disables colour in the text renderer; a non-empty, non-`0` `FORCE_COLOR` enables it |
|