@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,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cockpit-work
|
|
3
|
+
description: "Use when someone names a work order, or a change must be held to criteria someone else set, graded by something other than you, or carried across sessions, in a cockpit with work orders. Ordinary fixes use cockpit-fix."
|
|
4
|
+
targets: ["*"]
|
|
5
|
+
cockpit:
|
|
6
|
+
tools: [shell]
|
|
7
|
+
tool-equivalences:
|
|
8
|
+
claudecode: [Bash]
|
|
9
|
+
codexcli: [shell]
|
|
10
|
+
opencode: [bash]
|
|
11
|
+
commands: [work status, work accept, work check, work note, work grade, work signoff, test-run]
|
|
12
|
+
changes: [the files the accepted work order's scope names]
|
|
13
|
+
non-goals: [grading its own work under independent grading, passing a gate the policy gives a person, editing the policy in cockpit.toml]
|
|
14
|
+
procedure: procedures/work.md
|
|
15
|
+
review: { mechanical: cockpit-skill-contract, judgment: pending }
|
|
16
|
+
entry-point-lines: 9
|
|
17
|
+
claudecode:
|
|
18
|
+
allowed-tools: [Bash]
|
|
19
|
+
codexcli:
|
|
20
|
+
dependencies:
|
|
21
|
+
tools: [{ type: executable, value: cockpit, description: Runs accepted cockpit CLI primitives. }]
|
|
22
|
+
opencode:
|
|
23
|
+
allowed-tools: [bash]
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
<!-- cockpit:verified version=0.0.0 -->
|
|
27
|
+
|
|
28
|
+
# Work an order
|
|
29
|
+
|
|
30
|
+
{{tool-equivalence}}
|
|
31
|
+
Read [procedures/work.md](procedures/work.md) beside this skill and follow **Work** from step 0, which resumes an existing order at the step its state names.
|
|
32
|
+
Under independent grading another agent tool grades the order; never grade your own work.
|
|
33
|
+
When a command answers `WORK_PERSON_REQUIRED`, stop and ask the person to run the same command with `--interactive` in a terminal: never type a digest for them.
|
|
34
|
+
If `check` or the session-start report names drift, follow *On drift* in the cockpit-setup skill's procedure, `../cockpit-setup/procedures/setup.md`, first.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
---
|
|
2
|
+
loading: pull
|
|
3
|
+
budget: uncapped
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- cockpit:verified version=0.0.0 -->
|
|
7
|
+
|
|
8
|
+
# Explain a cockpit
|
|
9
|
+
|
|
10
|
+
## Running cockpit
|
|
11
|
+
|
|
12
|
+
- Run every command from the cockpit root, the directory holding `cockpit.toml`, through the
|
|
13
|
+
project-local binary, for example `./node_modules/.bin/cockpit check --config cockpit.toml`.
|
|
14
|
+
`npx --no cockpit <command>` starts the same binary, but the path form still runs where the
|
|
15
|
+
guard cannot prove what npx starts. If the binary is missing, stop and ask the person to install cockpit; a
|
|
16
|
+
runner that downloads a package is never a substitute.
|
|
17
|
+
- Take flags from each command's `--help`. With `--json`, read `result`, `diagnostics[].code` and
|
|
18
|
+
`invocation.exitCode`. Every diagnostic names its fix, and
|
|
19
|
+
`./node_modules/@b00dea/cockpit/docs/troubleshooting.md` covers the codes that need more; the
|
|
20
|
+
other user-guide pages cited here sit beside it.
|
|
21
|
+
- When the guard asks before a command, the person decides in Claude Code; Codex and OpenCode deny
|
|
22
|
+
instead, so hand the person the exact command to run in a terminal. A refusal that holds every
|
|
23
|
+
tool call (a guard message saying so, or `GUARD_AUTHORITY_UNAVAILABLE`) follows any
|
|
24
|
+
edit to `cockpit.toml` or reinstall of cockpit or Node, and clears only when a person runs
|
|
25
|
+
`./node_modules/.bin/cockpit sync --config cockpit.toml` in a terminal. A refused command is the
|
|
26
|
+
person's to run: never reword, wrap or re-spell it to get past the guard.
|
|
27
|
+
- In Codex's sandbox only `check`, `sync --dry-run` and `--help` work. Every other cockpit command
|
|
28
|
+
there cannot read cockpit's state or the Docker socket, so a failure it reports is not evidence:
|
|
29
|
+
ask the person to approve running it outside the sandbox, or to run it in a terminal. Under
|
|
30
|
+
`codex exec`, which cannot ask, a person runs it.
|
|
31
|
+
- Ask, never invent. A port, image, command, host, purpose, name, version, role or credential comes
|
|
32
|
+
from a file you read or from the person; with neither, name the gap and ask.
|
|
33
|
+
|
|
34
|
+
## Explain
|
|
35
|
+
|
|
36
|
+
You answer a question about this cockpit from what its commands report now, and change nothing.
|
|
37
|
+
|
|
38
|
+
1. **Pick the command that answers the question**, and only that one:
|
|
39
|
+
`./node_modules/.bin/cockpit doctor --config cockpit.toml --json` for environment health, wiring
|
|
40
|
+
and readiness gaps; `./node_modules/.bin/cockpit check --config cockpit.toml --json` for generated
|
|
41
|
+
files that drift from `cockpit.toml`; `./node_modules/.bin/cockpit preflight --config cockpit.toml --json`
|
|
42
|
+
for whether the environment passes the gate work needs. Run two only when the question spans them.
|
|
43
|
+
A question about one diagnostic code, or a refusal the person pasted, may need no command: read
|
|
44
|
+
what `./node_modules/@b00dea/cockpit/docs/troubleshooting.md` says about the code, and for a guard
|
|
45
|
+
refusal, `./node_modules/@b00dea/cockpit/docs/safety-and-autonomy.md`. Done when you have the
|
|
46
|
+
output, or the page, the answer rests on.
|
|
47
|
+
2. **Answer from that output.** Name each relevant diagnostic code, what it means, and the fix it
|
|
48
|
+
names; say which wired repositories, agent tools and gates are involved, and what is still a
|
|
49
|
+
gap. Quote the output for every claim instead of describing the configuration from memory.
|
|
50
|
+
Done when every claim in your answer points at a line of output or a page.
|
|
51
|
+
3. **Give the next command** that changes the state, and who runs it: the agent, or a person in a
|
|
52
|
+
terminal when the guard or a gate gives the step to a person. Done when the person can act on it
|
|
53
|
+
without asking you again.
|
|
54
|
+
|
|
55
|
+
When explaining drift, say what each command does: `check` repairs nothing; `sync` rewrites a
|
|
56
|
+
hand-edited generated artifact such as `compose.cockpit.yml`, and refuses a hand-edited skill,
|
|
57
|
+
agent settings file or cockpit-owned region with `SURFACE_STATE_CONFLICT`; the fix for each case is
|
|
58
|
+
in *On drift* of the cockpit-setup skill's procedure, `../../cockpit-setup/procedures/setup.md` from
|
|
59
|
+
this file. For a secret question, follow its *Secret handling* section and distinguish the tracked
|
|
60
|
+
schema, the encrypted or provider source, the redacted status, injection into a trusted child
|
|
61
|
+
process, and the same-user read confinement that is unavailable.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
loading: pull
|
|
3
|
+
budget: uncapped
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- cockpit:verified version=0.0.0 -->
|
|
7
|
+
|
|
8
|
+
# Fix a defect
|
|
9
|
+
|
|
10
|
+
## Running cockpit
|
|
11
|
+
|
|
12
|
+
- Run every command from the cockpit root, the directory holding `cockpit.toml`, through the
|
|
13
|
+
project-local binary, for example `./node_modules/.bin/cockpit check --config cockpit.toml`.
|
|
14
|
+
`npx --no cockpit <command>` starts the same binary, but the path form still runs where the
|
|
15
|
+
guard cannot prove what npx starts. If the binary is missing, stop and ask the person to install cockpit; a
|
|
16
|
+
runner that downloads a package is never a substitute.
|
|
17
|
+
- Take flags from each command's `--help`. With `--json`, read `result`, `diagnostics[].code` and
|
|
18
|
+
`invocation.exitCode`. Every diagnostic names its fix, and
|
|
19
|
+
`./node_modules/@b00dea/cockpit/docs/troubleshooting.md` covers the codes that need more; the
|
|
20
|
+
other user-guide pages cited here sit beside it.
|
|
21
|
+
- When the guard asks before a command, the person decides in Claude Code; Codex and OpenCode deny
|
|
22
|
+
instead, so hand the person the exact command to run in a terminal. A refusal that holds every
|
|
23
|
+
tool call (a guard message saying so, or `GUARD_AUTHORITY_UNAVAILABLE`) follows any
|
|
24
|
+
edit to `cockpit.toml` or reinstall of cockpit or Node, and clears only when a person runs
|
|
25
|
+
`./node_modules/.bin/cockpit sync --config cockpit.toml` in a terminal. A refused command is the
|
|
26
|
+
person's to run: never reword, wrap or re-spell it to get past the guard.
|
|
27
|
+
- In Codex's sandbox only `check`, `sync --dry-run` and `--help` work. Every other cockpit command
|
|
28
|
+
there cannot read cockpit's state or the Docker socket, so a failure it reports is not evidence:
|
|
29
|
+
ask the person to approve running it outside the sandbox, or to run it in a terminal. Under
|
|
30
|
+
`codex exec`, which cannot ask, a person runs it.
|
|
31
|
+
- Ask, never invent. A port, image, command, host, purpose, name, version, role or credential comes
|
|
32
|
+
from a file you read or from the person; with neither, name the gap and ask.
|
|
33
|
+
|
|
34
|
+
## Fix
|
|
35
|
+
|
|
36
|
+
A fix is a change you make and prove yourself. It needs no intake, draft, source audit or
|
|
37
|
+
work-order file. Use the cockpit-work skill instead when someone else must certify the result, or
|
|
38
|
+
the work must carry on in a later session or belongs to a programme. Ask that again whenever the
|
|
39
|
+
scope changes, not at hand-back.
|
|
40
|
+
|
|
41
|
+
1. **Name the defect.** Write down the expected behavior, the observed behavior and the repository
|
|
42
|
+
that owns it. Done when a reader could tell the fix worked from those two sentences alone.
|
|
43
|
+
2. **Find the gate.** The *Testing tiers* section of the cockpit's root `AGENTS.md` lists the
|
|
44
|
+
declared gates and which change each proves; pick the narrowest that covers this one. If it says
|
|
45
|
+
no gate is declared, follow it instead: prove the fix with the product's own test runner, and
|
|
46
|
+
report that no gate graded it. Done when you hold one gate ID, or know there is none.
|
|
47
|
+
3. **Record the baseline before you edit**:
|
|
48
|
+
`./node_modules/.bin/cockpit test-run --config cockpit.toml --gate declared-gate-id --json`, with
|
|
49
|
+
the ID from step 2. Any verdict but PASS exits with `TEST_GATE_UNSATISFIED`, and its fix says
|
|
50
|
+
what FAIL, DEGRADED, VOID and PARTIAL each need. Done when you know what already passed and what
|
|
51
|
+
already failed.
|
|
52
|
+
4. **Reproduce at the narrowest real boundary.** Extend the nearest behavior test through its
|
|
53
|
+
public surface so it fails on this defect, and run it with the narrowest selector the gate takes.
|
|
54
|
+
Start the stack with `./node_modules/.bin/cockpit up --config cockpit.toml` only when the
|
|
55
|
+
behavior needs a live process or integration; read
|
|
56
|
+
`./node_modules/.bin/cockpit logs --config cockpit.toml --service service-id`, naming the declared
|
|
57
|
+
service, and `./node_modules/.bin/cockpit doctor --config cockpit.toml --json` only for the runtime
|
|
58
|
+
output the defect needs. When the stack will not start (no Docker, another holder, an unmeasured
|
|
59
|
+
runtime), report the code `up` gives and its fix rather than proving the fix some other way. Done
|
|
60
|
+
when a test goes red on exactly the observed behavior.
|
|
61
|
+
5. **Then change the repository that owns the defect**, and nothing else. Leave uncommitted changes
|
|
62
|
+
that were already in the checkout as you found them. For an environment or credential defect,
|
|
63
|
+
follow the *Secret handling* section of the cockpit-setup skill's procedure,
|
|
64
|
+
`../../cockpit-setup/procedures/setup.md` from this file, before running the declared product
|
|
65
|
+
command. Done when the test from step 4 passes.
|
|
66
|
+
6. **Prove it**: run the gate from step 3 again, complete and without a selector. Done when it
|
|
67
|
+
reports PASS, or you can name the failure and its cause.
|
|
68
|
+
7. **Review.** Once the change is stable, simplify it, then review it independently, with security
|
|
69
|
+
emphasis when the changed boundary warrants it. Reuse an installed code-review or security-review
|
|
70
|
+
skill; otherwise apply that sequence directly. Fix blocking findings and rerun the gate. Done
|
|
71
|
+
when no blocking finding is open and the gate result is current.
|
|
72
|
+
8. **Clean up.** List the files, temporary files, processes and stack claims this task created.
|
|
73
|
+
Remove only the temporary files this task created; keep earlier uncommitted changes, other
|
|
74
|
+
agents' files, claims other holders hold and the review results. Release a stack claim only
|
|
75
|
+
with the cockpit lifecycle command (`./node_modules/.bin/cockpit sleep --config cockpit.toml`),
|
|
76
|
+
following any approval it asks for; when cockpit cannot confirm that release is safe, keep the
|
|
77
|
+
claim and report who holds it, the refusal and its output. Done when every item is removed or
|
|
78
|
+
reported with the reason you kept it.
|
|
79
|
+
|
|
80
|
+
Report the defect, the files you changed, the gate results before and after, and every item you
|
|
81
|
+
kept.
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
---
|
|
2
|
+
loading: pull
|
|
3
|
+
budget: uncapped
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- cockpit:verified version=0.0.0 -->
|
|
7
|
+
|
|
8
|
+
# Set up and maintain a cockpit
|
|
9
|
+
|
|
10
|
+
## Running cockpit
|
|
11
|
+
|
|
12
|
+
- Run every command from the cockpit root, the directory holding `cockpit.toml`, through the
|
|
13
|
+
project-local binary, for example `./node_modules/.bin/cockpit check --config cockpit.toml`.
|
|
14
|
+
`npx --no cockpit <command>` starts the same binary, but the path form still runs where the
|
|
15
|
+
guard cannot prove what npx starts. If the binary is missing, stop and ask the person to install cockpit; a
|
|
16
|
+
runner that downloads a package is never a substitute.
|
|
17
|
+
- Take flags from each command's `--help`. With `--json`, read `result`, `diagnostics[].code` and
|
|
18
|
+
`invocation.exitCode`. Every diagnostic names its fix, and
|
|
19
|
+
`./node_modules/@b00dea/cockpit/docs/troubleshooting.md` covers the codes that need more; the
|
|
20
|
+
other user-guide pages cited here sit beside it.
|
|
21
|
+
- When the guard asks before a command, the person decides in Claude Code; Codex and OpenCode deny
|
|
22
|
+
instead, so hand the person the exact command to run in a terminal. A refusal that holds every
|
|
23
|
+
tool call (a guard message saying so, or `GUARD_AUTHORITY_UNAVAILABLE`) follows any
|
|
24
|
+
edit to `cockpit.toml` or reinstall of cockpit or Node, and clears only when a person runs
|
|
25
|
+
`./node_modules/.bin/cockpit sync --config cockpit.toml` in a terminal. A refused command is the
|
|
26
|
+
person's to run: never reword, wrap or re-spell it to get past the guard.
|
|
27
|
+
- In Codex's sandbox only `check`, `sync --dry-run` and `--help` work. Every other cockpit command
|
|
28
|
+
there cannot read cockpit's state or the Docker socket, so a failure it reports is not evidence:
|
|
29
|
+
ask the person to approve running it outside the sandbox, or to run it in a terminal. Under
|
|
30
|
+
`codex exec`, which cannot ask, a person runs it.
|
|
31
|
+
- Ask, never invent. A port, image, command, host, purpose, name, version, role or credential comes
|
|
32
|
+
from a file you read or from the person; with neither, name the gap and ask.
|
|
33
|
+
|
|
34
|
+
## Bootstrap
|
|
35
|
+
|
|
36
|
+
`init` reads the repositories, interviews, writes the generated files and checks the environment;
|
|
37
|
+
follow what it reports rather than redoing any of that by hand. Rerunning the same command, with
|
|
38
|
+
the same root and `--target`, resumes where it stopped; a different target refuses with
|
|
39
|
+
`INIT_TARGET_CHANGED`, and a repository or draft that changed underneath it refuses with a code
|
|
40
|
+
such as `INIT_STATE_STALE` or `INIT_DRAFT_CHANGED` whose fix says what to restore or redo. Inside an
|
|
41
|
+
installed cockpit the guard asks before any `init` that carries `--answers` or an `--accept-` flag.
|
|
42
|
+
Until step 7 installs cockpit in the cockpit root, rerun `init` with the same executable that
|
|
43
|
+
started it, even where it lives outside this root.
|
|
44
|
+
|
|
45
|
+
1. **Choose the agent tools.** Ask the person which agent tools the team uses: `claudecode`
|
|
46
|
+
(Claude Code), `codexcli` (Codex CLI), `opencode` (OpenCode), `cursor` (Cursor) or `grokcli`
|
|
47
|
+
(Grok Build). One tool is a complete choice; for several, pass them all, yours first and
|
|
48
|
+
comma-separated (`--target claudecode,opencode`); the list needs at least one of `claudecode`,
|
|
49
|
+
`codexcli` and `opencode`, the tools cockpit can guard. init writes it as `[surfaces] tools`, and
|
|
50
|
+
sync writes instructions, skills and settings for those tools only. Cursor and Grok Build get
|
|
51
|
+
files nobody has tested them loading (see
|
|
52
|
+
`./node_modules/@b00dea/cockpit/docs/capability-matrix.md`), so propose them only when the team
|
|
53
|
+
uses them. Done when you hold the `--target` value.
|
|
54
|
+
2. **Preview.** Run `./node_modules/.bin/cockpit init . --target <tool> --json`, adding
|
|
55
|
+
`--registry` only when adopting an existing registry. The preview writes nothing. Read
|
|
56
|
+
`result.stage`, `result.question` and `result.interview.outstanding`: every field the interview
|
|
57
|
+
will ask, each with its inferred values and the file each came from. Done when you hold
|
|
58
|
+
`result.previewSha256` and the outstanding fields.
|
|
59
|
+
3. **Explore, then ask in one small round.** Read the repositories for each outstanding field
|
|
60
|
+
before asking, ask only for what the files and CLI output cannot answer, and present each
|
|
61
|
+
inferred value with its source for confirmation. Always settle these with the person:
|
|
62
|
+
- **The name.** `init` proposes the cockpit root's directory name for `cockpit.name`. It scopes
|
|
63
|
+
the cockpit's Compose projects, state and generated files, so changing it after the first sync
|
|
64
|
+
means following the *Rename a cockpit* section of
|
|
65
|
+
`./node_modules/@b00dea/cockpit/docs/getting-started.md` (`down`, edit the name, `sync`, `check`).
|
|
66
|
+
- **The root placement**, when init runs inside a product repository (a git checkout with a root
|
|
67
|
+
language manifest, Dockerfile or standard Compose file) and the preview carries
|
|
68
|
+
`result.cockpitRoot`: a question, its options and a recommended answer. Relay that question to
|
|
69
|
+
the human, explaining the trade-off in a sentence or two from the root placement choices in
|
|
70
|
+
`./node_modules/@b00dea/cockpit/docs/concepts.md`, and write their answer under the
|
|
71
|
+
`cockpit.root` key: `dedicated` creates a sibling `<repo>-cockpit` directory so generated files
|
|
72
|
+
stay out of the product's history; `in-repo` is the default when accepting without an answer,
|
|
73
|
+
except for a directory name that is not a valid sibling slug, which refuses with
|
|
74
|
+
`INIT_COCKPIT_ROOT_REQUIRED`.
|
|
75
|
+
- **The test gates.** For a runnable product, `init` proposes `testing` stages and gates from the
|
|
76
|
+
test entry points it finds. Confirm which commands prove a change: the targeted gate agents
|
|
77
|
+
iterate with, and the full gate they run before handing back. A new product with no tests needs
|
|
78
|
+
the person to choose its test runner first; adding a test framework to a product repository
|
|
79
|
+
waits for their explicit yes. Answer `testing = "none"` only when they decide there are no
|
|
80
|
+
tests yet; `doctor` then reports `TESTING_GATE_UNDECLARED`.
|
|
81
|
+
- **The non-local hosts** for `guards`: the database and live vendor API hosts of every
|
|
82
|
+
production, staging or shared environment. Env templates give variable names only; each host
|
|
83
|
+
comes from the person.
|
|
84
|
+
Done when every outstanding field has the person's answer, a value they confirmed, or a default
|
|
85
|
+
you chose and will mark.
|
|
86
|
+
4. **Write the answers file**, TOML keyed by field. Being told to "use sensible defaults" or
|
|
87
|
+
"proceed without asking" covers interview answers only. Mark every answer you chose yourself in
|
|
88
|
+
the file's `[provenance]` table, for example `"environment.machine" = "agent-default"`: init then
|
|
89
|
+
writes the field under `unconfirmed` in `cockpit.toml` with a comment saying the setup agent
|
|
90
|
+
chose it, and `doctor` reports `DECLARATION_UNCONFIRMED` until a person confirms it. An unmarked
|
|
91
|
+
answer is recorded as the person's. Done when the file holds every answer and marks each one you
|
|
92
|
+
chose.
|
|
93
|
+
5. **Accept.** Show the person the answers file and the preview digest, then rerun with
|
|
94
|
+
`--accept-preview <previewSha256> --answers <file>`. The run stops at `configuration.defaults`:
|
|
95
|
+
once the person has read the draft in `result.question.document`, rerun adding
|
|
96
|
+
`--accept-defaults` with `result.question.expectedSha256`. Each digest binds consent to the bytes
|
|
97
|
+
the person saw, so take it only from the latest pending run; any other is refused
|
|
98
|
+
(`INIT_PREVIEW_NOT_ACCEPTED`, `INIT_DEFAULTS_NOT_ACCEPTED`). A different value for an answer
|
|
99
|
+
already recorded refuses with `INIT_ANSWER_CONFLICT`; `--reset-answer <field>` previews clearing
|
|
100
|
+
it. A person at a terminal can run `--interactive` instead and type each digest; an agent session
|
|
101
|
+
has no terminal, so there it refuses with `INIT_TERMINAL_REQUIRED`. Done when the run has passed
|
|
102
|
+
`configuration.defaults`.
|
|
103
|
+
6. **Work through the expected stops**, rerunning the same accepted command after each:
|
|
104
|
+
- Where a runtime is declared, preflight needs a completed first bring-up, so the run stops with
|
|
105
|
+
`STATE_UNSEEDED` (exit 2, stage `draft-observed`); the diagnostics beside it name every other
|
|
106
|
+
gap found without a running stack. Bring the stack up as step 7 of **Create a local setup**
|
|
107
|
+
describes.
|
|
108
|
+
- Preflight passes only once the cockpit repository is committed and clean, so a new one reports
|
|
109
|
+
`GIT_STATE_UNHEALTHY` with the commands that commit the generated files. A person approves or
|
|
110
|
+
runs the staging and the commit, not you: the guard asks on `git add <paths>`, denies a broad
|
|
111
|
+
`git add -A` that covers a secrets directory, and the first commit stages the guard's own
|
|
112
|
+
files. Show them `git status --short` and hand them that fix to run in a terminal. To read
|
|
113
|
+
Git state in another directory, use `git -C <dir> status` or `cd ./<dir> && <command>`; a bare
|
|
114
|
+
`cd <dir>` is refused.
|
|
115
|
+
Done when the result reports `environment-verified`, or, for a cockpit that declares no runtime,
|
|
116
|
+
reports it with `ENVIRONMENT_NOT_DECLARED` as information and no bring-up.
|
|
117
|
+
7. **Clear the readiness gaps.** Every `init` stop, and
|
|
118
|
+
`./node_modules/.bin/cockpit doctor --config cockpit.toml --json`, carries `result.readiness`:
|
|
119
|
+
`gaps` lists each prerequisite a check reported missing, with its `level` (a `required` one is
|
|
120
|
+
refused by the command that needs it), `needs` (why cockpit needs it) and `findings` (the
|
|
121
|
+
diagnostic, its message and its fix); `noFinding` lists the ones no check reported, which is not
|
|
122
|
+
proof, because a check that could not run reports nothing. Take the gaps one at a time, required
|
|
123
|
+
first: say what is missing, why cockpit needs it, and the exact change you propose. Ask before
|
|
124
|
+
touching any product repository; committing, installing cockpit, recording a remote, untracking
|
|
125
|
+
a file or adding a test changes it for everyone who works on it. Where a gap needs judgement
|
|
126
|
+
(which test runner to adopt, whether the existing tests prove anything, where characterization
|
|
127
|
+
tests for untested code should live), propose with what you read and let the person decide.
|
|
128
|
+
- The `cockpit-installed` gap clears first: `init` ran from a temporary copy, so run
|
|
129
|
+
`npm install` in the cockpit root, then ask the person to run
|
|
130
|
+
`./node_modules/.bin/cockpit sync --config cockpit.toml` in a terminal so the guard hook runs
|
|
131
|
+
the installed copy.
|
|
132
|
+
- If anyone will run Codex in this cockpit, a person must trust its guard hook on each machine,
|
|
133
|
+
and again whenever sync changes the hook: Codex silently skips a project hook nobody has
|
|
134
|
+
trusted, so every tool call would run unguarded. An agent cannot give that trust. Ask the
|
|
135
|
+
person to run `codex -C <cockpit root>` in a terminal (not `codex exec`), trust the folder if
|
|
136
|
+
asked, and choose **Trust all and continue** when Codex shows **Hooks need review**. `doctor`
|
|
137
|
+
reports `CODEX_HOOK_UNTRUSTED` until it is done.
|
|
138
|
+
Done when `doctor` reports no required gap and every other gap is cleared or reported.
|
|
139
|
+
8. **Offer the product changes, one yes each.** "Use sensible defaults" never extends to writing
|
|
140
|
+
inside a product repository: an **AGENTS.md** pointer, a Compose file, a `package.json`, a
|
|
141
|
+
Dockerfile or a `.env.schema` in a sibling checkout each needs the person's explicit yes to that
|
|
142
|
+
exact change, because it changes the product for everyone who works on it.
|
|
143
|
+
- For a dedicated cockpit, offer an instruction pointer for each product repository. If the
|
|
144
|
+
product has no **AGENTS.md**, show the exact proposed file as a draft; if it has one, show the
|
|
145
|
+
marked block that would be appended without changing the team's text. After approval, set
|
|
146
|
+
`instruction_pointer = true` on that sibling's table in `cockpit.toml`; the guard then holds
|
|
147
|
+
every tool call until a person runs `./node_modules/.bin/cockpit sync --config cockpit.toml` in
|
|
148
|
+
a terminal. Then continue from step 4 of **Add or remove a repository** at its `setup` command. An in-repository cockpit already uses the root guide and must not point it at itself.
|
|
149
|
+
- After accepted initialization, and only with explicit permission to change the product's
|
|
150
|
+
fixtures or auth setup, read `references/test-data-and-personas.md` beside the cockpit-setup
|
|
151
|
+
skill and treat it as a separate product change. Bootstrap does not discover provider
|
|
152
|
+
identities or create browser state.
|
|
153
|
+
- For environment or secret adoption, follow **Secret handling** after sync has established its
|
|
154
|
+
owned ignore boundary.
|
|
155
|
+
Done when each offer is applied or declined.
|
|
156
|
+
|
|
157
|
+
Report the actual result, every gap still named, and every default you chose, with its field and
|
|
158
|
+
value, so the person can confirm or replace each.
|
|
159
|
+
|
|
160
|
+
## Create a local setup
|
|
161
|
+
|
|
162
|
+
Use this when a repository has no local setup: it has only ever run in CI, staging or a cluster,
|
|
163
|
+
so there is no Dockerfile, Compose file or documented way to start it on a laptop. Cockpit cannot
|
|
164
|
+
read a setup that does not exist, and a setup it guessed would look complete while holding
|
|
165
|
+
guesses. So derive each value from what the repository shows, record it as inferred, and let the human confirm it.
|
|
166
|
+
|
|
167
|
+
1. Read what the repository already states, without running or changing anything: the manifests and
|
|
168
|
+
lockfiles for the runtime and entrypoint, CI workflows for the services they start, deployment
|
|
169
|
+
files for the ports and variable names they inject, and the code for its health endpoint.
|
|
170
|
+
The init preview from **Bootstrap** already proposes several of these under `interview.outstanding`; reuse them
|
|
171
|
+
rather than re-deriving. Done when you hold a list of entrypoint and runtime, ports, environment
|
|
172
|
+
variable names, backing services with images, and a health endpoint, each with the file it came from.
|
|
173
|
+
2. Record variable names only. Values belong to whoever owns the secret; see **Secret handling**. Done when
|
|
174
|
+
no value from an env file, manifest or workflow appears in your notes or output.
|
|
175
|
+
3. Mark every derived value as `inferred` with its source file and the reason you read it from there.
|
|
176
|
+
Show the human the whole list and ask them to confirm or correct it. Done when the human has
|
|
177
|
+
answered for every inferred value; confirm one only on their word.
|
|
178
|
+
4. Turn each unknown into a named gap instead of a value: an undecided decision for data, mounts,
|
|
179
|
+
ports and restore, and an explicit vendor posture for every third-party endpoint. Cockpit renders
|
|
180
|
+
a subject with no decision as undecided, which keeps the gap visible. Done when each unknown is
|
|
181
|
+
named with who can resolve it, and nothing in the declaration was filled in to make it load.
|
|
182
|
+
Answer `environment.test_data` with exact booleans for `seeded_data` and `signed_in_users`. A false
|
|
183
|
+
answer is retained as a not-declared decision. A true answer is only a requirement: it remains unresolved
|
|
184
|
+
until product-owned seed operations or browser authentication states are declared, and never proves that
|
|
185
|
+
data or a login exists.
|
|
186
|
+
5. Decide where the runnable pieces live. A Dockerfile or Compose file written into a product
|
|
187
|
+
repository is a product change, so ask the human first and show the exact path and contents.
|
|
188
|
+
Without that permission, declare an environment cockpit renders itself and leave the product
|
|
189
|
+
untouched. Done when either the human approved that specific file or no product file was written.
|
|
190
|
+
6. Finish the configuration with the init flow in **Bootstrap**. On an existing cockpit, an edit to
|
|
191
|
+
`cockpit.toml` makes the guard hold every tool call, so a person runs
|
|
192
|
+
`./node_modules/.bin/cockpit sync --config cockpit.toml` in a terminal; then run
|
|
193
|
+
`./node_modules/.bin/cockpit check --config cockpit.toml --json`. Done when the check exits 0.
|
|
194
|
+
7. Where a runtime is declared, measure it with
|
|
195
|
+
`./node_modules/.bin/cockpit runtime measure --config cockpit.toml --image <local-image>`, using an
|
|
196
|
+
image already on this machine because the probe never pulls; with none, ask the person which to
|
|
197
|
+
use. It measures the local daemon `up` will use (the context `DOCKER_CONTEXT` names, or else the
|
|
198
|
+
active one), can run for minutes without output, records the result for this machine only and
|
|
199
|
+
leaves `cockpit.toml` unchanged, so no `sync` is needed. When Docker is missing or not running,
|
|
200
|
+
it and `up` refuse with `RUNTIME_UNAVAILABLE`: ask the person to start or install it. Then start
|
|
201
|
+
the stack with `./node_modules/.bin/cockpit up --config cockpit.toml`. Report the actual result.
|
|
202
|
+
Done when the stack reports healthy, or you have named what stopped it.
|
|
203
|
+
|
|
204
|
+
## Secret handling
|
|
205
|
+
|
|
206
|
+
Keep the tracked product `.env.schema` beside the component that owns it. Store only encrypted
|
|
207
|
+
Varlock resolver expressions or external-provider references under
|
|
208
|
+
`env/.secrets/<cockpit-project>/<component>`; the generated `env/.secrets/.gitignore` must be current,
|
|
209
|
+
the directory mode 0700, and resolver files mode 0600 before use. Ignoring, encryption and redaction
|
|
210
|
+
do not prevent same-user code from reading a resolved value. The agent receives schema and redacted
|
|
211
|
+
status, never a plaintext source.
|
|
212
|
+
|
|
213
|
+
Reuse the product's declared command or script. Resolve both paths to absolute paths from their owning
|
|
214
|
+
roots so the command is independent of its working directory; repeated Varlock paths are applied in
|
|
215
|
+
order, so the later central path takes precedence. For status the locked executable is invoked as
|
|
216
|
+
`varlock load --path <absolute-component-schema-root> --path
|
|
217
|
+
<absolute-cockpit-root>/env/.secrets/<cockpit-project>/<component> --agent --format json-full
|
|
218
|
+
--summary-stderr`. For a trusted product process it is invoked as `varlock run --path
|
|
219
|
+
<absolute-component-schema-root> --path <absolute-cockpit-root>/env/.secrets/<cockpit-project>/<component>
|
|
220
|
+
--inject vars --redact-stdout -- <exact command>`. The angle brackets describe product-resolved inputs,
|
|
221
|
+
not literal commands. Resolve the executable and version
|
|
222
|
+
from the product manifest and lock; runtime commands never fetch with `npx`. If the product has not
|
|
223
|
+
adopted Varlock, you need explicit permission to change the product before adding and locking it. `varlock init`,
|
|
224
|
+
provider login, encryption and secret migration stay with a person; preview their file and
|
|
225
|
+
provider scope instead of running them automatically.
|
|
226
|
+
|
|
227
|
+
Preflight and doctor already check the schema of every sibling that has a `.env.schema`; a failing row
|
|
228
|
+
names the keys, and `varlock load` in that sibling shows why.
|
|
229
|
+
|
|
230
|
+
Treat Varlock output as secret-tainted even in agent mode. Report variable names, validation state,
|
|
231
|
+
exit status and provenance only. Never copy raw resolved values, stdout or stderr into work-order
|
|
232
|
+
records. Varlock's credential proxy is preview software and same-user code is not confined here;
|
|
233
|
+
report secure agent secret use as unavailable unless a sandbox that has been tested proves it.
|
|
234
|
+
|
|
235
|
+
## Add or remove an agent tool
|
|
236
|
+
|
|
237
|
+
When the team starts or stops using an agent tool, the `tool` command edits only `[surfaces]
|
|
238
|
+
tools` in `cockpit.toml`. The guard asks before every `tool` command, the preview included, and
|
|
239
|
+
after the edit it holds every tool call until a person syncs.
|
|
240
|
+
|
|
241
|
+
1. Preview with `./node_modules/.bin/cockpit tool add <tool> --config cockpit.toml --dry-run` (or
|
|
242
|
+
`tool remove`) and show the person the list it prints. Done when they agree to that list.
|
|
243
|
+
2. Run it without `--dry-run`. Tell the person first that every tool call is held after it. Done
|
|
244
|
+
when the command exits 0.
|
|
245
|
+
3. The person runs `./node_modules/.bin/cockpit sync --config cockpit.toml` in a terminal: an added
|
|
246
|
+
tool's files are written from the same sources as the others, and a removed tool's files are
|
|
247
|
+
deleted as `[autonomy] stale_delete` allows. When sync refuses with
|
|
248
|
+
`GENERATED_STALE_APPROVAL_REQUIRED`, they rerun it with `--interactive` and type the
|
|
249
|
+
stale-removal digest it shows. Done when
|
|
250
|
+
`./node_modules/.bin/cockpit check --config cockpit.toml --json` exits 0.
|
|
251
|
+
|
|
252
|
+
## Add or remove a repository
|
|
253
|
+
|
|
254
|
+
Use this on an installed cockpit when a product gains or drops a repository. The `sibling`
|
|
255
|
+
command edits `cockpit.toml` so the repository is declared once, with its purpose, instead of
|
|
256
|
+
reached by path. The guard asks before every `sibling` command, and because the command writes
|
|
257
|
+
`cockpit.toml` immediately, the guard then holds every tool call until a person syncs.
|
|
258
|
+
|
|
259
|
+
1. **Propose the declaration.** Read the repository and ask the person for its purpose when no
|
|
260
|
+
source states it. Show the human the proposed sibling declaration before invoking the command:
|
|
261
|
+
slug, purpose, source mode, directory and exported variable. Done when the person approves it.
|
|
262
|
+
2. **Run the form that matches where the repository is.** Tell the person first that every tool
|
|
263
|
+
call is held after it. For a checkout already on disk, which must have an `origin` remote, run
|
|
264
|
+
`./node_modules/.bin/cockpit sibling add billing --config cockpit.toml --from ../billing --purpose "<purpose>" --json`;
|
|
265
|
+
for a new one run
|
|
266
|
+
`./node_modules/.bin/cockpit sibling add billing --config cockpit.toml --create --purpose "<purpose>" --json`
|
|
267
|
+
and hand the person `result.publish.command`, which creates the hosted repository; for a known
|
|
268
|
+
remote run
|
|
269
|
+
`./node_modules/.bin/cockpit sibling add billing --config cockpit.toml --remote <url> --purpose "<purpose>" --json`.
|
|
270
|
+
To drop one, run `./node_modules/.bin/cockpit sibling remove billing --config cockpit.toml --json`,
|
|
271
|
+
which refuses and lists every reference while anything still uses the repository, and never
|
|
272
|
+
deletes the checkout. The command writes cockpit.toml immediately; `--json` changes only its
|
|
273
|
+
output format, so it is neither a preview nor an acceptance gate. While the stack is up, a
|
|
274
|
+
repository the stack uses is refused until a person runs
|
|
275
|
+
`./node_modules/.bin/cockpit down --config cockpit.toml`. Done when the command exits 0.
|
|
276
|
+
3. **Sync.** The changed declaration affects the guard, so a human runs
|
|
277
|
+
`./node_modules/.bin/cockpit sync --config cockpit.toml` in a terminal. Then run
|
|
278
|
+
`./node_modules/.bin/cockpit check --config cockpit.toml --json`. Done when the check exits 0.
|
|
279
|
+
4. **Instruction pointer, only on request.** When the person wants the repository's **AGENTS.md**
|
|
280
|
+
to link to the cockpit instructions, add `--instruction-pointer` to the step 2 command; it opts
|
|
281
|
+
the sibling in and writes nothing there. A sibling already declared is opted in by setting
|
|
282
|
+
`instruction_pointer = true` on its table instead, followed by a person's sync. Then run
|
|
283
|
+
`./node_modules/.bin/cockpit setup --config cockpit.toml --json`; it reports the proposed
|
|
284
|
+
**AGENTS.md** path (`SETUP_INSTRUCTION_POINTER_OFFERED`) without writing it. If the guide is missing, show the exact new-file draft;
|
|
285
|
+
otherwise show the appended block and the preserved team text. After approval, run
|
|
286
|
+
`./node_modules/.bin/cockpit setup --config cockpit.toml --write-instruction-pointers`, which
|
|
287
|
+
writes only the marked block and refuses an edited, partial or duplicated existing one
|
|
288
|
+
(`SETUP_INSTRUCTION_POINTER_INVALID`). Done when the block is written or the person declined it.
|
|
289
|
+
5. Run `./node_modules/.bin/cockpit doctor --config cockpit.toml --json` and clear any
|
|
290
|
+
`sibling-instructions` gap for the new repository as **Make a repository's instructions reach
|
|
291
|
+
every tool** describes. Done when `doctor` reports no gap for it.
|
|
292
|
+
|
|
293
|
+
## Make a repository's instructions reach every tool
|
|
294
|
+
|
|
295
|
+
Each product repository's own instructions must reach every agent tool, not only the one its team
|
|
296
|
+
uses: Codex and OpenCode load **AGENTS.md** and Claude Code loads **CLAUDE.md**, so the shared text
|
|
297
|
+
belongs in AGENTS.md and CLAUDE.md starts with a line reading `@AGENTS.md`. The
|
|
298
|
+
`sibling-instructions` readiness gap names each repository laid out otherwise.
|
|
299
|
+
|
|
300
|
+
1. Run `./node_modules/.bin/cockpit setup --config cockpit.toml --json`. It reports
|
|
301
|
+
`SETUP_INSTRUCTION_FILES_OFFERED` for the two changes that need no judgement: a CLAUDE.md
|
|
302
|
+
importing an existing AGENTS.md, or a lone CLAUDE.md moved byte for byte into AGENTS.md. Done
|
|
303
|
+
when you know which repositories it offers and which need a proposal of yours.
|
|
304
|
+
2. Propose the files, read first. Before proposing a move, read the CLAUDE.md: lines only Claude
|
|
305
|
+
Code can act on (Claude Code commands, settings or tool names) go back into CLAUDE.md under the
|
|
306
|
+
`@AGENTS.md` line once moved, so show the person those lines and where each would go. When both
|
|
307
|
+
files exist without the import, read both and propose one AGENTS.md holding everything every
|
|
308
|
+
tool needs and a CLAUDE.md of `@AGENTS.md` plus Claude-only lines. When neither exists, or the
|
|
309
|
+
instructions sit in files such as **.cursorrules** or **GEMINI.md**, draft the AGENTS.md from
|
|
310
|
+
what you read. Done when the person has seen the exact text of every file.
|
|
311
|
+
3. After their yes to that exact text, run
|
|
312
|
+
`./node_modules/.bin/cockpit setup --config cockpit.toml --write-instruction-files` for the
|
|
313
|
+
offered changes, and edit the others by hand. A team's instruction file stays on disk: removing
|
|
314
|
+
one is the person's call. Done when `doctor` reports no `sibling-instructions` gap for the
|
|
315
|
+
repository.
|
|
316
|
+
|
|
317
|
+
## After upgrading cockpit
|
|
318
|
+
|
|
319
|
+
An upgrade changes the generated files that guard and instruct every agent, so it is reviewed,
|
|
320
|
+
never applied silently. Installing a new cockpit also makes the guard hold every tool call until
|
|
321
|
+
`sync` regenerates it for the new version.
|
|
322
|
+
|
|
323
|
+
1. **Upgrade in one command where you may.**
|
|
324
|
+
`./node_modules/.bin/cockpit upgrade --config cockpit.toml --dry-run` resolves the target and
|
|
325
|
+
prints the commands; show them to the person. `./node_modules/.bin/cockpit upgrade --config cockpit.toml`
|
|
326
|
+
(or `upgrade <version>`) then installs that exact release with the package manager the lockfile
|
|
327
|
+
names, runs `sync` in a new process, and prints the `Upgrade:` lines. An agent may run it where
|
|
328
|
+
`[autonomy] sync = "agent"`, the default; otherwise the guard asks, and the person runs it. When
|
|
329
|
+
its sync fails (`UPGRADE_SYNC_FAILED`, for example on stale removals that need approval), the new
|
|
330
|
+
version is already installed and the guard holds every tool call: a person acts on what sync
|
|
331
|
+
reported and runs `./node_modules/.bin/cockpit sync --config cockpit.toml --interactive` in a
|
|
332
|
+
terminal. Done when the command exits 0 and its sync wrote the new files.
|
|
333
|
+
2. **Or by hand.** `npm update` does not move the exact pin, so install the reviewed release by
|
|
334
|
+
version: `npm install --save-dev --save-exact @b00dea/cockpit@<version>`, and confirm the manifest
|
|
335
|
+
and lockfile show that exact version. From then on the guard holds every tool call, so a person
|
|
336
|
+
runs `./node_modules/.bin/cockpit sync --config cockpit.toml --dry-run` and then
|
|
337
|
+
`./node_modules/.bin/cockpit sync --config cockpit.toml --interactive` in a terminal. Done when
|
|
338
|
+
that sync exits 0.
|
|
339
|
+
3. **Review the diff.** A hand edit to a skill, agent settings file or cockpit-owned region stops
|
|
340
|
+
sync with `SURFACE_STATE_CONFLICT`: move that change into a `[surfaces].overlays` entry instead of
|
|
341
|
+
editing the generated file. An upgrade that changes something you overrode reports
|
|
342
|
+
`OVERRIDDEN_CORE_CHANGED`: review the new built-in against your override before updating its
|
|
343
|
+
recorded hash. Done when every changed file is accounted for.
|
|
344
|
+
4. **Do what sync does not.** Read the newly installed `./node_modules/@b00dea/cockpit/CHANGELOG.md`
|
|
345
|
+
between the old and new version for lines starting `Upgrade:`; each names a step that sync alone
|
|
346
|
+
does not do. Done when every `Upgrade:` line has been done or reported to the person.
|
|
347
|
+
5. **Commit together.** Ask the person to commit the lockfile and the regenerated files together.
|
|
348
|
+
Done when `./node_modules/.bin/cockpit check --config cockpit.toml --json` exits 0.
|
|
349
|
+
|
|
350
|
+
## Diagnose
|
|
351
|
+
|
|
352
|
+
1. Run `./node_modules/.bin/cockpit doctor --config cockpit.toml --json` first: it reports health,
|
|
353
|
+
wiring and `result.readiness` without repairing anything. Use
|
|
354
|
+
`./node_modules/.bin/cockpit preflight --config cockpit.toml --json` when the environment must
|
|
355
|
+
pass the blocking gate.
|
|
356
|
+
2. Follow the fix each diagnostic names, required gaps first. When the fix is a person's step
|
|
357
|
+
(trusting a Codex hook, signing in to a provider, approving a digest), hand them the exact
|
|
358
|
+
command it names. Done when `doctor` reports each gap cleared, or you have reported the ones
|
|
359
|
+
only a person can clear.
|
|
360
|
+
|
|
361
|
+
For an account of the result without changing anything, use the cockpit-explain skill.
|
|
362
|
+
|
|
363
|
+
## On drift
|
|
364
|
+
|
|
365
|
+
`check` reports drift as `GENERATED_ARTIFACT_DRIFT`, and the session-start hook prints the same
|
|
366
|
+
report before you work. Act on the fix it names:
|
|
367
|
+
|
|
368
|
+
1. **A sibling guide's copy is stale** (the message names the guide). Run
|
|
369
|
+
`./node_modules/.bin/cockpit sync --config cockpit.toml`, review the regenerated `AGENTS.md`, and
|
|
370
|
+
commit it together with the guide change. Under `[autonomy] sync = "person"` or `"ci"` the guard
|
|
371
|
+
stops that sync: ask the person to run it.
|
|
372
|
+
2. **A generated file was edited by hand** (`SURFACE_STATE_CONFLICT`). Move the change into
|
|
373
|
+
`cockpit.toml` or a `[surfaces].overlays` entry, then sync. Editing the generated file again only
|
|
374
|
+
moves the drift.
|
|
375
|
+
3. **A formerly generated file is still on disk.** If the fix says to run `sync`, `[autonomy]
|
|
376
|
+
stale_delete` lets it remove the file: run it and review what it removed. If the fix asks a
|
|
377
|
+
person to approve a digest, stop and ask them.
|
|
378
|
+
|
|
379
|
+
Done when `./node_modules/.bin/cockpit check --config cockpit.toml --json` exits 0.
|