Skip to content

Commit 8e16e65

Browse files
committed
fix: include SkillRoute portfolio in package runtime
1 parent 728ca7f commit 8e16e65

5 files changed

Lines changed: 40 additions & 5 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@
176176
"instructions.md",
177177
"plugin.json",
178178
".mcp.json",
179+
"skills/portfolio.json",
179180
"agents/",
180181
"skills/*/**",
181182
"instructions/",

‎scripts/lib/package-compatibility-projection.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function walkFiles (root) {
4343
function assertSafeTarget (relative) {
4444
const value = portable(relative)
4545
const safe = value === 'instructions.md' ||
46+
value === 'skills/portfolio.json' ||
4647
/^instructions\/[^/].+$/.test(value) ||
4748
/^prompts\/[^/].*\.md$/.test(value) ||
4849
/^skills\/(?:_schemas\/[^/].+|[^/]+\/[^/].*)$/.test(value)
@@ -66,7 +67,7 @@ function buildPackageProjectionPlan (root) {
6667
for (const file of walkFiles(contentSkillsRoot)) {
6768
const relative = portable(path.relative(contentSkillsRoot, file))
6869
if (relative.endsWith('/SKILL.md') || relative.endsWith('/devcodex.skill.json')) continue
69-
if (relative === 'portfolio.json' || relative === 'portfolio-evidence.json') continue
70+
if (relative === 'portfolio-evidence.json') continue
7071
const target = assertSafeTarget(`skills/${relative}`)
7172
if (entries.has(target)) throw new Error(`duplicate package projection target: ${target}`)
7273
const content = fs.readFileSync(file)

‎scripts/test-global-install-smoke.js‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ for (const host of ['.copilot', '.claude', '.codex', path.join('gemini-cli-home'
122122
assert.strictEqual(receipt.workspaceCleanMode, 'GlobalOnlyWorkspaceCleanModeV1')
123123
}
124124
assert.strictEqual(fs.existsSync(path.join(globalHome, '.agents', 'devcodex', 'instructions.full.md')), true)
125+
assert.strictEqual(
126+
fs.existsSync(path.join(globalHome, '.agents', 'devcodex', 'skills', 'portfolio.json')),
127+
true,
128+
'shared Skill runtime must include portfolio.json for installed SkillRoute bootstrap'
129+
)
125130
assert.strictEqual(fs.existsSync(path.join(globalHome, '.agents', 'devcodex', 'skills', 'routing', 'SKILL.md')), true)
126131
assert.strictEqual(
127132
fs.existsSync(path.join(globalHome, '.agents', 'skills', 'routing', 'SKILL.md')),
@@ -219,6 +224,33 @@ const importedClaudeHook = JSON.parse(runCommand(process.execPath, [installedCla
219224
assert.strictEqual(importedClaudeHook.continue, true)
220225
assert.strictEqual(importedClaudeHook.devcodexCompatibilityBypass, 'grok-imported-claude-hook')
221226

227+
const installedCodexAdapter = path.join(
228+
globalHome,
229+
'.codex',
230+
'devcodex',
231+
'runtime',
232+
'hooks',
233+
'_runtime',
234+
'lifecycle-host-adapters.cjs'
235+
)
236+
const installedCodexHook = JSON.parse(runCommand(process.execPath, [installedCodexAdapter, 'codex'], {
237+
cwd: workspace,
238+
env: installedEnv,
239+
shell: false,
240+
input: JSON.stringify({
241+
hookEventName: 'UserPromptSubmit',
242+
cwd: workspace,
243+
prompt: 'routing installed package smoke',
244+
session_id: 'installed-package-skill-route'
245+
})
246+
}).stdout)
247+
const installedCodexContext = `${installedCodexHook.systemMessage || ''}\n${installedCodexHook.hookSpecificOutput?.additionalContext || ''}`
248+
assert.match(
249+
installedCodexContext,
250+
/SkillRouteBootstrapV1/,
251+
'installed Codex hook must expose SkillRoute bootstrap from packed global runtime'
252+
)
253+
222254
for (const host of ['copilot', 'claude', 'codex', 'gemini', 'grok']) {
223255
const installedAdapter = path.join(
224256
globalHome,

‎scripts/test-pack-clean.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const forbidden = [
5353
/data\/process-improvements\.md/,
5454
/data\/pending-issues\.md/,
5555
/data\/gap-registry\.md/,
56-
/skills\/portfolio\.json/,
5756
/skills\/portfolio-evidence\.json/,
5857
/content-source\//,
5958
/^content\//,
@@ -106,6 +105,7 @@ const required = [
106105
'scripts/instruction-fallback-check.js',
107106
'scripts/migrate-layout.js',
108107
'assets/icon-512.png',
108+
'skills/portfolio.json',
109109
].concat(packageFiles, pluginFiles, promptFiles, dataTemplateFiles, indexRuntimeRequires, packagedScriptDeps)
110110
.filter(Boolean)
111111
.filter(file => !file.endsWith('/'))
@@ -131,8 +131,8 @@ if (skillPackFiles.length < 10) {
131131
console.error(` found ${skillPackFiles.length} skills/*/SKILL.md`)
132132
process.exit(1)
133133
}
134-
if (files.some(file => file === 'skills/portfolio.json' || file === 'skills/portfolio-evidence.json')) {
135-
console.error('\x1b[31m✗ Pack must exclude skills/portfolio.json and skills/portfolio-evidence.json\x1b[0m')
134+
if (files.some(file => file === 'skills/portfolio-evidence.json')) {
135+
console.error('\x1b[31m✗ Pack must exclude skills/portfolio-evidence.json\x1b[0m')
136136
process.exit(1)
137137
}
138138
if (npmignore.includes('tests/')) {

‎scripts/test-package-compatibility-projection.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const {
1919
} = require('./lib/package-compatibility-projection')
2020

2121
const ROOT = path.resolve(__dirname, '..')
22-
const EXPECTED_ENTRY_COUNT = 249
22+
const EXPECTED_ENTRY_COUNT = 250
2323

2424
function git (root, args) {
2525
return execFileSync('git', ['-C', root, ...args], {
@@ -93,6 +93,7 @@ if (currentMissingCount === 0 && currentReusableForeignCount === 0) {
9393
assert.strictEqual(materialized.materializedCount, EXPECTED_ENTRY_COUNT)
9494
assert.strictEqual(materialized.reusedExistingCount, 0)
9595
assert.strictEqual(fs.existsSync(path.join(root, 'instructions.md')), true)
96+
assert.strictEqual(fs.existsSync(path.join(root, 'skills', 'portfolio.json')), true)
9697
assert.strictEqual(fs.existsSync(path.join(root, 'skills', 'routing', 'intent.json')), true)
9798
assert.strictEqual(fs.existsSync(path.join(root, DEFAULT_RECEIPT)), true)
9899

0 commit comments

Comments
 (0)