@@ -274,10 +274,9 @@ test('bypass phrase variants do NOT count', async () => {
274274 const repo = makeFakeFleetRepo ( )
275275 try {
276276 const file = makeCanonicalFile ( repo , '.git-hooks/pre-push.mts' )
277- // Each of these should NOT bypass — phrase must be exact.
277+ // Each of these should NOT bypass: a word of the phrase is missing.
278+ // (Case + dash/space variants DO count — see the next test.)
278279 for ( const variant of [
279- 'allow fleet-fork bypass' , // lowercase
280- 'Allow fleet fork bypass' , // space instead of hyphen
281280 'Allow fleet-fork' , // no "bypass"
282281 'fleet-fork bypass' , // no "Allow"
283282 ] ) {
@@ -299,6 +298,34 @@ test('bypass phrase variants do NOT count', async () => {
299298 }
300299} )
301300
301+ test ( 'case / hyphen / space / dash variants of the phrase all count' , async ( ) => {
302+ const repo = makeFakeFleetRepo ( )
303+ try {
304+ const file = makeCanonicalFile ( repo , '.git-hooks/pre-push.mts' )
305+ // The normalizer lowercases + folds dash variants + whitespace, so a
306+ // human typing lowercase, spaces, or an em-dash instead of the canonical
307+ // mixed-case hyphenated phrase still bypasses. Only the words + order matter.
308+ for ( const variant of [
309+ 'Allow fleet-fork bypass' , // canonical
310+ 'allow fleet-fork bypass' , // lowercase
311+ 'ALLOW FLEET-FORK BYPASS' , // uppercase
312+ 'Allow fleet fork bypass' , // spaces instead of hyphen
313+ 'Allow fleet—fork bypass' , // em-dash
314+ ] ) {
315+ const result = await runHook (
316+ {
317+ tool_input : { file_path : file , new_string : 'x' } ,
318+ tool_name : 'Edit' ,
319+ } ,
320+ userTurn ( variant ) ,
321+ )
322+ assert . strictEqual ( result . code , 0 , `variant should bypass: ${ variant } ` )
323+ }
324+ } finally {
325+ rmSync ( repo , { force : true , recursive : true } )
326+ }
327+ } )
328+
302329test ( 'paths under socket-wheelhouse/template/ always pass' , async ( ) => {
303330 // Even if Claude tries to spell out a path that would otherwise
304331 // match a canonical prefix, anything under .../socket-wheelhouse/
0 commit comments