From 03b8f6849f4aeef415da5fb8b338892278ac48e7 Mon Sep 17 00:00:00 2001 From: montjeffrey Date: Thu, 8 Oct 2026 16:46:32 +0000 Subject: [PATCH] test(context): reject malformed Claude validation entries --- tests/lib/context-profile-native-claude.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/lib/context-profile-native-claude.test.js b/tests/lib/context-profile-native-claude.test.js index a29e2d70e..f74c6892a 100644 --- a/tests/lib/context-profile-native-claude.test.js +++ b/tests/lib/context-profile-native-claude.test.js @@ -109,6 +109,12 @@ for (const version of ['2.1.291 (Claude Code)', '2.1.292', '2.1.292 (Claude Code const corruptions = { 'validation error': [{ validate: report => ({ ...report, success: false, manifest: { errors: [{ path: 'skills' }] } }) }, /plugin validation failed/], + 'null validation entry': [{ validate: report => ({ ...report, contents: [null] }) }, /plugin validation failed/], + 'validation entry without errors': [{ validate: report => ({ ...report, contents: [{ type: 'skill' }] }) }, /plugin validation failed/], + 'validation entry with non-array errors': [{ validate: report => ({ ...report, contents: [{ type: 'skill', errors: 'bad' }] }) }, + /plugin validation failed/], + 'validation entry error': [{ validate: report => ({ ...report, contents: [{ type: 'skill', errors: [{ path: 'name' }] }] }) }, + /plugin validation failed/], 'extra plugin': [{ list: plugins => [...plugins, { id: 'other@market', scope: 'user', enabled: true, installPath: '/elsewhere' }] }, /plugin discovery mismatch/], 'moved plugin': [{ list: plugins => [{ ...plugins[0], installPath: '/elsewhere' }] }, /plugin discovery mismatch/], 'disabled plugin': [{ list: plugins => [{ ...plugins[0], enabled: false }] }, /plugin discovery mismatch/],