overlord-cli 0.2611201138.0 → 0.2611211050.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.
Files changed (149) hide show
  1. package/README.md +61 -0
  2. package/dist/connectors/AGENTS.md +4 -2
  3. package/dist/connectors/HARNESS-MATRIX.md +28 -27
  4. package/dist/connectors/README.md +23 -14
  5. package/dist/connectors/VERSION +1 -1
  6. package/dist/connectors/adapters/antigravity/CAPABILITIES.md +49 -26
  7. package/dist/connectors/adapters/antigravity/README.md +63 -15
  8. package/dist/connectors/adapters/antigravity/assets/logo.png +0 -0
  9. package/dist/connectors/adapters/antigravity/codec/antigravity.codec.yaml +66 -0
  10. package/dist/connectors/adapters/antigravity/codec/antigravity.decision-codec.yaml +26 -0
  11. package/dist/connectors/adapters/antigravity/conformance-manifest.yaml +8 -4
  12. package/dist/connectors/adapters/antigravity/fixtures/decision-codec.json +51 -0
  13. package/dist/connectors/adapters/antigravity/fixtures/hooks-registration.json +15 -0
  14. package/dist/connectors/adapters/antigravity/fixtures/mutation-window-evidence.json +12 -7
  15. package/dist/connectors/adapters/antigravity/fixtures/normalize-post-tool-use-failed.json +54 -0
  16. package/dist/connectors/adapters/antigravity/fixtures/normalize-post-tool-use-shell.json +50 -0
  17. package/dist/connectors/adapters/antigravity/fixtures/normalize-post-tool-use-write.json +58 -0
  18. package/dist/connectors/adapters/antigravity/fixtures/normalize-pre-invocation.json +37 -0
  19. package/dist/connectors/adapters/antigravity/fixtures/official-stop.json +32 -0
  20. package/dist/connectors/adapters/antigravity/fixtures/post-tool-use-hook.json +36 -0
  21. package/dist/connectors/adapters/antigravity/fixtures/post-tool-use-unbound.json +35 -0
  22. package/dist/connectors/adapters/antigravity/fixtures/pre-invocation-hook.json +35 -0
  23. package/dist/connectors/adapters/antigravity/fixtures/pre-invocation-inject.json +36 -0
  24. package/dist/connectors/adapters/antigravity/fixtures/pre-invocation-unbound.json +29 -0
  25. package/dist/connectors/adapters/antigravity/fixtures/stop-delivery-reminder.json +37 -0
  26. package/dist/connectors/adapters/antigravity/fixtures/stop-hook-failure.json +37 -0
  27. package/dist/connectors/adapters/antigravity/fixtures/stop-inbox-inject.json +35 -0
  28. package/dist/connectors/adapters/antigravity/fixtures/unbound-session.json +27 -10
  29. package/dist/connectors/adapters/antigravity/harness-capabilities.yaml +133 -51
  30. package/dist/connectors/adapters/antigravity/hooks/overlord-pre-invocation.sh +30 -0
  31. package/dist/connectors/adapters/antigravity/hooks/overlord-stop.sh +37 -0
  32. package/dist/connectors/adapters/antigravity/hooks.json +31 -1
  33. package/dist/connectors/adapters/antigravity/mcp_config.json +1 -2
  34. package/dist/connectors/adapters/antigravity/plugin.json +9 -2
  35. package/dist/connectors/adapters/claude/.claude-plugin/plugin.json +5 -8
  36. package/dist/connectors/adapters/claude/.mcp.json +8 -0
  37. package/dist/connectors/adapters/claude/CAPABILITIES.md +32 -20
  38. package/dist/connectors/adapters/claude/README.md +84 -15
  39. package/dist/connectors/adapters/claude/codec/claude.decision-codec.yaml +13 -5
  40. package/dist/connectors/adapters/claude/conformance-manifest.yaml +4 -6
  41. package/dist/connectors/adapters/claude/fixtures/decision-codec.json +8 -9
  42. package/dist/connectors/adapters/claude/fixtures/decision-hook-registration.json +17 -0
  43. package/dist/connectors/adapters/claude/fixtures/hook-capture-fail-open.json +60 -0
  44. package/dist/connectors/adapters/claude/fixtures/hook-decision-no-approval-on-failure.json +74 -0
  45. package/dist/connectors/adapters/claude/fixtures/hook-nested-session-gate.json +148 -0
  46. package/dist/connectors/adapters/claude/fixtures/hook-stop-fail-open.json +61 -0
  47. package/dist/connectors/adapters/claude/fixtures/hooks-fail-open-registration.json +32 -0
  48. package/dist/connectors/adapters/claude/fixtures/native-payload-shapes.json +206 -0
  49. package/dist/connectors/adapters/claude/fixtures/normalize-post-tool-use-shell.json +1 -7
  50. package/dist/connectors/adapters/claude/fixtures/normalize-post-tool-use-write.json +2 -10
  51. package/dist/connectors/adapters/claude/fixtures/normalize-session-start.json +1 -4
  52. package/dist/connectors/adapters/claude/fixtures/normalize-user-prompt-submit.json +1 -5
  53. package/dist/connectors/adapters/claude/fixtures/permission-request.json +14 -5
  54. package/dist/connectors/adapters/claude/fixtures/post-tool-use-capture.json +54 -13
  55. package/dist/connectors/adapters/claude/fixtures/post-tool-use-parity.json +6 -3
  56. package/dist/connectors/adapters/claude/fixtures/probe-decision-fail-closed.json +45 -0
  57. package/dist/connectors/adapters/claude/fixtures/probe-fail-open.json +48 -0
  58. package/dist/connectors/adapters/claude/fixtures/probe-stop-heartbeat.json +40 -0
  59. package/dist/connectors/adapters/claude/fixtures/status-line-opt-in.json +16 -0
  60. package/dist/connectors/adapters/claude/fixtures/status-line-payload.json +29 -0
  61. package/dist/connectors/adapters/claude/fixtures/status-line-side-effect-free.json +16 -0
  62. package/dist/connectors/adapters/claude/fixtures/subagent-identity.json +143 -0
  63. package/dist/connectors/adapters/claude/fixtures/subagent-stop-background.json +95 -0
  64. package/dist/connectors/adapters/claude/fixtures/unbound-session.json +134 -12
  65. package/dist/connectors/adapters/claude/harness-capabilities.yaml +151 -57
  66. package/dist/connectors/adapters/claude/hooks/hooks.json +33 -6
  67. package/dist/connectors/adapters/claude/skills/overlord-mission/SKILL.md +4 -4
  68. package/dist/connectors/adapters/codex/.codex-plugin/plugin.json +1 -1
  69. package/dist/connectors/adapters/codex/CAPABILITIES.md +24 -10
  70. package/dist/connectors/adapters/codex/README.md +31 -5
  71. package/dist/connectors/adapters/codex/codec/codex.codec.yaml +9 -0
  72. package/dist/connectors/adapters/codex/conformance-manifest.yaml +2 -2
  73. package/dist/connectors/adapters/codex/fixtures/control-plane-surface-guard.json +26 -0
  74. package/dist/connectors/adapters/codex/fixtures/control-plane-surface-prompt-guard.json +24 -0
  75. package/dist/connectors/adapters/codex/fixtures/decision-codec.json +13 -9
  76. package/dist/connectors/adapters/codex/fixtures/normalize-post-tool-use-failed.json +2 -0
  77. package/dist/connectors/adapters/codex/fixtures/normalize-post-tool-use-rename.json +2 -0
  78. package/dist/connectors/adapters/codex/fixtures/normalize-post-tool-use-subagent.json +53 -0
  79. package/dist/connectors/adapters/codex/fixtures/normalize-post-tool-use.json +2 -0
  80. package/dist/connectors/adapters/codex/fixtures/normalize-pre-tool-use.json +2 -0
  81. package/dist/connectors/adapters/codex/fixtures/normalize-session-start.json +2 -0
  82. package/dist/connectors/adapters/codex/fixtures/normalize-user-prompt.json +2 -0
  83. package/dist/connectors/adapters/codex/fixtures/permission-request.json +22 -7
  84. package/dist/connectors/adapters/codex/fixtures/shell-session-env.json +28 -0
  85. package/dist/connectors/adapters/codex/fixtures/status-line-opt-in.json +22 -0
  86. package/dist/connectors/adapters/codex/fixtures/status-line-provider.json +124 -0
  87. package/dist/connectors/adapters/codex/fixtures/status-line-state.json +90 -0
  88. package/dist/connectors/adapters/codex/fixtures/stop.json +28 -0
  89. package/dist/connectors/adapters/codex/harness-capabilities.yaml +118 -20
  90. package/dist/connectors/adapters/codex/scripts/permission-hook.sh +5 -0
  91. package/dist/connectors/adapters/codex/scripts/user-prompt-submit-hook.sh +5 -0
  92. package/dist/connectors/adapters/codex-app-server/CAPABILITIES.md +149 -0
  93. package/dist/connectors/adapters/codex-app-server/README.md +251 -0
  94. package/dist/connectors/adapters/codex-app-server/codec/codex-app-server.codec.yaml +150 -0
  95. package/dist/connectors/adapters/codex-app-server/conformance-manifest.yaml +24 -0
  96. package/dist/connectors/adapters/codex-app-server/fixtures/human-answers-control-plane-cards.json +17 -0
  97. package/dist/connectors/adapters/codex-app-server/fixtures/launch-mints-control-plane-channel.json +20 -0
  98. package/dist/connectors/adapters/codex-app-server/fixtures/mutation-window-evidence.json +29 -0
  99. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-child-file-change.json +74 -0
  100. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-command-completed.json +67 -0
  101. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-command-started.json +61 -0
  102. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-file-change-completed.json +70 -0
  103. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-file-change-declined.json +71 -0
  104. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-file-change-started.json +64 -0
  105. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-fork-started.json +79 -0
  106. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-steer-message.json +50 -0
  107. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-subagent-started.json +51 -0
  108. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-thread-started.json +77 -0
  109. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-turn-interrupted.json +44 -0
  110. package/dist/connectors/adapters/codex-app-server/fixtures/normalize-user-message.json +50 -0
  111. package/dist/connectors/adapters/codex-app-server/fixtures/reasked-approval-occurrence.json +14 -0
  112. package/dist/connectors/adapters/codex-app-server/fixtures/replay-child-thread.json +692 -0
  113. package/dist/connectors/adapters/codex-app-server/fixtures/replay-command-approval.json +465 -0
  114. package/dist/connectors/adapters/codex-app-server/fixtures/replay-concurrent-answer.json +278 -0
  115. package/dist/connectors/adapters/codex-app-server/fixtures/replay-handshake.json +242 -0
  116. package/dist/connectors/adapters/codex-app-server/fixtures/replay-history-import.json +974 -0
  117. package/dist/connectors/adapters/codex-app-server/fixtures/replay-inject-steer.json +235 -0
  118. package/dist/connectors/adapters/codex-app-server/fixtures/replay-inject-turn-boundary.json +403 -0
  119. package/dist/connectors/adapters/codex-app-server/fixtures/replay-interrupt.json +199 -0
  120. package/dist/connectors/adapters/codex-app-server/fixtures/replay-patch-approval.json +266 -0
  121. package/dist/connectors/adapters/codex-app-server/fixtures/replay-version-gate.json +84 -0
  122. package/dist/connectors/adapters/codex-app-server/fixtures/server-socket-owner-only.json +24 -0
  123. package/dist/connectors/adapters/codex-app-server/fixtures/status-line-provider.json +125 -0
  124. package/dist/connectors/adapters/codex-app-server/fixtures/status-line-thread-index.json +15 -0
  125. package/dist/connectors/adapters/codex-app-server/fixtures/supervisor-reaps-orphans.json +17 -0
  126. package/dist/connectors/adapters/codex-app-server/fixtures/supervisor-watchdog.json +14 -0
  127. package/dist/connectors/adapters/codex-app-server/fixtures/trust-entry-cleanup.json +13 -0
  128. package/dist/connectors/adapters/codex-app-server/fixtures/unbound-session.json +13 -0
  129. package/dist/connectors/adapters/codex-app-server/harness-capabilities.yaml +384 -0
  130. package/dist/connectors/adapters/cursor/.cursor-plugin/plugin.json +1 -1
  131. package/dist/connectors/adapters/cursor/CAPABILITIES.md +3 -3
  132. package/dist/connectors/adapters/cursor/conformance-manifest.yaml +2 -2
  133. package/dist/connectors/adapters/cursor/fixtures/claude-plugin-import-guard.json +17 -0
  134. package/dist/connectors/adapters/cursor/harness-capabilities.yaml +12 -7
  135. package/dist/connectors/adapters/opencode/conformance-manifest.yaml +1 -1
  136. package/dist/connectors/adapters/pi/conformance-manifest.yaml +1 -1
  137. package/dist/connectors/core/scripts/agent-session-hook.sh +4 -0
  138. package/dist/connectors/core/scripts/capture-change-hook.sh +5 -0
  139. package/dist/connectors/core/scripts/overlord-mcp.mjs +668 -38
  140. package/dist/connectors/docs/05-connectors-and-agent-plugins.md +12 -4
  141. package/dist/connectors/docs/testing.md +12 -4
  142. package/dist/index.js +12809 -6328
  143. package/dist/index.js.map +4 -4
  144. package/package.json +1 -1
  145. package/dist/connectors/adapters/claude/fixtures/inject-async-rewake.json +0 -13
  146. package/dist/connectors/adapters/claude/fixtures/inject-stop-block.json +0 -9
  147. package/dist/connectors/adapters/claude/scripts/permission-hook.sh +0 -21
  148. package/dist/connectors/adapters/claude/scripts/stop-hook.sh +0 -81
  149. package/dist/connectors/adapters/claude/scripts/user-prompt-submit-hook.sh +0 -121
@@ -4,9 +4,9 @@
4
4
 
5
5
  **Adapter** `claude` · **Codec** `claude` · **Integration shape** `callback` · **Capability tier** 1 (Observational)
6
6
 
7
- **Harness version verified** `2.1.227` · **range** `>=2.1.0` · **scheme** `semver`
7
+ **Harness version verified** `2.1.329` · **range** `>=2.1.328` · **scheme** `semver`
8
8
 
9
- **Descriptor digest** `0f708197c1306226e137a332532fabbc68c41023ba0bd46614468d9fef38a14e`
9
+ **Descriptor digest** `ea275756dcff0c1ed16b366f8bcfad9a185545d2c7fd55ab7afc6933bbad2552`
10
10
 
11
11
  > The tier is derived from passing fixtures, never authored. `unsupported` means the harness
12
12
  > cannot do it — do not attempt it. `not-implemented` means it is buildable and unbuilt: that is
@@ -22,7 +22,7 @@
22
22
  | Field | `session_id` |
23
23
  | Evidence | fixtures: `fixtures/normalize-post-tool-use-shell.json` |
24
24
 
25
- Every hook body carries `session_id`, so binding needs no environment cooperation and works identically for the first event of a session and the thousandth. The native session id is a correlation alias only: authorization and mission scope come from the verified channel credential, never from cwd and never from an unverified native id. `CLAUDE_CODE_SESSION_ID` remains available in tool subprocesses and is used by `attach`, but the payload field is the one the push path depends on because it is present on the path that actually needs it.
25
+ Every hook body carries `session_id`, so binding needs no environment cooperation and works identically for the first event of a session and the thousandth. The native session id is a correlation alias only: authorization and mission scope come from the verified channel credential, never from cwd and never from an unverified native id. `CLAUDE_CODE_SESSION_ID` remains available in tool subprocesses and is used by `attach`, but the payload field is the one the push path depends on because it is present on the path that actually needs it. The `mcp_tool` hooks template it into the tool input as `${session_id}`. Recorded on 2.1.329 (fixtures/subagent-identity.json): hooks inside a subagent or fork carry the parent's `session_id` plus `agent_id`/`agent_type`, so their work binds to the parent's mission; compaction keeps the `session_id`; a nested `claude -p` gets its own id.
26
26
 
27
27
  The native session id is a **correlation alias only**. Authorization and mission scope come
28
28
  from the verified channel/session credential; neither the working directory nor an unverified
@@ -37,7 +37,7 @@ native id is a binding authority.
37
37
  | Harness ceiling | none documented |
38
38
  | Evidence | fixtures: `fixtures/permission-request.json` |
39
39
 
40
- Per-command `timeout` in seconds with no documented ceiling. Omitting `decision` from a PermissionRequest response falls through to the native prompt, which is the required fail-toward-the-harness behavior.
40
+ The hook's `timeout` (seconds, default 600 for mcp_tool) has no documented ceiling. Claude sends no timeout in the payload, so the launch-registered decision hook passes `hookTimeoutSeconds: 300` as a literal input and the tool answers `{}` 5 s before it. Omitting `decision` from a PermissionRequest answer falls through to the native prompt.
41
41
 
42
42
  ## Mutation-window evidence
43
43
 
@@ -58,10 +58,10 @@ callbacks, record unavailable evidence health.
58
58
 
59
59
  | Capability | Status | Native | Evidence |
60
60
  | --- | --- | --- | --- |
61
- | `observe.prompt` | ✅ supported | `UserPromptSubmit` | fixtures: `fixtures/normalize-user-prompt-submit.json` |
61
+ | `observe.prompt` | ✅ supported | `UserPromptSubmit` | fixtures: `fixtures/normalize-user-prompt-submit.json`, `fixtures/native-payload-shapes.json` |
62
62
  | `observe.toolCall` | 🚧 not-implemented | `PreToolUse` | tracked as `agent-session-phase-2` |
63
63
  | `observe.toolResult` | 🚧 not-implemented | `PostToolUse` | tracked as `latch-engine` |
64
- | `observe.fileEdit` | ✅ supported | `PostToolUse` | fixtures: `fixtures/normalize-post-tool-use-write.json`, `fixtures/normalize-post-tool-use-notebook.json`, `fixtures/post-tool-use-parity.json`, `fixtures/post-tool-use-capture.json` |
64
+ | `observe.fileEdit` | ✅ supported | `PostToolUse` | fixtures: `fixtures/normalize-post-tool-use-write.json`, `fixtures/normalize-post-tool-use-notebook.json`, `fixtures/post-tool-use-parity.json`, `fixtures/post-tool-use-capture.json`, `fixtures/hook-capture-fail-open.json`, `fixtures/native-payload-shapes.json` |
65
65
  | `observe.sessionLifecycle` | 🚧 not-implemented | `SessionStart` | tracked as `latch-engine` |
66
66
  | `decide.shell` | 🚧 not-implemented | `PermissionRequest` | tracked as `latch-engine` |
67
67
  | `decide.mcp` | 🚧 not-implemented | `PermissionRequest` | tracked as `latch-engine` |
@@ -74,39 +74,51 @@ callbacks, record unavailable evidence health.
74
74
  | `inject.turnBoundary` | 🚧 not-implemented | `Stop` | tracked as `latch-engine` |
75
75
  | `inject.nextTurn` | 🚧 not-implemented | `Stop` | tracked as `agent-session-phase-4` |
76
76
  | `terminal.concurrentAnswer` | ⛔ unsupported | — | The native permission prompt is drawn only after the hook returns, so nobody can answer in the terminal while Overlord holds the decision. Holding is simultaneously the only way to answer remotely and the reason the terminal cannot participate. (evidence: `connector-harness-taxonomy.md#12-the-axis-that-actually-matters`) |
77
- | `terminal.statusSurface` | 🚧 not-implemented | `statusMessage` | tracked as `agent-session-phase-2` |
77
+ | `terminal.statusSurface` | ✅ supported | `statusLine` | fixtures: `fixtures/status-line-payload.json`, `fixtures/status-line-opt-in.json`, `fixtures/status-line-side-effect-free.json` |
78
78
 
79
79
  ### Capability notes
80
80
 
81
- - **`observe.prompt`** — The protocol follow-up hook posts `user_follow_up` mission events. There is no separate mechanical agent-session event stream.
81
+ - **`observe.prompt`** — The UserPromptSubmit `mcp_tool` hook calls `overlord_hook_user_prompt_submit`, which runs `ovld protocol hook-event --hook-type UserPromptSubmit` and posts `user_follow_up` mission events. It fails open (fixtures/hooks-fail-open-registration.json). There is no separate mechanical agent-session event stream.
82
82
  - **`observe.toolCall`** — Deliberately unregistered in Phase 1. PreToolUse is decision-capable: registering it for observation alone would put a script in front of every tool call for no benefit a PostToolUse registration does not already provide, while inheriting the blast radius of the decision path. It lands with the codecs that can actually use it.
83
83
  - **`observe.toolResult`** — The protocol PostToolUse callback forwards bounded mutation evidence to the local objective ledger, but it does not expose a general tool-result event stream.
84
- - **`observe.fileEdit`** — The shipped PostToolUse callback forwards its native payload to local `capture-change` only when `OVERLORD_OBJECTIVE_ID` resolves an exact active-session binding. A directly named Write/Edit path normalized by the Claude codec as `file.edited` records non-exclusive `declared_edit`/`direct` evidence. Codec-normalized read, search, and fetch callbacks are silent no-ops; mutation-capable callbacks without a normalized edit path, plus shell, generic, unknown, and unmapped callbacks, record unavailable evidence health. Mechanical agent-session observation is not a live Overlord path.
84
+ - **`observe.fileEdit`** — The PostToolUse `mcp_tool` hook calls `overlord_hook_post_tool_use`, which forwards the rebuilt native payload to local `capture-change` only when `OVERLORD_OBJECTIVE_ID` resolves an exact active-session binding, and always answers `{}` (fails open). A directly named Write/Edit path normalized by the Claude codec as `file.edited` records non-exclusive `declared_edit`/`direct` evidence. Codec-normalized read, search, and fetch callbacks are silent no-ops; mutation-capable callbacks without a normalized edit path, plus shell, generic, unknown, and unmapped callbacks, record unavailable evidence health. Mechanical agent-session observation is not a live Overlord path.
85
85
  - **`observe.sessionLifecycle`** — No Overlord session-lifecycle registration ships.
86
- - **`decide.universal`** — The native Claude prompt owns approvals; Overlord exposes no remote decision control.
86
+ - **`decide.universal`** — The native Claude prompt owns approvals; Overlord exposes no remote decision control yet. The transport exists: `ovld launch` registers a PermissionRequest `mcp_tool` hook with `onFailure: "block"` for channel-bound launches only (fixtures/decision-hook-registration.json). A failure to reach the hooks server denies (fixtures/probe-decision-fail-closed.json); a CLI or backend failure answers no decision and keeps the native prompt (fixtures/hook-decision-no-approval-on-failure.json).
87
87
  - **`answer.structuredQuestion`** — Elicitation/ElicitationResult hook events exist in the binary but their request and response shapes were not read. Write the fixture before relying on them.
88
88
  - **`answer.persistentAllow`** — Structurally available, deliberately unbuilt. A standing permission grant needs its own design, confirmation, audit language, and RBAC review before any remote surface offers it.
89
89
  - **`inject.midTurn`** — Session-input injection is not a live Overlord connector path. A future conversation surface must use the native Latch v2 Conversation Hub protocol.
90
- - **`inject.turnBoundary`** — Turn-boundary injection moved off Overlord connectors. The protocol Stop hook still reminds the agent to deliver when needed.
90
+ - **`inject.turnBoundary`** — Turn-boundary injection moved off Overlord connectors. The Stop `mcp_tool` hook still checks the channel inbox and reminds the agent to deliver when needed, at most once per session and objective. It fails open (fixtures/hook-stop-fail-open.json). At a final Stop (no running `background_tasks`) in a headless session (`CLAUDE_CODE_ENTRYPOINT` `sdk-*`) the inbox step polls for up to 60 s so an instruction sent just after the run finishes still reaches it; interactive sessions claim once and never wait. The plugin's Stop hook timeout is 100 s (hazard `headless-stop-hold`).
91
91
  - **`inject.nextTurn`** — No distinct next-turn-only path yet; turn-boundary Stop covers the portable fallback.
92
- - **`terminal.statusSurface`** — `statusMessage` is static install-time configuration with no per-request interpolation and no session-binding predicate, so it renders in unbound sessions too. It must be worded as an option, never as an instruction.
92
+ - **`terminal.statusSurface`** — Claude Code's `statusLine` command runs `ovld status-line --agent claude --payload-file -`, which shows the bound mission and objective (display ids and titles) and whether the session is awaiting an answer or approval, blocked on a question, or delivered. The binding comes from the native-session index under the payload `session_id`, else the launch environment; an unbound session prints nothing and makes no network call. The command answers from an owner-only local snapshot and refreshes a stale one in a detached, lock-guarded process. A plugin cannot ship a status line, so `ovld agent-setup claude --status-line` (or a yes at its prompt) adds it to the user's settings and never replaces an existing one. Verified live on 2.1.329. The hook `statusMessage` field is unrelated: it is static spinner text with no session-binding predicate, and Overlord does not use it.
93
93
 
94
94
  ## Hazards
95
95
 
96
96
  | Hazard | Severity | Verification | Mitigation | Tracked as |
97
97
  | --- | --- | --- | --- | --- |
98
- | `shipped-permission-hook-inert` | high | verified | implemented | fixture `fixtures/permission-request.json` |
99
- | `shipped-stop-hook-inert` | medium | verified | required | `agent-session-phase-3` |
100
- | `fork-and-subagent-identity-unknown` | medium | unverified | required | `taxonomy-7.6` |
101
- | `subagent-stop-unregistered` | medium | verified | required | `coo:585` |
98
+ | `shipped-permission-hook-inert` | high | verified | implemented | fixture `fixtures/decision-hook-registration.json` |
99
+ | `shipped-stop-hook-inert` | medium | verified | implemented | fixture `fixtures/hook-stop-fail-open.json` |
100
+ | `hook-tool-unlisted-call` | medium | verified | required | `coo:1323.2ewy` |
101
+ | `hook-server-no-fallback` | medium | verified | implemented | fixture `fixtures/probe-fail-open.json` |
102
+ | `fork-and-subagent-identity-unknown` | medium | verified | implemented | fixture `fixtures/subagent-identity.json` |
103
+ | `subagent-stop-unregistered` | medium | verified | implemented | fixture `fixtures/subagent-stop-background.json` |
104
+ | `nested-session-inherits-launch-env` | medium | verified | implemented | fixture `fixtures/hook-nested-session-gate.json` |
105
+ | `headless-stop-hold` | low | verified | implemented | fixture `fixtures/probe-stop-heartbeat.json` |
102
106
 
103
- **`shipped-permission-hook-inert`** — The installed PermissionRequest hook calls a `ovld protocol permission-request` subcommand that does not exist, backgrounds the call with `) & disown`, and is gated on a MISSION_ID environment variable launched sessions do not always set. It records nothing and, being backgrounded with stdout discarded, is structurally incapable of returning a decision.
107
+ **`shipped-permission-hook-inert`** — Retired with the shell scripts (coo:1323). The old plugin shipped an unregistered `scripts/permission-hook.sh` that called a nonexistent `ovld protocol permission-request` and backgrounded the call, so it could never return a decision. The script is deleted. The decision path is now a PermissionRequest `mcp_tool` hook that `ovld launch` registers only for channel-bound sessions, with `onFailure: "block"`.
104
108
 
105
- **`shipped-stop-hook-inert`** — The installed Stop hook calls `ovld protocol hook-event --hook-type Stop`, which the CLI rejects, and then parses a `deliveryStatus` field nothing produces. Confirmed again at 2.1.221 from a live agent-pod session: every entry in ~/.ovld/logs/stop-hook.log takes the `no launch mission id` branch and returns before the delivery check, because the hook gates on a `MISSION_ID` environment variable the pod does not set. The PostToolUse path is independently scoped by explicit mission and objective launch environment; the Stop hook should use an equally explicit binding.
109
+ **`shipped-stop-hook-inert`** — Fixed in coo:1323. The old Stop script called `ovld protocol hook-event --hook-type Stop`, which the CLI rejected, and gated on a `MISSION_ID` the pod did not set. The Stop hook is now an `mcp_tool` call: it binds through the launch environment or the native-session index that `attach` writes, `hook-event` accepts Stop and returns delivery status, and the reminder blocks at most once per session and objective. Failures fail open.
106
110
 
107
- **`fork-and-subagent-identity-unknown`** — Whether an in-process fork mints a new native session id, and whether subagent tool calls carry the parent's id, are both unverified. Guessing either routes a session's requests to the wrong mission. Partially narrowed at 2.1.221: the binary carries distinct `SubagentStart` and `SubagentStop` hook events, converts an agent-frontmatter `Stop` registration into `SubagentStop` ("subagents trigger SubagentStop"), and records `parent_session_id` and `agent_type` as separate fields from `session_id`. That the harness distinguishes the two identities is now established; which value lands in a subagent hook payload's `session_id` is still not, and that is the part binding depends on. Read it from a real subagent payload before changing any binding code.
111
+ **`hook-tool-unlisted-call`** — The hooks server omits its hook tools from `tools/list` so the model never sees them, and Claude Code still calls them from `mcp_tool` hooks (verified on 2.1.329). That behavior is undocumented. A release that validated hook tools against `tools/list` would break every Overlord hook, and in channel-bound launches would deny every permission request. Doctor warns when Claude Code is newer than `verifiedVersion`; the probe must be re-run on each `verifiedVersion` bump.
108
112
 
109
- **`subagent-stop-unregistered`** — The adapter registers `Stop` and no subagent-lifecycle event. Claude Code 2.1.221 fires `SubagentStop` — not `Stop` — when a subagent finishes, and subagents now run in the background past the parent's turn boundary. Version 2.1.224 also removed the 200-subagent-per-session spawn cap, increasing the frequency of this gap, so the shipped Stop registration is guaranteed not to run for work a subagent completes after the parent stopped. Nothing is lost today because that registration is already inert (see `shipped-stop-hook-inert`), which is exactly why the fix is to repair the Stop path first and only then decide whether the repaired body should also ride `SubagentStop`. Registering the current inert script on a second event would add a spawn per subagent completion and buy nothing.
113
+ **`hook-server-no-fallback`** — Claude Code has no fallback from a failed `mcp_tool` hook to another hook, so when the hooks server is not connected (no `node` on PATH, server disabled in `/mcp`, plugin not installed) follow-up capture, file capture and the Stop reminder silently stop while the session keeps working. Mitigated: these hooks fail open (fixtures/probe-fail-open.json), `ovld agent-setup claude` and `ovld doctor` report a missing or disconnected server with the fix, and the overlord-mission skill tells the agent to use the `ovld protocol` CLI.
114
+
115
+ **`fork-and-subagent-identity-unknown`** — Resolved (coo:1323.n938). Recorded on 2.1.329: every hook fired inside a subagent, including a `fork` subagent, carries the parent's `session_id` and adds `agent_id` and `agent_type`; `${agent_id}`/`${agent_type}` template the same values into an `mcp_tool` input and `""` in the main agent. PreCompact, PostCompact and the post-compaction SessionStart keep the `session_id` (main-thread compaction carries no `agent_id`). Binding by `session_id` therefore routes subagent and fork work to the parent's binding, which is correct because they work on the parent's objective, and a binding survives compaction. No Overlord hook needs `agent_id` today; it stays available if a decision card ever has to name the subagent.
116
+
117
+ **`subagent-stop-unregistered`** — Resolved (coo:1323.n938); `SubagentStop` stays unregistered on purpose. Recorded on 2.1.329: the main `Stop` fires while background subagents still run and lists them in `background_tasks`; each subagent's end fires `SubagentStop` (parent `session_id` plus `agent_id`); Claude then wakes the main agent with a harness-written `<task-notification>` prompt through UserPromptSubmit, and that turn ends in another main `Stop` with `background_tasks` empty. So the main Stop does run after subagent work completes. A subagent's stop is not the end of the objective, so a reminder or an inbox claim there would be wrong. The Stop hook templates `background_tasks`; while one is running, the delivery reminder and the headless inbox wait are deferred to the later Stop, and `hook-event` never records a `<task-notification>` prompt as a user follow-up.
118
+
119
+ **`nested-session-inherits-launch-env`** — A `claude -p` started from a Bash tool of a launched session gets its own session id (2.1.317+, and on 2.1.329 even with `CLAUDE_CODE_DISABLE_NESTED_SESSION_ID=1`), so it never matches the native-session index. But it inherits the launch environment (mission, objective, session channel), which bound it to the parent's mission: its prompt would be recorded as the user's follow-up, its Stop could claim the parent's pending instruction or be told to deliver the parent's objective. Mitigated: Claude Code exports `CLAUDE_PID` to tool processes but not to MCP servers, so a hooks server that sees a `CLAUDE_PID` other than its own parent belongs to a nested session. Its follow-up, Stop and decision hooks then ignore the launch binding (it may still bind through the index under its own id if its agent attaches); file capture keeps the launch objective because the nested process edits the same checkout for the same objective. Limit: a session launched by an `ovld` process that itself runs inside a Claude Code tool inherits that outer `CLAUDE_PID` and is treated as nested.
120
+
121
+ **`headless-stop-hold`** — A headless final Stop holds the inbox open for up to 60 s. Before 2.1.323 a host could take a hook that long for a hung turn. Since 2.1.323 `claude -p` and SDK sessions emit a progress heartbeat every 30 s while a hook runs (recorded on 2.1.329: `tool_progress` with `heartbeat: true` at 30 s during a 45 s Stop hook). Interactive sessions never wait, the wait is skipped while background subagents run, and the Stop hook timeout (100 s) exceeds the wait plus the inbox (16 s) and reminder (10 s) budgets.
110
122
 
111
123
  ## Native decision shape
112
124
 
@@ -10,6 +10,8 @@ Claude Code plugin that exposes the Overlord local mission workflow to any Claud
10
10
  - [Install (local dev)](#install-local-dev)
11
11
  - [Install (published marketplace)](#install-published-marketplace)
12
12
  - [Namespaced components](#namespaced-components)
13
+ - [Hooks and the CLI fallback](#hooks-and-the-cli-fallback)
14
+ - [Status line (optional)](#status-line-optional)
13
15
  - [For Developers](#for-developers)
14
16
  - [Overlord layer map](#overlord-layer-map)
15
17
  - [What ships](#what-ships)
@@ -18,7 +20,11 @@ Claude Code plugin that exposes the Overlord local mission workflow to any Claud
18
20
 
19
21
  ### Requirements
20
22
 
21
- - Overlord CLI (`ovld`) on `PATH`. See the Overlord docs / Settings → Agents & MCP.
23
+ - Claude Code **2.1.328 or later**. The plugin's hooks are `mcp_tool` hooks, and the
24
+ permission-decision hook needs `onFailure: "block"`, which 2.1.328 added. `ovld doctor`
25
+ reports an older version as an error.
26
+ - Overlord CLI (`ovld`) and `node` on `PATH`. The hooks server is a Node script, and every hook
27
+ runs an `ovld` command. See the Overlord docs / Settings → Agents & MCP.
22
28
  - `MISSION_ID` is exported automatically when a Claude session is launched from Overlord.
23
29
 
24
30
  ### Install (recommended)
@@ -44,7 +50,14 @@ the connector. If the `claude` CLI is not on `PATH`, setup still writes the
44
50
  marketplace manifest and prints the two commands above to run once Claude Code
45
51
  is installed.
46
52
 
47
- The plugin prompts for `overlord_url` and, when needed for non-interactive use, `user_token` at install time. Create the token with `ovld user-token create`; the raw `out_...` secret is shown once and should be pasted into the Claude plugin config. Authentication can also come from `ovld auth repair` first when a shared session already exists, then `ovld auth login`, Overlord Desktop, or `Overlord_USER_TOKEN` / `OVLD_USER_TOKEN` in the launched shell.
53
+ After installing, setup checks the Claude Code version, that the plugin is enabled, and that
54
+ its `plugin:overlord:overlord-hooks` MCP server connects (`claude mcp get`), and prints any
55
+ problem with its fix.
56
+
57
+ The plugin prompts for `overlord_url` at install time. It no longer has a `user_token`
58
+ setting: the hooks and the CLI authenticate the same way, through `ovld auth repair` when a
59
+ shared session already exists, then `ovld auth login`, Overlord Desktop, or
60
+ `Overlord_USER_TOKEN` / `OVLD_USER_TOKEN` in the environment Claude Code starts from.
48
61
 
49
62
  ### Install (local dev)
50
63
 
@@ -61,6 +74,60 @@ Inside Claude Code the components are surfaced with the plugin prefix:
61
74
 
62
75
  Prompts generated by the runner should reference these names in bundle instruction mode.
63
76
 
77
+ ### Hooks and the CLI fallback
78
+
79
+ Every Overlord hook is an `mcp_tool` hook. Claude Code calls a tool on the plugin's bundled local
80
+ MCP server `overlord-hooks`, and that tool runs the same `ovld` command you could run yourself:
81
+
82
+ | Hook | Tool | Runs | On failure |
83
+ | --- | --- | --- | --- |
84
+ | `UserPromptSubmit` | `overlord_hook_user_prompt_submit` | `ovld protocol hook-event --hook-type UserPromptSubmit` (records follow-ups) | continues |
85
+ | `PostToolUse` (`Edit\|Write\|MultiEdit\|NotebookEdit\|Bash`) | `overlord_hook_post_tool_use` | `ovld protocol capture-change` (local changed-file ledger) | continues |
86
+ | `Stop` | `overlord_hook_stop` | `ovld agent-session inbox`, then `ovld protocol hook-event --hook-type Stop` (delivery reminder, once per objective) | continues |
87
+ | `PermissionRequest` | `overlord_hook_permission_request` | `ovld agent-session request` (remote decision) | **denies** |
88
+
89
+ The first three are in the plugin's `hooks/hooks.json`, run in every session, and do nothing
90
+ until the session is bound to an Overlord mission. The `PermissionRequest` hook is not in the
91
+ plugin: `ovld launch` adds it through `claude --settings` only for sessions it launched with a
92
+ session channel, and only when the plugin and its hooks server are installed. If Claude Code
93
+ cannot reach the hooks server for that hook, it denies the request rather than approve it. If
94
+ the backend is slow or fails, the tool returns no decision and Claude shows its normal prompt.
95
+
96
+ Subagents, nested runs and headless runs:
97
+
98
+ - Hooks inside a subagent or fork carry the parent's session id, so their follow-ups and file
99
+ edits belong to the parent's objective. `SubagentStop` is not registered. While background
100
+ subagents are still running, the Stop reminder waits for the Stop that follows their
101
+ completion notice, and that notice is never recorded as your follow-up.
102
+ - A `claude -p` started from inside a launched session does not inherit the launch binding: its
103
+ prompts, Stop and decisions are not attributed to the parent's mission (its file edits still
104
+ are). It binds only if its own agent attaches.
105
+ - In a headless session (`claude -p`, Agent SDK), the final Stop waits up to 60 s for an
106
+ instruction sent from Overlord before the run ends. Claude Code shows a heartbeat every 30 s
107
+ meanwhile. Interactive sessions never wait. The Stop hook timeout is 100 s.
108
+
109
+ Claude Code has no automatic fallback from a failed `mcp_tool` hook. If the hooks server is not
110
+ connected (`/mcp` shows `plugin:overlord:overlord-hooks` as failed, `node` is not on `PATH`, or
111
+ the plugin is disabled), follow-up capture, file capture and the Stop reminder are off, but the
112
+ session keeps working. The **`ovld protocol` CLI is the supported fallback** and is unchanged:
113
+ `ovld protocol attach`, `update`, `ask`, `deliver` and `changes` all work without the hooks.
114
+ Declare the files you changed with `--paths` on `update` or `deliver`. To fix the hooks, run
115
+ `ovld doctor`, which names the problem, then `ovld agent-setup claude`.
116
+
117
+ ### Status line (optional)
118
+
119
+ A plugin cannot set Claude Code's status line, so it is opt-in at setup:
120
+
121
+ ```bash
122
+ ovld agent-setup claude --status-line
123
+ ```
124
+
125
+ This adds `ovld status-line --agent claude --payload-file -` to `~/.claude/settings.json`
126
+ (refreshing every 10 s) only when you have no status line. It shows the session's mission and
127
+ objective and whether it is awaiting your answer or approval, blocked on a question, or
128
+ delivered. It prints nothing in a session that is not bound to a mission. To combine it with your
129
+ own status line, pipe the same stdin into that command from your script.
130
+
64
131
  ## For Developers
65
132
 
66
133
  ### Overlord layer map
@@ -68,7 +135,7 @@ Prompts generated by the runner should reference these names in bundle instructi
68
135
  This connector is intentionally reviewable against the four connector layers in `connectors/README.md`:
69
136
 
70
137
  - Connector Core: `../../core/overlord-mission/SKILL.md` and its `reference/` files carry the durable attach, update, ask, and deliver workflow.
71
- - Connector Plugins: `skills/overlord-mission/SKILL.md`, `commands/`, `hooks/hooks.json`, and `scripts/` extend the core for Claude Code.
138
+ - Connector Plugins: `skills/overlord-mission/SKILL.md`, `commands/`, `hooks/hooks.json`, `.mcp.json`, and the rendered `scripts/overlord-mcp.mjs` hooks server extend the core for Claude Code.
72
139
  - Plugin Adapters: `.claude-plugin/plugin.json` declares the Claude-native plugin package and install-time config.
73
140
  - Prompt Wrappers: `prompt-wrapper.md` describes the launch-time context-file prompt shape for Claude.
74
141
 
@@ -76,17 +143,18 @@ This connector is intentionally reviewable against the four connector layers in
76
143
 
77
144
  - `skills/overlord-mission/SKILL.md` — Claude adapter template with a `<!-- @connector-core -->` marker; setup interpolates shared core content at install time.
78
145
  - `commands/*.md` — slash commands for session routing, objective discussion, mission creation, and work recording.
79
- - `hooks/hooks.json` + `scripts/*.sh` — mission follow-up (`UserPromptSubmit`), local
80
- objective-ledger capture (`PostToolUse`), and the Stop delivery reminder. The installed
81
- `scripts/post-tool-use-hook.sh` is rendered from the shared
82
- `connectors/core/scripts/capture-change-hook.sh`; there is no adapter-local implementation.
83
- Only a path normalized
84
- by the Claude codec as `file.edited` records non-exclusive `declared_edit`/`direct` evidence;
85
- normalized read, search, and fetch callbacks are silent no-ops. Mutation-capable callbacks
86
- without a normalized edit path, plus shell, generic, unknown, and unmapped callbacks, record
87
- unavailable evidence health. Mechanical harness observation, permission, and injection are not
88
- live Overlord connector paths under Latch v2; native Claude prompts retain control.
89
- - `userConfig` for `overlord_url` and `user_token`; the hook scripts use the `ovld protocol` CLI and pass the plugin's USER_TOKEN to that CLI as `Overlord_USER_TOKEN`.
146
+ - `hooks/hooks.json` — three fail-open `mcp_tool` hooks: mission follow-up (`UserPromptSubmit`),
147
+ local objective-ledger capture (`PostToolUse`), and the Stop delivery reminder. No shell or
148
+ Python hook script ships.
149
+ - `.mcp.json` + `scripts/overlord-mcp.mjs` — the `overlord-hooks` local stdio server, started
150
+ with `--hooks`. `scripts/overlord-mcp.mjs` is rendered at setup from the shared
151
+ `connectors/core/scripts/overlord-mcp.mjs`. In `--hooks` mode it lists no tools, so the model
152
+ never sees the hook tools, and each tool forwards the rebuilt native payload to a fixed `ovld`
153
+ command. Only a path normalized by the Claude codec as `file.edited` records non-exclusive
154
+ `declared_edit`/`direct` evidence; normalized read, search, and fetch callbacks are silent
155
+ no-ops. Mutation-capable callbacks without a normalized edit path, plus shell, generic,
156
+ unknown, and unmapped callbacks, record unavailable evidence health.
157
+ - `userConfig` for `overlord_url`.
90
158
  - `conformance-manifest.yaml` — connector conformance declaration for the Overlord contract.
91
159
  - `prompt-wrapper.md` — Claude launch context-file guidance.
92
160
 
@@ -94,7 +162,8 @@ The shared Connector Core source lives at `connectors/core/overlord-mission`. `o
94
162
 
95
163
  ### Deliberate omissions
96
164
 
97
- - **No local MCP shim.** The Claude plugin reaches Overlord's hosted MCP server, so the local stdio bridge that Codex, Cursor, and Antigravity install would only duplicate it.
165
+ - **No model-facing local MCP shim.** The Claude plugin reaches Overlord's hosted MCP server for the model's tools. The bundled shim runs only in `--hooks` mode and lists no tools.
166
+ - **No decision hook in the plugin.** A fail-closed `PermissionRequest` hook in the plugin would run in every Claude session on the machine, so a broken local install would deny every permission prompt. `ovld launch` registers it per launch instead.
98
167
  - **No native resume flag.** Sessions are re-entered through the plugin's own surfaces rather than a `--session` launch flag.
99
168
 
100
169
  See the [adapter capability matrix](../../README.md#adapter-capability-matrix) for how this compares across adapters.
@@ -3,21 +3,29 @@ adapter: claude
3
3
  eventNamePaths: [hook_event_name]
4
4
  projectRootPaths: [cwd]
5
5
  requests:
6
+ # Claude Code's PermissionRequest input carries tool_name, tool_input, permission_mode and
7
+ # permission_suggestions. It has no request id, call id or timeout. The `mcp_tool` hook supplies
8
+ # its own timeout as the literal input `hookTimeoutSeconds`, so the answer window matches the
9
+ # hook that is actually waiting.
6
10
  - native: PermissionRequest
7
11
  toolPath: tool_name
8
12
  inputPath: tool_input
9
- requestIdPaths: [request_id]
10
- callIdPaths: [tool_use_id]
11
- timeoutPaths: [timeout]
13
+ timeoutPaths: [hookTimeoutSeconds]
12
14
  responses:
15
+ # "PermissionRequest decision control": `decision` is an object whose `behavior` is allow or
16
+ # deny. A string `decision` fails Claude's output schema, which a fail-closed hook turns into a
17
+ # deny, so the shape is pinned by fixtures/decision-codec.json.
13
18
  allow:
14
19
  body:
15
20
  hookSpecificOutput:
16
21
  hookEventName: PermissionRequest
17
- decision: allow
22
+ decision:
23
+ behavior: allow
18
24
  deny:
19
25
  body:
20
26
  hookSpecificOutput:
21
27
  hookEventName: PermissionRequest
22
- decision: deny
28
+ decision:
29
+ behavior: deny
30
+ message: Denied in Overlord.
23
31
  ask: { defer: true }
@@ -1,4 +1,4 @@
1
- contractVersion: "179.0.1"
1
+ contractVersion: "179.12.0"
2
2
  componentType: connector
3
3
  componentKey: claude
4
4
  label: "Claude Code Connector"
@@ -14,7 +14,7 @@ connector:
14
14
  harnessCapabilities:
15
15
  path: connectors/adapters/claude/harness-capabilities.yaml
16
16
  schemaVersion: 1
17
- digest: "0f708197c1306226e137a332532fabbc68c41023ba0bd46614468d9fef38a14e"
17
+ digest: "ea275756dcff0c1ed16b366f8bcfad9a185545d2c7fd55ab7afc6933bbad2552"
18
18
  # ── END GENERATED ────────────────────────────────────────────────────────────
19
19
  installPath: "~/.ovld/claude/marketplace/plugins/overlord"
20
20
  managedFiles:
@@ -30,11 +30,9 @@ connector:
30
30
  - "commands/load.md"
31
31
  - "commands/prompt.md"
32
32
  - "commands/record-work.md"
33
+ - ".mcp.json"
33
34
  - "hooks/hooks.json"
34
- - "scripts/permission-hook.sh"
35
- - "scripts/post-tool-use-hook.sh"
36
- - "scripts/stop-hook.sh"
37
- - "scripts/user-prompt-submit-hook.sh"
35
+ - "scripts/overlord-mcp.mjs"
38
36
  - "skills/overlord-mission/SKILL.md"
39
37
  - "skills/overlord-mission/reference/cli.md"
40
38
  - "skills/overlord-mission/reference/record-work.md"
@@ -1,17 +1,16 @@
1
1
  {
2
2
  "fixtureVersion": 1,
3
3
  "kind": "decision-codec",
4
- "description": "Claude request reduction and exact allow/deny/defer output.",
4
+ "description": "Claude PermissionRequest reduction and exact allow/deny/defer output. The payload is the documented PermissionRequest input as the mcp_tool hook rebuilds it (tool_input JSON-decoded, hookTimeoutSeconds supplied as a literal hook input).",
5
5
  "codec": "codec/claude.decision-codec.yaml",
6
6
  "payload": {
7
7
  "hook_event_name": "PermissionRequest",
8
8
  "session_id": "session-1",
9
9
  "cwd": "/repo",
10
+ "permission_mode": "default",
10
11
  "tool_name": "Bash",
11
12
  "tool_input": { "command": "echo AKIAIOSFODNN7EXAMPLE" },
12
- "request_id": "req-1",
13
- "tool_use_id": "call-1",
14
- "timeout": 45
13
+ "hookTimeoutSeconds": 300
15
14
  },
16
15
  "expect": {
17
16
  "request": {
@@ -25,13 +24,13 @@
25
24
  "riskMarkers": ["secret-adjacent"],
26
25
  "formatterVersion": 1
27
26
  },
28
- "nativeRequestId": "req-1",
29
- "nativeCallId": "call-1",
30
- "harnessTimeoutSeconds": 45
27
+ "nativeRequestId": null,
28
+ "nativeCallId": null,
29
+ "harnessTimeoutSeconds": 300
31
30
  },
32
31
  "responses": {
33
- "allow": "{\"hookSpecificOutput\":{\"hookEventName\":\"PermissionRequest\",\"decision\":\"allow\"}}\n",
34
- "deny": "{\"hookSpecificOutput\":{\"hookEventName\":\"PermissionRequest\",\"decision\":\"deny\"}}\n",
32
+ "allow": "{\"hookSpecificOutput\":{\"hookEventName\":\"PermissionRequest\",\"decision\":{\"behavior\":\"allow\"}}}\n",
33
+ "deny": "{\"hookSpecificOutput\":{\"hookEventName\":\"PermissionRequest\",\"decision\":{\"behavior\":\"deny\",\"message\":\"Denied in Overlord.\"}}}\n",
35
34
  "ask": null
36
35
  }
37
36
  },
@@ -0,0 +1,17 @@
1
+ {
2
+ "fixtureVersion": 1,
3
+ "kind": "source-guard",
4
+ "description": "The decision path is the only fail-closed hook: `ovld launch` registers PermissionRequest as an mcp_tool hook with onFailure block (through claude --settings, only for channel-bound launches), so a failure to reach the hooks server denies. The transcript path and permission suggestions are never templated.",
5
+ "path": "cli/src/claude-decision-hook.ts",
6
+ "assert": {
7
+ "mustContain": [
8
+ "PermissionRequest:",
9
+ "type: 'mcp_tool'",
10
+ "server: CLAUDE_HOOKS_SERVER",
11
+ "tool: CLAUDE_DECISION_HOOK_TOOL",
12
+ "onFailure: 'block'",
13
+ "timeout: CLAUDE_DECISION_HOOK_TIMEOUT_SECONDS"
14
+ ],
15
+ "mustNotContain": ["'${transcript_path}'", "'${permission_suggestions}'", "'${tool_response}'"]
16
+ }
17
+ }
@@ -0,0 +1,60 @@
1
+ {
2
+ "fixtureVersion": 1,
3
+ "kind": "script-io",
4
+ "description": "Capture fails open. When `ovld protocol capture-change` fails, the PostToolUse hook tool still answers `{}` and never `isError`, so the tool call that already ran is never blocked. The hook registration has no onFailure (fixtures/hooks-fail-open-registration.json).",
5
+ "script": "connectors/core/scripts/overlord-mcp.mjs",
6
+ "adapterKey": "claude",
7
+ "args": ["--hooks"],
8
+ "stdinMessages": [
9
+ {
10
+ "jsonrpc": "2.0",
11
+ "id": 1,
12
+ "method": "tools/call",
13
+ "params": {
14
+ "name": "overlord_hook_post_tool_use",
15
+ "arguments": {
16
+ "hook_event_name": "PostToolUse",
17
+ "session_id": "claude-session-1",
18
+ "cwd": "/repo",
19
+ "tool_name": "Write",
20
+ "tool_use_id": "toolu_1",
21
+ "tool_input": "{\"file_path\": \"/repo/src/a.ts\"}"
22
+ }
23
+ }
24
+ }
25
+ ],
26
+ "env": {
27
+ "MISSION_ID": null,
28
+ "OVERLORD_MISSION_ID": null,
29
+ "OVERLORD_OBJECTIVE_ID": "coo:825.abcd",
30
+ "OVERLORD_SESSION_CHANNEL_ID": null,
31
+ "OVERLORD_SESSION_CHANNEL_TOKEN": null,
32
+ "SESSION_KEY": null,
33
+ "OVLD_HOME": null,
34
+ "CLAUDE_CODE_SESSION_ID": null
35
+ },
36
+ "spy": {
37
+ "exitCode": 1,
38
+ "stdout": "{\"decision\":\"block\",\"reason\":\"must not surface\"}"
39
+ },
40
+ "expect": {
41
+ "exitCode": 0,
42
+ "stderr": "",
43
+ "responses": [
44
+ {
45
+ "jsonrpc": "2.0",
46
+ "id": 1,
47
+ "result": {
48
+ "content": [
49
+ {
50
+ "type": "text",
51
+ "text": "{}"
52
+ }
53
+ ]
54
+ }
55
+ }
56
+ ],
57
+ "cliInvocations": ["protocol capture-change --agent claude"],
58
+ "sandboxWrites": []
59
+ }
60
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "fixtureVersion": 1,
3
+ "kind": "script-io",
4
+ "description": "The decision tool never manufactures an approval. When `ovld agent-session request` fails, even with allow-shaped stdout, the PermissionRequest tool answers `{}` (no decision), which leaves Claude's native prompt in place. Only a failure of the harness-to-tool hop denies (fixtures/probe-decision-fail-closed.json).",
5
+ "script": "connectors/core/scripts/overlord-mcp.mjs",
6
+ "adapterKey": "claude",
7
+ "args": ["--hooks"],
8
+ "stdinMessages": [
9
+ {
10
+ "jsonrpc": "2.0",
11
+ "id": 1,
12
+ "method": "tools/call",
13
+ "params": {
14
+ "name": "overlord_hook_permission_request",
15
+ "arguments": {
16
+ "hook_event_name": "PermissionRequest",
17
+ "session_id": "claude-session-1",
18
+ "cwd": "/repo",
19
+ "permission_mode": "default",
20
+ "tool_name": "Bash",
21
+ "tool_input": "{\"command\": \"ls\"}",
22
+ "hookTimeoutSeconds": 300
23
+ }
24
+ }
25
+ }
26
+ ],
27
+ "env": {
28
+ "MISSION_ID": null,
29
+ "OVERLORD_MISSION_ID": null,
30
+ "OVERLORD_OBJECTIVE_ID": null,
31
+ "OVERLORD_SESSION_CHANNEL_ID": "channel-1",
32
+ "OVERLORD_SESSION_CHANNEL_TOKEN": null,
33
+ "SESSION_KEY": null,
34
+ "OVLD_HOME": null,
35
+ "CLAUDE_CODE_SESSION_ID": null
36
+ },
37
+ "spy": {
38
+ "exitCode": 1,
39
+ "stdout": "{\"hookSpecificOutput\":{\"hookEventName\":\"PermissionRequest\",\"decision\":{\"behavior\":\"allow\"}}}"
40
+ },
41
+ "expect": {
42
+ "exitCode": 0,
43
+ "stderr": "",
44
+ "responses": [
45
+ {
46
+ "jsonrpc": "2.0",
47
+ "id": 1,
48
+ "result": {
49
+ "content": [
50
+ {
51
+ "type": "text",
52
+ "text": "{}"
53
+ }
54
+ ]
55
+ }
56
+ }
57
+ ],
58
+ "cliInvocations": ["agent-session request --agent claude --payload-file -"],
59
+ "cliStdin": [
60
+ {
61
+ "hook_event_name": "PermissionRequest",
62
+ "session_id": "claude-session-1",
63
+ "cwd": "/repo",
64
+ "permission_mode": "default",
65
+ "tool_name": "Bash",
66
+ "tool_input": {
67
+ "command": "ls"
68
+ },
69
+ "hookTimeoutSeconds": 300
70
+ }
71
+ ],
72
+ "sandboxWrites": []
73
+ }
74
+ }