@agent-teams/docs-protocol-agent-teams 0.0.0 → 0.1.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.
Files changed (195) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +27 -2
  3. package/assets/catalog.json +1 -1
  4. package/assets/history/sha256-8711dbd6109740857c69462d218071818317a62949f08ecf8abdc6d6b736321f/caller.yml +14 -0
  5. package/assets/history/sha256-f8da49344c3b0e9f31235de2826b1b9b392afb84515ace6af4fb5fe580e3a714/caller.yml +14 -0
  6. package/assets/transition-catalog.json +1 -1
  7. package/dist/composition/qualification-cli.d.ts.map +1 -1
  8. package/dist/composition/qualification-cli.js +19 -3
  9. package/dist/composition/qualification-cli.js.map +1 -1
  10. package/dist/consumer-integration/adapters/cohort-v2-authority-validator.d.ts +5 -0
  11. package/dist/consumer-integration/adapters/cohort-v2-authority-validator.d.ts.map +1 -0
  12. package/dist/consumer-integration/adapters/cohort-v2-authority-validator.js +361 -0
  13. package/dist/consumer-integration/adapters/cohort-v2-authority-validator.js.map +1 -0
  14. package/dist/consumer-integration/adapters/consumer-integration-schema-validator.d.ts +1 -0
  15. package/dist/consumer-integration/adapters/consumer-integration-schema-validator.d.ts.map +1 -1
  16. package/dist/consumer-integration/adapters/consumer-integration-schema-validator.js +22 -4
  17. package/dist/consumer-integration/adapters/consumer-integration-schema-validator.js.map +1 -1
  18. package/dist/consumer-integration/adapters/consumer-upgrade-file-projectors.d.ts +40 -1
  19. package/dist/consumer-integration/adapters/consumer-upgrade-file-projectors.d.ts.map +1 -1
  20. package/dist/consumer-integration/adapters/consumer-upgrade-file-projectors.js +227 -0
  21. package/dist/consumer-integration/adapters/consumer-upgrade-file-projectors.js.map +1 -1
  22. package/dist/consumer-integration/adapters/github-cohort-authority-reader.d.ts +17 -5
  23. package/dist/consumer-integration/adapters/github-cohort-authority-reader.d.ts.map +1 -1
  24. package/dist/consumer-integration/adapters/github-cohort-authority-reader.js +123 -16
  25. package/dist/consumer-integration/adapters/github-cohort-authority-reader.js.map +1 -1
  26. package/dist/consumer-integration/adapters/node-consumer-integration-repository.d.ts +2 -1
  27. package/dist/consumer-integration/adapters/node-consumer-integration-repository.d.ts.map +1 -1
  28. package/dist/consumer-integration/adapters/node-consumer-integration-repository.js +55 -16
  29. package/dist/consumer-integration/adapters/node-consumer-integration-repository.js.map +1 -1
  30. package/dist/consumer-integration/adapters/node-consumer-restoration-evidence.d.ts +38 -0
  31. package/dist/consumer-integration/adapters/node-consumer-restoration-evidence.d.ts.map +1 -0
  32. package/dist/consumer-integration/adapters/node-consumer-restoration-evidence.js +177 -0
  33. package/dist/consumer-integration/adapters/node-consumer-restoration-evidence.js.map +1 -0
  34. package/dist/consumer-integration/adapters/node-consumer-restoration-finalization.d.ts +10 -0
  35. package/dist/consumer-integration/adapters/node-consumer-restoration-finalization.d.ts.map +1 -0
  36. package/dist/consumer-integration/adapters/node-consumer-restoration-finalization.js +95 -0
  37. package/dist/consumer-integration/adapters/node-consumer-restoration-finalization.js.map +1 -0
  38. package/dist/consumer-integration/adapters/node-consumer-restoration-lock.d.ts +3 -0
  39. package/dist/consumer-integration/adapters/node-consumer-restoration-lock.d.ts.map +1 -0
  40. package/dist/consumer-integration/adapters/node-consumer-restoration-lock.js +104 -0
  41. package/dist/consumer-integration/adapters/node-consumer-restoration-lock.js.map +1 -0
  42. package/dist/consumer-integration/adapters/node-consumer-restoration-scope.d.ts +9 -0
  43. package/dist/consumer-integration/adapters/node-consumer-restoration-scope.d.ts.map +1 -0
  44. package/dist/consumer-integration/adapters/node-consumer-restoration-scope.js +71 -0
  45. package/dist/consumer-integration/adapters/node-consumer-restoration-scope.js.map +1 -0
  46. package/dist/consumer-integration/adapters/node-consumer-restoration-selection.d.ts +9 -0
  47. package/dist/consumer-integration/adapters/node-consumer-restoration-selection.d.ts.map +1 -0
  48. package/dist/consumer-integration/adapters/node-consumer-restoration-selection.js +35 -0
  49. package/dist/consumer-integration/adapters/node-consumer-restoration-selection.js.map +1 -0
  50. package/dist/consumer-integration/adapters/node-consumer-restoration.d.ts +12 -0
  51. package/dist/consumer-integration/adapters/node-consumer-restoration.d.ts.map +1 -0
  52. package/dist/consumer-integration/adapters/node-consumer-restoration.js +102 -0
  53. package/dist/consumer-integration/adapters/node-consumer-restoration.js.map +1 -0
  54. package/dist/consumer-integration/adapters/node-consumer-upgrade-sandbox.d.ts +33 -5
  55. package/dist/consumer-integration/adapters/node-consumer-upgrade-sandbox.d.ts.map +1 -1
  56. package/dist/consumer-integration/adapters/node-consumer-upgrade-sandbox.js +111 -106
  57. package/dist/consumer-integration/adapters/node-consumer-upgrade-sandbox.js.map +1 -1
  58. package/dist/consumer-integration/adapters/node-consumer-upgrade-source-proof.d.ts +20 -0
  59. package/dist/consumer-integration/adapters/node-consumer-upgrade-source-proof.d.ts.map +1 -0
  60. package/dist/consumer-integration/adapters/node-consumer-upgrade-source-proof.js +89 -0
  61. package/dist/consumer-integration/adapters/node-consumer-upgrade-source-proof.js.map +1 -0
  62. package/dist/consumer-integration/adapters/node-consumer-upgrade-target.d.ts +11 -0
  63. package/dist/consumer-integration/adapters/node-consumer-upgrade-target.d.ts.map +1 -0
  64. package/dist/consumer-integration/adapters/node-consumer-upgrade-target.js +60 -0
  65. package/dist/consumer-integration/adapters/node-consumer-upgrade-target.js.map +1 -0
  66. package/dist/consumer-integration/adapters/pnpm-lockfile-policy-v1.d.ts +1 -1
  67. package/dist/consumer-integration/adapters/pnpm-lockfile-policy-v1.d.ts.map +1 -1
  68. package/dist/consumer-integration/adapters/pnpm-lockfile-policy-v1.js +2 -3
  69. package/dist/consumer-integration/adapters/pnpm-lockfile-policy-v1.js.map +1 -1
  70. package/dist/consumer-integration/adapters/pnpm-lockfile-validator-v1.d.ts +19 -0
  71. package/dist/consumer-integration/adapters/pnpm-lockfile-validator-v1.d.ts.map +1 -1
  72. package/dist/consumer-integration/adapters/pnpm-lockfile-validator-v1.js +184 -44
  73. package/dist/consumer-integration/adapters/pnpm-lockfile-validator-v1.js.map +1 -1
  74. package/dist/consumer-integration/adapters/pnpm-lockfile-validator-v2.d.ts +4 -0
  75. package/dist/consumer-integration/adapters/pnpm-lockfile-validator-v2.d.ts.map +1 -0
  76. package/dist/consumer-integration/adapters/pnpm-lockfile-validator-v2.js +64 -0
  77. package/dist/consumer-integration/adapters/pnpm-lockfile-validator-v2.js.map +1 -0
  78. package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.d.ts +19 -2
  79. package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.d.ts.map +1 -1
  80. package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.js +65 -18
  81. package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v1.js.map +1 -1
  82. package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v2.d.ts +13 -0
  83. package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v2.d.ts.map +1 -0
  84. package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v2.js +37 -0
  85. package/dist/consumer-integration/adapters/pnpm-manifest-adapter-v2.js.map +1 -0
  86. package/dist/consumer-integration/adapters/pnpm-runtime-closure-v1.d.ts +7 -0
  87. package/dist/consumer-integration/adapters/pnpm-runtime-closure-v1.d.ts.map +1 -1
  88. package/dist/consumer-integration/adapters/pnpm-runtime-closure-v1.js +12 -3
  89. package/dist/consumer-integration/adapters/pnpm-runtime-closure-v1.js.map +1 -1
  90. package/dist/consumer-integration/adapters/pnpm-runtime-closure-v2.d.ts +3 -0
  91. package/dist/consumer-integration/adapters/pnpm-runtime-closure-v2.d.ts.map +1 -0
  92. package/dist/consumer-integration/adapters/pnpm-runtime-closure-v2.js +11 -0
  93. package/dist/consumer-integration/adapters/pnpm-runtime-closure-v2.js.map +1 -0
  94. package/dist/consumer-integration/application/model/consumer-restoration.d.ts +76 -0
  95. package/dist/consumer-integration/application/model/consumer-restoration.d.ts.map +1 -0
  96. package/dist/consumer-integration/application/model/consumer-restoration.js +2 -0
  97. package/dist/consumer-integration/application/model/consumer-restoration.js.map +1 -0
  98. package/dist/consumer-integration/application/policies/consumer-integration-assets.d.ts +19 -3
  99. package/dist/consumer-integration/application/policies/consumer-integration-assets.d.ts.map +1 -1
  100. package/dist/consumer-integration/application/policies/consumer-integration-assets.js +38 -4
  101. package/dist/consumer-integration/application/policies/consumer-integration-assets.js.map +1 -1
  102. package/dist/consumer-integration/application/policies/consumer-integration-desired-state.d.ts +3 -1
  103. package/dist/consumer-integration/application/policies/consumer-integration-desired-state.d.ts.map +1 -1
  104. package/dist/consumer-integration/application/policies/consumer-integration-desired-state.js +87 -0
  105. package/dist/consumer-integration/application/policies/consumer-integration-desired-state.js.map +1 -1
  106. package/dist/consumer-integration/application/policies/consumer-restoration-proof.d.ts +12 -0
  107. package/dist/consumer-integration/application/policies/consumer-restoration-proof.d.ts.map +1 -0
  108. package/dist/consumer-integration/application/policies/consumer-restoration-proof.js +123 -0
  109. package/dist/consumer-integration/application/policies/consumer-restoration-proof.js.map +1 -0
  110. package/dist/consumer-integration/application/policies/qualified-docs-cohort-v2.d.ts +13 -0
  111. package/dist/consumer-integration/application/policies/qualified-docs-cohort-v2.d.ts.map +1 -0
  112. package/dist/consumer-integration/application/policies/qualified-docs-cohort-v2.js +38 -0
  113. package/dist/consumer-integration/application/policies/qualified-docs-cohort-v2.js.map +1 -0
  114. package/dist/consumer-integration/application/ports/consumer-integration-lifecycle.d.ts +3 -2
  115. package/dist/consumer-integration/application/ports/consumer-integration-lifecycle.d.ts.map +1 -1
  116. package/dist/consumer-integration/application/ports/consumer-integration-planners.d.ts +4 -4
  117. package/dist/consumer-integration/application/ports/consumer-integration-planners.d.ts.map +1 -1
  118. package/dist/consumer-integration/application/ports/consumer-restoration.d.ts +24 -0
  119. package/dist/consumer-integration/application/ports/consumer-restoration.d.ts.map +1 -0
  120. package/dist/consumer-integration/application/ports/consumer-restoration.js +2 -0
  121. package/dist/consumer-integration/application/ports/consumer-restoration.js.map +1 -0
  122. package/dist/consumer-integration/application/ports/consumer-upgrade.d.ts +44 -6
  123. package/dist/consumer-integration/application/ports/consumer-upgrade.d.ts.map +1 -1
  124. package/dist/consumer-integration/application/use-cases/compile-consumer-integration-v3.d.ts +39 -0
  125. package/dist/consumer-integration/application/use-cases/compile-consumer-integration-v3.d.ts.map +1 -0
  126. package/dist/consumer-integration/application/use-cases/compile-consumer-integration-v3.js +284 -0
  127. package/dist/consumer-integration/application/use-cases/compile-consumer-integration-v3.js.map +1 -0
  128. package/dist/consumer-integration/application/use-cases/plan-consumer-integration.d.ts +2 -2
  129. package/dist/consumer-integration/application/use-cases/plan-consumer-integration.d.ts.map +1 -1
  130. package/dist/consumer-integration/application/use-cases/plan-consumer-integration.js +23 -153
  131. package/dist/consumer-integration/application/use-cases/plan-consumer-integration.js.map +1 -1
  132. package/dist/consumer-integration/application/use-cases/run-consumer-integration.d.ts.map +1 -1
  133. package/dist/consumer-integration/application/use-cases/run-consumer-integration.js +10 -6
  134. package/dist/consumer-integration/application/use-cases/run-consumer-integration.js.map +1 -1
  135. package/dist/consumer-integration/application/use-cases/upgrade-consumer-integration.d.ts +11 -3
  136. package/dist/consumer-integration/application/use-cases/upgrade-consumer-integration.d.ts.map +1 -1
  137. package/dist/consumer-integration/application/use-cases/upgrade-consumer-integration.js +188 -39
  138. package/dist/consumer-integration/application/use-cases/upgrade-consumer-integration.js.map +1 -1
  139. package/dist/consumer-integration/composition/consumer-integration-cli.d.ts.map +1 -1
  140. package/dist/consumer-integration/composition/consumer-integration-cli.js +85 -15
  141. package/dist/consumer-integration/composition/consumer-integration-cli.js.map +1 -1
  142. package/dist/consumer-integration/composition/consumer-integration-planner.d.ts +6 -2
  143. package/dist/consumer-integration/composition/consumer-integration-planner.d.ts.map +1 -1
  144. package/dist/consumer-integration/composition/consumer-integration-planner.js +40 -3
  145. package/dist/consumer-integration/composition/consumer-integration-planner.js.map +1 -1
  146. package/dist/consumer-integration/composition/node-consumer-integration.d.ts +12 -0
  147. package/dist/consumer-integration/composition/node-consumer-integration.d.ts.map +1 -1
  148. package/dist/consumer-integration/composition/node-consumer-integration.js +17 -1
  149. package/dist/consumer-integration/composition/node-consumer-integration.js.map +1 -1
  150. package/dist/consumer-integration/composition/qualification-v3-boundary.d.ts +20 -0
  151. package/dist/consumer-integration/composition/qualification-v3-boundary.d.ts.map +1 -0
  152. package/dist/consumer-integration/composition/qualification-v3-boundary.js +29 -0
  153. package/dist/consumer-integration/composition/qualification-v3-boundary.js.map +1 -0
  154. package/dist/consumer-integration/domain/model.d.ts +61 -0
  155. package/dist/consumer-integration/domain/model.d.ts.map +1 -1
  156. package/dist/consumer-integration/generated/canonical-assets.d.ts +3 -2
  157. package/dist/consumer-integration/generated/canonical-assets.d.ts.map +1 -1
  158. package/dist/consumer-integration/generated/canonical-assets.js +3 -2
  159. package/dist/consumer-integration/generated/canonical-assets.js.map +1 -1
  160. package/dist/consumer-integration/index.d.ts +3 -1
  161. package/dist/consumer-integration/index.d.ts.map +1 -1
  162. package/dist/consumer-integration/index.js +1 -0
  163. package/dist/consumer-integration/index.js.map +1 -1
  164. package/dist/index.d.ts +2 -1
  165. package/dist/index.d.ts.map +1 -1
  166. package/dist/index.js +1 -1
  167. package/dist/index.js.map +1 -1
  168. package/dist/qualification/index.d.ts +6 -0
  169. package/dist/qualification/index.d.ts.map +1 -1
  170. package/dist/qualification/index.js +3 -0
  171. package/dist/qualification/index.js.map +1 -1
  172. package/dist/qualification/qualification-v3-authority.d.ts +14 -0
  173. package/dist/qualification/qualification-v3-authority.d.ts.map +1 -0
  174. package/dist/qualification/qualification-v3-authority.js +5 -0
  175. package/dist/qualification/qualification-v3-authority.js.map +1 -0
  176. package/dist/qualification/qualification-v3-observer.d.ts +7 -0
  177. package/dist/qualification/qualification-v3-observer.d.ts.map +1 -0
  178. package/dist/qualification/qualification-v3-observer.js +22 -0
  179. package/dist/qualification/qualification-v3-observer.js.map +1 -0
  180. package/dist/qualification/qualification-v3-runner.d.ts +7 -0
  181. package/dist/qualification/qualification-v3-runner.d.ts.map +1 -0
  182. package/dist/qualification/qualification-v3-runner.js +95 -0
  183. package/dist/qualification/qualification-v3-runner.js.map +1 -0
  184. package/dist/qualification/v3-contract.d.ts +58 -0
  185. package/dist/qualification/v3-contract.d.ts.map +1 -0
  186. package/dist/qualification/v3-contract.js +2 -0
  187. package/dist/qualification/v3-contract.js.map +1 -0
  188. package/package.json +3 -3
  189. package/schemas/docs-consumer-integration-profile/v3.schema.json +68 -0
  190. package/schemas/docs-consumer-managed-state/v2.schema.json +120 -0
  191. package/schemas/docs-consumer-restoration-execution/v1.schema.json +124 -0
  192. package/schemas/docs-consumer-upgrade-execution/v1.schema.json +39 -3
  193. package/schemas/docs-protocol-qualification-receipt/v3.schema.json +118 -0
  194. package/schemas/qualified-docs-cohort/v2.schema.json +149 -0
  195. package/skills/docs/SKILL.md +8 -6
@@ -1,3 +1,22 @@
1
1
  import type { ConsumerIntegrationDesiredStateV1 } from "../domain/model.js";
2
+ export interface QualifiedPnpmLockfileTarget {
3
+ readonly name: string;
4
+ readonly version: string;
5
+ readonly integrity: string;
6
+ readonly direct?: boolean;
7
+ }
8
+ export interface QualifiedPnpmLockfileInternalEdge {
9
+ readonly from: string;
10
+ readonly to: string;
11
+ }
12
+ export declare function assertQualifiedPnpmLockfileTargets(bytes: Uint8Array, options: {
13
+ readonly targets: readonly QualifiedPnpmLockfileTarget[];
14
+ readonly internalEdges: readonly QualifiedPnpmLockfileInternalEdge[];
15
+ readonly runtimeClosureDigest: string;
16
+ readonly computeRuntimeClosureDigest: (lockfile: Record<string, unknown>) => `sha256:${string}`;
17
+ readonly forbiddenAliasTargetPackageNames?: readonly string[];
18
+ /** V1 historically validates closure safety without binding the consumer's full graph digest. */
19
+ readonly enforceRuntimeClosureDigest?: boolean;
20
+ }): void;
2
21
  export declare function assertQualifiedPnpmLockfileV1(bytes: Uint8Array, desired: ConsumerIntegrationDesiredStateV1): void;
3
22
  //# sourceMappingURL=pnpm-lockfile-validator-v1.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pnpm-lockfile-validator-v1.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/pnpm-lockfile-validator-v1.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,oBAAoB,CAAC;AA+E5E,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,iCAAiC,GACzC,IAAI,CAiHN"}
1
+ {"version":3,"file":"pnpm-lockfile-validator-v1.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/pnpm-lockfile-validator-v1.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,oBAAoB,CAAC;AAQ5E,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAkSD,wBAAgB,kCAAkC,CAChD,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE;IACP,QAAQ,CAAC,OAAO,EAAE,SAAS,2BAA2B,EAAE,CAAC;IACzD,QAAQ,CAAC,aAAa,EAAE,SAAS,iCAAiC,EAAE,CAAC;IACrE,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,2BAA2B,EAAE,CACpC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC9B,UAAU,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,gCAAgC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9D,iGAAiG;IACjG,QAAQ,CAAC,2BAA2B,CAAC,EAAE,OAAO,CAAC;CAChD,GACA,IAAI,CAwEN;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,iCAAiC,GACzC,IAAI,CAkBN"}
@@ -8,6 +8,9 @@ function yamlRecord(value, subject) {
8
8
  }
9
9
  return value;
10
10
  }
11
+ function yamlOptionalRecord(value, subject) {
12
+ return value === undefined ? {} : yamlRecord(value, subject);
13
+ }
11
14
  function assertRegistryPackageEntry(options) {
12
15
  const resolution = yamlRecord(options.packageEntry["resolution"], `pnpm-lock.yaml#packages.${options.packageName}.resolution`);
13
16
  if (resolution["integrity"] !== options.integrity) {
@@ -36,11 +39,45 @@ function assertRootOwnsCohortPins(importers, packageNames) {
36
39
  }
37
40
  }
38
41
  }
39
- function assertRegistryBoundRuntimeClosure(lockfile, desired) {
42
+ function targetsNpmAlias(value, packageNames) {
43
+ const candidates = typeof value === "string"
44
+ ? [value]
45
+ : typeof value === "object" && value !== null && !Array.isArray(value)
46
+ ? [
47
+ value["specifier"],
48
+ value["version"]
49
+ ]
50
+ : [];
51
+ return candidates.some((candidate) => typeof candidate === "string" &&
52
+ packageNames.some((packageName) => candidate === `npm:${packageName}` || candidate.startsWith(`npm:${packageName}@`) ||
53
+ candidate === packageName || candidate.startsWith(`${packageName}@`)));
54
+ }
55
+ function assertNoCohortAliases(importers, packageNames) {
56
+ for (const [importerPath, importerValue] of Object.entries(importers)) {
57
+ const importer = yamlRecord(importerValue, `pnpm-lock.yaml#importers.${importerPath}`);
58
+ for (const field of [
59
+ "dependencies", "devDependencies", "optionalDependencies", "peerDependencies"
60
+ ]) {
61
+ if (importer[field] === undefined) {
62
+ continue;
63
+ }
64
+ const declarations = yamlRecord(importer[field], `pnpm-lock.yaml#importers.${importerPath}.${field}`);
65
+ for (const [alias, declaration] of Object.entries(declarations)) {
66
+ if (targetsNpmAlias(declaration, packageNames)) {
67
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_COHORT_ALIAS_FORBIDDEN", `pnpm importer ${importerPath} alias ${alias} must not target a Cohort package.`);
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ function assertRegistryBoundRuntimeClosure(lockfile, compute, expectedDigest, enforceDigest) {
40
74
  try {
41
75
  // The Cohort digest qualifies the isolated release graph. A consumer may select
42
76
  // compatible transitives or peer contexts, but every reachable edge stays registry/SRI bound.
43
- computePnpmRuntimeClosureDigestV1(lockfile, desired.cohort);
77
+ const observedDigest = compute(lockfile);
78
+ if (enforceDigest && observedDigest !== expectedDigest) {
79
+ throw new PnpmRuntimeClosureError("Runtime closure digest differs from the selected Cohort.");
80
+ }
44
81
  }
45
82
  catch (error) {
46
83
  if (error instanceof PnpmRuntimeClosureError) {
@@ -49,22 +86,128 @@ function assertRegistryBoundRuntimeClosure(lockfile, desired) {
49
86
  throw error;
50
87
  }
51
88
  }
52
- export function assertQualifiedPnpmLockfileV1(bytes, desired) {
89
+ function assertTargetSnapshots(input) {
90
+ const snapshotKeys = new Map();
91
+ for (const target of input.targets) {
92
+ const packageName = target.name;
93
+ const direct = target.direct ?? true;
94
+ snapshotKeys.set(packageName, new Set());
95
+ const importerValue = input.devDependencies[packageName];
96
+ if (!direct && importerValue !== undefined) {
97
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_LOCKFILE_COHORT_MISMATCH", `${packageName} is a transitive Cohort coordinate and must not be a root importer pin.`);
98
+ }
99
+ if (direct) {
100
+ const importerEntry = yamlRecord(importerValue, `pnpm-lock.yaml#importers...${packageName}`);
101
+ if (importerEntry["specifier"] !== target.version ||
102
+ !validPnpmPeerContext(importerEntry["version"], target.version)) {
103
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_LOCKFILE_COHORT_MISMATCH", `${packageName} importer evidence must select exact cohort version ${target.version}.`);
104
+ }
105
+ const snapshotKey = `${packageName}@${String(importerEntry["version"])}`;
106
+ if (input.snapshots[snapshotKey] === undefined) {
107
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_LOCKFILE_SNAPSHOT_MISSING", `${packageName} has no snapshot selected by the root importer.`);
108
+ }
109
+ snapshotKeys.get(packageName).add(snapshotKey);
110
+ }
111
+ const packageEntry = yamlRecord(input.packages[`${packageName}@${target.version}`], `pnpm-lock.yaml#packages.${packageName}`);
112
+ assertRegistryPackageEntry({ integrity: target.integrity, packageEntry, packageName });
113
+ }
114
+ return snapshotKeys;
115
+ }
116
+ function assertSinglePackageResolutions(packages, targets) {
117
+ for (const target of targets) {
118
+ const packageName = target.name;
119
+ const prefix = `${packageName}@`;
120
+ const keys = Object.keys(packages).filter((key) => key.startsWith(prefix));
121
+ if (keys.length !== 1 || keys[0] !== `${prefix}${target.version}`) {
122
+ throw new ConsumerIntegrationNodeError(packageName.endsWith("engineering-foundation")
123
+ ? "DOCS_CONSUMER_DUPLICATE_FOUNDATION_RESOLUTION"
124
+ : packageName.endsWith("docs-protocol")
125
+ ? "DOCS_CONSUMER_DUPLICATE_DOCS_PROTOCOL_RESOLUTION"
126
+ : "DOCS_CONSUMER_DUPLICATE_COHORT_RESOLUTION", `pnpm-lock.yaml must contain exactly one physical cohort ${packageName} resolution.`);
127
+ }
128
+ }
129
+ }
130
+ function assertInternalEdges(input) {
131
+ const targetByName = new Map(input.targets.map((target) => [target.name, target]));
132
+ const allowedTargetsBySource = new Map();
133
+ for (const edge of input.edges) {
134
+ const source = targetByName.get(edge.from);
135
+ const target = targetByName.get(edge.to);
136
+ if (source === undefined || target === undefined) {
137
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_COHORT_DEPENDENCY_MISMATCH", `Internal Cohort edge ${edge.from} -> ${edge.to} has no declared coordinate.`);
138
+ }
139
+ const allowedTargets = allowedTargetsBySource.get(source.name) ?? new Set();
140
+ allowedTargets.add(target.name);
141
+ allowedTargetsBySource.set(source.name, allowedTargets);
142
+ }
143
+ const selectedSnapshots = new Map([...input.snapshotKeys].map(([name, keys]) => [name, new Set(keys)]));
144
+ const pending = input.targets.flatMap((target) => [...(selectedSnapshots.get(target.name) ?? [])].map((snapshotKey) => ({
145
+ source: target,
146
+ snapshotKey
147
+ })));
148
+ const visited = new Set();
149
+ while (pending.length > 0) {
150
+ const { source, snapshotKey } = pending.shift();
151
+ if (visited.has(snapshotKey)) {
152
+ continue;
153
+ }
154
+ visited.add(snapshotKey);
155
+ const sourceSnapshot = yamlRecord(input.snapshots[snapshotKey], `pnpm-lock.yaml#snapshots.${snapshotKey}`);
156
+ const dependencies = yamlOptionalRecord(sourceSnapshot["dependencies"], `pnpm-lock.yaml#snapshots.${source.name}.dependencies`);
157
+ const optionalDependencies = yamlOptionalRecord(sourceSnapshot["optionalDependencies"], `pnpm-lock.yaml#snapshots.${source.name}.optionalDependencies`);
158
+ const allowedTargets = allowedTargetsBySource.get(source.name) ?? new Set();
159
+ for (const target of input.targets) {
160
+ const dependency = dependencies[target.name];
161
+ const optionalDependency = optionalDependencies[target.name];
162
+ if (optionalDependency !== undefined) {
163
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_COHORT_DEPENDENCY_MISMATCH", `${source.name} must not optionally depend on Cohort package ${target.name}.`);
164
+ }
165
+ if (allowedTargets.has(target.name)) {
166
+ if (!validPnpmPeerContext(dependency, target.version)) {
167
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_COHORT_DEPENDENCY_MISMATCH", `${source.name} must depend on exact Cohort ${target.name}@${target.version}.`);
168
+ }
169
+ const targetSnapshotKey = `${target.name}@${String(dependency)}`;
170
+ if (input.snapshots[targetSnapshotKey] === undefined) {
171
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_LOCKFILE_SNAPSHOT_MISSING", `${source.name} selects missing Cohort snapshot ${targetSnapshotKey}.`);
172
+ }
173
+ const targetSelections = selectedSnapshots.get(target.name);
174
+ if (!targetSelections.has(targetSnapshotKey)) {
175
+ targetSelections.add(targetSnapshotKey);
176
+ pending.push({ source: target, snapshotKey: targetSnapshotKey });
177
+ }
178
+ }
179
+ else if (dependency !== undefined) {
180
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_COHORT_DEPENDENCY_MISMATCH", `${source.name} has forbidden extra Cohort dependency ${target.name}.`);
181
+ }
182
+ }
183
+ }
184
+ for (const target of input.targets) {
185
+ if ((selectedSnapshots.get(target.name)?.size ?? 0) === 0) {
186
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_LOCKFILE_SNAPSHOT_MISSING", `${target.name} has no snapshot reachable from the root Cohort pins.`);
187
+ }
188
+ }
189
+ }
190
+ export function assertQualifiedPnpmLockfileTargets(bytes, options) {
53
191
  const document = parseDocument(Buffer.from(bytes).toString("utf8"), { uniqueKeys: true });
54
192
  if (document.errors.length > 0) {
55
193
  throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_LOCKFILE_INVALID", "pnpm-lock.yaml must be duplicate-free YAML.");
56
194
  }
57
195
  const lockfile = yamlRecord(document.toJS({ maxAliasCount: 0 }), "pnpm-lock.yaml");
58
196
  if (String(lockfile["lockfileVersion"]) !== "9.0") {
59
- throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_LOCKFILE_INVALID", "V1 requires pnpm lockfileVersion 9.0.");
197
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_LOCKFILE_INVALID", "Managed consumer integration requires pnpm lockfileVersion 9.0.");
60
198
  }
61
- if (targetsManagedPackage(lockfile["overrides"]) ||
62
- targetsManagedPackage(lockfile["patchedDependencies"])) {
199
+ const targetPackageNames = options.targets.map(({ name }) => name);
200
+ if (targetsManagedPackage(lockfile["overrides"], targetPackageNames) ||
201
+ targetsManagedPackage(lockfile["patchedDependencies"], targetPackageNames)) {
63
202
  throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_LOCKFILE_OVERRIDE", "Docs Protocol cohort packages must not use lockfile overrides or patches.");
64
203
  }
65
204
  const importers = yamlRecord(lockfile["importers"], "pnpm-lock.yaml#importers");
66
205
  if (importers["."] === undefined) {
67
- throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_UNSUPPORTED_WORKSPACE", "V1 requires one root pnpm importer in the repository lockfile.");
206
+ throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_UNSUPPORTED_WORKSPACE", "Managed consumer integration requires one root pnpm importer.");
207
+ }
208
+ const forbiddenAliasTargetPackageNames = options.forbiddenAliasTargetPackageNames ?? [];
209
+ if (forbiddenAliasTargetPackageNames.length > 0) {
210
+ assertNoCohortAliases(importers, forbiddenAliasTargetPackageNames);
68
211
  }
69
212
  const importer = yamlRecord(importers["."], "pnpm-lock.yaml#importers.");
70
213
  const devDependencies = yamlRecord(importer["devDependencies"], "pnpm-lock.yaml#importers...devDependencies");
@@ -74,47 +217,44 @@ export function assertQualifiedPnpmLockfileV1(bytes, desired) {
74
217
  continue;
75
218
  }
76
219
  const record = yamlRecord(declarations, `pnpm-lock.yaml#importers...${field}`);
77
- if (["@agent-teams/docs-protocol", "@agent-teams/engineering-foundation"]
78
- .some((packageName) => record[packageName] !== undefined)) {
220
+ if (targetPackageNames.some((packageName) => record[packageName] !== undefined)) {
79
221
  throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_NON_DEV_DEPENDENCY", "Docs Protocol cohort packages may be declared only in root devDependencies.");
80
222
  }
81
223
  }
82
224
  const packages = yamlRecord(lockfile["packages"], "pnpm-lock.yaml#packages");
83
225
  const snapshots = yamlRecord(lockfile["snapshots"], "pnpm-lock.yaml#snapshots");
84
- const targets = [
85
- ["@agent-teams/docs-protocol", desired.cohort.packages.docsProtocol],
86
- ["@agent-teams/engineering-foundation", desired.cohort.packages.engineeringFoundation]
87
- ];
88
- assertRootOwnsCohortPins(importers, targets.map(([packageName]) => packageName));
89
- for (const [packageName, target] of targets) {
90
- const importerEntry = yamlRecord(devDependencies[packageName], `pnpm-lock.yaml#importers...${packageName}`);
91
- const selectedVersion = importerEntry["version"];
92
- if (importerEntry["specifier"] !== target.version ||
93
- !validPnpmPeerContext(selectedVersion, target.version)) {
94
- throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_LOCKFILE_COHORT_MISMATCH", `${packageName} importer evidence must select exact cohort version ${target.version}.`);
95
- }
96
- const packageEntry = yamlRecord(packages[`${packageName}@${target.version}`], `pnpm-lock.yaml#packages.${packageName}`);
97
- assertRegistryPackageEntry({ integrity: target.integrity, packageEntry, packageName });
98
- const snapshotKey = `${packageName}@${selectedVersion}`;
99
- if (snapshots[snapshotKey] === undefined) {
100
- throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_LOCKFILE_SNAPSHOT_MISSING", `${packageName} must have the exact selected pnpm snapshot.`);
101
- }
102
- }
103
- for (const [packageName, target] of targets) {
104
- const prefix = `${packageName}@`;
105
- const keys = Object.keys(packages).filter((key) => key.startsWith(prefix));
106
- if (keys.length !== 1 || keys[0] !== `${prefix}${target.version}`) {
107
- throw new ConsumerIntegrationNodeError(packageName.endsWith("engineering-foundation")
108
- ? "DOCS_CONSUMER_DUPLICATE_FOUNDATION_RESOLUTION"
109
- : "DOCS_CONSUMER_DUPLICATE_DOCS_PROTOCOL_RESOLUTION", `pnpm-lock.yaml must contain exactly one physical cohort ${packageName} resolution.`);
110
- }
111
- }
112
- const docsSelection = yamlRecord(devDependencies["@agent-teams/docs-protocol"], "pnpm-lock.yaml#importers...docs-protocol")["version"];
113
- const docsSnapshot = yamlRecord(snapshots[`@agent-teams/docs-protocol@${String(docsSelection)}`], "pnpm-lock.yaml#snapshots.docs-protocol");
114
- const docsDependencies = yamlRecord(docsSnapshot["dependencies"], "pnpm-lock.yaml#snapshots.docs-protocol.dependencies");
115
- if (!validPnpmPeerContext(docsDependencies["@agent-teams/engineering-foundation"], desired.cohort.packages.engineeringFoundation.version)) {
116
- throw new ConsumerIntegrationNodeError("DOCS_CONSUMER_COHORT_DEPENDENCY_MISMATCH", "The selected Docs Protocol snapshot must depend on the exact cohort Foundation version.");
117
- }
118
- assertRegistryBoundRuntimeClosure(lockfile, desired);
226
+ assertRootOwnsCohortPins(importers, targetPackageNames);
227
+ const snapshotKeys = assertTargetSnapshots({
228
+ devDependencies,
229
+ packages,
230
+ snapshots,
231
+ targets: options.targets
232
+ });
233
+ assertSinglePackageResolutions(packages, options.targets);
234
+ assertInternalEdges({
235
+ edges: options.internalEdges,
236
+ snapshots,
237
+ snapshotKeys,
238
+ targets: options.targets
239
+ });
240
+ assertRegistryBoundRuntimeClosure(lockfile, options.computeRuntimeClosureDigest, options.runtimeClosureDigest, options.enforceRuntimeClosureDigest ?? true);
241
+ }
242
+ export function assertQualifiedPnpmLockfileV1(bytes, desired) {
243
+ assertQualifiedPnpmLockfileTargets(bytes, {
244
+ targets: [
245
+ { name: "@agent-teams/docs-protocol", ...desired.cohort.packages.docsProtocol },
246
+ {
247
+ name: "@agent-teams/engineering-foundation",
248
+ ...desired.cohort.packages.engineeringFoundation
249
+ }
250
+ ],
251
+ internalEdges: [{
252
+ from: "@agent-teams/docs-protocol",
253
+ to: "@agent-teams/engineering-foundation"
254
+ }],
255
+ runtimeClosureDigest: desired.cohort.runtime.runtimeClosureDigest,
256
+ enforceRuntimeClosureDigest: false,
257
+ computeRuntimeClosureDigest: (lockfile) => computePnpmRuntimeClosureDigestV1(lockfile, desired.cohort)
258
+ });
119
259
  }
120
260
  //# sourceMappingURL=pnpm-lockfile-validator-v1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pnpm-lockfile-validator-v1.js","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/pnpm-lockfile-validator-v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAGrC,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACxB,MAAM,8BAA8B,CAAC;AAEtC,SAAS,UAAU,CAAC,KAAc,EAAE,OAAe;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,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CAAC,EAC5B,qDAAqD,CACtD,CAAC;IACF,IAAI,CAAC,oBAAoB,CACvB,gBAAgB,CAAC,qCAAqC,CAAC,EACvD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC,OAAO,CACtD,EAAE,CAAC;QACF,MAAM,IAAI,4BAA4B,CACpC,0CAA0C,EAC1C,yFAAyF,CAC1F,CAAC;IACJ,CAAC;IACD,iCAAiC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC"}
1
+ {"version":3,"file":"pnpm-lockfile-validator-v1.js","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/pnpm-lockfile-validator-v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAGrC,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAC3F,OAAO,EACL,iCAAiC,EACjC,uBAAuB,EACxB,MAAM,8BAA8B,CAAC;AActC,SAAS,UAAU,CAAC,KAAc,EAAE,OAAe;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,4BAA4B,CACpC,gCAAgC,EAChC,GAAG,OAAO,uBAAuB,CAClC,CAAC;IACJ,CAAC;IACD,OAAO,KAAgC,CAAC;AAC1C,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAc,EAAE,OAAe;IACzD,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,0BAA0B,CAAC,OAInC;IACC,MAAM,UAAU,GAAG,UAAU,CAC3B,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,EACl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AC,CAAC;IAC1D,mBAAmB,CAAC;QAClB,KAAK,EAAE,OAAO,CAAC,aAAa;QAC5B,SAAS;QACT,YAAY;QACZ,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC,CAAC;IACH,iCAAiC,CAC/B,QAAQ,EACR,OAAO,CAAC,2BAA2B,EACnC,OAAO,CAAC,oBAAoB,EAC5B,OAAO,CAAC,2BAA2B,IAAI,IAAI,CAC5C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,KAAiB,EACjB,OAA0C;IAE1C,kCAAkC,CAAC,KAAK,EAAE;QACxC,OAAO,EAAE;YACP,EAAE,IAAI,EAAE,4BAA4B,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC/E;gBACE,IAAI,EAAE,qCAAqC;gBAC3C,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB;aACjD;SACF;QACD,aAAa,EAAE,CAAC;gBACd,IAAI,EAAE,4BAA4B;gBAClC,EAAE,EAAE,qCAAqC;aAC1C,CAAC;QACF,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB;QACjE,2BAA2B,EAAE,KAAK;QAClC,2BAA2B,EAAE,CAAC,QAAQ,EAAE,EAAE,CACxC,iCAAiC,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC;KAC9D,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ConsumerIntegrationDesiredStateV3 } from "../domain/model.js";
2
+ export declare function observeQualifiedPnpmLockfileV2(bytes: Uint8Array, desired: ConsumerIntegrationDesiredStateV3): `sha256:${string}`;
3
+ export declare function assertQualifiedPnpmLockfileV2(bytes: Uint8Array, desired: ConsumerIntegrationDesiredStateV3): void;
4
+ //# sourceMappingURL=pnpm-lockfile-validator-v2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pnpm-lockfile-validator-v2.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/pnpm-lockfile-validator-v2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,oBAAoB,CAAC;AAuE5E,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,iCAAiC,GACzC,UAAU,MAAM,EAAE,CAEpB;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE,iCAAiC,GACzC,IAAI,CAEN"}
@@ -0,0 +1,64 @@
1
+ import { qualifiedDocsCohortV2PackageEntries } from "../application/policies/qualified-docs-cohort-v2.js";
2
+ import { assertQualifiedPnpmLockfileTargets } from "./pnpm-lockfile-validator-v1.js";
3
+ import { computePnpmRuntimeClosureDigestV2 } from "./pnpm-runtime-closure-v2.js";
4
+ const MAXIMUM_LOCKFILE_BYTES = 32 * 1024 * 1024;
5
+ const INTERNAL_EDGES = Object.freeze([
6
+ Object.freeze({
7
+ from: "@agent-teams/document-authoring",
8
+ to: "@agent-teams/repository-mutation"
9
+ }),
10
+ Object.freeze({
11
+ from: "@agent-teams/docs-protocol",
12
+ to: "@agent-teams/document-authoring"
13
+ }),
14
+ Object.freeze({
15
+ from: "@agent-teams/docs-protocol",
16
+ to: "@agent-teams/repository-mutation"
17
+ }),
18
+ Object.freeze({
19
+ from: "@agent-teams/docs-protocol-agent-teams",
20
+ to: "@agent-teams/docs-protocol"
21
+ }),
22
+ Object.freeze({
23
+ from: "@agent-teams/docs-protocol-agent-teams",
24
+ to: "@agent-teams/repository-mutation"
25
+ }),
26
+ Object.freeze({
27
+ from: "@agent-teams/engineering-foundation",
28
+ to: "@agent-teams/document-authoring"
29
+ }),
30
+ Object.freeze({
31
+ from: "@agent-teams/engineering-foundation",
32
+ to: "@agent-teams/repository-mutation"
33
+ })
34
+ ]);
35
+ function validateQualifiedPnpmLockfileV2(bytes, desired, enforceRuntimeClosureDigest) {
36
+ if (!(bytes instanceof Uint8Array) || bytes.byteLength === 0 ||
37
+ bytes.byteLength > MAXIMUM_LOCKFILE_BYTES) {
38
+ throw new TypeError(`Qualification v3 lockfile must contain 1..${MAXIMUM_LOCKFILE_BYTES} bytes.`);
39
+ }
40
+ const entries = qualifiedDocsCohortV2PackageEntries(desired.cohort);
41
+ let runtimeClosureDigest;
42
+ assertQualifiedPnpmLockfileTargets(bytes, {
43
+ targets: entries.map(({ name, version, integrity, direct }) => ({ name, version, integrity, direct })),
44
+ internalEdges: INTERNAL_EDGES,
45
+ forbiddenAliasTargetPackageNames: entries.map(({ name }) => name),
46
+ runtimeClosureDigest: desired.cohort.runtime.runtimeClosureDigest,
47
+ enforceRuntimeClosureDigest,
48
+ computeRuntimeClosureDigest(lockfile) {
49
+ runtimeClosureDigest = computePnpmRuntimeClosureDigestV2(lockfile, desired.cohort);
50
+ return runtimeClosureDigest;
51
+ }
52
+ });
53
+ if (runtimeClosureDigest === undefined) {
54
+ throw new Error("Qualified pnpm lockfile validation did not observe a runtime closure.");
55
+ }
56
+ return runtimeClosureDigest;
57
+ }
58
+ export function observeQualifiedPnpmLockfileV2(bytes, desired) {
59
+ return validateQualifiedPnpmLockfileV2(bytes, desired, false);
60
+ }
61
+ export function assertQualifiedPnpmLockfileV2(bytes, desired) {
62
+ validateQualifiedPnpmLockfileV2(bytes, desired, true);
63
+ }
64
+ //# sourceMappingURL=pnpm-lockfile-validator-v2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pnpm-lockfile-validator-v2.js","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/pnpm-lockfile-validator-v2.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mCAAmC,EAAE,MAC5C,qDAAqD,CAAC;AACxD,OAAO,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AAEjF,MAAM,sBAAsB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,C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AM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CACjF;QACD,aAAa,EAAE,cAAc;QAC7B,gCAAgC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC;QACjE,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB;QACjE,2BAA2B;QAC3B,2BAA2B,CAAC,QAAQ;YAClC,oBAAoB,GAAG,iCAAiC,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;YACnF,OAAO,oBAAoB,CAAC;QAC9B,CAAC;KACF,CAAC,CAAC;IACH,IAAI,oBAAoB,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,KAAiB,EACjB,OAA0C;IAE1C,OAAO,+BAA+B,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,KAAiB,EACjB,OAA0C;IAE1C,+BAA+B,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC"}
@@ -1,15 +1,32 @@
1
1
  import type { ConsumerIntegrationDigest, ConsumerIntegrationFileObservation, QualifiedDocsCohortBindingV1 } from "../domain/model.js";
2
- import type { PnpmManifestPlanV1, PnpmManifestPlannerV1 } from "../application/ports/consumer-integration-planners.js";
2
+ import type { PnpmManifestPlanV1 } from "../application/ports/consumer-integration-planners.js";
3
+ export interface CohortManifestTarget {
4
+ readonly name: string;
5
+ readonly version: string;
6
+ }
3
7
  export type { PnpmManifestPlanV1 } from "../application/ports/consumer-integration-planners.js";
8
+ export declare function projectPnpmManifestCohortTargets(input: {
9
+ readonly bytes: Uint8Array;
10
+ readonly targets: readonly CohortManifestTarget[];
11
+ readonly transitivePackageNames?: readonly string[];
12
+ readonly forbiddenAliasTargetPackageNames?: readonly string[];
13
+ }): Uint8Array;
4
14
  export declare function projectPnpmManifestCohortPinsV1(input: {
5
15
  readonly bytes: Uint8Array;
6
16
  readonly cohort: QualifiedDocsCohortBindingV1;
7
17
  }): Uint8Array;
18
+ export declare function planPnpmManifestTargets(input: {
19
+ readonly observation: ConsumerIntegrationFileObservation;
20
+ readonly profilePath: string;
21
+ readonly targets: readonly CohortManifestTarget[];
22
+ readonly forbiddenRootPackageNames?: readonly string[];
23
+ readonly forbiddenAliasTargetPackageNames?: readonly string[];
24
+ readonly knownPriorScriptsDigest?: ConsumerIntegrationDigest;
25
+ }): PnpmManifestPlanV1;
8
26
  export declare function planPnpmManifestV1(input: {
9
27
  readonly observation: ConsumerIntegrationFileObservation;
10
28
  readonly profilePath: string;
11
29
  readonly cohort: QualifiedDocsCohortBindingV1;
12
30
  readonly knownPriorScriptsDigest?: ConsumerIntegrationDigest;
13
31
  }): PnpmManifestPlanV1;
14
- export declare const pnpmManifestPlannerV1: PnpmManifestPlannerV1;
15
32
  //# sourceMappingURL=pnpm-manifest-adapter-v1.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pnpm-manifest-adapter-v1.d.ts","sourceRoot":"","sources":["../../../src/consumer-integration/adapters/pnpm-manifest-adapter-v1.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,yBAAyB,EACzB,kCAAkC,EAElC,4BAA4B,EAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,uDAAuD,CAAC;AAU/D,YAAY,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAsGhG,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAA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/C,GAAG,UAAU,CAKb;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,QAAQ,CAAC,WAAW,EAAE,kCAAkC,CAAC;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAClD,QAAQ,CAAC,yBAAyB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvD,QAAQ,CAAC,gCAAgC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9D,QAAQ,CAAC,uBAAuB,CAAC,EAAE,yBAAyB,CAAC;CAC9D,GAAG,kBAAkB,CA4FrB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,QAAQ,CAAC,WAAW,EAAE,kCAAkC,CAAC;IACzD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,4BAA4B,CAAC;IAC9C,QAAQ,CAAC,uBAAuB,CAAC,EAAE,yBAAyB,CAAC;CAC9D,GAAG,kBAAkB,CASrB"}
@@ -59,9 +59,9 @@ function manifestShapeIssues(manifest) {
59
59
  }
60
60
  return issues;
61
61
  }
62
- function cohortDependencyIssues(dependencies, devDependencies, optionalDependencies, peerDependencies, cohort) {
62
+ function cohortDependencyIssues(dependencies, devDependencies, optionalDependencies, peerDependencies, targets) {
63
63
  const issues = [];
64
- for (const packageName of [DOCS_PACKAGE, FOUNDATION_PACKAGE]) {
64
+ for (const { name: packageName } of targets) {
65
65
  for (const [field, declarations] of [
66
66
  ["dependencies", dependencies],
67
67
  ["optionalDependencies", optionalDependencies],
@@ -72,24 +72,45 @@ function cohortDependencyIssues(dependencies, devDependencies, optionalDependenc
72
72
  }
73
73
  }
74
74
  }
75
- const requiredVersions = {
76
- [DOCS_PACKAGE]: cohort.packages.docsProtocol.version,
77
- [FOUNDATION_PACKAGE]: cohort.packages.engineeringFoundation.version
78
- };
79
- for (const [packageName, version] of Object.entries(requiredVersions)) {
75
+ for (const { name: packageName, version } of targets) {
80
76
  if (devDependencies[packageName] !== version) {
81
77
  issues.push(issue(`package.json#devDependencies.${packageName}`, "DOCS_CONSUMER_COHORT_PIN_REQUIRED", `Update ${packageName} and pnpm-lock.yaml together to exact version ${version} before consumer apply.`));
82
78
  }
83
79
  }
84
80
  return issues;
85
81
  }
86
- export function projectPnpmManifestCohortPinsV1(input) {
82
+ function forbiddenRootDeclarationIssues(declarationsByField, packageNames) {
83
+ return packageNames.flatMap((packageName) => declarationsByField.flatMap(([field, declarations]) => declarations[packageName] === undefined ? [] : [issue(`package.json#${field}.${packageName}`, "DOCS_CONSUMER_TRANSITIVE_ROOT_DECLARATION", `${packageName} is a transitive Cohort coordinate and must not be a root declaration.`)]));
84
+ }
85
+ function targetsNpmAlias(value, packageNames) {
86
+ return typeof value === "string" && packageNames.some((packageName) => value === `npm:${packageName}` || value.startsWith(`npm:${packageName}@`));
87
+ }
88
+ function cohortAliasIssues(declarationsByField, packageNames) {
89
+ return declarationsByField.flatMap(([field, declarations]) => Object.entries(declarations).flatMap(([alias, value]) => targetsNpmAlias(value, packageNames) ? [issue(`package.json#${field}.${alias}`, "DOCS_CONSUMER_COHORT_ALIAS_FORBIDDEN", `npm alias ${alias} must not target a Cohort package.`)] : []));
90
+ }
91
+ function cohortManifestTargetsV1(cohort) {
92
+ return Object.freeze([
93
+ Object.freeze({ name: DOCS_PACKAGE, version: cohort.packages.docsProtocol.version }),
94
+ Object.freeze({
95
+ name: FOUNDATION_PACKAGE,
96
+ version: cohort.packages.engineeringFoundation.version
97
+ })
98
+ ]);
99
+ }
100
+ export function projectPnpmManifestCohortTargets(input) {
87
101
  const { manifest, source } = parseManifest(input.bytes);
88
102
  const issues = manifestShapeIssues(manifest);
89
103
  const dependencies = recordField(manifest, "dependencies");
104
+ const devDependencies = recordField(manifest, "devDependencies");
90
105
  const optionalDependencies = recordField(manifest, "optionalDependencies");
91
106
  const peerDependencies = recordField(manifest, "peerDependencies");
92
- for (const packageName of [DOCS_PACKAGE, FOUNDATION_PACKAGE]) {
107
+ const declarationsByField = [
108
+ ["dependencies", dependencies],
109
+ ["devDependencies", devDependencies],
110
+ ["optionalDependencies", optionalDependencies],
111
+ ["peerDependencies", peerDependencies]
112
+ ];
113
+ for (const { name: packageName } of input.targets) {
93
114
  for (const [field, declarations] of [
94
115
  ["dependencies", dependencies],
95
116
  ["optionalDependencies", optionalDependencies],
@@ -100,19 +121,30 @@ export function projectPnpmManifestCohortPinsV1(input) {
100
121
  }
101
122
  }
102
123
  }
124
+ issues.push(...cohortAliasIssues(declarationsByField, input.forbiddenAliasTargetPackageNames ?? []));
103
125
  if (issues.length > 0) {
104
126
  throw new TypeError(issues.map(({ message }) => message).join(" "));
105
127
  }
106
128
  let postimage = source;
107
- for (const [packageName, version] of [
108
- [DOCS_PACKAGE, input.cohort.packages.docsProtocol.version],
109
- [FOUNDATION_PACKAGE, input.cohort.packages.engineeringFoundation.version]
110
- ]) {
129
+ for (const packageName of input.transitivePackageNames ?? []) {
130
+ for (const [field, declarations] of declarationsByField) {
131
+ if (declarations[packageName] !== undefined) {
132
+ postimage = applyField(postimage, [field, packageName], void 0);
133
+ }
134
+ }
135
+ }
136
+ for (const { name: packageName, version } of input.targets) {
111
137
  postimage = applyField(postimage, ["devDependencies", packageName], version);
112
138
  }
113
139
  return Buffer.from(postimage, "utf8");
114
140
  }
115
- export function planPnpmManifestV1(input) {
141
+ export function projectPnpmManifestCohortPinsV1(input) {
142
+ return projectPnpmManifestCohortTargets({
143
+ bytes: input.bytes,
144
+ targets: cohortManifestTargetsV1(input.cohort)
145
+ });
146
+ }
147
+ export function planPnpmManifestTargets(input) {
116
148
  if (input.observation.state === "absent") {
117
149
  const empty = digestBytes(new Uint8Array());
118
150
  return {
@@ -143,7 +175,15 @@ export function planPnpmManifestV1(input) {
143
175
  const devDependencies = recordField(manifest, "devDependencies");
144
176
  const optionalDependencies = recordField(manifest, "optionalDependencies");
145
177
  const peerDependencies = recordField(manifest, "peerDependencies");
146
- issues.push(...cohortDependencyIssues(dependencies, devDependencies, optionalDependencies, peerDependencies, input.cohort));
178
+ const declarationsByField = [
179
+ ["dependencies", dependencies],
180
+ ["devDependencies", devDependencies],
181
+ ["optionalDependencies", optionalDependencies],
182
+ ["peerDependencies", peerDependencies]
183
+ ];
184
+ issues.push(...cohortDependencyIssues(dependencies, devDependencies, optionalDependencies, peerDependencies, input.targets));
185
+ issues.push(...forbiddenRootDeclarationIssues(declarationsByField, input.forbiddenRootPackageNames ?? []));
186
+ issues.push(...cohortAliasIssues(declarationsByField, input.forbiddenAliasTargetPackageNames ?? []));
147
187
  const desiredScripts = canonicalDocsScripts(input.profilePath);
148
188
  const observedScripts = Object.fromEntries(Object.keys(desiredScripts).map((script) => [
149
189
  script,
@@ -183,7 +223,14 @@ export function planPnpmManifestV1(input) {
183
223
  issues: []
184
224
  };
185
225
  }
186
- export const pnpmManifestPlannerV1 = Object.freeze({
187
- plan: planPnpmManifestV1
188
- });
226
+ export function planPnpmManifestV1(input) {
227
+ return planPnpmManifestTargets({
228
+ observation: input.observation,
229
+ profilePath: input.profilePath,
230
+ targets: cohortManifestTargetsV1(input.cohort),
231
+ ...(input.knownPriorScriptsDigest === undefined
232
+ ? {}
233
+ : { knownPriorScriptsDigest: input.knownPriorScriptsDigest })
234
+ });
235
+ }
189
236
  //# sourceMappingURL=pnpm-manifest-adapter-v1.js.map