@webpresso/agent-kit 3.1.30 → 3.3.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/README.md +53 -15
- package/bin/_run.js +183 -20
- package/catalog/AGENTS.md.tpl +3 -3
- package/catalog/agent/agents/implementer.md +45 -0
- package/catalog/agent/rules/parallel-orchestration-quota.md +100 -0
- package/catalog/agent/rules/pre-implementation.md +28 -1
- package/catalog/agent/rules/supported-agent-clis.md +9 -0
- package/catalog/agent/rules/typescript-version.md +50 -0
- package/catalog/agent/skills/codex/SKILL.md +25 -1
- package/catalog/agent/skills/verify/SKILL.md +4 -2
- package/catalog/docs/templates/blueprint.md +1 -1
- package/dist/esm/audit/agents.js +1 -0
- package/dist/esm/audit/blueprint-lifecycle-sql.d.ts +12 -0
- package/dist/esm/audit/blueprint-lifecycle-sql.js +23 -2
- package/dist/esm/audit/blueprint-pr-coverage.js +4 -0
- package/dist/esm/audit/blueprint-trust.js +14 -10
- package/dist/esm/audit/changeset-evidence.d.ts +23 -0
- package/dist/esm/audit/changeset-evidence.js +30 -0
- package/dist/esm/audit/changeset-required.d.ts +10 -0
- package/dist/esm/audit/changeset-required.js +73 -0
- package/dist/esm/audit/ci-guardrails-detection.d.ts +27 -0
- package/dist/esm/audit/ci-guardrails-detection.js +68 -0
- package/dist/esm/audit/ci-guardrails-wiring.d.ts +22 -0
- package/dist/esm/audit/ci-guardrails-wiring.js +80 -0
- package/dist/esm/audit/ci-test-perf.js +30 -0
- package/dist/esm/audit/command-surface.js +4 -2
- package/dist/esm/audit/host-substitution-risk.d.ts +2 -0
- package/dist/esm/audit/host-substitution-risk.js +256 -0
- package/dist/esm/audit/registry.d.ts +4 -4
- package/dist/esm/audit/registry.js +13 -1
- package/dist/esm/audit/toolchain-isolation.js +1 -2
- package/dist/esm/audit/typescript-version.d.ts +2 -0
- package/dist/esm/audit/typescript-version.js +123 -0
- package/dist/esm/blueprint/core/parser.js +101 -2
- package/dist/esm/blueprint/core/schema.d.ts +1 -0
- package/dist/esm/blueprint/core/schema.js +26 -0
- package/dist/esm/blueprint/core/validation/criteria.d.ts +14 -0
- package/dist/esm/blueprint/core/validation/criteria.js +41 -2
- package/dist/esm/blueprint/core/validation/state.js +25 -14
- package/dist/esm/blueprint/db/migrations/run.js +4 -2
- package/dist/esm/blueprint/lifecycle/audit.d.ts +20 -0
- package/dist/esm/blueprint/lifecycle/audit.js +87 -20
- package/dist/esm/blueprint/lifecycle/canonicalize.d.ts +6 -0
- package/dist/esm/blueprint/lifecycle/canonicalize.js +135 -0
- package/dist/esm/blueprint/lifecycle/local.d.ts +2 -1
- package/dist/esm/blueprint/lifecycle/local.js +19 -3
- package/dist/esm/blueprint/lifecycle/review-provenance.d.ts +6 -0
- package/dist/esm/blueprint/lifecycle/review-provenance.js +68 -12
- package/dist/esm/blueprint/lifecycle/rollout-anchor.d.ts +97 -0
- package/dist/esm/blueprint/lifecycle/rollout-anchor.js +161 -0
- package/dist/esm/blueprint/service/BlueprintCreationService.d.ts +1 -0
- package/dist/esm/blueprint/service/BlueprintCreationService.js +53 -4
- package/dist/esm/blueprint/service/blueprint-tech-debt-links.js +16 -2
- package/dist/esm/blueprint/sync/client.d.ts +2 -1
- package/dist/esm/blueprint/sync/client.js +1 -1
- package/dist/esm/blueprint/trust/command-runner.d.ts +26 -0
- package/dist/esm/blueprint/trust/command-runner.js +148 -0
- package/dist/esm/blueprint/trust/dossier.d.ts +1 -0
- package/dist/esm/blueprint/trust/dossier.js +40 -6
- package/dist/esm/blueprint/trust/gates.d.ts +7 -0
- package/dist/esm/blueprint/trust/gates.js +20 -0
- package/dist/esm/blueprint/trust/promotion.d.ts +8 -0
- package/dist/esm/blueprint/trust/promotion.js +74 -112
- package/dist/esm/blueprint/trust/scaffold.d.ts +19 -0
- package/dist/esm/blueprint/trust/scaffold.js +64 -0
- package/dist/esm/blueprint/trust/validator.d.ts +1 -0
- package/dist/esm/blueprint/trust/validator.js +7 -1
- package/dist/esm/blueprint/utils/archive.js +27 -5
- package/dist/esm/blueprint/utils/document-paths.d.ts +18 -0
- package/dist/esm/blueprint/utils/document-paths.js +45 -12
- package/dist/esm/build/cli-mcp-parity.js +15 -0
- package/dist/esm/cli/bundle/commands/blueprint.d.ts +1 -0
- package/dist/esm/cli/bundle/commands/blueprint.js +1 -0
- package/dist/esm/cli/cli.d.ts +1 -1
- package/dist/esm/cli/cli.js +43 -0
- package/dist/esm/cli/commands/agent-launch.d.ts +8 -1
- package/dist/esm/cli/commands/agent-launch.js +93 -4
- package/dist/esm/cli/commands/audit-core.d.ts +1 -1
- package/dist/esm/cli/commands/audit-core.js +8 -1
- package/dist/esm/cli/commands/audit.js +21 -5
- package/dist/esm/cli/commands/blueprint/execution.js +18 -6
- package/dist/esm/cli/commands/blueprint/mutations.js +59 -40
- package/dist/esm/cli/commands/blueprint/router-dispatch.d.ts +2 -1
- package/dist/esm/cli/commands/blueprint/router-dispatch.js +20 -1
- package/dist/esm/cli/commands/blueprint/router-output.d.ts +21 -0
- package/dist/esm/cli/commands/blueprint/router-output.js +48 -17
- package/dist/esm/cli/commands/blueprint/router.d.ts +7 -0
- package/dist/esm/cli/commands/blueprint/router.js +13 -1
- package/dist/esm/cli/commands/ci-preflight.d.ts +13 -2
- package/dist/esm/cli/commands/ci-preflight.js +30 -6
- package/dist/esm/cli/commands/compile.js +5 -31
- package/dist/esm/cli/commands/dash/delivery-status.d.ts +1 -0
- package/dist/esm/cli/commands/dash/delivery-status.js +11 -4
- package/dist/esm/cli/commands/doctor.js +5 -0
- package/dist/esm/cli/commands/hook.d.ts +5 -0
- package/dist/esm/cli/commands/hook.js +15 -9
- package/dist/esm/cli/commands/init/config.js +2 -2
- package/dist/esm/cli/commands/init/convergence-apply.d.ts +88 -0
- package/dist/esm/cli/commands/init/convergence-apply.js +325 -0
- package/dist/esm/cli/commands/init/convergence-state.d.ts +13 -0
- package/dist/esm/cli/commands/init/convergence-state.js +54 -0
- package/dist/esm/cli/commands/init/convergence.d.ts +23 -0
- package/dist/esm/cli/commands/init/convergence.js +57 -0
- package/dist/esm/cli/commands/init/git-convergence.d.ts +19 -0
- package/dist/esm/cli/commands/init/git-convergence.js +168 -0
- package/dist/esm/cli/commands/init/gitignore-patcher.js +2 -0
- package/dist/esm/cli/commands/init/grok-privacy-smoke.d.ts +52 -0
- package/dist/esm/cli/commands/init/grok-privacy-smoke.js +91 -0
- package/dist/esm/cli/commands/init/host-native-proof.d.ts +18 -0
- package/dist/esm/cli/commands/init/host-native-proof.js +88 -0
- package/dist/esm/cli/commands/init/host-visibility.d.ts +2 -2
- package/dist/esm/cli/commands/init/host-visibility.js +94 -5
- package/dist/esm/cli/commands/init/index.d.ts +3 -0
- package/dist/esm/cli/commands/init/index.js +326 -173
- package/dist/esm/cli/commands/init/mcp-spec.d.ts +57 -0
- package/dist/esm/cli/commands/init/mcp-spec.js +273 -0
- package/dist/esm/cli/commands/init/merge.d.ts +1 -0
- package/dist/esm/cli/commands/init/merge.js +30 -1
- package/dist/esm/cli/commands/init/package-root.d.ts +7 -0
- package/dist/esm/cli/commands/init/package-root.js +10 -2
- package/dist/esm/cli/commands/init/plugin-cache-prune.d.ts +0 -3
- package/dist/esm/cli/commands/init/plugin-cache-prune.js +0 -1
- package/dist/esm/cli/commands/init/scaffold-agents-md.d.ts +1 -1
- package/dist/esm/cli/commands/init/scaffold-agents-md.js +9 -3
- package/dist/esm/cli/commands/init/scaffold-base-kit.d.ts +20 -0
- package/dist/esm/cli/commands/init/scaffold-base-kit.js +61 -5
- package/dist/esm/cli/commands/init/scaffolders/agent-hooks/emitters/grok.d.ts +14 -8
- package/dist/esm/cli/commands/init/scaffolders/agent-hooks/emitters/grok.js +41 -24
- package/dist/esm/cli/commands/init/scaffolders/agent-hooks/index.d.ts +2 -0
- package/dist/esm/cli/commands/init/scaffolders/agent-hooks/index.js +54 -24
- package/dist/esm/cli/commands/init/scaffolders/codex-mcp/index.d.ts +12 -31
- package/dist/esm/cli/commands/init/scaffolders/codex-mcp/index.js +288 -202
- package/dist/esm/cli/commands/init/scaffolders/file-transaction.d.ts +22 -0
- package/dist/esm/cli/commands/init/scaffolders/file-transaction.js +230 -0
- package/dist/esm/cli/commands/init/scaffolders/grok-mcp/index.d.ts +38 -0
- package/dist/esm/cli/commands/init/scaffolders/grok-mcp/index.js +73 -0
- package/dist/esm/cli/commands/init/scaffolders/opencode-plugin/index.d.ts +21 -0
- package/dist/esm/cli/commands/init/scaffolders/opencode-plugin/index.js +559 -63
- package/dist/esm/cli/commands/init/untracked-collision.d.ts +14 -0
- package/dist/esm/cli/commands/init/untracked-collision.js +42 -0
- package/dist/esm/cli/commands/opencode-probe.d.ts +107 -0
- package/dist/esm/cli/commands/opencode-probe.js +323 -0
- package/dist/esm/cli/commands/opencode-rotate.d.ts +72 -0
- package/dist/esm/cli/commands/opencode-rotate.js +147 -0
- package/dist/esm/cli/commands/public-readiness.d.ts +11 -0
- package/dist/esm/cli/commands/public-readiness.js +42 -0
- package/dist/esm/cli/commands/quality-runner.js +3 -3
- package/dist/esm/cli/commands/review.d.ts +35 -3
- package/dist/esm/cli/commands/review.js +751 -209
- package/dist/esm/cli/commands/run-wait.d.ts +2 -0
- package/dist/esm/cli/commands/run-wait.js +122 -0
- package/dist/esm/cli/commands/rust-check.d.ts +24 -0
- package/dist/esm/cli/commands/rust-check.js +110 -0
- package/dist/esm/cli/commands/setup-help.js +1 -1
- package/dist/esm/cli/commands/setup-repair-help.js +1 -1
- package/dist/esm/cli/commands/typecheck.d.ts +1 -0
- package/dist/esm/cli/commands/typecheck.js +30 -1
- package/dist/esm/cli/commands/worktree/router-dispatch.d.ts +6 -0
- package/dist/esm/cli/commands/worktree/router-dispatch.js +126 -9
- package/dist/esm/cli/commands/worktree/router.js +10 -0
- package/dist/esm/cli/direct-provider-launch.js +9 -5
- package/dist/esm/cli/optional-tool-freshness.d.ts +27 -0
- package/dist/esm/cli/optional-tool-freshness.js +219 -9
- package/dist/esm/daemon/domains/git-actions.d.ts +29 -0
- package/dist/esm/daemon/domains/git-actions.js +136 -0
- package/dist/esm/daemon/domains/run-registry-interop.d.ts +16 -0
- package/dist/esm/daemon/domains/run-registry-interop.js +45 -0
- package/dist/esm/daemon/domains/sessions-search.d.ts +11 -0
- package/dist/esm/daemon/domains/sessions-search.js +29 -0
- package/dist/esm/daemon/handlers/blueprints-handlers.d.ts +5 -0
- package/dist/esm/daemon/handlers/blueprints-handlers.js +36 -0
- package/dist/esm/daemon/handlers/deploy-handlers.d.ts +6 -0
- package/dist/esm/daemon/handlers/deploy-handlers.js +5 -0
- package/dist/esm/daemon/handlers/fleet-handlers.d.ts +15 -0
- package/dist/esm/daemon/handlers/fleet-handlers.js +91 -0
- package/dist/esm/daemon/handlers/git-handlers.d.ts +6 -0
- package/dist/esm/daemon/handlers/git-handlers.js +27 -0
- package/dist/esm/daemon/handlers/product.d.ts +7 -0
- package/dist/esm/daemon/handlers/product.js +10 -119
- package/dist/esm/daemon/handlers/sessions-handlers.d.ts +12 -0
- package/dist/esm/daemon/handlers/sessions-handlers.js +31 -0
- package/dist/esm/daemon/handlers/shared.d.ts +5 -0
- package/dist/esm/daemon/handlers/shared.js +16 -0
- package/dist/esm/daemon/methods.d.ts +8 -1
- package/dist/esm/daemon/methods.js +7 -0
- package/dist/esm/daemon/protocol/contract.d.ts +43 -0
- package/dist/esm/daemon/protocol/contract.js +26 -0
- package/dist/esm/daemon/protocol/index.d.ts +1 -1
- package/dist/esm/daemon/protocol/index.js +1 -1
- package/dist/esm/hooks/__conformance__/matrix.d.ts +6 -0
- package/dist/esm/hooks/__conformance__/matrix.js +137 -0
- package/dist/esm/hooks/conformance/batch.js +5 -0
- package/dist/esm/hooks/doctor.d.ts +5 -3
- package/dist/esm/hooks/doctor.js +67 -16
- package/dist/esm/hooks/permission-request/index.js +9 -3
- package/dist/esm/hooks/permission-request/policy.d.ts +9 -0
- package/dist/esm/hooks/permission-request/policy.js +13 -0
- package/dist/esm/hooks/pretool-guard/dev-routing.d.ts +9 -0
- package/dist/esm/hooks/pretool-guard/dev-routing.js +41 -5
- package/dist/esm/hooks/pretool-guard/logger.d.ts +7 -0
- package/dist/esm/hooks/pretool-guard/logger.js +16 -0
- package/dist/esm/hooks/pretool-guard/runner.d.ts +6 -0
- package/dist/esm/hooks/pretool-guard/runner.js +68 -16
- package/dist/esm/hooks/pretool-guard/validators/blueprint.js +30 -10
- package/dist/esm/hooks/pretool-guard/validators/forbidden-commands.js +54 -0
- package/dist/esm/hooks/pretool-guard/validators/index.d.ts +7 -0
- package/dist/esm/hooks/pretool-guard/validators/index.js +21 -0
- package/dist/esm/hooks/pretool-guard/validators/path-contract.d.ts +19 -0
- package/dist/esm/hooks/pretool-guard/validators/path-contract.js +25 -8
- package/dist/esm/hooks/pretool-guard/validators/worktree-discipline.js +6 -1
- package/dist/esm/hooks/shared/guard-outcome.d.ts +149 -0
- package/dist/esm/hooks/shared/guard-outcome.js +215 -0
- package/dist/esm/hooks/shared/hook-bootstrap.d.ts +26 -0
- package/dist/esm/hooks/shared/hook-bootstrap.js +64 -1
- package/dist/esm/hooks/shared/types.d.ts +8 -5
- package/dist/esm/hooks/shared/types.js +50 -9
- package/dist/esm/hooks/stop/qa-changed-files.d.ts +11 -0
- package/dist/esm/hooks/stop/qa-changed-files.js +92 -0
- package/dist/esm/mcp/blueprint/_shared/lifecycle.js +14 -1
- package/dist/esm/mcp/blueprint/handlers/document-mutations.d.ts +5 -0
- package/dist/esm/mcp/blueprint/handlers/document-mutations.js +109 -11
- package/dist/esm/mcp/blueprint/handlers/review-log.js +8 -1
- package/dist/esm/mcp/blueprint/handlers/task-advance.js +113 -54
- package/dist/esm/mcp/blueprint/handlers/task-verify.js +39 -19
- package/dist/esm/mcp/blueprint/registration.js +3 -2
- package/dist/esm/mcp/server.d.ts +1 -0
- package/dist/esm/mcp/server.js +27 -0
- package/dist/esm/mcp/tools/_names.d.ts +1 -1
- package/dist/esm/mcp/tools/_names.js +5 -0
- package/dist/esm/mcp/tools/_registry.js +10 -0
- package/dist/esm/mcp/tools/_shared/audit-kinds.d.ts +1 -1
- package/dist/esm/mcp/tools/_shared/result.js +44 -1
- package/dist/esm/mcp/tools/audit.d.ts +5 -1
- package/dist/esm/mcp/tools/audit.js +42 -0
- package/dist/esm/mcp/tools/audits.d.ts +4 -0
- package/dist/esm/mcp/tools/ci-preflight.d.ts +50 -0
- package/dist/esm/mcp/tools/ci-preflight.js +183 -0
- package/dist/esm/mcp/tools/pr-upsert.js +39 -1
- package/dist/esm/mcp/tools/review-run.d.ts +28 -0
- package/dist/esm/mcp/tools/review-run.js +216 -0
- package/dist/esm/mcp/tools/run-wait.d.ts +86 -0
- package/dist/esm/mcp/tools/run-wait.js +593 -0
- package/dist/esm/mcp/tools/session-fetch-and-index.d.ts +1 -1
- package/dist/esm/mcp/tools/session-id.d.ts +3 -0
- package/dist/esm/mcp/tools/session-id.js +45 -0
- package/dist/esm/mcp/tools/session-info.d.ts +3 -0
- package/dist/esm/mcp/tools/session-info.js +49 -0
- package/dist/esm/output-transforms/audit.d.ts +23 -0
- package/dist/esm/output-transforms/audit.js +47 -0
- package/dist/esm/output-transforms/index.js +2 -0
- package/dist/esm/package.json +2 -0
- package/dist/esm/platform/client.d.ts +7 -1
- package/dist/esm/platform/github-contract-source.d.ts +2 -1
- package/dist/esm/pr-description/contract.js +24 -4
- package/dist/esm/review/authority.js +27 -14
- package/dist/esm/review/availability.d.ts +33 -0
- package/dist/esm/review/availability.js +122 -20
- package/dist/esm/review/delivery-verifier.d.ts +27 -0
- package/dist/esm/review/delivery-verifier.js +115 -0
- package/dist/esm/review/events.d.ts +3 -2
- package/dist/esm/review/events.js +23 -3
- package/dist/esm/review/execution/adapters.d.ts +11 -1
- package/dist/esm/review/execution/adapters.js +36 -10
- package/dist/esm/review/execution/artifacts.d.ts +1 -1
- package/dist/esm/review/execution/output-policy.d.ts +2 -0
- package/dist/esm/review/execution/output-policy.js +12 -0
- package/dist/esm/review/execution/review-checkout.js +121 -21
- package/dist/esm/review/execution/supervisor.js +36 -4
- package/dist/esm/review/execution/types.d.ts +9 -0
- package/dist/esm/review/opencode-account.d.ts +24 -0
- package/dist/esm/review/opencode-account.js +68 -0
- package/dist/esm/review/opencode-auth.d.ts +33 -0
- package/dist/esm/review/opencode-auth.js +79 -0
- package/dist/esm/review/subject.d.ts +25 -0
- package/dist/esm/review/subject.js +116 -26
- package/dist/esm/runtime/opencode-account-materializer.d.ts +34 -0
- package/dist/esm/runtime/opencode-account-materializer.js +33 -0
- package/dist/esm/rust/affected-manifests.d.ts +38 -0
- package/dist/esm/rust/affected-manifests.js +69 -0
- package/dist/esm/session-memory/fetch-index.d.ts +1 -1
- package/dist/esm/status/snapshot.js +32 -25
- package/dist/esm/test/duration-sequencer.d.ts +20 -0
- package/dist/esm/test/duration-sequencer.js +54 -0
- package/dist/esm/test/shard-durations.json +922 -0
- package/dist/esm/test/worker-budget.d.ts +6 -0
- package/dist/esm/test/worker-budget.js +59 -1
- package/dist/esm/test-helpers/global-setup.d.ts +1 -2
- package/dist/esm/test-helpers/global-setup.js +79 -32
- package/dist/esm/typecheck/planner.d.ts +9 -1
- package/dist/esm/typecheck/planner.js +31 -0
- package/dist/esm/ultragoal/service.d.ts +7 -0
- package/dist/esm/ultragoal/service.js +42 -2
- package/dist/esm/utils/write-json-file.js +3 -1
- package/dist/esm/worktrees/codex-project-trust.d.ts +15 -0
- package/dist/esm/worktrees/codex-project-trust.js +56 -0
- package/dist/esm/worktrees/orphan-scan.d.ts +50 -0
- package/dist/esm/worktrees/orphan-scan.js +211 -0
- package/dist/esm/worktrees/registry.d.ts +8 -0
- package/dist/esm/worktrees/registry.js +18 -3
- package/package.json +18 -13
package/README.md
CHANGED
|
@@ -12,6 +12,11 @@ projects a repeatable `wp` command surface, generated host instructions, MCP
|
|
|
12
12
|
quality tools, local continuity, and policy checks so agent work can be run,
|
|
13
13
|
reviewed, and repaired with evidence.
|
|
14
14
|
|
|
15
|
+
Its durable value is repo-owned policy and evidence, not matching every native
|
|
16
|
+
host feature. Host launchers and plugin packages bridge the repo contract onto
|
|
17
|
+
Claude, Codex, OpenCode, Grok, and future hosts; parity utilities are kept only
|
|
18
|
+
where they protect that contract.
|
|
19
|
+
|
|
15
20
|
The root `@webpresso/agent-kit` package is the CLI/core distribution: it
|
|
16
21
|
ships `wp`, MCP tools, audits, blueprints, session memory, docs, and the
|
|
17
22
|
catalog sources that generate repo-owned agent surfaces. Host-native plugin
|
|
@@ -96,13 +101,25 @@ Native host delivery is package-scoped: Claude, Codex, and OpenCode consume
|
|
|
96
101
|
`@webpresso/claude-plugin`, `@webpresso/codex-plugin`, and
|
|
97
102
|
`@webpresso/opencode-plugin` respectively. The root
|
|
98
103
|
`@webpresso/agent-kit` package no longer ships repo-root host plugin payloads,
|
|
99
|
-
and OpenCode
|
|
100
|
-
`@webpresso/opencode-plugin
|
|
104
|
+
and OpenCode combines native `opencode.json` `plugin[]` registration via
|
|
105
|
+
`@webpresso/opencode-plugin` (hook bridge) with a setup-managed
|
|
106
|
+
`mcp.webpresso` entry that launches the shared `wp mcp` server directly.
|
|
107
|
+
Claude Code installs the
|
|
101
108
|
plugin as `agent-kit@webpresso` from a **version-pinned** GitHub marketplace
|
|
102
109
|
(`webpresso/agent-kit@vX.Y.Z`); `wp update` / `wp setup` rebind that pin so
|
|
103
110
|
hosts do not freeze on a stale catalog. See
|
|
104
111
|
[`docs/packages/claude-plugin.md`](./docs/packages/claude-plugin.md).
|
|
105
112
|
|
|
113
|
+
All four supported hosts receive the same `wp mcp` server from one canonical
|
|
114
|
+
spec (`webpresso`, args `["mcp"]`, env `WP_SKIP_UPDATE_CHECK=1`):
|
|
115
|
+
|
|
116
|
+
| Host | Skills | Hooks | MCP (`wp mcp`) |
|
|
117
|
+
| -------- | ------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
118
|
+
| Claude | plugin `agent-kit@webpresso` | setup-managed `.claude/settings.json` | plugin manifest `mcpServers.webpresso` |
|
|
119
|
+
| Codex | plugin `@webpresso/codex-plugin` | setup-managed `.codex/hooks.json` | setup-managed `~/.codex/config.toml` `[mcp_servers.webpresso]` |
|
|
120
|
+
| OpenCode | shared skill roots (`.claude/`, `.agents/`) | npm plugin `@webpresso/opencode-plugin` via `plugin[]` | setup-managed `opencode.json` `mcp.webpresso` |
|
|
121
|
+
| Grok | reads `AGENTS.md`/`CLAUDE.md` natively | project `.grok/hooks/webpresso.json` (trust-gated: run `/hooks-trust` once) | project `.grok/config.toml` `[mcp_servers.webpresso]` |
|
|
122
|
+
|
|
106
123
|
Then ask Claude, Codex, or another MCP-capable host for one bounded read-only
|
|
107
124
|
check:
|
|
108
125
|
|
|
@@ -122,20 +139,40 @@ When a repo uses provider-backed MCP credentials, launch the host through
|
|
|
122
139
|
`wp claude`, `wp codex`, `wp grok`, `wp opencode`, or `wp dash` so `wp` can inject the
|
|
123
140
|
configured provider environment before the host starts.
|
|
124
141
|
|
|
142
|
+
Maintainers prove Claude's package-native path in an isolated fixture with
|
|
143
|
+
`claude --plugin-dir packages/claude-plugin`, empty setting sources, built-in
|
|
144
|
+
tools disabled, and an MCP allowlist containing only `wp_session_stats`. Grok
|
|
145
|
+
operators run `/hooks-trust` in the project once, then verify discovery with
|
|
146
|
+
`grok inspect --json`, `grok mcp list --json`, and
|
|
147
|
+
`grok mcp doctor webpresso --json`. Scoping doctor keeps unrelated personal MCP
|
|
148
|
+
authentication failures out of the Webpresso result.
|
|
149
|
+
Provider-authenticated inference is deliberately local-only:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
wp run proof:host-native
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The command uses the Claude and Grok CLIs' saved local subscription sessions,
|
|
156
|
+
removes API-key and CI OAuth variables from its child processes, fails closed
|
|
157
|
+
when either login is unavailable, and writes only redacted evidence under
|
|
158
|
+
`.webpresso/evidence/`. CI/CD validates the deterministic host contracts but
|
|
159
|
+
never receives provider credentials or performs billed model inference. Use
|
|
160
|
+
`proof:host-native:claude` or `proof:host-native:grok` to run one host.
|
|
161
|
+
|
|
125
162
|
## What `wp` guards
|
|
126
163
|
|
|
127
|
-
| Outcome | What Agent Kit provides
|
|
128
|
-
| -------------------------------------- |
|
|
129
|
-
| Start from a known repo contract | `wp setup repair --project-init` creates or repairs agent instructions, host config, docs templates, blueprint folders, quality scripts, and safe ignores.
|
|
130
|
-
| Give agents one command
|
|
131
|
-
| Expose bounded MCP tools | `wp_*` MCP tools return JSON summaries with failure evidence, output limits, and token-saved metadata instead of raw terminal dumps.
|
|
132
|
-
| Keep host surfaces consistent | One catalog projects rules, hooks, generated instruction files, and
|
|
133
|
-
| Preserve local continuity | Session memory is local storage with explicit search, restore, capture, retrieve, reset, and doctor tools.
|
|
134
|
-
| Isolate risky work | Managed worktrees and blueprint owner binding keep implementation lanes separate from the main checkout.
|
|
135
|
-
| Run browser QA with evidence | Browser doctor/ensure helpers and bundled browse, QA, design-review, and devex-review skills support local or explicit preview URLs.
|
|
136
|
-
| Handle secrets without committing them | Provider/profile/sink contracts route secrets through configured runtime channels for local commands, host launch wrappers, CI rehearsal, and supported preview/deploy workflows with repo-specific setup.
|
|
137
|
-
| Block drift before release | Guardrails cover docs, blueprints, catalog drift, reference parity, paths, licenses, secrets, tech debt, and package surface.
|
|
138
|
-
| Tie claims to evidence | Public benchmark and release claims require docs gates plus a checked-in first-party result card under `docs/bench/result-cards/` before publication.
|
|
164
|
+
| Outcome | What Agent Kit provides | Proof |
|
|
165
|
+
| -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
166
|
+
| Start from a known repo contract | `wp setup repair --project-init` creates or repairs agent instructions, host config, docs templates, blueprint folders, quality scripts, and safe ignores. | [setup command source](https://github.com/webpresso/agent-kit/tree/main/src/cli/commands/init) |
|
|
167
|
+
| Give agents one command bridge | `wp test`, `wp lint`, `wp typecheck`, `wp format`, `wp e2e`, `wp qa`, `wp audit`, `wp worktree`, `wp fleet`, and `wp secrets` expose repo-owned checks consistently while host-native mechanics stay replaceable (see [stability policy](./docs/stability-policy.md) for which surfaces carry semver guarantees). | [CLI entrypoint](https://github.com/webpresso/agent-kit/blob/main/src/cli/cli.ts) |
|
|
168
|
+
| Expose bounded MCP tools | `wp_*` MCP tools return JSON summaries with failure evidence, output limits, and token-saved metadata instead of raw terminal dumps. | [MCP registry](https://github.com/webpresso/agent-kit/blob/main/src/mcp/tools/_registry.ts) |
|
|
169
|
+
| Keep host surfaces consistent | One catalog projects rules, hooks, generated instruction files, and adapter-package contents; host-specific plugins are bridges, not the source of policy truth. | [Claude adapter](./packages/claude-plugin/), [Codex adapter](./packages/codex-plugin/), [OpenCode adapter](./packages/opencode-plugin/), [host substitution scorecard](./docs/host-substitution-scorecard.md) |
|
|
170
|
+
| Preserve local continuity | Session memory is local storage with explicit search, restore, capture, retrieve, reset, and doctor tools. | [`docs/guides/session-memory.md`](./docs/guides/session-memory.md), [`docs/bench/session-memory-methodology.md`](./docs/bench/session-memory-methodology.md) |
|
|
171
|
+
| Isolate risky work | Managed worktrees and blueprint owner binding keep implementation lanes separate from the main checkout. | [worktrees guide](https://github.com/webpresso/agent-kit/blob/main/docs/worktrees.md) |
|
|
172
|
+
| Run browser QA with evidence | Browser doctor/ensure helpers and bundled browse, QA, design-review, and devex-review skills support local or explicit preview URLs. | [browser source](https://github.com/webpresso/agent-kit/tree/main/src/browser), [QA output guide](https://github.com/webpresso/agent-kit/blob/main/docs/qa-output.md) |
|
|
173
|
+
| Handle secrets without committing them | Provider/profile/sink contracts route secrets through configured runtime channels for local commands, host launch wrappers, CI rehearsal, and supported preview/deploy workflows with repo-specific setup. | [`docs/secrets/providers.md`](./docs/secrets/providers.md), [`docs/ci-act.md`](./docs/ci-act.md) |
|
|
174
|
+
| Block drift before release | Guardrails cover docs, blueprints, catalog drift, reference parity, paths, licenses, secrets, tech debt, and package surface. | [audit source](https://github.com/webpresso/agent-kit/tree/main/src/audit), [`docs/bench/reference-parity-matrix.md`](./docs/bench/reference-parity-matrix.md), [host smoke test](https://github.com/webpresso/agent-kit/blob/main/src/__integration__/reference-parity-host-smoke.integration.test.ts), [tool surface test](https://github.com/webpresso/agent-kit/blob/main/src/__integration__/reference-parity-tool-surface.integration.test.ts) |
|
|
175
|
+
| Tie claims to evidence | Public benchmark and release claims require docs gates plus a checked-in first-party result card under `docs/bench/result-cards/` before publication. | [`docs/bench/result-card-contract.md`](./docs/bench/result-card-contract.md), [`docs/bench/result-cards/README.md`](./docs/bench/result-cards/README.md), [public readiness script](https://github.com/webpresso/agent-kit/blob/main/scripts/public-readiness.ts) |
|
|
139
176
|
|
|
140
177
|
## Develop/deploy workflow shape
|
|
141
178
|
|
|
@@ -258,7 +295,8 @@ surfaces, quality gates, MCP tools, session memory, worktrees, blueprints,
|
|
|
258
295
|
preview/deploy guardrails, and audit policy in one repeatable package.
|
|
259
296
|
|
|
260
297
|
Skip it when you only want a prompt library, cannot run Node-based developer
|
|
261
|
-
tooling, or do not want repo-local agent files.
|
|
298
|
+
tooling, or do not want repo-local agent files. Agent Kit is a repository
|
|
299
|
+
delivery harness around coding-agent hosts, not a runtime agent SDK — see
|
|
262
300
|
[`docs/is-agent-kit-for-me.md`](https://github.com/webpresso/agent-kit/blob/main/docs/is-agent-kit-for-me.md).
|
|
263
301
|
|
|
264
302
|
## Maintainer verification
|
package/bin/_run.js
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { spawn, spawnSync } from "node:child_process";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
accessSync,
|
|
6
|
+
constants,
|
|
7
|
+
existsSync,
|
|
8
|
+
readFileSync,
|
|
9
|
+
readdirSync,
|
|
10
|
+
realpathSync,
|
|
11
|
+
statSync,
|
|
12
|
+
} from "node:fs";
|
|
13
|
+
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
6
14
|
import { fileURLToPath } from "node:url";
|
|
7
15
|
|
|
8
16
|
import {
|
|
@@ -28,6 +36,9 @@ const LAUNCHER_LINEAGE_ENV = "WP_INTERNAL_LAUNCHER_LINEAGE";
|
|
|
28
36
|
const MAX_LAUNCHER_LINEAGE_DEPTH = 16;
|
|
29
37
|
const MAX_LAUNCHER_LINEAGE_BYTES = 16 * 1024;
|
|
30
38
|
const WP_PROBE_TIMEOUT_MS = 5_000;
|
|
39
|
+
// Set on the child env when bootstrapping deps via `vp install`; a re-entrant `wp install`
|
|
40
|
+
// (e.g. a vp wrapper that shells back to wp) sees it and refuses, bounding recursion.
|
|
41
|
+
const BOOTSTRAP_VP_INSTALL_SENTINEL = "WP_BOOTSTRAP_VP_INSTALL";
|
|
31
42
|
const WP_PROBE_TERM_GRACE_MS = 250;
|
|
32
43
|
const WP_PROBE_KILL_OBSERVE_MS = 1_000;
|
|
33
44
|
const WP_PROBE_OUTPUT_LIMIT_BYTES = 64 * 1024;
|
|
@@ -371,10 +382,13 @@ function runtimeSourceRequiresSourceLaunch(sourceRootDir, builtRootDir) {
|
|
|
371
382
|
return false;
|
|
372
383
|
}
|
|
373
384
|
|
|
374
|
-
function wpSourceRequiresSourceLaunch(repoRoot) {
|
|
385
|
+
export function wpSourceRequiresSourceLaunch(repoRoot) {
|
|
375
386
|
const sourceRoots = [
|
|
376
387
|
["src", "cli"],
|
|
377
388
|
["src", "tool-runtime"],
|
|
389
|
+
["src", "mcp"],
|
|
390
|
+
["src", "blueprint"],
|
|
391
|
+
["src", "audit"],
|
|
378
392
|
];
|
|
379
393
|
|
|
380
394
|
return sourceRoots.some((segments) =>
|
|
@@ -839,6 +853,139 @@ function formatMissingPathDelegateDiagnostic(repoRoot) {
|
|
|
839
853
|
].join(" ");
|
|
840
854
|
}
|
|
841
855
|
|
|
856
|
+
// Shared PATH-scan core for the bootstrap layer: yields { candidate, realpath } for each
|
|
857
|
+
// `join(dir, name)` (name ∈ binNames) across PATH, realpath-deduped, skipping excludedOwners.
|
|
858
|
+
// Extracted so the wp delegate resolver and the vp bootstrap resolver share one loop instead of
|
|
859
|
+
// copying it. binNames is a list so callers can supply Windows PATHEXT variants (e.g. vp.cmd).
|
|
860
|
+
function* iterateAgentPathCandidates({ binNames, pathEnv, excludedOwners = new Set() }) {
|
|
861
|
+
const seen = new Set();
|
|
862
|
+
for (const dir of pathEnv.split(delimiter)) {
|
|
863
|
+
if (!dir) continue;
|
|
864
|
+
for (const binName of binNames) {
|
|
865
|
+
const candidate = join(dir, binName);
|
|
866
|
+
if (!existsSync(candidate)) continue;
|
|
867
|
+
let realpath;
|
|
868
|
+
try {
|
|
869
|
+
realpath = canonicalPath(candidate);
|
|
870
|
+
} catch {
|
|
871
|
+
continue;
|
|
872
|
+
}
|
|
873
|
+
if (excludedOwners.has(realpath) || seen.has(realpath)) continue;
|
|
874
|
+
seen.add(realpath);
|
|
875
|
+
yield { candidate, realpath };
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
// Plain-JS mirror of src/cli/global-vp.ts's rejection contract. bin/_run.js is the
|
|
881
|
+
// dependency-free bootstrap layer and cannot import global-vp.ts (TS, resolved from
|
|
882
|
+
// node_modules that do not exist yet), so the contract is duplicated here by necessity.
|
|
883
|
+
function splitPathSegments(value) {
|
|
884
|
+
const normalized = value.replace(/\\/g, sep);
|
|
885
|
+
const stripped = normalized.startsWith(sep) ? normalized.slice(sep.length) : normalized;
|
|
886
|
+
return stripped.split(sep).filter((segment) => segment.length > 0 && segment !== delimiter);
|
|
887
|
+
}
|
|
888
|
+
function hasSegmentPair(segments, left, right) {
|
|
889
|
+
return segments.some((segment, index) => segment === left && segments[index + 1] === right);
|
|
890
|
+
}
|
|
891
|
+
function isProjectNodeModulesCandidate(value) {
|
|
892
|
+
const segments = splitPathSegments(value);
|
|
893
|
+
return segments.includes("node_modules") && !segments.includes(".vite-plus");
|
|
894
|
+
}
|
|
895
|
+
function isRuntimeLocalVitePlusCandidate(value) {
|
|
896
|
+
return hasSegmentPair(splitPathSegments(value), ".vite-plus", "js_runtime");
|
|
897
|
+
}
|
|
898
|
+
function isRejectedBootstrapVpCandidate(candidatePath, realpath) {
|
|
899
|
+
return (
|
|
900
|
+
isProjectNodeModulesCandidate(candidatePath) ||
|
|
901
|
+
isProjectNodeModulesCandidate(realpath) ||
|
|
902
|
+
isRuntimeLocalVitePlusCandidate(candidatePath) ||
|
|
903
|
+
isRuntimeLocalVitePlusCandidate(realpath)
|
|
904
|
+
);
|
|
905
|
+
}
|
|
906
|
+
function isExecutableFile(path, platform = process.platform) {
|
|
907
|
+
try {
|
|
908
|
+
if (!statSync(path).isFile()) return false;
|
|
909
|
+
if (platform !== "win32") accessSync(path, constants.X_OK);
|
|
910
|
+
return true;
|
|
911
|
+
} catch {
|
|
912
|
+
return false;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
// The `vp` filenames to look for on PATH. On Windows, expand PATHEXT (e.g. vp.cmd, vp.exe) so a
|
|
917
|
+
// shim-installed `vp` is found; elsewhere just `vp`. Mirrors src/cli/global-vp.ts's discovery.
|
|
918
|
+
function bootstrapVpCandidateNames(platform, env) {
|
|
919
|
+
if (platform !== "win32") return ["vp"];
|
|
920
|
+
const exts = (env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD")
|
|
921
|
+
.split(";")
|
|
922
|
+
.map((ext) => ext.trim())
|
|
923
|
+
.filter((ext) => ext.length > 0);
|
|
924
|
+
return [...exts.map((ext) => `vp${ext}`), "vp"];
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
// Build the spawn descriptor for a resolved vp. On Windows a `.cmd`/`.bat` shim must run through
|
|
928
|
+
// the command interpreter; elsewhere the realpath is executed directly. Mirrors global-vp.ts.
|
|
929
|
+
function bootstrapVpCommand(realpath, platform, env) {
|
|
930
|
+
if (platform === "win32" && /\.(?:cmd|bat)$/iu.test(realpath)) {
|
|
931
|
+
return {
|
|
932
|
+
command: env.ComSpec ?? env.COMSPEC ?? "cmd.exe",
|
|
933
|
+
args: ["/d", "/s", "/c", realpath],
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
return { command: realpath, args: [] };
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
// Resolve a global Vite+ (`vp`) binary on PATH to bootstrap dependency installation on a bare
|
|
940
|
+
// agent-kit source checkout, where `wp install` cannot load its own CLI. Mirrors the
|
|
941
|
+
// `resolveGlobalCapableVp` contract: rejects project-local and Vite+ runtime-local `vp`, checks
|
|
942
|
+
// executability, expands Windows PATHEXT, and wraps `.cmd`/`.bat` shims. Returns a spawn
|
|
943
|
+
// descriptor `{ command, args }` (args is the prefix before the forwarded install args) or null.
|
|
944
|
+
export function resolveBareCheckoutVp({
|
|
945
|
+
pathEnv = process.env.PATH ?? "",
|
|
946
|
+
platform = process.platform,
|
|
947
|
+
env = process.env,
|
|
948
|
+
} = {}) {
|
|
949
|
+
const binNames = bootstrapVpCandidateNames(platform, env);
|
|
950
|
+
for (const { candidate, realpath } of iterateAgentPathCandidates({ binNames, pathEnv })) {
|
|
951
|
+
if (isRejectedBootstrapVpCandidate(candidate, realpath)) continue;
|
|
952
|
+
if (!isExecutableFile(realpath, platform)) continue;
|
|
953
|
+
return bootstrapVpCommand(realpath, platform, env);
|
|
954
|
+
}
|
|
955
|
+
return null;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
// True only for a BARE `wp install` on a bare checkout. Positional subcommands
|
|
959
|
+
// (`wp install codex|claude-code|opencode|oh-my`, or `wp install <pkg>`) route to
|
|
960
|
+
// adapter/global-install/add paths in the real CLI and must NOT be blindly delegated to
|
|
961
|
+
// `vp install`; only flag-only forms (e.g. `--frozen-lockfile`) pass. Deliberately not
|
|
962
|
+
// generalized to `update`/`add`: default `wp update` is a tooling refresh, not a PM install.
|
|
963
|
+
//
|
|
964
|
+
// Eligibility keys off whether the CLI can actually load, not merely `node_modules` absence: the
|
|
965
|
+
// CLI's own dependency `cac` must be present, or a built dist CLI must exist. This covers both a
|
|
966
|
+
// fully bare checkout AND a partial/interrupted install (node_modules present but `cac` missing),
|
|
967
|
+
// which would otherwise fall through to the same missing-dependency source crash.
|
|
968
|
+
export function isInstallBootstrapNeeded(binName, argv, { repoRoot, env = process.env } = {}) {
|
|
969
|
+
if (binName !== "wp") return false;
|
|
970
|
+
if (argv[0] !== "install") return false;
|
|
971
|
+
if (!argv.slice(1).every((arg) => arg.startsWith("-"))) return false;
|
|
972
|
+
if (env.WP_FORCE_SOURCE === "1") return false;
|
|
973
|
+
if (!isAgentKitSourceRepo(repoRoot)) return false;
|
|
974
|
+
const cacInstalled = existsSync(join(repoRoot, "node_modules", "cac"));
|
|
975
|
+
const builtCli = existsSync(join(repoRoot, "dist", "esm", "cli", "cli.js"));
|
|
976
|
+
return !cacInstalled && !builtCli;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
function formatMissingBareInstallDiagnostic(repoRoot) {
|
|
980
|
+
return [
|
|
981
|
+
"Unable to bootstrap dependencies for this @webpresso/agent-kit checkout:",
|
|
982
|
+
"its runtime dependencies are not installed, so `wp install` cannot load its own CLI (which",
|
|
983
|
+
"depends on packages that are not present yet).",
|
|
984
|
+
`No Vite+ (\`vp\`) binary was found on PATH to perform the install for ${repoRoot}.`,
|
|
985
|
+
"Install Vite+ (see the vite-plus documentation) or run a supported global `wp`, then re-run `wp install`.",
|
|
986
|
+
].join(" ");
|
|
987
|
+
}
|
|
988
|
+
|
|
842
989
|
export async function resolvePathDelegateWp({
|
|
843
990
|
repoRoot = resolvePackageRoot(),
|
|
844
991
|
pathEnv = process.env.PATH ?? "",
|
|
@@ -861,24 +1008,15 @@ export async function resolvePathDelegateWp({
|
|
|
861
1008
|
|
|
862
1009
|
const excludedOwners = new Set(launcherLineage);
|
|
863
1010
|
if (selfRealpath !== null) excludedOwners.add(selfRealpath);
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
} catch {
|
|
873
|
-
continue;
|
|
874
|
-
}
|
|
875
|
-
if (excludedOwners.has(candidateRealpath) || seenCandidates.has(candidateRealpath)) continue;
|
|
876
|
-
seenCandidates.add(candidateRealpath);
|
|
877
|
-
const probeEnv = withLauncherDelegate(env, launcherLineage, candidateRealpath);
|
|
878
|
-
if (!(await isAgentKitWpBinary(candidateRealpath, probeEnv, probeVersion, probeCommand))) {
|
|
879
|
-
continue;
|
|
1011
|
+
for (const { realpath } of iterateAgentPathCandidates({
|
|
1012
|
+
binNames: ["wp"],
|
|
1013
|
+
pathEnv,
|
|
1014
|
+
excludedOwners,
|
|
1015
|
+
})) {
|
|
1016
|
+
const probeEnv = withLauncherDelegate(env, launcherLineage, realpath);
|
|
1017
|
+
if (await isAgentKitWpBinary(realpath, probeEnv, probeVersion, probeCommand)) {
|
|
1018
|
+
return realpath;
|
|
880
1019
|
}
|
|
881
|
-
return candidateRealpath;
|
|
882
1020
|
}
|
|
883
1021
|
return null;
|
|
884
1022
|
}
|
|
@@ -954,6 +1092,31 @@ export async function runNamedBin(binName, argv = process.argv.slice(2)) {
|
|
|
954
1092
|
if (shouldBareMcpDelegate) throw new Error(formatMissingPathDelegateDiagnostic(repoRoot));
|
|
955
1093
|
}
|
|
956
1094
|
|
|
1095
|
+
// Dependency bootstrap for `wp install` when the CLI's own deps are not installed. Runs after
|
|
1096
|
+
// the global-`wp` delegate attempt above (a healthy global wp is preferred for bare checkouts),
|
|
1097
|
+
// and independently of `bareExternalPluginCheckout` so a partial/interrupted install (node_modules
|
|
1098
|
+
// present but unusable) is also recovered instead of crashing on the missing `cac` import.
|
|
1099
|
+
if (isInstallBootstrapNeeded(binName, argv, { repoRoot })) {
|
|
1100
|
+
if (process.env[BOOTSTRAP_VP_INSTALL_SENTINEL] === "1") {
|
|
1101
|
+
throw new Error(
|
|
1102
|
+
"Refusing recursive vp bootstrap: a vp on PATH re-invoked `wp install` during dependency bootstrap.",
|
|
1103
|
+
);
|
|
1104
|
+
}
|
|
1105
|
+
const vp = resolveBareCheckoutVp();
|
|
1106
|
+
if (!vp) throw new Error(formatMissingBareInstallDiagnostic(repoRoot));
|
|
1107
|
+
// Preserve the caller's cwd (matches package-manager.ts's `vp install`); do not force repoRoot.
|
|
1108
|
+
const installed = spawnSync(vp.command, [...vp.args, "install", ...argv.slice(1)], {
|
|
1109
|
+
stdio: "inherit",
|
|
1110
|
+
env: { ...process.env, [BOOTSTRAP_VP_INSTALL_SENTINEL]: "1" },
|
|
1111
|
+
});
|
|
1112
|
+
if (installed.error) throw installed.error;
|
|
1113
|
+
if (installed.signal) {
|
|
1114
|
+
process.kill(process.pid, installed.signal);
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
process.exit(installed.status ?? 1);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
957
1120
|
const plan = buildLaunchPlan({ binName, forwardedArgs: argv, repoRoot });
|
|
958
1121
|
const isHookDispatch = binName === "wp" && argv[0] === "hook";
|
|
959
1122
|
const isHooksRuntimeCommand =
|
package/catalog/AGENTS.md.tpl
CHANGED
|
@@ -47,8 +47,8 @@ Catalog-owned surfaces:
|
|
|
47
47
|
|
|
48
48
|
- Command routing is a hard invariant: prefer `wp`, then `vp`, then `pnpm`.
|
|
49
49
|
Use `vp` only when `wp` has no equivalent, and raw `pnpm` only when
|
|
50
|
-
neither facade can perform the operation. All
|
|
51
|
-
|
|
50
|
+
neither facade can perform the operation. All docs, instructions, scripts,
|
|
51
|
+
and workflows must follow this order.
|
|
52
52
|
- Prefer repo scripts/wrappers over ad-hoc commands.
|
|
53
53
|
- Repo hook/tool denial: switch to the named facade/lifecycle; do not retry raw.
|
|
54
54
|
- Reuse nearby utilities and patterns before adding new abstractions.
|
|
@@ -66,7 +66,7 @@ asynchronously.
|
|
|
66
66
|
Before claiming completion, run the narrowest MCP/`wp` checks that prove the
|
|
67
67
|
change: typecheck, lint/format, affected tests, policy, docs/blueprint, and
|
|
68
68
|
`wp sync --check` after template/catalog changes. Fix root cause or record the
|
|
69
|
-
blocker. Before pushing, run `
|
|
69
|
+
blocker. Before pushing, run `wp_ci_preflight` (see `ci-cost-local-first`).
|
|
70
70
|
|
|
71
71
|
## Communicate
|
|
72
72
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: implementer
|
|
3
|
+
description: Implement a scoped fix or feature end-to-end (reproduce, edit, verify) when the task needs real Edit/Write/Bash access, not just review or docs. Prefer this over general-purpose for a single well-scoped code change.
|
|
4
|
+
tools:
|
|
5
|
+
- Read
|
|
6
|
+
- Grep
|
|
7
|
+
- Glob
|
|
8
|
+
- Edit
|
|
9
|
+
- Write
|
|
10
|
+
- Bash
|
|
11
|
+
model: sonnet
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Implementer
|
|
15
|
+
|
|
16
|
+
You own landing one scoped code change: reproduce the problem or confirm the
|
|
17
|
+
requirement, make the minimal correct edit, and prove it works.
|
|
18
|
+
|
|
19
|
+
## Primary responsibilities
|
|
20
|
+
|
|
21
|
+
- Reproduce the failure or confirm the requirement before editing.
|
|
22
|
+
- Fix at the owning boundary — the root cause, not the nearest symptom.
|
|
23
|
+
- Write or strengthen a regression proof (test, or the nearest reliable
|
|
24
|
+
equivalent) that fails against the old behavior before your fix and passes
|
|
25
|
+
after.
|
|
26
|
+
- Update every consumer of a changed contract in the same change. No
|
|
27
|
+
half-migrations.
|
|
28
|
+
- Run the narrowest verification that proves the repaired behavior (lint,
|
|
29
|
+
typecheck, targeted tests, relevant audits) before reporting done.
|
|
30
|
+
|
|
31
|
+
## Scope discipline
|
|
32
|
+
|
|
33
|
+
- One coherent repair per dispatch. If the task turns out to be several
|
|
34
|
+
unrelated failures, say so and name them instead of bundling fixes.
|
|
35
|
+
- No speculative abstractions, config knobs, or unrelated cleanup alongside
|
|
36
|
+
the fix.
|
|
37
|
+
- No silent fallbacks, suppressions, or lint disables to make a check pass.
|
|
38
|
+
|
|
39
|
+
## Expected output
|
|
40
|
+
|
|
41
|
+
- The invariant that was broken, in one sentence.
|
|
42
|
+
- What changed and why, at the owning boundary.
|
|
43
|
+
- The verification that ran (commands, exit codes, test names) — not a claim
|
|
44
|
+
without evidence.
|
|
45
|
+
- Anything noticed but intentionally left unfixed, named explicitly.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: rule
|
|
3
|
+
slug: parallel-orchestration-quota
|
|
4
|
+
title: Parallel orchestration and quota discipline
|
|
5
|
+
status: active
|
|
6
|
+
scope: repo
|
|
7
|
+
applies_to: [agents]
|
|
8
|
+
related:
|
|
9
|
+
- ci-cost-local-first
|
|
10
|
+
- cmd-execution
|
|
11
|
+
- pre-implementation
|
|
12
|
+
- engineering-principles
|
|
13
|
+
- supported-agent-clis
|
|
14
|
+
created: "2026-07-24"
|
|
15
|
+
last_reviewed: "2026-07-24"
|
|
16
|
+
paths:
|
|
17
|
+
- "blueprints/**"
|
|
18
|
+
- "catalog/agent/**"
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Parallel orchestration and quota discipline
|
|
22
|
+
|
|
23
|
+
How to execute multi-blueprint work: one orchestrator, many cheap executors,
|
|
24
|
+
lowest defensible token/quota/CI cost. This is the **default** execution model
|
|
25
|
+
for programs of more than ~3 blueprints — not an opt-in mode.
|
|
26
|
+
|
|
27
|
+
Companion rules (do not restate them here): `ci-cost-local-first.md` for runner
|
|
28
|
+
policy, `cmd-execution.md` for the scoped-command surface,
|
|
29
|
+
`pre-implementation.md` for the blueprint gate, `engineering-principles.md` for
|
|
30
|
+
scope filters, `supported-agent-clis.md` for host tiers.
|
|
31
|
+
|
|
32
|
+
## Orchestrator / executor split
|
|
33
|
+
|
|
34
|
+
The session that owns the program is an **orchestrator**: it plans, sequences,
|
|
35
|
+
dispatches, reviews, and lands. It does not implement. Implementation is
|
|
36
|
+
delegated to **executor subagents**, one per blueprint, each confined to that
|
|
37
|
+
blueprint's owner worktree.
|
|
38
|
+
|
|
39
|
+
- Spawn a **fresh executor per task** inside a multi-task blueprint. Long
|
|
40
|
+
single-session runs drift; a fresh executor per task keeps a consolidated
|
|
41
|
+
blueprint cheap to run correctly.
|
|
42
|
+
- Executors never touch the primary checkout or another blueprint's worktree.
|
|
43
|
+
- The orchestrator runs from its own controller worktree cut from
|
|
44
|
+
`origin/main`, never from the primary checkout.
|
|
45
|
+
|
|
46
|
+
## Model tier by intrinsic difficulty
|
|
47
|
+
|
|
48
|
+
Pick the **cheapest model that can do the job**, judged by the hardest task in
|
|
49
|
+
the blueprint — never by aggregate diff size or file count.
|
|
50
|
+
|
|
51
|
+
| Complexity | Executor |
|
|
52
|
+
| --------------------------------------------------- | -------------------------------------------- |
|
|
53
|
+
| L / XL, design-heavy, security- or protocol-bearing | premium reasoning tier |
|
|
54
|
+
| M | mid tier, high effort |
|
|
55
|
+
| S / XS, mechanical | mid tier, medium effort — or small/fast tier |
|
|
56
|
+
|
|
57
|
+
A blueprint bundling many mechanically-trivial edits stays a cheap-tier job. If
|
|
58
|
+
a blueprint would need a premium tier only because of one hard task, that task
|
|
59
|
+
is mis-homed: move it to a blueprint whose tier it matches.
|
|
60
|
+
|
|
61
|
+
**Exception: design, UI, and frontend work always gets the premium tier**,
|
|
62
|
+
whatever its sized complexity — components, panels, layout, styling, UX flows,
|
|
63
|
+
design systems, and the frontend half of any feature. Mechanical work degrades
|
|
64
|
+
gracefully at a cheaper tier: it is either correct or it fails a test. Interface
|
|
65
|
+
work does not. A technically-correct but badly-judged UI passes every check and
|
|
66
|
+
still has to be redone, so the cheaper tier is not actually cheaper. Backend and
|
|
67
|
+
mechanical work keeps the cheapest-capable rule above.
|
|
68
|
+
|
|
69
|
+
## Quota awareness across hosts
|
|
70
|
+
|
|
71
|
+
Provider subscriptions are the budget. Treat weekly quota as a shared,
|
|
72
|
+
exhaustible resource across every host (see `supported-agent-clis.md`).
|
|
73
|
+
|
|
74
|
+
- Route each job — implementation and review alike — to the host whose
|
|
75
|
+
subscription can absorb it, not reflexively to the strongest one.
|
|
76
|
+
- On a provider usage-limit error, **rotate provider and resume** rather than
|
|
77
|
+
waiting or retrying the same host. Review gates are resumable by gate id.
|
|
78
|
+
- Never spend a premium tier on work a cheap tier finishes identically.
|
|
79
|
+
|
|
80
|
+
## Review and CI cost
|
|
81
|
+
|
|
82
|
+
Blueprint count is the dominant cost driver: one executable blueprint is one
|
|
83
|
+
PR, one external review, and one full CI matrix run.
|
|
84
|
+
|
|
85
|
+
- **Consolidate coherent work.** One blueprint = one reviewable contract in one
|
|
86
|
+
subsystem. Never straddle a dependency cut, mix intrinsic-difficulty tiers, or
|
|
87
|
+
merge unrelated subsystems just to reduce count.
|
|
88
|
+
- **Route each review gate to the cheapest adequate provider.** Reserve premium
|
|
89
|
+
reviewers for premium-tier blueprints.
|
|
90
|
+
- **Prefer work that needs no gate at all.** Markdown-only PRs are exempt from
|
|
91
|
+
blueprint PR coverage; pure git hygiene (branch/worktree pruning) needs no PR.
|
|
92
|
+
- Verify locally before pushing, and rebase onto fresh `origin/main` before
|
|
93
|
+
landing so cached CI layers are reused.
|
|
94
|
+
|
|
95
|
+
## Parallelism
|
|
96
|
+
|
|
97
|
+
Run 3–4 blueprints concurrently. Widen only when the extra lanes touch disjoint
|
|
98
|
+
files; serialize where they contend. When several features would edit one hot
|
|
99
|
+
file, land a **behavior-preserving split first** so each feature owns its own
|
|
100
|
+
file — that split pays for itself across the whole program.
|
|
@@ -7,7 +7,7 @@ scope: repo
|
|
|
7
7
|
applies_to: [agents, humans]
|
|
8
8
|
related: []
|
|
9
9
|
created: "2026-05-06"
|
|
10
|
-
last_reviewed: "2026-
|
|
10
|
+
last_reviewed: "2026-07-23"
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# Pre-Implementation Rules
|
|
@@ -157,6 +157,10 @@ as finished.
|
|
|
157
157
|
A blueprint is a **folder** (`blueprints/<status>/<slug>/_overview.md`) and may
|
|
158
158
|
not be promoted from `draft/` to `planned/` until it has **1 provenance-backed
|
|
159
159
|
approval from Claude/Codex/Grok or an OpenCode-Go model** on the current content.
|
|
160
|
+
Legacy flat blueprints (`blueprints/<status>/<slug>.md`) remain readable and
|
|
161
|
+
lifecycle-valid, but they have no sibling review authority; run
|
|
162
|
+
`wp blueprint canonicalize <slug>` before recording review ledgers, artifacts,
|
|
163
|
+
Ultragoal events, or approval frontmatter.
|
|
160
164
|
|
|
161
165
|
- **Gate input = committed in-folder review authority.** The preferred path is a
|
|
162
166
|
content-addressed v2 `review-events.jsonl` event produced by `wp review gate`.
|
|
@@ -203,6 +207,19 @@ approval from Claude/Codex/Grok or an OpenCode-Go model** on the current content
|
|
|
203
207
|
`approvals:` frontmatter with first-hand knowledge that reviewer actually
|
|
204
208
|
produced that verdict — there is intentionally no MCP-reachable shortcut
|
|
205
209
|
around that.
|
|
210
|
+
- **`wp review override <slug> --reason "…" --confirm` is the gated CLI escape
|
|
211
|
+
hatch for a genuinely un-convergeable gate** — a strong reviewer legitimately
|
|
212
|
+
rejected the subject but its sole remaining blocker is physically
|
|
213
|
+
un-remediable (e.g. a platform residual the code cannot fix). It records a
|
|
214
|
+
`maintainer-override` approval that satisfies the promotion gate DISTINCTLY
|
|
215
|
+
(never counted as a strong or OpenCode-Go approval). It is not a way to skip
|
|
216
|
+
review: it REFUSES unless a formal Claude/Codex/Grok/OpenCode-Go gate has
|
|
217
|
+
already rejected the exact current subject, and it requires an explicit reason
|
|
218
|
+
plus `--confirm`. `maintainer-override` is not in the `wp review log` /
|
|
219
|
+
`wp_blueprint_review_log` reviewer enum, so this command is the only writer —
|
|
220
|
+
there is no MCP-reachable or frontmatter shortcut to mint it. Reserve it for
|
|
221
|
+
the residual that no code change can close; a normal blocker is fixed and
|
|
222
|
+
re-reviewed, not overridden.
|
|
206
223
|
- **Retry interrupted or structurally failed gates with the same immutable
|
|
207
224
|
target** by running `wp review gate ... --resume <gate-id>`. Aborted,
|
|
208
225
|
timed-out, incomplete, and protocol/transport failures append a new attempt
|
|
@@ -210,6 +227,16 @@ approval from Claude/Codex/Grok or an OpenCode-Go model** on the current content
|
|
|
210
227
|
killed writer is never overwritten. A complete content rejection is terminal
|
|
211
228
|
for that unchanged target, while active provider limits/unavailability remain
|
|
212
229
|
suppressed until their recorded retry window permits another attempt.
|
|
230
|
+
- **Completed rejections have a two-subject circuit breaker.** Plan review
|
|
231
|
+
lineage uses the canonical `wp-blueprint-v1` subject, so lifecycle/trust
|
|
232
|
+
bookkeeping commits reuse the prior rejection and do not invoke another
|
|
233
|
+
reviewer. One semantically changed remediation subject may receive the final
|
|
234
|
+
formal review; its prompt includes the prior rejection artifact and requires
|
|
235
|
+
all remaining blockers together. After two distinct semantic subjects are
|
|
236
|
+
rejected, `wp review gate` returns `scope-exhausted` before provider
|
|
237
|
+
invocation. Stop automated retries and obtain an explicit human scope
|
|
238
|
+
decision before creating a successor blueprint. Plan and delivery purposes
|
|
239
|
+
have separate budgets; delivery retains its existing whole-tree subject.
|
|
213
240
|
- **`provider-event-too-large` means one captured provider JSON event exceeded
|
|
214
241
|
the bounded event limit; it is not a reviewer verdict.** Keep the bound in
|
|
215
242
|
place, retry the same gate id, and switch provider/model when possible because
|
|
@@ -56,6 +56,15 @@ This is a product control-plane surface, not a silent Tier-1 promotion:
|
|
|
56
56
|
- Missing binary/auth degrades with an explicit UI reason (never silent omit).
|
|
57
57
|
- Benchmarks/plugins that require Tier-1 guarantees MUST still treat Grok as
|
|
58
58
|
outside Tier 1 until a separate tier promotion lands.
|
|
59
|
+
- `wp setup` also delivers the native project surfaces for Grok: the
|
|
60
|
+
`.grok/config.toml` `[mcp_servers.webpresso]` entry and trust-gated
|
|
61
|
+
`.grok/hooks/webpresso.json` managed hooks (run `/hooks-trust` once in Grok).
|
|
62
|
+
Grok reads `AGENTS.md`/`CLAUDE.md` natively, so no instruction projection is
|
|
63
|
+
needed.
|
|
64
|
+
- After trusting the project hooks, operators verify native discovery with
|
|
65
|
+
`grok inspect --json`, `grok mcp list --json`, and
|
|
66
|
+
`grok mcp doctor --json`. Grok remains a trial host until its protected
|
|
67
|
+
privacy/native-proof job passes for the release SHA.
|
|
59
68
|
|
|
60
69
|
## Tier 3 — not supported
|
|
61
70
|
|