()
| 98 | } |
| 99 | |
| 100 | export async function loadBudgetBaseline() { |
| 101 | if (cachedBaseline) { |
| 102 | return cachedBaseline; |
| 103 | } |
| 104 | |
| 105 | const home = os.homedir(); |
| 106 | const skillRoot = path.join(home, ".codex", "skills"); |
| 107 | const curatedPluginRoot = path.join(home, ".codex", "plugins", "cache", "openai-curated"); |
| 108 | const tempPluginRoot = path.join(home, ".codex", ".tmp", "plugins", "plugins"); |
| 109 | |
| 110 | const skillSamples = await collectSkillSamples(skillRoot); |
| 111 | const pluginSamples = [ |
| 112 | ...(await collectPluginSamples(curatedPluginRoot)), |
| 113 | ...(await collectPluginSamples(tempPluginRoot)), |
| 114 | ]; |
| 115 | |
| 116 | cachedBaseline = { |
| 117 | skill: summarizeSamples(skillSamples) || DEFAULT_BASELINE.skill, |
| 118 | plugin: summarizeSamples(pluginSamples) || DEFAULT_BASELINE.plugin, |
| 119 | directory: DEFAULT_BASELINE.directory, |
| 120 | evidence: { |
| 121 | skillSamples: skillSamples.length, |
| 122 | pluginSamples: pluginSamples.length, |
| 123 | sourceRoots: [ |
| 124 | relativePath(process.cwd(), skillRoot), |
| 125 | relativePath(process.cwd(), curatedPluginRoot), |
| 126 | relativePath(process.cwd(), tempPluginRoot), |
| 127 | ], |
| 128 | }, |
| 129 | }; |
| 130 | |
| 131 | return cachedBaseline; |
| 132 | } |
no test coverage detected