@primitive.ai/prim 0.1.0-alpha.116 → 0.1.0-alpha.118

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.
Files changed (47) hide show
  1. package/README.md +21 -21
  2. package/SKILL.md +3 -3
  3. package/dist/{chunk-XG7S3LIL.js → chunk-3NJ4FUPK.js} +889 -919
  4. package/dist/{chunk-J5HBSRAV.js → chunk-4HEWA4IO.js} +1 -1
  5. package/dist/{chunk-LEUZDTNT.js → chunk-B3FVP7VQ.js} +1 -1
  6. package/dist/{chunk-4OEJ2ONG.js → chunk-C2AEY4AI.js} +2 -13
  7. package/dist/{chunk-S55JKCHQ.js → chunk-C2AJBMP2.js} +2 -2
  8. package/dist/{chunk-D3ZDZZYS.js → chunk-CHRICRVE.js} +17 -10
  9. package/dist/{chunk-HMD5K6W7.js → chunk-ECP7EGOD.js} +2 -2
  10. package/dist/{chunk-FTW4ZCBA.js → chunk-FPDOBG3H.js} +1 -1
  11. package/dist/{chunk-3TIKBQHV.js → chunk-JGOFEG6T.js} +6 -4
  12. package/dist/chunk-JSBRDJBE.js +30 -0
  13. package/dist/{chunk-KGBMU76T.js → chunk-JXQVXU2K.js} +1 -1
  14. package/dist/chunk-KZB4ABIB.js +13 -0
  15. package/dist/{chunk-I3J344DF.js → chunk-L3NUFCOD.js} +5 -5
  16. package/dist/{chunk-6IRAGUYK.js → chunk-LEEWUN74.js} +2 -2
  17. package/dist/{chunk-JKJ22ONL.js → chunk-OHLVHT6R.js} +6 -6
  18. package/dist/{chunk-RLBASQJD.js → chunk-OIXHRN32.js} +4 -4
  19. package/dist/{chunk-LLKJAET2.js → chunk-PYIIYC3A.js} +8 -16
  20. package/dist/{chunk-NEQI2VLM.js → chunk-Q4CWXKNV.js} +5 -5
  21. package/dist/{chunk-4SN5BCIG.js → chunk-QX7QFMLF.js} +2 -2
  22. package/dist/{chunk-CXMLAWC2.js → chunk-SCOEPFOV.js} +2 -2
  23. package/dist/{chunk-6JHKKLA2.js → chunk-UMSJ4DU2.js} +46 -46
  24. package/dist/{chunk-JKO6PZWQ.js → chunk-VEI7KUOU.js} +26 -48
  25. package/dist/hook-runtime/daemon/server.js +1 -0
  26. package/dist/hook-runtime/hooks/post-commit.js +1 -0
  27. package/dist/hook-runtime/hooks/post-rewrite.js +1 -0
  28. package/dist/hook-runtime/hooks/post-tool-use.js +29 -29
  29. package/dist/hook-runtime/hooks/pre-commit.js +1 -0
  30. package/dist/hook-runtime/hooks/pre-tool-use-worker.js +34746 -0
  31. package/dist/hook-runtime/hooks/pre-tool-use.js +82 -35549
  32. package/dist/hook-runtime/hooks/prim-hook.js +22 -22
  33. package/dist/hook-runtime/hooks/session-end.js +14 -14
  34. package/dist/hook-runtime/hooks/session-start.js +100 -100
  35. package/dist/hook-runtime/index.js +244 -256
  36. package/dist/hook-runtime/statusline-main.js +1 -0
  37. package/dist/hooks/post-commit.js +8 -7
  38. package/dist/hooks/post-rewrite.js +7 -6
  39. package/dist/hooks/post-tool-use.js +25 -22
  40. package/dist/hooks/pre-commit.js +5 -4
  41. package/dist/hooks/pre-tool-use-worker.js +222 -0
  42. package/dist/hooks/pre-tool-use.js +73 -257
  43. package/dist/hooks/prim-hook.js +25 -22
  44. package/dist/hooks/session-end.js +10 -7
  45. package/dist/hooks/session-start.js +22 -19
  46. package/dist/index.js +54 -53
  47. package/package.json +3 -3
package/README.md CHANGED
@@ -13,24 +13,26 @@ presence — from the command line and via session + git hooks.
13
13
  > organization, gates can warn, pause, or block a conflicting edit until you resolve
14
14
  > the decision and retry. Automatic decision capture in active repositories is separate.
15
15
 
16
- When Enforcement is enabled, the V4 gate waits for complete Decision coverage.
17
- It polls for up to 240 seconds, limits individual requests to 10 seconds, and
18
- pauses the tool on incomplete evaluation or service failure, including in warn
19
- mode. A paused response includes a check ID:
16
+ When Enforcement is enabled, automatic V4 checks wait at most **two seconds**.
17
+ Confirmed conflicts found in that window retain the existing review/warning
18
+ behavior. Otherwise work proceeds silently, including on timeout, incomplete
19
+ coverage, authentication problems, or service failure. Admitted evaluations
20
+ continue in the backend for internal review; later results cannot stop or undo
21
+ an edit and do not send a user notification.
22
+
23
+ Explicit inspection and recovery retain their longer wait:
20
24
 
21
25
  ```bash
22
26
  prim decisions preflight status <checkId>
23
- prim decisions preflight resume <checkId> # Finish evaluation, then retry the tool
27
+ prim decisions preflight resume <checkId>
24
28
  ```
25
29
 
26
- The backend must support V4 before this CLI is rolled out. There is no V3 fallback.
27
- Re-run `prim <agent> install` and `prim doctor` to repair the 300-second hook timeout
28
- and check host failure protection. Claude needs 2.1.295+ (`onFailure: "block"`),
29
- Cursor uses the verified 3.24.9+ baseline (`failClosed: true`), and Hermes needs
30
- `fail_closed` shell-hook support. Codex supports explicit deny but does not
31
- provide a documented fail-closed policy for a hook crash, kill, or host timeout;
32
- Primitive cannot guarantee that host failure boundary. Reload/restart and trust
33
- the updated hooks as directed by the installer.
30
+ There is no V3 fallback. Re-run `prim <agent> install` and `prim doctor` to repair
31
+ the two-second hook timeout and fail-open settings. Claude uses its default
32
+ failure behavior, Cursor uses `failClosed: false`, and Hermes uses
33
+ `fail_closed: false`. Codex also permits the action if the hook fails. Reload or
34
+ restart the host as directed by the installer. Older installations retain their
35
+ blocking behavior until upgraded and repaired.
34
36
 
35
37
  ## Installation
36
38
 
@@ -583,18 +585,16 @@ They never install or upgrade the host or change your host settings.
583
585
 
584
586
  ```bash
585
587
  pnpm test:preflight-host # Installed Codex
586
- pnpm test:preflight-host:claude # Claude 2.1.295+ on PATH
588
+ pnpm test:preflight-host:claude # Claude 2.1.284+ on PATH
587
589
  pnpm test:preflight-host:claude --binary /path/to/compatible/claude
588
590
  # CLI_CLAUDE_BIN also selects the Claude binary.
589
591
  ```
590
592
 
591
- Each check covers completed allow, paused evaluation in warn mode, malformed
592
- backend JSON, CLI deadline expiry, hook crash, and host watchdog expiry. Deadline
593
- expiry uses an accelerated remaining 240-second budget; the watchdog uses a
594
- one-second timeout. These checks do not wait 240/300 seconds. Claude's
595
- `onFailure: "block"` blocks the crash and watchdog cases. The Codex check records
596
- its current limitation by expecting execution in those two cases; explicit CLI
597
- denials still block. Unsupported Claude versions fail before the fixture runs.
593
+ Each check covers completed allow, confirmed conflict, paused evaluation, malformed
594
+ backend JSON, CLI deadline expiry, hook crash, and host watchdog expiry. Only the
595
+ confirmed conflict prevents the sentinel write. The hook budget and watchdog are
596
+ two seconds; no fixture waits minutes. Unsupported Claude versions fail before
597
+ the fixture runs.
598
598
  The separate `pnpm test:preflight-v4 --schema /path/to/cli-http-v1.schema.json`
599
599
  check validates the built CLI against a supplied authoritative backend contract.
600
600
 
package/SKILL.md CHANGED
@@ -40,11 +40,11 @@ When Enforcement is enabled, before an edit (Claude Code: Edit/Write/MultiEdit;
40
40
 
41
41
  - **deny** -- the edit is blocked. Name each governing Decision and the proposed conflicting edit. Overriding a Decision requires explicit human approval for that specific override. Reconcile bypasses are disabled until a host can provide verifiable human approval; keep the edit blocked and choose a compatible approach.
42
42
  - **warn / additional context** -- the edit proceeds, but a relevant prior decision is surfaced. Read it. Cursor, Codex, and Hermes map a would-be `ask` to **deny**. Do not change gate settings, use sandbox escalation, or request prefix permissions to evade the block. Automatic approval review, `--yes`, and an agent assertion are not human approval.
43
- - **"Operation paused"** -- the check has not covered every eligible Decision. The tool is denied, including in warn mode. Use the supplied `prim decisions preflight resume <checkId>` command, then retry the tool call. `prim decisions preflight status <checkId>` inspects progress without restarting it.
43
+ - **No confirmed conflict within two seconds** -- work proceeds silently. Incomplete checks and service failures do not deny the tool or add a notice. Already admitted evaluations continue for internal review; later findings do not stop or undo that edit.
44
44
 
45
- When enabled, the V4 gate polls durable evaluation for up to 240 seconds, with each request bounded to 10 seconds. Incomplete coverage, network/auth failures, malformed responses, and expired checks pause the tool operation. Completed checks retain normal block/warn policy. The full tool input is hashed before the proposal is redacted and truncated, so a changed retry cannot reuse another proposal’s evaluation. The backend must support V4; the CLI never falls back to V3.
45
+ The two-second automatic budget includes local preparation, authentication, and network requests. A confirmed conflict can retain normal block/warn policy while other Decisions are still being evaluated; partial coverage remains explicit in the receipt. The full tool input is hashed before redaction and truncation. The CLI never falls back to V3. Explicit `prim decisions preflight status <checkId>` and `resume <checkId>` remain available for internal inspection and recovery with the longer manual budget.
46
46
 
47
- Run `prim <agent> install` to repair the 300-second hook timeout and host failure policy, then `prim doctor`. Claude requires 2.1.295+ (`onFailure: "block"`); Cursor requires the verified 3.24.9+ baseline (`failClosed: true`); Hermes requires installed `fail_closed` support. Codex honors an explicit deny but has no documented fail-closed policy for a crashed, killed, or host-timed-out hook; doctor reports that limitation. Restart or refresh the host as directed after changing hook settings.
47
+ Run `prim <agent> install` to repair the two-second hook timeout and fail-open settings, then `prim doctor`. Claude uses its default failure behavior; Cursor uses `failClosed: false`; Hermes uses `fail_closed: false`. Codex also permits tools on hook failure. Restart or refresh the host as directed. Older CLI installations retain blocking behavior until upgraded and repaired.
48
48
 
49
49
  ## Read the graph before large or load-bearing edits
50
50