@@ -38,6 +38,28 @@ function resolveVectorAdapterStatus(vectorAdapterSource, vectorAdapterModulePres
3838 return 'prefilter_only' ;
3939}
4040
41+ function resolveQueryBackendDefaultMode ( queryBackendSource , graphAdapterModulePresent ) {
42+ if ( ! graphAdapterModulePresent ) {
43+ return 'absent' ;
44+ }
45+
46+ const modeMatch = queryBackendSource . match ( / r e q u e s t \. m o d e \s * \| \| \s * [ ' " ] ( [ ^ ' " ] + ) [ ' " ] / ) ;
47+ if ( modeMatch && ( modeMatch [ 1 ] === 'local_hybrid' || modeMatch [ 1 ] === 'keyword_only' ) ) {
48+ return modeMatch [ 1 ] ;
49+ }
50+
51+ return 'unknown' ;
52+ }
53+
54+ function resolveVectorAdapterLinkedIntoQueryBackend ( queryBackendSource , graphAdapterModulePresent ) {
55+ if ( ! graphAdapterModulePresent ) {
56+ return false ;
57+ }
58+
59+ return queryBackendSource . includes ( 'createLocalVectorAccelerationAdapter' )
60+ && queryBackendSource . includes ( 'vectorAccelerationAdapter.accelerate' ) ;
61+ }
62+
4163function evaluateFoundationReadiness ( options = { } ) {
4264 const repoRoot = options . repoRoot || path . resolve ( __dirname , '..' ) ;
4365 const packageJson = readJsonIfExists ( path . join ( repoRoot , 'package.json' ) ) ;
@@ -80,6 +102,7 @@ function evaluateFoundationReadiness(options = {}) {
80102 ) ;
81103
82104 const storeSource = readTextIfExists ( storePath ) ;
105+ const queryBackendSource = readTextIfExists ( graphAdapterPath ) ;
83106 const vectorAdapterSource = readTextIfExists ( vectorAdapterPath ) ;
84107 const enDashboard = readTextIfExists ( enDashboardPath ) ;
85108 const zhDashboard = readTextIfExists ( zhDashboardPath ) ;
@@ -89,9 +112,14 @@ function evaluateFoundationReadiness(options = {}) {
89112 storeSource . includes ( 'createFileBackedKnowledgeGraphStore' )
90113 && storeSource . includes ( "storeType: 'file'" ) ;
91114 const graphAdapterModulePresent = fileExists ( graphAdapterPath ) ;
115+ const queryBackendDefaultMode = resolveQueryBackendDefaultMode ( queryBackendSource , graphAdapterModulePresent ) ;
92116 const vectorAdapterModulePresent = fileExists ( vectorAdapterPath ) ;
93117 const vectorAdapterStatus = resolveVectorAdapterStatus ( vectorAdapterSource , vectorAdapterModulePresent ) ;
94118 const vectorAdapterIndependent = vectorAdapterStatus === 'independent' ;
119+ const vectorAdapterLinkedIntoQueryBackend = resolveVectorAdapterLinkedIntoQueryBackend (
120+ queryBackendSource ,
121+ graphAdapterModulePresent
122+ ) ;
95123 const checklistPagesPresent = fileExists ( enChecklistPath ) && fileExists ( zhChecklistPath ) ;
96124 const dashboardReferencesPresent =
97125 enDashboard . includes ( 'foundation-reentry-readiness-checklist' )
@@ -193,9 +221,11 @@ function evaluateFoundationReadiness(options = {}) {
193221 loaded : storeModulePresent && storeSource . includes ( 'loadSnapshot' ) ,
194222 fileBackedStore,
195223 graphAdapterModulePresent,
224+ queryBackendDefaultMode,
196225 vectorAdapterModulePresent,
197226 vectorAdapterStatus,
198227 vectorAdapterIndependent,
228+ vectorAdapterLinkedIntoQueryBackend,
199229 } ,
200230 documents : {
201231 checklistPagesPresent,
@@ -224,9 +254,11 @@ function formatFoundationReadinessMarkdown(result, reportPaths) {
224254 `- Store load capability present: ${ result . baseline . loaded ? 'yes' : 'no' } ` ,
225255 `- File-backed store evidence: ${ result . baseline . fileBackedStore ? 'yes' : 'no' } ` ,
226256 `- Dedicated graph adapter module present: ${ result . baseline . graphAdapterModulePresent ? 'yes' : 'no' } ` ,
257+ `- Query backend default mode: ${ result . baseline . queryBackendDefaultMode } ` ,
227258 `- Dedicated vector adapter module present: ${ result . baseline . vectorAdapterModulePresent ? 'yes' : 'no' } ` ,
228259 `- Vector adapter status: ${ result . baseline . vectorAdapterStatus } ` ,
229260 `- Vector adapter independent: ${ result . baseline . vectorAdapterIndependent ? 'yes' : 'no' } ` ,
261+ `- Vector adapter linked into query backend: ${ result . baseline . vectorAdapterLinkedIntoQueryBackend ? 'yes' : 'no' } ` ,
230262 '' ,
231263 '## Documentation' ,
232264 '' ,
0 commit comments