@b00dea/cockpit 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +99 -0
- package/README.md +3 -0
- package/cockpit.schema.json +73 -3
- package/dist/autonomy.d.ts +3 -2
- package/dist/autonomy.js +30 -13
- package/dist/browser/commands.d.ts +57 -2
- package/dist/browser/commands.js +114 -10
- package/dist/browser/runtime.d.ts +1 -0
- package/dist/browser/runtime.js +4 -1
- package/dist/browser/surfaces.d.ts +7 -7
- package/dist/browser/surfaces.js +5 -0
- package/dist/canonical-json.d.ts +2 -0
- package/dist/canonical-json.js +5 -0
- package/dist/cli-main.d.ts +40 -3
- package/dist/cli-main.js +241 -62
- package/dist/command-table.d.ts +19 -11
- package/dist/command-table.js +190 -38
- package/dist/config/load.d.ts +16 -4
- package/dist/config/load.js +25 -3
- package/dist/config/unconfirmed-toml.d.ts +9 -0
- package/dist/config/unconfirmed-toml.js +29 -0
- package/dist/diagnostics.js +10 -1
- package/dist/docs/check.d.ts +16 -0
- package/dist/docs/check.js +197 -0
- package/dist/docs/decision-record.d.ts +34 -0
- package/dist/docs/decision-record.js +135 -0
- package/dist/docs/decisions.d.ts +16 -0
- package/dist/docs/decisions.js +103 -0
- package/dist/docs/markdown.d.ts +36 -0
- package/dist/docs/markdown.js +88 -0
- package/dist/docs/references.d.ts +32 -0
- package/dist/docs/references.js +148 -0
- package/dist/environment/application/confirm.d.ts +35 -0
- package/dist/environment/application/confirm.js +122 -0
- package/dist/environment/application/destructive.js +6 -2
- package/dist/environment/application/doctor.d.ts +12 -7
- package/dist/environment/application/doctor.js +20 -8
- package/dist/environment/application/guard.d.ts +12 -6
- package/dist/environment/application/guard.js +87 -32
- package/dist/environment/application/health.d.ts +14 -5
- package/dist/environment/application/health.js +8 -2
- package/dist/environment/application/lifecycle-context.d.ts +10 -3
- package/dist/environment/application/lifecycle-state.js +4 -3
- package/dist/environment/application/lifecycle.d.ts +2 -1
- package/dist/environment/application/lifecycle.js +11 -3
- package/dist/environment/application/services.d.ts +60 -0
- package/dist/environment/application/services.js +89 -0
- package/dist/environment/application/siblings.d.ts +43 -0
- package/dist/environment/application/siblings.js +269 -0
- package/dist/environment/claims.d.ts +10 -10
- package/dist/environment/claims.js +3 -11
- package/dist/environment/compose-topology.d.ts +15 -7
- package/dist/environment/compose-topology.js +100 -23
- package/dist/environment/contract.d.ts +42 -9
- package/dist/environment/contract.js +33 -0
- package/dist/environment/executable.d.ts +12 -0
- package/dist/environment/executable.js +46 -23
- package/dist/environment/generated-application/check.js +2 -0
- package/dist/environment/generated-application/prepare.js +2 -0
- package/dist/environment/generated-application/shared.d.ts +10 -2
- package/dist/environment/generated-application/shared.js +6 -1
- package/dist/environment/generated-application/surface-outputs.js +23 -12
- package/dist/environment/generated-application/surfaces.js +16 -11
- package/dist/environment/generated-application/sync.js +19 -4
- package/dist/environment/git-observation.d.ts +25 -6
- package/dist/environment/git-observation.js +37 -28
- package/dist/environment/health-composition.d.ts +3 -2
- package/dist/environment/health-composition.js +19 -2
- package/dist/environment/init-application.d.ts +39 -14
- package/dist/environment/init-application.js +39 -10
- package/dist/environment/lifecycle-composition.d.ts +4 -2
- package/dist/environment/lifecycle-composition.js +84 -17
- package/dist/environment/lifecycle-stage.d.ts +8 -3
- package/dist/environment/lifecycle-stage.js +11 -1
- package/dist/environment/logs.d.ts +1 -1
- package/dist/environment/map-limit.d.ts +2 -0
- package/dist/environment/map-limit.js +13 -0
- package/dist/environment/mcp-observation.d.ts +9 -0
- package/dist/environment/mcp-observation.js +46 -0
- package/dist/environment/observations.d.ts +1 -1
- package/dist/environment/observations.js +2 -0
- package/dist/environment/operator-application.d.ts +35 -6
- package/dist/environment/operator-application.js +42 -0
- package/dist/environment/presence.d.ts +4 -0
- package/dist/environment/presence.js +26 -0
- package/dist/environment/read-composition.d.ts +8 -3
- package/dist/environment/read-composition.js +53 -8
- package/dist/environment/readiness-composition.d.ts +20 -1
- package/dist/environment/readiness-composition.js +23 -2
- package/dist/environment/reclaim.d.ts +56 -19
- package/dist/environment/reclaim.js +147 -42
- package/dist/environment/runtime.d.ts +64 -18
- package/dist/environment/runtime.js +73 -3
- package/dist/environment/served-checkout-grants.d.ts +53 -0
- package/dist/environment/served-checkout-grants.js +182 -0
- package/dist/environment/sibling-checkouts.d.ts +119 -0
- package/dist/environment/sibling-checkouts.js +254 -0
- package/dist/environment/sibling-observation.d.ts +27 -0
- package/dist/environment/sibling-observation.js +45 -0
- package/dist/environment/sibling-pull.d.ts +23 -0
- package/dist/environment/sibling-pull.js +95 -0
- package/dist/environment/stack-inputs.d.ts +18 -0
- package/dist/environment/stack-inputs.js +210 -0
- package/dist/environment/stack-inventory-prune.d.ts +31 -0
- package/dist/environment/stack-inventory-prune.js +129 -0
- package/dist/environment/stack-inventory-report.d.ts +44 -0
- package/dist/environment/stack-inventory-report.js +78 -0
- package/dist/environment/stack-inventory.d.ts +94 -0
- package/dist/environment/stack-inventory.js +418 -0
- package/dist/environment/state.d.ts +48 -9
- package/dist/environment/state.js +142 -2
- package/dist/environment/tool-registration.js +3 -7
- package/dist/environment-exec/execute.d.ts +6 -3
- package/dist/environment-exec/execute.js +4 -0
- package/dist/fix-catalogue.d.ts +1 -1
- package/dist/generated-environment/adopt.js +4 -8
- package/dist/guards/answer-confirmation.d.ts +41 -0
- package/dist/guards/answer-confirmation.js +109 -0
- package/dist/guards/evaluator.d.ts +20 -3
- package/dist/guards/evaluator.js +39 -7
- package/dist/guards/local-identity.d.ts +6 -2
- package/dist/guards/local-identity.js +10 -4
- package/dist/guards/policy-change.d.ts +43 -0
- package/dist/guards/policy-change.js +159 -0
- package/dist/guards/policy-pin.d.ts +1 -1
- package/dist/guards/policy-pin.js +14 -12
- package/dist/init/command.d.ts +4 -3
- package/dist/init/command.js +36 -16
- package/dist/init/derive.d.ts +8 -6
- package/dist/init/derive.js +140 -36
- package/dist/init/draft.d.ts +13 -11
- package/dist/init/draft.js +54 -31
- package/dist/init/render.d.ts +18 -6
- package/dist/init/render.js +31 -9
- package/dist/repository-path.d.ts +9 -0
- package/dist/repository-path.js +16 -0
- package/dist/schema.d.ts +42 -75
- package/dist/schema.js +62 -11
- package/dist/surfaces/harness-registry.d.ts +80 -0
- package/dist/surfaces/harness-registry.js +29 -0
- package/dist/surfaces/mcp.d.ts +67 -17
- package/dist/surfaces/mcp.js +194 -31
- package/dist/surfaces/projection.d.ts +7 -7
- package/dist/surfaces/projection.js +41 -6
- package/dist/surfaces/render.d.ts +5 -44
- package/dist/surfaces/render.js +5 -2
- package/dist/team-metadata.js +2 -1
- package/dist/testing/test-protection.d.ts +34 -0
- package/dist/testing/test-protection.js +137 -0
- package/dist/testing/weakening.d.ts +15 -0
- package/dist/testing/weakening.js +30 -0
- package/dist/work-orders/application-closure.d.ts +7 -0
- package/dist/work-orders/application-closure.js +76 -0
- package/dist/work-orders/application-context.d.ts +162 -0
- package/dist/work-orders/application-context.js +137 -0
- package/dist/work-orders/application-decisions.d.ts +27 -0
- package/dist/work-orders/application-decisions.js +121 -0
- package/dist/work-orders/application-grading.d.ts +11 -0
- package/dist/work-orders/application-grading.js +212 -0
- package/dist/work-orders/application.d.ts +4 -97
- package/dist/work-orders/application.js +94 -254
- package/dist/work-orders/composition.d.ts +35 -58
- package/dist/work-orders/composition.js +216 -24
- package/dist/work-orders/contract.d.ts +22 -6
- package/dist/work-orders/contract.js +34 -16
- package/dist/work-orders/decisions.d.ts +23 -0
- package/dist/work-orders/decisions.js +55 -0
- package/dist/work-orders/store.d.ts +54 -5
- package/dist/work-orders/store.js +118 -24
- package/docs/README.md +6 -3
- package/docs/capability-matrix.md +17 -9
- package/docs/cli-reference.md +209 -1
- package/docs/command-list.md +12 -1
- package/docs/concepts.md +6 -4
- package/docs/configuration-essentials.md +7 -2
- package/docs/configuration-reference.md +18 -3
- package/docs/docs-check.md +76 -0
- package/docs/environment.md +194 -6
- package/docs/faq.md +5 -3
- package/docs/getting-started.md +109 -25
- package/docs/harness-surfaces.md +69 -2
- package/docs/safety-and-autonomy.md +56 -12
- package/docs/troubleshooting.md +29 -8
- package/docs/tutorial.md +3 -2
- package/docs/work-and-browser.md +180 -14
- package/libexec/browser-operation.cjs +86 -2
- package/package.json +2 -2
- package/surfaces/skills/cockpit-browser.skill.md +7 -2
- package/surfaces/skills/cockpit-explain.skill.md +1 -1
- package/surfaces/skills/cockpit-fix.skill.md +1 -1
- package/surfaces/skills/cockpit-setup.skill.md +3 -3
- package/surfaces/skills/cockpit-work.skill.md +1 -1
- package/surfaces/skills/procedures/explain.md +9 -4
- package/surfaces/skills/procedures/fix.md +25 -11
- package/surfaces/skills/procedures/setup.md +113 -40
- package/surfaces/skills/procedures/work.md +45 -16
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,105 @@ file layout, and the overlay contract. Deprecation and migration rules are in th
|
|
|
13
13
|
|
|
14
14
|
<!-- Changesets inserts each release above the first version heading, so this heading keeps the introduction above every release. -->
|
|
15
15
|
|
|
16
|
+
## 0.1.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 88f97b6: Browser route findings are evidence, not a gate. `browser drive` with findings now exits 0 and carries `verdict: findings` with the full receipt; `--fail-on-findings` restores exit 2 (`BROWSER_ROUTE_FINDINGS`) for a criterion that wants a clean route. Each route also carries an `excerpt` of up to five console and uncaught error messages, 240 bytes each, tagged `untrusted-page-content`, so a favicon 404 can be told from a broken API call. The excerpt is read only when `[browser.data]` is isolated, not restored and not reaching production; otherwise it is omitted with the reason.
|
|
21
|
+
|
|
22
|
+
`browser.request_preapproval` now defaults to on when `[browser.data]` qualifies for it and to off otherwise; an explicit value still wins, and `true` on a posture that does not qualify is still refused.
|
|
23
|
+
|
|
24
|
+
The command after `cockpit exec --service <s> --` runs in the container's filesystem, so the guard no longer proves it read-only: it stays subject to the name-based denials and is admitted only by a `[guards] allow` rule or a declared build or test command, and otherwise asks.
|
|
25
|
+
|
|
26
|
+
`init` lists the `COMPOSE_IMAGE_TAG_SHARED` finding beside the other Compose findings.
|
|
27
|
+
- 6058a69: `browser drive` now reports what each route's page did wrong, not only that it loaded: console errors, uncaught page errors, and failed or 4xx/5xx requests to the application's own origin, with method, URL path (no query) and status, plus counts of warnings, aborted requests and third-party traffic. Each route gets a `clean` or `findings` verdict, at most 20 entries are kept per route, and message text, bodies, headers and cookies are never read. With `--fail-on-findings` a drive with findings exits 2 with `BROWSER_ROUTE_FINDINGS`, so it works as a work-order criterion check that demands a clean route; without it the findings are evidence and the drive exits 0. `--route <name-or-path>` drives or captures a single declared route.
|
|
28
|
+
- 1752c64: `cockpit check` now refuses a Compose service that sets `container_name`. Docker allows one container
|
|
29
|
+
of a name, so the second checkout's `up` failed at runtime, which breaks the one-stack-per-checkout
|
|
30
|
+
promise; the finding is `COMPOSE_CONTAINER_NAME_FIXED`, an error like `COMPOSE_PORT_NOT_LEASED`, and
|
|
31
|
+
`init` shows it beside the drafted `cockpit.toml`. The install instructions now name the pnpm and
|
|
32
|
+
yarn equivalents.
|
|
33
|
+
|
|
34
|
+
Upgrade: remove `container_name` from each Compose service `check` names and address the service by
|
|
35
|
+
its Compose service name or `docker compose exec <service>`.
|
|
36
|
+
- 1cd11c3: Compose profiles now activate. `[environment] profiles` lists the profiles every `up` and `session`
|
|
37
|
+
starts, and `up --profile <name>` (repeatable, also on `session`) adds more for a run. The stack
|
|
38
|
+
records its profile set, so `down`, `sleep`, `logs`, `preflight` and the service verbs act on the
|
|
39
|
+
same services, and a `profile:<name>` sibling is mounted while its profile is active. A profile no
|
|
40
|
+
service declares is refused with `COMPOSE_PROFILE_UNDEFINED`; adding a profile to a running stack
|
|
41
|
+
is refused like any other change, so run `down`, then `up --profile <name>`.
|
|
42
|
+
|
|
43
|
+
New service verbs act on this checkout's own stack without naming its Compose project: `ps`,
|
|
44
|
+
`restart --service <name>`, `rebuild --service <name>` and `exec --service <name> -- <command>`.
|
|
45
|
+
The guard admits them like `up`. The command after `exec --` runs inside the container, where the guard cannot see files, so it is never treated as read-only: it runs without asking only when a `[guards] allow` rule or a declared build or test command matches it. An agent's `--profile` runs without asking only for a profile in `environment.profiles` that mounts no operator-gated sibling.
|
|
46
|
+
|
|
47
|
+
`check` refuses a built service with a fixed `image` tag (`COMPOSE_IMAGE_TAG_SHARED`), because one
|
|
48
|
+
checkout's build replaced the image another checkout's stack ran, and now judges bind mounts of
|
|
49
|
+
profile-gated services under their profiles instead of refusing them.
|
|
50
|
+
|
|
51
|
+
Upgrade: run cockpit sync, so Claude Code may run the new verbs without asking.
|
|
52
|
+
- e7da68a: `cockpit confirm <answer> --config <file>` clears an `unconfirmed` entry once the observation that verifies it passes on this machine: `preflight` with the stack up for `ports.bases`, `check` for `environment.compose_files`, and the measured runtime against the declared floor for `environment.machine`. It removes only that entry from `cockpit.toml`, keeping comments, and records what ran, when, the result and an evidence digest in `.cockpit/local/answer-confirmations`, which the guard keeps agents from writing. The guard treats the removal as non-widening only while that record matches the configuration, so an agent's own sync applies it where `[autonomy] sync = "agent"`; a missing, stale or forged record still holds it for a person. A failed observation is refused with `CONFIRM_OBSERVATION_FAILED`, and the trust decisions (`guards`, `testing`, `environment.install_policies`, `sibling`, `environment.posture`) and the answers no observation settles (`cockpit.name`, `estate.runnable`, `environment.test_data`) with `CONFIRM_PERSON_REQUIRED`.
|
|
53
|
+
|
|
54
|
+
`DECLARATION_UNCONFIRMED` now names `cockpit confirm` for the answers an observation settles and says a person confirms the rest.
|
|
55
|
+
- 55fca43: New `cockpit docs check` command and `[docs]` table. `living` lists globs of documents that must stay true, in the cockpit's repository or `<sibling slug>:` in a sibling; the command reports `DOCS_REFERENCE_REMOVED` for a path a living document cites that the repository history deleted or renamed (naming the new path), and `DOCS_TARGET_REMOVED` for a `make` target a Makefile once defined and no longer does. A path or target that never existed is not reported. The optional `decisions` and `decisions_index` keys check a decision-record set: `DECISION_NUMBER_REUSED`, `DECISION_UNINDEXED`, `DECISION_INDEX_ENTRY_MISSING`, `DECISION_STATUS_MISSING`, `DECISION_LINK_UNRESOLVED` and `DECISION_SUPERSEDED_STALE`. It exits 2 on any finding, supports `--json`, refuses with `DOCS_NOT_DECLARED` without a `[docs]` table and reports `DOCS_DECLARATION_UNMATCHED` for an entry that matches nothing. The guard admits it for agents because it only reads, the generated Claude Code settings allow it without a prompt, and `doctor` names it when `[docs]` is declared. Run `cockpit sync` to pick up the new allow rule.
|
|
56
|
+
- 33e2085: Every Git command cockpit runs now carries `core.fsmonitor=false` and `core.hooksPath=/dev/null`, including the `ls-files` and `log` reads behind `docs check`. `pull` skips a checkout whose own Git configuration sets `core.sshCommand`, `core.askPass`, `core.gitProxy`, `credential.helper` or a remote's `uploadpack`/`receivepack`, as `PULL_SKIPPED` naming the key, because the fetch would run that command.
|
|
57
|
+
|
|
58
|
+
Browser console and error excerpts are redacted like other diagnostics and lose URL query strings and fragments before they are kept as evidence. `docs check` redacts Git's error text in its diagnostics.
|
|
59
|
+
- c5ea35d: Grading now detects a change that weakens tests: deleted test files, skipped or focused tests, suppressed checks, removed or loosened assertions, and narrowed test configuration, judged against the order's recorded base commits. Under `checks` grading such a change fails until it is acknowledged with the new `work acknowledge` command (`[work.gates] acknowledge`, default `agent`); under `independent` and `self` grading the findings are judged as the `test-changes-justified` criterion instead. `[testing] test_files` declares which files are tests; common layouts are the default.
|
|
60
|
+
- 0fdaf04: The guard's pin on `[work]`, `[work.gates]` and `[autonomy]` now judges the command after `cockpit exec --service <s> --` as a command of its own, as it already did for `cockpit session`. Before, a container command that named `cockpit.toml` after its own `--config` was taken for cockpit's `--config` operand and let through. Because the command runs in the container, no read-only spelling excuses it from the pin either.
|
|
61
|
+
- 69a3d9a: `sync` refuses a sibling guide that is, or links to, a `.env` or `.env.*` file, a file below a
|
|
62
|
+
`.secrets` directory or a declared environment instance, with `PROJECTION_GUIDE_SECRET`, instead of
|
|
63
|
+
copying its contents into the root `AGENTS.md` that every agent reads.
|
|
64
|
+
|
|
65
|
+
The guard admits `up --profile <name>` and `session --profile <name>` from an agent only for a
|
|
66
|
+
profile already in `environment.profiles` that mounts no sibling with `gate = "operator"`; any other
|
|
67
|
+
profile asks for a person.
|
|
68
|
+
- e17d668: An agent can now apply its own `cockpit.toml` edit when the edit does not widen what agents may do.
|
|
69
|
+
After any edit the guard still holds every tool call, but it compares the edit with the configuration
|
|
70
|
+
the guards were generated from: when the edit only rewords a sibling's purpose, moves a port, adds a
|
|
71
|
+
derived route, an agent tool or an operator gate, or removes a Compose file, profile or resettable
|
|
72
|
+
volume, the guard admits `cockpit sync` and `cockpit check` from the agent (where `[autonomy] sync =
|
|
73
|
+
"agent"`) and reports `GUARD_CONFIG_UNSYNCED`. Any other edit keeps the person-only hold, whose
|
|
74
|
+
message now names each field that widens: any change to `[guards]`, `[work]`, `[autonomy]`, `[mcp]`,
|
|
75
|
+
`[testing]` or `[browser]`, a new sibling, a sibling's changed directory, guides or environment files,
|
|
76
|
+
a command field, and a field the classification has no rule for. `check` reports the same
|
|
77
|
+
classification, `GUARD_CONFIG_WIDENED` as an error and `GUARD_CONFIG_UNSYNCED` as a warning. Sync
|
|
78
|
+
keeps the configuration it generated the guards from in `.cockpit/local/guard-config`. An agent may
|
|
79
|
+
now run `cockpit tool add`; `tool remove`, `sibling add` and `sibling remove` stay a person's.
|
|
80
|
+
- bf769dc: `init` now lets the setup agent accept what it read from exact sources. Each proposal in `interview.outstanding` carries `provenance.kind` (`derived`, `measured` or `inferred`) and each field a `confirmedBy` of `agent` or `person`. An answers file can mark `cockpit.name`, `ports.bases` and `environment.compose_files` as `"derived"`, with or without a value: init answers with the value it read, refuses a different one with `DOCUMENT_CONFIGURATION_ANSWER_NOT_DERIVED`, and records the source file and line in `cockpit.toml` and `result.derived` instead of listing the field as unconfirmed. The defaults digest now covers only the security boundaries (protected branches, guard allow and deny lists, approved MCP servers, resettable volumes, generated host paths), and the draft shows which values a person confirms. The machine floor is proposed: memory and CPUs from the Compose file's service limits, or from this machine's measured container runtime where no limit records them; free disk and cold start are never proposed.
|
|
81
|
+
- 4c96d73: Add `cockpit stacks`, which lists every stack on this machine with its checkout, state, containers,
|
|
82
|
+
volumes, port lease and last activity, and `cockpit stacks prune`, which previews and, with `--apply`,
|
|
83
|
+
removes the stacks whose checkout is gone, such as a deleted worktree's, together with their
|
|
84
|
+
containers, networks, labelled volumes, port lease and state. A checkout is proven from Compose's
|
|
85
|
+
working-directory label or from the checkouts Git records for the cockpit, never from names; a stack
|
|
86
|
+
whose checkout exists is never touched. State this version cannot read is listed and kept, except
|
|
87
|
+
state folders in the spelling an earlier build used, which are pruned once none of their stacks is
|
|
88
|
+
kept. A prune that deletes volumes follows `[autonomy] reset`; otherwise a person approves it with
|
|
89
|
+
`--interactive`. `doctor` now warns with `STACKS_ORPHANED`, and its warning
|
|
90
|
+
about unreadable state folders names `stacks prune` instead of a manual `rm -rf`.
|
|
91
|
+
- 98b824a: A `.cockpit/policy.json` written by 0.1.0, which has no `[work.gates] acknowledge`, no longer makes every `work` command, `sync` and `doctor` refuse it as malformed: a missing decider is read as `person`, so the new `agent` default is reported as the weakening `work.gates.acknowledge: person -> agent`, which a person accepts with `sync --interactive`. A record with an unknown key still refuses, and now says what to do when the committed copy is the damaged one. A grade that finds an agent's amendments lower the bar stays on the order until a person or CI amends it, so a later `work check` no longer lets the agent amend again. Two concurrent `work recover --apply` runs no longer both take over a dead lock and delete each other's: one takes it over and the other refuses. `work decide` writes decision records and the index line through descriptors checked against the confined path, so a directory swapped for a link while the record is opened no longer redirects the write outside the repository.
|
|
92
|
+
- 2b8f74c: A sibling's MCP declaration can now list remote (streamable HTTP) servers in Claude Code's spelling: `type: "http"`, a `url` (https, or http only to loopback), `headers` whose values are only `${NAME}` or `Bearer ${NAME}` references, and an optional `headersHelper` command that prints the headers when the tool connects. They are approved by digest like local servers, so a changed URL, header or helper needs a new approval. `sync` writes each tool's native form (Claude Code `.mcp.json`, Codex `bearer_token_env_var`, `env_http_headers` and `http_headers_helper`, OpenCode `{env:NAME}` headers); a tool that cannot carry the credential, OpenCode for a helper and Cursor and Grok Build for any remote server, gets nothing and `sync` and `check` warn `MCP_TRANSPORT_UNAVAILABLE`. SSE servers and literal header values are refused. `doctor` now warns `MCP_COMMAND_UNRESOLVED` when an approved server's command or helper does not resolve and `MCP_ENVIRONMENT_UNSET` when a variable it reads is unset, without starting a server or using the network.
|
|
93
|
+
- 9e514aa: `cockpit use <slug> <checkout>` serves a sibling from another checkout of its repository, such as a
|
|
94
|
+
linked worktree, for this cockpit checkout only; `use <slug> --clear` goes back to the declared one.
|
|
95
|
+
The stack's mounts, `logs`, the guard's allowed roots and protected instance files, `doctor` and
|
|
96
|
+
`preflight` all follow it, a checkout of a different repository is refused, and a worktree missing a
|
|
97
|
+
declared environment file is reported, never filled in. `cockpit pull` fetches and fast-forwards the
|
|
98
|
+
cockpit and every sibling to its upstream, skipping and reporting any checkout with modified files, a
|
|
99
|
+
diverged branch or a failed fetch; agents may run it. `up` now records each mounted sibling's
|
|
100
|
+
lockfiles and the new `rebuild_inputs` paths, and `doctor`, `preflight` and `pull` warn with
|
|
101
|
+
`STACK_INPUTS_CHANGED` when they change under a running stack.
|
|
102
|
+
- 090c027: Preflight and doctor now fail when a checkout recorded by `cockpit use` no longer exists, as `up` already refuses it. Before, they only warned, so the gate passed a stack `up` could not start.
|
|
103
|
+
- 1f3618c: Work orders and `docs check` read a sibling where `cockpit use` serves it. Heads, changes, test-weakening detection, grades, test gates and `docs check` used the checkout cockpit.toml declares even while the stack ran a worktree, so a grade could pass work it never saw; they now read the served checkout, and refuse with `SIBLING_CHECKOUT_UNAVAILABLE` when that checkout is gone.
|
|
104
|
+
|
|
105
|
+
`work decide --supersedes` reads decision records as `docs check` does. It marks a record whose status is a `- Status:` or `__Status__:` line, the line under a `## Status` heading, or CRLF front matter, rewriting it in place, and it no longer rewrites a `Status:` line inside a code fence. A record named `0012_x.md` is numbered 12 when choosing the next record's number.
|
|
106
|
+
- 45095f0: `stacks prune --apply` now removes only the running cockpit's orphaned stacks, plus the state folders an earlier build left. Before, it covered every cockpit on the machine while checking only the running cockpit's `[autonomy] reset`, so an agent could delete the volumes of a cockpit that requires a person. Another cockpit's orphans are still listed in the preview, marked `thisCockpit: false` with a `STACKS_PRUNE_UNCONFIRMED` warning, and a person removes them with `stacks prune --interactive`.
|
|
107
|
+
|
|
108
|
+
A worktree whose path is missing while Git still registers it, or marks it locked, is no longer taken for gone: its checkout is `unknown` and its stack is kept, since an unmounted drive or share, or a checkout moved without `git worktree repair`, looks the same. Run `git worktree prune` (after `git worktree unlock` for a locked worktree) once the checkout is really gone, and the next prune removes its stack.
|
|
109
|
+
- 546232c: `cockpit use` now grants the agent tools a checkout outside the declared one, so they no longer prompt or refuse edits there. Claude Code gets it in `.claude/settings.local.json` (`use` keeps everything else in that file and `use --clear` removes only the entry it added), and OpenCode gets it in its machine-local grant file, which `sync` now keeps. Codex has no machine-local setting for this, so `use` tells you to start it with `--add-dir <checkout>`; Cursor and Grok Build get nothing and `use` says so. `--json` reports the tools as `agentGrants`. `use` also refuses with `EVIDENCE_UNAVAILABLE` when the declared checkout exists but cannot be resolved, instead of guessing its path, and `pull` reports a checkout whose repository cannot be resolved with `PULL_SKIPPED` under its label, where it used to report it as missing.
|
|
110
|
+
- 913a385: Work orders hand judgement to the grading model instead of a fixed rule or a person. Under `independent` and `self` grading, a change outside `scope` no longer fails the grade by itself: it becomes the standing criterion `scope-changes-necessary`; flagged test changes become `test-changes-justified`, judged against the diff with any acknowledgement notes as context; and an agent's amendment that rewrites a criterion, widens `scope`, or drops a non-goal or rewords the objective is recorded with its before and after and judged at the next grade as `amendments-hold-bar`, whose failure makes the next amendment a person's. Under `self` the `--note` must name each such path. `checks` grading keeps the hard rules, and now also needs a person for an agent's scope widening. Removing a criterion or gate always needs a person. `[work.gates] acknowledge` now defaults to `agent`, so a cockpit that left it unset reports the change as a policy weakening at its next sync. `work recover --apply` is open to agents: it checks the lock's recorded host and the containers cockpit labels before removing a lock, refuses when it cannot show the holder gone, and records what it checked in the order's record. The attempt-cap refusal names who closes or amends the order as `[work.gates]` says.
|
|
111
|
+
- e54c63d: Work orders record their lasting decisions. With `[docs] decisions` declared, `work note --decision --text "<title>"` records a decision on an order and `work decide` resolves it: `--record` writes the next numbered decision record (with `Work order:` back-link, placeholders to fill and an index line in `decisions_index`), optionally marking an older one `superseded by` it with `--supersedes`; `--record-file` cites an existing record; `--none --reason` says it is not lasting. `work signoff` refuses every closure while a decision is unresolved or its record still holds placeholders, `work verify` fails when a cited record is gone or no longer names its order, and `work status` lists open decisions. `work accept` and `work status` list decision records that name paths in the order's scope. Under `independent` and `self` grading, a declared `[docs]` adds the standing criteria `decisions-recorded` and `docs-updated` to every grade.
|
|
112
|
+
|
|
113
|
+
A work-order scope or source spelled `<sibling>:../path` is now refused when the order is read, as `../path` already was.
|
|
114
|
+
|
|
16
115
|
## 0.1.0
|
|
17
116
|
|
|
18
117
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -15,6 +15,9 @@ Install it as an exact, project-local dev dependency (the package is pre-alpha,
|
|
|
15
15
|
npm install --save-dev --save-exact @b00dea/cockpit
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
+
With pnpm or yarn, use `pnpm add -D -E @b00dea/cockpit` or `yarn add -D -E @b00dea/cockpit`, and run
|
|
19
|
+
`pnpm exec cockpit` or `yarn cockpit` in place of running it through `npx --no`.
|
|
20
|
+
|
|
18
21
|
Start with the [repository README](https://github.com/b0dea/cockpit#readme) and
|
|
19
22
|
[Getting started](https://github.com/b0dea/cockpit/blob/main/docs/getting-started.md#install-cockpit).
|
|
20
23
|
|
package/cockpit.schema.json
CHANGED
|
@@ -191,6 +191,15 @@
|
|
|
191
191
|
"additionalProperties": false
|
|
192
192
|
}
|
|
193
193
|
},
|
|
194
|
+
"rebuild_inputs": {
|
|
195
|
+
"description": "Files or directories in the sibling, beyond its lockfiles, whose change leaves a running stack stale, such as a migrations directory.",
|
|
196
|
+
"maxItems": 64,
|
|
197
|
+
"type": "array",
|
|
198
|
+
"items": {
|
|
199
|
+
"type": "string",
|
|
200
|
+
"pattern": "^(?!\\/)(?![A-Za-z][A-Za-z0-9+.-]*:)(?!.*(?:^|\\/)\\.{1,2}(?:\\/|$))(?!.*\\\\)(?:[^/\\x00-\\x1f\\x7f]+\\/)*[^/\\x00-\\x1f\\x7f]+$"
|
|
201
|
+
}
|
|
202
|
+
},
|
|
194
203
|
"derives": {
|
|
195
204
|
"description": "Facts about the sibling that cockpit derives rows or MCP servers from.",
|
|
196
205
|
"type": "object",
|
|
@@ -760,7 +769,7 @@
|
|
|
760
769
|
]
|
|
761
770
|
},
|
|
762
771
|
"amend": {
|
|
763
|
-
"description": "Who accepts a changed contract. Default agent. Removing
|
|
772
|
+
"description": "Who accepts a changed contract. Default agent. Removing an accepted criterion or gate always needs a person or ci; an agent's rewrite of a criterion, scope, non-goal or objective is judged at the next grade, and needs a person under checks grading.",
|
|
764
773
|
"type": "string",
|
|
765
774
|
"enum": [
|
|
766
775
|
"agent",
|
|
@@ -785,6 +794,15 @@
|
|
|
785
794
|
"person",
|
|
786
795
|
"ci"
|
|
787
796
|
]
|
|
797
|
+
},
|
|
798
|
+
"acknowledge": {
|
|
799
|
+
"description": "Who acknowledges that an order weakened tests, which checks grading otherwise fails; under independent and self grading the acknowledgement is context for the verdict. Default agent.",
|
|
800
|
+
"type": "string",
|
|
801
|
+
"enum": [
|
|
802
|
+
"agent",
|
|
803
|
+
"person",
|
|
804
|
+
"ci"
|
|
805
|
+
]
|
|
788
806
|
}
|
|
789
807
|
},
|
|
790
808
|
"additionalProperties": false
|
|
@@ -1137,8 +1155,7 @@
|
|
|
1137
1155
|
"description": "Statement about the data the browser touches; cockpit cannot observe it."
|
|
1138
1156
|
},
|
|
1139
1157
|
"request_preapproval": {
|
|
1140
|
-
"
|
|
1141
|
-
"description": "Run browser tools without prompts; allowed only on isolated, non-production, non-restored data.",
|
|
1158
|
+
"description": "Run browser tools without prompts; allowed only on isolated, non-production, non-restored data. Defaults to true when data qualifies and false otherwise.",
|
|
1142
1159
|
"type": "boolean"
|
|
1143
1160
|
},
|
|
1144
1161
|
"artifacts": {
|
|
@@ -1225,6 +1242,18 @@
|
|
|
1225
1242
|
"description": "Test stages and gates.",
|
|
1226
1243
|
"type": "object",
|
|
1227
1244
|
"properties": {
|
|
1245
|
+
"test_files": {
|
|
1246
|
+
"description": "Paths and globs, relative to each checkout, that hold tests. Grading fails an order that deletes, skips or loosens what they match. Defaults to common layouts.",
|
|
1247
|
+
"minItems": 1,
|
|
1248
|
+
"maxItems": 64,
|
|
1249
|
+
"type": "array",
|
|
1250
|
+
"items": {
|
|
1251
|
+
"type": "string",
|
|
1252
|
+
"minLength": 1,
|
|
1253
|
+
"maxLength": 512,
|
|
1254
|
+
"pattern": "^(?!\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))[A-Za-z0-9._@+\\-/*?]+$"
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1228
1257
|
"stages": {
|
|
1229
1258
|
"minItems": 1,
|
|
1230
1259
|
"maxItems": 128,
|
|
@@ -1607,6 +1636,17 @@
|
|
|
1607
1636
|
},
|
|
1608
1637
|
"uniqueItems": true
|
|
1609
1638
|
},
|
|
1639
|
+
"profiles": {
|
|
1640
|
+
"default": [],
|
|
1641
|
+
"description": "Compose profiles every up and session activates; up --profile adds more for one run.",
|
|
1642
|
+
"maxItems": 64,
|
|
1643
|
+
"type": "array",
|
|
1644
|
+
"items": {
|
|
1645
|
+
"type": "string",
|
|
1646
|
+
"maxLength": 64,
|
|
1647
|
+
"pattern": "^[a-z0-9][a-z0-9_.-]*$"
|
|
1648
|
+
}
|
|
1649
|
+
},
|
|
1610
1650
|
"entrypoint_derivatives": {
|
|
1611
1651
|
"default": [],
|
|
1612
1652
|
"description": "Addresses derived from leased ports, such as application origins and callback URLs.",
|
|
@@ -2342,6 +2382,36 @@
|
|
|
2342
2382
|
}
|
|
2343
2383
|
},
|
|
2344
2384
|
"additionalProperties": false
|
|
2385
|
+
},
|
|
2386
|
+
"docs": {
|
|
2387
|
+
"description": "Living documents and decision records: docs check keeps them true, and work orders record their decisions there.",
|
|
2388
|
+
"type": "object",
|
|
2389
|
+
"properties": {
|
|
2390
|
+
"living": {
|
|
2391
|
+
"default": [],
|
|
2392
|
+
"description": "Globs of the Markdown documents that must stay true; docs check reports the paths and make targets they cite that the repository has since removed.",
|
|
2393
|
+
"maxItems": 64,
|
|
2394
|
+
"type": "array",
|
|
2395
|
+
"items": {
|
|
2396
|
+
"type": "string",
|
|
2397
|
+
"maxLength": 1024,
|
|
2398
|
+
"pattern": "^(?!(?:[a-z0-9][a-z0-9-]{0,63}:)?(?:.*\\/)?\\.\\.(?:\\/|$))(?:[a-z0-9][a-z0-9-]{0,63}:)?(?![/])[A-Za-z0-9._@+\\-/*?]+$"
|
|
2399
|
+
}
|
|
2400
|
+
},
|
|
2401
|
+
"decisions": {
|
|
2402
|
+
"description": "Directory of decision records, such as docs/adr. Work orders record their lasting decisions there, and docs check reports duplicate numbers, missing statuses and broken supersedes links.",
|
|
2403
|
+
"type": "string",
|
|
2404
|
+
"maxLength": 1024,
|
|
2405
|
+
"pattern": "^(?!(?:[a-z0-9][a-z0-9-]{0,63}:)?(?:.*\\/)?\\.\\.?(?:\\/|$))(?:[a-z0-9][a-z0-9-]{0,63}:)?(?![/])[A-Za-z0-9._@+\\-/]*[A-Za-z0-9._@+-]$"
|
|
2406
|
+
},
|
|
2407
|
+
"decisions_index": {
|
|
2408
|
+
"description": "Index file that links every decision record; a record cockpit writes is appended to it, and docs check reports records it omits and links to records that do not exist.",
|
|
2409
|
+
"type": "string",
|
|
2410
|
+
"maxLength": 1024,
|
|
2411
|
+
"pattern": "^(?!(?:[a-z0-9][a-z0-9-]{0,63}:)?(?:.*\\/)?\\.\\.?(?:\\/|$))(?:[a-z0-9][a-z0-9-]{0,63}:)?(?![/])[A-Za-z0-9._@+\\-/]*[A-Za-z0-9._@+-]$"
|
|
2412
|
+
}
|
|
2413
|
+
},
|
|
2414
|
+
"additionalProperties": false
|
|
2345
2415
|
}
|
|
2346
2416
|
},
|
|
2347
2417
|
"required": [
|
package/dist/autonomy.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type EnvironmentDiagnostic } from './environment/contract.js';
|
|
2
2
|
import type { CockpitConfig, Decider, WorkGrading } from './schema.js';
|
|
3
|
-
export type WorkGate = 'accept' | 'amend' | 'answer' | 'signoff';
|
|
4
|
-
|
|
3
|
+
export type WorkGate = 'accept' | 'amend' | 'answer' | 'signoff' | 'acknowledge';
|
|
4
|
+
type AutonomyDecision = 'sync' | 'stale_delete' | 'reset' | 'mcp_approve';
|
|
5
5
|
export interface EffectivePolicy {
|
|
6
6
|
readonly grading: WorkGrading;
|
|
7
7
|
readonly gates: Readonly<Record<WorkGate, Decider>>;
|
|
@@ -42,3 +42,4 @@ export declare function writeRecordedPolicy(root: string, policy: EffectivePolic
|
|
|
42
42
|
* undefined when the text is not TOML. [mcp] is pinned only while a person approves MCP servers.
|
|
43
43
|
*/
|
|
44
44
|
export declare function pinnedPolicyTables(text: string): Readonly<Record<string, unknown>> | undefined;
|
|
45
|
+
export {};
|
package/dist/autonomy.js
CHANGED
|
@@ -12,8 +12,9 @@ import { hasErrorCode, RefusalError } from './environment/contract.js';
|
|
|
12
12
|
// The owner's defaults: an agent runs cockpit end to end except where stack data is lost or a process
|
|
13
13
|
// would start outside the guard, and a team opts into person or CI gates field by field. A sibling's
|
|
14
14
|
// MCP source is an ordinary file an agent writes, and a harness starts an enabled server outside every
|
|
15
|
-
// guard boundary, so an agent approving MCP servers could run any command it wrote there.
|
|
16
|
-
|
|
15
|
+
// guard boundary, so an agent approving MCP servers could run any command it wrote there. Test
|
|
16
|
+
// weakening is judged by the grading model where one grades, so acknowledging it is the agent's too.
|
|
17
|
+
export const GATE_DEFAULTS = Object.freeze({ accept: 'agent', amend: 'agent', answer: 'agent', signoff: 'agent', acknowledge: 'agent' });
|
|
17
18
|
export const AUTONOMY_DEFAULTS = Object.freeze({ sync: 'agent', stale_delete: 'agent', reset: 'person', mcp_approve: 'person' });
|
|
18
19
|
export function effectivePolicy(config) {
|
|
19
20
|
const pick = (declared, defaults) => Object.fromEntries(Object.entries(defaults).map(([key, value]) => [key, declared[key] ?? value]));
|
|
@@ -73,14 +74,30 @@ export function weakeningDigest(recorded, current) {
|
|
|
73
74
|
// agent's edit would weaken still stands until a person accepts the weakening at sync.
|
|
74
75
|
const POLICY_RECORD_PATH = '.cockpit/policy.json';
|
|
75
76
|
const RECORD_FORMAT = 'cockpit-policy/v1';
|
|
76
|
-
|
|
77
|
+
// A record written before a decision point existed lacks its key: the 0.1.0 record has no
|
|
78
|
+
// `acknowledge`. The missing decider is read as `person`, so a default that now hands it to the agent
|
|
79
|
+
// is reported as a weakening a person accepts once at sync, not refused for good nor passed unseen. An
|
|
80
|
+
// unknown key or value was not written by cockpit and refuses.
|
|
81
|
+
function recordedPolicy(value) {
|
|
82
|
+
const deciders = (table, defaults) => {
|
|
83
|
+
if (typeof table !== 'object' || table === null || Array.isArray(table))
|
|
84
|
+
return undefined;
|
|
85
|
+
if (Object.entries(table).some(([key, entry]) => !Object.hasOwn(defaults, key) || !Object.hasOwn(DECIDER_RANK, entry)))
|
|
86
|
+
return undefined;
|
|
87
|
+
const declared = table;
|
|
88
|
+
return Object.fromEntries(Object.keys(defaults).map(key => [key, declared[key] ?? 'person']));
|
|
89
|
+
};
|
|
90
|
+
if (typeof value !== 'object' || value === null || Object.keys(value).sort().join() !== 'autonomy,gates,grading')
|
|
91
|
+
return undefined;
|
|
77
92
|
const row = value;
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return typeof value === 'object' && value !== null && Object.keys(value).sort().join() === 'autonomy,gates,grading'
|
|
82
|
-
&& Object.hasOwn(GRADING_RANK, row.grading) && deciders(row.gates, Object.keys(GATE_DEFAULTS)) && deciders(row.autonomy, Object.keys(AUTONOMY_DEFAULTS));
|
|
93
|
+
const gates = deciders(row.gates, GATE_DEFAULTS);
|
|
94
|
+
const autonomy = deciders(row.autonomy, AUTONOMY_DEFAULTS);
|
|
95
|
+
return Object.hasOwn(GRADING_RANK, row.grading) && gates && autonomy ? { grading: row.grading, gates, autonomy } : undefined;
|
|
83
96
|
}
|
|
97
|
+
// Restoring the committed copy helps only where the damage is uncommitted; where the committed copy is the
|
|
98
|
+
// damaged one, the record is a person's to remove, after which the next sync records cockpit.toml's policy.
|
|
99
|
+
const DAMAGED_RECORD_REMEDY = `restore the committed copy with git restore -- ${POLICY_RECORD_PATH}, or if that copy is the damaged one, `
|
|
100
|
+
+ `a person deletes ${POLICY_RECORD_PATH} and runs npx --no cockpit sync --config <your cockpit.toml> --interactive to record the policy cockpit.toml declares`;
|
|
84
101
|
/** The policy the last sync recorded, or undefined before the first; an unreadable record refuses. */
|
|
85
102
|
export async function readRecordedPolicy(root) {
|
|
86
103
|
const path = join(root, POLICY_RECORD_PATH);
|
|
@@ -106,13 +123,13 @@ export async function readRecordedPolicy(root) {
|
|
|
106
123
|
catch (error) {
|
|
107
124
|
if (!(error instanceof SyntaxError))
|
|
108
125
|
throw error;
|
|
109
|
-
throw new RefusalError(`${POLICY_RECORD_PATH} is not JSON;
|
|
126
|
+
throw new RefusalError(`${POLICY_RECORD_PATH} is not JSON; ${DAMAGED_RECORD_REMEDY}`);
|
|
110
127
|
}
|
|
111
128
|
const record = parsed;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return
|
|
129
|
+
const policy = record?.format === RECORD_FORMAT ? recordedPolicy(record.policy) : undefined;
|
|
130
|
+
if (!policy)
|
|
131
|
+
throw new RefusalError(`${POLICY_RECORD_PATH} is not a ${RECORD_FORMAT} record (an unknown format, table, key, decider or grading); ${DAMAGED_RECORD_REMEDY}`);
|
|
132
|
+
return policy;
|
|
116
133
|
}
|
|
117
134
|
export async function writeRecordedPolicy(root, policy) {
|
|
118
135
|
const path = join(root, POLICY_RECORD_PATH);
|
|
@@ -3,7 +3,7 @@ import { type StateNamespace } from '../environment/state.js';
|
|
|
3
3
|
import { type BrowserRuntimeProjection } from './runtime.js';
|
|
4
4
|
import { type BrowserProjectClient } from './surfaces.js';
|
|
5
5
|
export type BrowserCommandKind = 'drive' | 'screenshot';
|
|
6
|
-
|
|
6
|
+
interface BrowserRouteDeclaration {
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly path: string;
|
|
9
9
|
}
|
|
@@ -14,11 +14,61 @@ export interface BrowserRoutePolicy {
|
|
|
14
14
|
url: string;
|
|
15
15
|
}>[];
|
|
16
16
|
}
|
|
17
|
+
type BrowserDiagnosticEntry = Readonly<{
|
|
18
|
+
kind: 'console';
|
|
19
|
+
path?: string;
|
|
20
|
+
line?: number;
|
|
21
|
+
}> | Readonly<{
|
|
22
|
+
kind: 'pageerror';
|
|
23
|
+
name: string;
|
|
24
|
+
}> | Readonly<{
|
|
25
|
+
kind: 'request';
|
|
26
|
+
method: string;
|
|
27
|
+
path: string;
|
|
28
|
+
status: number;
|
|
29
|
+
} | {
|
|
30
|
+
kind: 'request';
|
|
31
|
+
method: string;
|
|
32
|
+
path: string;
|
|
33
|
+
failure: string;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Console and uncaught error text, capped in count and bytes. It is page content, so a reader treats
|
|
37
|
+
* it as data and never as instructions. Present only for a data posture that is isolated, not
|
|
38
|
+
* restored and not reaching production; otherwise `omitted` says why there is none.
|
|
39
|
+
*/
|
|
40
|
+
type BrowserMessageExcerpt = Readonly<{
|
|
41
|
+
trust: 'untrusted-page-content';
|
|
42
|
+
messages: readonly Readonly<{
|
|
43
|
+
kind: 'console' | 'pageerror';
|
|
44
|
+
text: string;
|
|
45
|
+
}>[];
|
|
46
|
+
}> | Readonly<{
|
|
47
|
+
omitted: string;
|
|
48
|
+
}>;
|
|
49
|
+
/** What a route's page did wrong. Identifiers and counts, plus a message excerpt where the data posture allows it: never bodies, headers or cookies. */
|
|
50
|
+
interface BrowserRouteDiagnostics {
|
|
51
|
+
readonly consoleErrors: number;
|
|
52
|
+
readonly consoleWarnings: number;
|
|
53
|
+
readonly pageErrors: number;
|
|
54
|
+
readonly failedRequests: number;
|
|
55
|
+
readonly abortedRequests: number;
|
|
56
|
+
readonly thirdParty: Readonly<{
|
|
57
|
+
requests: number;
|
|
58
|
+
failed: number;
|
|
59
|
+
}>;
|
|
60
|
+
readonly entries: readonly BrowserDiagnosticEntry[];
|
|
61
|
+
readonly omitted: number;
|
|
62
|
+
readonly excerpt: BrowserMessageExcerpt;
|
|
63
|
+
}
|
|
64
|
+
type BrowserRouteVerdict = 'clean' | 'findings';
|
|
17
65
|
export interface BrowserCommandInput {
|
|
18
66
|
readonly runtime: BrowserRuntimeProjection;
|
|
19
67
|
readonly client: BrowserProjectClient;
|
|
20
68
|
readonly policy: BrowserRoutePolicy;
|
|
21
69
|
readonly kind: BrowserCommandKind;
|
|
70
|
+
/** A declared route's name or path; every declared route is driven when absent. */
|
|
71
|
+
readonly route?: string;
|
|
22
72
|
readonly role?: string;
|
|
23
73
|
readonly state?: Readonly<{
|
|
24
74
|
namespace: StateNamespace;
|
|
@@ -26,7 +76,7 @@ export interface BrowserCommandInput {
|
|
|
26
76
|
ownerId: HolderId;
|
|
27
77
|
}>;
|
|
28
78
|
}
|
|
29
|
-
|
|
79
|
+
interface BrowserCommandSurfaceReceipt {
|
|
30
80
|
readonly name: string;
|
|
31
81
|
readonly url: string;
|
|
32
82
|
readonly screenshot?: Readonly<{
|
|
@@ -34,6 +84,8 @@ export interface BrowserCommandSurfaceReceipt {
|
|
|
34
84
|
sha256: string;
|
|
35
85
|
byteLength: number;
|
|
36
86
|
}>;
|
|
87
|
+
readonly diagnostics?: BrowserRouteDiagnostics;
|
|
88
|
+
readonly verdict?: BrowserRouteVerdict;
|
|
37
89
|
}
|
|
38
90
|
export interface BrowserCommandReceipt {
|
|
39
91
|
readonly kind: BrowserCommandKind;
|
|
@@ -46,6 +98,8 @@ export interface BrowserCommandReceipt {
|
|
|
46
98
|
policy: 'serialized' | 'per-worker';
|
|
47
99
|
}>;
|
|
48
100
|
readonly surfaces: readonly Readonly<BrowserCommandSurfaceReceipt>[];
|
|
101
|
+
/** drive only: findings when any route has console errors, uncaught errors or failed own-origin requests. */
|
|
102
|
+
readonly verdict?: BrowserRouteVerdict;
|
|
49
103
|
}
|
|
50
104
|
export type BrowserCommandResult = Readonly<{
|
|
51
105
|
kind: 'complete';
|
|
@@ -60,3 +114,4 @@ export declare function issueBrowserRoutePolicy(runtime: BrowserRuntimeProjectio
|
|
|
60
114
|
}>): BrowserRoutePolicy;
|
|
61
115
|
export declare function isIssuedBrowserCommandReceipt(value: unknown): value is BrowserCommandReceipt;
|
|
62
116
|
export declare function executeBrowserCommand(value: BrowserCommandInput): Promise<BrowserCommandResult>;
|
|
117
|
+
export {};
|