@@ -965,7 +965,20 @@ test('every CLI refuses a flag it does not know, before it does anything', () =>
965965 [ 'evidence-context.mjs' , [ '--all' ] ] ,
966966 [ 'audit.mjs' , [ ] ] , [ 'brief.mjs' , [ ] ] , [ 'doctor.mjs' , [ ] ] , [ 'gate.mjs' , [ ] ] , [ 'handoff.mjs' , [ ] ] ,
967967 [ 'preflight.mjs' , [ ] ] , [ 'prior.mjs' , [ ] ] , [ 'research.mjs' , [ '--dry-run' ] ] , [ 'bundle.mjs' , [ ] ] ,
968+ // Added 2026-10-11 (#271). measure and export-warc refuse before they look for a project.
969+ // artifact with no subcommand names the unknown flag and exits 2; with a subcommand the
970+ // refusal is exit 3 (BLOCKED) and artifact-cli.test.mjs covers it. panel refuses before
971+ // it listens on anything.
972+ [ 'measure.mjs' , [ ] ] , [ 'export-warc.mjs' , [ ] ] , [ 'artifact.mjs' , [ ] ] , [ 'panel.mjs' , [ ] ] ,
968973 ] ;
974+ // Found 2026-10-11 (#271): four CLIs called refuseUnknownFlags and had no row here, so a new
975+ // CLI could be forgotten again. Every file under bin/ that refuses unknown flags by that name
976+ // must have a row; a CLI with its own refusal (collect-remote, disclosure, mcp-server,
977+ // path-authority) is covered by its own tests.
978+ const refusing = fs . readdirSync ( path . join ( KIT_ROOT , 'bin' ) )
979+ . filter ( ( name ) => name . endsWith ( '.mjs' ) && / r e f u s e U n k n o w n F l a g s \( / . test ( fs . readFileSync ( path . join ( KIT_ROOT , 'bin' , name ) , 'utf8' ) ) ) ;
980+ const missing = refusing . filter ( ( name ) => ! cases . some ( ( [ bin ] ) => bin === name ) ) ;
981+ assert . deepEqual ( missing , [ ] , `these CLIs refuse unknown flags but have no row in this table: ${ missing . join ( ', ' ) } ` ) ;
969982 for ( const [ bin , args ] of cases ) {
970983 const root = planned ( 'flags' ) ;
971984 const r = run ( bin , [ ...args , '--no-such-flag' ] , { root, env : { HOME : home , USERPROFILE : home , RESEARCH_KIT_CONFIG : path . join ( home , 'c.json' ) } } ) ;
0 commit comments