@mikeargento/bitgraph 1.9.0 → 1.9.2

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 (252) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +58 -35
  3. package/dist/constructor.js +1 -1
  4. package/dist/constructor.js.map +1 -1
  5. package/dist/fuse-cli.js +1 -1
  6. package/dist/fuse-cli.js.map +1 -1
  7. package/dist/fuse.js +1 -1
  8. package/dist/fuse.js.map +1 -1
  9. package/dist/host.js +1 -1
  10. package/dist/host.js.map +1 -1
  11. package/dist/index.d.ts +2 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +2 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/policy.js +1 -1
  16. package/dist/policy.js.map +1 -1
  17. package/package.json +23 -8
  18. package/src/constructor.ts +1 -1
  19. package/src/fuse-cli.ts +1 -1
  20. package/src/fuse.ts +1 -1
  21. package/src/host.ts +1 -1
  22. package/src/index.ts +3 -2
  23. package/src/policy.ts +1 -1
  24. package/dist/__tests__/audit-anchors.test.d.ts +0 -2
  25. package/dist/__tests__/audit-anchors.test.d.ts.map +0 -1
  26. package/dist/__tests__/audit-anchors.test.js +0 -152
  27. package/dist/__tests__/audit-anchors.test.js.map +0 -1
  28. package/dist/__tests__/audit-anomalies.test.d.ts +0 -2
  29. package/dist/__tests__/audit-anomalies.test.d.ts.map +0 -1
  30. package/dist/__tests__/audit-anomalies.test.js +0 -663
  31. package/dist/__tests__/audit-anomalies.test.js.map +0 -1
  32. package/dist/__tests__/audit-attestation.test.d.ts +0 -2
  33. package/dist/__tests__/audit-attestation.test.d.ts.map +0 -1
  34. package/dist/__tests__/audit-attestation.test.js +0 -403
  35. package/dist/__tests__/audit-attestation.test.js.map +0 -1
  36. package/dist/__tests__/audit-bench-smoke.test.d.ts +0 -2
  37. package/dist/__tests__/audit-bench-smoke.test.d.ts.map +0 -1
  38. package/dist/__tests__/audit-bench-smoke.test.js +0 -87
  39. package/dist/__tests__/audit-bench-smoke.test.js.map +0 -1
  40. package/dist/__tests__/audit-boundary.test.d.ts +0 -20
  41. package/dist/__tests__/audit-boundary.test.d.ts.map +0 -1
  42. package/dist/__tests__/audit-boundary.test.js +0 -84
  43. package/dist/__tests__/audit-boundary.test.js.map +0 -1
  44. package/dist/__tests__/audit-cli.test.d.ts +0 -2
  45. package/dist/__tests__/audit-cli.test.d.ts.map +0 -1
  46. package/dist/__tests__/audit-cli.test.js +0 -239
  47. package/dist/__tests__/audit-cli.test.js.map +0 -1
  48. package/dist/__tests__/audit-dependencies.test.d.ts +0 -2
  49. package/dist/__tests__/audit-dependencies.test.d.ts.map +0 -1
  50. package/dist/__tests__/audit-dependencies.test.js +0 -116
  51. package/dist/__tests__/audit-dependencies.test.js.map +0 -1
  52. package/dist/__tests__/audit-fixtures.d.ts +0 -265
  53. package/dist/__tests__/audit-fixtures.d.ts.map +0 -1
  54. package/dist/__tests__/audit-fixtures.js +0 -511
  55. package/dist/__tests__/audit-fixtures.js.map +0 -1
  56. package/dist/__tests__/audit-ingest.test.d.ts +0 -2
  57. package/dist/__tests__/audit-ingest.test.d.ts.map +0 -1
  58. package/dist/__tests__/audit-ingest.test.js +0 -473
  59. package/dist/__tests__/audit-ingest.test.js.map +0 -1
  60. package/dist/__tests__/audit-memory-ingest.test.d.ts +0 -12
  61. package/dist/__tests__/audit-memory-ingest.test.d.ts.map +0 -1
  62. package/dist/__tests__/audit-memory-ingest.test.js +0 -135
  63. package/dist/__tests__/audit-memory-ingest.test.js.map +0 -1
  64. package/dist/__tests__/audit-property.test.d.ts +0 -2
  65. package/dist/__tests__/audit-property.test.d.ts.map +0 -1
  66. package/dist/__tests__/audit-property.test.js +0 -771
  67. package/dist/__tests__/audit-property.test.js.map +0 -1
  68. package/dist/__tests__/audit-real-fixtures.test.d.ts +0 -2
  69. package/dist/__tests__/audit-real-fixtures.test.d.ts.map +0 -1
  70. package/dist/__tests__/audit-real-fixtures.test.js +0 -132
  71. package/dist/__tests__/audit-real-fixtures.test.js.map +0 -1
  72. package/dist/__tests__/audit-real-live.test.d.ts +0 -2
  73. package/dist/__tests__/audit-real-live.test.d.ts.map +0 -1
  74. package/dist/__tests__/audit-real-live.test.js +0 -107
  75. package/dist/__tests__/audit-real-live.test.js.map +0 -1
  76. package/dist/__tests__/audit-reconstruct.test.d.ts +0 -2
  77. package/dist/__tests__/audit-reconstruct.test.d.ts.map +0 -1
  78. package/dist/__tests__/audit-reconstruct.test.js +0 -287
  79. package/dist/__tests__/audit-reconstruct.test.js.map +0 -1
  80. package/dist/__tests__/audit-report.test.d.ts +0 -2
  81. package/dist/__tests__/audit-report.test.d.ts.map +0 -1
  82. package/dist/__tests__/audit-report.test.js +0 -186
  83. package/dist/__tests__/audit-report.test.js.map +0 -1
  84. package/dist/__tests__/audit-roundtrip.test.d.ts +0 -2
  85. package/dist/__tests__/audit-roundtrip.test.d.ts.map +0 -1
  86. package/dist/__tests__/audit-roundtrip.test.js +0 -368
  87. package/dist/__tests__/audit-roundtrip.test.js.map +0 -1
  88. package/dist/__tests__/audit-temporal.test.d.ts +0 -2
  89. package/dist/__tests__/audit-temporal.test.d.ts.map +0 -1
  90. package/dist/__tests__/audit-temporal.test.js +0 -364
  91. package/dist/__tests__/audit-temporal.test.js.map +0 -1
  92. package/dist/__tests__/audit-tiers.test.d.ts +0 -2
  93. package/dist/__tests__/audit-tiers.test.d.ts.map +0 -1
  94. package/dist/__tests__/audit-tiers.test.js +0 -282
  95. package/dist/__tests__/audit-tiers.test.js.map +0 -1
  96. package/dist/__tests__/audit-witness-real.test.d.ts +0 -19
  97. package/dist/__tests__/audit-witness-real.test.d.ts.map +0 -1
  98. package/dist/__tests__/audit-witness-real.test.js +0 -82
  99. package/dist/__tests__/audit-witness-real.test.js.map +0 -1
  100. package/dist/__tests__/audit-witness.test.d.ts +0 -2
  101. package/dist/__tests__/audit-witness.test.d.ts.map +0 -1
  102. package/dist/__tests__/audit-witness.test.js +0 -308
  103. package/dist/__tests__/audit-witness.test.js.map +0 -1
  104. package/dist/__tests__/canonical.test.d.ts +0 -2
  105. package/dist/__tests__/canonical.test.d.ts.map +0 -1
  106. package/dist/__tests__/canonical.test.js +0 -162
  107. package/dist/__tests__/canonical.test.js.map +0 -1
  108. package/dist/__tests__/chain-hash-anchor.test.d.ts +0 -22
  109. package/dist/__tests__/chain-hash-anchor.test.d.ts.map +0 -1
  110. package/dist/__tests__/chain-hash-anchor.test.js +0 -55
  111. package/dist/__tests__/chain-hash-anchor.test.js.map +0 -1
  112. package/dist/__tests__/commit-service.integration.test.d.ts +0 -2
  113. package/dist/__tests__/commit-service.integration.test.d.ts.map +0 -1
  114. package/dist/__tests__/commit-service.integration.test.js +0 -95
  115. package/dist/__tests__/commit-service.integration.test.js.map +0 -1
  116. package/dist/__tests__/constructor.test.d.ts +0 -2
  117. package/dist/__tests__/constructor.test.d.ts.map +0 -1
  118. package/dist/__tests__/constructor.test.js +0 -267
  119. package/dist/__tests__/constructor.test.js.map +0 -1
  120. package/dist/__tests__/declared-proof-fixture.d.ts +0 -66
  121. package/dist/__tests__/declared-proof-fixture.d.ts.map +0 -1
  122. package/dist/__tests__/declared-proof-fixture.js +0 -66
  123. package/dist/__tests__/declared-proof-fixture.js.map +0 -1
  124. package/dist/__tests__/fuse-placement.test.d.ts +0 -2
  125. package/dist/__tests__/fuse-placement.test.d.ts.map +0 -1
  126. package/dist/__tests__/fuse-placement.test.js +0 -31
  127. package/dist/__tests__/fuse-placement.test.js.map +0 -1
  128. package/dist/__tests__/fuse-roundtrip.test.d.ts +0 -2
  129. package/dist/__tests__/fuse-roundtrip.test.d.ts.map +0 -1
  130. package/dist/__tests__/fuse-roundtrip.test.js +0 -241
  131. package/dist/__tests__/fuse-roundtrip.test.js.map +0 -1
  132. package/dist/__tests__/fuse-sdk.test.d.ts +0 -2
  133. package/dist/__tests__/fuse-sdk.test.d.ts.map +0 -1
  134. package/dist/__tests__/fuse-sdk.test.js +0 -117
  135. package/dist/__tests__/fuse-sdk.test.js.map +0 -1
  136. package/dist/__tests__/fuse-set-sdk.test.d.ts +0 -2
  137. package/dist/__tests__/fuse-set-sdk.test.d.ts.map +0 -1
  138. package/dist/__tests__/fuse-set-sdk.test.js +0 -721
  139. package/dist/__tests__/fuse-set-sdk.test.js.map +0 -1
  140. package/dist/__tests__/fuse-set.test.d.ts +0 -2
  141. package/dist/__tests__/fuse-set.test.d.ts.map +0 -1
  142. package/dist/__tests__/fuse-set.test.js +0 -868
  143. package/dist/__tests__/fuse-set.test.js.map +0 -1
  144. package/dist/__tests__/fuse-set2.test.d.ts +0 -2
  145. package/dist/__tests__/fuse-set2.test.d.ts.map +0 -1
  146. package/dist/__tests__/fuse-set2.test.js +0 -294
  147. package/dist/__tests__/fuse-set2.test.js.map +0 -1
  148. package/dist/__tests__/fuse-vectors.test.d.ts +0 -2
  149. package/dist/__tests__/fuse-vectors.test.d.ts.map +0 -1
  150. package/dist/__tests__/fuse-vectors.test.js +0 -175
  151. package/dist/__tests__/fuse-vectors.test.js.map +0 -1
  152. package/dist/__tests__/fuse-verify.test.d.ts +0 -2
  153. package/dist/__tests__/fuse-verify.test.d.ts.map +0 -1
  154. package/dist/__tests__/fuse-verify.test.js +0 -250
  155. package/dist/__tests__/fuse-verify.test.js.map +0 -1
  156. package/dist/__tests__/hello-world.test.d.ts +0 -2
  157. package/dist/__tests__/hello-world.test.d.ts.map +0 -1
  158. package/dist/__tests__/hello-world.test.js +0 -9
  159. package/dist/__tests__/hello-world.test.js.map +0 -1
  160. package/dist/__tests__/mock-proof-fixture.d.ts +0 -15
  161. package/dist/__tests__/mock-proof-fixture.d.ts.map +0 -1
  162. package/dist/__tests__/mock-proof-fixture.js +0 -34
  163. package/dist/__tests__/mock-proof-fixture.js.map +0 -1
  164. package/dist/__tests__/policy-enforcement.test.d.ts +0 -2
  165. package/dist/__tests__/policy-enforcement.test.d.ts.map +0 -1
  166. package/dist/__tests__/policy-enforcement.test.js +0 -188
  167. package/dist/__tests__/policy-enforcement.test.js.map +0 -1
  168. package/dist/__tests__/proof-hash-regression.test.d.ts +0 -2
  169. package/dist/__tests__/proof-hash-regression.test.d.ts.map +0 -1
  170. package/dist/__tests__/proof-hash-regression.test.js +0 -95
  171. package/dist/__tests__/proof-hash-regression.test.js.map +0 -1
  172. package/dist/__tests__/proof-hash.test.d.ts +0 -2
  173. package/dist/__tests__/proof-hash.test.d.ts.map +0 -1
  174. package/dist/__tests__/proof-hash.test.js +0 -116
  175. package/dist/__tests__/proof-hash.test.js.map +0 -1
  176. package/dist/__tests__/proof-integrity.test.d.ts +0 -2
  177. package/dist/__tests__/proof-integrity.test.d.ts.map +0 -1
  178. package/dist/__tests__/proof-integrity.test.js +0 -426
  179. package/dist/__tests__/proof-integrity.test.js.map +0 -1
  180. package/dist/__tests__/realistic-proof-fixture.d.ts +0 -56
  181. package/dist/__tests__/realistic-proof-fixture.d.ts.map +0 -1
  182. package/dist/__tests__/realistic-proof-fixture.js +0 -57
  183. package/dist/__tests__/realistic-proof-fixture.js.map +0 -1
  184. package/dist/__tests__/verifier.test.d.ts +0 -2
  185. package/dist/__tests__/verifier.test.d.ts.map +0 -1
  186. package/dist/__tests__/verifier.test.js +0 -531
  187. package/dist/__tests__/verifier.test.js.map +0 -1
  188. package/dist/canonical.d.ts +0 -54
  189. package/dist/canonical.d.ts.map +0 -1
  190. package/dist/canonical.js +0 -119
  191. package/dist/canonical.js.map +0 -1
  192. package/dist/proof-hash.d.ts +0 -9
  193. package/dist/proof-hash.d.ts.map +0 -1
  194. package/dist/proof-hash.js +0 -75
  195. package/dist/proof-hash.js.map +0 -1
  196. package/dist/types.d.ts +0 -705
  197. package/dist/types.d.ts.map +0 -1
  198. package/dist/types.js +0 -3
  199. package/dist/types.js.map +0 -1
  200. package/dist/verifier.d.ts +0 -27
  201. package/dist/verifier.d.ts.map +0 -1
  202. package/dist/verifier.js +0 -844
  203. package/dist/verifier.js.map +0 -1
  204. package/src/__tests__/audit-anchors.test.ts +0 -188
  205. package/src/__tests__/audit-anomalies.test.ts +0 -815
  206. package/src/__tests__/audit-attestation.test.ts +0 -529
  207. package/src/__tests__/audit-bench-smoke.test.ts +0 -108
  208. package/src/__tests__/audit-boundary.test.ts +0 -96
  209. package/src/__tests__/audit-cli.test.ts +0 -288
  210. package/src/__tests__/audit-dependencies.test.ts +0 -141
  211. package/src/__tests__/audit-fixtures.ts +0 -736
  212. package/src/__tests__/audit-ingest.test.ts +0 -575
  213. package/src/__tests__/audit-memory-ingest.test.ts +0 -156
  214. package/src/__tests__/audit-property.test.ts +0 -892
  215. package/src/__tests__/audit-real-fixtures.test.ts +0 -153
  216. package/src/__tests__/audit-real-live.test.ts +0 -128
  217. package/src/__tests__/audit-reconstruct.test.ts +0 -353
  218. package/src/__tests__/audit-report.test.ts +0 -222
  219. package/src/__tests__/audit-roundtrip.test.ts +0 -464
  220. package/src/__tests__/audit-temporal.test.ts +0 -446
  221. package/src/__tests__/audit-tiers.test.ts +0 -343
  222. package/src/__tests__/audit-witness-real.test.ts +0 -92
  223. package/src/__tests__/audit-witness.test.ts +0 -345
  224. package/src/__tests__/canonical.test.ts +0 -253
  225. package/src/__tests__/chain-hash-anchor.test.ts +0 -67
  226. package/src/__tests__/commit-service.integration.test.ts +0 -117
  227. package/src/__tests__/constructor.test.ts +0 -340
  228. package/src/__tests__/declared-proof-fixture.ts +0 -65
  229. package/src/__tests__/fuse-placement.test.ts +0 -32
  230. package/src/__tests__/fuse-roundtrip.test.ts +0 -243
  231. package/src/__tests__/fuse-sdk.test.ts +0 -142
  232. package/src/__tests__/fuse-set-sdk.test.ts +0 -852
  233. package/src/__tests__/fuse-set.test.ts +0 -1005
  234. package/src/__tests__/fuse-set2.test.ts +0 -343
  235. package/src/__tests__/fuse-vectors.test.ts +0 -218
  236. package/src/__tests__/fuse-verify.test.ts +0 -278
  237. package/src/__tests__/hello-world.test.ts +0 -10
  238. package/src/__tests__/mock-proof-fixture.ts +0 -36
  239. package/src/__tests__/policy-enforcement.test.ts +0 -226
  240. package/src/__tests__/proof-hash-regression.test.ts +0 -107
  241. package/src/__tests__/proof-hash.test.ts +0 -129
  242. package/src/__tests__/proof-integrity.test.ts +0 -541
  243. package/src/__tests__/real-fixtures/anchor-after-112762.json +0 -47
  244. package/src/__tests__/real-fixtures/anchor-with-ethereum-112758.json +0 -47
  245. package/src/__tests__/real-fixtures/live-proof-0.json +0 -42
  246. package/src/__tests__/real-fixtures/live-proof-1.json +0 -43
  247. package/src/__tests__/real-fixtures/live-proof-2.json +0 -43
  248. package/src/__tests__/real-fixtures/successor-112760.json +0 -38
  249. package/src/__tests__/real-fixtures/witness-25525146.json +0 -6
  250. package/src/__tests__/real-fixtures/witness-25525147.json +0 -6
  251. package/src/__tests__/realistic-proof-fixture.ts +0 -57
  252. package/src/__tests__/verifier.test.ts +0 -624
@@ -1,287 +0,0 @@
1
- // Copyright (c) Mike Argento. All rights reserved. See LICENSE.
2
- /**
3
- * Tests for @mikeargento/bitgraph-audit causal reconstruction:
4
- * partitioning per (signer key, epochId, chainId), chain components from
5
- * prevB64 hash links, genesis and terminal identification, counter
6
- * evidence, and epoch relationships (epochLink lineage edges, hard-edge
7
- * ordering, observed-but-unordered epochs).
8
- */
9
- import { describe, test, after } from "node:test";
10
- import * as assert from "node:assert/strict";
11
- import { rm } from "node:fs/promises";
12
- import { classifyAnomalies, ingestBundle, reconstructChains, verifyObservedProofs, } from "@mikeargento/bitgraph-audit";
13
- import { sha256 } from "@noble/hashes/sha256";
14
- import { b64, healthyPairs, makeConstructorProof, makeCounterChain, makeEpochLinkProof, makeKey, makeTempDir, proofJson, utf8, writeBundleDir, } from "./audit-fixtures.js";
15
- const tempDirs = [];
16
- after(async () => {
17
- for (const dir of tempDirs) {
18
- await rm(dir, { recursive: true, force: true });
19
- }
20
- });
21
- async function auditBundle(files) {
22
- const dir = await makeTempDir("bitgraph-audit-reconstruct-");
23
- tempDirs.push(dir);
24
- await writeBundleDir(dir, files);
25
- const ingest = await ingestBundle(dir);
26
- await verifyObservedProofs(ingest);
27
- const reconstruction = await reconstructChains(ingest);
28
- const report = await classifyAnomalies(ingest, reconstruction);
29
- return { ingest, reconstruction, report };
30
- }
31
- // ---------------------------------------------------------------------------
32
- // The critical regression: a healthy chain is clean
33
- // ---------------------------------------------------------------------------
34
- describe("reconstruct: healthy slot/commit chain", () => {
35
- test("one partition, one component, zero anomalies, zero unexplained positions", async () => {
36
- const chain = await makeCounterChain({
37
- epochId: "epoch-healthy",
38
- chainId: "bitgraph:main",
39
- pairs: healthyPairs(4), // slot 1/commit 2 ... slot 7/commit 8
40
- });
41
- const { ingest, reconstruction, report } = await auditBundle({
42
- "proofs/p0.json": proofJson(chain.proofs[0].proof),
43
- "proofs/p1.json": proofJson(chain.proofs[1].proof),
44
- "proofs/p2.json": proofJson(chain.proofs[2].proof),
45
- "proofs/p3.json": proofJson(chain.proofs[3].proof),
46
- });
47
- assert.equal(ingest.proofs.length, 4);
48
- assert.equal(reconstruction.partitions.length, 1);
49
- const partition = reconstruction.partitions[0];
50
- assert.deepEqual(partition.key, {
51
- publicKeyB64: chain.key.publicKeyB64,
52
- epochId: "epoch-healthy",
53
- chainId: "bitgraph:main",
54
- });
55
- assert.equal(partition.components.length, 1);
56
- const component = partition.components[0];
57
- assert.deepEqual(component.memberProofHashes, chain.proofs.map((p) => p.proofHash), "link order must follow the hash chain from genesis to terminal");
58
- assert.deepEqual(component.genesisProofHashes, [chain.proofs[0].proofHash]);
59
- assert.deepEqual(component.terminalProofHashes, [chain.proofs[3].proofHash]);
60
- assert.deepEqual(component.brokenLinkProofHashes, []);
61
- assert.equal(component.hasCounterEvidence, true);
62
- assert.deepEqual(component.positionRange, { min: "1", max: "8" });
63
- // THE critical regression: a healthy slot/commit chain produces NO
64
- // unexplained positions and no anomalies of any kind.
65
- assert.deepEqual(report.anomalies, []);
66
- assert.deepEqual(report.divergences, []);
67
- });
68
- test("reconstruction is link-driven: file order and counters are not the mechanism", async () => {
69
- const chain = await makeCounterChain({
70
- epochId: "epoch-shuffled",
71
- pairs: healthyPairs(3),
72
- });
73
- // Write files in an order that reverses the causal order.
74
- const { reconstruction } = await auditBundle({
75
- "a-last.json": proofJson(chain.proofs[2].proof),
76
- "b-middle.json": proofJson(chain.proofs[1].proof),
77
- "c-first.json": proofJson(chain.proofs[0].proof),
78
- });
79
- const component = reconstruction.partitions[0].components[0];
80
- assert.deepEqual(component.memberProofHashes, chain.proofs.map((p) => p.proofHash));
81
- });
82
- test("a counterless link chain still reconstructs as one component", async () => {
83
- const chain = await makeCounterChain({
84
- epochId: "epoch-no-counters",
85
- pairs: [{}, {}, {}], // epochId only: hash links are the only evidence
86
- });
87
- const { reconstruction, report } = await auditBundle({
88
- "p0.json": proofJson(chain.proofs[0].proof),
89
- "p1.json": proofJson(chain.proofs[1].proof),
90
- "p2.json": proofJson(chain.proofs[2].proof),
91
- });
92
- const partition = reconstruction.partitions[0];
93
- assert.equal(partition.components.length, 1);
94
- const component = partition.components[0];
95
- assert.deepEqual(component.memberProofHashes, chain.proofs.map((p) => p.proofHash));
96
- assert.equal(component.hasCounterEvidence, false);
97
- assert.equal(component.positionRange, undefined);
98
- assert.deepEqual(report.anomalies, []);
99
- });
100
- });
101
- // ---------------------------------------------------------------------------
102
- // Partitioning
103
- // ---------------------------------------------------------------------------
104
- describe("reconstruct: partitioning", () => {
105
- test("two independent lineages are never merged", async () => {
106
- const chainA = await makeCounterChain({ epochId: "epoch-A", pairs: healthyPairs(2) });
107
- const chainB = await makeCounterChain({ epochId: "epoch-B", pairs: healthyPairs(2) });
108
- const { reconstruction, report } = await auditBundle({
109
- "a0.json": proofJson(chainA.proofs[0].proof),
110
- "a1.json": proofJson(chainA.proofs[1].proof),
111
- "b0.json": proofJson(chainB.proofs[0].proof),
112
- "b1.json": proofJson(chainB.proofs[1].proof),
113
- });
114
- assert.equal(reconstruction.partitions.length, 2);
115
- const keys = reconstruction.partitions.map((p) => p.key.publicKeyB64).sort();
116
- assert.deepEqual(keys, [chainA.key.publicKeyB64, chainB.key.publicKeyB64].sort());
117
- // Same counters on both chains, yet no collisions: counters are
118
- // partition-local.
119
- assert.deepEqual(report.anomalies, []);
120
- assert.deepEqual(report.divergences, []);
121
- });
122
- test("same signer and epoch on different chainIds are separate partitions (G6)", async () => {
123
- const key = await makeKey();
124
- const main = await makeCounterChain({
125
- key,
126
- epochId: "epoch-multichain",
127
- chainId: "bitgraph:main",
128
- pairs: healthyPairs(2),
129
- payloadPrefix: "main",
130
- });
131
- const globalChain = await makeCounterChain({
132
- key,
133
- epochId: "epoch-multichain",
134
- pairs: healthyPairs(2), // no chainId: normalized "global"
135
- payloadPrefix: "global",
136
- });
137
- const { reconstruction, report } = await auditBundle({
138
- "m0.json": proofJson(main.proofs[0].proof),
139
- "m1.json": proofJson(main.proofs[1].proof),
140
- "g0.json": proofJson(globalChain.proofs[0].proof),
141
- "g1.json": proofJson(globalChain.proofs[1].proof),
142
- });
143
- assert.equal(reconstruction.partitions.length, 2);
144
- assert.deepEqual(reconstruction.partitions.map((p) => p.key.chainId).sort(), ["bitgraph:main", "global"]);
145
- assert.deepEqual(report.anomalies, []);
146
- });
147
- test("chainless proofs stay outside partitions as observed-but-unchained", async () => {
148
- const chain = await makeCounterChain({ epochId: "epoch-with-stray", pairs: healthyPairs(2) });
149
- const chainless = await makeConstructorProof(); // no counter, no epochId
150
- const { ingest, reconstruction, report } = await auditBundle({
151
- "p0.json": proofJson(chain.proofs[0].proof),
152
- "p1.json": proofJson(chain.proofs[1].proof),
153
- "stray.json": proofJson(chainless.proof),
154
- });
155
- assert.equal(ingest.proofs.length, 3);
156
- assert.equal(reconstruction.partitions.length, 1);
157
- assert.equal(reconstruction.partitions[0].memberProofHashes.length, 2);
158
- const strayHash = ingest.proofs.find((p) => p.chainless).proofHash;
159
- assert.deepEqual(reconstruction.unchainedProofHashes, [strayHash]);
160
- // Observed-but-unchained is not an anomaly.
161
- assert.deepEqual(report.anomalies, []);
162
- });
163
- test("a proof with chain fields but no signer key is unpartitioned", async () => {
164
- const broken = JSON.stringify({
165
- version: "bitgraph/1",
166
- artifact: { hashAlg: "sha256", digestB64: b64(sha256(utf8("broken-payload"))) },
167
- commit: { nonceB64: "AAAA", counter: "2", epochId: "epoch-broken" },
168
- signer: { publicKeyB64: 42, signatureB64: "AAAA" },
169
- });
170
- const { ingest, reconstruction } = await auditBundle({ "broken.json": broken });
171
- assert.equal(ingest.proofs.length, 1);
172
- assert.equal(reconstruction.partitions.length, 0);
173
- assert.deepEqual(reconstruction.unpartitionedProofHashes, [ingest.proofs[0].proofHash]);
174
- // The verification dimension reports the structural failure.
175
- assert.equal(ingest.proofs[0].verification.status, "failed");
176
- });
177
- });
178
- // ---------------------------------------------------------------------------
179
- // Missing proofs split components
180
- // ---------------------------------------------------------------------------
181
- describe("reconstruct: missing middle proof", () => {
182
- test("splits the partition into two components with the break identified", async () => {
183
- const chain = await makeCounterChain({ epochId: "epoch-gap", pairs: healthyPairs(3) });
184
- // Omit the middle proof (slot 3 / commit 4).
185
- const { reconstruction } = await auditBundle({
186
- "p0.json": proofJson(chain.proofs[0].proof),
187
- "p2.json": proofJson(chain.proofs[2].proof),
188
- });
189
- const partition = reconstruction.partitions[0];
190
- assert.equal(partition.components.length, 2);
191
- const [first, second] = partition.components;
192
- assert.deepEqual(first.memberProofHashes, [chain.proofs[0].proofHash]);
193
- assert.deepEqual(first.genesisProofHashes, [chain.proofs[0].proofHash]);
194
- assert.deepEqual(first.terminalProofHashes, [chain.proofs[0].proofHash]);
195
- assert.deepEqual(second.memberProofHashes, [chain.proofs[2].proofHash]);
196
- assert.deepEqual(second.genesisProofHashes, []);
197
- assert.deepEqual(second.brokenLinkProofHashes, [chain.proofs[2].proofHash]);
198
- });
199
- });
200
- // ---------------------------------------------------------------------------
201
- // Epoch relationships
202
- // ---------------------------------------------------------------------------
203
- describe("reconstruct: epoch relationships", () => {
204
- test("a valid epochLink produces a hard lineage edge and linked ordering", async () => {
205
- const chainA = await makeCounterChain({ epochId: "epoch-lineage-A", pairs: healthyPairs(2) });
206
- const terminalA = chainA.proofs[1];
207
- const genesisB = await makeEpochLinkProof({
208
- prevEpochId: "epoch-lineage-A",
209
- prevCounter: terminalA.proof.commit.counter,
210
- prevProofHashB64: terminalA.chainHash,
211
- prevPublicKeyB64: chainA.key.publicKeyB64,
212
- toEpochId: "epoch-lineage-B",
213
- counter: "2",
214
- slotCounter: "1",
215
- });
216
- const { reconstruction, report } = await auditBundle({
217
- "a0.json": proofJson(chainA.proofs[0].proof),
218
- "a1.json": proofJson(terminalA.proof),
219
- "b-genesis.json": proofJson(genesisB.proof),
220
- });
221
- const { edges, epochs, orderedPairs } = reconstruction.epochRelationships;
222
- assert.equal(edges.length, 1);
223
- const edge = edges[0];
224
- assert.equal(edge.resolution, "matched");
225
- assert.equal(edge.fromEpochId, "epoch-lineage-A");
226
- assert.equal(edge.toEpochId, "epoch-lineage-B");
227
- assert.equal(edge.predecessorProofHash, terminalA.proofHash);
228
- assert.equal(edge.metadataConsistent, true);
229
- assert.equal(edge.referencedProofIsTerminal, true);
230
- assert.equal(edge.viaProofValid, true);
231
- assert.equal(edge.predecessorValid, true);
232
- assert.equal(edge.hardEdge, true);
233
- assert.deepEqual(orderedPairs, [
234
- { beforeEpochId: "epoch-lineage-A", afterEpochId: "epoch-lineage-B" },
235
- ]);
236
- const epochA = epochs.find((e) => e.epochId === "epoch-lineage-A");
237
- const epochB = epochs.find((e) => e.epochId === "epoch-lineage-B");
238
- assert.equal(epochA.ordering, "linked");
239
- assert.equal(epochB.ordering, "linked");
240
- assert.deepEqual(epochA.linkedSuccessorEpochIds, ["epoch-lineage-B"]);
241
- assert.deepEqual(epochB.linkedPredecessorEpochIds, ["epoch-lineage-A"]);
242
- // The extension point stays untouched by reconstruction.
243
- assert.equal(epochA.anchorBounds, undefined);
244
- // Valid lineage is not an anomaly.
245
- assert.deepEqual(report.anomalies, []);
246
- assert.deepEqual(report.divergences, []);
247
- });
248
- test("a dangling epochLink yields no hard edge and no ordering", async () => {
249
- const genesis = await makeEpochLinkProof({
250
- prevEpochId: "epoch-never-observed",
251
- prevCounter: "10",
252
- prevProofHashB64: b64(sha256(utf8("terminal-never-observed"))),
253
- toEpochId: "epoch-dangling-B",
254
- counter: "2",
255
- slotCounter: "1",
256
- });
257
- const { reconstruction } = await auditBundle({
258
- "b-genesis.json": proofJson(genesis.proof),
259
- });
260
- const { edges, epochs, orderedPairs } = reconstruction.epochRelationships;
261
- assert.equal(edges.length, 1);
262
- assert.equal(edges[0].resolution, "dangling");
263
- assert.equal(edges[0].hardEdge, false);
264
- assert.deepEqual(orderedPairs, []);
265
- assert.equal(epochs.find((e) => e.epochId === "epoch-dangling-B").ordering, "observed-but-unordered");
266
- });
267
- test("epochs with no lineage evidence are observed-but-unordered, never divergence", async () => {
268
- const chainA = await makeCounterChain({ epochId: "epoch-solo-A", pairs: healthyPairs(2) });
269
- const chainB = await makeCounterChain({ epochId: "epoch-solo-B", pairs: healthyPairs(2) });
270
- const { reconstruction, report } = await auditBundle({
271
- "a0.json": proofJson(chainA.proofs[0].proof),
272
- "a1.json": proofJson(chainA.proofs[1].proof),
273
- "b0.json": proofJson(chainB.proofs[0].proof),
274
- "b1.json": proofJson(chainB.proofs[1].proof),
275
- });
276
- const { epochs, edges, orderedPairs } = reconstruction.epochRelationships;
277
- assert.equal(edges.length, 0);
278
- assert.deepEqual(orderedPairs, []);
279
- for (const epoch of epochs) {
280
- assert.equal(epoch.ordering, "observed-but-unordered");
281
- }
282
- // Concurrent-or-unordered is never divergence.
283
- assert.deepEqual(report.divergences, []);
284
- assert.deepEqual(report.anomalies, []);
285
- });
286
- });
287
- //# sourceMappingURL=audit-reconstruct.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit-reconstruct.test.js","sourceRoot":"","sources":["../../src/__tests__/audit-reconstruct.test.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC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M,EAAE,GAAG,MAAM,WAAW,CAAC;YACnD,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC;YAC7C,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC;YAC7C,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC;YAC7C,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC;SAC9C,CAAC,CAAC;QAEH,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,cAAc,CAAC,kBAAkB,CAAC;QAC1E,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC9B,MAAM,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QACnC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;QACzD,CAAC;QACD,+CAA+C;QAC/C,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACzC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=audit-report.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit-report.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/audit-report.test.ts"],"names":[],"mappings":""}
@@ -1,186 +0,0 @@
1
- // Copyright (c) Mike Argento. All rights reserved. See LICENSE.
2
- /**
3
- * Tests for the Phase 4d audit orchestrator and report generators:
4
- * runAudit end-to-end over the standard mixed bundle, JSON report with
5
- * stable codes and correct counts, deterministic double-run equality
6
- * (runMetadata stripped), executive-summary language in the brief's
7
- * style (two-position gap wording, no-winner divergence wording), and
8
- * zero em dash characters in all generated output.
9
- */
10
- import { describe, it, before, after } from "node:test";
11
- import * as assert from "node:assert/strict";
12
- import { rm } from "node:fs/promises";
13
- import { buildJsonReport, buildMarkdownReport, computeExitFlags, runAudit, } from "@mikeargento/bitgraph-audit";
14
- import { makeStandardAuditBundle } from "./audit-fixtures.js";
15
- const EM_DASH = "—";
16
- describe("audit orchestrator and reports: standard mixed bundle", () => {
17
- let bundle;
18
- let result;
19
- let report;
20
- let markdown;
21
- before(async () => {
22
- bundle = await makeStandardAuditBundle();
23
- result = await runAudit(bundle.dir);
24
- report = buildJsonReport(result);
25
- markdown = buildMarkdownReport(result);
26
- });
27
- after(async () => {
28
- await rm(bundle.dir, { recursive: true, force: true });
29
- });
30
- it("runs the full pipeline end-to-end", () => {
31
- assert.equal(result.ingest.container, "directory");
32
- assert.equal(result.runMetadata.bundlePath, bundle.dir);
33
- assert.equal(typeof result.runMetadata.toolVersion, "string");
34
- assert.ok(result.runMetadata.startedAt.includes("T"));
35
- // Two partitions: the main chain and the anchor's own epoch.
36
- assert.equal(result.reconstruction.partitions.length, 2);
37
- // Verification tiers.
38
- assert.equal(result.verification.verified, bundle.expected.verified);
39
- assert.equal(result.verification.failed, bundle.expected.failed);
40
- assert.equal(result.verification.artifactUnavailable, bundle.expected.artifactUnavailable);
41
- assert.equal(result.verification.chainless, bundle.expected.chainless);
42
- // Chain anomalies: gap, break, fork.
43
- const codes = result.anomalies.anomalies.map((a) => a.code).sort();
44
- assert.deepEqual(codes, [
45
- "chain-break-missing",
46
- "predecessor-reuse",
47
- "unexplained-counter-positions",
48
- ]);
49
- assert.equal(result.anomalies.divergences.length, 1);
50
- assert.equal(result.anomalies.divergences[0]?.kind, "predecessor-reuse");
51
- const partyHashes = result.anomalies.divergences[0]?.parties.map((p) => p.proofHash).sort();
52
- assert.deepEqual(partyHashes, [bundle.forkAProofHash, bundle.forkBProofHash].sort());
53
- // The gap is exactly the dropped proof's two positions (slot 3, commit 4).
54
- const gap = result.anomalies.anomalies.find((a) => a.code === "unexplained-counter-positions");
55
- assert.deepEqual((gap?.details).positions, ["3", "4"]);
56
- // Authority analysis is quiet; attestation records exist without documents.
57
- assert.equal(result.authorities.anomalies.length, 0);
58
- assert.equal(result.attestations.records.length, 6);
59
- assert.equal(result.attestations.counts.proofsWithDocument, 0);
60
- // The anchor was identified and its witness verified with the header timestamp.
61
- assert.deepEqual(result.temporal.verifiedAnchorProofHashes, [bundle.anchorProofHash]);
62
- const outcome = result.witnesses.outcomes.find((o) => o.verified);
63
- assert.equal(outcome?.anchorProofHash, bundle.anchorProofHash);
64
- assert.equal(outcome?.timestamp, bundle.blockTimestamp);
65
- assert.equal(outcome?.blockNumber, String(bundle.blockNumber));
66
- // Exit flags: unsupported-version sets bit 1, anomalies set bit 2.
67
- assert.deepEqual(computeExitFlags(result), {
68
- verificationFailures: true,
69
- chainAnomaliesOrDivergences: true,
70
- code: 3,
71
- });
72
- });
73
- it("JSON report carries the schema version, stable codes, and correct counts", () => {
74
- assert.equal(report.reportSchemaVersion, "bitgraph-audit-report/2");
75
- assert.equal(report.toolVersion, result.runMetadata.toolVersion);
76
- assert.equal(report.runMetadata.nondeterministic, true);
77
- assert.equal(report.input.counts.observed, bundle.expected.observed);
78
- assert.equal(report.input.counts.proofFiles, bundle.expected.proofFiles);
79
- assert.equal(report.input.counts.exactDuplicates, bundle.expected.exactDuplicates);
80
- assert.equal(report.input.counts.semanticDuplicates, bundle.expected.semanticDuplicates);
81
- assert.equal(report.input.counts.unsupportedVersion, bundle.expected.unsupportedVersion);
82
- assert.equal(report.input.counts.verified, bundle.expected.verified);
83
- assert.equal(report.input.counts.failed, bundle.expected.failed);
84
- assert.equal(report.input.counts.artifactUnavailable, bundle.expected.artifactUnavailable);
85
- assert.equal(report.input.counts.chainless, bundle.expected.chainless);
86
- // Machine consumers key on stable codes, never prose.
87
- const codes = report.anomalies.map((a) => a.code);
88
- for (const expected of [
89
- "unsupported-version",
90
- "exact-duplicate",
91
- "semantic-duplicate",
92
- "unexplained-counter-positions",
93
- "chain-break-missing",
94
- "predecessor-reuse",
95
- ]) {
96
- assert.ok(codes.includes(expected), `anomaly list includes ${expected}`);
97
- }
98
- assert.equal(report.anomalies.length, 6);
99
- assert.deepEqual(report.summary.anomalyCountsByCode, {
100
- "chain-break-missing": 1,
101
- "exact-duplicate": 1,
102
- "predecessor-reuse": 1,
103
- "semantic-duplicate": 1,
104
- "unexplained-counter-positions": 1,
105
- "unsupported-version": 1,
106
- });
107
- // Per-proof records: sorted by canonical hash, compact fields only.
108
- const hashes = report.proofs.map((p) => p.proofHash);
109
- assert.deepEqual(hashes, [...hashes].sort());
110
- assert.equal(report.proofs.length, bundle.expected.observed);
111
- assert.ok(!("proof" in report.proofs[0]), "raw proof objects never serialized");
112
- // The stored-form copy is cross-checked, never trusted. Its embedded
113
- // proofHash matched, so no mismatch escalation and no finding; the
114
- // record keeps the first observed copy's "absent" status per ingest
115
- // semantics (only a mismatch on any copy escalates).
116
- const genesis = report.proofs.find((p) => p.proofHash === bundle.chainProofHashes[0]);
117
- assert.notEqual(genesis?.embeddedProofHash, "mismatch");
118
- assert.ok(!codes.includes("proofhash-mismatch"));
119
- assert.equal(genesis?.sources.length, 3);
120
- assert.equal(genesis?.verificationStatus, "verified");
121
- // Partition intactness: main chain broken, anchor partition intact.
122
- assert.equal(report.partitions.length, 2);
123
- const mainPartition = report.partitions.find((p) => p.key.epochId === bundle.epochId);
124
- const anchorPartition = report.partitions.find((p) => p.key.epochId === bundle.anchorEpochId);
125
- assert.equal(mainPartition?.intact, false);
126
- assert.equal(mainPartition?.components.length, 2);
127
- assert.equal(anchorPartition?.intact, true);
128
- assert.equal(report.summary.chainIntact, false);
129
- assert.equal(report.summary.partitionsIntact, 1);
130
- // Epoch relationships: two epochs, no ordering evidence between them.
131
- assert.equal(report.summary.epochsObserved, 2);
132
- assert.equal(report.epochRelationships.unorderedPairs.length, 1);
133
- assert.equal(report.epochRelationships.orderedPairs.length, 0);
134
- // Rejected input listed with path and offending version string.
135
- assert.equal(report.unsupportedVersions.length, 1);
136
- assert.equal(report.unsupportedVersions[0]?.path, bundle.unsupportedPath);
137
- assert.equal(report.unsupportedVersions[0]?.version, "occ/1");
138
- // Temporal summary: the anchor's own segment is lower-bounded, the rest unanchored.
139
- assert.equal(report.summary.temporal.anchorsIdentified, 1);
140
- assert.equal(report.summary.temporal.anchorsWithVerifiedWitness, 1);
141
- assert.ok(report.summary.temporal.segmentsLowerBounded >= 1);
142
- assert.ok(report.summary.temporal.segmentsUnanchored >= 1);
143
- // Exit flags mirrored into the summary.
144
- assert.deepEqual(report.summary.exit, {
145
- verificationFailures: true,
146
- chainAnomaliesOrDivergences: true,
147
- code: 3,
148
- });
149
- });
150
- it("is deterministic across runs once runMetadata is stripped", async () => {
151
- const resultA = await runAudit(bundle.dir);
152
- const resultB = await runAudit(bundle.dir);
153
- const reportA = buildJsonReport(resultA);
154
- const reportB = buildJsonReport(resultB);
155
- const { runMetadata: metaA, ...restA } = reportA;
156
- const { runMetadata: metaB, ...restB } = reportB;
157
- assert.deepEqual(restA, restB);
158
- assert.equal(JSON.stringify(restA), JSON.stringify(restB));
159
- // The markdown differs only in the wall-clock start time.
160
- const mdA = buildMarkdownReport(resultA).replaceAll(metaA.startedAt, "STARTED_AT");
161
- const mdB = buildMarkdownReport(resultB).replaceAll(metaB.startedAt, "STARTED_AT");
162
- assert.equal(mdA, mdB);
163
- });
164
- it("markdown executive summary uses the brief's gap and divergence language", () => {
165
- assert.ok(markdown.includes("# BitGraph Audit Report"));
166
- // G2 gap language: two-position wording, honest absence claim.
167
- assert.ok(markdown.includes("neither commit positions nor referenced slot positions"));
168
- assert.ok(markdown.includes("does not, by itself, prove"));
169
- // Divergence: no winner is ever chosen.
170
- assert.ok(markdown.includes("does not choose between them"));
171
- // Rejected legacy input listed with its path and version string.
172
- assert.ok(markdown.includes(bundle.unsupportedPath));
173
- assert.ok(markdown.includes("occ/1"));
174
- // Chain intactness stated per partition.
175
- assert.ok(markdown.includes("Chain intact: no"));
176
- assert.ok(markdown.includes("Chain intact: yes"));
177
- });
178
- it("contains zero em dash characters in the markdown and the JSON", () => {
179
- assert.ok(!markdown.includes(EM_DASH), "markdown contains no em dashes");
180
- const json = JSON.stringify(report, null, 2);
181
- assert.ok(!json.includes(EM_DASH), "JSON report contains no em dashes");
182
- // The report never leaks signatures or raw proof bodies.
183
- assert.ok(!json.includes('"signatureB64"'));
184
- });
185
- });
186
- //# sourceMappingURL=audit-report.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit-report.test.js","sourceRoot":"","sources":["../../src/__tests__/audit-report.test.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,QAAQ,GACT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAA4B,MAAM,qBAAqB,CAAC;AAExF,MAAM,OAAO,GAAG,GAAG,CAAC;AAEpB,QAAQ,CAAC,uDAAuD,EAAE,GAAG,EAAE;IACrE,IAAI,MAA2B,CAAC;IAChC,IAAI,MAAmB,CAAC;IACxB,IAAI,MAAuB,CAAC;IAC5B,IAAI,QAAgB,CAAC;IAErB,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,MAAM,GAAG,MAAM,uBAAuB,EAAE,CAAC;QACzC,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACpC,MAAM,GAAG,eA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