@webpresso/agent-kit 3.1.30 → 3.2.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.
Potentially problematic release.
This version of @webpresso/agent-kit might be problematic. Click here for more details.
- package/README.md +53 -15
- package/bin/_run.js +179 -19
- 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/ci-guardrails-wiring.d.ts +22 -0
- package/dist/esm/audit/ci-guardrails-wiring.js +90 -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 +8 -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 +43 -1
- 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 +65 -10
- 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.js +36 -11
- 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/trust/command-runner.d.ts +26 -0
- package/dist/esm/blueprint/trust/command-runner.js +148 -0
- 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 +62 -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 +10 -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 +34 -0
- package/dist/esm/cli/commands/agent-launch.d.ts +6 -1
- package/dist/esm/cli/commands/agent-launch.js +82 -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 +17 -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 +6 -3
- 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 +24 -0
- package/dist/esm/cli/commands/init/convergence-apply.js +221 -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 +1 -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/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 +11 -0
- package/dist/esm/cli/commands/init/scaffold-base-kit.js +56 -1
- 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 +51 -23
- 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 +7 -0
- package/dist/esm/cli/commands/init/scaffolders/file-transaction.js +58 -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-rotate.d.ts +49 -0
- package/dist/esm/cli/commands/opencode-rotate.js +135 -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/review.d.ts +35 -3
- package/dist/esm/cli/commands/review.js +729 -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/setup-help.js +1 -1
- package/dist/esm/cli/commands/setup-repair-help.js +1 -1
- package/dist/esm/cli/commands/worktree/router-dispatch.js +13 -8
- 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 +3 -3
- package/dist/esm/hooks/doctor.js +30 -15
- 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/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 +23 -8
- package/dist/esm/hooks/stop/qa-changed-files.d.ts +11 -0
- package/dist/esm/hooks/stop/qa-changed-files.js +74 -0
- package/dist/esm/mcp/blueprint/_shared/lifecycle.js +14 -1
- package/dist/esm/mcp/blueprint/handlers/document-mutations.js +78 -4
- 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 +4 -1
- package/dist/esm/mcp/tools/audit.js +30 -0
- package/dist/esm/mcp/tools/audits.d.ts +3 -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-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/review/authority.js +13 -5
- package/dist/esm/review/availability.d.ts +22 -0
- package/dist/esm/review/availability.js +107 -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.js +26 -9
- 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 +87 -6
- package/dist/esm/review/execution/supervisor.js +5 -0
- package/dist/esm/review/execution/types.d.ts +8 -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 +12 -0
- package/dist/esm/review/subject.js +74 -22
- package/dist/esm/runtime/opencode-account-materializer.d.ts +34 -0
- package/dist/esm/runtime/opencode-account-materializer.js +33 -0
- package/dist/esm/status/snapshot.js +30 -19
- 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 -1
- package/dist/esm/test-helpers/global-setup.js +68 -24
- 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/registry.d.ts +8 -0
- package/dist/esm/worktrees/registry.js +18 -3
- package/package.json +16 -13
|
@@ -7,4 +7,10 @@ export interface VitestWorkerBudget {
|
|
|
7
7
|
readonly subprocess: number;
|
|
8
8
|
}
|
|
9
9
|
export declare function parsePositiveInteger(value: string | undefined): number | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Allocate one worker ceiling across concurrently running Vitest projects.
|
|
12
|
+
* Standalone project runs keep `computeVitestWorkerBudget`; only the supervisor
|
|
13
|
+
* uses this aggregate contract.
|
|
14
|
+
*/
|
|
15
|
+
export declare function computeConcurrentVitestWorkerBudget(options?: VitestWorkerBudgetOptions): VitestWorkerBudget;
|
|
10
16
|
export declare function computeVitestWorkerBudget(options?: VitestWorkerBudgetOptions): VitestWorkerBudget;
|
|
@@ -9,12 +9,70 @@ function splitSharedBudget(totalWorkers) {
|
|
|
9
9
|
if (totalWorkers <= 2) {
|
|
10
10
|
return { unit: 1, subprocess: 1 };
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
// Even split. The lanes carry near-equal total work (measured 2026-07-23 on
|
|
13
|
+
// an 8-core host: unit ≈320 worker-seconds, subprocess ≈266 — see
|
|
14
|
+
// docs/ci-test-perf.md), so the previous 2/3-unit skew starved the
|
|
15
|
+
// subprocess lane: its makespan, not unit's, bounded the whole run
|
|
16
|
+
// (subprocess lane >296s at 2 workers vs 168s at 4 on the same host).
|
|
17
|
+
// CI is unaffected — it pins WP_VITEST_MAX_WORKERS=2, taking the early
|
|
18
|
+
// return above.
|
|
19
|
+
const unit = Math.max(1, Math.round(totalWorkers / 2));
|
|
13
20
|
return {
|
|
14
21
|
unit,
|
|
15
22
|
subprocess: Math.max(1, totalWorkers - unit),
|
|
16
23
|
};
|
|
17
24
|
}
|
|
25
|
+
function readWorkerOverride(env, name) {
|
|
26
|
+
const raw = env[name];
|
|
27
|
+
if (raw === undefined)
|
|
28
|
+
return;
|
|
29
|
+
const parsed = parsePositiveInteger(raw);
|
|
30
|
+
if (parsed === undefined) {
|
|
31
|
+
throw new Error(`${name} must be a positive integer, got ${JSON.stringify(raw)}`);
|
|
32
|
+
}
|
|
33
|
+
return parsed;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Allocate one worker ceiling across concurrently running Vitest projects.
|
|
37
|
+
* Standalone project runs keep `computeVitestWorkerBudget`; only the supervisor
|
|
38
|
+
* uses this aggregate contract.
|
|
39
|
+
*/
|
|
40
|
+
export function computeConcurrentVitestWorkerBudget(options = {}) {
|
|
41
|
+
const env = options.env ?? process.env;
|
|
42
|
+
const sharedOverride = readWorkerOverride(env, "WP_VITEST_MAX_WORKERS");
|
|
43
|
+
const unitOverride = readWorkerOverride(env, "WP_VITEST_UNIT_MAX_WORKERS");
|
|
44
|
+
const subprocessOverride = readWorkerOverride(env, "WP_VITEST_SUBPROCESS_MAX_WORKERS");
|
|
45
|
+
if (sharedOverride === undefined &&
|
|
46
|
+
unitOverride !== undefined &&
|
|
47
|
+
subprocessOverride !== undefined) {
|
|
48
|
+
return { unit: unitOverride, subprocess: subprocessOverride };
|
|
49
|
+
}
|
|
50
|
+
const total = sharedOverride ?? (env.CI === "true" ? 2 : defaultSharedWorkers(options));
|
|
51
|
+
if (total < 2) {
|
|
52
|
+
throw new Error(`WP_VITEST_MAX_WORKERS must be at least 2 for concurrent projects, got ${total}`);
|
|
53
|
+
}
|
|
54
|
+
if (unitOverride !== undefined && subprocessOverride !== undefined) {
|
|
55
|
+
if (unitOverride + subprocessOverride > total) {
|
|
56
|
+
throw new Error(`Lane worker overrides (${unitOverride + subprocessOverride}) exceed aggregate worker budget ${total}`);
|
|
57
|
+
}
|
|
58
|
+
return { unit: unitOverride, subprocess: subprocessOverride };
|
|
59
|
+
}
|
|
60
|
+
if (unitOverride !== undefined) {
|
|
61
|
+
const subprocess = total - unitOverride;
|
|
62
|
+
if (subprocess < 1) {
|
|
63
|
+
throw new Error(`Unit worker override ${unitOverride} leaves no aggregate subprocess worker`);
|
|
64
|
+
}
|
|
65
|
+
return { unit: unitOverride, subprocess };
|
|
66
|
+
}
|
|
67
|
+
if (subprocessOverride !== undefined) {
|
|
68
|
+
const unit = total - subprocessOverride;
|
|
69
|
+
if (unit < 1) {
|
|
70
|
+
throw new Error(`Subprocess worker override ${subprocessOverride} leaves no aggregate unit worker`);
|
|
71
|
+
}
|
|
72
|
+
return { unit, subprocess: subprocessOverride };
|
|
73
|
+
}
|
|
74
|
+
return splitSharedBudget(total);
|
|
75
|
+
}
|
|
18
76
|
export function computeVitestWorkerBudget(options = {}) {
|
|
19
77
|
const env = options.env ?? process.env;
|
|
20
78
|
const sharedOverride = parsePositiveInteger(env.WP_VITEST_MAX_WORKERS);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TestProject } from "vitest/node";
|
|
2
2
|
export declare function shouldPrepareDistForProject(projectName: string | undefined): boolean;
|
|
3
|
-
export declare function setup(project?: Pick<TestProject, "name">): void
|
|
3
|
+
export declare function setup(project?: Pick<TestProject, "name">): Promise<void>;
|
|
@@ -1,44 +1,88 @@
|
|
|
1
1
|
import { execFileSync } from "node:child_process";
|
|
2
|
-
import { existsSync } from "node:fs";
|
|
2
|
+
import { existsSync, mkdirSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import lockfile from "proper-lockfile";
|
|
4
5
|
import { syncSastRuleAssets } from "#build/sast-rule-assets.js";
|
|
6
|
+
import { runFormat } from "#format/index.js";
|
|
5
7
|
import { ensureHostRuntimeArtifactsForSerialTests } from "./runtime-binary-artifacts.js";
|
|
6
8
|
const REPO_ROOT = process.cwd();
|
|
7
9
|
const DIST_SENTINEL = join(REPO_ROOT, "dist", "esm", "index.js");
|
|
8
10
|
const MIGRATION_SENTINEL = join(REPO_ROOT, "dist", "esm", "blueprint", "db", "migrations", "0001_seed.sql");
|
|
11
|
+
// Lock target lives outside dist/ (tshy rewrites dist/) and under the always-present, gitignored
|
|
12
|
+
// node_modules/.cache so a concurrent test run cannot clobber it mid-build.
|
|
13
|
+
const BUILD_LOCK_TARGET = join(REPO_ROOT, "node_modules", ".cache", "wp-test-setup");
|
|
9
14
|
const DIST_PREP_PROJECTS = new Set(["subprocess", "serial-subprocess"]);
|
|
10
15
|
export function shouldPrepareDistForProject(projectName) {
|
|
11
16
|
return projectName !== undefined && DIST_PREP_PROJECTS.has(projectName);
|
|
12
17
|
}
|
|
18
|
+
// Serialize the dist build across concurrent test runs sharing this checkout: tshy's non-atomic
|
|
19
|
+
// dist/package.json writes corrupt each other if two runs build at once. proper-lockfile gives a
|
|
20
|
+
// bounded wait plus native stale-owner recovery (a dead builder's lock is reclaimed after `stale`).
|
|
21
|
+
// The retry budget spans well past a cold build so a second run waits rather than failing closed.
|
|
22
|
+
async function withDistBuildLock(fn) {
|
|
23
|
+
mkdirSync(join(REPO_ROOT, "node_modules", ".cache"), { recursive: true });
|
|
24
|
+
const release = await lockfile.lock(BUILD_LOCK_TARGET, {
|
|
25
|
+
realpath: false,
|
|
26
|
+
stale: 120_000,
|
|
27
|
+
retries: { retries: 40, factor: 1.4, minTimeout: 200, maxTimeout: 5_000 },
|
|
28
|
+
});
|
|
29
|
+
try {
|
|
30
|
+
return await fn();
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
await release();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
13
36
|
// Build before subprocess workers fork — tshy's non-atomic package.json write races with bun subprocess reads in init.e2e.test.ts.
|
|
14
37
|
// Unit-only runs should not pay this build/setup cost, and Vitest passes the selected TestProject to globalSetup.
|
|
15
|
-
export function setup(project) {
|
|
38
|
+
export async function setup(project) {
|
|
16
39
|
syncSastRuleAssets(REPO_ROOT);
|
|
17
40
|
if (!shouldPrepareDistForProject(project?.name))
|
|
18
41
|
return;
|
|
19
|
-
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
builtDist = true;
|
|
27
|
-
}
|
|
28
|
-
if (!existsSync(MIGRATION_SENTINEL)) {
|
|
29
|
-
execFileSync("bun", ["src/build/blueprint-migration-assets.ts"], {
|
|
30
|
-
cwd: REPO_ROOT,
|
|
31
|
-
encoding: "utf8",
|
|
32
|
-
env: { ...process.env, HUSKY: "0" },
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
if (builtDist) {
|
|
36
|
-
execFileSync("bun", ["src/build/normalize-tsconfig-json-exports.ts"], {
|
|
37
|
-
cwd: REPO_ROOT,
|
|
38
|
-
encoding: "utf8",
|
|
39
|
-
env: { ...process.env, HUSKY: "0" },
|
|
40
|
-
});
|
|
42
|
+
// Fast path: nothing to build. Only pay the lock when a build artifact is actually missing.
|
|
43
|
+
if (existsSync(DIST_SENTINEL) && existsSync(MIGRATION_SENTINEL)) {
|
|
44
|
+
if (project?.name === "serial-subprocess") {
|
|
45
|
+
ensureHostRuntimeArtifactsForSerialTests({ rootDir: REPO_ROOT });
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
41
48
|
}
|
|
49
|
+
await withDistBuildLock(async () => {
|
|
50
|
+
let builtDist = false;
|
|
51
|
+
// Re-check under the lock: another run may have completed the build while we waited.
|
|
52
|
+
if (!existsSync(DIST_SENTINEL)) {
|
|
53
|
+
execFileSync("./node_modules/.bin/tshy", [], {
|
|
54
|
+
cwd: REPO_ROOT,
|
|
55
|
+
encoding: "utf8",
|
|
56
|
+
env: { ...process.env, HUSKY: "0" },
|
|
57
|
+
});
|
|
58
|
+
builtDist = true;
|
|
59
|
+
// tshy rewrites package.json's exports with a trailing newline the repo formatter forbids
|
|
60
|
+
// (`.editorconfig [*.json] insert_final_newline = false`), which would leave a clean worktree
|
|
61
|
+
// dirty. The real `build` script (package.json `"build"`) restores it with `wp format --file
|
|
62
|
+
// package.json`; mirror that here in-process (runFormat spawns only `vp fmt`, avoiding a second
|
|
63
|
+
// cold CLI launch) so `wp test` never dirties package.json. See package-scripts.test.ts.
|
|
64
|
+
// Fail loudly if the restore does not succeed — a silent failure would ship a dirty package.json.
|
|
65
|
+
const restored = await runFormat({ files: ["package.json"], cwd: REPO_ROOT });
|
|
66
|
+
if (!restored.passed) {
|
|
67
|
+
throw new Error(`global-setup: could not restore package.json formatting after tshy (exit ${restored.exitCode})` +
|
|
68
|
+
`${restored.spawnError ? `: ${restored.spawnError}` : ""}\n${restored.output}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (!existsSync(MIGRATION_SENTINEL)) {
|
|
72
|
+
execFileSync("bun", ["src/build/blueprint-migration-assets.ts"], {
|
|
73
|
+
cwd: REPO_ROOT,
|
|
74
|
+
encoding: "utf8",
|
|
75
|
+
env: { ...process.env, HUSKY: "0" },
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
if (builtDist) {
|
|
79
|
+
execFileSync("bun", ["src/build/normalize-tsconfig-json-exports.ts"], {
|
|
80
|
+
cwd: REPO_ROOT,
|
|
81
|
+
encoding: "utf8",
|
|
82
|
+
env: { ...process.env, HUSKY: "0" },
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
42
86
|
if (project?.name === "serial-subprocess") {
|
|
43
87
|
ensureHostRuntimeArtifactsForSerialTests({ rootDir: REPO_ROOT });
|
|
44
88
|
}
|
|
@@ -70,6 +70,13 @@ export declare function decideUltragoalRun(input: {
|
|
|
70
70
|
readonly currentSourceSnapshot?: string;
|
|
71
71
|
readonly now?: Date;
|
|
72
72
|
}): UltragoalRunDecision;
|
|
73
|
+
/**
|
|
74
|
+
* Preflight every blueprint's document shape BEFORE a durable state
|
|
75
|
+
* transition. Ledger callbacks run after state is committed, so a flat
|
|
76
|
+
* blueprint must be rejected here or the command throws with state already
|
|
77
|
+
* written. Missing blueprints are tolerated exactly like the ledger append.
|
|
78
|
+
*/
|
|
79
|
+
export declare function assertUltragoalBlueprintShapes(cwd: string, slugs: readonly string[]): void;
|
|
73
80
|
export declare function createUltragoal(input: {
|
|
74
81
|
readonly cwd?: string;
|
|
75
82
|
readonly brief: string;
|
|
@@ -7,6 +7,7 @@ import { BlueprintCreationService } from "#service/BlueprintCreationService.js";
|
|
|
7
7
|
import { BlueprintService } from "#service/BlueprintService.js";
|
|
8
8
|
import { scanBlueprintDirectory } from "#service/scanner.js";
|
|
9
9
|
import { resolveBlueprintRoot } from "#utils/blueprint-root.js";
|
|
10
|
+
import { assertFolderBlueprintIdentity, resolveBlueprintDocumentIdentity, } from "#utils/document-paths.js";
|
|
10
11
|
import { assertUltragoalEnabled, assertUltragoalMutationAllowed } from "./guards.js";
|
|
11
12
|
import { evaluateUltragoalCompletion, hasRepeatedQaError, MAX_STOP_STREAK, MAX_VALIDATION_ROUNDS, } from "./completion.js";
|
|
12
13
|
import { formatUltragoalHandoff } from "./handoff.js";
|
|
@@ -222,14 +223,43 @@ export function decideUltragoalRun(input) {
|
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
function findBlueprint(cwd, slug) {
|
|
226
|
+
const baseDir = resolveBlueprintRoot(cwd);
|
|
225
227
|
const entries = scanBlueprintDirectory({
|
|
226
|
-
baseDir
|
|
228
|
+
baseDir,
|
|
227
229
|
includeSpecialFolders: true,
|
|
228
230
|
});
|
|
229
231
|
const found = entries.find((entry) => entry.slug === slug || entry.slug.endsWith(`/${slug}`));
|
|
230
232
|
if (!found)
|
|
231
233
|
throw new Error(`Blueprint not found: ${slug}`);
|
|
232
|
-
|
|
234
|
+
const identity = resolveBlueprintDocumentIdentity(baseDir, found.path);
|
|
235
|
+
if (!identity) {
|
|
236
|
+
throw new Error(`Blueprint ${found.slug} resolved to an invalid document path: ${found.path}`);
|
|
237
|
+
}
|
|
238
|
+
return { path: found.path, shape: identity.shape, slug: found.slug };
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Preflight every blueprint's document shape BEFORE a durable state
|
|
242
|
+
* transition. Ledger callbacks run after state is committed, so a flat
|
|
243
|
+
* blueprint must be rejected here or the command throws with state already
|
|
244
|
+
* written. Missing blueprints are tolerated exactly like the ledger append.
|
|
245
|
+
*/
|
|
246
|
+
export function assertUltragoalBlueprintShapes(cwd, slugs) {
|
|
247
|
+
for (const slug of slugs) {
|
|
248
|
+
let found;
|
|
249
|
+
try {
|
|
250
|
+
found = findBlueprint(cwd, slug);
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
if (error instanceof Error && error.message === `Blueprint not found: ${slug}`)
|
|
254
|
+
continue;
|
|
255
|
+
throw error;
|
|
256
|
+
}
|
|
257
|
+
assertFolderBlueprintIdentity({
|
|
258
|
+
documentPath: found.path,
|
|
259
|
+
lifecycleSlug: found.slug,
|
|
260
|
+
shape: found.shape,
|
|
261
|
+
});
|
|
262
|
+
}
|
|
233
263
|
}
|
|
234
264
|
function appendUltragoalLedgerEvent(cwd, slug, state, event) {
|
|
235
265
|
let found;
|
|
@@ -241,6 +271,11 @@ function appendUltragoalLedgerEvent(cwd, slug, state, event) {
|
|
|
241
271
|
return;
|
|
242
272
|
throw error;
|
|
243
273
|
}
|
|
274
|
+
assertFolderBlueprintIdentity({
|
|
275
|
+
documentPath: found.path,
|
|
276
|
+
lifecycleSlug: found.slug,
|
|
277
|
+
shape: found.shape,
|
|
278
|
+
});
|
|
244
279
|
const reviewsPath = join(dirname(found.path), "reviews.md");
|
|
245
280
|
mkdirSync(dirname(reviewsPath), { recursive: true });
|
|
246
281
|
const prefix = existsSync(reviewsPath) ? "\n" : "# Blueprint reviews\n\n";
|
|
@@ -281,6 +316,7 @@ export async function createUltragoal(input) {
|
|
|
281
316
|
sessionId: input.sessionId ?? process.env.WP_SESSION_ID ?? randomUUID(),
|
|
282
317
|
ultragoalId: input.ultragoalId ?? `ultragoal-${randomUUID()}`,
|
|
283
318
|
});
|
|
319
|
+
assertUltragoalBlueprintShapes(cwd, blueprintSlugs);
|
|
284
320
|
await initializeUltragoalState(state, cwd, (written) => {
|
|
285
321
|
for (const slug of blueprintSlugs)
|
|
286
322
|
appendUltragoalLedgerEvent(cwd, slug, written, "created");
|
|
@@ -337,6 +373,9 @@ export async function getUltragoalHandoff(cwd = process.cwd()) {
|
|
|
337
373
|
}
|
|
338
374
|
export async function cancelUltragoal(cwd = process.cwd()) {
|
|
339
375
|
assertUltragoalMutationAllowed(cwd);
|
|
376
|
+
const current = await readUltragoalState(cwd);
|
|
377
|
+
if (current)
|
|
378
|
+
assertUltragoalBlueprintShapes(cwd, current.blueprintSlugs);
|
|
340
379
|
const next = await updateUltragoalState((state) => transitionUltragoalState(state, "cancelled"), cwd, (written) => {
|
|
341
380
|
for (const slug of written.blueprintSlugs) {
|
|
342
381
|
appendUltragoalLedgerEvent(cwd, slug, written, "cancelled");
|
|
@@ -394,6 +433,7 @@ export async function runCurrentUltragoal(cwd = process.cwd(), deps = {}) {
|
|
|
394
433
|
now: deps.now?.() ?? new Date(),
|
|
395
434
|
});
|
|
396
435
|
if (committedDecision.state !== status.state) {
|
|
436
|
+
assertUltragoalBlueprintShapes(cwd, committedDecision.state.blueprintSlugs);
|
|
397
437
|
await updateUltragoalState((current) => {
|
|
398
438
|
if (current.ultragoalId !== status.state?.ultragoalId ||
|
|
399
439
|
current.updatedAt !== status.state.updatedAt ||
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { closeSync, copyFileSync, existsSync, fdatasyncSync, fsyncSync, openSync, renameSync, rmSync, writeFileSync, } from "node:fs";
|
|
1
|
+
import { closeSync, copyFileSync, existsSync, fdatasyncSync, fchmodSync, fsyncSync, openSync, renameSync, rmSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { dirname } from "node:path";
|
|
4
4
|
export function writeJsonFile(path, data, options = {}) {
|
|
@@ -45,6 +45,8 @@ function writeFileAtomicWithPolicy(path, content, options, allowCrossDeviceFallb
|
|
|
45
45
|
let installed = false;
|
|
46
46
|
try {
|
|
47
47
|
fd = openSync(tmpPath, "w", normalized.mode);
|
|
48
|
+
if (normalized.mode !== undefined)
|
|
49
|
+
fchmodSync(fd, normalized.mode);
|
|
48
50
|
writeFileSync(fd, content, normalized.writeOptions);
|
|
49
51
|
fdatasyncSync(fd);
|
|
50
52
|
closeSync(fd);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface RemoveCodexProjectTrustOptions {
|
|
2
|
+
readonly configFilePath?: string;
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Remove the exact Codex project-trust table for a worktree that has just been
|
|
6
|
+
* removed. This deliberately does not touch nested hook state or other project
|
|
7
|
+
* entries, which may remain valid user-owned configuration.
|
|
8
|
+
*/
|
|
9
|
+
export declare function removeCodexProjectTrust(worktreePath: string, options?: RemoveCodexProjectTrustOptions): Promise<"removed" | "unchanged">;
|
|
10
|
+
/**
|
|
11
|
+
* Remove exact Codex project-trust tables in one locked rewrite. Prune can
|
|
12
|
+
* reconcile several externally deleted worktrees at once, so batching avoids
|
|
13
|
+
* taking the global config lock and rewriting the file for every entry.
|
|
14
|
+
*/
|
|
15
|
+
export declare function removeCodexProjectTrusts(worktreePaths: readonly string[], options?: RemoveCodexProjectTrustOptions): Promise<"removed" | "unchanged">;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import lockfile from "proper-lockfile";
|
|
3
|
+
import { defaultCodexConfigFilePath } from "#cli/commands/init/scaffolders/agent-hooks/codex-trust-sync.js";
|
|
4
|
+
import { writeFileAtomic } from "#shared-utils/write-json-file.js";
|
|
5
|
+
/**
|
|
6
|
+
* Remove the exact Codex project-trust table for a worktree that has just been
|
|
7
|
+
* removed. This deliberately does not touch nested hook state or other project
|
|
8
|
+
* entries, which may remain valid user-owned configuration.
|
|
9
|
+
*/
|
|
10
|
+
export function removeCodexProjectTrust(worktreePath, options = {}) {
|
|
11
|
+
return removeCodexProjectTrusts([worktreePath], options);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Remove exact Codex project-trust tables in one locked rewrite. Prune can
|
|
15
|
+
* reconcile several externally deleted worktrees at once, so batching avoids
|
|
16
|
+
* taking the global config lock and rewriting the file for every entry.
|
|
17
|
+
*/
|
|
18
|
+
export async function removeCodexProjectTrusts(worktreePaths, options = {}) {
|
|
19
|
+
if (worktreePaths.length === 0)
|
|
20
|
+
return "unchanged";
|
|
21
|
+
const configFilePath = options.configFilePath ?? defaultCodexConfigFilePath();
|
|
22
|
+
if (!existsSync(configFilePath))
|
|
23
|
+
return "unchanged";
|
|
24
|
+
const release = await lockfile.lock(configFilePath, {
|
|
25
|
+
realpath: false,
|
|
26
|
+
retries: { retries: 8, factor: 1.5, minTimeout: 25, maxTimeout: 250 },
|
|
27
|
+
});
|
|
28
|
+
try {
|
|
29
|
+
const existing = readFileSync(configFilePath, "utf8");
|
|
30
|
+
const next = removeProjectTrustTables(existing, worktreePaths);
|
|
31
|
+
if (next === existing)
|
|
32
|
+
return "unchanged";
|
|
33
|
+
writeFileAtomic(configFilePath, next, "utf8");
|
|
34
|
+
return "removed";
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
await release();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function removeProjectTrustTables(config, worktreePaths) {
|
|
41
|
+
const lines = config.split("\n");
|
|
42
|
+
const headers = new Set(worktreePaths.map((worktreePath) => `[projects.${JSON.stringify(worktreePath)}]`));
|
|
43
|
+
let removed = false;
|
|
44
|
+
for (let start = 0; start < lines.length;) {
|
|
45
|
+
if (!headers.has(lines[start]?.trim() ?? "")) {
|
|
46
|
+
start += 1;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
let end = start + 1;
|
|
50
|
+
while (end < lines.length && !/^\s*\[.+\]\s*$/u.test(lines[end] ?? ""))
|
|
51
|
+
end += 1;
|
|
52
|
+
lines.splice(start, end - start);
|
|
53
|
+
removed = true;
|
|
54
|
+
}
|
|
55
|
+
return removed ? lines.join("\n") : config;
|
|
56
|
+
}
|
|
@@ -50,6 +50,13 @@ export interface PruneStaleWorktreeRegistryOptions extends RegistryOptions {
|
|
|
50
50
|
readonly inventory: WorktreeInventory;
|
|
51
51
|
readonly scope: MembershipScope;
|
|
52
52
|
}
|
|
53
|
+
export interface StaleWorktreeRegistryPrunePlan {
|
|
54
|
+
readonly kept: ManagedWorktreeEntry[];
|
|
55
|
+
readonly removed: ManagedWorktreeEntry[];
|
|
56
|
+
readonly warnings: string[];
|
|
57
|
+
/** Persist the already-classified registry mutation after dependent cleanup succeeds. */
|
|
58
|
+
commit(): void;
|
|
59
|
+
}
|
|
53
60
|
/** Read one physical registry file at `root`. */
|
|
54
61
|
export declare function readPhysicalRegistry(root: string): WorktreeRegistry;
|
|
55
62
|
/** Write one physical registry file at `root`. */
|
|
@@ -100,6 +107,7 @@ export declare function removeWorktreeRegistryEntries(predicate: (entry: Managed
|
|
|
100
107
|
* when it is PROVEN-SAME-REPO and STALE against a COMPLETE inventory; unknown,
|
|
101
108
|
* other-repo, and present entries are RETAINED.
|
|
102
109
|
*/
|
|
110
|
+
export declare function planStaleWorktreeRegistryPrune(options: PruneStaleWorktreeRegistryOptions): StaleWorktreeRegistryPrunePlan;
|
|
103
111
|
export declare function pruneStaleWorktreeRegistryEntries(options: PruneStaleWorktreeRegistryOptions): {
|
|
104
112
|
kept: ManagedWorktreeEntry[];
|
|
105
113
|
removed: ManagedWorktreeEntry[];
|
|
@@ -193,7 +193,7 @@ export function removeWorktreeRegistryEntries(predicate, options = {}) {
|
|
|
193
193
|
* when it is PROVEN-SAME-REPO and STALE against a COMPLETE inventory; unknown,
|
|
194
194
|
* other-repo, and present entries are RETAINED.
|
|
195
195
|
*/
|
|
196
|
-
export function
|
|
196
|
+
export function planStaleWorktreeRegistryPrune(options) {
|
|
197
197
|
const resolveKey = options.scope.resolveMembershipRepoKey ?? ((dir) => resolveRepoIdentity(dir));
|
|
198
198
|
const shouldPrune = (entry) => {
|
|
199
199
|
const membership = classifyMembership(entry.repoRoot, options.scope.authoritativeRepoKey, resolveKey);
|
|
@@ -205,16 +205,31 @@ export function pruneStaleWorktreeRegistryEntries(options) {
|
|
|
205
205
|
};
|
|
206
206
|
const kept = [];
|
|
207
207
|
const removed = [];
|
|
208
|
+
const pendingWrites = [];
|
|
208
209
|
for (const root of physicalRoots(options)) {
|
|
209
210
|
const registry = readPhysicalRegistry(root);
|
|
210
211
|
const rootRemoved = registry.entries.filter(shouldPrune);
|
|
211
212
|
const rootKept = registry.entries.filter((entry) => !shouldPrune(entry));
|
|
212
213
|
if (rootRemoved.length > 0)
|
|
213
|
-
|
|
214
|
+
pendingWrites.push({ root, entries: rootKept });
|
|
214
215
|
kept.push(...rootKept);
|
|
215
216
|
removed.push(...rootRemoved);
|
|
216
217
|
}
|
|
217
|
-
return {
|
|
218
|
+
return {
|
|
219
|
+
kept,
|
|
220
|
+
removed,
|
|
221
|
+
warnings: [...options.inventory.warnings],
|
|
222
|
+
commit() {
|
|
223
|
+
for (const pendingWrite of pendingWrites) {
|
|
224
|
+
writePhysicalRegistry({ version: 1, entries: pendingWrite.entries }, pendingWrite.root);
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
export function pruneStaleWorktreeRegistryEntries(options) {
|
|
230
|
+
const plan = planStaleWorktreeRegistryPrune(options);
|
|
231
|
+
plan.commit();
|
|
232
|
+
return plan;
|
|
218
233
|
}
|
|
219
234
|
/**
|
|
220
235
|
* LISTING-ONLY logical lookup by id. Identity-sensitive owner resolution must
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpresso/agent-kit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "TypeScript-first agent harness for guarded develop/deploy workflows: wp CLI gates, MCP tools, hooks, memory, worktrees, secrets, audits, and evidence checks.",
|
|
6
6
|
"keywords": [
|
|
@@ -365,7 +365,7 @@
|
|
|
365
365
|
"version": "changeset version && vp run sync-marketplace-version && vp run generate-skills && ./bin/wp format",
|
|
366
366
|
"release:publish": "bun scripts/release-publish.ts",
|
|
367
367
|
"typecheck": "./bin/wp typecheck",
|
|
368
|
-
"test": "
|
|
368
|
+
"test": "bun scripts/run-vitest-projects.ts",
|
|
369
369
|
"test:mutation": "bun stryker run stryker.config.ts",
|
|
370
370
|
"eval": "bun src/runners/evals/index.ts",
|
|
371
371
|
"bench:dash": "bun scripts/bench/wp-dash-menu.tsx",
|
|
@@ -392,6 +392,9 @@
|
|
|
392
392
|
"audits:check": "./bin/wp audit guardrails && vp run workflow-actions:check && vp run hooks:doctor:ci && vp run check:blueprint-done-ledger",
|
|
393
393
|
"hooks:doctor": "./bin/wp hooks doctor",
|
|
394
394
|
"hooks:doctor:ci": "./bin/wp hooks doctor --skip-mcp && PATH=\"$PWD/bin:$PATH\" ./bin/wp hooks conformance --hosts codex,claude,opencode --lanes generated,repo,runtime,global,plugin --strict",
|
|
395
|
+
"proof:host-native": "bun scripts/host-native-proof.ts",
|
|
396
|
+
"proof:host-native:claude": "bun scripts/host-native-proof.ts --host claude",
|
|
397
|
+
"proof:host-native:grok": "bun scripts/host-native-proof.ts --host grok",
|
|
395
398
|
"qa": "vp run build && bun scripts/run-parallel-checks.ts",
|
|
396
399
|
"changeset": "changeset",
|
|
397
400
|
"changeset:status": "GIT_WORK_TREE=$PWD changeset status",
|
|
@@ -502,16 +505,16 @@
|
|
|
502
505
|
"setupWpActionRef": "c2c71a7a4be446fc6858e6b57bf55a11ccfa2d88"
|
|
503
506
|
},
|
|
504
507
|
"optionalDependencies": {
|
|
505
|
-
"@webpresso/agent-kit-runtime-darwin-arm64": "3.
|
|
506
|
-
"@webpresso/agent-kit-runtime-darwin-x64": "3.
|
|
507
|
-
"@webpresso/agent-kit-runtime-linux-x64": "3.
|
|
508
|
-
"@webpresso/agent-kit-runtime-linux-arm64": "3.
|
|
509
|
-
"@webpresso/agent-kit-runtime-windows-x64": "3.
|
|
510
|
-
"@webpresso/agent-kit-session-memory-darwin-x64": "3.
|
|
511
|
-
"@webpresso/agent-kit-session-memory-darwin-arm64": "3.
|
|
512
|
-
"@webpresso/agent-kit-session-memory-linux-x64": "3.
|
|
513
|
-
"@webpresso/agent-kit-session-memory-linux-arm64": "3.
|
|
514
|
-
"@webpresso/agent-kit-session-memory-win32-x64": "3.
|
|
515
|
-
"@webpresso/agent-kit-session-memory-win32-arm64": "3.
|
|
508
|
+
"@webpresso/agent-kit-runtime-darwin-arm64": "3.2.0",
|
|
509
|
+
"@webpresso/agent-kit-runtime-darwin-x64": "3.2.0",
|
|
510
|
+
"@webpresso/agent-kit-runtime-linux-x64": "3.2.0",
|
|
511
|
+
"@webpresso/agent-kit-runtime-linux-arm64": "3.2.0",
|
|
512
|
+
"@webpresso/agent-kit-runtime-windows-x64": "3.2.0",
|
|
513
|
+
"@webpresso/agent-kit-session-memory-darwin-x64": "3.2.0",
|
|
514
|
+
"@webpresso/agent-kit-session-memory-darwin-arm64": "3.2.0",
|
|
515
|
+
"@webpresso/agent-kit-session-memory-linux-x64": "3.2.0",
|
|
516
|
+
"@webpresso/agent-kit-session-memory-linux-arm64": "3.2.0",
|
|
517
|
+
"@webpresso/agent-kit-session-memory-win32-x64": "3.2.0",
|
|
518
|
+
"@webpresso/agent-kit-session-memory-win32-arm64": "3.2.0"
|
|
516
519
|
}
|
|
517
520
|
}
|