From 9e8326f7666761fd95030588e2fed1b84a5bc01b Mon Sep 17 00:00:00 2001 From: garrytan Date: Sun, 1 Nov 2026 12:55:27 +0000 Subject: [PATCH] test(pregate): a head policy that adds a lane over a lane-less base is strict (GST-775) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- test/pregate-policy-lane-verdicts.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/pregate-policy-lane-verdicts.test.ts b/test/pregate-policy-lane-verdicts.test.ts index 5eda69051..97407bcaf 100644 --- a/test/pregate-policy-lane-verdicts.test.ts +++ b/test/pregate-policy-lane-verdicts.test.ts @@ -170,6 +170,15 @@ describe('negative controls: a policy that declares lanes still fails hard', () expect([r.status, r.row.status, r.row.code]).toEqual([EXIT.fail, 'fail', 'PREGATE_NO_LANE']); }); + // Value: protects=a --policy-from head file that adds a lane over a lane-less base makes the run strict; fails_when=the head merge + // keeps the base's declaresLanes only; why_new=the merge is new; seam=none; no_claim=none + test('--policy-from head adding dependencies over a timeout-only base keeps PREGATE_NO_LANE', () => { + const repo = fixture({ pregate: { $schema: SCHEMA, timeout_s: 1800 }, baseFiles: NO_PLATFORM_LANE }); + commit(repo, { ...GREEN, '.gstack/pregate.json': JSON.stringify({ $schema: SCHEMA, timeout_s: 1800, dependencies: { 'bin/tool': ['test/util.test.js'] } }) + '\n' }); + const r = lanes(repo, ['--policy-from', 'head']); + expect([r.status, r.row.status, r.row.code]).toEqual([EXIT.fail, 'fail', 'PREGATE_NO_LANE']); + }); + // Value: protects=without a [] declaration a deleted test still runs its owning suite and an unmapped deleted source still fails; // fails_when=moving the removed-test handling waives non-test removals; why_new=new; seam=none; no_claim=none test('a deleted source file under a lane-declaring policy still owes a lane', () => {