@@ -366,6 +366,8 @@ const missingSchemaFile = scopeResults.filter((r) => !r.schemaFileExists);
366366const missingGateway = scopeResults . filter (
367367 ( r ) => r . gatewayStatus === "missing"
368368) ;
369+ const blockingMissingGateway = missingGateway . filter ( ( r ) => r . isNew ) ;
370+ const inheritedMissingGateway = missingGateway . filter ( ( r ) => ! r . isNew ) ;
369371const gatewayErrors = scopeResults . filter ( ( r ) => r . gatewayStatus === "error" ) ;
370372const metadataDrift = scopeResults . filter (
371373 ( r ) => r . metadataMismatches && r . metadataMismatches . length > 0
@@ -377,6 +379,8 @@ const summary = {
377379 fullyConsistent : fullyConsistent . length ,
378380 missingSchemaFile : missingSchemaFile . length ,
379381 missingGateway : missingGateway . length ,
382+ blockingMissingGateway : blockingMissingGateway . length ,
383+ inheritedMissingGateway : inheritedMissingGateway . length ,
380384 gatewayErrors : gatewayErrors . length ,
381385 metadataDrift : metadataDrift . length ,
382386 orphanedSchemas : orphanedSchemas . length ,
@@ -388,6 +392,12 @@ const issueCount =
388392 summary . gatewayErrors +
389393 summary . metadataDrift +
390394 summary . orphanedSchemas ;
395+ const blockingIssueCount =
396+ summary . missingSchemaFile +
397+ summary . blockingMissingGateway +
398+ summary . gatewayErrors +
399+ summary . metadataDrift +
400+ summary . orphanedSchemas ;
391401
392402// ---------------------------------------------------------------------------
393403// Output
@@ -406,13 +416,17 @@ if (jsonOutput) {
406416}
407417
408418// Human-readable summary always goes to stderr
409- if ( issueCount === 0 ) {
419+ if ( blockingIssueCount === 0 && issueCount === 0 ) {
410420 process . stderr . write (
411421 `Schema health check PASSED: all ${ summary . total } scopes are consistent.\n`
412422 ) ;
423+ } else if ( blockingIssueCount === 0 ) {
424+ process . stderr . write (
425+ `Schema health check PASSED with ${ issueCount } inherited non-blocking issue(s).\n\n`
426+ ) ;
413427} else {
414428 process . stderr . write (
415- `Schema health check FAILED: ${ issueCount } issue(s) found\n\n`
429+ `Schema health check FAILED: ${ blockingIssueCount } blocking issue(s) found ( ${ issueCount } total issue(s)). \n\n`
416430 ) ;
417431
418432 if ( missingSchemaFile . length > 0 ) {
@@ -427,7 +441,7 @@ if (issueCount === 0) {
427441 if ( missingGateway . length > 0 ) {
428442 process . stderr . write ( "Not registered in Gateway:\n" ) ;
429443 for ( const r of missingGateway ) {
430- const tag = r . isNew ? " [added in this PR]" : "" ;
444+ const tag = r . isNew ? " [added in this PR]" : " [pre-existing debt] " ;
431445 process . stderr . write ( ` - ${ r . scope } (connector: ${ r . connector } )${ tag } \n` ) ;
432446 }
433447 process . stderr . write ( "\n" ) ;
@@ -463,9 +477,15 @@ if (issueCount === 0) {
463477 process . stderr . write ( "\n" ) ;
464478 }
465479
466- process . stderr . write (
467- "These issues must be resolved before connectors can be used by Personal Servers.\n"
468- ) ;
480+ if ( blockingIssueCount > 0 ) {
481+ process . stderr . write (
482+ "These blocking issues must be resolved before connectors can be used by Personal Servers.\n"
483+ ) ;
484+ } else {
485+ process . stderr . write (
486+ "Inherited Gateway registration debt remains. This PR does not introduce new Gateway registration gaps.\n"
487+ ) ;
488+ }
469489}
470490
471- process . exit ( issueCount === 0 ? 0 : 1 ) ;
491+ process . exit ( blockingIssueCount === 0 ? 0 : 1 ) ;
0 commit comments