@b00dea/cockpit 0.0.0-bootstrap.0 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +375 -0
- package/LICENSE +21 -0
- package/README.md +21 -1
- package/bin/cockpit.mjs +33 -0
- package/cockpit.schema.json +2574 -0
- package/dist/autonomy.d.ts +44 -0
- package/dist/autonomy.js +156 -0
- package/dist/bounded-read.d.ts +14 -0
- package/dist/bounded-read.js +42 -0
- package/dist/browser/commands.d.ts +62 -0
- package/dist/browser/commands.js +349 -0
- package/dist/browser/package-paths.d.ts +1 -0
- package/dist/browser/package-paths.js +6 -0
- package/dist/browser/proxy.d.ts +22 -0
- package/dist/browser/proxy.js +37 -0
- package/dist/browser/runtime.d.ts +117 -0
- package/dist/browser/runtime.js +183 -0
- package/dist/browser/surfaces.d.ts +141 -0
- package/dist/browser/surfaces.js +556 -0
- package/dist/browser/ui-gate.d.ts +15 -0
- package/dist/browser/ui-gate.js +18 -0
- package/dist/cli-guard.d.ts +5 -0
- package/dist/cli-guard.js +71 -0
- package/dist/cli-main.d.ts +139 -0
- package/dist/cli-main.js +1405 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +16 -0
- package/dist/command-table.d.ts +113 -0
- package/dist/command-table.js +512 -0
- package/dist/config/load.d.ts +171 -0
- package/dist/config/load.js +345 -0
- package/dist/config/sibling-toml.d.ts +48 -0
- package/dist/config/sibling-toml.js +160 -0
- package/dist/config/surface-tools-toml.d.ts +9 -0
- package/dist/config/surface-tools-toml.js +37 -0
- package/dist/config/verified-write.d.ts +43 -0
- package/dist/config/verified-write.js +89 -0
- package/dist/diagnostics.d.ts +26 -0
- package/dist/diagnostics.js +335 -0
- package/dist/emit.d.ts +22 -0
- package/dist/emit.js +43 -0
- package/dist/entrypoint-kinds.d.ts +3 -0
- package/dist/entrypoint-kinds.js +11 -0
- package/dist/environment/application/destructive.d.ts +6 -0
- package/dist/environment/application/destructive.js +425 -0
- package/dist/environment/application/doctor.d.ts +89 -0
- package/dist/environment/application/doctor.js +235 -0
- package/dist/environment/application/guard.d.ts +43 -0
- package/dist/environment/application/guard.js +622 -0
- package/dist/environment/application/health.d.ts +134 -0
- package/dist/environment/application/health.js +379 -0
- package/dist/environment/application/lifecycle-context.d.ts +228 -0
- package/dist/environment/application/lifecycle-context.js +154 -0
- package/dist/environment/application/lifecycle-state.d.ts +25 -0
- package/dist/environment/application/lifecycle-state.js +201 -0
- package/dist/environment/application/lifecycle.d.ts +17 -0
- package/dist/environment/application/lifecycle.js +729 -0
- package/dist/environment/application/logs.d.ts +45 -0
- package/dist/environment/application/logs.js +127 -0
- package/dist/environment/application/setup.d.ts +129 -0
- package/dist/environment/application/setup.js +741 -0
- package/dist/environment/application/shared.d.ts +11 -0
- package/dist/environment/application/shared.js +61 -0
- package/dist/environment/claims.d.ts +389 -0
- package/dist/environment/claims.js +1709 -0
- package/dist/environment/codex-hook-trust.d.ts +11 -0
- package/dist/environment/codex-hook-trust.js +185 -0
- package/dist/environment/compose-environment.d.ts +1 -0
- package/dist/environment/compose-environment.js +6 -0
- package/dist/environment/compose-ownership.d.ts +21 -0
- package/dist/environment/compose-ownership.js +117 -0
- package/dist/environment/compose-topology.d.ts +117 -0
- package/dist/environment/compose-topology.js +413 -0
- package/dist/environment/contract.d.ts +489 -0
- package/dist/environment/contract.js +761 -0
- package/dist/environment/declaration.d.ts +14 -0
- package/dist/environment/declaration.js +39 -0
- package/dist/environment/destructive-composition.d.ts +29 -0
- package/dist/environment/destructive-composition.js +333 -0
- package/dist/environment/docker-daemon.d.ts +30 -0
- package/dist/environment/docker-daemon.js +78 -0
- package/dist/environment/docker-endpoint.d.ts +10 -0
- package/dist/environment/docker-endpoint.js +19 -0
- package/dist/environment/env-schema-observation.d.ts +46 -0
- package/dist/environment/env-schema-observation.js +241 -0
- package/dist/environment/evidence.d.ts +136 -0
- package/dist/environment/evidence.js +437 -0
- package/dist/environment/executable.d.ts +26 -0
- package/dist/environment/executable.js +167 -0
- package/dist/environment/generated-application/authorities.d.ts +5 -0
- package/dist/environment/generated-application/authorities.js +61 -0
- package/dist/environment/generated-application/bootstrap-skill.d.ts +16 -0
- package/dist/environment/generated-application/bootstrap-skill.js +328 -0
- package/dist/environment/generated-application/check.d.ts +13 -0
- package/dist/environment/generated-application/check.js +189 -0
- package/dist/environment/generated-application/custom-surface.d.ts +26 -0
- package/dist/environment/generated-application/custom-surface.js +289 -0
- package/dist/environment/generated-application/prepare.d.ts +29 -0
- package/dist/environment/generated-application/prepare.js +276 -0
- package/dist/environment/generated-application/publication.d.ts +33 -0
- package/dist/environment/generated-application/publication.js +547 -0
- package/dist/environment/generated-application/shared.d.ts +484 -0
- package/dist/environment/generated-application/shared.js +349 -0
- package/dist/environment/generated-application/surface-observation.d.ts +4 -0
- package/dist/environment/generated-application/surface-observation.js +69 -0
- package/dist/environment/generated-application/surface-outputs.d.ts +71 -0
- package/dist/environment/generated-application/surface-outputs.js +389 -0
- package/dist/environment/generated-application/surfaces.d.ts +3 -0
- package/dist/environment/generated-application/surfaces.js +699 -0
- package/dist/environment/generated-application/sync.d.ts +6 -0
- package/dist/environment/generated-application/sync.js +109 -0
- package/dist/environment/git-observation.d.ts +183 -0
- package/dist/environment/git-observation.js +544 -0
- package/dist/environment/health-composition.d.ts +11 -0
- package/dist/environment/health-composition.js +628 -0
- package/dist/environment/host-observation.d.ts +56 -0
- package/dist/environment/host-observation.js +52 -0
- package/dist/environment/identity.d.ts +48 -0
- package/dist/environment/identity.js +85 -0
- package/dist/environment/init-application.d.ts +308 -0
- package/dist/environment/init-application.js +697 -0
- package/dist/environment/install-policy-observation.d.ts +71 -0
- package/dist/environment/install-policy-observation.js +284 -0
- package/dist/environment/install-policy.d.ts +48 -0
- package/dist/environment/install-policy.js +96 -0
- package/dist/environment/instance.d.ts +33 -0
- package/dist/environment/instance.js +122 -0
- package/dist/environment/instruction-pointer.d.ts +19 -0
- package/dist/environment/instruction-pointer.js +144 -0
- package/dist/environment/lifecycle-composition.d.ts +29 -0
- package/dist/environment/lifecycle-composition.js +675 -0
- package/dist/environment/lifecycle-stage.d.ts +115 -0
- package/dist/environment/lifecycle-stage.js +398 -0
- package/dist/environment/lifecycle.d.ts +75 -0
- package/dist/environment/lifecycle.js +354 -0
- package/dist/environment/logs.d.ts +132 -0
- package/dist/environment/logs.js +519 -0
- package/dist/environment/observations.d.ts +46 -0
- package/dist/environment/observations.js +344 -0
- package/dist/environment/operator-application.d.ts +50 -0
- package/dist/environment/operator-application.js +155 -0
- package/dist/environment/ports.d.ts +182 -0
- package/dist/environment/ports.js +1205 -0
- package/dist/environment/posture-observation.d.ts +68 -0
- package/dist/environment/posture-observation.js +253 -0
- package/dist/environment/read-composition.d.ts +27 -0
- package/dist/environment/read-composition.js +352 -0
- package/dist/environment/readiness-composition.d.ts +38 -0
- package/dist/environment/readiness-composition.js +130 -0
- package/dist/environment/reclaim.d.ts +333 -0
- package/dist/environment/reclaim.js +1835 -0
- package/dist/environment/repository-identity.d.ts +13 -0
- package/dist/environment/repository-identity.js +108 -0
- package/dist/environment/runtime-measurement-record.d.ts +38 -0
- package/dist/environment/runtime-measurement-record.js +111 -0
- package/dist/environment/runtime-measurement.d.ts +27 -0
- package/dist/environment/runtime-measurement.js +224 -0
- package/dist/environment/runtime-probe-residue.d.ts +43 -0
- package/dist/environment/runtime-probe-residue.js +148 -0
- package/dist/environment/runtime-probe.d.ts +72 -0
- package/dist/environment/runtime-probe.js +725 -0
- package/dist/environment/runtime.d.ts +505 -0
- package/dist/environment/runtime.js +2335 -0
- package/dist/environment/seed.d.ts +16 -0
- package/dist/environment/seed.js +43 -0
- package/dist/environment/selftest-application.d.ts +86 -0
- package/dist/environment/selftest-application.js +713 -0
- package/dist/environment/sensitive.d.ts +3 -0
- package/dist/environment/sensitive.js +48 -0
- package/dist/environment/setup-observation.d.ts +62 -0
- package/dist/environment/setup-observation.js +1473 -0
- package/dist/environment/setup.d.ts +43 -0
- package/dist/environment/setup.js +176 -0
- package/dist/environment/sibling-instructions.d.ts +33 -0
- package/dist/environment/sibling-instructions.js +224 -0
- package/dist/environment/sibling-registration.d.ts +45 -0
- package/dist/environment/sibling-registration.js +538 -0
- package/dist/environment/state.d.ts +371 -0
- package/dist/environment/state.js +2013 -0
- package/dist/environment/templates.d.ts +140 -0
- package/dist/environment/templates.js +685 -0
- package/dist/environment/tool-registration.d.ts +9 -0
- package/dist/environment/tool-registration.js +96 -0
- package/dist/environment/upgrade-application.d.ts +19 -0
- package/dist/environment/upgrade-application.js +175 -0
- package/dist/environment-exec/execute.d.ts +102 -0
- package/dist/environment-exec/execute.js +1175 -0
- package/dist/environment-exec/libexec-program.d.ts +6 -0
- package/dist/environment-exec/libexec-program.js +22 -0
- package/dist/environment-exec/verified-digest.d.ts +4 -0
- package/dist/environment-exec/verified-digest.js +16 -0
- package/dist/exact-keys.d.ts +7 -0
- package/dist/exact-keys.js +15 -0
- package/dist/fix-catalogue.d.ts +32 -0
- package/dist/fix-catalogue.js +60 -0
- package/dist/freshness.d.ts +29 -0
- package/dist/freshness.js +75 -0
- package/dist/generated-environment/adopt.d.ts +16 -0
- package/dist/generated-environment/adopt.js +275 -0
- package/dist/generated-environment/command.d.ts +47 -0
- package/dist/generated-environment/command.js +75 -0
- package/dist/generated-environment/transaction.d.ts +186 -0
- package/dist/generated-environment/transaction.js +1770 -0
- package/dist/grading/evaluate.d.ts +71 -0
- package/dist/grading/evaluate.js +403 -0
- package/dist/grading/grade.d.ts +33 -0
- package/dist/grading/grade.js +57 -0
- package/dist/guards/evaluator.d.ts +113 -0
- package/dist/guards/evaluator.js +1226 -0
- package/dist/guards/harness-adapter.d.ts +17 -0
- package/dist/guards/harness-adapter.js +57 -0
- package/dist/guards/host.d.ts +8 -0
- package/dist/guards/host.js +10 -0
- package/dist/guards/invocation-parser.d.ts +66 -0
- package/dist/guards/invocation-parser.js +595 -0
- package/dist/guards/local-identity.d.ts +40 -0
- package/dist/guards/local-identity.js +123 -0
- package/dist/guards/policy-pin.d.ts +13 -0
- package/dist/guards/policy-pin.js +175 -0
- package/dist/guards/protected-locations.d.ts +62 -0
- package/dist/guards/protected-locations.js +461 -0
- package/dist/guards/read-only.d.ts +37 -0
- package/dist/guards/read-only.js +315 -0
- package/dist/init/command.d.ts +40 -0
- package/dist/init/command.js +310 -0
- package/dist/init/derive.d.ts +51 -0
- package/dist/init/derive.js +715 -0
- package/dist/init/draft.d.ts +138 -0
- package/dist/init/draft.js +1205 -0
- package/dist/init/render.d.ts +35 -0
- package/dist/init/render.js +82 -0
- package/dist/init/scaffold.d.ts +53 -0
- package/dist/init/scaffold.js +121 -0
- package/dist/invocation.d.ts +13 -0
- package/dist/invocation.js +20 -0
- package/dist/package-metadata.d.ts +9 -0
- package/dist/package-metadata.js +19 -0
- package/dist/readiness.d.ts +53 -0
- package/dist/readiness.js +88 -0
- package/dist/references/named.d.ts +24 -0
- package/dist/references/named.js +27 -0
- package/dist/refusal.d.ts +15 -0
- package/dist/refusal.js +7 -0
- package/dist/registry-derivation.d.ts +31 -0
- package/dist/registry-derivation.js +32 -0
- package/dist/registry-resolve/command.d.ts +47 -0
- package/dist/registry-resolve/command.js +226 -0
- package/dist/registry-resolve/registry.d.ts +68 -0
- package/dist/registry-resolve/registry.js +292 -0
- package/dist/registry-resolve/render-shell.d.ts +18 -0
- package/dist/registry-resolve/render-shell.js +36 -0
- package/dist/repair.d.ts +29 -0
- package/dist/repair.js +8 -0
- package/dist/schema-json.d.ts +1 -0
- package/dist/schema-json.js +177 -0
- package/dist/schema.d.ts +1322 -0
- package/dist/schema.js +934 -0
- package/dist/setup/command.d.ts +4 -0
- package/dist/setup/command.js +4 -0
- package/dist/sha256.d.ts +1 -0
- package/dist/sha256.js +4 -0
- package/dist/surfaces/adoption.d.ts +41 -0
- package/dist/surfaces/adoption.js +217 -0
- package/dist/surfaces/consumer-instructions.d.ts +20 -0
- package/dist/surfaces/consumer-instructions.js +43 -0
- package/dist/surfaces/contract.d.ts +42 -0
- package/dist/surfaces/contract.js +169 -0
- package/dist/surfaces/core-declarations.d.ts +24 -0
- package/dist/surfaces/core-declarations.js +79 -0
- package/dist/surfaces/development-markers.d.ts +1 -0
- package/dist/surfaces/development-markers.js +18 -0
- package/dist/surfaces/generator-adapter.d.ts +71 -0
- package/dist/surfaces/generator-adapter.js +809 -0
- package/dist/surfaces/harness-registry.d.ts +180 -0
- package/dist/surfaces/harness-registry.js +117 -0
- package/dist/surfaces/mcp.d.ts +95 -0
- package/dist/surfaces/mcp.js +186 -0
- package/dist/surfaces/merge.d.ts +30 -0
- package/dist/surfaces/merge.js +105 -0
- package/dist/surfaces/ownership.d.ts +190 -0
- package/dist/surfaces/ownership.js +795 -0
- package/dist/surfaces/projection.d.ts +136 -0
- package/dist/surfaces/projection.js +681 -0
- package/dist/surfaces/render.d.ts +118 -0
- package/dist/surfaces/render.js +633 -0
- package/dist/surfaces/restrictions.d.ts +130 -0
- package/dist/surfaces/restrictions.js +447 -0
- package/dist/surfaces/selftest.d.ts +162 -0
- package/dist/surfaces/selftest.js +393 -0
- package/dist/surfaces/skill-contract.d.ts +85 -0
- package/dist/surfaces/skill-contract.js +449 -0
- package/dist/surfaces/sync.d.ts +57 -0
- package/dist/surfaces/sync.js +164 -0
- package/dist/team-metadata.d.ts +41 -0
- package/dist/team-metadata.js +512 -0
- package/dist/testing/gates.d.ts +91 -0
- package/dist/testing/gates.js +182 -0
- package/dist/testing/hooks.d.ts +59 -0
- package/dist/testing/hooks.js +139 -0
- package/dist/testing/verdict.d.ts +29 -0
- package/dist/testing/verdict.js +62 -0
- package/dist/work-orders/application.d.ts +99 -0
- package/dist/work-orders/application.js +383 -0
- package/dist/work-orders/composition.d.ts +124 -0
- package/dist/work-orders/composition.js +1010 -0
- package/dist/work-orders/contract.d.ts +61 -0
- package/dist/work-orders/contract.js +122 -0
- package/dist/work-orders/store.d.ts +158 -0
- package/dist/work-orders/store.js +197 -0
- package/docs/README.md +65 -0
- package/docs/architecture.md +136 -0
- package/docs/capability-matrix.md +50 -0
- package/docs/cli-reference.md +599 -0
- package/docs/command-list.md +51 -0
- package/docs/compose-patterns.md +99 -0
- package/docs/concepts.md +171 -0
- package/docs/configuration-essentials.md +172 -0
- package/docs/configuration-reference.md +621 -0
- package/docs/environment.md +760 -0
- package/docs/extending.md +43 -0
- package/docs/faq.md +111 -0
- package/docs/getting-started.md +608 -0
- package/docs/harness-surfaces.md +433 -0
- package/docs/joining-a-team.md +76 -0
- package/docs/release-policy.md +49 -0
- package/docs/safety-and-autonomy.md +419 -0
- package/docs/troubleshooting.md +361 -0
- package/docs/tutorial.md +170 -0
- package/docs/work-and-browser.md +254 -0
- package/libexec/browser-operation.cjs +186 -0
- package/libexec/fence-marker.cjs +101 -0
- package/libexec/fence-marker.d.cts +24 -0
- package/libexec/fenced-group-runner.cjs +77 -0
- package/libexec/fenced-supervisor.cjs +137 -0
- package/libexec/generated-filesystem.cjs +731 -0
- package/libexec/install-filesystem.cjs +225 -0
- package/libexec/rulesync-generator.NOTICE.md +1112 -0
- package/libexec/rulesync-generator.cjs +743 -0
- package/libexec/surface-generator-worker.cjs +266 -0
- package/libexec/surface-output-reader.cjs +99 -0
- package/libexec/surface-scratch-cleanup.cjs +14 -0
- package/libexec/validate-harness-evidence.d.mts +183 -0
- package/libexec/validate-harness-evidence.mjs +1312 -0
- package/package.json +76 -1
- package/surfaces/README.md +33 -0
- package/surfaces/agents/evaluator.agent.md +76 -0
- package/surfaces/guards/bash-guard.sh +48 -0
- package/surfaces/guards/claude.adapter.json +25 -0
- package/surfaces/guards/codex.adapter.json +24 -0
- package/surfaces/guards/opencode.adapter.json +25 -0
- package/surfaces/references/browser.md +63 -0
- package/surfaces/references/test-data-and-personas.md +84 -0
- package/surfaces/references/testing-tiers.md +11 -0
- package/surfaces/skills/cockpit-browser.skill.md +54 -0
- package/surfaces/skills/cockpit-explain.skill.md +32 -0
- package/surfaces/skills/cockpit-fix.skill.md +37 -0
- package/surfaces/skills/cockpit-setup.skill.md +39 -0
- package/surfaces/skills/cockpit-work.skill.md +34 -0
- package/surfaces/skills/collection.json +5 -0
- package/surfaces/skills/procedures/explain.md +61 -0
- package/surfaces/skills/procedures/fix.md +81 -0
- package/surfaces/skills/procedures/setup.md +379 -0
- package/surfaces/skills/procedures/work.md +105 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Compose patterns
|
|
2
|
+
|
|
3
|
+
cockpit runs your Compose files as written, so a stub vendor, a TLS front end or a data restore is
|
|
4
|
+
a few lines of plain Compose rather than a cockpit setting. Each pattern below keeps to what
|
|
5
|
+
[`check`](environment.md#compose-first-stacks) expects of a Compose file: published ports come from
|
|
6
|
+
a `[ports.bases]` variable and bind `127.0.0.1`, and a container gets only the bind mounts
|
|
7
|
+
`cockpit.toml` declares. `check` also warns about a service with no healthcheck and an image pinned
|
|
8
|
+
by tag rather than digest; pin the tags below before you rely on them. A build context is not a
|
|
9
|
+
bind mount, so the patterns copy their files in with a small Dockerfile instead of mounting them.
|
|
10
|
+
|
|
11
|
+
## Stub a vendor
|
|
12
|
+
|
|
13
|
+
Run a local stand-in for a third-party API and point the app at it by service name:
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
services:
|
|
17
|
+
api:
|
|
18
|
+
build: ${API_DIR:-./api}
|
|
19
|
+
environment:
|
|
20
|
+
PAYMENTS_URL: http://payments-stub:8080
|
|
21
|
+
depends_on:
|
|
22
|
+
payments-stub:
|
|
23
|
+
condition: service_healthy
|
|
24
|
+
payments-stub:
|
|
25
|
+
build: ./stubs/payments
|
|
26
|
+
healthcheck:
|
|
27
|
+
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://localhost:8080/health"]
|
|
28
|
+
interval: 5s
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`./stubs/payments` holds the stub's Dockerfile and the responses it serves. The stub publishes no
|
|
32
|
+
host port, because only the app calls it. Keep the real vendor's address out of the stack, and list
|
|
33
|
+
its host under `[guards] vendor_endpoint_hosts` in `cockpit.toml` so the guards keep agents away
|
|
34
|
+
from it too.
|
|
35
|
+
|
|
36
|
+
## Serve TLS
|
|
37
|
+
|
|
38
|
+
Put a reverse proxy in front of the app when the product must run on `https`. This one uses Caddy's
|
|
39
|
+
internal certificate authority, so no private key leaves the container:
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
services:
|
|
43
|
+
tls:
|
|
44
|
+
image: caddy:2-alpine # pin this by digest
|
|
45
|
+
command: ["caddy", "reverse-proxy", "--from", "https://app.sample.localhost", "--to", "api:3000", "--internal-certs"]
|
|
46
|
+
ports: ["127.0.0.1:${APP_HOST_PORT:-8443}:443"]
|
|
47
|
+
volumes: ["caddy-data:/data"]
|
|
48
|
+
healthcheck:
|
|
49
|
+
test: ["CMD", "wget", "-q", "-O", "/dev/null", "http://localhost:2019/config/"]
|
|
50
|
+
interval: 5s
|
|
51
|
+
volumes:
|
|
52
|
+
caddy-data: {}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Declare the matching [named local URL](environment.md#named-local-urls) with
|
|
56
|
+
`hostname = "app.sample.localhost"` and `scheme = "https"` on `APP_HOST_PORT`. Each client that
|
|
57
|
+
connects must trust the proxy's root certificate, which Caddy keeps in the `caddy-data` volume
|
|
58
|
+
under `/data/caddy/pki/authorities/local/`; copy it out with `docker compose cp` and trust only
|
|
59
|
+
that public certificate. Leave `caddy-data` out of
|
|
60
|
+
`resettable_volumes`, so a reset does not issue a new root that every client must trust again.
|
|
61
|
+
|
|
62
|
+
## Seed or restore data
|
|
63
|
+
|
|
64
|
+
For a seed that talks to the running stack, declare
|
|
65
|
+
[`environment.seed`](environment.md#demo-data-test-users-and-roles): `up` runs it on the host once
|
|
66
|
+
the stack is healthy and again after the data volume is recreated, with the leased ports in its
|
|
67
|
+
environment. A restore is the same declaration with a script that loads a dump:
|
|
68
|
+
|
|
69
|
+
```toml
|
|
70
|
+
[environment]
|
|
71
|
+
compose_files = ["compose.yml"]
|
|
72
|
+
resettable_volumes = ["postgres-data"]
|
|
73
|
+
seed = { argv = ["sh", "scripts/restore.sh"], timeout_seconds = 900 }
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`scripts/restore.sh` connects to `127.0.0.1:$POSTGRES_HOST_PORT`, which cockpit sets from the lease,
|
|
77
|
+
and loads the dump with the product's own tools. Print every table or object it could not restore
|
|
78
|
+
before it exits, because a silent gap looks like a complete copy.
|
|
79
|
+
|
|
80
|
+
To load data without a host command, let the database image do it on an empty volume. The official
|
|
81
|
+
Postgres image runs the scripts in `/docker-entrypoint-initdb.d` only when its data directory is
|
|
82
|
+
empty, which is the state `reset` leaves a resettable volume in:
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
services:
|
|
86
|
+
postgres:
|
|
87
|
+
build: ./db # FROM postgres:17-alpine, then COPY init/ /docker-entrypoint-initdb.d/
|
|
88
|
+
environment:
|
|
89
|
+
POSTGRES_PASSWORD: postgres
|
|
90
|
+
volumes: ["postgres-data:/var/lib/postgresql/data"]
|
|
91
|
+
healthcheck:
|
|
92
|
+
test: ["CMD", "pg_isready", "-U", "postgres"]
|
|
93
|
+
interval: 5s
|
|
94
|
+
volumes:
|
|
95
|
+
postgres-data: {}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Keep dumps and fixtures out of tracked files when they hold real data; build them into the image
|
|
99
|
+
from an ignored directory, or have the seed command fetch them.
|
package/docs/concepts.md
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Concepts
|
|
2
|
+
|
|
3
|
+
This page defines the words cockpit's commands, configuration and diagnostics use. Each term has
|
|
4
|
+
one meaning across the documentation, and other pages link here instead of redefining it.
|
|
5
|
+
|
|
6
|
+
## Cockpit glossary
|
|
7
|
+
|
|
8
|
+
Everyday terms, in plain language.
|
|
9
|
+
|
|
10
|
+
### Agent harness
|
|
11
|
+
|
|
12
|
+
The AI coding tool an agent runs in, such as Claude Code, Codex CLI or OpenCode. cockpit installs
|
|
13
|
+
its guard hook for those; for Cursor and Grok Build, once `[surfaces] tools` lists them, it writes
|
|
14
|
+
files but installs no guard, and nobody has confirmed those tools load them. The
|
|
15
|
+
[capability matrix](capability-matrix.md) lists the target identifiers and what is confirmed for
|
|
16
|
+
each feature; see also [Capability states](harness-surfaces.md#capability-states).
|
|
17
|
+
|
|
18
|
+
### Sibling repository
|
|
19
|
+
|
|
20
|
+
One of the product's Git repositories, declared in a `[[sibling]]` table. Siblings sit side by
|
|
21
|
+
side under one directory, the siblings root. Each says how the stack uses the checkout (`mount`)
|
|
22
|
+
and how the checkout gets onto disk (`acquire`), two deliberately independent settings
|
|
23
|
+
([Architecture](architecture.md#two-axes-mount-and-acquire)).
|
|
24
|
+
|
|
25
|
+
### Stack
|
|
26
|
+
|
|
27
|
+
The running product: the Docker Compose project cockpit generates from the declared services,
|
|
28
|
+
volumes and ports, started against the sibling checkouts on your disk.
|
|
29
|
+
|
|
30
|
+
### Surface
|
|
31
|
+
|
|
32
|
+
A file cockpit generates for an agent harness: the shared instructions in AGENTS.md, the Claude
|
|
33
|
+
import in CLAUDE.md, skills, subagents, hooks, MCP server entries and permissions. `cockpit sync`
|
|
34
|
+
renders them from templates shipped in the package.
|
|
35
|
+
|
|
36
|
+
### Overlay
|
|
37
|
+
|
|
38
|
+
A product-specific addition to the generated surfaces, such as an extra rule or skill; see
|
|
39
|
+
[Cockpit surface overlay](#cockpit-surface-overlay).
|
|
40
|
+
|
|
41
|
+
### Guard
|
|
42
|
+
|
|
43
|
+
A check that runs before an agent's tool call and can deny it, for example a push to a protected
|
|
44
|
+
branch, an edit to a declared environment or secret file, or a command aimed at a declared hosted
|
|
45
|
+
database or vendor host. The same policy is installed as a hook in each harness that supports one.
|
|
46
|
+
|
|
47
|
+
### Drift
|
|
48
|
+
|
|
49
|
+
A difference between a generated file on disk and what the current configuration would generate.
|
|
50
|
+
`cockpit check` reports it without changing anything. `cockpit sync` rewrites a changed generated
|
|
51
|
+
artifact such as `compose.cockpit.yml`, but refuses a changed surface (a skill, agent settings or
|
|
52
|
+
a cockpit-owned region) with `SURFACE_STATE_CONFLICT`, because it can no longer prove it wrote
|
|
53
|
+
those bytes.
|
|
54
|
+
|
|
55
|
+
### Holder
|
|
56
|
+
|
|
57
|
+
A record that one checkout is using the stack. `up` adds one and `sleep` removes it; the stack stops
|
|
58
|
+
only when none remain, so one agent cannot stop another's environment.
|
|
59
|
+
|
|
60
|
+
### Work order
|
|
61
|
+
|
|
62
|
+
A file, `workorders/<id>.md`, whose YAML front-matter is the contract for one piece of agent work: its
|
|
63
|
+
objective, the paths it may change, acceptance criteria with the checks that show them, and what it
|
|
64
|
+
leaves alone. cockpit records who accepted it, runs its checks, grades the result against it and
|
|
65
|
+
records how it closed; the [work-order contract](https://github.com/b0dea/cockpit/blob/main/packages/cockpit/src/work-orders/contract.ts)
|
|
66
|
+
holds its schema and limits.
|
|
67
|
+
|
|
68
|
+
### Evaluator
|
|
69
|
+
|
|
70
|
+
The grader for a finished work order under the default `independent` grading. It grades each
|
|
71
|
+
acceptance criterion against the checks cockpit ran and the change since the order was accepted, in a
|
|
72
|
+
fresh read-only run that never sees the session that did the work, in another listed agent tool when
|
|
73
|
+
one is available, otherwise the same tool in a new run. It never edits code. A cockpit can instead let the
|
|
74
|
+
checks alone decide, or let the agent report its own verdict; the record says which.
|
|
75
|
+
|
|
76
|
+
### Enforced, instructed, generated and unavailable
|
|
77
|
+
|
|
78
|
+
The four states of a harness feature. See
|
|
79
|
+
[Cockpit harness capability state](#cockpit-harness-capability-state).
|
|
80
|
+
|
|
81
|
+
## Cockpit checkout root
|
|
82
|
+
|
|
83
|
+
The directory that holds <!-- cockpit:ref consumer=cockpit.toml --> `cockpit.toml`; it identifies one cockpit instance. Generated
|
|
84
|
+
paths, `cockpit.siblings_root` and lifecycle commands resolve from here, even when the
|
|
85
|
+
configuration sits inside a larger Git checkout, so sibling discovery and Compose paths follow
|
|
86
|
+
the configuration you select with `--config`.
|
|
87
|
+
|
|
88
|
+
The cockpit's runtime identity comes from the main Git checkout and the checkout identity from the
|
|
89
|
+
current one, so linked worktrees share one cockpit but stay distinct checkouts. A standalone
|
|
90
|
+
directory can `sync` before Git exists; `setup` and lifecycle commands need a Git checkout.
|
|
91
|
+
|
|
92
|
+
## Where the cockpit lives
|
|
93
|
+
|
|
94
|
+
The cockpit root is the directory that holds `cockpit.toml`, the generated instructions, the guard
|
|
95
|
+
and the harness settings. There are two layouts, and `init` does not ask which to use for a single
|
|
96
|
+
repository:
|
|
97
|
+
|
|
98
|
+
- **In-repo** is the default for one product repository. The repository itself is the cockpit root
|
|
99
|
+
(`siblings_root = "."`, the repository is the sibling with `dir = "."`), so the cockpit files are
|
|
100
|
+
committed with the product.
|
|
101
|
+
- **Dedicated** is the layout for a product made of several repositories. The root is a folder or
|
|
102
|
+
repository of its own beside them, such as `shop-cockpit`, with `siblings_root = ".."`:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
work/
|
|
106
|
+
shop/ product repository, first sibling (dir = "shop")
|
|
107
|
+
shop-cockpit/ cockpit root: cockpit.toml, AGENTS.md, guards, harness settings
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
A dedicated root keeps cockpit files out of the product repositories and lets one cockpit own several
|
|
111
|
+
neutrally; an in-repo cockpit cannot. Pick it by answering `cockpit.root = "dedicated"` to `init` run
|
|
112
|
+
from the product repository: `init` creates `../<repo>-cockpit` as a local Git repository (the one
|
|
113
|
+
directory it writes outside the folder it ran in; an existing destination must be empty or a local
|
|
114
|
+
Git repository with a plain `.git` directory) and declares the product repository as its first
|
|
115
|
+
sibling. An empty folder or a folder of documents is itself the cockpit: `init` declares it as its
|
|
116
|
+
own first sibling (`dir = "."`), and repositories are added later with
|
|
117
|
+
`cockpit sibling add <slug> --create`.
|
|
118
|
+
|
|
119
|
+
There is no command to move an in-repo cockpit. Do not delete the ownership manifest or the paths it
|
|
120
|
+
lists by hand; create a new dedicated cockpit as a separate adoption, and remove the old one only
|
|
121
|
+
once a command can preview and check that cleanup. To create one, follow
|
|
122
|
+
[Getting started](getting-started.md).
|
|
123
|
+
|
|
124
|
+
## Cockpit sibling declaration
|
|
125
|
+
|
|
126
|
+
The `[[sibling]]` entry for one product repository: its stable slug, directory, acquisition and
|
|
127
|
+
mount modes, toolchain and generated guidance. It names a repository; `setup` and `preflight`
|
|
128
|
+
check that the checkout exists and matches it.
|
|
129
|
+
|
|
130
|
+
## Cockpit product registry
|
|
131
|
+
|
|
132
|
+
An optional, validated description of an existing product's repositories, environment, surfaces,
|
|
133
|
+
guards, grading and adoption state, used as input when adopting an established setup. The
|
|
134
|
+
<!-- cockpit:ref consumer=cockpit.toml --> `cockpit.toml` draft it produces still needs your review.
|
|
135
|
+
|
|
136
|
+
## Cockpit lifecycle record
|
|
137
|
+
|
|
138
|
+
The state cockpit keeps for one checkout and its shared runtime: which setup and bring-up stages
|
|
139
|
+
completed. Later commands use it to resume safely and to tell the current state from an earlier
|
|
140
|
+
attempt.
|
|
141
|
+
|
|
142
|
+
## Cockpit generated ownership
|
|
143
|
+
|
|
144
|
+
The record of every file and delimited region of a shared file that cockpit wrote, with
|
|
145
|
+
the bytes it expects. It lets `check` detect drift and `sync` replace its own output without
|
|
146
|
+
touching anything else.
|
|
147
|
+
|
|
148
|
+
## Cockpit harness capability state
|
|
149
|
+
|
|
150
|
+
The confirmed status of one feature for one agent harness:
|
|
151
|
+
|
|
152
|
+
- `enforced`: a mechanism refuses the prohibited operation, and a dated check shows it doing so.
|
|
153
|
+
- `instructed`: cockpit emits the guidance or setting, but enforcement has not been confirmed.
|
|
154
|
+
- `generated`: cockpit emits the file for a harness with no guard adapter or loading test, so
|
|
155
|
+
nobody has verified that the tool even loads it.
|
|
156
|
+
- `unavailable`: the harness offers no mechanism, so cockpit emits nothing and records why.
|
|
157
|
+
|
|
158
|
+
Generating a file never promotes a feature to `enforced`; only a probe of the real tool does.
|
|
159
|
+
|
|
160
|
+
## Cockpit surface overlay
|
|
161
|
+
|
|
162
|
+
A product-specific rule, subagent, skill or hook added through `[surfaces].overlays`. It may
|
|
163
|
+
replace a built-in item only with an explicit `replaces` entry naming that item's SHA-256, so a
|
|
164
|
+
later change to the item is reported instead of silently overridden. It cannot replace core
|
|
165
|
+
permissions or MCP approval.
|
|
166
|
+
|
|
167
|
+
## Cockpit evidence boundary
|
|
168
|
+
|
|
169
|
+
The line between what cockpit has checked itself and what still needs confirmation elsewhere: a
|
|
170
|
+
running harness, a person, a vendor or a live runtime. A repository test proves cockpit's own
|
|
171
|
+
behaviour, not that a harness loaded a generated file.
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Configuration essentials
|
|
2
|
+
|
|
3
|
+
This page is for people writing or reviewing their first `cockpit.toml`. It covers the tables a
|
|
4
|
+
typical cockpit sets, the ones `init` asks about and the bundled examples declare, each with a
|
|
5
|
+
minimal snippet and a link to its full entry in the generated
|
|
6
|
+
[configuration reference](configuration-reference.md). Everything else is optional and listed by
|
|
7
|
+
area at the end.
|
|
8
|
+
|
|
9
|
+
## `[cockpit]`
|
|
10
|
+
|
|
11
|
+
The cockpit's name and where the product's repositories live. The name scopes the cockpit's
|
|
12
|
+
Compose projects, state and generated files, so renaming it later means bringing the stack down
|
|
13
|
+
and syncing again. `siblings_root` is relative to the cockpit directory and defaults to `..`.
|
|
14
|
+
Full entry: [`[cockpit]`](configuration-reference.md#cockpit).
|
|
15
|
+
|
|
16
|
+
```toml
|
|
17
|
+
[cockpit]
|
|
18
|
+
name = "shop"
|
|
19
|
+
siblings_root = ".."
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## `[[sibling]]`
|
|
23
|
+
|
|
24
|
+
One table per product repository. `mount` says how the stack uses the checkout: `always`
|
|
25
|
+
bind-mounts it, `profile:<name>` mounts it only under that Compose profile, `none` leaves it read
|
|
26
|
+
but never mounted, and `host` runs it outside the stack for the reason given in `host_reason`.
|
|
27
|
+
`acquire` says how it reaches disk: `auto` clones `remote` during `setup`, `manual` expects a
|
|
28
|
+
person to clone it, and `none` never clones it, so it must already be there. The two are
|
|
29
|
+
[independent](architecture.md#two-axes-mount-and-acquire). `var` carries the checkout's path and
|
|
30
|
+
`toolchain` picks the install policy. `cockpit sibling add` writes these tables for you. Full
|
|
31
|
+
entries: [`[[sibling]]`](configuration-reference.md#sibling) and
|
|
32
|
+
[`[[sibling.environment_files]]`](configuration-reference.md#siblingenvironment_files).
|
|
33
|
+
|
|
34
|
+
```toml
|
|
35
|
+
[[sibling]]
|
|
36
|
+
slug = "api"
|
|
37
|
+
dir = "api"
|
|
38
|
+
mount = "always"
|
|
39
|
+
acquire = "auto"
|
|
40
|
+
remote = "git@example.com:team/api.git"
|
|
41
|
+
var = "API_DIR"
|
|
42
|
+
toolchain = "node"
|
|
43
|
+
purpose = "HTTP API for orders"
|
|
44
|
+
|
|
45
|
+
[[sibling.environment_files]]
|
|
46
|
+
template = ".env.example" # tracked in the sibling
|
|
47
|
+
instance = ".env" # created from it by setup
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## `[ports]`
|
|
51
|
+
|
|
52
|
+
The base host port of every published port, by variable name. Each parallel stack publishes the
|
|
53
|
+
bases plus a multiple of `step`, as
|
|
54
|
+
[Local URLs and port families](environment.md#local-urls-and-port-families) explains. An empty
|
|
55
|
+
`[ports.bases]` table records that nothing is published. Full entry:
|
|
56
|
+
[`[ports]`](configuration-reference.md#ports).
|
|
57
|
+
|
|
58
|
+
```toml
|
|
59
|
+
[ports.bases]
|
|
60
|
+
API_HOST_PORT = 4100
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## `[environment]`: posture and machine floor
|
|
64
|
+
|
|
65
|
+
How the product is reached and signed in to locally, and the least the container runtime must
|
|
66
|
+
offer. `preflight` refuses a runtime until the posture is declared, and runtime commands refuse to
|
|
67
|
+
start on a machine below the floor;
|
|
68
|
+
[Declare environment postures](environment.md#declare-environment-postures) covers the tags. Full
|
|
69
|
+
entries: [`[environment]`](configuration-reference.md#environment),
|
|
70
|
+
[`[[environment.posture_requirements]]`](configuration-reference.md#environmentposture_requirements)
|
|
71
|
+
and [`[environment.machine]`](configuration-reference.md#environmentmachine).
|
|
72
|
+
|
|
73
|
+
```toml
|
|
74
|
+
[environment]
|
|
75
|
+
addressing = "port"
|
|
76
|
+
authentication = "none"
|
|
77
|
+
posture_requirements = [{ requirement = "leased-localhost-ports", addressing = "port" }]
|
|
78
|
+
|
|
79
|
+
[environment.machine]
|
|
80
|
+
runtime_memory_mb = 512
|
|
81
|
+
runtime_cpus = 1
|
|
82
|
+
free_disk_mb = 1024
|
|
83
|
+
cold_start_seconds = 60
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## The stack: `compose_files`
|
|
87
|
+
|
|
88
|
+
A product that runs as a stack lists its Compose files under `[environment]`, and cockpit runs them
|
|
89
|
+
as written ([Compose-first stacks](environment.md#compose-first-stacks)). A small app with no
|
|
90
|
+
Compose file gets a starting one from `cockpit init --scaffold-compose`
|
|
91
|
+
([Scaffold a Compose file](environment.md#scaffold-a-compose-file)). `resettable_volumes` names the
|
|
92
|
+
Compose volumes `reset` may delete, and `seed` the command `up` runs to fill them
|
|
93
|
+
([Demo data, test users and roles](environment.md#demo-data-test-users-and-roles)). Full entry:
|
|
94
|
+
[`[environment]`](configuration-reference.md#environment).
|
|
95
|
+
|
|
96
|
+
```toml
|
|
97
|
+
[environment]
|
|
98
|
+
compose_files = ["compose.yml"]
|
|
99
|
+
resettable_volumes = ["postgres-data"]
|
|
100
|
+
seed = { argv = ["npm", "run", "db:seed"], timeout_seconds = 300 }
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## `[[environment.install_policies]]`
|
|
104
|
+
|
|
105
|
+
The project build and test commands for one toolchain, selected by the lockfile a sibling
|
|
106
|
+
checkout holds. `setup` needs exactly one matching row for each sibling whose `toolchain` is not
|
|
107
|
+
`none`, and the guard allows the declared `build` and `test` argument vectors in that checkout.
|
|
108
|
+
Full entry: the [`install_policies` shape](configuration-reference.md#environmentinstall_policies).
|
|
109
|
+
|
|
110
|
+
```toml
|
|
111
|
+
[[environment.install_policies]]
|
|
112
|
+
toolchain = "node"
|
|
113
|
+
lockfile = "package-lock.json"
|
|
114
|
+
build = ["npm", "run", "build"]
|
|
115
|
+
test = ["npm", "test"]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## `[testing]`
|
|
119
|
+
|
|
120
|
+
The product's test commands as stages, grouped into a targeted gate agents run while iterating and
|
|
121
|
+
a full gate they run before handing back shared changes. A stage command is an argument list run
|
|
122
|
+
without a shell; [Choose the proving test tier](work-and-browser.md#choose-the-proving-test-tier)
|
|
123
|
+
explains the tiers. Full entries: [`[testing]`](configuration-reference.md#testing),
|
|
124
|
+
[`[[testing.stages]]`](configuration-reference.md#testingstages) and
|
|
125
|
+
[`[[testing.gates]]`](configuration-reference.md#testinggates).
|
|
126
|
+
|
|
127
|
+
```toml
|
|
128
|
+
[testing]
|
|
129
|
+
stages = [
|
|
130
|
+
{ id = "changed", command = ["npx", "vitest", "run", "--changed", "origin/main"], requires_stack = false },
|
|
131
|
+
{ id = "all", command = ["npx", "vitest", "run"], requires_stack = false },
|
|
132
|
+
]
|
|
133
|
+
gates = [
|
|
134
|
+
{ id = "changed", tier = "targeted", stages = ["changed"], changes = "Isolated behaviour" },
|
|
135
|
+
{ id = "all", tier = "full", stages = ["all"], changes = "Shared or cross-project behaviour" },
|
|
136
|
+
]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## `[guards]`
|
|
140
|
+
|
|
141
|
+
The database and live vendor API hosts of every non-local environment; the guard denies agent
|
|
142
|
+
commands that reach them ([Safety and autonomy](safety-and-autonomy.md)). Empty lists record that
|
|
143
|
+
none exists. Full entry: [`[guards]`](configuration-reference.md#guards).
|
|
144
|
+
|
|
145
|
+
```toml
|
|
146
|
+
[guards]
|
|
147
|
+
hosted_db_hosts = ["db.prod.example.com"]
|
|
148
|
+
vendor_endpoint_hosts = ["api.payments.example.com"]
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## `unconfirmed`
|
|
152
|
+
|
|
153
|
+
`init` lists each answer no person stated in `unconfirmed`, at the top of the file, and `doctor`
|
|
154
|
+
warns until a person confirms each value and deletes its entry. Full entry:
|
|
155
|
+
[Top-level keys](configuration-reference.md#top-level-keys).
|
|
156
|
+
|
|
157
|
+
## Everything else
|
|
158
|
+
|
|
159
|
+
Each optional area links to its tables in the reference and to the guide that explains it. The
|
|
160
|
+
reference also lists the [defaults](configuration-reference.md#defaults) and the
|
|
161
|
+
[checks beyond the schema](configuration-reference.md#checks-beyond-the-schema).
|
|
162
|
+
|
|
163
|
+
| Area | Tables | Guide |
|
|
164
|
+
|---|---|---|
|
|
165
|
+
| Vendor stubs, TLS, restores | your Compose files | [Compose patterns](compose-patterns.md) |
|
|
166
|
+
| Browser checks | [`[browser]`](configuration-reference.md#browser) | [Browser evidence](work-and-browser.md#browser-evidence) |
|
|
167
|
+
| Work orders | [`[work]`](configuration-reference.md#work) | [Work and browser workflows](work-and-browser.md) |
|
|
168
|
+
| Who decides | [`[autonomy]`](configuration-reference.md#autonomy) | [Who decides](safety-and-autonomy.md#who-decides) |
|
|
169
|
+
| Guard rules | [`[[guards.allow]]`](configuration-reference.md#guardsallow), the `deny` row of [`[guards]`](configuration-reference.md#guards) | [Safety and autonomy](safety-and-autonomy.md) |
|
|
170
|
+
| MCP approvals | [`[mcp]`](configuration-reference.md#mcp) | [MCP servers and restrictions](harness-surfaces.md#mcp-servers-and-restrictions) |
|
|
171
|
+
| Surface overlays | [`[[surfaces.overlays]]`](configuration-reference.md#surfacesoverlays) | [Ownership and extension](harness-surfaces.md#ownership-and-extension) |
|
|
172
|
+
| Custom harnesses | [`[[surfaces.harnesses]]`](configuration-reference.md#surfacesharnesses) | [Custom harnesses](harness-surfaces.md#custom-harnesses) |
|