@kungfu-tech/buildchain 3.0.9-alpha.12 → 3.0.9-alpha.13
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/dist/site/buildchain-contract.json +4 -4
- package/dist/site/buildchain-site.json +9 -9
- package/dist/site/kfd-claims.json +2 -2
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +1 -1
- package/dist/site/node-api-registry.json +156 -12
- package/dist/site/page-registry.json +4 -4
- package/dist/site/public-surface-audit.json +2 -2
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/site-manifest.json +5 -5
- package/dist/site/workflow-registry.json +4 -4
- package/docs/dev-delivery-warrant.md +26 -6
- package/docs/node-api-reference.md +14 -9
- package/package.json +1 -1
- package/packages/core/dev-delivery-native-proof.js +142 -5
- package/packages/core/dev-delivery-warrant.js +1 -1
- package/scripts/dev-delivery-native-run.mjs +33 -6
- package/scripts/dev-delivery-proof.mjs +3 -0
- package/scripts/dev-delivery-two-phase-resume.mjs +80 -1
- package/scripts/dev-delivery-two-phase.mjs +41 -72
- package/scripts/dev-delivery-warrant.mjs +3 -0
- package/templates/native-dev-delivery.yml +1 -1
|
@@ -8351,8 +8351,8 @@
|
|
|
8351
8351
|
"workflowRegistryPath": "dist/site/workflow-registry.json",
|
|
8352
8352
|
"pageRegistryPath": "dist/site/page-registry.json",
|
|
8353
8353
|
"cliRegistryDigest": "613ca42d3fe36e953603221d1cf16478ba84e6cf27dd6d11ddb2c1caea42ec3b",
|
|
8354
|
-
"workflowRegistryDigest": "
|
|
8355
|
-
"pageRegistryDigest": "
|
|
8354
|
+
"workflowRegistryDigest": "0f5c0541b3784df88d2908aa88623e5adb48891bc2f9e701eac62785cfd1f600",
|
|
8355
|
+
"pageRegistryDigest": "278318ddd3f832a3681ff805eff19f9a1e3d7da382c62db10a8be663cdc99139"
|
|
8356
8356
|
},
|
|
8357
8357
|
"comparison": {
|
|
8358
8358
|
"missingCliRegistry": [],
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"contract": "kungfu-buildchain-publication-release-registry",
|
|
4
|
-
"generatedAt": "2026-08-
|
|
5
|
-
"publishedAt": "2026-08-
|
|
4
|
+
"generatedAt": "2026-08-13T12:00:11.000Z",
|
|
5
|
+
"publishedAt": "2026-08-13T12:00:11.000Z",
|
|
6
6
|
"reproducible": true,
|
|
7
7
|
"timestampPolicy": "ci-injected",
|
|
8
8
|
"deterministicInputs": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"declared Buildchain surface manifest contract"
|
|
20
20
|
],
|
|
21
21
|
"sourceDateEpoch": "0",
|
|
22
|
-
"sourceRevision": "
|
|
22
|
+
"sourceRevision": "0052ce9b07f86ea3dd6eaf81e75ae1751ee79494",
|
|
23
23
|
"timestampPolicyDetails": {
|
|
24
24
|
"contract": "kungfu-buildchain-surface-timestamp-policy",
|
|
25
25
|
"timestampFields": [
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"package": {
|
|
34
34
|
"name": "@kungfu-tech/buildchain",
|
|
35
|
-
"version": "3.0.9-alpha.
|
|
35
|
+
"version": "3.0.9-alpha.13",
|
|
36
36
|
"versionSource": "package.json#version"
|
|
37
37
|
},
|
|
38
38
|
"sourceKind": "package-site-bundle",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"contract": "kungfu-buildchain-site-manifest",
|
|
4
|
-
"generatedAt": "2026-08-
|
|
5
|
-
"publishedAt": "2026-08-
|
|
4
|
+
"generatedAt": "2026-08-13T12:00:11.000Z",
|
|
5
|
+
"publishedAt": "2026-08-13T12:00:11.000Z",
|
|
6
6
|
"reproducible": true,
|
|
7
7
|
"timestampPolicy": "ci-injected",
|
|
8
8
|
"deterministicInputs": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"declared Buildchain surface manifest contract"
|
|
20
20
|
],
|
|
21
21
|
"sourceDateEpoch": "0",
|
|
22
|
-
"sourceRevision": "
|
|
22
|
+
"sourceRevision": "0052ce9b07f86ea3dd6eaf81e75ae1751ee79494",
|
|
23
23
|
"timestampPolicyDetails": {
|
|
24
24
|
"contract": "kungfu-buildchain-surface-timestamp-policy",
|
|
25
25
|
"timestampFields": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"package": {
|
|
39
39
|
"name": "@kungfu-tech/buildchain",
|
|
40
|
-
"version": "3.0.9-alpha.
|
|
40
|
+
"version": "3.0.9-alpha.13",
|
|
41
41
|
"versionSource": "package.json#version"
|
|
42
42
|
},
|
|
43
43
|
"entrypoint": "buildchain-site.json",
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
"path": "docs/node-api-reference.md",
|
|
254
254
|
"plane": "use",
|
|
255
255
|
"exists": true,
|
|
256
|
-
"digest": "sha256:
|
|
256
|
+
"digest": "sha256:354ccb4a6d2b9d2fbf979d4daace49576919299804129a1e8c9f2d12bf826c5e"
|
|
257
257
|
},
|
|
258
258
|
{
|
|
259
259
|
"id": "build-facts",
|
|
@@ -1970,7 +1970,7 @@
|
|
|
1970
1970
|
"status": "preview",
|
|
1971
1971
|
"owner": "buildchain-workflows",
|
|
1972
1972
|
"maturity": "preview",
|
|
1973
|
-
"introducedVersion": "3.0.9-alpha.
|
|
1973
|
+
"introducedVersion": "3.0.9-alpha.13",
|
|
1974
1974
|
"compatibilityPromise": "preserved-through-the-v3-major-line",
|
|
1975
1975
|
"deprecationReplacement": "",
|
|
1976
1976
|
"sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
|
|
@@ -1991,7 +1991,7 @@
|
|
|
1991
1991
|
"status": "preview",
|
|
1992
1992
|
"owner": "buildchain-workflows",
|
|
1993
1993
|
"maturity": "preview",
|
|
1994
|
-
"introducedVersion": "3.0.9-alpha.
|
|
1994
|
+
"introducedVersion": "3.0.9-alpha.13",
|
|
1995
1995
|
"compatibilityPromise": "preserved-through-the-v3-major-line",
|
|
1996
1996
|
"deprecationReplacement": "",
|
|
1997
1997
|
"sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
|
|
@@ -2012,7 +2012,7 @@
|
|
|
2012
2012
|
"status": "preview",
|
|
2013
2013
|
"owner": "buildchain-workflows",
|
|
2014
2014
|
"maturity": "preview",
|
|
2015
|
-
"introducedVersion": "3.0.9-alpha.
|
|
2015
|
+
"introducedVersion": "3.0.9-alpha.13",
|
|
2016
2016
|
"compatibilityPromise": "preserved-through-the-v3-major-line",
|
|
2017
2017
|
"deprecationReplacement": "",
|
|
2018
2018
|
"sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
|
|
@@ -2062,7 +2062,7 @@
|
|
|
2062
2062
|
"status": "preview",
|
|
2063
2063
|
"owner": "buildchain-workflows",
|
|
2064
2064
|
"maturity": "preview",
|
|
2065
|
-
"introducedVersion": "3.0.9-alpha.
|
|
2065
|
+
"introducedVersion": "3.0.9-alpha.13",
|
|
2066
2066
|
"compatibilityPromise": "preserved-through-the-v3-major-line",
|
|
2067
2067
|
"deprecationReplacement": "",
|
|
2068
2068
|
"sunsetCondition": "explicit-breaking-change-review-in-a-future-major-line",
|
|
@@ -8,7 +8,7 @@ confidence: high
|
|
|
8
8
|
sensitivity: public
|
|
9
9
|
evidence_grade: A
|
|
10
10
|
review_state: self-reviewed
|
|
11
|
-
last_reviewed: 2026-08-
|
|
11
|
+
last_reviewed: 2026-08-13
|
|
12
12
|
ai_provenance:
|
|
13
13
|
model_family: GPT-5
|
|
14
14
|
product: Codex
|
|
@@ -93,10 +93,14 @@ affected closure, dependencies, toolchain, covered paths, and exact acceptance
|
|
|
93
93
|
evidence. Ready state and approval are established before provisional
|
|
94
94
|
selection.
|
|
95
95
|
|
|
96
|
-
Native Qualification Proof is separate.
|
|
96
|
+
Native Qualification Proof is separate. Its v3 form binds semantic source and patch,
|
|
97
97
|
plan, affected closure, dependency graph, toolchain, the exact execution
|
|
98
|
-
environment contract, covered paths, native shard evidence,
|
|
99
|
-
base used by the native composition
|
|
98
|
+
environment contract, covered paths, native shard evidence, the exact dev
|
|
99
|
+
base used by the native composition, and the v2 native heartbeat-run receipt.
|
|
100
|
+
That receipt exposes and roots the exact repository, protected base, source
|
|
101
|
+
head, qualified base, toolchain, and environment binding established before
|
|
102
|
+
process spawn. The proof repeats the binding root and includes the receipt root
|
|
103
|
+
in its shard evidence. Before reuse, the consumer roots the
|
|
100
104
|
complete attributed Dev delta, including both sides of every rename, then
|
|
101
105
|
classifies it:
|
|
102
106
|
|
|
@@ -111,6 +115,11 @@ classifies it:
|
|
|
111
115
|
changed source, plan, closure, dependency, toolchain, or environment root
|
|
112
116
|
fails closed to full native qualification.
|
|
113
117
|
|
|
118
|
+
Historical Native Qualification Proof v1 and v2 values remain readable, but
|
|
119
|
+
they cannot be reused because their execution receipt did not bind the
|
|
120
|
+
environment root. They fail closed to explicit native revalidation and produce
|
|
121
|
+
a v3 proof.
|
|
122
|
+
|
|
114
123
|
The reuse decision binds the exact old and current Dev heads, normalized changed
|
|
115
124
|
paths and rename pairs in `baseDeltaRoot`. This makes local and hosted replay of
|
|
116
125
|
the same inputs byte-deterministic. Generated outputs that participate in the
|
|
@@ -134,13 +143,16 @@ buildchain dev warrant submit --repository owner/repository \
|
|
|
134
143
|
--source-identity-root <root> --source-patch-root <root> \
|
|
135
144
|
--source-proof-root <root> --plan-root <root> --closure-root <root> \
|
|
136
145
|
--dependency-root <root> --toolchain-root <root> \
|
|
146
|
+
--environment-root <root> \
|
|
137
147
|
--delivery-class native-proof-required
|
|
138
148
|
|
|
139
149
|
buildchain dev warrant select --repository owner/repository \
|
|
140
150
|
--branch dev/v4/v4.0 --execute
|
|
141
151
|
|
|
142
152
|
buildchain dev proof native --branch dev/v4/v4.0 \
|
|
143
|
-
--
|
|
153
|
+
--source-head <sha> --qualified-base <sha> \
|
|
154
|
+
--environment-root <root> \
|
|
155
|
+
--native-execution-receipt native-heartbeat-run.json \
|
|
144
156
|
--affected-paths-json '["packages/native"]' ...
|
|
145
157
|
|
|
146
158
|
buildchain dev proof classify-native --source-proof native-proof.json \
|
|
@@ -168,7 +180,9 @@ equivalent exact consumer). It performs an exact fenced heartbeat before spawn,
|
|
|
168
180
|
renews throughout the complete child lifetime, performs a final renewal before
|
|
169
181
|
accepting success, and terminates the process group on heartbeat or fencing
|
|
170
182
|
failure. Missing, stale, expired, or mismatched Warrant state therefore blocks
|
|
171
|
-
native spawn instead of becoming qualification evidence.
|
|
183
|
+
native spawn instead of becoming qualification evidence. The environment root
|
|
184
|
+
is validated and included in the execution binding before the first heartbeat
|
|
185
|
+
or process spawn; it cannot be attached only after a successful run.
|
|
172
186
|
|
|
173
187
|
Proof commands create, verify, classify, and compose the two proof layers:
|
|
174
188
|
|
|
@@ -291,6 +305,12 @@ The reusable `dev-pr-auto-merge.yml` supports three explicit rollout modes:
|
|
|
291
305
|
configured consumer workflow is dispatched immediately for that exact PR,
|
|
292
306
|
head, and source run; the candidate is not left waiting for a patrol cron.
|
|
293
307
|
|
|
308
|
+
For a required native delivery class, the reusable controller rejects a
|
|
309
|
+
missing or malformed environment root before runtime checkout, candidate
|
|
310
|
+
submission, Warrant selection, or native execution. The input remains
|
|
311
|
+
conditionally optional so `off`, `shadow`, and `non-native-fast` callers keep
|
|
312
|
+
their documented behavior.
|
|
313
|
+
|
|
294
314
|
The controller persists a completed native proof before its final base
|
|
295
315
|
reclassification. A later exact retry can supply that proof and avoid the
|
|
296
316
|
expensive native command when the rooted delta still proves reuse safe. A
|
|
@@ -1564,7 +1564,7 @@ Target: `./packages/core/dev-delivery-authority.js`. Public symbols: 22.
|
|
|
1564
1564
|
|
|
1565
1565
|
## `@kungfu-tech/buildchain/dev-delivery-warrant`
|
|
1566
1566
|
|
|
1567
|
-
Target: `./packages/core/dev-delivery-warrant.js`. Public symbols:
|
|
1567
|
+
Target: `./packages/core/dev-delivery-warrant.js`. Public symbols: 49.
|
|
1568
1568
|
|
|
1569
1569
|
| Symbol | Kind and signature | Parameters | Return | Errors | Side effects | Example | Source |
|
|
1570
1570
|
| --- | --- | --- | --- | --- | --- | --- | --- |
|
|
@@ -1573,9 +1573,11 @@ Target: `./packages/core/dev-delivery-warrant.js`. Public symbols: 44.
|
|
|
1573
1573
|
| `closeDevDeliveryWarrant` | function: function closeDevDeliveryWarrant(queueInput, warrant, { outcome, evidenceRoot, reason = "", now = new Date().toISOString() } = {}) | queueInput, warrant, { outcome, evidenceRoot, reason = "", now = new Date().toISOString() } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { closeDevDeliveryWarrant } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:586` |
|
|
1574
1574
|
| `createDevDeliveryQueue` | function: function createDevDeliveryQueue({ repository: repositoryInput, protectedBase: protectedBaseInput, policy = {}, now = new Date().toISOString() } = {}) | { repository: repositoryInput, protectedBase: protectedBaseInput, policy = {}, now = new Date().toISOString() } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createDevDeliveryQueue } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:120` |
|
|
1575
1575
|
| `createIntegrationDeliveryProof` | function: function createIntegrationDeliveryProof(input = {}) | input = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { createIntegrationDeliveryProof } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-proof.js:207` |
|
|
1576
|
-
| `
|
|
1577
|
-
| `
|
|
1578
|
-
| `
|
|
1576
|
+
| `createNativeExecutionBinding` | function: function createNativeExecutionBinding(input = {}) | input = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createNativeExecutionBinding } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:94` |
|
|
1577
|
+
| `createNativeExecutionReceipt` | function: function createNativeExecutionReceipt(input = {}) | input = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { createNativeExecutionReceipt } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:106` |
|
|
1578
|
+
| `createNativeProofBaseDelta` | function: function createNativeProofBaseDelta(input = {}) | input = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createNativeProofBaseDelta } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:64` |
|
|
1579
|
+
| `createNativeProofReuseDecision` | function: function createNativeProofReuseDecision({ proof, current = {} } = {}) | { proof, current = {} } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createNativeProofReuseDecision } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:423` |
|
|
1580
|
+
| `createNativeQualificationProof` | function: function createNativeQualificationProof(input = {}) | input = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { createNativeQualificationProof } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:161` |
|
|
1579
1581
|
| `createProjectCutReplayPlan` | function: function createProjectCutReplayPlan(input = {}) | input = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { createProjectCutReplayPlan } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-proof.js:121` |
|
|
1580
1582
|
| `createProjectCutReplayProof` | function: function createProjectCutReplayProof(input = {}) | input = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { createProjectCutReplayProof } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-proof.js:141` |
|
|
1581
1583
|
| `createReleaseBlockerPriorityClaim` | function: function createReleaseBlockerPriorityClaim(repairInput, input = {}) | repairInput, input = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { createReleaseBlockerPriorityClaim } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/release-blocker-priority.js:32` |
|
|
@@ -1584,7 +1586,7 @@ Target: `./packages/core/dev-delivery-warrant.js`. Public symbols: 44.
|
|
|
1584
1586
|
| `DEV_DELIVERY_CLASSES` | constant: const DEV_DELIVERY_CLASSES | none | value | Import does not declare a throw contract. | none-on-import | `import { DEV_DELIVERY_CLASSES } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:24` |
|
|
1585
1587
|
| `DEV_DELIVERY_LEASE_RECEIPT_SCHEMA` | constant: const DEV_DELIVERY_LEASE_RECEIPT_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { DEV_DELIVERY_LEASE_RECEIPT_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:16` |
|
|
1586
1588
|
| `DEV_DELIVERY_PRIORITIES` | constant: const DEV_DELIVERY_PRIORITIES | none | value | Import does not declare a throw contract. | none-on-import | `import { DEV_DELIVERY_PRIORITIES } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:18` |
|
|
1587
|
-
| `DEV_DELIVERY_QUALIFICATION_RECEIPT_SCHEMA` | constant: const DEV_DELIVERY_QUALIFICATION_RECEIPT_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { DEV_DELIVERY_QUALIFICATION_RECEIPT_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:
|
|
1589
|
+
| `DEV_DELIVERY_QUALIFICATION_RECEIPT_SCHEMA` | constant: const DEV_DELIVERY_QUALIFICATION_RECEIPT_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { DEV_DELIVERY_QUALIFICATION_RECEIPT_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:24` |
|
|
1588
1590
|
| `DEV_DELIVERY_QUEUE_CONTRACT` | constant: const DEV_DELIVERY_QUEUE_CONTRACT | none | value | Import does not declare a throw contract. | none-on-import | `import { DEV_DELIVERY_QUEUE_CONTRACT } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:12` |
|
|
1589
1591
|
| `DEV_DELIVERY_SELECTION_RECEIPT_SCHEMA` | constant: const DEV_DELIVERY_SELECTION_RECEIPT_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { DEV_DELIVERY_SELECTION_RECEIPT_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:15` |
|
|
1590
1592
|
| `DEV_DELIVERY_SETTLEMENT_RECEIPT_SCHEMA` | value: DEV_DELIVERY_SETTLEMENT_RECEIPT_SCHEMA | none | unknown | No narrower error contract was mechanically discoverable. | unknown | `import { DEV_DELIVERY_SETTLEMENT_RECEIPT_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:1` |
|
|
@@ -1593,8 +1595,10 @@ Target: `./packages/core/dev-delivery-warrant.js`. Public symbols: 44.
|
|
|
1593
1595
|
| `devDeliveryContentRoot` | function: function devDeliveryContentRoot(value) | value | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { devDeliveryContentRoot } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-common.js:27` |
|
|
1594
1596
|
| `heartbeatDevDeliveryWarrant` | function: function heartbeatDevDeliveryWarrant(queueInput, warrant, { now = new Date().toISOString(), leaseSeconds } = {}) | queueInput, warrant, { now = new Date().toISOString(), leaseSeconds } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { heartbeatDevDeliveryWarrant } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:508` |
|
|
1595
1597
|
| `INTEGRATION_DELIVERY_PROOF_SCHEMA` | constant: const INTEGRATION_DELIVERY_PROOF_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { INTEGRATION_DELIVERY_PROOF_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-proof.js:5` |
|
|
1596
|
-
| `
|
|
1597
|
-
| `
|
|
1598
|
+
| `NATIVE_EXECUTION_BINDING_SCHEMA` | constant: const NATIVE_EXECUTION_BINDING_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { NATIVE_EXECUTION_BINDING_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:18` |
|
|
1599
|
+
| `NATIVE_EXECUTION_RECEIPT_SCHEMA` | constant: const NATIVE_EXECUTION_RECEIPT_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { NATIVE_EXECUTION_RECEIPT_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:20` |
|
|
1600
|
+
| `NATIVE_PROOF_BASE_DELTA_SCHEMA` | constant: const NATIVE_PROOF_BASE_DELTA_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { NATIVE_PROOF_BASE_DELTA_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:26` |
|
|
1601
|
+
| `NATIVE_PROOF_REUSE_DECISION_SCHEMA` | constant: const NATIVE_PROOF_REUSE_DECISION_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { NATIVE_PROOF_REUSE_DECISION_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:22` |
|
|
1598
1602
|
| `NATIVE_QUALIFICATION_PROOF_SCHEMA` | constant: const NATIVE_QUALIFICATION_PROOF_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { NATIVE_QUALIFICATION_PROOF_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:12` |
|
|
1599
1603
|
| `normalizeDevDeliveryQueue` | function: function normalizeDevDeliveryQueue(input, expected = {}) | input, expected = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { normalizeDevDeliveryQueue } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:135` |
|
|
1600
1604
|
| `observeDevDeliveryQueue` | function: function observeDevDeliveryQueue(queueInput, { now = new Date().toISOString() } = {}) | queueInput, { now = new Date().toISOString() } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { observeDevDeliveryQueue } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:652` |
|
|
@@ -1608,8 +1612,9 @@ Target: `./packages/core/dev-delivery-warrant.js`. Public symbols: 44.
|
|
|
1608
1612
|
| `SOURCE_QUALIFICATION_PROOF_SCHEMA` | constant: const SOURCE_QUALIFICATION_PROOF_SCHEMA | none | value | Import does not declare a throw contract. | none-on-import | `import { SOURCE_QUALIFICATION_PROOF_SCHEMA } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-proof.js:3` |
|
|
1609
1613
|
| `submitDevDeliveryCandidate` | function: function submitDevDeliveryCandidate(queueInput, input, { now = new Date().toISOString() } = {}) | queueInput, input, { now = new Date().toISOString() } = {} | unknown | May throw an Error on rejected input or failed operations; follow the linked source contract. | none-detected-by-static-source-scan | `import { submitDevDeliveryCandidate } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-warrant.js:245` |
|
|
1610
1614
|
| `verifyIntegrationDeliveryProof` | function: function verifyIntegrationDeliveryProof(proofInput, expected = {}) | proofInput, expected = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { verifyIntegrationDeliveryProof } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-proof.js:228` |
|
|
1611
|
-
| `
|
|
1612
|
-
| `
|
|
1615
|
+
| `verifyNativeExecutionReceipt` | function: function verifyNativeExecutionReceipt(receiptInput, expected = {}) | receiptInput, expected = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { verifyNativeExecutionReceipt } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:127` |
|
|
1616
|
+
| `verifyNativeProofReuseDecision` | function: function verifyNativeProofReuseDecision(decisionInput, { proof, current = {} } = {}) | decisionInput, { proof, current = {} } = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { verifyNativeProofReuseDecision } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:427` |
|
|
1617
|
+
| `verifyNativeQualificationProof` | function: function verifyNativeQualificationProof(proofInput, expected = {}) | proofInput, expected = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { verifyNativeQualificationProof } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-native-proof.js:215` |
|
|
1613
1618
|
| `verifyProjectCutReplayProof` | function: function verifyProjectCutReplayProof(proofInput, expected = {}) | proofInput, expected = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { verifyProjectCutReplayProof } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-proof.js:187` |
|
|
1614
1619
|
| `verifySourceQualificationProof` | function: function verifySourceQualificationProof(proofInput, expected = {}) | proofInput, expected = {} | unknown | Errors from called operations may propagate; no narrower throw contract is declared in source. | none-detected-by-static-source-scan | `import { verifySourceQualificationProof } from "@kungfu-tech/buildchain/dev-delivery-warrant";` | `packages/core/dev-delivery-proof.js:52` |
|
|
1615
1620
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kungfu-tech/buildchain",
|
|
3
|
-
"version": "3.0.9-alpha.
|
|
3
|
+
"version": "3.0.9-alpha.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Buildchain Release Passport, release governance, CLI toolkit, and site facts.",
|
|
6
6
|
"repository": "https://github.com/kungfu-systems/buildchain",
|
|
@@ -10,9 +10,15 @@ import {
|
|
|
10
10
|
} from "./dev-delivery-common.js";
|
|
11
11
|
|
|
12
12
|
export const NATIVE_QUALIFICATION_PROOF_SCHEMA =
|
|
13
|
+
"kungfu.buildchain.native-qualification-proof/v3";
|
|
14
|
+
const LEGACY_NATIVE_QUALIFICATION_PROOF_V2_SCHEMA =
|
|
13
15
|
"kungfu.buildchain.native-qualification-proof/v2";
|
|
14
16
|
const LEGACY_NATIVE_QUALIFICATION_PROOF_SCHEMA =
|
|
15
17
|
"kungfu.buildchain.native-qualification-proof/v1";
|
|
18
|
+
export const NATIVE_EXECUTION_BINDING_SCHEMA =
|
|
19
|
+
"kungfu.buildchain.native-execution-binding/v1";
|
|
20
|
+
export const NATIVE_EXECUTION_RECEIPT_SCHEMA =
|
|
21
|
+
"kungfu.buildchain.native-heartbeat-run-receipt/v2";
|
|
16
22
|
export const NATIVE_PROOF_REUSE_DECISION_SCHEMA =
|
|
17
23
|
"kungfu.buildchain.native-proof-reuse-decision/v1";
|
|
18
24
|
export const DEV_DELIVERY_QUALIFICATION_RECEIPT_SCHEMA =
|
|
@@ -85,7 +91,94 @@ function rooted(body) {
|
|
|
85
91
|
return { ...body, decisionRoot: devDeliveryContentRoot(body) };
|
|
86
92
|
}
|
|
87
93
|
|
|
94
|
+
export function createNativeExecutionBinding(input = {}) {
|
|
95
|
+
return {
|
|
96
|
+
schema: NATIVE_EXECUTION_BINDING_SCHEMA,
|
|
97
|
+
repository: repository(input.repository),
|
|
98
|
+
protectedBase: protectedBase(input.protectedBase),
|
|
99
|
+
sourceHead: exactSha(input.sourceHead, "sourceHead"),
|
|
100
|
+
qualifiedBase: exactSha(input.qualifiedBase, "qualifiedBase"),
|
|
101
|
+
toolchainRoot: exactRoot(input.toolchainRoot, "toolchainRoot"),
|
|
102
|
+
environmentRoot: exactRoot(input.environmentRoot, "environmentRoot"),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function createNativeExecutionReceipt(input = {}) {
|
|
107
|
+
const executionBinding = createNativeExecutionBinding(input.executionBinding);
|
|
108
|
+
const receipt = {
|
|
109
|
+
schema: NATIVE_EXECUTION_RECEIPT_SCHEMA,
|
|
110
|
+
outcome: input.outcome === "succeeded" ? "succeeded" : text(input.outcome),
|
|
111
|
+
commandRoot: exactRoot(input.commandRoot, "commandRoot"),
|
|
112
|
+
executionBinding,
|
|
113
|
+
executionBindingRoot: devDeliveryContentRoot(executionBinding),
|
|
114
|
+
startedAt: timestamp(input.startedAt, "startedAt"),
|
|
115
|
+
completedAt: timestamp(input.completedAt, "completedAt"),
|
|
116
|
+
heartbeatCount: Number(input.heartbeatCount),
|
|
117
|
+
};
|
|
118
|
+
if (receipt.outcome !== "succeeded") {
|
|
119
|
+
throw new Error("native execution receipt must record succeeded outcome");
|
|
120
|
+
}
|
|
121
|
+
if (!Number.isInteger(receipt.heartbeatCount) || receipt.heartbeatCount < 1) {
|
|
122
|
+
throw new Error("heartbeatCount must be a positive integer");
|
|
123
|
+
}
|
|
124
|
+
return { ...receipt, receiptRoot: devDeliveryContentRoot(receipt) };
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function verifyNativeExecutionReceipt(receiptInput, expected = {}) {
|
|
128
|
+
try {
|
|
129
|
+
const receipt = clone(receiptInput || {});
|
|
130
|
+
if (receipt.schema !== NATIVE_EXECUTION_RECEIPT_SCHEMA) {
|
|
131
|
+
return { ok: false, reason: "unsupported-schema" };
|
|
132
|
+
}
|
|
133
|
+
const receiptRoot = receipt.receiptRoot;
|
|
134
|
+
delete receipt.receiptRoot;
|
|
135
|
+
if (devDeliveryContentRoot(receipt) !== receiptRoot) {
|
|
136
|
+
return { ok: false, reason: "receipt-root-drift" };
|
|
137
|
+
}
|
|
138
|
+
const normalized = createNativeExecutionReceipt({
|
|
139
|
+
...receipt,
|
|
140
|
+
executionBinding: receipt.executionBinding,
|
|
141
|
+
});
|
|
142
|
+
if (normalized.receiptRoot !== receiptRoot) {
|
|
143
|
+
return { ok: false, reason: "receipt-input-drift" };
|
|
144
|
+
}
|
|
145
|
+
for (const [field, value] of Object.entries(expected)) {
|
|
146
|
+
if (value !== undefined && receipt.executionBinding?.[field] !== value) {
|
|
147
|
+
return { ok: false, reason: `${field}-mismatch` };
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
ok: true,
|
|
152
|
+
reason: "exact-native-execution-receipt",
|
|
153
|
+
receiptRoot,
|
|
154
|
+
executionBindingRoot: receipt.executionBindingRoot,
|
|
155
|
+
};
|
|
156
|
+
} catch (error) {
|
|
157
|
+
return { ok: false, reason: "invalid-receipt", error: error.message };
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
88
161
|
export function createNativeQualificationProof(input = {}) {
|
|
162
|
+
const sourceHead = exactSha(input.sourceHead, "sourceHead");
|
|
163
|
+
const qualifiedBase = exactSha(input.qualifiedBase, "qualifiedBase");
|
|
164
|
+
const toolchainRoot = exactRoot(input.toolchainRoot, "toolchainRoot");
|
|
165
|
+
const environmentRoot = exactRoot(input.environmentRoot, "environmentRoot");
|
|
166
|
+
const executionReceipt = verifyNativeExecutionReceipt(
|
|
167
|
+
input.nativeExecutionReceipt,
|
|
168
|
+
{
|
|
169
|
+
repository: repository(input.repository),
|
|
170
|
+
protectedBase: protectedBase(input.protectedBase),
|
|
171
|
+
sourceHead,
|
|
172
|
+
qualifiedBase,
|
|
173
|
+
toolchainRoot,
|
|
174
|
+
environmentRoot,
|
|
175
|
+
},
|
|
176
|
+
);
|
|
177
|
+
if (!executionReceipt.ok) {
|
|
178
|
+
throw new Error(
|
|
179
|
+
`native execution receipt rejected: ${executionReceipt.reason}`,
|
|
180
|
+
);
|
|
181
|
+
}
|
|
89
182
|
const body = {
|
|
90
183
|
schema: NATIVE_QUALIFICATION_PROOF_SCHEMA,
|
|
91
184
|
rootSemantics: NATIVE_QUALIFICATION_ROOT_SEMANTICS,
|
|
@@ -99,12 +192,15 @@ export function createNativeQualificationProof(input = {}) {
|
|
|
99
192
|
planRoot: exactRoot(input.planRoot, "planRoot"),
|
|
100
193
|
closureRoot: exactRoot(input.closureRoot, "closureRoot"),
|
|
101
194
|
dependencyRoot: exactRoot(input.dependencyRoot, "dependencyRoot"),
|
|
102
|
-
toolchainRoot
|
|
103
|
-
environmentRoot
|
|
104
|
-
|
|
195
|
+
toolchainRoot,
|
|
196
|
+
environmentRoot,
|
|
197
|
+
sourceHead,
|
|
198
|
+
qualifiedBase,
|
|
199
|
+
nativeExecutionBindingRoot: executionReceipt.executionBindingRoot,
|
|
200
|
+
nativeExecutionReceiptRoot: executionReceipt.receiptRoot,
|
|
105
201
|
affectedPaths: normalizedPaths(input.affectedPaths || []),
|
|
106
202
|
shardEvidenceRoots: exactRoots(
|
|
107
|
-
input.shardEvidenceRoots,
|
|
203
|
+
[...(input.shardEvidenceRoots || []), executionReceipt.receiptRoot],
|
|
108
204
|
"shardEvidenceRoots",
|
|
109
205
|
),
|
|
110
206
|
qualifiedAt: timestamp(input.qualifiedAt, "qualifiedAt"),
|
|
@@ -122,6 +218,7 @@ export function verifyNativeQualificationProof(proofInput, expected = {}) {
|
|
|
122
218
|
if (
|
|
123
219
|
![
|
|
124
220
|
NATIVE_QUALIFICATION_PROOF_SCHEMA,
|
|
221
|
+
LEGACY_NATIVE_QUALIFICATION_PROOF_V2_SCHEMA,
|
|
125
222
|
LEGACY_NATIVE_QUALIFICATION_PROOF_SCHEMA,
|
|
126
223
|
].includes(proof.schema)
|
|
127
224
|
) {
|
|
@@ -146,7 +243,38 @@ export function verifyNativeQualificationProof(proofInput, expected = {}) {
|
|
|
146
243
|
}
|
|
147
244
|
}
|
|
148
245
|
if (proof.schema === NATIVE_QUALIFICATION_PROOF_SCHEMA) {
|
|
149
|
-
|
|
246
|
+
repository(proof.repository);
|
|
247
|
+
protectedBase(proof.protectedBase);
|
|
248
|
+
exactSha(proof.sourceHead, "sourceHead");
|
|
249
|
+
exactSha(proof.qualifiedBase, "qualifiedBase");
|
|
250
|
+
for (const field of [
|
|
251
|
+
"sourceIdentityRoot",
|
|
252
|
+
"sourcePatchRoot",
|
|
253
|
+
"planRoot",
|
|
254
|
+
"closureRoot",
|
|
255
|
+
"dependencyRoot",
|
|
256
|
+
"toolchainRoot",
|
|
257
|
+
"environmentRoot",
|
|
258
|
+
"nativeExecutionBindingRoot",
|
|
259
|
+
"nativeExecutionReceiptRoot",
|
|
260
|
+
]) {
|
|
261
|
+
exactRoot(proof[field], field);
|
|
262
|
+
}
|
|
263
|
+
const expectedBindingRoot = devDeliveryContentRoot(
|
|
264
|
+
createNativeExecutionBinding(proof),
|
|
265
|
+
);
|
|
266
|
+
if (proof.nativeExecutionBindingRoot !== expectedBindingRoot) {
|
|
267
|
+
return { ok: false, reason: "native-execution-binding-root-drift" };
|
|
268
|
+
}
|
|
269
|
+
const shardEvidenceRoots = exactRoots(
|
|
270
|
+
proof.shardEvidenceRoots,
|
|
271
|
+
"shardEvidenceRoots",
|
|
272
|
+
);
|
|
273
|
+
if (!shardEvidenceRoots.includes(proof.nativeExecutionReceiptRoot)) {
|
|
274
|
+
return { ok: false, reason: "native-execution-receipt-unbound" };
|
|
275
|
+
}
|
|
276
|
+
normalizedPaths(proof.affectedPaths || []);
|
|
277
|
+
timestamp(proof.qualifiedAt, "qualifiedAt");
|
|
150
278
|
} else {
|
|
151
279
|
repository(proof.repository);
|
|
152
280
|
protectedBase(proof.protectedBase);
|
|
@@ -205,8 +333,15 @@ function nativeReuseBody(proof, current) {
|
|
|
205
333
|
requiredValidation: "full-native",
|
|
206
334
|
};
|
|
207
335
|
if (!verification.ok) return base;
|
|
336
|
+
if (proof.schema !== NATIVE_QUALIFICATION_PROOF_SCHEMA) {
|
|
337
|
+
return {
|
|
338
|
+
...base,
|
|
339
|
+
reason: "native-execution-evidence-unbound",
|
|
340
|
+
};
|
|
341
|
+
}
|
|
208
342
|
|
|
209
343
|
const semanticFields = [
|
|
344
|
+
"sourceHead",
|
|
210
345
|
"sourceIdentityRoot",
|
|
211
346
|
"sourcePatchRoot",
|
|
212
347
|
"planRoot",
|
|
@@ -346,6 +481,7 @@ export function createDevDeliveryWarrantQualifier({
|
|
|
346
481
|
const proofVerification = verifyNativeQualificationProof(nativeProof, {
|
|
347
482
|
repository: before.repository,
|
|
348
483
|
protectedBase: before.protectedBase,
|
|
484
|
+
sourceHead: active.sourceHead,
|
|
349
485
|
sourceIdentityRoot: active.sourceIdentityRoot,
|
|
350
486
|
sourcePatchRoot: active.sourcePatchRoot,
|
|
351
487
|
planRoot: active.planRoot,
|
|
@@ -363,6 +499,7 @@ export function createDevDeliveryWarrantQualifier({
|
|
|
363
499
|
proof: nativeProof,
|
|
364
500
|
current: {
|
|
365
501
|
...current,
|
|
502
|
+
sourceHead: active.sourceHead,
|
|
366
503
|
sourceIdentityRoot: active.sourceIdentityRoot,
|
|
367
504
|
sourcePatchRoot: active.sourcePatchRoot,
|
|
368
505
|
planRoot: active.planRoot,
|
|
@@ -7,7 +7,7 @@ import { compareReleaseBlockerPriority, normalizeReleaseBlockerPriorityClaim } f
|
|
|
7
7
|
export { devDeliveryContentRoot } from "./dev-delivery-common.js";
|
|
8
8
|
export { RELEASE_BLOCKER_PRIORITY_CLAIM_SCHEMA, createReleaseBlockerPriorityClaim } from "./release-blocker-priority.js";
|
|
9
9
|
export { SOURCE_QUALIFICATION_PROOF_SCHEMA, PROJECT_CUT_REPLAY_PROOF_SCHEMA, INTEGRATION_DELIVERY_PROOF_SCHEMA, classifyDevDeliveryDelta, createIntegrationDeliveryProof, createProjectCutReplayPlan, createProjectCutReplayProof, createSourceQualificationProof, verifyIntegrationDeliveryProof, verifyProjectCutReplayProof, verifySourceQualificationProof } from "./dev-delivery-proof.js";
|
|
10
|
-
export { DEV_DELIVERY_QUALIFICATION_RECEIPT_SCHEMA, NATIVE_QUALIFICATION_PROOF_SCHEMA, NATIVE_PROOF_REUSE_DECISION_SCHEMA, NATIVE_PROOF_BASE_DELTA_SCHEMA, createNativeProofBaseDelta, createNativeProofReuseDecision, createNativeQualificationProof, verifyNativeProofReuseDecision, verifyNativeQualificationProof } from "./dev-delivery-native-proof.js";
|
|
10
|
+
export { DEV_DELIVERY_QUALIFICATION_RECEIPT_SCHEMA, NATIVE_EXECUTION_BINDING_SCHEMA, NATIVE_EXECUTION_RECEIPT_SCHEMA, NATIVE_QUALIFICATION_PROOF_SCHEMA, NATIVE_PROOF_REUSE_DECISION_SCHEMA, NATIVE_PROOF_BASE_DELTA_SCHEMA, createNativeExecutionBinding, createNativeExecutionReceipt, createNativeProofBaseDelta, createNativeProofReuseDecision, createNativeQualificationProof, verifyNativeExecutionReceipt, verifyNativeProofReuseDecision, verifyNativeQualificationProof } from "./dev-delivery-native-proof.js";
|
|
11
11
|
export { DEV_DELIVERY_CANCELLATION_RECEIPT_SCHEMA };
|
|
12
12
|
export const DEV_DELIVERY_QUEUE_CONTRACT = "kungfu-buildchain-dev-delivery-warrant-queue";
|
|
13
13
|
export const DEV_DELIVERY_WARRANT_SCHEMA = "kungfu.buildchain.dev-delivery-warrant/v1";
|
|
@@ -3,7 +3,7 @@ import { spawn } from "node:child_process";
|
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
|
|
6
|
-
import { devDeliveryContentRoot } from "../packages/core/dev-delivery-warrant.js";
|
|
6
|
+
import { createNativeExecutionBinding, createNativeExecutionReceipt, devDeliveryContentRoot } from "../packages/core/dev-delivery-warrant.js";
|
|
7
7
|
import { runDevDeliveryCommand } from "./dev-delivery-warrant.mjs";
|
|
8
8
|
|
|
9
9
|
function flag(args, name, fallback = "") {
|
|
@@ -46,6 +46,7 @@ export async function runNativeWithHeartbeat({
|
|
|
46
46
|
if (typeof heartbeat !== "function") {
|
|
47
47
|
throw new Error("heartbeat callback is required");
|
|
48
48
|
}
|
|
49
|
+
const boundExecution = createNativeExecutionBinding(executionBinding);
|
|
49
50
|
const startedAt = now();
|
|
50
51
|
try {
|
|
51
52
|
await heartbeat();
|
|
@@ -138,16 +139,14 @@ export async function runNativeWithHeartbeat({
|
|
|
138
139
|
}
|
|
139
140
|
await beat();
|
|
140
141
|
const completedAt = now();
|
|
141
|
-
|
|
142
|
-
schema: "kungfu.buildchain.native-heartbeat-run-receipt/v1",
|
|
142
|
+
return createNativeExecutionReceipt({
|
|
143
143
|
outcome: "succeeded",
|
|
144
144
|
commandRoot: devDeliveryContentRoot({ command }),
|
|
145
|
-
|
|
145
|
+
executionBinding: boundExecution,
|
|
146
146
|
startedAt,
|
|
147
147
|
completedAt,
|
|
148
148
|
heartbeatCount,
|
|
149
|
-
};
|
|
150
|
-
return { ...receipt, receiptRoot: devDeliveryContentRoot(receipt) };
|
|
149
|
+
});
|
|
151
150
|
}
|
|
152
151
|
|
|
153
152
|
async function main() {
|
|
@@ -163,6 +162,26 @@ async function main() {
|
|
|
163
162
|
"command",
|
|
164
163
|
process.env.BUILDCHAIN_DEV_DELIVERY_NATIVE_COMMAND,
|
|
165
164
|
);
|
|
165
|
+
const sourceHead = flag(
|
|
166
|
+
args,
|
|
167
|
+
"source-head",
|
|
168
|
+
process.env.BUILDCHAIN_DEV_DELIVERY_SOURCE_HEAD,
|
|
169
|
+
);
|
|
170
|
+
const qualifiedBase = flag(
|
|
171
|
+
args,
|
|
172
|
+
"qualified-base",
|
|
173
|
+
process.env.BUILDCHAIN_DEV_DELIVERY_QUALIFIED_BASE,
|
|
174
|
+
);
|
|
175
|
+
const toolchainRoot = flag(
|
|
176
|
+
args,
|
|
177
|
+
"toolchain-root",
|
|
178
|
+
process.env.BUILDCHAIN_DEV_DELIVERY_TOOLCHAIN_ROOT,
|
|
179
|
+
);
|
|
180
|
+
const environmentRoot = flag(
|
|
181
|
+
args,
|
|
182
|
+
"environment-root",
|
|
183
|
+
process.env.BUILDCHAIN_DEV_DELIVERY_ENVIRONMENT_ROOT,
|
|
184
|
+
);
|
|
166
185
|
const cwd = path.resolve(
|
|
167
186
|
flag(args, "working-directory", process.env.GITHUB_WORKSPACE),
|
|
168
187
|
);
|
|
@@ -210,6 +229,14 @@ async function main() {
|
|
|
210
229
|
command,
|
|
211
230
|
cwd,
|
|
212
231
|
intervalMs: heartbeatSeconds * 1000,
|
|
232
|
+
executionBinding: {
|
|
233
|
+
repository,
|
|
234
|
+
protectedBase: branch,
|
|
235
|
+
sourceHead,
|
|
236
|
+
qualifiedBase,
|
|
237
|
+
toolchainRoot,
|
|
238
|
+
environmentRoot,
|
|
239
|
+
},
|
|
213
240
|
heartbeat: async () => {
|
|
214
241
|
await runDevDeliveryCommand({
|
|
215
242
|
command: "heartbeat",
|
|
@@ -54,6 +54,7 @@ export function devDeliveryProofCliOptions(args = [], environment = process.env)
|
|
|
54
54
|
shardEvidenceRoots: flag(rest, "shard-evidence-roots-json", environment.BUILDCHAIN_DEV_DELIVERY_SHARD_EVIDENCE_ROOTS || "[]"),
|
|
55
55
|
qualifiedAt: flag(rest, "qualified-at", environment.BUILDCHAIN_DEV_DELIVERY_QUALIFIED_AT),
|
|
56
56
|
qualifiedBase: flag(rest, "qualified-base", environment.BUILDCHAIN_DEV_DELIVERY_QUALIFIED_BASE),
|
|
57
|
+
nativeExecutionReceiptPath: flag(rest, "native-execution-receipt", environment.BUILDCHAIN_DEV_DELIVERY_NATIVE_EXECUTION_RECEIPT),
|
|
57
58
|
sourceProofPath: flag(rest, "source-proof", environment.BUILDCHAIN_DEV_DELIVERY_SOURCE_PROOF),
|
|
58
59
|
sourceProofRoot: flag(rest, "source-proof-root", environment.BUILDCHAIN_DEV_DELIVERY_SOURCE_PROOF_ROOT),
|
|
59
60
|
warrantResultPath: flag(rest, "warrant-result", environment.BUILDCHAIN_DEV_DELIVERY_WARRANT_RESULT),
|
|
@@ -132,7 +133,9 @@ export function runDevDeliveryProofCommand(options) {
|
|
|
132
133
|
dependencyRoot: options.dependencyRoot,
|
|
133
134
|
toolchainRoot: options.toolchainRoot,
|
|
134
135
|
environmentRoot: options.environmentRoot,
|
|
136
|
+
sourceHead: options.sourceHead,
|
|
135
137
|
qualifiedBase: options.qualifiedBase,
|
|
138
|
+
nativeExecutionReceipt: jsonFile(options.nativeExecutionReceiptPath, "native execution receipt"),
|
|
136
139
|
affectedPaths: jsonList(options.affectedPaths, "affected paths"),
|
|
137
140
|
shardEvidenceRoots: jsonList(options.shardEvidenceRoots, "shard evidence roots", { required: true }),
|
|
138
141
|
qualifiedAt: options.qualifiedAt,
|