@@ -24,7 +24,11 @@ const {
2424 writeManifestAtomic
2525} = require ( './scripts/lib/deployment-manifest-utils.js' )
2626const { runCli : runMigrateLayout } = require ( './scripts/migrate-layout.js' )
27- const { detectProfileTier, filesForProfileTier, inspectProfileContract, normalizeProfileTier } = require ( './mcp/profile-contract.js' )
27+ const {
28+ detectProfileTier, filesForProfileTier, inspectProfileContract, normalizeProfileTier,
29+ compareProfileTiers, updateProfileTierDeclaration, FEATURE_INVENTORY_SCHEMA_VERSION ,
30+ FEATURE_INVENTORY_COLUMN_LABELS
31+ } = require ( './mcp/profile-contract.js' )
2832const {
2933 findLayoutInfo : sharedFindLayoutInfo ,
3034 inferProjectFromCwd : sharedInferProjectFromCwd ,
@@ -344,6 +348,7 @@ const {
344348 genTestSpec,
345349 genReleaseSpec,
346350 genFeatureInventory,
351+ recommendProfileTier,
347352 genUserContractSpec,
348353 genConfigJson,
349354 detectAgent
@@ -352,7 +357,9 @@ const {
352357 path,
353358 detectHostPlatform,
354359 detectInstalledHostAssets,
355- processEnv : process . env
360+ processEnv : process . env ,
361+ featureInventorySchemaVersion : FEATURE_INVENTORY_SCHEMA_VERSION ,
362+ featureInventoryColumnLabels : FEATURE_INVENTORY_COLUMN_LABELS
356363} )
357364
358365const { cmdInit, cmdInitClaude, cmdInitCodex } = buildCliInstallCommands ( {
@@ -373,14 +380,14 @@ const { cmdInit, cmdInitClaude, cmdInitCodex } = buildCliInstallCommands({
373380function inspectProfileState ( profileDir ) {
374381 let availableFiles = [ ]
375382 try { availableFiles = fs . readdirSync ( profileDir ) . filter ( file => fs . statSync ( path . join ( profileDir , file ) ) . isFile ( ) ) } catch { }
376- const corpus = availableFiles . filter ( file => file . endsWith ( '.md' ) )
377- . map ( file => {
378- try { return fs . readFileSync ( path . join ( profileDir , file ) , 'utf8' ) } catch { return '' }
379- } ) . join ( '\n' )
383+ const documents = Object . fromEntries ( availableFiles . filter ( file => file . endsWith ( '.md' ) ) . map ( file => {
384+ try { return [ file , fs . readFileSync ( path . join ( profileDir , file ) , 'utf8' ) ] } catch { return [ file , '' ] }
385+ } ) )
386+ const corpus = Object . values ( documents ) . join ( '\n' )
380387 let tier = 'profile-lite'
381388 let error = null
382389 try { tier = detectProfileTier ( corpus ) } catch ( err ) { error = err . message }
383- const state = inspectProfileContract ( tier , availableFiles , corpus )
390+ const state = inspectProfileContract ( tier , availableFiles , corpus , documents )
384391 const configExists = fs . existsSync ( path . join ( profileDir , 'config.json' ) )
385392 return { ...state , complete : ! error && state . complete , configExists, error }
386393}
@@ -390,9 +397,11 @@ const { cmdStatus, cmdProfileInit, cmdDoctor, cmdHelp } = buildCliMaintenanceCom
390397 walkDir, isSourceRepo, resolveActiveRuntimeRoot, resolveProfileDir, getLegacyCounts,
391398 getCodexConfigState, inspectProfileState, detectProfileTier,
392399 inspectProfileContract, normalizeProfileTier, filesForProfileTier,
400+ compareProfileTiers, updateProfileTierDeclaration,
393401 readJsonSafe, safeFirstLine, detectArch, listTopDirs, detectStyle,
394402 genProfileReadme, genProjectInfo, genArchitecture, genStyle, genTestSpec,
395403 genReleaseSpec, genFeatureInventory, genUserContractSpec, genConfigJson,
404+ recommendProfileTier,
396405 detectAgent, detectHostPlatform, detectInstalledHostAssets
397406} )
398407
0 commit comments