diff --git a/scripts/check-no-main-deletions.mjs b/scripts/check-no-main-deletions.mjs index 1b37318638..3c7219d0c2 100644 --- a/scripts/check-no-main-deletions.mjs +++ b/scripts/check-no-main-deletions.mjs @@ -740,6 +740,37 @@ const RETIRED_ROUTING_FILES = [ const FALLOW_PRUNE_REASON = "fallow 3 reuses one audit snapshot per checkout and the hook prunes with `fallow audit-cache prune`, replacing this script"; +const PLAN_V1_SAMPLE_REASON = + "Plan v1 is no longer a supported cloud transport; the adapters, workflows and smoke tests now accept Plan v2 only"; + +const PLAN_V1_SAMPLE_FILES = [ + "examples/aws-lambda/sample-events/assemble-v1.json", + "examples/aws-lambda/sample-events/plan-v1.json", + "examples/aws-lambda/sample-events/render-chunk-v1.json", + "examples/gcp-cloud-run/sample-events/assemble-v1.json", + "examples/gcp-cloud-run/sample-events/plan-v1.json", + "examples/gcp-cloud-run/sample-events/render-chunk-v1.json", +]; + +const PLAN_PARITY_HARNESS_REASON = + "the completed Plan v1-to-v2 rollout harness has no supported v1 cloud path left to exercise"; + +const PLAN_PARITY_HARNESS_FILES = [ + "packages/producer/fixtures/plan-parity-size-pressure/.plan-parity-fixture.json", + "packages/producer/fixtures/plan-parity-size-pressure/index.html", + "packages/producer/fixtures/plan-parity-visual-audio/.plan-parity-fixture.json", + "packages/producer/fixtures/plan-parity-visual-audio/index.html", + "packages/producer/src/plan-parity-analysis.test.ts", + "packages/producer/src/plan-parity-analysis.ts", + "packages/producer/src/plan-parity-contract.test.ts", + "packages/producer/src/plan-parity-contract.ts", + "packages/producer/src/plan-parity-fixture.test.ts", + "packages/producer/src/plan-parity-fixture.ts", + "packages/producer/src/plan-parity-harness.test.ts", + "packages/producer/src/plan-parity-harness.ts", + "packages/producer/src/plan-parity-lambda-local-driver.ts", +]; + export const ALLOWED_DELETIONS = new Map([ // Prompt Guide as six topic pages [ @@ -2072,6 +2103,8 @@ export const ALLOWED_DELETIONS = new Map([ ], ["scripts/prune-fallow-audit-caches.mjs", FALLOW_PRUNE_REASON], ["scripts/prune-fallow-audit-caches.test.mjs", FALLOW_PRUNE_REASON], + ...PLAN_V1_SAMPLE_FILES.map((path) => [path, PLAN_V1_SAMPLE_REASON]), + ...PLAN_PARITY_HARNESS_FILES.map((path) => [path, PLAN_PARITY_HARNESS_REASON]), [ "packages/engine/src/services/frameCapture-releaseInjectedVideoMedia.browser.test.ts", "the revert of #5795 removes releaseInjectedVideoMedia, the only code this file tested", diff --git a/scripts/check-no-main-deletions.test.mjs b/scripts/check-no-main-deletions.test.mjs index 7682b97cf2..4e0ee57777 100644 --- a/scripts/check-no-main-deletions.test.mjs +++ b/scripts/check-no-main-deletions.test.mjs @@ -68,3 +68,17 @@ test("the Chrome beat analyzer removal is explicitly scoped", () => { assert.match(ALLOWED_DELETIONS.get(path) ?? "", /TypeScript beat tracker/); assert.equal(ALLOWED_DELETIONS.has("packages/core/src/beats/beatDetection.ts"), false); }); + +test("the Plan v1 cleanup allowlist is limited to samples and the rollout harness", () => { + for (const path of [ + "examples/aws-lambda/sample-events/plan-v1.json", + "examples/gcp-cloud-run/sample-events/plan-v1.json", + ]) + assert.match(ALLOWED_DELETIONS.get(path) ?? "", /no longer a supported cloud transport/); + + assert.match( + ALLOWED_DELETIONS.get("packages/producer/src/plan-parity-harness.ts") ?? "", + /completed Plan v1-to-v2 rollout harness/, + ); + assert.equal(ALLOWED_DELETIONS.has("packages/producer/src/services/distributed/plan.ts"), false); +});