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