@kungfu-tech/buildchain 2.8.2-alpha.0 → 2.8.2-alpha.1

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.
@@ -4,7 +4,7 @@
4
4
  "product": {
5
5
  "name": "Buildchain",
6
6
  "package": "@kungfu-tech/buildchain",
7
- "version": "2.8.2-alpha.0",
7
+ "version": "2.8.2-alpha.1",
8
8
  "repository": "https://github.com/kungfu-systems/buildchain"
9
9
  },
10
10
  "majorLine": "v2",
@@ -185,7 +185,7 @@
185
185
  "release-state SHA is recorded as a durable audit entrance"
186
186
  ],
187
187
  "breakingDigest": "sha256:b627e1b2ece9b6049517a942c5139e342e6077cdd3d8962d61cef8481b1f70ad",
188
- "auditDigest": "sha256:9668f3e01cfe8ce5b94ebdda24aeeaddbd609d8f4cc7cca33d82cbc59aae66f5"
188
+ "auditDigest": "sha256:22017d4cbe0d89aecfcada7b93f5cdf2935837b2236ae4aeff23f19dbf3d26cb"
189
189
  },
190
190
  {
191
191
  "contractVersion": 1,
@@ -234,7 +234,7 @@
234
234
  "prose-only public claims downgrade the release trust passport audit"
235
235
  ],
236
236
  "breakingDigest": "sha256:f0b636eb925ddbf45ff1a8872454ab7b4dd98857cac12bb75217830130e62a16",
237
- "auditDigest": "sha256:9668f3e01cfe8ce5b94ebdda24aeeaddbd609d8f4cc7cca33d82cbc59aae66f5"
237
+ "auditDigest": "sha256:22017d4cbe0d89aecfcada7b93f5cdf2935837b2236ae4aeff23f19dbf3d26cb"
238
238
  },
239
239
  {
240
240
  "contractVersion": 1,
@@ -294,5 +294,5 @@
294
294
  }
295
295
  ],
296
296
  "compatibilityDigest": "sha256:ca668f3f73ab0d84db0d489efccf6cd556704b069990a37a0c6c77a6519f754b",
297
- "contractDigest": "sha256:1ac1817722fee5509f584cdd02e1553c4162ddd2c89b49465144e5a436344fb3"
297
+ "contractDigest": "sha256:315ea2dcc1d77b75b04475cfef85c627b31186edca1e4ddb929bb758c9de9576"
298
298
  }
@@ -249,9 +249,11 @@ The generated release passport records the result under the KFD-provided
249
249
  top-level key currently named `kfd-3`. The section includes the KFD package
250
250
  version, schema ids/paths, pre-build witness digest, artifact witness digest,
251
251
  declared/exposed surface counts, missing declared shipped surfaces, and
252
- unclassified artifact public surfaces. It also records the KFD-2 trust proof
253
- view of that evidence: `releaseStatus`, witness file hashes and canonical
254
- hashes, declared capability verification, reverse audit boundary, residual
252
+ unclassified artifact public surfaces. Buildchain also projects the same
253
+ collaboration-interface evidence into the top-level `kfd-2` audit as a
254
+ machine-readable `trustProof` object on the generated `kfd-3:*` public claim.
255
+ That proof carries `releaseStatus`, witness file hashes and canonical hashes,
256
+ declared capability verification, reverse audit result and boundary, residual
255
257
  risk, and responsibility state.
256
258
 
257
259
  The trust proof makes the strongest claim only when the witnesses justify it:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungfu-tech/buildchain",
3
- "version": "2.8.2-alpha.0",
3
+ "version": "2.8.2-alpha.1",
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",
@@ -142,6 +142,7 @@ export {
142
142
  ARTIFACT_EVIDENCE_CONTRACT,
143
143
  IMPACT_LEDGER_CONTRACT,
144
144
  KFD2_RELEASE_TRUST_PASSPORT_CONTRACT,
145
+ KFD2_TRUST_PROOF_CONTRACT,
145
146
  PRODUCT_MECHANISM_CONTRACT,
146
147
  RELEASE_CHECK_REPORT_CONTRACT,
147
148
  RELEASE_PASSPORT_CONTRACT,
@@ -21,6 +21,7 @@ export const AGENT_INDEX_CONTRACT = "kungfu-buildchain-agent-index";
21
21
  export const PRODUCT_MECHANISM_CONTRACT = "kungfu-buildchain-product-mechanism";
22
22
  export const RELEASE_CHECK_REPORT_CONTRACT = "kungfu-buildchain-release-check-report";
23
23
  export const KFD2_RELEASE_TRUST_PASSPORT_CONTRACT = "kungfu-buildchain-kfd-2-release-trust-passport-audit";
24
+ export const KFD2_TRUST_PROOF_CONTRACT = "kungfu-buildchain-kfd-2-trust-proof";
24
25
 
25
26
  const CONTRACTS = new Set([
26
27
  RELEASE_PASSPORT_CONTRACT,
@@ -571,6 +572,9 @@ function normalizeKfd2Claim(raw = {}, index = 0) {
571
572
  : {};
572
573
  const responsibility = claim.responsibility && typeof claim.responsibility === "object" && !Array.isArray(claim.responsibility) ? claim.responsibility : {};
573
574
  const residualRisk = arrayOrEmpty(claim.residualRisk || claim.residual_risk);
575
+ const trustProof = claim.trustProof && typeof claim.trustProof === "object" && !Array.isArray(claim.trustProof)
576
+ ? claim.trustProof
577
+ : undefined;
574
578
  const missingBindings = [];
575
579
  if (sourceBindings.length === 0) missingBindings.push("declared-sources");
576
580
  if (machineEvidence.length === 0) missingBindings.push("machine-readable-evidence");
@@ -597,6 +601,7 @@ function normalizeKfd2Claim(raw = {}, index = 0) {
597
601
  auditBoundary,
598
602
  responsibility,
599
603
  residualRisk,
604
+ ...(trustProof ? { trustProof } : {}),
600
605
  proseOnly,
601
606
  missingBindings,
602
607
  status,
@@ -642,6 +647,17 @@ function kfd2ClaimFromKfd1World(world = {}, index = 0) {
642
647
  }
643
648
 
644
649
  function kfd2ClaimFromKfd3Interface(entry = {}, index = 0) {
650
+ const witnessHashes = {
651
+ prebuildWitnessSha256: entry.preBuildWitnessSha256,
652
+ artifactWitnessSha256: entry.artifactWitnessSha256,
653
+ prebuildCanonicalSha256: entry.witnessEvidence?.prebuild?.canonicalSha256 || "",
654
+ artifactCanonicalSha256: entry.witnessEvidence?.artifact?.canonicalSha256 || "",
655
+ };
656
+ const reverseAuditBoundary = entry.reverseAudit?.auditBoundary || entry.auditBoundary;
657
+ const residualRisk = arrayOrEmpty(entry.residualRisk);
658
+ const proofResult = entry.trustProof?.result === "pass"
659
+ ? (residualRisk.length > 0 ? "downgraded" : "passed")
660
+ : "failed";
645
661
  return normalizeKfd2Claim({
646
662
  id: `kfd-3:${entry.id || index + 1}`,
647
663
  public: true,
@@ -658,10 +674,7 @@ function kfd2ClaimFromKfd3Interface(entry = {}, index = 0) {
658
674
  { id: "reverse-audit", result: entry.reverseAudit?.status || "" },
659
675
  ],
660
676
  hashes: {
661
- prebuildWitnessSha256: entry.preBuildWitnessSha256,
662
- artifactWitnessSha256: entry.artifactWitnessSha256,
663
- prebuildCanonicalSha256: entry.witnessEvidence?.prebuild?.canonicalSha256 || "",
664
- artifactCanonicalSha256: entry.witnessEvidence?.artifact?.canonicalSha256 || "",
677
+ ...witnessHashes,
665
678
  },
666
679
  artifacts: entry.artifactWitness?.artifact?.name || entry.artifactWitness?.artifact?.path
667
680
  ? [entry.artifactWitness.artifact]
@@ -673,10 +686,25 @@ function kfd2ClaimFromKfd3Interface(entry = {}, index = 0) {
673
686
  },
674
687
  auditBoundary: entry.auditBoundary,
675
688
  responsibility: entry.responsibility,
676
- residualRisk: entry.residualRisk,
677
- status: entry.trustProof?.result === "pass"
678
- ? (arrayOrEmpty(entry.residualRisk).length > 0 ? "downgraded" : "passed")
679
- : "failed",
689
+ residualRisk,
690
+ trustProof: {
691
+ contract: KFD2_TRUST_PROOF_CONTRACT,
692
+ source: "kfd-3-collaboration-interface-release-gate",
693
+ result: proofResult,
694
+ statement: entry.trustProof?.statement || "",
695
+ kfd3TrustProof: {
696
+ contract: entry.trustProof?.contract || "",
697
+ result: entry.trustProof?.result || "",
698
+ releaseStatus: entry.trustProof?.releaseStatus || entry.releaseStatus || "",
699
+ },
700
+ witnessHashes,
701
+ declaredCapabilityVerification: entry.declaredCapabilityVerification,
702
+ reverseAudit: entry.reverseAudit,
703
+ reverseAuditBoundary,
704
+ residualRisk,
705
+ responsibility: entry.responsibility,
706
+ },
707
+ status: proofResult,
680
708
  }, index);
681
709
  }
682
710
 
@@ -1220,6 +1248,48 @@ function validateKfd2ReleaseTrustPassportAudit(section, issues) {
1220
1248
  proseOnly: Boolean(claim.proseOnly),
1221
1249
  }));
1222
1250
  }
1251
+ if (String(claim.id || "").startsWith("kfd-3:")) {
1252
+ const trustProof = claim.trustProof && typeof claim.trustProof === "object" && !Array.isArray(claim.trustProof)
1253
+ ? claim.trustProof
1254
+ : undefined;
1255
+ if (!trustProof || trustProof.contract !== KFD2_TRUST_PROOF_CONTRACT) {
1256
+ issues.push(issue("error", `kfd-2.claims[${index}].trustProof`, "KFD-3 generated public claims must include a KFD-2 trust proof", {
1257
+ id: claim.id || "",
1258
+ expectedContract: KFD2_TRUST_PROOF_CONTRACT,
1259
+ }));
1260
+ } else {
1261
+ if (!trustProof.witnessHashes?.prebuildWitnessSha256 || !trustProof.witnessHashes?.artifactWitnessSha256) {
1262
+ issues.push(issue("error", `kfd-2.claims[${index}].trustProof.witnessHashes`, "KFD-2 trust proof must preserve KFD-3 witness hashes", {
1263
+ id: claim.id || "",
1264
+ }));
1265
+ }
1266
+ if (!trustProof.declaredCapabilityVerification?.result) {
1267
+ issues.push(issue("error", `kfd-2.claims[${index}].trustProof.declaredCapabilityVerification`, "KFD-2 trust proof must preserve declared capability verification", {
1268
+ id: claim.id || "",
1269
+ }));
1270
+ }
1271
+ if (!trustProof.reverseAudit?.status) {
1272
+ issues.push(issue("error", `kfd-2.claims[${index}].trustProof.reverseAudit`, "KFD-2 trust proof must preserve reverse audit result", {
1273
+ id: claim.id || "",
1274
+ }));
1275
+ }
1276
+ if (!trustProof.reverseAuditBoundary || typeof trustProof.reverseAuditBoundary !== "object" || Array.isArray(trustProof.reverseAuditBoundary)) {
1277
+ issues.push(issue("error", `kfd-2.claims[${index}].trustProof.reverseAuditBoundary`, "KFD-2 trust proof must preserve the reverse audit boundary", {
1278
+ id: claim.id || "",
1279
+ }));
1280
+ }
1281
+ if (!Array.isArray(trustProof.residualRisk)) {
1282
+ issues.push(issue("error", `kfd-2.claims[${index}].trustProof.residualRisk`, "KFD-2 trust proof must preserve residual risk as an array", {
1283
+ id: claim.id || "",
1284
+ }));
1285
+ }
1286
+ if (!trustProof.responsibility?.registryFactsOwner || !trustProof.responsibility?.artifactVerificationOwner || !trustProof.responsibility?.releasePassportProofOwner) {
1287
+ issues.push(issue("error", `kfd-2.claims[${index}].trustProof.responsibility`, "KFD-2 trust proof must preserve KFD-3 responsibility state", {
1288
+ id: claim.id || "",
1289
+ }));
1290
+ }
1291
+ }
1292
+ }
1223
1293
  }
1224
1294
  if (section.status === "failed") {
1225
1295
  issues.push(issue("error", "kfd-2.status", "kfd-2 release trust passport audit must not contain failed public claims"));
@@ -150,6 +150,9 @@ if (!coreIndexSource.includes("createBuildchainContractWorld")) {
150
150
  if (!coreIndexSource.includes("KFD2_RELEASE_TRUST_PASSPORT_CONTRACT")) {
151
151
  throw new Error("packages/core/index.js must export KFD-2 release trust passport contract");
152
152
  }
153
+ if (!coreIndexSource.includes("KFD2_TRUST_PROOF_CONTRACT")) {
154
+ throw new Error("packages/core/index.js must export KFD-2 trust proof contract");
155
+ }
153
156
  for (const requiredSnippet of [
154
157
  "createKfd1ReleaseGateEvidence",
155
158
  "resolveKfd1Metadata",