| 321 | assert( |
| 322 | result && typeof result.action === 'string', |
| 323 | 'checkConsent should return { action: string }' |
| 324 | ); |
| 325 | assert( |
| 326 | ['allow', 'block', 'first-encounter'].includes(result.action), |
| 327 | `checkConsent action should be allow/block/first-encounter, got ${result.action}` |
| 328 | ); |
| 329 | }); |
| 330 | |
| 331 | // ── 5. Glob Pattern Matching (protect-files) ── |
| 332 | |
| 333 | console.log('\n▶ Glob Pattern Security'); |
| 334 | |
| 335 | test('protect-files blocks protected glob patterns', () => { |
| 336 | // Create a temporary harness.json with a protected pattern |
| 337 | const tmpConfig = path.join(os.tmpdir(), `citadel-test-${Date.now()}.json`); |