Lines 33-73typescript
34 mode: REVIEW_MODE.ORDINARY,
35 snapshot: testSnapshot({ baseTree: "1".repeat(40), completeTree: "2".repeat(40), route: REVIEW_ROUTE.STANDARD, lenses: [REVIEW_LENS.RELIABILITY] }),
36 evidenceHash: "a".repeat(64),
37 budget: { review_batches: 1, review_actors: 1, refuter_batches: 1, fix_batches: 1, validator_runs: 1, final_verifications: 1, judgment_rounds: 0, judge_runs: 0 },
39 store.runReducerOperation({ lineageId, transition: "ordinary-discovery", idempotencyKey: "freeze", input: { rows: [] } });
42test("bundle export is deterministic and compatible import installs its exact graph closure atomically", (t) => {
43 const { parent, source, target } = repository(t);
44 createLineage(source);
45 const first = join(parent, "first.review-bundle");
46 const second = join(parent, "second.review-bundle");
47 const exporter = new ReviewBundleExporter(source);
48 const exported = exporter.export({ outputPath: first, operationId: "export-one" });
49 exporter.export({ outputPath: second, operationId: "export-two" });
50 assert.deepEqual(readFileSync(first), readFileSync(second));
51 assert.equal(exported.roots[0]?.lineage_id, "bundle-lineage");
53 const importer = new ReviewBundleImporter(target, { mutationLockPlatform: qualifiedReviewLockPlatform() });
54 const imported = importer.import({ inputPath: first, operationId: "import-one", acknowledgeUntrustedBundleSource: true });
55 assert.equal(imported.imported, true);
MediumDynamic Require
Package source references dynamic require/import behavior.
tests/review-bundle.test.tsView on unpkg · L53 56 assert.equal(ReviewTransactionStore.forRepository(target).read("bundle-lineage").lineage_id, "bundle-lineage");
57 assert.equal(importer.import({ inputPath: first, operationId: "import-two" }).imported, false);
60// RISK2-001 (openspec/changes/bounded-review-graph-parity/reviews/post-apply-4r-round2-ledger.md):
61// repository_identity/root_commit_ids match alone cannot prove a bundle's lineage content was
62// ever produced by a legitimate export from THIS repository's own history — anyone who knows the
63// (often public) root commit can forge a structurally valid bundle claiming the same identity.
64// These tests exercise the resulting trust gate.
65test("bundle import denies adopting a brand-new lineage without an explicit untrusted-source acknowledgement", (t) => {
66 const { parent, source, target } = repository(t);
67 createLineage(source);
68 const bundle = join(parent, "transfer.review-bundle");
69 new ReviewBundleExporter(source).export({ outputPath: bundle, operationId: "export" });
71 () => new ReviewBundleImporter(target, { mutationLockPlatform: qualifiedReviewLockPlatform() }).import({ inputPath: bundle, operationId: "no-acknowledgement" }),
72 /REVIEW_BUNDLE_UNTRUSTED_SOURCE/,