devcontour-harness 0.1.0-alpha.26 → 0.1.0-alpha.27
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 +9 -2
- package/docs/architecture.md +59 -0
- package/docs/compatibility.md +24 -12
- package/docs/connectors.md +5 -2
- package/docs/contracts.md +47 -25
- package/docs/release-notes/0.1.0-alpha.27.md +36 -0
- package/docs/review-protocol.md +10 -4
- package/docs/toolchains.md +83 -0
- package/docs/upgrade.md +10 -0
- package/lib/cli.js +13 -0
- package/lib/contracts/cli.d.ts +124 -0
- package/lib/contracts/cli.js +66 -0
- package/lib/contracts/policy.d.ts +30 -0
- package/lib/contracts/policy.js +23 -0
- package/lib/contracts/published.d.ts +8 -0
- package/lib/control/harness.d.ts +12 -0
- package/lib/control/harness.js +4 -0
- package/lib/control/review.js +6 -1
- package/lib/engine/joint-runner.js +34 -1
- package/lib/engine/runner.d.ts +29 -0
- package/lib/engine/runner.js +200 -2
- package/lib/engine/worktree-cleanup.d.ts +131 -0
- package/lib/engine/worktree-cleanup.js +520 -0
- package/lib/environment/isolation.d.ts +1 -0
- package/lib/environment/isolation.js +2 -1
- package/lib/environment/os-tools.d.ts +4 -2
- package/lib/environment/os-tools.js +4 -2
- package/lib/environment/process.d.ts +5 -0
- package/lib/environment/process.js +40 -17
- package/lib/environment/resources.d.ts +9 -0
- package/lib/environment/resources.js +24 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/integrations/connector/commands.d.ts +2 -1
- package/lib/integrations/connector/commands.js +10 -2
- package/lib/integrations/connector/store.d.ts +1 -1
- package/lib/integrations/connector/store.js +11 -6
- package/lib/profiles/resolve.d.ts +6 -0
- package/lib/toolchains/inspect.d.ts +1 -1
- package/lib/toolchains/inspect.js +29 -1
- package/lib/toolchains/probe.d.ts +16 -0
- package/lib/toolchains/probe.js +20 -0
- package/lib/verification/confirm.d.ts +3 -1
- package/lib/verification/confirm.js +16 -2
- package/lib/verification/dependencies.d.ts +3 -0
- package/lib/verification/dependencies.js +11 -0
- package/lib/verification/dependency-store.d.ts +117 -0
- package/lib/verification/dependency-store.js +811 -0
- package/lib/verification/gates-at.js +18 -0
- package/package.json +1 -1
- package/schemas/execution-policy.schema.json +34 -0
|
@@ -9,6 +9,7 @@ import { defaultResourceDatabase, withResources } from "../environment/resources
|
|
|
9
9
|
import { removeSnapshots, snapshotDependencies } from "./dependencies.js";
|
|
10
10
|
import { runGate } from "./gates.js";
|
|
11
11
|
import { checkoutPath, chooseCheckoutRoot } from "../environment/checkout-root.js";
|
|
12
|
+
import { dependencyStoreRoot, materializeStore } from "./dependency-store.js";
|
|
12
13
|
import { credentialPaths } from "../environment/isolation.js";
|
|
13
14
|
import { explicitPrerequisites, orderedScope, standaloneScope } from "./gate-scope.js";
|
|
14
15
|
/**
|
|
@@ -61,6 +62,21 @@ export async function runGatesAt(ctx, input) {
|
|
|
61
62
|
const failed = new Set();
|
|
62
63
|
let snapshots = [];
|
|
63
64
|
let added = false;
|
|
65
|
+
const boundaryOf = ctx.boundary();
|
|
66
|
+
const store = {
|
|
67
|
+
policy: ctx.policy,
|
|
68
|
+
root: (rid) => dependencyStoreRoot(placement, ctx.stateDir, rid),
|
|
69
|
+
repoPath: (r) => ctx.repoPath(r),
|
|
70
|
+
boundary: {
|
|
71
|
+
hidden: boundaryOf.hidden,
|
|
72
|
+
checkouts: [
|
|
73
|
+
...new Set([...(boundaryOf.checkouts ?? []), ...(placement.root ? [placement.root] : [])]),
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
resourceDatabase: ctx.resourceDatabase ?? defaultResourceDatabase(),
|
|
77
|
+
deadline: Date.now() + ctx.policy.runTimeoutMs,
|
|
78
|
+
phaseMs: ctx.policy.runTimeoutMs,
|
|
79
|
+
};
|
|
64
80
|
await mkdir(root, { recursive: true });
|
|
65
81
|
await mkdir(dirname(cwd), { recursive: true });
|
|
66
82
|
try {
|
|
@@ -88,6 +104,7 @@ export async function runGatesAt(ctx, input) {
|
|
|
88
104
|
policy: ctx.policy,
|
|
89
105
|
environment: source,
|
|
90
106
|
signal,
|
|
107
|
+
store,
|
|
91
108
|
});
|
|
92
109
|
await git(path, 'worktree', 'add', '--detach', cwd, input.sha);
|
|
93
110
|
added = true;
|
|
@@ -104,6 +121,7 @@ export async function runGatesAt(ctx, input) {
|
|
|
104
121
|
}, source);
|
|
105
122
|
const boundary = ctx.boundary();
|
|
106
123
|
await withEnvironment(repo.lifecycle ?? ctx.policy.lifecycle, cwd, join(artifacts, 'environment'), execution, signal, async () => {
|
|
124
|
+
await materializeStore(store, { repo, cwd, execution, signal, dir: artifacts });
|
|
107
125
|
await runSteps(repo.prepare, cwd, join(artifacts, 'prepare'), execution, signal);
|
|
108
126
|
for (const gate of gates) {
|
|
109
127
|
// Пропускается только gate, чья явная предпосылка (`dependsOn`) не
|
package/package.json
CHANGED
|
@@ -677,6 +677,40 @@
|
|
|
677
677
|
"additionalProperties": false
|
|
678
678
|
}
|
|
679
679
|
},
|
|
680
|
+
"dependencyStore": {
|
|
681
|
+
"type": "object",
|
|
682
|
+
"properties": {
|
|
683
|
+
"manager": {
|
|
684
|
+
"type": "string",
|
|
685
|
+
"enum": [
|
|
686
|
+
"pnpm"
|
|
687
|
+
]
|
|
688
|
+
},
|
|
689
|
+
"lockfile": {
|
|
690
|
+
"default": "pnpm-lock.yaml",
|
|
691
|
+
"type": "string",
|
|
692
|
+
"minLength": 1,
|
|
693
|
+
"maxLength": 500,
|
|
694
|
+
"pattern": "^(?!\\/)(?!.*[\\\\:*?\\[\\]\\x00])(?!(?:.*\\/)?\\.{1,2}(?:\\/|$))(?=.{1,500}$).+$"
|
|
695
|
+
},
|
|
696
|
+
"maxBytes": {
|
|
697
|
+
"default": 8589934592,
|
|
698
|
+
"type": "integer",
|
|
699
|
+
"minimum": 1048576,
|
|
700
|
+
"maximum": 9007199254740991
|
|
701
|
+
},
|
|
702
|
+
"timeoutMs": {
|
|
703
|
+
"default": 600000,
|
|
704
|
+
"type": "integer",
|
|
705
|
+
"exclusiveMinimum": 0,
|
|
706
|
+
"maximum": 3600000
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
"required": [
|
|
710
|
+
"manager"
|
|
711
|
+
],
|
|
712
|
+
"additionalProperties": false
|
|
713
|
+
},
|
|
680
714
|
"dependencyBuild": {
|
|
681
715
|
"default": [],
|
|
682
716
|
"type": "array",
|