@@ -71,7 +71,7 @@ function buildScopedHostParity(hostParity, globalHostComparison) {
7171function buildCliMaintenanceCommands ( ctx ) {
7272 const {
7373 fs, os, path, process, console, c, SOURCES , CODEX_HOOK_COMMAND ,
74- walkDir, isSourceRepo, resolveActiveRuntimeRoot, resolveProfileDir, getLegacyCounts,
74+ walkDir, isSourceRepo, findLayoutInfo , resolveActiveRuntimeRoot, resolveProfileDir, getLegacyCounts,
7575 getCodexConfigState, inspectProfileState,
7676 detectProfileTier, inspectProfileContract, normalizeProfileTier,
7777 filesForProfileTier, readJsonSafe, safeFirstLine, detectArch, listTopDirs,
@@ -283,6 +283,16 @@ function buildCliMaintenanceCommands(ctx) {
283283 const profileState = inspectProfileState ( profileDir )
284284 const legacy = getLegacyCounts ( ghDir )
285285 const activeRoot = resolveActiveRuntimeRoot ( cwd )
286+ const layoutInfo = typeof findLayoutInfo === 'function'
287+ ? findLayoutInfo ( cwd )
288+ : { enabled : false , workspaceRoot : cwd }
289+ const workspaceLayoutReady = Boolean (
290+ layoutInfo ?. enabled &&
291+ layoutInfo . workspaceRoot &&
292+ fs . existsSync ( path . join ( layoutInfo . workspaceRoot , '.devcodex' , 'layout.json' ) ) &&
293+ fs . existsSync ( path . join ( layoutInfo . workspaceRoot , '.devcodex' , 'workspace' ) )
294+ )
295+ const workspaceRuntimeReady = fs . existsSync ( activeRoot ) || workspaceLayoutReady
286296 const executionOptimization = inspectExecutionOptimization ( cwd )
287297 const globalHostConfig = inspectGlobalHostConfig ( { env : process . env , cwd } )
288298 const globalHostComparison = buildGlobalHostComparison ( sourceRepository , globalHostConfig )
@@ -307,6 +317,9 @@ function buildCliMaintenanceCommands(ctx) {
307317 schemaVersion : 'StatusDiagnosticV1' ,
308318 cwd,
309319 hostRoot,
320+ activeRoot,
321+ workspaceLayoutReady,
322+ workspaceRuntimeReady,
310323 sourceRepository,
311324 trackedEntryFiles,
312325 installSurfaces,
@@ -388,7 +401,7 @@ function buildCliMaintenanceCommands(ctx) {
388401 console . log ( )
389402 console . log ( )
390403 console . log ( c . bold ( ' Workspace state:' ) )
391- console . log ( ` ${ c . cyan ( '.devcodex' . padEnd ( 14 ) ) } ${ fs . existsSync ( path . join ( hostRoot , '.devcodex' ) ) ? c . green ( 'present' ) : c . dim ( 'not initialized' ) } ` )
404+ console . log ( ` ${ c . cyan ( '.devcodex' . padEnd ( 14 ) ) } ${ facts . workspaceRuntimeReady ? c . green ( 'present' ) : c . dim ( 'not initialized' ) } ` )
392405 console . log ( ` ${ c . cyan ( 'host dirs' . padEnd ( 14 ) ) } ${ total
393406 ? c . yellow ( `${ total } legacy artifact(s); not required` )
394407 : c . green ( 'none; expected' ) } `)
@@ -431,7 +444,7 @@ function buildCliMaintenanceCommands(ctx) {
431444
432445 console . log ( )
433446 if ( total === 0 ) {
434- if ( isSrc ) {
447+ if ( isSrc || facts . workspaceRuntimeReady ) {
435448 console . log ( ` ${ c . dim ( 'No workspace host artifacts.' ) } ${ c . dim ( `This is expected in ${ workspaceCleanMode } .` ) } ` )
436449 } else {
437450 console . log ( ` ${ c . yellow ( 'Workspace runtime not initialized.' ) } Run ${ c . bold ( 'devcodex init' ) } ; host adapters require ${ c . bold ( 'npm install -g devcodex' ) } .` )
0 commit comments