taskquoin 0.0.0-stage → 2026.12.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 (160) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/LICENSE +55 -0
  3. package/README.md +227 -2
  4. package/SECURITY.md +26 -0
  5. package/adapters/git/src/git.js +250 -0
  6. package/adapters/git/src/index.js +1 -0
  7. package/adapters/hooks-claude/src/canonical.js +45 -0
  8. package/adapters/hooks-claude/src/index.js +2 -0
  9. package/adapters/hooks-claude/src/main.js +58 -0
  10. package/adapters/hooks-claude/src/payload.js +40 -0
  11. package/adapters/host-probe/src/index.js +2 -0
  12. package/adapters/host-probe/src/ollama.js +18 -0
  13. package/adapters/host-probe/src/probe.js +107 -0
  14. package/adapters/local-tool/src/fingerprint.js +56 -0
  15. package/adapters/local-tool/src/index.js +4 -0
  16. package/adapters/local-tool/src/local-tool.js +22 -0
  17. package/adapters/local-tool/src/sandboxed.js +105 -0
  18. package/adapters/local-tool/src/scan.js +52 -0
  19. package/adapters/memory-claude-mem/src/claude-mem.js +115 -0
  20. package/adapters/memory-claude-mem/src/index.js +1 -0
  21. package/adapters/process-runner/src/index.js +1 -0
  22. package/adapters/process-runner/src/runner.js +123 -0
  23. package/adapters/runtime-api/src/capabilities.json +116 -0
  24. package/adapters/runtime-api/src/executor.js +131 -0
  25. package/adapters/runtime-api/src/index.js +1 -0
  26. package/adapters/runtime-claude/src/capabilities.json +375 -0
  27. package/adapters/runtime-claude/src/command.js +34 -0
  28. package/adapters/runtime-claude/src/executor.js +162 -0
  29. package/adapters/runtime-claude/src/index.js +4 -0
  30. package/adapters/runtime-claude/src/permissions.js +76 -0
  31. package/adapters/runtime-claude/src/stream.js +60 -0
  32. package/adapters/runtime-codex/src/capabilities.json +192 -0
  33. package/adapters/runtime-codex/src/command.js +36 -0
  34. package/adapters/runtime-codex/src/executor.js +83 -0
  35. package/adapters/runtime-codex/src/index.js +4 -0
  36. package/adapters/runtime-codex/src/scratch.js +32 -0
  37. package/adapters/runtime-codex/src/stream.js +39 -0
  38. package/adapters/runtime-opencode/src/capabilities.json +149 -0
  39. package/adapters/runtime-opencode/src/config.js +33 -0
  40. package/adapters/runtime-opencode/src/credentials.js +130 -0
  41. package/adapters/runtime-opencode/src/executor.js +127 -0
  42. package/adapters/runtime-opencode/src/facts.js +43 -0
  43. package/adapters/runtime-opencode/src/hosts.js +16 -0
  44. package/adapters/runtime-opencode/src/hosts.json +3 -0
  45. package/adapters/runtime-opencode/src/index.js +6 -0
  46. package/adapters/runtime-opencode/src/mounts.js +58 -0
  47. package/adapters/runtime-opencode/src/stream.js +63 -0
  48. package/adapters/skill-store/src/index.js +1 -0
  49. package/adapters/skill-store/src/skill-store.js +162 -0
  50. package/adapters/store-fs/src/index.js +2 -0
  51. package/adapters/store-fs/src/store.js +201 -0
  52. package/adapters/store-fs/src/trusted-dir.js +37 -0
  53. package/apps/cli/src/console.js +432 -0
  54. package/apps/cli/src/dashboard-approve.js +259 -0
  55. package/apps/cli/src/dashboard-data.js +424 -0
  56. package/apps/cli/src/dashboard.js +500 -0
  57. package/apps/cli/src/history.js +35 -0
  58. package/apps/cli/src/home.js +18 -0
  59. package/apps/cli/src/i18n/en.js +527 -0
  60. package/apps/cli/src/i18n/index.js +90 -0
  61. package/apps/cli/src/i18n/languages.js +25 -0
  62. package/apps/cli/src/i18n/locales/ar.json +526 -0
  63. package/apps/cli/src/i18n/locales/de.json +505 -0
  64. package/apps/cli/src/i18n/locales/es.json +505 -0
  65. package/apps/cli/src/i18n/locales/fa.json +505 -0
  66. package/apps/cli/src/i18n/locales/fr.json +505 -0
  67. package/apps/cli/src/i18n/locales/he.json +505 -0
  68. package/apps/cli/src/i18n/locales/hi.json +505 -0
  69. package/apps/cli/src/i18n/locales/id.json +491 -0
  70. package/apps/cli/src/i18n/locales/it.json +505 -0
  71. package/apps/cli/src/i18n/locales/ja.json +491 -0
  72. package/apps/cli/src/i18n/locales/ko.json +491 -0
  73. package/apps/cli/src/i18n/locales/nl.json +505 -0
  74. package/apps/cli/src/i18n/locales/pl.json +512 -0
  75. package/apps/cli/src/i18n/locales/pt-BR.json +505 -0
  76. package/apps/cli/src/i18n/locales/ru.json +512 -0
  77. package/apps/cli/src/i18n/locales/th.json +491 -0
  78. package/apps/cli/src/i18n/locales/tr.json +505 -0
  79. package/apps/cli/src/i18n/locales/uk.json +512 -0
  80. package/apps/cli/src/i18n/locales/vi.json +491 -0
  81. package/apps/cli/src/i18n/locales/zh-CN.json +491 -0
  82. package/apps/cli/src/i18n/locales/zh-TW.json +491 -0
  83. package/apps/cli/src/i18n/width.js +40 -0
  84. package/apps/cli/src/layout.js +18 -0
  85. package/apps/cli/src/main.js +830 -0
  86. package/apps/cli/src/preferences.js +46 -0
  87. package/apps/cli/src/runtime-notices.js +41 -0
  88. package/apps/cli/src/safe-text.js +3 -0
  89. package/apps/cli/src/shortcut.js +82 -0
  90. package/apps/cli/src/skills-cli.js +112 -0
  91. package/apps/cli/src/tui/caps.js +31 -0
  92. package/apps/cli/src/tui/components/agent-list.js +58 -0
  93. package/apps/cli/src/tui/components/approval-center.js +145 -0
  94. package/apps/cli/src/tui/components/approval.js +95 -0
  95. package/apps/cli/src/tui/components/dashboard-frame.js +293 -0
  96. package/apps/cli/src/tui/components/diff-viewer.js +549 -0
  97. package/apps/cli/src/tui/components/event-viewer.js +46 -0
  98. package/apps/cli/src/tui/components/help-panel.js +59 -0
  99. package/apps/cli/src/tui/components/home.js +185 -0
  100. package/apps/cli/src/tui/components/logo.js +67 -0
  101. package/apps/cli/src/tui/components/panel.js +70 -0
  102. package/apps/cli/src/tui/components/status-bar.js +96 -0
  103. package/apps/cli/src/tui/components/timeline.js +120 -0
  104. package/apps/cli/src/tui/keys.js +139 -0
  105. package/apps/cli/src/tui/neutral.js +68 -0
  106. package/apps/cli/src/tui/screen.js +111 -0
  107. package/apps/cli/src/tui/text.js +165 -0
  108. package/apps/cli/src/tui/tokens.js +89 -0
  109. package/apps/cli/src/tui/view.js +64 -0
  110. package/apps/cli/src/upgrade-check.js +86 -0
  111. package/apps/cli/src/upgrade-cli.js +168 -0
  112. package/apps/cli/src/workflow-cli.js +674 -0
  113. package/package.json +29 -4
  114. package/packages/application/src/index.js +8 -0
  115. package/packages/application/src/lib/digest.js +7 -0
  116. package/packages/application/src/ports/memory.js +1 -0
  117. package/packages/application/src/ports/runtime-executor.js +1 -0
  118. package/packages/application/src/projection/run-view.js +194 -0
  119. package/packages/application/src/projection/squad-view.js +33 -0
  120. package/packages/application/src/use-cases/prepare-run.js +68 -0
  121. package/packages/application/src/workflow/feature-governed.js +420 -0
  122. package/packages/application/src/workflow/gate-signals.js +40 -0
  123. package/packages/application/src/workflow/prompts.js +81 -0
  124. package/packages/config/src/config.js +372 -0
  125. package/packages/config/src/index.js +1 -0
  126. package/packages/domain/src/capabilities.js +13 -0
  127. package/packages/domain/src/capability-matrix.js +63 -0
  128. package/packages/domain/src/enforcement.js +95 -0
  129. package/packages/domain/src/index.js +4 -0
  130. package/packages/domain/src/policy.js +32 -0
  131. package/packages/rules/src/glob.js +47 -0
  132. package/packages/rules/src/index.js +5 -0
  133. package/packages/rules/src/inherit.js +19 -0
  134. package/packages/rules/src/lists.js +41 -0
  135. package/packages/rules/src/rules.js +79 -0
  136. package/packages/rules/src/shell.js +83 -0
  137. package/packages/skills/src/index.js +1 -0
  138. package/packages/skills/src/skills.js +108 -0
  139. package/skills/code-review/SKILL.md +51 -0
  140. package/skills/egm-design/LICENSE +202 -0
  141. package/skills/egm-design/SKILL.md +68 -0
  142. package/skills/egm-design/references/feature-spec-standard.md +39 -0
  143. package/skills/egm-implementation-readiness/LICENSE +202 -0
  144. package/skills/egm-implementation-readiness/SKILL.md +67 -0
  145. package/skills/egm-implementation-readiness/references/implementation-readiness-standard.md +37 -0
  146. package/skills/first-party.lock.json +10 -0
  147. package/skills/planning-contract/SKILL.md +51 -0
  148. package/skills/ponytail/LICENSE +21 -0
  149. package/skills/ponytail/SKILL.md +56 -0
  150. package/skills/security-review/SKILL.md +58 -0
  151. package/skills/tdd/SKILL.md +52 -0
  152. package/skills/unslop/LICENSE +396 -0
  153. package/skills/unslop/SKILL.md +239 -0
  154. package/skills/unslop/references/cjk.md +34 -0
  155. package/skills/unslop/references/effects.md +113 -0
  156. package/skills/unslop/references/refs.md +17 -0
  157. package/skills/unslop/references/rtl.md +111 -0
  158. package/skills/unslop/references/signs.md +122 -0
  159. package/skills/unslop/references/tokens.md +139 -0
  160. package/skills/unslop/references/visuals.md +84 -0
@@ -0,0 +1,375 @@
1
+ {
2
+ "runtime": "claude",
3
+ "runtimeVersion": "2.1.327",
4
+ "measuredOn": "2026-11-18",
5
+ "evidence": "Re-measured on 2.1.327 (2026-11-18): every live suite rerun with unchanged mechanisms, same results as R3.1 on 2.1.325 — docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt. History: docs/reports/evidence-live-contract-R1.2-2026-11-15.txt (current mechanisms). R1.1 evidence superseded where mechanisms changed (ADR-0008). Hooks: docs/reports/evidence-live-R2-2026-11-15.txt. Bash sandbox: with sandbox.failIfUnavailable and bubblewrap/socat absent, a shell-granted run is refused before any API call (measured R2.1, $0); inside the sandbox measured R2.1 (docs/reports/evidence-live-R2.1-sandbox-2026-11-15.txt). R3.1 rerun of every live suite after the Codex R3 fixes: docs/reports/evidence-live-R3.1-2026-11-15.txt.",
6
+ "entries": {
7
+ "fs.read": [
8
+ {
9
+ "when": {
10
+ "granted": [
11
+ "shell.run"
12
+ ]
13
+ },
14
+ "class": "ADVISORY",
15
+ "granularity": "pattern",
16
+ "requires": [
17
+ "bash-sandbox"
18
+ ],
19
+ "evidence": "measured",
20
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt (rerun on 2.1.327) — R2.1 sandbox probe (bubblewrap 0.6.1, socat 1.7.4.1): .env read blocked by sandbox.filesystem.denyRead",
21
+ "mechanism": "sandbox denyRead blocks listed secret files and the control store; other reads (inside or outside the workspace) are not restricted"
22
+ },
23
+ {
24
+ "when": {
25
+ "granted": [
26
+ "shell.run"
27
+ ]
28
+ },
29
+ "class": "ADVISORY",
30
+ "granularity": "pattern",
31
+ "evidence": "inferred",
32
+ "mechanism": "an allowed shell command (e.g. npm test running repository code) can read anything the OS user can"
33
+ },
34
+ {
35
+ "when": {
36
+ "scope": "scoped"
37
+ },
38
+ "class": "ADVISORY",
39
+ "granularity": "pattern",
40
+ "evidence": "documented",
41
+ "mechanism": "Claude has implicit read permission inside the working directory; a narrow Read(glob) allow is not a closed read scope"
42
+ },
43
+ {
44
+ "class": "ENFORCED",
45
+ "granularity": "pattern",
46
+ "evidence": "inferred",
47
+ "mechanism": "dontAsk + Read(./**) allow (workspace-anchored since R1.2; R1.1 measured the unanchored form) + permissions.deny Read(...) for secrets paths. Re-measure before it can certify"
48
+ }
49
+ ],
50
+ "fs.write": [
51
+ {
52
+ "when": {
53
+ "absent": [
54
+ "fs.write",
55
+ "shell.run"
56
+ ]
57
+ },
58
+ "class": "ENFORCED",
59
+ "granularity": "pattern",
60
+ "holdsFor": [
61
+ "deny-all"
62
+ ],
63
+ "evidence": "measured",
64
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt M1 (shell=false): init-event tools=[\"Read\",\"Grep\",\"Glob\"] — no Edit/Write/Bash/WebFetch/WebSearch",
65
+ "mechanism": "--tools lists no Edit/Write/Bash: the agent cannot write any file"
66
+ },
67
+ {
68
+ "when": {
69
+ "granted": [
70
+ "shell.run"
71
+ ]
72
+ },
73
+ "class": "ENFORCED",
74
+ "granularity": "workspace",
75
+ "evidence": "measured",
76
+ "requires": [
77
+ "bash-sandbox"
78
+ ],
79
+ "mechanism": "Bash subprocesses in the native OS sandbox can write the workspace but not outside it (/tmp included); per-glob scope is NOT enforced for subprocesses",
80
+ "holdsFor": [
81
+ "workspace"
82
+ ],
83
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt (rerun on 2.1.327) — R2.1 sandbox probe (bubblewrap 0.6.1, socat 1.7.4.1): allowed/ written, other/ (not granted, inside workspace) ALSO written, outside and /tmp blocked"
84
+ },
85
+ {
86
+ "when": {
87
+ "granted": [
88
+ "shell.run"
89
+ ]
90
+ },
91
+ "class": "ADVISORY",
92
+ "granularity": "pattern",
93
+ "evidence": "inferred",
94
+ "mechanism": "an allowed shell command can write anywhere the OS user can; Edit rules only govern built-in file tools"
95
+ },
96
+ {
97
+ "class": "ENFORCED",
98
+ "granularity": "pattern",
99
+ "evidence": "measured",
100
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt (rerun on 2.1.327) — R1.2 claude boundary (fix/r1.2-hardening): allowed/ written; forbidden/, .claude/settings.json, outside denied (3 structured Write denials); R2 hooks A: Write through a symlink inside allowed/ to a file outside it was denied by Claude permissions alone (symlink resolved); R2 hooks B: also denied by the Taskquoin hook",
101
+ "mechanism": "dontAsk + Edit(./<glob>) allow per granted glob; everything else denied. Defense in depth: Taskquoin PreToolUse hook re-checks the physical path (inline --settings, runs under --setting-sources \"\")"
102
+ }
103
+ ],
104
+ "shell.run": [
105
+ {
106
+ "class": "ENFORCED",
107
+ "granularity": "pattern",
108
+ "evidence": "measured",
109
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt: \"claude bash-operators\" — echo hello * ran (positive control) and did not extend to &&, ;, $(…), backticks, inside the Bash sandbox",
110
+ "mechanism": "Bash tool only present when shell.run is granted; dontAsk + Bash(<pattern>) allow governs which commands the model may issue. Effects of allowed commands are captured by the shell.run variants of the other capabilities"
111
+ }
112
+ ],
113
+ "net.egress": [
114
+ {
115
+ "when": {
116
+ "absent": [
117
+ "net.egress",
118
+ "shell.run"
119
+ ]
120
+ },
121
+ "class": "ENFORCED",
122
+ "granularity": "pattern",
123
+ "holdsFor": [
124
+ "deny-all"
125
+ ],
126
+ "evidence": "measured",
127
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt M1 (shell=false): init-event tools=[\"Read\",\"Grep\",\"Glob\"] — no Edit/Write/Bash/WebFetch/WebSearch",
128
+ "mechanism": "--tools lists no WebFetch, WebSearch or Bash: the agent has no network-capable tool"
129
+ },
130
+ {
131
+ "when": {
132
+ "granted": [
133
+ "shell.run"
134
+ ]
135
+ },
136
+ "class": "ENFORCED",
137
+ "granularity": "pattern",
138
+ "evidence": "measured",
139
+ "requires": [
140
+ "bash-sandbox"
141
+ ],
142
+ "mechanism": "Bash subprocesses run in the native OS sandbox with an empty network allowlist (failIfUnavailable, no unsandboxed escape)",
143
+ "holdsFor": [
144
+ "deny-all"
145
+ ],
146
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt (rerun on 2.1.327) — R2.1 sandbox probe (bubblewrap 0.6.1, socat 1.7.4.1): curl to a 127.0.0.1 server: exit 7, 0 hits; curl https://example.com: exit 56"
147
+ },
148
+ {
149
+ "when": {
150
+ "granted": [
151
+ "shell.run"
152
+ ]
153
+ },
154
+ "class": "ADVISORY",
155
+ "granularity": "pattern",
156
+ "evidence": "inferred",
157
+ "mechanism": "subprocess network of allowed shell commands is unconstrained on the host"
158
+ },
159
+ {
160
+ "when": {
161
+ "scope": "scoped"
162
+ },
163
+ "class": "ENFORCED",
164
+ "granularity": "pattern",
165
+ "evidence": "documented",
166
+ "mechanism": "WebFetch(domain:<host>) allow rules"
167
+ },
168
+ {
169
+ "class": "ENFORCED",
170
+ "granularity": "pattern",
171
+ "evidence": "inferred",
172
+ "mechanism": "WebFetch/WebSearch absent from --tools and denied; no Bash without shell.run"
173
+ }
174
+ ],
175
+ "vcs.commit": [
176
+ {
177
+ "when": {
178
+ "absent": [
179
+ "shell.run"
180
+ ]
181
+ },
182
+ "class": "ENFORCED",
183
+ "granularity": "pattern",
184
+ "holdsFor": [
185
+ "deny-all"
186
+ ],
187
+ "evidence": "measured",
188
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt M1 (shell=false): init-event tools=[\"Read\",\"Grep\",\"Glob\"] — no Edit/Write/Bash/WebFetch/WebSearch",
189
+ "mechanism": "no Bash tool: the agent cannot invoke git"
190
+ },
191
+ {
192
+ "when": {
193
+ "granted": [
194
+ "shell.run"
195
+ ]
196
+ },
197
+ "class": "ENFORCED",
198
+ "granularity": "pattern",
199
+ "holdsFor": [
200
+ "deny-all"
201
+ ],
202
+ "requires": [
203
+ "bash-sandbox"
204
+ ],
205
+ "evidence": "measured",
206
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt (rerun on 2.1.327) — R2.1 hooks C: git commit inside the Bash sandbox fails, .git/index.lock Read-only file system (even with .git in allowWrite)",
207
+ "mechanism": "Claude's Bash sandbox keeps .git read-only: agents cannot commit; commits are made by the orchestrator on the host after verification"
208
+ },
209
+ {
210
+ "when": {
211
+ "granted": [
212
+ "shell.run"
213
+ ]
214
+ },
215
+ "class": "ADVISORY",
216
+ "granularity": "pattern",
217
+ "evidence": "inferred",
218
+ "mechanism": "an allowed script can invoke git internally; Bash(git commit *) deny only covers model-issued spellings"
219
+ },
220
+ {
221
+ "class": "ENFORCED",
222
+ "granularity": "pattern",
223
+ "evidence": "inferred",
224
+ "mechanism": "no Bash tool without shell.run ⇒ no git invocation by the model"
225
+ }
226
+ ],
227
+ "vcs.push": [
228
+ {
229
+ "when": {
230
+ "absent": [
231
+ "shell.run"
232
+ ]
233
+ },
234
+ "class": "ENFORCED",
235
+ "granularity": "pattern",
236
+ "holdsFor": [
237
+ "deny-all"
238
+ ],
239
+ "evidence": "measured",
240
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt M1 (shell=false): init-event tools=[\"Read\",\"Grep\",\"Glob\"] — no Edit/Write/Bash/WebFetch/WebSearch",
241
+ "mechanism": "no Bash tool: the agent cannot invoke git"
242
+ },
243
+ {
244
+ "when": {
245
+ "granted": [
246
+ "shell.run"
247
+ ]
248
+ },
249
+ "class": "ENFORCED",
250
+ "granularity": "pattern",
251
+ "evidence": "measured",
252
+ "requires": [
253
+ "bash-sandbox"
254
+ ],
255
+ "mechanism": "no network inside the Bash sandbox and no write outside the workspace ⇒ push reaches neither a network remote nor a local remote outside the workspace (measured)",
256
+ "holdsFor": [
257
+ "deny-all"
258
+ ],
259
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt: \"sandbox\" probe push=1 to a local bare remote outside the workspace, remote refs unchanged; loopback 0 hits, internet blocked"
260
+ },
261
+ {
262
+ "when": {
263
+ "granted": [
264
+ "shell.run"
265
+ ]
266
+ },
267
+ "class": "ADVISORY",
268
+ "granularity": "pattern",
269
+ "evidence": "inferred",
270
+ "mechanism": "an allowed script can invoke git push internally (network unconstrained on host)"
271
+ },
272
+ {
273
+ "class": "ENFORCED",
274
+ "granularity": "pattern",
275
+ "evidence": "inferred",
276
+ "mechanism": "no Bash tool without shell.run ⇒ no git invocation by the model"
277
+ }
278
+ ],
279
+ "connector.read": [
280
+ {
281
+ "when": {
282
+ "scope": "scoped"
283
+ },
284
+ "class": "UNSUPPORTED",
285
+ "granularity": "pattern",
286
+ "evidence": "inferred",
287
+ "mechanism": "no reviewed connector mechanism before R6; RunRequest accepts no MCP configuration"
288
+ },
289
+ {
290
+ "class": "ENFORCED",
291
+ "granularity": "pattern",
292
+ "evidence": "measured",
293
+ "mechanism": "--setting-sources \"\" + --strict-mcp-config with no --mcp-config ⇒ zero MCP servers (init event inventory recorded per run)",
294
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt M1: init-event inventory mcp_servers=[] with and without a shell"
295
+ }
296
+ ],
297
+ "connector.write": [
298
+ {
299
+ "when": {
300
+ "scope": "scoped"
301
+ },
302
+ "class": "BROKERED",
303
+ "granularity": "pattern",
304
+ "evidence": "inferred",
305
+ "requires": [
306
+ "broker-available"
307
+ ],
308
+ "mechanism": "Action Broker executes approved proposals (ADR-0004) — not implemented before R6"
309
+ },
310
+ {
311
+ "class": "ENFORCED",
312
+ "granularity": "pattern",
313
+ "evidence": "measured",
314
+ "mechanism": "zero MCP servers in agent runs (init event inventory recorded per run)",
315
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt M1: init-event inventory mcp_servers=[] with and without a shell"
316
+ }
317
+ ],
318
+ "config.modify": [
319
+ {
320
+ "when": {
321
+ "absent": [
322
+ "fs.write",
323
+ "shell.run"
324
+ ]
325
+ },
326
+ "class": "ENFORCED",
327
+ "granularity": "pattern",
328
+ "holdsFor": [
329
+ "deny-all"
330
+ ],
331
+ "evidence": "measured",
332
+ "evidenceRef": "docs/reports/evidence-live-claude-2.1.327-2026-11-18.txt M1 (shell=false): init-event tools=[\"Read\",\"Grep\",\"Glob\"] — no Edit/Write/Bash/WebFetch/WebSearch",
333
+ "mechanism": "--tools lists no Edit/Write/Bash: the agent cannot modify any file"
334
+ },
335
+ {
336
+ "when": {
337
+ "granted": [
338
+ "shell.run"
339
+ ]
340
+ },
341
+ "class": "ENFORCED",
342
+ "granularity": "pattern",
343
+ "evidence": "measured",
344
+ "requires": [
345
+ "bash-sandbox",
346
+ "landing-gate"
347
+ ],
348
+ "mechanism": "write-time: sandbox.filesystem.denyWrite on protected config, .git, the control store and every nested CLAUDE.md/AGENTS.md found by a complete workspace scan (run refused if the scan is incomplete); land-time: the workflow never commits a change to any protected path, including new nested instruction files",
349
+ "holdsFor": [
350
+ "deny-all",
351
+ "scoped",
352
+ "workspace"
353
+ ],
354
+ "evidenceRef": "R2.1 sandbox probe (.claude/settings.json write blocked by denyWrite) + deterministic tests: adapters/runtime-claude/test/executor.test.ts \"workspace scan…\", packages/application/test/workflow.test.ts \"landing gate…\""
355
+ },
356
+ {
357
+ "when": {
358
+ "granted": [
359
+ "shell.run"
360
+ ]
361
+ },
362
+ "class": "ADVISORY",
363
+ "granularity": "pattern",
364
+ "evidence": "inferred",
365
+ "mechanism": "an allowed shell command can modify configuration files"
366
+ },
367
+ {
368
+ "class": "ENFORCED",
369
+ "granularity": "pattern",
370
+ "evidence": "inferred",
371
+ "mechanism": "permissions.deny Edit(./.claude/**, ./.codex/**, ./.agents/**, ./.git/**, ./taskquoin.yaml, ./CLAUDE.md, ./AGENTS.md, ./.mcp.json, control store) — must hold even under a broad fs.write ** grant"
372
+ }
373
+ ]
374
+ }
375
+ }
@@ -0,0 +1,34 @@
1
+ /** Every built-in tool that reads, writes or runs commands. */
2
+ export const HOOK_MATCHER = 'Write|Edit|MultiEdit|NotebookEdit|Read|Grep|Glob|Bash';
3
+ const AGENT_ID_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
4
+ export function buildClaudeCommand(r) {
5
+ if (!AGENT_ID_RE.test(r.agent.id))
6
+ throw new Error(`invalid agent id ${JSON.stringify(r.agent.id)} (expected [a-z0-9-], max 48)`);
7
+ const name = `af-${r.agent.id}`;
8
+ const agents = { [name]: { description: r.agent.description, prompt: r.agent.prompt, tools: r.permissions.tools, ...(r.agent.model ? { model: r.agent.model } : {}) } };
9
+ const settings = {
10
+ permissions: { allow: r.permissions.allow, deny: r.permissions.deny, defaultMode: 'dontAsk' },
11
+ // ADR-0010: when the agent can run commands, they run in Claude Code's native OS sandbox (bubblewrap on Linux):
12
+ // no network (empty allowlist), no unsandboxed escape hatch, run FAILS if the sandbox is unavailable. NOTE: allowWrite
13
+ // is additive — the workspace stays writable for subprocesses (measured R2.1); denyWrite/denyRead carve out paths.
14
+ ...(r.permissions.tools.includes('Bash') ? { sandbox: {
15
+ enabled: true, failIfUnavailable: true, allowUnsandboxedCommands: false, autoAllowBashIfSandboxed: false,
16
+ network: { allowedDomains: [], allowLocalBinding: false, allowUnixSockets: [] },
17
+ filesystem: { allowWrite: r.sandboxWriteRoots ?? [], denyWrite: r.sandboxDenyWrite ?? [], denyRead: r.sandboxDenyRead ?? [] },
18
+ } } : {}),
19
+ ...(r.hookCommand ? { hooks: { PreToolUse: [{ matcher: HOOK_MATCHER, hooks: [{ type: 'command', command: r.hookCommand, timeout: 15, onFailure: 'block' }] }] } } : {}),
20
+ };
21
+ const args = [
22
+ '-p',
23
+ '--setting-sources', '',
24
+ '--settings', JSON.stringify(settings),
25
+ '--agents', JSON.stringify(agents), '--agent', name,
26
+ '--tools', r.permissions.tools.join(','),
27
+ '--permission-mode', 'dontAsk',
28
+ '--output-format', 'stream-json', '--verbose',
29
+ '--max-turns', String(r.maxTurns),
30
+ '--no-session-persistence',
31
+ '--strict-mcp-config',
32
+ ];
33
+ return { bin: 'claude', args, cwd: r.cwd, stdin: r.task };
34
+ }
@@ -0,0 +1,162 @@
1
+ import { existsSync, mkdtempSync, readdirSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
2
+ import { isAbsolute, sep } from 'node:path';
3
+ import { homedir } from 'node:os';
4
+ import { join } from 'node:path';
5
+ import { normalizeGrants } from '../../../packages/domain/src/index.js';
6
+ import { HOME_SECRET_GLOBS, PROTECTED_WRITE_GLOBS, SECRET_READ_GLOBS } from '../../../packages/rules/src/index.js';
7
+ import { scanWorkspace } from '../../local-tool/src/index.js';
8
+ import { assertTicket, invocationDigest } from '../../../packages/application/src/index.js';
9
+ import { runProcess, verifyBinaryVersion } from '../../process-runner/src/index.js';
10
+ import { ensureTrustedDir } from '../../store-fs/src/index.js';
11
+ import { buildClaudeCommand } from "./command.js";
12
+ import { claudePermissionsFor } from "./permissions.js";
13
+ import { parseClaudeStream } from "./stream.js";
14
+ /** ADR-0010 no-leak: telemetry, error reporting, auto-update and other non-essential traffic off for every run. */
15
+ export const CLAUDE_NO_LEAK_ENV = {
16
+ CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: '1', DISABLE_TELEMETRY: '1', DISABLE_ERROR_REPORTING: '1', DISABLE_AUTOUPDATER: '1',
17
+ // pilot 1: test output was truncated at the 30 000-char default; 128 000 is the documented maximum
18
+ BASH_MAX_OUTPUT_LENGTH: '128000',
19
+ };
20
+ /** fs.write globs → sandbox write roots. Only `**` and `<dir>/**` map to a directory; other globs grant no subprocess writes. */
21
+ export function sandboxWriteRoots(cwd, globs) {
22
+ const roots = new Set();
23
+ for (const g0 of globs) {
24
+ const g = g0.replace(/^\.\//, '');
25
+ if (g === '**')
26
+ roots.add(cwd);
27
+ else {
28
+ const m = /^([^*?[\]]+)\/\*\*$/.exec(g);
29
+ if (m && !m[1].split('/').includes('..'))
30
+ roots.add(`${cwd}/${m[1]}`);
31
+ }
32
+ }
33
+ return [...roots];
34
+ }
35
+ /** Globs → concrete paths for the OS sandbox (which takes paths): keep entries whose prefix before `/**` is literal. */
36
+ function literalPaths(root, globs) {
37
+ return globs.map(g => g.replace(/\/\*\*$/, '')).filter(g => !/[*?[\]]/.test(g)).map(g => `${root}/${g}`);
38
+ }
39
+ /** The scan lives in @taskquoin/local-tool (shared with Verify); re-exported for callers of this adapter. */
40
+ export { scanWorkspace } from '../../local-tool/src/index.js';
41
+ /**
42
+ * Protected configuration, the control store, .git (always — agents never commit, ADR-0011) and every nested
43
+ * instruction file found by the scan: never writable by sandboxed subprocesses. Files created during the run are caught
44
+ * by the workflow's landing gate (never committed).
45
+ */
46
+ export function sandboxDenyWrite(cwd, controlStore, scan) {
47
+ return [...new Set([...literalPaths(cwd, PROTECTED_WRITE_GLOBS), ...scan.instructionFiles, ...(controlStore ? [controlStore] : [])])];
48
+ }
49
+ /** Secret files (project + HOME) and control store, never readable by sandboxed subprocesses. */
50
+ export function sandboxDenyRead(cwd, home, controlStore, scan) {
51
+ const homeSecrets = literalPaths(home, HOME_SECRET_GLOBS);
52
+ // A symlinked secret dir (WSL: ~/.aws → /mnt/c/…) is denied at both the link and its real target.
53
+ const targets = homeSecrets.flatMap(p => { try {
54
+ const r = realpathSync(p);
55
+ return r !== p ? [r] : [];
56
+ }
57
+ catch {
58
+ return [];
59
+ } });
60
+ // symlinks leading outside the workspace are denied too (their targets were not scanned — Codex R4 N10), and so is
61
+ // what a secret-NAMED symlink points to (`.env -> credentials.txt`, Codex CR2 #3)
62
+ const secretTargets = scan.secretLinks.flatMap(l => { try {
63
+ return [realpathSync(l)];
64
+ }
65
+ catch {
66
+ return [];
67
+ } });
68
+ return [...new Set([...literalPaths(cwd, SECRET_READ_GLOBS), ...scan.secretFiles, ...secretTargets, ...scan.externalLinks, ...homeSecrets, ...targets, ...(controlStore ? [controlStore] : [])])];
69
+ }
70
+ const q = (s) => `'${s.replace(/'/g, `'\\''`)}'`;
71
+ export class ClaudeExecutor {
72
+ runtime = 'claude';
73
+ binary;
74
+ opts;
75
+ version;
76
+ constructor(binary, opts) {
77
+ if (!opts?.hook)
78
+ throw new Error('ClaudeExecutor requires the Taskquoin PreToolUse hook (ADR-0003)');
79
+ for (const [k, v] of Object.entries({ nodeBin: opts.hook.nodeBin, entry: opts.hook.entry, policyDir: opts.hook.policyDir, controlStore: opts.hook.controlStore })) {
80
+ if (!isAbsolute(v))
81
+ throw new Error(`hook.${k} must be an absolute path`);
82
+ }
83
+ if (!existsSync(opts.hook.nodeBin) || !existsSync(opts.hook.entry))
84
+ throw new Error('hook node binary or entry not found');
85
+ this.binary = binary;
86
+ this.opts = opts;
87
+ }
88
+ /** Verified once: the binary's real version must equal the declared one (Codex R3: facts bound to execution). */
89
+ async checkVersion(env) {
90
+ this.version ??= verifyBinaryVersion(this.binary.bin, this.binary.prefixArgs, env);
91
+ const v = await this.version;
92
+ if (v !== this.binary.version)
93
+ throw new Error(`claude binary is ${v}, declared ${this.binary.version}`);
94
+ return v;
95
+ }
96
+ async run(req, signal) {
97
+ const grants = normalizeGrants(req.agent.capabilities);
98
+ const hook = this.opts.hook;
99
+ const verified = await this.checkVersion(req.env);
100
+ assertTicket(req.ticket, 'claude', verified, req.agent.capabilities, req.agent.id);
101
+ const ws = realpathSync(req.cwd);
102
+ const entryReal = realpathSync(hook.entry);
103
+ if (entryReal === ws || entryReal.startsWith(ws + sep))
104
+ throw new Error('refusing: the hook code is inside the workspace the agent can write (it could disable its own guard)');
105
+ ensureTrustedDir(hook.policyDir, ws);
106
+ const frozen = (req.frozenPaths ?? []).map(f => {
107
+ const real = existsSync(f) ? realpathSync(f) : f;
108
+ if (!real.startsWith(ws + sep))
109
+ throw new Error(`refusing: frozen path outside the workspace (${f})`);
110
+ return real;
111
+ });
112
+ const scan = scanWorkspace(ws);
113
+ if (!scan.complete)
114
+ throw new Error(`workspace scan incomplete (${scan.problem}); refusing — sandbox deny lists would be partial`);
115
+ let policyRunDir;
116
+ const cleanupErrors = [];
117
+ try {
118
+ let hookCommand;
119
+ {
120
+ policyRunDir = mkdtempSync(join(hook.policyDir, 'run-'));
121
+ const policyFile = join(policyRunDir, 'policy.json');
122
+ const policy = {
123
+ projectRoot: realpathSync(req.cwd), home: req.env.HOME ?? homedir(),
124
+ writeGlobs: grants['fs.write'] ?? [], vcs: { commit: !!grants['vcs.commit'], push: !!grants['vcs.push'] }, controlStore: hook.controlStore,
125
+ ...(frozen.length ? { frozenRoots: frozen } : {}),
126
+ };
127
+ writeFileSync(policyFile, JSON.stringify(policy), { mode: 0o600, flag: 'wx' });
128
+ hookCommand = `${q(hook.nodeBin)} ${q(hook.entry)} --policy ${q(policyFile)}`;
129
+ }
130
+ const permissions = claudePermissionsFor(grants, { controlStore: hook.controlStore });
131
+ const cmd = buildClaudeCommand({
132
+ agent: { id: req.agent.id, description: req.agent.description, prompt: req.agent.prompt, model: req.agent.model },
133
+ task: req.task, cwd: req.cwd, permissions, maxTurns: req.agent.maxTurns ?? 20, ...(hookCommand ? { hookCommand } : {}),
134
+ sandboxWriteRoots: sandboxWriteRoots(ws, grants['fs.write'] ?? []),
135
+ sandboxDenyWrite: [...sandboxDenyWrite(ws, hook.controlStore, scan), ...frozen],
136
+ sandboxDenyRead: sandboxDenyRead(ws, req.env.HOME ?? homedir(), hook.controlStore, scan),
137
+ });
138
+ const env = { ...req.env, ...CLAUDE_NO_LEAK_ENV };
139
+ const args = [...(this.binary.prefixArgs ?? []), ...cmd.args];
140
+ const p = await runProcess({ bin: this.binary.bin, args, cwd: req.cwd, env, timeoutMs: req.timeoutMs, maxOutputBytes: req.maxOutputBytes, stdin: cmd.stdin }, signal);
141
+ const s = parseClaudeStream(p.stdout.split('\n'));
142
+ const status = p.status === 'timeout' || p.status === 'cancelled' ? p.status
143
+ : p.status === 'failed' ? 'failed' : s.terminal.status;
144
+ return {
145
+ status, runtime: 'claude', runtimeVersion: this.binary.version, exitCode: p.exitCode,
146
+ terminalMessage: s.terminal.resultText, usage: { costUsd: s.terminal.costUsd, numTurns: s.terminal.numTurns },
147
+ command: { bin: this.binary.bin, args, cwd: req.cwd }, effectiveConfigDigest: invocationDigest(this.binary.bin, args, env),
148
+ inventory: s.inventory, toolCalls: s.toolCalls, permissionDenials: s.terminal.permissionDenials, unsupported: [],
149
+ ...(cleanupErrors.length ? { cleanupErrors } : {}),
150
+ stdoutTruncated: p.truncated, stderr: p.stderr, durationMs: p.durationMs,
151
+ };
152
+ }
153
+ finally {
154
+ if (policyRunDir) {
155
+ try {
156
+ rmSync(policyRunDir, { recursive: true, force: true });
157
+ }
158
+ catch { /* reported best-effort */ }
159
+ }
160
+ }
161
+ }
162
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./command.js";
2
+ export * from "./permissions.js";
3
+ export * from "./stream.js";
4
+ export * from "./executor.js";
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Capability → Claude Code (2.1.325) tool availability + permission rules.
3
+ * Under --permission-mode dontAsk every tool use without an allow rule is denied, so the allow list
4
+ * IS the grant. Deny rules take precedence over allow and are always present for config/secrets (ADR-0005).
5
+ * Path rules: "./p" relative to cwd, "~/p" home. Edit rules cover every built-in file-editing tool.
6
+ */
7
+ import { normalizeGrants } from '../../../packages/domain/src/index.js';
8
+ import { HOME_SECRET_GLOBS, PROTECTED_WRITE_GLOBS, SECRET_READ_GLOBS } from '../../../packages/rules/src/index.js';
9
+ /**
10
+ * Always denied, whatever the agent is granted. Generated from the shared @taskquoin/rules lists so the permission
11
+ * compiler, the PreToolUse hook and the CI gate give one verdict (ADR-0003). The control store is added by absolute
12
+ * path per run (claudePermissionsFor opts).
13
+ */
14
+ export const CLAUDE_BASE_DENY = [
15
+ ...PROTECTED_WRITE_GLOBS.map(g => `Edit(./${g})`),
16
+ ...SECRET_READ_GLOBS.map(g => `Read(./${g})`),
17
+ ...HOME_SECRET_GLOBS.map(g => `Read(~/${g})`),
18
+ ];
19
+ const RULE_UNSAFE = /[()\u0000-\u001f\u007f]/;
20
+ const HOST_RE = /^(?=.{1,253}$)(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*$/;
21
+ function assertInsideWorkspace(glob) {
22
+ if (glob.trim() === '')
23
+ throw new Error('fs glob is empty');
24
+ if (RULE_UNSAFE.test(glob))
25
+ throw new Error(`fs glob ${JSON.stringify(glob)} contains characters that break permission-rule syntax`);
26
+ if (glob.startsWith('/') || glob.startsWith('~') || glob.split('/').includes('..') || /^[A-Za-z]:/.test(glob)) {
27
+ throw new Error(`fs glob "${glob}" points outside the workspace; only workspace-relative globs are allowed`);
28
+ }
29
+ return glob.startsWith('./') ? glob : `./${glob}`;
30
+ }
31
+ export function claudePermissionsFor(rawCaps, opts = {}) {
32
+ const caps = normalizeGrants(rawCaps);
33
+ const tools = new Set();
34
+ const allow = [];
35
+ const deny = [...CLAUDE_BASE_DENY];
36
+ if (opts.controlStore !== undefined) {
37
+ if (!opts.controlStore.startsWith('/') || RULE_UNSAFE.test(opts.controlStore))
38
+ throw new Error(`controlStore must be an absolute, rule-safe path (got ${JSON.stringify(opts.controlStore)})`);
39
+ deny.push(`Edit(/${opts.controlStore}/**)`, `Read(/${opts.controlStore}/**)`);
40
+ }
41
+ if (caps['fs.read']) {
42
+ tools.add('Read').add('Grep').add('Glob');
43
+ // Read rules also govern Grep and Glob. Always workspace-anchored (never a bare `Read`).
44
+ for (const g of caps['fs.read'])
45
+ allow.push(`Read(${assertInsideWorkspace(g)})`);
46
+ }
47
+ if (caps['fs.write']) {
48
+ tools.add('Edit').add('Write');
49
+ for (const g of caps['fs.write'])
50
+ allow.push(`Edit(${assertInsideWorkspace(g)})`);
51
+ }
52
+ if (caps['shell.run']) {
53
+ tools.add('Bash');
54
+ for (const p of caps['shell.run']) {
55
+ if (p.trim() === '' || RULE_UNSAFE.test(p))
56
+ throw new Error(`shell.run pattern ${JSON.stringify(p)} is empty or contains characters that break permission-rule syntax`);
57
+ allow.push(`Bash(${p})`);
58
+ }
59
+ }
60
+ if (caps['net.egress']) {
61
+ tools.add('WebFetch');
62
+ for (const h of caps['net.egress']) {
63
+ if (!HOST_RE.test(h))
64
+ throw new Error(`net.egress host ${JSON.stringify(h)} is not a plain hostname`);
65
+ allow.push(`WebFetch(domain:${h})`);
66
+ }
67
+ }
68
+ else {
69
+ deny.push('WebFetch', 'WebSearch');
70
+ }
71
+ if (!caps['vcs.commit'])
72
+ deny.push('Bash(git commit)', 'Bash(git commit *)');
73
+ if (!caps['vcs.push'])
74
+ deny.push('Bash(git push)', 'Bash(git push *)');
75
+ return { tools: [...tools], allow, deny };
76
+ }