@b00dea/cockpit 0.0.0-stage → 0.1.1

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 (426) hide show
  1. package/CHANGELOG.md +474 -0
  2. package/LICENSE +21 -0
  3. package/README.md +25 -2
  4. package/bin/cockpit.mjs +33 -0
  5. package/cockpit.schema.json +2644 -0
  6. package/dist/autonomy.d.ts +45 -0
  7. package/dist/autonomy.js +173 -0
  8. package/dist/bounded-read.d.ts +14 -0
  9. package/dist/bounded-read.js +42 -0
  10. package/dist/browser/commands.d.ts +117 -0
  11. package/dist/browser/commands.js +453 -0
  12. package/dist/browser/package-paths.d.ts +1 -0
  13. package/dist/browser/package-paths.js +6 -0
  14. package/dist/browser/proxy.d.ts +22 -0
  15. package/dist/browser/proxy.js +37 -0
  16. package/dist/browser/runtime.d.ts +118 -0
  17. package/dist/browser/runtime.js +186 -0
  18. package/dist/browser/surfaces.d.ts +141 -0
  19. package/dist/browser/surfaces.js +561 -0
  20. package/dist/browser/ui-gate.d.ts +15 -0
  21. package/dist/browser/ui-gate.js +18 -0
  22. package/dist/canonical-json.d.ts +2 -0
  23. package/dist/canonical-json.js +5 -0
  24. package/dist/cli-guard.d.ts +5 -0
  25. package/dist/cli-guard.js +71 -0
  26. package/dist/cli-main.d.ts +176 -0
  27. package/dist/cli-main.js +1584 -0
  28. package/dist/cli.d.ts +3 -0
  29. package/dist/cli.js +16 -0
  30. package/dist/command-table.d.ts +121 -0
  31. package/dist/command-table.js +664 -0
  32. package/dist/config/load.d.ts +183 -0
  33. package/dist/config/load.js +367 -0
  34. package/dist/config/sibling-toml.d.ts +48 -0
  35. package/dist/config/sibling-toml.js +160 -0
  36. package/dist/config/surface-tools-toml.d.ts +9 -0
  37. package/dist/config/surface-tools-toml.js +37 -0
  38. package/dist/config/unconfirmed-toml.d.ts +9 -0
  39. package/dist/config/unconfirmed-toml.js +29 -0
  40. package/dist/config/verified-write.d.ts +43 -0
  41. package/dist/config/verified-write.js +89 -0
  42. package/dist/diagnostics.d.ts +26 -0
  43. package/dist/diagnostics.js +344 -0
  44. package/dist/docs/check.d.ts +16 -0
  45. package/dist/docs/check.js +197 -0
  46. package/dist/docs/decision-record.d.ts +34 -0
  47. package/dist/docs/decision-record.js +135 -0
  48. package/dist/docs/decisions.d.ts +16 -0
  49. package/dist/docs/decisions.js +103 -0
  50. package/dist/docs/markdown.d.ts +36 -0
  51. package/dist/docs/markdown.js +88 -0
  52. package/dist/docs/references.d.ts +32 -0
  53. package/dist/docs/references.js +148 -0
  54. package/dist/emit.d.ts +22 -0
  55. package/dist/emit.js +43 -0
  56. package/dist/entrypoint-kinds.d.ts +3 -0
  57. package/dist/entrypoint-kinds.js +11 -0
  58. package/dist/environment/application/confirm.d.ts +35 -0
  59. package/dist/environment/application/confirm.js +122 -0
  60. package/dist/environment/application/destructive.d.ts +6 -0
  61. package/dist/environment/application/destructive.js +429 -0
  62. package/dist/environment/application/doctor.d.ts +94 -0
  63. package/dist/environment/application/doctor.js +247 -0
  64. package/dist/environment/application/guard.d.ts +49 -0
  65. package/dist/environment/application/guard.js +677 -0
  66. package/dist/environment/application/health.d.ts +143 -0
  67. package/dist/environment/application/health.js +385 -0
  68. package/dist/environment/application/lifecycle-context.d.ts +235 -0
  69. package/dist/environment/application/lifecycle-context.js +154 -0
  70. package/dist/environment/application/lifecycle-state.d.ts +25 -0
  71. package/dist/environment/application/lifecycle-state.js +202 -0
  72. package/dist/environment/application/lifecycle.d.ts +18 -0
  73. package/dist/environment/application/lifecycle.js +737 -0
  74. package/dist/environment/application/logs.d.ts +45 -0
  75. package/dist/environment/application/logs.js +127 -0
  76. package/dist/environment/application/services.d.ts +60 -0
  77. package/dist/environment/application/services.js +89 -0
  78. package/dist/environment/application/setup.d.ts +129 -0
  79. package/dist/environment/application/setup.js +741 -0
  80. package/dist/environment/application/shared.d.ts +11 -0
  81. package/dist/environment/application/shared.js +61 -0
  82. package/dist/environment/application/siblings.d.ts +43 -0
  83. package/dist/environment/application/siblings.js +269 -0
  84. package/dist/environment/claims.d.ts +389 -0
  85. package/dist/environment/claims.js +1701 -0
  86. package/dist/environment/codex-hook-trust.d.ts +11 -0
  87. package/dist/environment/codex-hook-trust.js +185 -0
  88. package/dist/environment/compose-environment.d.ts +1 -0
  89. package/dist/environment/compose-environment.js +6 -0
  90. package/dist/environment/compose-ownership.d.ts +21 -0
  91. package/dist/environment/compose-ownership.js +117 -0
  92. package/dist/environment/compose-topology.d.ts +125 -0
  93. package/dist/environment/compose-topology.js +490 -0
  94. package/dist/environment/contract.d.ts +522 -0
  95. package/dist/environment/contract.js +794 -0
  96. package/dist/environment/declaration.d.ts +14 -0
  97. package/dist/environment/declaration.js +39 -0
  98. package/dist/environment/destructive-composition.d.ts +29 -0
  99. package/dist/environment/destructive-composition.js +333 -0
  100. package/dist/environment/docker-daemon.d.ts +30 -0
  101. package/dist/environment/docker-daemon.js +78 -0
  102. package/dist/environment/docker-endpoint.d.ts +10 -0
  103. package/dist/environment/docker-endpoint.js +19 -0
  104. package/dist/environment/env-schema-observation.d.ts +46 -0
  105. package/dist/environment/env-schema-observation.js +241 -0
  106. package/dist/environment/evidence.d.ts +136 -0
  107. package/dist/environment/evidence.js +437 -0
  108. package/dist/environment/executable.d.ts +38 -0
  109. package/dist/environment/executable.js +190 -0
  110. package/dist/environment/generated-application/authorities.d.ts +5 -0
  111. package/dist/environment/generated-application/authorities.js +61 -0
  112. package/dist/environment/generated-application/bootstrap-skill.d.ts +16 -0
  113. package/dist/environment/generated-application/bootstrap-skill.js +328 -0
  114. package/dist/environment/generated-application/check.d.ts +13 -0
  115. package/dist/environment/generated-application/check.js +191 -0
  116. package/dist/environment/generated-application/custom-surface.d.ts +26 -0
  117. package/dist/environment/generated-application/custom-surface.js +289 -0
  118. package/dist/environment/generated-application/prepare.d.ts +29 -0
  119. package/dist/environment/generated-application/prepare.js +278 -0
  120. package/dist/environment/generated-application/publication.d.ts +33 -0
  121. package/dist/environment/generated-application/publication.js +547 -0
  122. package/dist/environment/generated-application/shared.d.ts +492 -0
  123. package/dist/environment/generated-application/shared.js +354 -0
  124. package/dist/environment/generated-application/surface-observation.d.ts +4 -0
  125. package/dist/environment/generated-application/surface-observation.js +69 -0
  126. package/dist/environment/generated-application/surface-outputs.d.ts +71 -0
  127. package/dist/environment/generated-application/surface-outputs.js +400 -0
  128. package/dist/environment/generated-application/surfaces.d.ts +3 -0
  129. package/dist/environment/generated-application/surfaces.js +704 -0
  130. package/dist/environment/generated-application/sync.d.ts +6 -0
  131. package/dist/environment/generated-application/sync.js +124 -0
  132. package/dist/environment/git-observation.d.ts +202 -0
  133. package/dist/environment/git-observation.js +553 -0
  134. package/dist/environment/health-composition.d.ts +12 -0
  135. package/dist/environment/health-composition.js +645 -0
  136. package/dist/environment/host-observation.d.ts +56 -0
  137. package/dist/environment/host-observation.js +52 -0
  138. package/dist/environment/identity.d.ts +48 -0
  139. package/dist/environment/identity.js +85 -0
  140. package/dist/environment/init-application.d.ts +333 -0
  141. package/dist/environment/init-application.js +726 -0
  142. package/dist/environment/install-policy-observation.d.ts +71 -0
  143. package/dist/environment/install-policy-observation.js +284 -0
  144. package/dist/environment/install-policy.d.ts +48 -0
  145. package/dist/environment/install-policy.js +96 -0
  146. package/dist/environment/instance.d.ts +33 -0
  147. package/dist/environment/instance.js +122 -0
  148. package/dist/environment/instruction-pointer.d.ts +19 -0
  149. package/dist/environment/instruction-pointer.js +144 -0
  150. package/dist/environment/lifecycle-composition.d.ts +31 -0
  151. package/dist/environment/lifecycle-composition.js +742 -0
  152. package/dist/environment/lifecycle-stage.d.ts +120 -0
  153. package/dist/environment/lifecycle-stage.js +408 -0
  154. package/dist/environment/lifecycle.d.ts +75 -0
  155. package/dist/environment/lifecycle.js +354 -0
  156. package/dist/environment/logs.d.ts +132 -0
  157. package/dist/environment/logs.js +519 -0
  158. package/dist/environment/map-limit.d.ts +2 -0
  159. package/dist/environment/map-limit.js +13 -0
  160. package/dist/environment/mcp-observation.d.ts +9 -0
  161. package/dist/environment/mcp-observation.js +46 -0
  162. package/dist/environment/observations.d.ts +46 -0
  163. package/dist/environment/observations.js +346 -0
  164. package/dist/environment/operator-application.d.ts +79 -0
  165. package/dist/environment/operator-application.js +197 -0
  166. package/dist/environment/ports.d.ts +182 -0
  167. package/dist/environment/ports.js +1205 -0
  168. package/dist/environment/posture-observation.d.ts +68 -0
  169. package/dist/environment/posture-observation.js +253 -0
  170. package/dist/environment/presence.d.ts +4 -0
  171. package/dist/environment/presence.js +26 -0
  172. package/dist/environment/read-composition.d.ts +32 -0
  173. package/dist/environment/read-composition.js +397 -0
  174. package/dist/environment/readiness-composition.d.ts +57 -0
  175. package/dist/environment/readiness-composition.js +151 -0
  176. package/dist/environment/reclaim.d.ts +370 -0
  177. package/dist/environment/reclaim.js +1940 -0
  178. package/dist/environment/repository-identity.d.ts +13 -0
  179. package/dist/environment/repository-identity.js +108 -0
  180. package/dist/environment/runtime-measurement-record.d.ts +38 -0
  181. package/dist/environment/runtime-measurement-record.js +111 -0
  182. package/dist/environment/runtime-measurement.d.ts +27 -0
  183. package/dist/environment/runtime-measurement.js +224 -0
  184. package/dist/environment/runtime-probe-residue.d.ts +43 -0
  185. package/dist/environment/runtime-probe-residue.js +148 -0
  186. package/dist/environment/runtime-probe.d.ts +72 -0
  187. package/dist/environment/runtime-probe.js +725 -0
  188. package/dist/environment/runtime.d.ts +551 -0
  189. package/dist/environment/runtime.js +2405 -0
  190. package/dist/environment/seed.d.ts +16 -0
  191. package/dist/environment/seed.js +43 -0
  192. package/dist/environment/selftest-application.d.ts +86 -0
  193. package/dist/environment/selftest-application.js +713 -0
  194. package/dist/environment/sensitive.d.ts +3 -0
  195. package/dist/environment/sensitive.js +48 -0
  196. package/dist/environment/served-checkout-grants.d.ts +53 -0
  197. package/dist/environment/served-checkout-grants.js +182 -0
  198. package/dist/environment/setup-observation.d.ts +62 -0
  199. package/dist/environment/setup-observation.js +1473 -0
  200. package/dist/environment/setup.d.ts +43 -0
  201. package/dist/environment/setup.js +176 -0
  202. package/dist/environment/sibling-checkouts.d.ts +119 -0
  203. package/dist/environment/sibling-checkouts.js +254 -0
  204. package/dist/environment/sibling-instructions.d.ts +33 -0
  205. package/dist/environment/sibling-instructions.js +224 -0
  206. package/dist/environment/sibling-observation.d.ts +27 -0
  207. package/dist/environment/sibling-observation.js +45 -0
  208. package/dist/environment/sibling-pull.d.ts +23 -0
  209. package/dist/environment/sibling-pull.js +95 -0
  210. package/dist/environment/sibling-registration.d.ts +45 -0
  211. package/dist/environment/sibling-registration.js +538 -0
  212. package/dist/environment/stack-inputs.d.ts +18 -0
  213. package/dist/environment/stack-inputs.js +210 -0
  214. package/dist/environment/stack-inventory-prune.d.ts +31 -0
  215. package/dist/environment/stack-inventory-prune.js +129 -0
  216. package/dist/environment/stack-inventory-report.d.ts +44 -0
  217. package/dist/environment/stack-inventory-report.js +78 -0
  218. package/dist/environment/stack-inventory.d.ts +94 -0
  219. package/dist/environment/stack-inventory.js +418 -0
  220. package/dist/environment/state.d.ts +410 -0
  221. package/dist/environment/state.js +2153 -0
  222. package/dist/environment/templates.d.ts +140 -0
  223. package/dist/environment/templates.js +685 -0
  224. package/dist/environment/tool-registration.d.ts +9 -0
  225. package/dist/environment/tool-registration.js +92 -0
  226. package/dist/environment/upgrade-application.d.ts +19 -0
  227. package/dist/environment/upgrade-application.js +175 -0
  228. package/dist/environment-exec/execute.d.ts +105 -0
  229. package/dist/environment-exec/execute.js +1179 -0
  230. package/dist/environment-exec/libexec-program.d.ts +6 -0
  231. package/dist/environment-exec/libexec-program.js +22 -0
  232. package/dist/environment-exec/verified-digest.d.ts +4 -0
  233. package/dist/environment-exec/verified-digest.js +16 -0
  234. package/dist/exact-keys.d.ts +7 -0
  235. package/dist/exact-keys.js +15 -0
  236. package/dist/fix-catalogue.d.ts +32 -0
  237. package/dist/fix-catalogue.js +60 -0
  238. package/dist/freshness.d.ts +29 -0
  239. package/dist/freshness.js +75 -0
  240. package/dist/generated-environment/adopt.d.ts +16 -0
  241. package/dist/generated-environment/adopt.js +271 -0
  242. package/dist/generated-environment/command.d.ts +47 -0
  243. package/dist/generated-environment/command.js +75 -0
  244. package/dist/generated-environment/transaction.d.ts +186 -0
  245. package/dist/generated-environment/transaction.js +1770 -0
  246. package/dist/grading/evaluate.d.ts +71 -0
  247. package/dist/grading/evaluate.js +403 -0
  248. package/dist/grading/grade.d.ts +33 -0
  249. package/dist/grading/grade.js +57 -0
  250. package/dist/guards/answer-confirmation.d.ts +41 -0
  251. package/dist/guards/answer-confirmation.js +109 -0
  252. package/dist/guards/evaluator.d.ts +130 -0
  253. package/dist/guards/evaluator.js +1258 -0
  254. package/dist/guards/harness-adapter.d.ts +17 -0
  255. package/dist/guards/harness-adapter.js +57 -0
  256. package/dist/guards/host.d.ts +8 -0
  257. package/dist/guards/host.js +10 -0
  258. package/dist/guards/invocation-parser.d.ts +66 -0
  259. package/dist/guards/invocation-parser.js +595 -0
  260. package/dist/guards/local-identity.d.ts +44 -0
  261. package/dist/guards/local-identity.js +129 -0
  262. package/dist/guards/policy-change.d.ts +43 -0
  263. package/dist/guards/policy-change.js +159 -0
  264. package/dist/guards/policy-pin.d.ts +13 -0
  265. package/dist/guards/policy-pin.js +177 -0
  266. package/dist/guards/protected-locations.d.ts +62 -0
  267. package/dist/guards/protected-locations.js +461 -0
  268. package/dist/guards/read-only.d.ts +37 -0
  269. package/dist/guards/read-only.js +315 -0
  270. package/dist/init/command.d.ts +41 -0
  271. package/dist/init/command.js +330 -0
  272. package/dist/init/derive.d.ts +53 -0
  273. package/dist/init/derive.js +819 -0
  274. package/dist/init/draft.d.ts +140 -0
  275. package/dist/init/draft.js +1228 -0
  276. package/dist/init/render.d.ts +47 -0
  277. package/dist/init/render.js +104 -0
  278. package/dist/init/scaffold.d.ts +53 -0
  279. package/dist/init/scaffold.js +121 -0
  280. package/dist/invocation.d.ts +13 -0
  281. package/dist/invocation.js +20 -0
  282. package/dist/package-metadata.d.ts +9 -0
  283. package/dist/package-metadata.js +19 -0
  284. package/dist/readiness.d.ts +53 -0
  285. package/dist/readiness.js +88 -0
  286. package/dist/references/named.d.ts +24 -0
  287. package/dist/references/named.js +27 -0
  288. package/dist/refusal.d.ts +15 -0
  289. package/dist/refusal.js +7 -0
  290. package/dist/registry-derivation.d.ts +31 -0
  291. package/dist/registry-derivation.js +32 -0
  292. package/dist/registry-resolve/command.d.ts +47 -0
  293. package/dist/registry-resolve/command.js +226 -0
  294. package/dist/registry-resolve/registry.d.ts +68 -0
  295. package/dist/registry-resolve/registry.js +292 -0
  296. package/dist/registry-resolve/render-shell.d.ts +18 -0
  297. package/dist/registry-resolve/render-shell.js +36 -0
  298. package/dist/repair.d.ts +29 -0
  299. package/dist/repair.js +8 -0
  300. package/dist/repository-path.d.ts +9 -0
  301. package/dist/repository-path.js +16 -0
  302. package/dist/schema-json.d.ts +1 -0
  303. package/dist/schema-json.js +177 -0
  304. package/dist/schema.d.ts +1289 -0
  305. package/dist/schema.js +985 -0
  306. package/dist/setup/command.d.ts +4 -0
  307. package/dist/setup/command.js +4 -0
  308. package/dist/sha256.d.ts +1 -0
  309. package/dist/sha256.js +4 -0
  310. package/dist/surfaces/adoption.d.ts +41 -0
  311. package/dist/surfaces/adoption.js +217 -0
  312. package/dist/surfaces/consumer-instructions.d.ts +20 -0
  313. package/dist/surfaces/consumer-instructions.js +43 -0
  314. package/dist/surfaces/contract.d.ts +42 -0
  315. package/dist/surfaces/contract.js +169 -0
  316. package/dist/surfaces/core-declarations.d.ts +24 -0
  317. package/dist/surfaces/core-declarations.js +79 -0
  318. package/dist/surfaces/development-markers.d.ts +1 -0
  319. package/dist/surfaces/development-markers.js +18 -0
  320. package/dist/surfaces/generator-adapter.d.ts +71 -0
  321. package/dist/surfaces/generator-adapter.js +809 -0
  322. package/dist/surfaces/harness-registry.d.ts +260 -0
  323. package/dist/surfaces/harness-registry.js +146 -0
  324. package/dist/surfaces/mcp.d.ts +145 -0
  325. package/dist/surfaces/mcp.js +349 -0
  326. package/dist/surfaces/merge.d.ts +30 -0
  327. package/dist/surfaces/merge.js +105 -0
  328. package/dist/surfaces/ownership.d.ts +190 -0
  329. package/dist/surfaces/ownership.js +795 -0
  330. package/dist/surfaces/projection.d.ts +136 -0
  331. package/dist/surfaces/projection.js +716 -0
  332. package/dist/surfaces/render.d.ts +79 -0
  333. package/dist/surfaces/render.js +636 -0
  334. package/dist/surfaces/restrictions.d.ts +130 -0
  335. package/dist/surfaces/restrictions.js +447 -0
  336. package/dist/surfaces/selftest.d.ts +162 -0
  337. package/dist/surfaces/selftest.js +393 -0
  338. package/dist/surfaces/skill-contract.d.ts +85 -0
  339. package/dist/surfaces/skill-contract.js +449 -0
  340. package/dist/surfaces/sync.d.ts +57 -0
  341. package/dist/surfaces/sync.js +164 -0
  342. package/dist/team-metadata.d.ts +41 -0
  343. package/dist/team-metadata.js +513 -0
  344. package/dist/testing/gates.d.ts +91 -0
  345. package/dist/testing/gates.js +182 -0
  346. package/dist/testing/hooks.d.ts +59 -0
  347. package/dist/testing/hooks.js +139 -0
  348. package/dist/testing/test-protection.d.ts +34 -0
  349. package/dist/testing/test-protection.js +137 -0
  350. package/dist/testing/verdict.d.ts +29 -0
  351. package/dist/testing/verdict.js +62 -0
  352. package/dist/testing/weakening.d.ts +15 -0
  353. package/dist/testing/weakening.js +30 -0
  354. package/dist/work-orders/application-closure.d.ts +7 -0
  355. package/dist/work-orders/application-closure.js +76 -0
  356. package/dist/work-orders/application-context.d.ts +162 -0
  357. package/dist/work-orders/application-context.js +137 -0
  358. package/dist/work-orders/application-decisions.d.ts +27 -0
  359. package/dist/work-orders/application-decisions.js +121 -0
  360. package/dist/work-orders/application-grading.d.ts +11 -0
  361. package/dist/work-orders/application-grading.js +212 -0
  362. package/dist/work-orders/application.d.ts +6 -0
  363. package/dist/work-orders/application.js +223 -0
  364. package/dist/work-orders/composition.d.ts +101 -0
  365. package/dist/work-orders/composition.js +1202 -0
  366. package/dist/work-orders/contract.d.ts +77 -0
  367. package/dist/work-orders/contract.js +140 -0
  368. package/dist/work-orders/decisions.d.ts +23 -0
  369. package/dist/work-orders/decisions.js +55 -0
  370. package/dist/work-orders/store.d.ts +207 -0
  371. package/dist/work-orders/store.js +291 -0
  372. package/docs/README.md +68 -0
  373. package/docs/architecture.md +136 -0
  374. package/docs/capability-matrix.md +58 -0
  375. package/docs/cli-reference.md +807 -0
  376. package/docs/command-list.md +62 -0
  377. package/docs/compose-patterns.md +99 -0
  378. package/docs/concepts.md +173 -0
  379. package/docs/configuration-essentials.md +177 -0
  380. package/docs/configuration-reference.md +636 -0
  381. package/docs/docs-check.md +76 -0
  382. package/docs/environment.md +948 -0
  383. package/docs/extending.md +43 -0
  384. package/docs/faq.md +113 -0
  385. package/docs/getting-started.md +692 -0
  386. package/docs/harness-surfaces.md +500 -0
  387. package/docs/joining-a-team.md +76 -0
  388. package/docs/release-policy.md +49 -0
  389. package/docs/safety-and-autonomy.md +463 -0
  390. package/docs/troubleshooting.md +382 -0
  391. package/docs/tutorial.md +171 -0
  392. package/docs/work-and-browser.md +420 -0
  393. package/libexec/browser-operation.cjs +270 -0
  394. package/libexec/fence-marker.cjs +101 -0
  395. package/libexec/fence-marker.d.cts +24 -0
  396. package/libexec/fenced-group-runner.cjs +77 -0
  397. package/libexec/fenced-supervisor.cjs +137 -0
  398. package/libexec/generated-filesystem.cjs +731 -0
  399. package/libexec/install-filesystem.cjs +225 -0
  400. package/libexec/rulesync-generator.NOTICE.md +1112 -0
  401. package/libexec/rulesync-generator.cjs +743 -0
  402. package/libexec/surface-generator-worker.cjs +266 -0
  403. package/libexec/surface-output-reader.cjs +99 -0
  404. package/libexec/surface-scratch-cleanup.cjs +14 -0
  405. package/libexec/validate-harness-evidence.d.mts +183 -0
  406. package/libexec/validate-harness-evidence.mjs +1312 -0
  407. package/package.json +74 -4
  408. package/surfaces/README.md +33 -0
  409. package/surfaces/agents/evaluator.agent.md +76 -0
  410. package/surfaces/guards/bash-guard.sh +48 -0
  411. package/surfaces/guards/claude.adapter.json +25 -0
  412. package/surfaces/guards/codex.adapter.json +24 -0
  413. package/surfaces/guards/opencode.adapter.json +25 -0
  414. package/surfaces/references/browser.md +63 -0
  415. package/surfaces/references/test-data-and-personas.md +84 -0
  416. package/surfaces/references/testing-tiers.md +11 -0
  417. package/surfaces/skills/cockpit-browser.skill.md +59 -0
  418. package/surfaces/skills/cockpit-explain.skill.md +32 -0
  419. package/surfaces/skills/cockpit-fix.skill.md +37 -0
  420. package/surfaces/skills/cockpit-setup.skill.md +39 -0
  421. package/surfaces/skills/cockpit-work.skill.md +34 -0
  422. package/surfaces/skills/collection.json +5 -0
  423. package/surfaces/skills/procedures/explain.md +66 -0
  424. package/surfaces/skills/procedures/fix.md +95 -0
  425. package/surfaces/skills/procedures/setup.md +452 -0
  426. package/surfaces/skills/procedures/work.md +134 -0
@@ -0,0 +1,463 @@
1
+ # Safety and autonomy
2
+
3
+ This page is for people reviewing the controls cockpit generates and for agents working within
4
+ them. It says what the guard allows, asks about, denies or cannot evaluate, and why. A permission
5
+ always applies to one exact command and declared resources, never a whole command family.
6
+
7
+ The [command table](https://github.com/b0dea/cockpit/blob/main/packages/cockpit/src/command-table.ts) and
8
+ [guard evaluator](https://github.com/b0dea/cockpit/blob/main/packages/cockpit/src/guards/evaluator.ts) own these decisions; the generated
9
+ [CLI reference](cli-reference.md), [command list](command-list.md) and
10
+ [configuration reference](configuration-reference.md) describe their public inputs.
11
+
12
+ ## Outcome vocabulary
13
+
14
+ | Outcome | Meaning |
15
+ | --- | --- |
16
+ | `allow` | Evaluation completed without a harder boundary; executable invocations match exact permitted profiles or the built-in read-only profile. |
17
+ | `ask` | A person must decide. An `ask` result permits nothing by itself. |
18
+ | `deny` | A hard boundary forbids the request, even with an exact grant. |
19
+ | `unavailable` | Cockpit could not verify or safely evaluate the request, so it permits nothing. |
20
+
21
+ The evaluator scans the whole captured command for hard denials before returning `unavailable` or
22
+ `ask`, so a softer result found earlier cannot hide a later forbidden operation. Malformed input or
23
+ an incomplete policy is `unavailable` before that scan can begin.
24
+
25
+ ## Cockpit and project commands
26
+
27
+ A cockpit command is allowed only when it matches an exact available public command profile. The
28
+ application verifies the executable and working root; the command resolver checks the bounded
29
+ complete argument vector, resolved configuration path, declared services, permitted option roles
30
+ and inspected paths. Internal guard transport and public commands marked unavailable are excluded.
31
+ The command after `session --` or `exec --` is judged as one more invocation, so neither admits
32
+ what the guard would refuse on its own. `exec` runs it in a product container whose files the
33
+ guard cannot see, so a read-only proof about host paths does not carry over: the name-based
34
+ denials (`.env*` and the rest) still apply to it, and it is admitted only by a `[guards] allow`
35
+ rule or as a declared build or test command; otherwise it asks, which Codex and OpenCode turn into
36
+ a denial. Declared project build and test commands are allowed only as their exact argument vectors in their
37
+ own checkout. A wildcard over a command family never grants permission.
38
+
39
+ ## Hard controls and prompts
40
+
41
+ Evaluation runs in this order: built-in hard denials, declared denials, checks cockpit could not
42
+ complete, declared allows, the built-in read-only profile, then `ask`. A declared allow therefore
43
+ cannot bypass any boundary below.
44
+
45
+ ### Instances, secrets and hosted endpoints
46
+
47
+ The guard denies mutation or staging of a declared environment instance, and mutation below a
48
+ secrets directory. That covers command and patch removals as well as writes, removing a directory
49
+ that contains an instance or the secrets directory, and staging a containing directory that could
50
+ include an instance.
51
+
52
+ Every `.env` and `.env.*` file at any depth is treated as holding secrets, declared or not: reading,
53
+ writing, removing, staging or linking one is a hard denial through every guarded tool. The
54
+ conventional documentation names `.env.example`, `.env.sample`, `.env.template` and `.env.schema`
55
+ are exempt, and so is every declared environment `template`. The refusal says what to do instead:
56
+ run what needs the values as `varlock run -- <cmd>`, which never prints them, or read the variable
57
+ names from the `.env.schema`. Another name that starts with `.env`, such as `.envrc`, is not denied,
58
+ but reading it prompts.
59
+
60
+ Executable use of a declared hosted database or vendor host is denied at hostname boundaries.
61
+ Matching examines executable, argument and environment-assignment-value roles; redirects,
62
+ heredocs, comments and definitions do not count as executable host use. Host names are compared
63
+ after Unicode compatibility normalization, so fullwidth letters and ideographic full stops, which
64
+ resolvers fold to ASCII, do not hide a declared host.
65
+
66
+ ### Configuration, Git and guard controls
67
+
68
+ Every guarded call reads the configuration file and
69
+ `.cockpit/generated-environment-ownership.json`, so losing either holds the agent until a human
70
+ restores it. Deleting, renaming, truncating, relinking or making either unreadable is a hard
71
+ denial, and so is removing a directory that contains either. The guard recognises this through
72
+ `rm`, `unlink`, `mv`, `git rm`, `git mv`, `find -delete`, `truncate`, `git archive` output,
73
+ truncating `dd` or `tee` writes, `ln` onto either file, a `chmod` mode that drops the owner's read
74
+ permission or is copied with `--reference`, a patch delete or move, a Write tool call with empty
75
+ content, and a `>` redirect. Editing the configuration in place stays permitted, including bounded
76
+ `dd conv=notrunc` and `tee` append forms under the normal write checks; the edit takes effect only
77
+ after `sync` runs, and only a person's sync applies an edit that
78
+ [widens what agents may do](#edits-the-guard-has-not-applied).
79
+
80
+ Writing anywhere under a `.git` directory is a hard denial, because Git configuration chooses
81
+ programs that read-only Git commands run. For the same reason, so is every `git config` form other
82
+ than a proven read (`--get`, `--get-all`, `--get-regexp`, `--list`, `get`, `list`, or a lone
83
+ `section.key`), whatever its scope: a global `core.pager` or `core.hooksPath` reaches every
84
+ repository.
85
+
86
+ Removing, renaming or directly overwriting a guard control is a hard denial, as is removing a
87
+ directory that contains one or an executable control below a protected plugin directory. Otherwise
88
+ an exact command allow could disable a hook, or change a program a harness starts, before the next
89
+ guarded call. The protected files include every harness's native MCP and permission outputs derived
90
+ from the shipped harness registry, the MCP wrapper scripts under `.cockpit/mcp/` that those
91
+ outputs start, the work-order records under `.cockpit/work-orders/`, which carry no key, so one an
92
+ agent wrote would read as a person's to the next `cockpit work` command, and `.cockpit/policy.json`,
93
+ the [autonomy policy](#who-decides) the last sync accepted. This boundary follows folded path
94
+ spellings and verified filesystem identities, so alternate case and aliases do not bypass it.
95
+
96
+ The installed code the guard runs is a control too. The guard checks its entry point's digest, but
97
+ an edited module it loads could turn every hard denial into an allow. So these are hard denials:
98
+
99
+ - writing, linking, changing the mode of, or removing anything inside the running cockpit package
100
+ or any package it loads, under both its installed path and its real path, or removing a
101
+ directory that contains one;
102
+ - writing into any `node_modules/.bin` directory of a configured root, where package scripts and
103
+ `npx` find their commands;
104
+ - creating, replacing or linking a file directly inside a directory on the harness's command
105
+ search path (`PATH`) that lies within a configured root, where a planted `ls`, `git` or `rg`
106
+ would run in place of a permitted read-only command.
107
+
108
+ Only absolute search path entries can be protected: a relative entry such as `.`, `./node_modules/.bin`
109
+ or an empty one names whatever directory a command runs in, so a file the agent wrote anywhere could
110
+ run in place of a permitted command, or as the interpreter a path-spelled script such as
111
+ `./node_modules/.bin/cockpit` starts through `#!/usr/bin/env node`. While the harness's `PATH` holds
112
+ one, no command is allowed without a prompt, whatever profile or declared rule matches it, and the
113
+ reason names the entry. Keep relative entries off the `PATH` an agent harness starts with; `doctor`
114
+ reports one in the `PATH` it runs with as `GUARD_SEARCH_PATH_RELATIVE`.
115
+
116
+ The Claude Code registration includes `NotebookEdit`, so notebook cell changes get the same
117
+ protected-path checks as text edits. For a configuration in a repository subdirectory, these
118
+ controls belong to the configuration's directory. Start Codex in that directory: its generated hook
119
+ resolves the guard from the canonical session directory, not from an enclosing Git repository.
120
+ Generating a hook does not establish that the harness runs it; see
121
+ [Capability states](harness-surfaces.md#capability-states).
122
+
123
+ ### Destinations, sources and links
124
+
125
+ The evaluator resolves visible destinations for bounded `cp`, `install`, `mv`, `ln`, `git mv`,
126
+ `git archive`, `tee`, `dd`, `touch`, `truncate` and `chmod` forms, and the destination of bounded
127
+ `tar` extraction forms. Git paths use the directory selected by `git -C`. Extraction without an
128
+ explicit destination writes to the invocation's working directory. Visible source files for bounded
129
+ `cp`, `install`, `dd` and `tar` forms get the same protected read check as built-in read-only
130
+ commands.
131
+
132
+ A hard or symbolic `ln` whose target is, contains or lies inside a secrets directory, a declared
133
+ instance, a guard control or the installed cockpit is a hard denial, because the link would reach
134
+ it under a name the guard does not protect. A symbolic link's target is checked from both the
135
+ working directory and the link's own directory.
136
+
137
+ These are `unavailable`: every unsupported `tar` or `ln` mode or option, and a command whose
138
+ visible operand names a control, a protected plugin subtree or a directory containing either
139
+ and that the guard cannot classify. These checks run before declared allows. They do not inspect archive
140
+ member paths or the bodies of approved scripts, and classifying an extraction directory does not
141
+ prove that an archive cannot traverse outside it. An exact command rule permits that command; it is
142
+ not a filesystem sandbox. To restore or intentionally replace generated controls, stop the guarded
143
+ session and have a human run `cockpit sync --config cockpit.toml` in a terminal.
144
+
145
+ ### Protected branches and prompts
146
+
147
+ Pushes to declared protected branches are hard denials, including explicit protected destinations
148
+ and `git push --all` or `git push --mirror` when protected branches are declared. Missing or
149
+ unresolved destinations, including ambiguous source-only revisions, symbolic aliases and wildcards,
150
+ need a human decision. An exact grant cannot override either boundary.
151
+
152
+ These produce `ask`: unresolved Git execution context, destructive Git reset or clean forms,
153
+ staging by explicit path (a person approves or runs it), staging without explicit paths, wrapped or environment-modifying commands, unmatched invocation
154
+ profiles, and any removal without a grant. An explicit removal outside configured roots stays at
155
+ `ask` even when a declared allow matches, because cockpit cannot verify a target outside the roots
156
+ it manages; review the exact path and approve it, or move the work under a configured root. `git add -A`, `git add .` or a
157
+ directory operand that covers a secrets directory or an environment instance is a hard denial:
158
+ stage the changed files by name. Unsupported staging options or unproven pathspec grammar produce
159
+ `unavailable`. Any other refused command gets an `ask` that names the command and gives three ways
160
+ forward: a person approves it, a person runs it in a terminal, or a person admits it under
161
+ `[guards] allow`; for tests it points to `cockpit test-run`.
162
+
163
+ ### Declared rules
164
+
165
+ Declared rules refine the final prompt boundary. Each vector starts with the executable.
166
+ `[[guards.deny]]` matches a command-vector prefix or a contiguous command-vector sequence and may
167
+ name a safe fix. `[[guards.allow]]` matches a command-vector prefix, optionally only at one
168
+ checkout-relative working directory. An allow cannot bypass a hosted endpoint, protected branch,
169
+ secret path, malformed capture or unavailable filesystem evidence. Wrapped and
170
+ environment-modifying invocations are never allowed by a declared rule, because wrappers can change
171
+ which program actually runs. A rule that admits an interpreter, such as `["node"]`, `["python3"]` or
172
+ `["perl"]`, admits whatever code it is given, inline (`node -e`) or in a file, and the guard cannot
173
+ see what that code writes, guard controls included; without such a rule those invocations ask.
174
+
175
+ Malformed or oversized input, incomplete policy, escaped or symlinked path evidence, inspection
176
+ failure and exceeded limits produce `unavailable`. The
177
+ [invocation parser](https://github.com/b0dea/cockpit/blob/main/packages/cockpit/src/guards/invocation-parser.ts) captures bounded input
178
+ once; the evaluator accepts only input that parser produced, so a hand-built lookalike is refused.
179
+
180
+ ### Read-only commands
181
+
182
+ A built-in read-only profile lets agents inspect the checkout without a prompt, which matters most
183
+ on Codex and OpenCode, where a prompt becomes a denial. It covers exact argument shapes of `ls`,
184
+ `pwd`, `cat`, `head`, `tail`, `wc`, `rg`, `grep`, `fd`, `find`, `echo`, `printf`, `sed`,
185
+ `git status`, `git diff`, `git log`, `git show`, `git rev-parse`, `git branch` listing flags, and the
186
+ cockpit commands in
187
+ [Cockpit commands an agent can run](#cockpit-commands-an-agent-can-run). The
188
+ [read-only profile](https://github.com/b0dea/cockpit/blob/main/packages/cockpit/src/guards/read-only.ts) lists each permitted option.
189
+
190
+ - Any other option falls back to the ordinary rules, including options that run programs or write
191
+ files: `rg --pre`, `find -exec`, `find -delete`, `fd --exec`, `git -c`, `git --output`,
192
+ `git --ext-diff` and `git diff --no-index`.
193
+ - Options whose value is optional, such as `grep --context` on macOS, are accepted only in their
194
+ attached `--option=value` form, so the next word can never be misread.
195
+ - `printf` is read-only only without options, because `printf -v` assigns a variable. `sed` only
196
+ prints: `sed -n '5p'` or `sed -n '1,$p'` with numeric or `$` addresses and the `p` command, since
197
+ other commands can write or run programs. `git rev-parse` is read-only except `--git-path`,
198
+ `--resolve-git-dir`, `--parseopt` and `--sq-quote`. `git branch` is read-only with no argument or
199
+ with `--list`, `-a`, `-r`, `-v`, `-vv` or `--show-current` (and their long forms), never with a
200
+ branch name.
201
+ - `$?` is allowed as an argument only to a read-only command, where it cannot name a path, and
202
+ never as the directory of `env -C`.
203
+ - A command may follow `cd ./dir`, `cd ../dir` or `cd /abs/dir` joined by `&&` or `;`, with the
204
+ directory then judged as the command's working directory. A bare `cd name` is refused, because
205
+ `CDPATH` can send it elsewhere the guard cannot see: write `cd ./name`, or use `git -C name` for
206
+ Git. A `..` after a directory name, as in `cd ./a/../b` or `env -C a/..`, is refused too: `env`
207
+ resolves it from wherever a link named `a` leads, and so does a shell set to follow links.
208
+ `pushd`, `popd` and zsh's `chdir` are refused, because only `cd` is followed. A `cd`
209
+ may fail, and one after `||` may not run at all, so each later command is judged from every
210
+ directory it may run in: `&&` and `||` group left to right, so in `pwd || cd ./dir && cat x` the
211
+ `cat` is judged from both directories. A newline after `&&`, `||` or `|` continues the list. A
212
+ `cd` in a pipeline is refused, and a list ending in `&` runs in a subshell, so its `cd` moves no
213
+ later command.
214
+ - Git runs read-only only in a directory with its own `.git`, because Git otherwise treats a
215
+ directory holding `HEAD`, `objects` and `refs` as a repository and honours its configuration.
216
+ Git operands are inspected as files whose content may be printed.
217
+ - `rg` is read-only only when `RIPGREP_CONFIG_PATH` is absent, because an ambient ripgrep
218
+ configuration can inject options such as a preprocessor. Its `-g`, `--glob` and `--iglob` are
219
+ read-only only as `!` exclusions: any other glob overrides the hidden and ignore filters, so
220
+ `rg -g '.env*'` would print a hidden environment file.
221
+ - A pipeline or chain is permitted only when every segment is. Redirecting output to `/dev/null`,
222
+ `/dev/stdout` or `/dev/stderr`, or input from `/dev/null`, touches no file and does not change the
223
+ decision.
224
+
225
+ ### Cockpit commands an agent can run
226
+
227
+ | Command | Decision | Why |
228
+ | --- | --- | --- |
229
+ | `npx --no cockpit check --config cockpit.toml`, and likewise `doctor`, `preflight`, `ps`, `logs --service <service>`, `stacks`, `stacks prune`, `docs check` and `sync --dry-run` | allowed | They read and report; nothing they do changes a file the guard relies on. |
230
+ | `npx --no -- cockpit --help`, `npx --no cockpit up --help`, and the version | allowed | They print and exit before any command runs. |
231
+ | `npx --no cockpit up --config cockpit.toml`, and likewise `sleep`, `down`, `restart --service <service>` and `rebuild --service <service>` | allowed | They act only on the stack cockpit declared and owns; `down` keeps data volumes, and deletes only from the local Docker daemon it fixes at the start of the run. |
232
+ | `up --profile <profile>` | allowed for a profile in `environment.profiles` that mounts no sibling with `gate = "operator"`, otherwise a prompt | Another profile starts services no person declared for agents, and an operator-gated sibling touches live data or local hardware. |
233
+ | `npx --no cockpit exec --config cockpit.toml --service <service> -- <command>` | allowed when a `[guards] allow` rule or a declared build or test command admits `<command>`, otherwise a prompt | The command runs in a container whose files the guard cannot see, so it is never proven read-only, and the name-based denials still apply to it. |
234
+ | `npx --no cockpit pull --config cockpit.toml` | allowed | It only fetches and fast-forwards, and leaves a modified or diverged checkout as it was. |
235
+ | `npx --no cockpit use <slug> <checkout> --config cockpit.toml`, and `use <slug> --clear` | allowed for a checkout inside a directory the agent may already write, otherwise a prompt | The choice is recorded for this checkout of the cockpit only, so it never widens what the agent can reach. |
236
+ | `npx --no cockpit runtime measure --config cockpit.toml --image <local-image>` | allowed | The probe runs a disposable stack under its own project, removes it, and records the result only in this machine's git-ignored state; `cockpit.toml` never changes. |
237
+ | `npx --no cockpit session --config cockpit.toml -- <command>`, with a `--profile` that `up` admits | the decision for `<command>` | A session runs its command as the agent could run it directly, so it never admits more. |
238
+ | `npx --no cockpit test-run --config cockpit.toml --gate <gate>`, with an optional `--mode` and a `--select <kind>:<value>` whose value does not start with `-` | allowed for a gate `cockpit.toml` declares | The gate runs only the stages a person declared in the reviewed configuration, the trust `up` already has. |
239
+ | `npx --no cockpit work status --config cockpit.toml`, `work accept`, `work check`, `work note`, `work decide`, `work answer`, `work acknowledge`, `work grade`, `work signoff`, `work recover` (with or without `--apply`), `work verify` and `cockpit grade --criteria <file>`, each with its own options | allowed | They report, or take a step [`[work.gates]`](#who-decides) gives the agent; a step it gives a person waits for the digest typed after `--interactive`, which no agent invocation carries. Grading runs in a separate evaluator. `work recover --apply` removes a lock only once it has shown the holder gone on the lock's own host and among the containers cockpit labels. |
240
+ | `npx --no cockpit sync --config cockpit.toml`, and `upgrade`, whose sync child writes | allowed where `[autonomy] sync = "agent"`, otherwise a prompt | It regenerates the files the configuration declares; after `cockpit.toml` changes, the guard admits it only when the edit [does not widen](#edits-the-guard-has-not-applied) what agents may do, so an agent's sync never publishes a widening of its own. |
241
+ | `npx --no cockpit tool add <tool> --config cockpit.toml`, with an optional `--dry-run` | allowed | It edits only `[surfaces] tools`, and an added tool [does not widen](#edits-the-guard-has-not-applied) what agents may do, so the agent's sync applies it. |
242
+ | `npx --no cockpit reset --config cockpit.toml --apply` | allowed where `[autonomy] reset = "agent"`, otherwise a prompt | It deletes stack data. |
243
+ | `npx --no cockpit stacks prune --config cockpit.toml --apply` | allowed; the command itself refuses a prune that deletes volumes unless `[autonomy] reset = "agent"` | It removes only stacks whose checkout is gone, which bringing the stack up again recreates, and their data only where a reset could delete it. |
244
+ | `npx --no cockpit browser drive --config cockpit.toml`, and likewise `screenshot`, with an optional `--role` | allowed where `browser.request_preapproval` is on, otherwise a prompt | They sign in and capture the declared application, so they run unprompted only on the isolated, non-production data the configuration declares. Preapproval is on by default exactly when `browser.data` is isolated, not restored and not reaching production, and off otherwise; an explicit `request_preapproval` wins, and `true` on a posture that does not qualify is refused. `drive` also accepts `--fail-on-findings`. |
245
+ | `work accept`, `work answer`, `work acknowledge` and `work signoff` with `--interactive` | a prompt, which Codex and OpenCode turn into a denial | `--interactive` asks for a person at a terminal to type the digest of what it shows. |
246
+ | `sync --adopt`, `sync --interactive`, `reset --interactive`, `stacks prune --interactive`, `sibling add`, `sibling remove`, `tool remove` and every other command | a prompt, which Codex and OpenCode turn into a denial | They widen what agents may do through `cockpit.toml`, rewrite a team's own settings, ask for a person, or delete data. |
247
+
248
+ A file such a command names, like `--criteria`, is checked as a read:
249
+ the command may quote it in a refusal. A declared instance, a file below `.secrets` or a `.env` or
250
+ `.env.*` file that is not documentation is denied, and a symlink or a path outside the configured
251
+ roots prompts.
252
+
253
+ "Allowed" means the guard does not object. Claude Code also needs its own allow rule, which the
254
+ generated settings carry for the commands the shipped skills use
255
+ ([Claude Code command rules](harness-surfaces.md#claude-code-command-rules)); in Codex's sandbox
256
+ most of these commands must run outside it
257
+ ([Run cockpit outside the Codex sandbox](harness-surfaces.md#run-cockpit-outside-the-codex-sandbox)).
258
+
259
+ Run these exactly as shown. A prefix such as `env -u NAME` or `nohup` makes any of them a wrapped
260
+ invocation, which prompts, and none needs one: `down`, `reset` and `runtime measure` choose their
261
+ Docker daemon themselves, as [Choose the Docker daemon](environment.md#choose-the-docker-daemon)
262
+ describes.
263
+
264
+ These count from the cockpit root with `--config` naming the configured `cockpit.toml`; `check`,
265
+ `doctor` and help also count from any directory. Each spelling counts only where the guard proves
266
+ it starts its own installed package:
267
+
268
+ - a path such as `./node_modules/.bin/cockpit`, or one given to `node`, must resolve to it;
269
+ - bare `cockpit` must be what the command search path finds first;
270
+ - the npx spellings in the table must run from the cockpit root with no root `.npmrc` and no `bin`
271
+ or `directories.bin` in the root `package.json`, because npm would otherwise run that program or
272
+ apply that configuration first. Writing an `.npmrc` anywhere inside the configured roots is
273
+ denied, so one cannot be planted in the same command after that check. Any other npx option, or
274
+ npx without `--no` (which may download a package), is not the installed cockpit.
275
+
276
+ Where npx cannot be proven, every npx spelling prompts, and Codex and OpenCode refuse it, while the
277
+ same command spelled as a path, such as `./node_modules/.bin/cockpit doctor --config cockpit.toml`,
278
+ still counts from the cockpit root.
279
+ `doctor` reports this as `COCKPIT_LAUNCHER_UNPROVEN`, using the guard's own check, and names which
280
+ spelling it can prove. The guard does not check which `npx` the command search path finds: it
281
+ assumes that program behaves as npm's own, as the version-manager and package-firewall shims that
282
+ hand over to npm do.
283
+
284
+ ### Reading secrets and instances
285
+
286
+ Every hard denial still applies first. Reading a declared instance, a `.env` or `.env.*` file that
287
+ is not documentation, or anything under a `.secrets` directory is denied under every spelling that resolves to it, including a case-folded spelling of
288
+ the checkout itself, and so is a recursive search rooted at or below one. Shell reads also compare
289
+ filesystem identity: a hard link to a declared instance, or to any file in the cockpit's
290
+ `env/.secrets` directory, is denied like the file itself. The guard enumerates that directory on
291
+ every call, up to 512 entries; above that bound every content read falls back to a prompt rather
292
+ than going unchecked. A hard link to a file in any other `.secrets` directory is recognised only by
293
+ its spelling.
294
+
295
+ These reads fall back to a prompt instead of being allowed:
296
+
297
+ - a recursive search, whenever a declared instance or an `env/.secrets` file has a second hard link
298
+ anywhere;
299
+ - a search whose tree contains an existing instance, a `.secrets` directory at any depth, or a
300
+ `.env*` file that is neither a declared template nor one of the documentation names, since `grep -r` reads every file below it. The guard
301
+ walks each searched tree to find them, without following links, and a tree too large for its
302
+ bounded walk is not searched either. The reason names the path, so the agent can search a
303
+ narrower one;
304
+ - an `rg` search that would read one. ripgrep skips what Git ignores, so the guard asks Git, with
305
+ the guard's own Git executable, which files the enclosing repository does not ignore, and a
306
+ gitignored `.env` or `node_modules` does not block it. Only `.gitignore` files are applied, and
307
+ hidden files count, because a type such as `rg -t sh` reads a `.env`. Where Git's list cannot stand
308
+ for ripgrep's (outside a repository, with an `.ignore` or `.rgignore` file in or above the tree,
309
+ through a nested repository or submodule, below a `.git` or `.jj` entry, above which ripgrep stops
310
+ applying ignore files, when the search names an ignored path, when a `.gitignore` Git reads holds
311
+ a line the two glob engines may read differently, such as braces, a POSIX class like `[[:alpha:]]`,
312
+ a backslash escape, trailing whitespace, a `**` that is not a whole path component, or bytes that
313
+ are not UTF-8, or when Git does not answer), the
314
+ search is walked like `grep -r`. Either way the guard sees only what exists before the call runs, so a
315
+ recursive search is allowed only when every other command in the call is read-only too, and
316
+ nothing in it can write an environment file first;
317
+ - `git diff`, `git show`, and `git log` with patch output, whenever the repository's index holds a
318
+ `.env*` file that is neither a declared template nor a documentation name, a file below a
319
+ `.secrets` directory or a declared instance, unless the command names no revision and is limited with `-- <path>` to paths that hold
320
+ none (`git log` may name revisions, but not `--full-diff`). `--check` counts as printing content,
321
+ and `git log -L<range>:<path>` is not read-only. A revision may name a blob, which prints whatever pathspec
322
+ follows. Only the index is asked: a file committed once and since removed from it is still in
323
+ history, and `git log -p` prints it. Run `git rm --cached` and rotate what it held;
324
+ - a path that is a symlink or leaves one through `..`, lies outside the configured roots, or has
325
+ another `.env*` name, such as `.envrc`. A declared environment `template` and the documentation
326
+ names are read like any other file.
327
+
328
+ The guard hook sees shell commands and edits only. Claude Code's own Read, Grep and Glob tools never
329
+ reach it, so `sync` also writes Claude `Read` deny rules into `.claude/settings.json`: one for every
330
+ `.env` and every `.env.*` file, one for every `.secrets` directory and one for every declared instance
331
+ of every sibling, whether or not the
332
+ sibling is mounted or granted to Claude. A sibling instance's rule is anchored on the path below the
333
+ sibling's parent, so the committed file is identical on every clone; it can match more than the
334
+ instance (any file with the same sibling-relative suffix), never less. An instance in the cockpit
335
+ root itself is anchored at the project root. These rules match path spellings only: Claude's native
336
+ tools cannot see filesystem identity, so a hard link or a symbolic link to an instance or secrets
337
+ file, under a name outside the rules, stays readable to them. The guard's identity checks cover
338
+ shell commands only. Claude applies a deny rule before any allow, so the `.env.*` rule cannot exempt
339
+ the documentation names: Claude's own tools refuse `.env.example`, `.env.schema` and declared
340
+ templates too, which `cat` in a shell still reads.
341
+
342
+ ## Who decides
343
+
344
+ `[autonomy]` and `[work.gates]` in `cockpit.toml` say who takes each decision cockpit gates: `agent`,
345
+ `person` or `ci`. Every field defaults to `agent` except `reset` and `mcp_approve`, which default to `person`.
346
+ `[work] grading` says how a work order earns done; the work-order fields are described in
347
+ [Who passes each gate](work-and-browser.md#who-passes-each-gate).
348
+
349
+ | Field | Decides | Default |
350
+ | --- | --- | --- |
351
+ | `sync` | whether the guard lets an agent run a writing `sync`; under `ci` a writing sync runs only where `CI` is set | `agent` |
352
+ | `stale_delete` | whether `sync` removes a file it generated before and no longer generates without a person typing the stale-removal digest | `agent` |
353
+ | `reset` | whether `reset --apply`, and a `stacks prune --apply` that deletes volumes, delete stack data without a person; otherwise a person approves the preview with `--interactive` | `person` |
354
+ | `mcp_approve` | `person`: sync enables only the MCP servers whose digest a person recorded in `[mcp.approved]`, and `MCP_NOT_APPROVED` names the rest; `agent`: sync enables every declared server as declared now, which lets an agent start processes outside the guard, because a sibling's MCP source is a file the agent can write and each harness starts an enabled server outside every guard boundary | `person` |
355
+
356
+ <!-- cockpit:ref path=packages/cockpit/src/guards/policy-pin.ts --> The guard pins the policy: an agent's edit, write or patch that would change `[work]`,
357
+ `[work.gates]` or `[autonomy]`, or `[mcp]` while `mcp_approve` is `person`, is a hard denial. It
358
+ applies the edit to the current text and compares the tables, so an edit elsewhere in the file stays
359
+ permitted; an edit it cannot apply exactly, and a shell command that names the file and is not a
360
+ proven read, a Git record or the `--config` operand of a cockpit command, are denied because the guard
361
+ cannot show the tables unchanged. A cockpit session's command after `--` is judged as a command of its
362
+ own, and a path or `node <script>` spelling of cockpit is admitted only where the guard proves it
363
+ starts the installed cockpit. The pin holds only for the
364
+ tool calls the guard inspects.
365
+
366
+ Every writing `sync` records the policy it ran under in `.cockpit/policy.json`. A later sync that finds
367
+ a field weaker than that record, such as a gate moved from `person` to `agent` or grading from
368
+ `independent` to `self`, writes nothing and reports `POLICY_WEAKENING_UNCONFIRMED` with the change and
369
+ its digest; a person runs `sync --interactive`, reads it and types the digest. `check` and `doctor` report
370
+ the same weakening before any sync runs. Until then every work
371
+ command refuses to run under the weaker policy, and so does `reset --apply` when `[autonomy] reset` is
372
+ the weakened field. A stronger policy needs nobody.
373
+
374
+ What no setting relaxes: reads of secrets and declared instances, pushes to protected branches,
375
+ writes to guard controls, and the policy pin. What only a person can do: trust Codex's hooks, trust a
376
+ workspace in Claude Code, and sign in to a secrets provider. `doctor` and `check` report missing
377
+ Codex hook trust as `CODEX_HOOK_UNTRUSTED`; cockpit cannot observe the other two, so a person
378
+ confirms them.
379
+
380
+ A local `person` gate is best-effort: cockpit cannot tell a person from a program driving a terminal.
381
+ `ci` relies on the `CI` variable, which an agent can set too, so locally it is best-effort as well.
382
+ The only enforced human gate is a required CI job behind a protected environment whose reviewers must
383
+ approve it, such as the [`work verify` job](work-and-browser.md#who-passes-each-gate).
384
+
385
+ ### Edits the guard has not applied
386
+
387
+ <!-- cockpit:ref path=packages/cockpit/src/guards/policy-change.ts --> Once `cockpit.toml` differs
388
+ from the configuration the guards were generated from, the guard loads both, the earlier from the
389
+ copy sync keeps in `.cockpit/local/guard-config`, and compares them with defaults applied. An edit that does
390
+ not widen what agents may do holds every tool call except `cockpit sync` and `cockpit check`, which
391
+ the agent may run under the rules above, and the hold says so (`GUARD_CONFIG_UNSYNCED`). Any other
392
+ edit holds every call, that sync included, until a person runs `sync` in a terminal, and the hold
393
+ names each field that widens.
394
+
395
+ An edit does not widen only when every difference is one of these:
396
+
397
+ - descriptive or host-only fields: a sibling's `purpose`, `host_reason` and `rebuild_inputs`,
398
+ `cockpit.guide_cap`, `[ports]`, `environment.entrypoint_derivatives`, `environment.machine` and
399
+ `docs.living`;
400
+ - added agent tools, `unconfirmed` answers and sibling operator gates;
401
+ - removed Compose files, Compose profiles and resettable volumes, and an install policy that admits no
402
+ command it did not.
403
+
404
+ Every other difference widens. That includes any change, in either direction, to `[guards]`,
405
+ `[work]`, `[autonomy]`, `[mcp]`, `[testing]` (whose stages `test-run` runs unprompted) and `[browser]`;
406
+ a new sibling, wherever its directory is; a sibling's changed `dir`, `guides` (sync copies each guide
407
+ into the root `AGENTS.md`), environment files or derived MCP sources; and every command field, such
408
+ as `environment.seed`. A field the classification has no rule for widens too, so a field added to
409
+ the schema is a person's decision until a rule says otherwise. A missing or mismatched
410
+ copy of the generated configuration cannot show an edit safe, so it holds as a widening edit does.
411
+ `check` reports the same classification: `GUARD_CONFIG_UNSYNCED` as a warning, `GUARD_CONFIG_WIDENED`
412
+ as an error naming the fields.
413
+
414
+ Whoever runs it, sync refuses a guide that is, or links to, a `.env` or `.env.*` file, a file below a
415
+ `.secrets` directory or a declared environment instance (`PROJECTION_GUIDE_SECRET`), so a guide never
416
+ copies what the guard keeps from agents into the root `AGENTS.md`.
417
+
418
+ ## Native adapter behavior
419
+
420
+ The [transport and adapter owner](https://github.com/b0dea/cockpit/blob/main/packages/cockpit/src/guards/harness-adapter.ts) translates a
421
+ decision without adding grants or weakening hard boundaries:
422
+
423
+ | Harness | Translation and adapter exit |
424
+ | --- | --- |
425
+ | Claude Code | Allow, ask, and deny exit 0; ask and deny are carried in native decision JSON. |
426
+ | Codex CLI | Ask becomes deny, because Codex hooks have no prompt tier, and a decision a human cannot be shown must not let the call run. Allow and deny exit 0; deny is carried in native decision JSON. |
427
+ | OpenCode | Ask becomes deny, for the same reason: its plugin hook can only throw or continue. Allow exits 0; every non-allow decision exits 2. |
428
+
429
+ Unavailable or malformed decisions exit 2 on every target, so adapter exit 0 alone does not mean
430
+ permission was granted.
431
+
432
+ Guard transport uses a fixed handler argument vector, normalized absolute handler and
433
+ working-directory paths, bounded standard input, and bounded output and error. The
434
+ [transport owner](https://github.com/b0dea/cockpit/blob/main/packages/cockpit/src/guards/harness-adapter.ts) sets a timeout so a stalled
435
+ handler cannot hold a guarded call indefinitely. Copied plans, failed transport, signals, oversized
436
+ output, nonzero handler status and invalid JSON become `unavailable` with exit 2. Lexical path
437
+ normalization in this adapter does not itself verify filesystem identity.
438
+
439
+ If an adapter is unavailable, no target-specific registration or read-only fragment is emitted; the
440
+ shared guard file may still be generated. What each harness is confirmed to enforce, and why
441
+ generated restrictions stay `instructed` until a run of the real tool says otherwise, is in
442
+ [Capability states](harness-surfaces.md#capability-states) and
443
+ [Guard adapters](harness-surfaces.md#guard-adapters).
444
+
445
+ ## Exit codes and generated references
446
+
447
+ Exit codes are listed in the [CLI reference](cli-reference.md). How cockpit records command
448
+ completion and keeps its generated reference pages current is maintainer detail, in the contributor
449
+ page "CLI completion and generated references", reached from [CONTRIBUTING.md](https://github.com/b0dea/cockpit/blob/main/CONTRIBUTING.md).
450
+
451
+ ## Evidence
452
+
453
+ Static configuration, source inspection, synthetic fixtures, model self-report and silence do not
454
+ prove native enforcement. The
455
+ [native evidence validator](https://github.com/b0dea/cockpit/blob/main/packages/cockpit/libexec/validate-harness-evidence.mjs) binds exact
456
+ current executable and wiring identities, generated-manifest and candidate digests, version,
457
+ bounded transcripts and validation results, and each record carries candidate and deliberately
458
+ broken-control evidence.
459
+
460
+ Missing evidence keeps a cell `instructed` or `unavailable`, with `human_needed` judgments still
461
+ pending. It never relaxes a hard denial or grants a permission. Switching defaults, deleting
462
+ fallbacks and publishing stay human decisions; a green source check or a generated reference does
463
+ not make them.