Skip to content

Commit 9cbca21

Browse files
committed
test(plugin-security): pin the capability collision refusal on its token, not its prose
Two `bootstrap-seed-round-trips` cases asserted loudness by matching the old sentence "owned by another package". The wording moved when the refusal grew a diagnostic record, so they now match the stable `capability_name_collision` grep token and additionally assert the record on the pass outcome. Claude-Session: https://claude.ai/code/session_01URLHobLUJB9K1ABV6ofdjj Co-authored-by: Claude <noreply@anthropic.com>
1 parent aafc3ce commit 9cbca21

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎packages/plugins/plugin-security/src/bootstrap-seed-round-trips.test.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,12 @@ describe('#11096 — the batched read preserves the provenance branches', () =>
628628
expect(r.skippedForeign).toBe(1);
629629
expect(r.materializedNames).toEqual(['crm.cap.0']);
630630
expect(ql.rows[0].package_id).toBe('com.example.a'); // untouched
631-
expect(warns.some((w) => w.includes('owned by another package'))).toBe(true);
631+
// [#18023] The loudness is pinned on the stable grep TOKEN, not on prose:
632+
// the wording moved when the refusal grew a diagnostic record, and a pin on
633+
// a sentence re-reds on every rewording without ever asking the question it
634+
// was written to ask. The record on the outcome is the other half.
635+
expect(warns.some((w) => w.includes('capability_name_collision'))).toBe(true);
636+
expect(r.collisions?.map((d) => d.name)).toEqual(['crm.cap.0']);
632637
});
633638

634639
it('still CLAIMS a derived platform placeholder for an explicit declaration', async () => {
@@ -699,7 +704,9 @@ describe('#11096 — the batched read preserves the provenance branches', () =>
699704
expect(r.skippedForeign).toBe(1);
700705
expect(ql.rows).toHaveLength(1);
701706
expect(ql.rows[0].package_id).toBe('com.example.a');
702-
expect(warns.some((w) => w.includes('owned by another package'))).toBe(true);
707+
// [#18023] Token, not prose — see the sibling case above.
708+
expect(warns.some((w) => w.includes('capability_name_collision'))).toBe(true);
709+
expect(r.collisions?.map((d) => d.declaredBy)).toEqual(['com.example.b']);
703710
});
704711
});
705712

0 commit comments

Comments
 (0)