@kungfu-tech/buildchain 4.0.1-alpha.4 → 4.0.1-alpha.5
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/architecture/decisions/0002-next-development-transition.md +101 -0
- package/architecture/internal-capabilities.json +52 -3
- package/architecture/maintainability-policy.json +22 -10
- package/architecture/v3-core-mechanism-inventory.json +89 -0
- package/architecture/v4-capability-state-machine-manifest.json +73 -0
- package/architecture/v4-compatibility-facts-parity.json +77 -0
- package/architecture/v4-next-development-parity.json +192 -0
- package/architecture/v4-release-train-parity.json +1 -0
- package/architecture/v4-tail-reseal-parity.json +150 -0
- package/bin/buildchain.mjs +16 -1
- package/bin/internal/command-registry.mjs +2 -0
- package/bin/internal/compatibility-facts-cli.mjs +101 -0
- package/contracts/fixtures/next-development-transition-v1/anchored-manual-waiting.json +47 -0
- package/contracts/fixtures/next-development-transition-v1/semver-auto-planned.json +47 -0
- package/contracts/fixtures/next-development-transition-v1/version-model-cases.json +40 -0
- package/contracts/fixtures/v4-compatibility-facts-v1/shared.json +1129 -0
- package/contracts/fixtures/v4-floating-consumer-policy-v1/cases.json +7 -1
- package/contracts/fixtures/v4-tail-reseal-v1/valid.json +229 -0
- package/contracts/next-development-request-v1.schema.json +66 -0
- package/contracts/next-development-transition-v1.schema.json +292 -0
- package/contracts/v4-compatibility-facts-v1.schema.json +230 -0
- package/contracts/v4-tail-reseal-v1.schema.json +276 -0
- package/dist/site/agent-index.json +1 -0
- package/dist/site/artifact-schemas.json +2 -0
- package/dist/site/buildchain-contract.json +1388 -23
- package/dist/site/buildchain-site.json +257 -19
- package/dist/site/capability-registry.json +10 -8
- package/dist/site/cli-registry.json +106 -0
- package/dist/site/kfd-claims.json +187 -12
- package/dist/site/kfd-upstream-aggregate.json +1 -1
- package/dist/site/manual-registry.json +35 -4
- package/dist/site/node-api-registry.json +6579 -4493
- package/dist/site/page-registry.json +233 -11
- package/dist/site/public-surface-audit.json +241 -7
- package/dist/site/publication-authority-registry.json +6 -1
- package/dist/site/publication-registry.json +4 -4
- package/dist/site/release-provenance.json +7 -0
- package/dist/site/schemas/v4-compatibility-facts-v1.schema.json +230 -0
- package/dist/site/site-manifest.json +24 -8
- package/dist/site/workflow-registry.json +36 -4
- package/docs/MAP.md +4 -1
- package/docs/cli-reference.md +125 -0
- package/docs/dev-alpha-candidate-patrol.md +8 -0
- package/docs/next-development-transition.md +118 -0
- package/docs/node-api-reference.md +250 -117
- package/docs/v4-compatibility-facts.md +91 -0
- package/docs/v4-tail-reseal.md +73 -0
- package/docs/versioning.md +4 -3
- package/package.json +14 -5
- package/packages/core/buildchain-agent-manuals.js +2 -0
- package/packages/core/buildchain-compatibility-authority.js +336 -0
- package/packages/core/buildchain-compatibility-fact.js +394 -0
- package/packages/core/buildchain-compatibility-facts.json +217 -0
- package/packages/core/buildchain-compatibility-proof.js +566 -0
- package/packages/core/buildchain-contract.js +93 -141
- package/packages/core/channel-candidate.js +8 -0
- package/packages/core/channel-promotion-baseline.js +55 -0
- package/packages/core/dev-alpha-candidate-selection.js +10 -2
- package/packages/core/dev-delivery-execution-transfer.js +21 -1
- package/packages/core/dev-delivery-process-boundary.js +19 -6
- package/packages/core/dev-delivery-provider-heartbeat.js +18 -6
- package/packages/core/kungfu-temporal-fact.js +557 -0
- package/packages/core/next-development-candidate-reservation.js +186 -0
- package/packages/core/next-development-controller.js +728 -0
- package/packages/core/next-development-projection.js +287 -0
- package/packages/core/next-development-transition.js +738 -0
- package/packages/core/paper-agent-entry.js +11 -5
- package/packages/core/paper.js +16 -5
- package/packages/core/v4-canonical-contracts.js +5 -0
- package/packages/core/v4-floating-consumer-policy.js +29 -9
- package/packages/core/v4-tail-reseal-contract.js +26 -0
- package/packages/core/v4-tail-reseal-github.js +178 -0
- package/packages/core/v4-tail-reseal-receipt.js +225 -0
- package/packages/core/v4-tail-reseal.js +594 -0
- package/scripts/buildchain-cli-help.mjs +20 -0
- package/scripts/check-inventory.mjs +11 -0
- package/scripts/dev-alpha-candidate-patrol.mjs +22 -1
- package/scripts/generate-next-development-guidance.mjs +49 -0
- package/scripts/generate-site-bundle.mjs +16 -3
- package/scripts/init-repo.mjs +22 -4
- package/scripts/next-development-self-dogfood-harness.mjs +460 -0
- package/scripts/next-development-self-dogfood.mjs +597 -0
- package/scripts/next-development-transition.mjs +47 -0
- package/scripts/site-capability-metadata.mjs +12 -0
- package/scripts/v4-consumer-policy.mjs +1 -5
- package/scripts/v4-tail-reseal-macos-rehearsal.mjs +134 -0
- package/scripts/v4-tail-reseal.mjs +416 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
status: active
|
|
3
|
+
period: ongoing
|
|
4
|
+
theme: buildchain-v4-compatibility-facts
|
|
5
|
+
doc_type: technical-reference
|
|
6
|
+
source_level: local-files
|
|
7
|
+
confidence: high
|
|
8
|
+
sensitivity: public
|
|
9
|
+
evidence_grade: A
|
|
10
|
+
review_state: unreviewed
|
|
11
|
+
last_reviewed: 2026-08-16
|
|
12
|
+
ai_provenance:
|
|
13
|
+
model_family: GPT-5
|
|
14
|
+
product: Codex
|
|
15
|
+
generated_at: 2026-08-16
|
|
16
|
+
invisible_context: not asserted
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
# Buildchain v4 compatibility Facts
|
|
20
|
+
|
|
21
|
+
Buildchain v4 authorizes contract compatibility with immutable, directional
|
|
22
|
+
Facts. `compatibleBreakingDigests` and the v1 proof objects remain public for
|
|
23
|
+
older consumers, but they are deterministic projections. Neither can authorize
|
|
24
|
+
a transition without the current Fact registry, its exact Project Cut, and a
|
|
25
|
+
verified path receipt.
|
|
26
|
+
|
|
27
|
+
## Authority chain
|
|
28
|
+
|
|
29
|
+
The package source is
|
|
30
|
+
`packages/core/buildchain-compatibility-facts.json`, retained from v3 exact head
|
|
31
|
+
`6b96bdad8d9f8ccf9275f27d9370a226a9c78465`. Each declaration becomes a KFR2
|
|
32
|
+
predicate and relation, then enters an append-only temporal bundle. The
|
|
33
|
+
registry identity binds all Fact, proof, Cut, supersession, revocation, and
|
|
34
|
+
bundle roots.
|
|
35
|
+
|
|
36
|
+
V4 projects a legacy digest only when a verified Fact targets the exact current
|
|
37
|
+
surface kind, ID, and breaking digest. The old proof's v2/v3 `majorLines` field
|
|
38
|
+
is historical projection metadata; it does not narrow or enlarge the
|
|
39
|
+
digest-and-Cut-bound Fact. A target digest that has changed since v3 receives no
|
|
40
|
+
projection.
|
|
41
|
+
|
|
42
|
+
## Decision semantics
|
|
43
|
+
|
|
44
|
+
- Direction is always source to target. Reverse use rejects.
|
|
45
|
+
- The only operation is `accept-contract-lock`.
|
|
46
|
+
- Evaluation selects one direct Fact. It never searches for a path or infers
|
|
47
|
+
symmetry or transitivity.
|
|
48
|
+
- Composition requires an ordered caller-supplied path and positive bounded
|
|
49
|
+
depth.
|
|
50
|
+
- Supersession and revocation append lifecycle records. Old Cuts replay old
|
|
51
|
+
truth; later Cuts deterministically reject superseded or revoked relations.
|
|
52
|
+
- A revocation is the safety-equivalent expiry boundary: compatibility has no
|
|
53
|
+
wall-clock-only truth outside a rooted Cut.
|
|
54
|
+
- Missing, ambiguous, not-yet-valid, revoked, superseded, wrong-direction,
|
|
55
|
+
wrong-Cut, disconnected, cyclic, inactive, or corrupted inputs produce a
|
|
56
|
+
rooted rejected receipt.
|
|
57
|
+
|
|
58
|
+
Rust and TypeScript implement the same KFR2 closed-field encoding and emit
|
|
59
|
+
byte-identical JSON for the shared fixture in
|
|
60
|
+
`contracts/fixtures/v4-compatibility-facts-v1/shared.json`.
|
|
61
|
+
|
|
62
|
+
## CLI and Node API
|
|
63
|
+
|
|
64
|
+
Project and verify the built-in registry:
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
npx @kungfu-tech/buildchain facts compatibility project --json
|
|
68
|
+
npx @kungfu-tech/buildchain facts compatibility verify --json
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Create a direct query template for one current Fact, then verify it:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
npx @kungfu-tech/buildchain facts compatibility query-template \
|
|
75
|
+
--fact-root sha256:... --json
|
|
76
|
+
npx @kungfu-tech/buildchain facts compatibility query \
|
|
77
|
+
--query query.json --registry registry.json --json
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
The `@kungfu-tech/buildchain/compatibility-fact-authority` export provides the
|
|
81
|
+
same constructors, verifiers, resolver, and Release Passport evidence helper.
|
|
82
|
+
Compatibility evidence explicitly sets `grantsReleaseAuthority: false`; it can
|
|
83
|
+
be attached through the existing release-evidence route but cannot publish,
|
|
84
|
+
merge, sign, or release anything.
|
|
85
|
+
|
|
86
|
+
## Updating the registry
|
|
87
|
+
|
|
88
|
+
Append a new source Fact or lifecycle record. Never rewrite an existing Fact,
|
|
89
|
+
directly edit a surface digest allowlist, or convert a caller claim into
|
|
90
|
+
authority. Regenerate references and site facts, then run the shared parity
|
|
91
|
+
fixture and the complete repository check.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# V4 retained-candidate tail reseal
|
|
2
|
+
|
|
3
|
+
Buildchain v4 can recover one narrowly defined late Alpha failure without
|
|
4
|
+
rebuilding a qualified four-platform candidate. The recovery is not a cache hit
|
|
5
|
+
and does not give Stage Capsule any provider authority. It is a fresh governed
|
|
6
|
+
run that proves all retained bytes first, then executes only the explicitly
|
|
7
|
+
fenced macOS signing-finalization tail.
|
|
8
|
+
|
|
9
|
+
The authoritative request schema is
|
|
10
|
+
[`contracts/v4-tail-reseal-v1.schema.json`](../contracts/v4-tail-reseal-v1.schema.json).
|
|
11
|
+
It binds the failed run and source tree, four payload and manifest archive
|
|
12
|
+
digests, four content roots, Stage Capsule roots and reuse decisions, Warrant
|
|
13
|
+
lineage, retention, credential authority, signing delegation/result, release
|
|
14
|
+
tail transaction, idempotency key, and independent provider readbacks. Any
|
|
15
|
+
mismatch rejects reuse and requires a normal candidate build.
|
|
16
|
+
|
|
17
|
+
## Authority boundary
|
|
18
|
+
|
|
19
|
+
- `install`, `build`, `verify`, `package`, and the ordinary platform matrix are
|
|
20
|
+
skipped only when all 16 per-platform Stage Capsule decisions prove exact
|
|
21
|
+
reuse. Capsule reuse has no external effects.
|
|
22
|
+
- Only `macos-arm64:signing-finalization` may change payload bytes. The public
|
|
23
|
+
workflow verifies the retained macOS bytes before the effect and verifies the
|
|
24
|
+
resealed bytes plus signing and release-tail readbacks afterward.
|
|
25
|
+
- The signing token exists only in the macOS credential-island step. It is not
|
|
26
|
+
stored in a Capsule, request, artifact, log, Passport, or receipt.
|
|
27
|
+
- A successful run emits the existing
|
|
28
|
+
`kungfu-buildchain-release-candidate-passport` contract. Tail reseal does not
|
|
29
|
+
create a second candidate or release artifact class.
|
|
30
|
+
- Durable callers use `@v4-alpha` during Alpha evaluation or `@v4` after stable
|
|
31
|
+
promotion. Exact SHAs are runtime evidence from `job.workflow_sha`, never a
|
|
32
|
+
persisted selector.
|
|
33
|
+
|
|
34
|
+
## CLI and Node API
|
|
35
|
+
|
|
36
|
+
Plan locally from the deterministic data contract:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
buildchain tail-reseal plan \
|
|
40
|
+
--request .buildchain/tail-reseal/request.json \
|
|
41
|
+
--output .buildchain/tail-reseal/plan.json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`tail-reseal admit` performs the provider readback of the exact failed run,
|
|
45
|
+
jobs, retained GitHub artifact archives, and signing-authority result. Each
|
|
46
|
+
fresh platform runner then uses `verify-platform --mode retained`. Only the
|
|
47
|
+
macOS runner may follow with `--mode resealed --provider-readback-root ...`.
|
|
48
|
+
After the ordinary Release Candidate Passport is generated, `tail-reseal seal`
|
|
49
|
+
binds all four readbacks and the protected Warrant readback into the final
|
|
50
|
+
receipt.
|
|
51
|
+
|
|
52
|
+
The Node exports are `@kungfu-tech/buildchain/v4-tail-reseal` for request and
|
|
53
|
+
plan logic and `@kungfu-tech/buildchain/v4-tail-reseal-receipt` for terminal
|
|
54
|
+
receipt creation and verification.
|
|
55
|
+
|
|
56
|
+
## Reusable workflow
|
|
57
|
+
|
|
58
|
+
Consumers invoke
|
|
59
|
+
`kungfu-systems/buildchain/.github/workflows/v4-tail-reseal.yml@v4-alpha` from a
|
|
60
|
+
trusted, same-repository workflow. The caller supplies the rooted request, the
|
|
61
|
+
original candidate consumer-policy receipt, a reviewed macOS finalization
|
|
62
|
+
command, and the explicitly named signing secret. The command must write:
|
|
63
|
+
|
|
64
|
+
- `.buildchain/tail-reseal/signing-provider-readback.json`
|
|
65
|
+
- `.buildchain/tail-reseal/release-tail-provider-readback.json`
|
|
66
|
+
|
|
67
|
+
Their byte digests must equal the roots fixed in the request. The workflow
|
|
68
|
+
downloads the signing result by exact authority repository, run, artifact name,
|
|
69
|
+
and archive digest; no credential or provider effect is replayed from a Stage
|
|
70
|
+
Capsule.
|
|
71
|
+
|
|
72
|
+
The v3-to-v4 invariant mapping is recorded in
|
|
73
|
+
[`architecture/v4-tail-reseal-parity.json`](../architecture/v4-tail-reseal-parity.json).
|
package/docs/versioning.md
CHANGED
|
@@ -79,9 +79,10 @@ repository changes are patch".
|
|
|
79
79
|
|
|
80
80
|
| Date | Action | Line | Faces | Class | Rationale | PR |
|
|
81
81
|
| ---------- | ------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- |
|
|
82
|
-
| 2026-08-
|
|
83
|
-
| 2026-08-
|
|
84
|
-
| 2026-08-
|
|
82
|
+
| 2026-08-16 | extend-minor | `v4.0` | next-development-transition, next-development-controller, next-development-projection, next-development-cli | additive | Forward-port the rooted completed-Alpha successor contract, semver/auto and anchored/manual modes, CAS recovery, protected Dev reconciliation, reservation readback, public templates, and consumer-equivalent lifecycle proof from the exact v3 evidence into v4. | |
|
|
83
|
+
| 2026-08-14 | extend-minor | `v4.0` | source-qualification-proof-v2, source-proof-reuse-decision, reusable-check-workflow | additive | Forward-port opt-in exact accepted source-proof reuse for merge groups, binding source, base, patch, runtime, plan, policy, closure, dependency, required-context, producer receipt, and caller run. Any missing or changed predicate fails closed to the existing full source lifecycle, which remains the default. | |
|
|
84
|
+
| 2026-08-11 | extend-minor | `v4.0` | release-blocker-repair-contract, release-blocker-priority-claim, release-train-node-export, dev-delivery-warrant-node-export | additive | Forward-port rooted successor candidate generations, exact semantic patch identity across cut and Dev landings, publication blocking through conflict or mismatch, and the narrow non-preemptive Warrant blocker lane already protected and self-dogfood-proven on v3. | |
|
|
85
|
+
| 2026-08-10 | extend-minor | `v4.0` | release-cut-contract, release-train-state-machine, release-train-node-export | additive | Forward-port the provider-neutral rooted Release Cut and idempotent Release Train state contract already proven on v3; candidate, tree, Alpha base, runtime, generation, and authority stay frozen while later Dev movement remains an observation rather than implicit supersession. | |
|
|
85
86
|
| 2026-08-08 | extend-minor | `v4.0` | dev-delivery-warrant-read-candidate, rust-state-projection, dev-delivery-cli | additive | Add an opt-in, qualification-bound read projection behind `observe --read-mode v4`; v3 remains the sole writer and default reader, mutation commands ignore the switch, failures stop, and rollback is the explicit caller change back to v3. | |
|
|
86
87
|
| 2026-08-05 | extend-minor | `v3.0` | auditable-demo-scenario, auditable-demo-capture, auditable-demo-adapter | additive | Add an opt-in deterministic readable-playback declaration that preserves captured terminal payloads and order while normalizing only presentation timing; omitted playback continues to use observed PTY timestamps, and existing composition modes remain unchanged. | |
|
|
87
88
|
| 2026-08-04 | extend-minor | `v3.0` | dev-delivery-warrant-queue, source-qualification-proof, integration-delivery-proof, dev-delivery-cli, reusable-dev-delivery-workflows | additive | Add durable fair and fenced protected-dev scheduling plus split source/integration proof contracts. Existing PR admission remains available through explicit `off` and `shadow` rollout modes; no existing command, export, or release flow is removed. | |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kungfu-tech/buildchain",
|
|
3
|
-
"version": "4.0.1-alpha.
|
|
3
|
+
"version": "4.0.1-alpha.5",
|
|
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",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"./detached-artifact-signature": "./packages/core/detached-artifact-signature.js",
|
|
24
24
|
"./anchored-version-material": "./packages/core/anchored-version-material.js",
|
|
25
25
|
"./buildchain-contract": "./packages/core/buildchain-contract.js",
|
|
26
|
+
"./compatibility-fact-authority": "./packages/core/buildchain-compatibility-proof.js",
|
|
26
27
|
"./candidate-timeline": "./packages/core/candidate-timeline.js",
|
|
27
28
|
"./channel-candidate": "./packages/core/channel-candidate.js",
|
|
28
29
|
"./cache-evidence": "./packages/core/cache-evidence.js",
|
|
@@ -43,6 +44,8 @@
|
|
|
43
44
|
"./public-surface-audit": "./packages/core/public-surface-audit.js",
|
|
44
45
|
"./v4-floating-consumer-policy": "./packages/core/v4-floating-consumer-policy.js",
|
|
45
46
|
"./v4-runtime-ref-resume-authority": "./packages/core/v4-runtime-ref-resume-authority.js",
|
|
47
|
+
"./v4-tail-reseal": "./packages/core/v4-tail-reseal.js",
|
|
48
|
+
"./v4-tail-reseal-receipt": "./packages/core/v4-tail-reseal-receipt.js",
|
|
46
49
|
"./logging": "./packages/core/logging.js",
|
|
47
50
|
"./portable-dev-cache": "./packages/core/portable-dev-cache.js",
|
|
48
51
|
"./publication-artifact": "./packages/core/publication-artifact.js",
|
|
@@ -60,6 +63,9 @@
|
|
|
60
63
|
"./release-candidate": "./packages/core/release-candidate.js",
|
|
61
64
|
"./release-candidate-recovery": "./packages/core/release-candidate-recovery.js",
|
|
62
65
|
"./release-train": "./packages/core/release-train.js",
|
|
66
|
+
"./next-development-transition": "./packages/core/next-development-transition.js",
|
|
67
|
+
"./next-development-controller": "./packages/core/next-development-controller.js",
|
|
68
|
+
"./next-development-projection": "./packages/core/next-development-projection.js",
|
|
63
69
|
"./stable-candidate-ledger": "./packages/core/stable-candidate-ledger.js",
|
|
64
70
|
"./release-passport": "./packages/core/release-passport.js",
|
|
65
71
|
"./release-passport-contract": "./packages/core/release-passport-contract.js",
|
|
@@ -92,6 +98,7 @@
|
|
|
92
98
|
"./site/schemas/kfd-product-gate-input-v1.schema.json": "./dist/site/schemas/kfd-product-gate-input-v1.schema.json",
|
|
93
99
|
"./site/schemas/kfd-support-projection-v1.schema.json": "./dist/site/schemas/kfd-support-projection-v1.schema.json",
|
|
94
100
|
"./site/schemas/dev-delivery-authority-v2.schema.json": "./dist/site/schemas/dev-delivery-authority-v2.schema.json",
|
|
101
|
+
"./site/schemas/v4-compatibility-facts-v1.schema.json": "./dist/site/schemas/v4-compatibility-facts-v1.schema.json",
|
|
95
102
|
"./site/buildchain-contract.json": "./dist/site/buildchain-contract.json",
|
|
96
103
|
"./site/product-mechanism.json": "./dist/site/product-mechanism.json",
|
|
97
104
|
"./site/release-provenance.json": "./dist/site/release-provenance.json",
|
|
@@ -130,14 +137,16 @@
|
|
|
130
137
|
"precheck:static": "prettier --check architecture/decisions/0003-two-phase-delivery-warrant.md architecture/v4-delivery-authority-parity.json contracts/dev-delivery-authority-v2.schema.json dist/site/schemas/dev-delivery-authority-v2.schema.json docs/dev-delivery-qualification-landing-adr.md packages/core/dev-delivery-authority-candidate.js packages/core/dev-delivery-authority-evidence.js packages/core/dev-delivery-authority-landing.js packages/core/dev-delivery-authority-observation.js packages/core/dev-delivery-authority-qualification.js packages/core/dev-delivery-authority-settlement.js packages/core/dev-delivery-authority-state.js packages/core/dev-delivery-execution-failure.js packages/core/dev-delivery-execution-transfer.js packages/core/dev-delivery-landing-readback.js packages/core/dev-delivery-landing-terminal-evidence.js packages/core/dev-delivery-landing-testing-port.js packages/core/dev-delivery-native-execution.js packages/core/dev-delivery-native-proof.js packages/core/dev-delivery-process-boundary.js packages/core/dev-delivery-warrant-qualification.js packages/core/dev-delivery-warrant-state.js scripts/dev-delivery-authority-command-adapters.mjs scripts/dev-delivery-authority-provider.mjs scripts/dev-delivery-authority.mjs scripts/dev-delivery-native-run.mjs scripts/dev-delivery-process-boundary.mjs scripts/dev-delivery-two-phase-resume.mjs scripts/dev-delivery-two-phase.mjs scripts/dev-delivery-warrant-options.mjs scripts/dev-delivery-warrant-store.mjs templates/native-dev-delivery.yml",
|
|
131
138
|
"operator:windows-jit": "bash scripts/aws-windows-jit-operator.sh",
|
|
132
139
|
"check": "pnpm run check:static && node scripts/check-v4-public-dogfood-contract.mjs && node scripts/check-v4-floating-consumer-policy-contract.mjs && pnpm run check:v4-bridge && pnpm run check:v4-contracts && node scripts/check-maintainability.mjs && node scripts/check-internal-architecture.mjs && node scripts/check-inventory.mjs && node scripts/check-core-mechanism-inventory.mjs && node scripts/check-release-tail-contract.mjs && node scripts/v4-architecture.mjs validate && node scripts/v4-warrant-shadow-plan.mjs validate && pnpm run check:site && pnpm run check:workflows && pnpm run test:unit && pnpm run check:golden-path && node scripts/check-action-bundles.mjs",
|
|
133
|
-
"check:static": "node scripts/check-javascript-syntax.mjs && prettier --check architecture/*.json contracts/release-tail-provider-bindings-v1.schema.json contracts/v4-canonical-contracts-v1.schema.json contracts/v4-delivery-warrant-semantic-diff-report-v1.schema.json contracts/v4-delivery-warrant-trace-v1.schema.json contracts/v4-floating-consumer-policy-receipt-v1.schema.json contracts/v4-runtime-ref-resume-authority-v1.schema.json contracts/v4-host-contract-v1.schema.json contracts/v4-provider-operation-journal-v1.schema.json contracts/v4-release-activation-shadow-v1.schema.json contracts/v4-stable-publication-fence-v1.schema.json contracts/v4-partial-mutation-recovery-v1.schema.json contracts/v4-stage-capsule-v1.schema.json contracts/v4-stage-capsule-store-v1.schema.json contracts/v4-stage-capsule-resume-v1.schema.json contracts/release-tail-capabilities-v1.schema.json contracts/fixtures/release-tail-capabilities-v1/*.json contracts/fixtures/v4-delivery-warrant-trace-v1/*.json contracts/fixtures/v4-floating-consumer-policy-v1/*.json contracts/fixtures/v4-runtime-ref-resume-authority-v1/*.json contracts/fixtures/v4-provider-operation-journal-v1/*.json contracts/fixtures/v4-provider-readback-idempotency-v1/*.json contracts/fixtures/v4-release-activation-shadow-v1/*.json contracts/fixtures/v4-stable-publication-fence-v1/*.json contracts/fixtures/v4-partial-mutation-recovery-v1/*.json contracts/fixtures/v4-stage-capsule-v1/*.json contracts/fixtures/v4-stage-capsule-store-v1/*.json contracts/fixtures/v4-stage-capsule-resume-v1/*.json bin/internal/command-registry.mjs packages/core/v4-canonical-contracts.js packages/core/v4-floating-consumer-evidence.js packages/core/v4-floating-consumer-policy.js packages/core/v4-floating-consumer-release-passport.js packages/core/v4-runtime-ref-resume-authority.js packages/core/v4-runtime-selector-persistence.js packages/core/v4-provider-operation-journal.js packages/core/v4-provider-readback-idempotency.js packages/core/v4-release-activation-shadow.js packages/core/v4-stable-publication-fence.js packages/core/v4-partial-mutation-recovery-qualification.js packages/core/v4-stage-capsule.js packages/core/v4-stage-capsule-store.js packages/core/v4-stage-capsule-local-store.js packages/core/v4-platform-stage-checkpoints.js packages/core/v4-stage-capsule-resume-planner.js packages/core/v4-stage-capsule-qualification.js packages/core/v4-stage-capsule-qualification-campaign.js packages/core/v4-delivery-warrant-fixture-runner.js packages/core/v4-delivery-warrant-read-candidate.js packages/core/v4-delivery-warrant-semantic-diff-gate.js packages/core/v4-delivery-warrant-shadow-adapter.js scripts/authorize-promotion-runtime-override.cjs scripts/check-core-mechanism-inventory.mjs scripts/check-release-tail-contract.mjs scripts/check-javascript-syntax.mjs scripts/check-maintainability.mjs scripts/dev-pr-prequeue-guard.mjs scripts/check-v4-public-dogfood-contract.mjs scripts/maintainability-metrics.mjs scripts/public-reference.mjs scripts/site-reference-registry.mjs scripts/generate-public-reference.mjs scripts/v4-architecture.mjs scripts/v4-bridge-bootstrap.mjs scripts/v4-bridge-evidence.mjs scripts/v4-consumer-policy.mjs scripts/v4-host-adapter.mjs scripts/v4-platform-stage-checkpoint-rehearsal.mjs scripts/v4-stage-capsule-resume-rehearsal.mjs scripts/v4-stage-capsule-qualification.mjs scripts/v4-warrant-shadow-plan.mjs scripts/verify-golden-path.mjs tests/authorize-promotion-runtime-override.test.mjs tests/command-registry.test.mjs tests/core-mechanism-inventory.test.mjs tests/release-tail-contract.test.mjs tests/maintainability.test.mjs tests/promotion-responsibilities.test.mjs tests/public-reference.test.mjs tests/v4-architecture.test.mjs tests/v4-bridge.test.mjs tests/v4-canonical-contracts.test.mjs tests/v4-delivery-warrant-fixture-runner.test.mjs tests/v4-delivery-warrant-read-candidate.test.mjs tests/v4-floating-consumer-policy.test.mjs tests/v4-runtime-ref-resume-authority.test.mjs tests/v4-platform-stage-checkpoints.test.mjs tests/v4-provider-operation-journal.test.mjs tests/v4-provider-readback-idempotency.test.mjs tests/v4-public-dogfood-contract.test.mjs tests/v4-release-activation-shadow.test.mjs tests/v4-stable-publication-fence.test.mjs tests/v4-partial-mutation-recovery-qualification.test.mjs tests/v4-stage-capsule.test.mjs tests/v4-stage-capsule-store.test.mjs tests/v4-stage-capsule-resume-planner.test.mjs tests/v4-stage-capsule-qualification.test.mjs tests/v4-warrant-shadow-plan.test.mjs",
|
|
140
|
+
"check:static": "node scripts/check-javascript-syntax.mjs && prettier --check architecture/*.json contracts/release-tail-provider-bindings-v1.schema.json contracts/v4-canonical-contracts-v1.schema.json contracts/v4-compatibility-facts-v1.schema.json contracts/v4-delivery-warrant-semantic-diff-report-v1.schema.json contracts/v4-delivery-warrant-trace-v1.schema.json contracts/v4-floating-consumer-policy-receipt-v1.schema.json contracts/v4-runtime-ref-resume-authority-v1.schema.json contracts/v4-tail-reseal-v1.schema.json contracts/v4-host-contract-v1.schema.json contracts/v4-provider-operation-journal-v1.schema.json contracts/v4-release-activation-shadow-v1.schema.json contracts/v4-stable-publication-fence-v1.schema.json contracts/v4-partial-mutation-recovery-v1.schema.json contracts/v4-stage-capsule-v1.schema.json contracts/v4-stage-capsule-store-v1.schema.json contracts/v4-stage-capsule-resume-v1.schema.json contracts/release-tail-capabilities-v1.schema.json contracts/fixtures/release-tail-capabilities-v1/*.json contracts/fixtures/v4-delivery-warrant-trace-v1/*.json contracts/fixtures/v4-floating-consumer-policy-v1/*.json contracts/fixtures/v4-runtime-ref-resume-authority-v1/*.json contracts/fixtures/v4-tail-reseal-v1/*.json contracts/fixtures/v4-compatibility-facts-v1/*.json contracts/fixtures/v4-provider-operation-journal-v1/*.json contracts/fixtures/v4-provider-readback-idempotency-v1/*.json contracts/fixtures/v4-release-activation-shadow-v1/*.json contracts/fixtures/v4-stable-publication-fence-v1/*.json contracts/fixtures/v4-partial-mutation-recovery-v1/*.json contracts/fixtures/v4-stage-capsule-v1/*.json contracts/fixtures/v4-stage-capsule-store-v1/*.json contracts/fixtures/v4-stage-capsule-resume-v1/*.json bin/internal/command-registry.mjs bin/internal/compatibility-facts-cli.mjs packages/core/v4-canonical-contracts.js packages/core/kungfu-temporal-fact.js packages/core/buildchain-compatibility-fact.js packages/core/buildchain-compatibility-authority.js packages/core/buildchain-compatibility-proof.js packages/core/v4-floating-consumer-evidence.js packages/core/v4-floating-consumer-policy.js packages/core/v4-floating-consumer-release-passport.js packages/core/v4-runtime-ref-resume-authority.js packages/core/v4-tail-reseal-contract.js packages/core/v4-tail-reseal-github.js packages/core/v4-tail-reseal-receipt.js packages/core/v4-tail-reseal.js packages/core/v4-runtime-selector-persistence.js packages/core/v4-provider-operation-journal.js packages/core/v4-provider-readback-idempotency.js packages/core/v4-release-activation-shadow.js packages/core/v4-stable-publication-fence.js packages/core/v4-partial-mutation-recovery-qualification.js packages/core/v4-stage-capsule.js packages/core/v4-stage-capsule-store.js packages/core/v4-stage-capsule-local-store.js packages/core/v4-platform-stage-checkpoints.js packages/core/v4-stage-capsule-resume-planner.js packages/core/v4-stage-capsule-qualification.js packages/core/v4-stage-capsule-qualification-campaign.js packages/core/v4-delivery-warrant-fixture-runner.js packages/core/v4-delivery-warrant-read-candidate.js packages/core/v4-delivery-warrant-semantic-diff-gate.js packages/core/v4-delivery-warrant-shadow-adapter.js scripts/authorize-promotion-runtime-override.cjs scripts/check-core-mechanism-inventory.mjs scripts/check-release-tail-contract.mjs scripts/check-javascript-syntax.mjs scripts/check-maintainability.mjs scripts/dev-pr-prequeue-guard.mjs scripts/check-v4-public-dogfood-contract.mjs scripts/maintainability-metrics.mjs scripts/public-reference.mjs scripts/site-reference-registry.mjs scripts/generate-public-reference.mjs scripts/v4-architecture.mjs scripts/v4-bridge-bootstrap.mjs scripts/v4-bridge-evidence.mjs scripts/v4-consumer-policy.mjs scripts/v4-host-adapter.mjs scripts/v4-platform-stage-checkpoint-rehearsal.mjs scripts/v4-stage-capsule-resume-rehearsal.mjs scripts/v4-stage-capsule-qualification.mjs scripts/v4-tail-reseal-macos-rehearsal.mjs scripts/v4-tail-reseal.mjs scripts/v4-warrant-shadow-plan.mjs scripts/verify-golden-path.mjs tests/authorize-promotion-runtime-override.test.mjs tests/command-registry.test.mjs tests/core-mechanism-inventory.test.mjs tests/release-tail-contract.test.mjs tests/maintainability.test.mjs tests/promotion-responsibilities.test.mjs tests/public-reference.test.mjs tests/v4-architecture.test.mjs tests/v4-bridge.test.mjs tests/v4-canonical-contracts.test.mjs tests/v4-delivery-warrant-fixture-runner.test.mjs tests/v4-delivery-warrant-read-candidate.test.mjs tests/v4-floating-consumer-policy.test.mjs tests/v4-runtime-ref-resume-authority.test.mjs tests/v4-tail-reseal.test.mjs tests/v4-tail-reseal-parity.test.mjs tests/v4-compatibility-facts.test.mjs tests/v4-platform-stage-checkpoints.test.mjs tests/v4-provider-operation-journal.test.mjs tests/v4-provider-readback-idempotency.test.mjs tests/v4-public-dogfood-contract.test.mjs tests/v4-release-activation-shadow.test.mjs tests/v4-stable-publication-fence.test.mjs tests/v4-partial-mutation-recovery-qualification.test.mjs tests/v4-stage-capsule.test.mjs tests/v4-stage-capsule-store.test.mjs tests/v4-stage-capsule-resume-planner.test.mjs tests/v4-stage-capsule-qualification.test.mjs tests/v4-warrant-shadow-plan.test.mjs",
|
|
134
141
|
"check:v4-bridge": "cargo fmt --manifest-path crates/buildchain-v4-bridge/Cargo.toml -- --check && cargo clippy --locked --manifest-path crates/buildchain-v4-bridge/Cargo.toml -- -D warnings && cargo test --locked --manifest-path crates/buildchain-v4-bridge/Cargo.toml",
|
|
135
|
-
"check:v4-contracts": "cargo fmt --manifest-path crates/buildchain-v4-contracts/Cargo.toml -- --check && cargo clippy --locked --manifest-path crates/buildchain-v4-contracts/Cargo.toml -- -D warnings && cargo test --locked --manifest-path crates/buildchain-v4-contracts/Cargo.toml && node --test tests/v4-canonical-contracts.test.mjs tests/v4-delivery-warrant-fixture-runner.test.mjs tests/v4-delivery-warrant-read-candidate.test.mjs tests/v4-floating-consumer-policy-contract.test.mjs tests/v4-floating-consumer-policy.test.mjs tests/v4-runtime-ref-resume-authority.test.mjs tests/v4-platform-stage-checkpoints.test.mjs tests/v4-provider-operation-journal.test.mjs tests/v4-provider-readback-idempotency.test.mjs tests/v4-public-dogfood-contract.test.mjs tests/v4-release-activation-shadow.test.mjs tests/v4-stable-publication-fence.test.mjs tests/v4-partial-mutation-recovery-qualification.test.mjs tests/v4-stage-capsule.test.mjs tests/v4-stage-capsule-store.test.mjs tests/v4-stage-capsule-resume-planner.test.mjs tests/v4-stage-capsule-qualification.test.mjs",
|
|
142
|
+
"check:v4-contracts": "cargo fmt --manifest-path crates/buildchain-v4-contracts/Cargo.toml -- --check && cargo clippy --locked --manifest-path crates/buildchain-v4-contracts/Cargo.toml -- -D warnings && cargo test --locked --manifest-path crates/buildchain-v4-contracts/Cargo.toml && node --test tests/v4-canonical-contracts.test.mjs tests/v4-delivery-warrant-fixture-runner.test.mjs tests/v4-delivery-warrant-read-candidate.test.mjs tests/v4-floating-consumer-policy-contract.test.mjs tests/v4-floating-consumer-policy.test.mjs tests/v4-runtime-ref-resume-authority.test.mjs tests/v4-tail-reseal.test.mjs tests/v4-tail-reseal-parity.test.mjs tests/v4-compatibility-facts.test.mjs tests/v4-platform-stage-checkpoints.test.mjs tests/v4-provider-operation-journal.test.mjs tests/v4-provider-readback-idempotency.test.mjs tests/v4-public-dogfood-contract.test.mjs tests/v4-release-activation-shadow.test.mjs tests/v4-stable-publication-fence.test.mjs tests/v4-partial-mutation-recovery-qualification.test.mjs tests/v4-stage-capsule.test.mjs tests/v4-stage-capsule-store.test.mjs tests/v4-stage-capsule-resume-planner.test.mjs tests/v4-stage-capsule-qualification.test.mjs",
|
|
136
143
|
"check:workflows": "bash scripts/check-workflows.sh",
|
|
137
144
|
"generate:reference": "node scripts/generate-public-reference.mjs",
|
|
138
145
|
"check:reference": "node scripts/generate-public-reference.mjs --check",
|
|
139
|
-
"generate:
|
|
140
|
-
"check:
|
|
146
|
+
"generate:next-development": "node scripts/generate-next-development-guidance.mjs",
|
|
147
|
+
"check:next-development": "node scripts/generate-next-development-guidance.mjs --check",
|
|
148
|
+
"generate:site": "pnpm run generate:next-development && pnpm run generate:reference && node scripts/generate-site-bundle.mjs",
|
|
149
|
+
"check:site": "pnpm run check:next-development && pnpm run check:reference && node scripts/generate-site-bundle.mjs --check",
|
|
141
150
|
"check:golden-path": "node scripts/verify-golden-path.mjs",
|
|
142
151
|
"test:unit": "node --test tests/*.test.mjs",
|
|
143
152
|
"build": "pnpm -r --filter \"./actions/**\" build",
|
|
@@ -10,6 +10,7 @@ export const BUILDCHAIN_AGENT_MANUALS = Object.freeze([
|
|
|
10
10
|
{ id: "github-governance-authority", title: "GitHub governance authority", path: "docs/github-governance-authority.md", plane: "verify" },
|
|
11
11
|
{ id: "release-candidate", title: "Release Candidate Passport", path: "docs/release-candidate.md", plane: "verify" },
|
|
12
12
|
{ id: "release-train", title: "Release Train and Release Cut", path: "docs/release-train.md", plane: "verify" },
|
|
13
|
+
{ id: "next-development-transition", title: "Next-development transition", path: "docs/next-development-transition.md", plane: "verify" },
|
|
13
14
|
{ id: "release-propagation", title: "Release propagation", path: "docs/release-propagation.md", plane: "use" },
|
|
14
15
|
{ id: "readme-badges", title: "README badge blocks", path: "docs/readme-badges.md", plane: "use" },
|
|
15
16
|
{ id: "homebrew", title: "Homebrew distribution indexes", path: "docs/homebrew.md", plane: "use" },
|
|
@@ -33,6 +34,7 @@ export const BUILDCHAIN_AGENT_MANUALS = Object.freeze([
|
|
|
33
34
|
{ id: "release-tail-contract", title: "Declarative release-tail contract", path: "docs/release-tail-contract.md", plane: "verify" },
|
|
34
35
|
{ id: "release-tail-provider-plane", title: "Declarative release-tail provider plane", path: "docs/release-tail-provider-plane.md", plane: "use" },
|
|
35
36
|
{ id: "release-governance", title: "Release governance", path: "docs/release-governance.md", plane: "why" },
|
|
37
|
+
{ id: "v4-compatibility-facts", title: "Buildchain v4 compatibility Facts", path: "docs/v4-compatibility-facts.md", plane: "verify" },
|
|
36
38
|
{ id: "release-flow", title: "Release flow", path: "docs/release-flow.md", plane: "verify" },
|
|
37
39
|
{ id: "runtime-train-validation", title: "Runtime train validation", path: "docs/runtime-train-validation.md", plane: "verify" },
|
|
38
40
|
{ id: "versioning", title: "Versioning", path: "docs/versioning.md", plane: "why" },
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import {
|
|
2
|
+
devDeliveryContentRoot as contentRoot,
|
|
3
|
+
devDeliveryExactRoot as exactRoot,
|
|
4
|
+
devDeliveryExactSha as exactSha,
|
|
5
|
+
devDeliveryText as text,
|
|
6
|
+
} from "./dev-delivery-common.js";
|
|
7
|
+
import {
|
|
8
|
+
BUILDCHAIN_COMPATIBILITY_PROOF_REGISTRY_SCHEMA,
|
|
9
|
+
BUILDCHAIN_COMPATIBILITY_RELEASE_EVIDENCE_SCHEMA,
|
|
10
|
+
createBuildchainCompatibilityFactRegistry,
|
|
11
|
+
createHistoricalBuildchainCompatibilityProofs,
|
|
12
|
+
verifyBuildchainCompatibilityProof,
|
|
13
|
+
} from "./buildchain-compatibility-fact.js";
|
|
14
|
+
import {
|
|
15
|
+
KUNGFU_TEMPORAL_PATH_QUERY_SCHEMA,
|
|
16
|
+
verifyKungfuTemporalPath,
|
|
17
|
+
} from "./kungfu-temporal-fact.js";
|
|
18
|
+
|
|
19
|
+
const COMPATIBILITY_OPERATION = "accept-contract-lock";
|
|
20
|
+
const COMPATIBILITY_DIRECTION = "source-to-target";
|
|
21
|
+
|
|
22
|
+
function exactText(value, label) {
|
|
23
|
+
const normalized = text(value);
|
|
24
|
+
if (!normalized) throw new Error(`${label} must not be empty`);
|
|
25
|
+
return normalized;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function factInputFromProof(proof) {
|
|
29
|
+
return {
|
|
30
|
+
proofId: proof.proofId,
|
|
31
|
+
surfaceId: proof.source.surfaceId,
|
|
32
|
+
surfaceKind: proof.source.surfaceKind,
|
|
33
|
+
sourceBreakingDigest: proof.source.breakingDigest,
|
|
34
|
+
targetBreakingDigest: proof.target.breakingDigest,
|
|
35
|
+
scope: proof.scope,
|
|
36
|
+
evidence: proof.evidence,
|
|
37
|
+
authority: proof.authority,
|
|
38
|
+
cut: proof.cut,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function projectionForSurface({ proofs, factByProofRoot, surface }) {
|
|
43
|
+
const matching = proofs.filter(
|
|
44
|
+
(proof) =>
|
|
45
|
+
proof.target.surfaceId === surface.id &&
|
|
46
|
+
proof.target.surfaceKind === surface.kind &&
|
|
47
|
+
proof.target.breakingDigest === surface.breakingDigest &&
|
|
48
|
+
proof.operation === COMPATIBILITY_OPERATION,
|
|
49
|
+
);
|
|
50
|
+
const bySource = new Map();
|
|
51
|
+
for (const proof of matching) {
|
|
52
|
+
const sourceDigest = proof.source.breakingDigest;
|
|
53
|
+
if (bySource.has(sourceDigest))
|
|
54
|
+
throw new Error(
|
|
55
|
+
`ambiguous compatibility proof for ${surface.id} ${sourceDigest}`,
|
|
56
|
+
);
|
|
57
|
+
bySource.set(sourceDigest, proof);
|
|
58
|
+
}
|
|
59
|
+
return [...bySource.values()]
|
|
60
|
+
.sort((left, right) =>
|
|
61
|
+
left.source.breakingDigest.localeCompare(right.source.breakingDigest),
|
|
62
|
+
)
|
|
63
|
+
.map((proof) => ({
|
|
64
|
+
breakingDigest: proof.source.breakingDigest,
|
|
65
|
+
proofRoot: proof.proofRoot,
|
|
66
|
+
factRoot: factByProofRoot.get(proof.proofRoot)?.factRoot || "",
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function createBuildchainCompatibilityProofRegistry({
|
|
71
|
+
proofs = createHistoricalBuildchainCompatibilityProofs(),
|
|
72
|
+
surfaces = [],
|
|
73
|
+
majorLine = "",
|
|
74
|
+
} = {}) {
|
|
75
|
+
const verifiedProofs = proofs
|
|
76
|
+
.map((proof) => {
|
|
77
|
+
const verification = verifyBuildchainCompatibilityProof(proof);
|
|
78
|
+
if (!verification.ok)
|
|
79
|
+
throw new Error(
|
|
80
|
+
`invalid compatibility proof: ${verification.reason}${verification.error ? `: ${verification.error}` : ""}`,
|
|
81
|
+
);
|
|
82
|
+
return verification.proof;
|
|
83
|
+
})
|
|
84
|
+
.sort((left, right) => left.proofRoot.localeCompare(right.proofRoot));
|
|
85
|
+
const factRegistry = createBuildchainCompatibilityFactRegistry({
|
|
86
|
+
factInputs: verifiedProofs.map(factInputFromProof),
|
|
87
|
+
});
|
|
88
|
+
const factByProofRoot = new Map(
|
|
89
|
+
factRegistry.facts.map((fact) => [fact.proof.proofRoot, fact]),
|
|
90
|
+
);
|
|
91
|
+
const projections = Object.fromEntries(
|
|
92
|
+
[...surfaces]
|
|
93
|
+
.sort((left, right) => left.id.localeCompare(right.id))
|
|
94
|
+
.map((surface) => [
|
|
95
|
+
surface.id,
|
|
96
|
+
projectionForSurface({
|
|
97
|
+
proofs: verifiedProofs,
|
|
98
|
+
factByProofRoot,
|
|
99
|
+
surface,
|
|
100
|
+
}),
|
|
101
|
+
])
|
|
102
|
+
.filter(([, entries]) => entries.length > 0),
|
|
103
|
+
);
|
|
104
|
+
const identity = {
|
|
105
|
+
schema: BUILDCHAIN_COMPATIBILITY_PROOF_REGISTRY_SCHEMA,
|
|
106
|
+
proofRoots: verifiedProofs.map((proof) => proof.proofRoot),
|
|
107
|
+
};
|
|
108
|
+
return {
|
|
109
|
+
...identity,
|
|
110
|
+
proofs: verifiedProofs,
|
|
111
|
+
facts: factRegistry.facts,
|
|
112
|
+
factRegistry,
|
|
113
|
+
factRegistryRoot: factRegistry.registryRoot,
|
|
114
|
+
factCutRoot: factRegistry.currentCutRoot,
|
|
115
|
+
projections,
|
|
116
|
+
registryRoot: contentRoot(identity),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function assertBuildchainCompatibilityProjection(contractWorld) {
|
|
121
|
+
if (
|
|
122
|
+
!Array.isArray(contractWorld?.compatibilityFacts) ||
|
|
123
|
+
!Array.isArray(contractWorld?.compatibilityProofs)
|
|
124
|
+
) {
|
|
125
|
+
throw new Error(
|
|
126
|
+
"compatibility Facts and their proof projection are required",
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
const registry = createBuildchainCompatibilityProofRegistry({
|
|
130
|
+
proofs: contractWorld.compatibilityProofs,
|
|
131
|
+
surfaces: contractWorld.surfaces || [],
|
|
132
|
+
majorLine: contractWorld.majorLine,
|
|
133
|
+
});
|
|
134
|
+
if (contractWorld.compatibilityProofRegistryRoot !== registry.registryRoot) {
|
|
135
|
+
throw new Error("compatibility proof registry root mismatch");
|
|
136
|
+
}
|
|
137
|
+
if (
|
|
138
|
+
contractWorld.compatibilityFactRegistryRoot !== registry.factRegistryRoot
|
|
139
|
+
) {
|
|
140
|
+
throw new Error("compatibility Fact registry root mismatch");
|
|
141
|
+
}
|
|
142
|
+
if (contractWorld.compatibilityFactCutRoot !== registry.factCutRoot) {
|
|
143
|
+
throw new Error("compatibility Fact Cut root mismatch");
|
|
144
|
+
}
|
|
145
|
+
if (
|
|
146
|
+
JSON.stringify(contractWorld.compatibilityFacts) !==
|
|
147
|
+
JSON.stringify(registry.facts)
|
|
148
|
+
) {
|
|
149
|
+
throw new Error("compatibility Facts drift from the verified registry");
|
|
150
|
+
}
|
|
151
|
+
for (const surface of contractWorld.surfaces || []) {
|
|
152
|
+
const expected = registry.projections[surface.id] || [];
|
|
153
|
+
const expectedDigests = expected.map((entry) => entry.breakingDigest);
|
|
154
|
+
const expectedRoots = expected.map((entry) => entry.proofRoot);
|
|
155
|
+
const expectedFactRoots = expected.map((entry) => entry.factRoot);
|
|
156
|
+
const actualDigests = surface.compatibleBreakingDigests || [];
|
|
157
|
+
const actualRoots = surface.compatibilityProofRoots || [];
|
|
158
|
+
const actualFactRoots = surface.compatibilityFactRoots || [];
|
|
159
|
+
if (JSON.stringify(actualDigests) !== JSON.stringify(expectedDigests)) {
|
|
160
|
+
throw new Error(
|
|
161
|
+
`compatibleBreakingDigests projection mismatch for ${surface.id}`,
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
if (JSON.stringify(actualRoots) !== JSON.stringify(expectedRoots)) {
|
|
165
|
+
throw new Error(
|
|
166
|
+
`compatibilityProofRoots projection mismatch for ${surface.id}`,
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
if (JSON.stringify(actualFactRoots) !== JSON.stringify(expectedFactRoots)) {
|
|
170
|
+
throw new Error(
|
|
171
|
+
`compatibilityFactRoots projection mismatch for ${surface.id}`,
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
ok: true,
|
|
177
|
+
reason: "exact-Fact-backed-projection",
|
|
178
|
+
registryRoot: registry.registryRoot,
|
|
179
|
+
factRegistryRoot: registry.factRegistryRoot,
|
|
180
|
+
factCutRoot: registry.factCutRoot,
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function verifyBuildchainCompatibilityPath({ registry, query } = {}) {
|
|
185
|
+
if (!registry?.temporalBundle)
|
|
186
|
+
throw new Error("compatibility Fact registry is required");
|
|
187
|
+
return verifyKungfuTemporalPath(registry.temporalBundle, query);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export function createBuildchainCompatibilityPathQuery({
|
|
191
|
+
registry,
|
|
192
|
+
queryId,
|
|
193
|
+
sourceRoot,
|
|
194
|
+
targetRoot,
|
|
195
|
+
relationPathRoots,
|
|
196
|
+
maxDepth = 1,
|
|
197
|
+
} = {}) {
|
|
198
|
+
if (!registry?.temporalBundle || registry.predicateRoots?.length !== 1) {
|
|
199
|
+
throw new Error(
|
|
200
|
+
"one exact compatibility Fact registry predicate is required",
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
const predicateRoot = registry.predicateRoots[0];
|
|
204
|
+
const predicate = registry.temporalBundle.predicates.find(
|
|
205
|
+
(entry) => entry.root === predicateRoot,
|
|
206
|
+
)?.record;
|
|
207
|
+
return {
|
|
208
|
+
schema: KUNGFU_TEMPORAL_PATH_QUERY_SCHEMA,
|
|
209
|
+
queryId: exactText(queryId, "queryId"),
|
|
210
|
+
operation: COMPATIBILITY_OPERATION,
|
|
211
|
+
predicateRoot,
|
|
212
|
+
sourceRoot: exactRoot(sourceRoot, "sourceRoot"),
|
|
213
|
+
targetRoot: exactRoot(targetRoot, "targetRoot"),
|
|
214
|
+
cutRoot: exactRoot(registry.currentCutRoot, "currentCutRoot"),
|
|
215
|
+
relationPathRoots: (relationPathRoots || []).map((entry) =>
|
|
216
|
+
exactRoot(entry, "relationPathRoot"),
|
|
217
|
+
),
|
|
218
|
+
requiredAuthorityRoot: exactRoot(
|
|
219
|
+
predicate?.authorityRoot,
|
|
220
|
+
"requiredAuthorityRoot",
|
|
221
|
+
),
|
|
222
|
+
maxDepth,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export function resolveBuildchainCompatibilityProof({
|
|
227
|
+
registry,
|
|
228
|
+
surface,
|
|
229
|
+
sourceBreakingDigest,
|
|
230
|
+
majorLine,
|
|
231
|
+
} = {}) {
|
|
232
|
+
const candidates = (registry?.proofs || []).filter(
|
|
233
|
+
(proof) =>
|
|
234
|
+
proof.source.surfaceId === surface.id &&
|
|
235
|
+
proof.source.surfaceKind === surface.kind &&
|
|
236
|
+
proof.source.breakingDigest === sourceBreakingDigest &&
|
|
237
|
+
proof.target.breakingDigest === surface.breakingDigest &&
|
|
238
|
+
proof.operation === COMPATIBILITY_OPERATION,
|
|
239
|
+
);
|
|
240
|
+
if (candidates.length === 0)
|
|
241
|
+
return { ok: false, reason: "compatibility-proof-missing" };
|
|
242
|
+
if (candidates.length > 1)
|
|
243
|
+
return { ok: false, reason: "ambiguous-compatibility-proof" };
|
|
244
|
+
const verification = verifyBuildchainCompatibilityProof(candidates[0]);
|
|
245
|
+
if (!verification.ok) return verification;
|
|
246
|
+
const projection = registry.projections?.[surface.id] || [];
|
|
247
|
+
if (
|
|
248
|
+
!projection.some(
|
|
249
|
+
(entry) =>
|
|
250
|
+
entry.breakingDigest === sourceBreakingDigest &&
|
|
251
|
+
entry.proofRoot === verification.proofRoot,
|
|
252
|
+
)
|
|
253
|
+
) {
|
|
254
|
+
return { ok: false, reason: "compatibility-proof-projection-missing" };
|
|
255
|
+
}
|
|
256
|
+
const fact = registry.factRegistry?.facts.find(
|
|
257
|
+
(entry) => entry.proof.proofRoot === verification.proofRoot,
|
|
258
|
+
);
|
|
259
|
+
if (!fact) return { ok: false, reason: "compatibility-fact-missing" };
|
|
260
|
+
const query = createBuildchainCompatibilityPathQuery({
|
|
261
|
+
registry: registry.factRegistry,
|
|
262
|
+
queryId: `buildchain:compatibility:${surface.id}:${sourceBreakingDigest}:${surface.breakingDigest}`,
|
|
263
|
+
sourceRoot: fact.sourceRoot,
|
|
264
|
+
targetRoot: fact.targetRoot,
|
|
265
|
+
relationPathRoots: [fact.factRoot],
|
|
266
|
+
maxDepth: 1,
|
|
267
|
+
});
|
|
268
|
+
const pathReceipt = verifyBuildchainCompatibilityPath({
|
|
269
|
+
registry: registry.factRegistry,
|
|
270
|
+
query,
|
|
271
|
+
});
|
|
272
|
+
if (pathReceipt.record.status !== "accepted") {
|
|
273
|
+
return {
|
|
274
|
+
ok: false,
|
|
275
|
+
reason: pathReceipt.record.failureCode,
|
|
276
|
+
pathReceipt,
|
|
277
|
+
pathReceiptRoot: pathReceipt.root,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
return {
|
|
281
|
+
ok: true,
|
|
282
|
+
reason: "Fact-backed-compatible-relation",
|
|
283
|
+
proof: verification.proof,
|
|
284
|
+
proofRoot: verification.proofRoot,
|
|
285
|
+
fact,
|
|
286
|
+
factRoot: fact.factRoot,
|
|
287
|
+
pathReceipt,
|
|
288
|
+
pathReceiptRoot: pathReceipt.root,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export function createBuildchainCompatibilityReleaseEvidence({
|
|
293
|
+
contractWorld,
|
|
294
|
+
release,
|
|
295
|
+
decisions = [],
|
|
296
|
+
} = {}) {
|
|
297
|
+
const projection = assertBuildchainCompatibilityProjection(contractWorld);
|
|
298
|
+
const normalizedRelease = {
|
|
299
|
+
sourceSha: exactSha(release?.sourceSha, "release.sourceSha"),
|
|
300
|
+
tag: exactText(release?.tag, "release.tag"),
|
|
301
|
+
channel: exactText(release?.channel, "release.channel"),
|
|
302
|
+
};
|
|
303
|
+
const rootSet = (field) =>
|
|
304
|
+
[...new Set(decisions.map((entry) => entry[field]).filter(Boolean))]
|
|
305
|
+
.map((entry) => exactRoot(entry, field))
|
|
306
|
+
.sort();
|
|
307
|
+
const compatibility = {
|
|
308
|
+
operation: COMPATIBILITY_OPERATION,
|
|
309
|
+
direction: COMPATIBILITY_DIRECTION,
|
|
310
|
+
authority: "Fact-registry-only",
|
|
311
|
+
grantsReleaseAuthority: false,
|
|
312
|
+
contractDigest: exactRoot(
|
|
313
|
+
contractWorld.contractDigest,
|
|
314
|
+
"contractWorld.contractDigest",
|
|
315
|
+
),
|
|
316
|
+
compatibilityDigest: exactRoot(
|
|
317
|
+
contractWorld.compatibilityDigest,
|
|
318
|
+
"contractWorld.compatibilityDigest",
|
|
319
|
+
),
|
|
320
|
+
factRegistryRoot: projection.factRegistryRoot,
|
|
321
|
+
factCutRoot: projection.factCutRoot,
|
|
322
|
+
proofRegistryRoot: projection.registryRoot,
|
|
323
|
+
usedFactRoots: rootSet("factRoot"),
|
|
324
|
+
usedProofRoots: rootSet("proofRoot"),
|
|
325
|
+
pathReceiptRoots: rootSet("pathReceiptRoot"),
|
|
326
|
+
};
|
|
327
|
+
const body = {
|
|
328
|
+
schemaVersion: 1,
|
|
329
|
+
contract: BUILDCHAIN_COMPATIBILITY_RELEASE_EVIDENCE_SCHEMA,
|
|
330
|
+
id: "buildchain-compatibility-facts",
|
|
331
|
+
kind: "compatibility-fact-lineage",
|
|
332
|
+
release: normalizedRelease,
|
|
333
|
+
compatibility,
|
|
334
|
+
};
|
|
335
|
+
return { ...body, evidenceRoot: contentRoot(body) };
|
|
336
|
+
}
|