chore(tests): prune obsolete probes and define truthful offline test gates

This commit is contained in:
Codex committed 2026-10-21 14:21:03 +09:00
1 parent f512a0f3fd
commit a839d23e12
122 files changed
+186 -2876

No files matched your search

@@ -457,6 +457,8 @@ console.log(JSON.stringify({ result: 'PASS', checks: checks.length, phase: 'arch
check('initialize restores installs after a stop', restored.origin?.recommendationId, 'archify')
}
console.log(JSON.stringify({ result: 'PASS', checks: checks.length, phase: 'required-offline' }))
// ---- the shipped catalog entry must match the real published package ---------
{
const cached = path.resolve('.tmp/recommended-audit/archify.zip')
@@ -465,11 +467,16 @@ console.log(JSON.stringify({ result: 'PASS', checks: checks.length, phase: 'arch
let bytes: Uint8Array | undefined
try {
bytes = await fs.readFile(override ?? cached)
} catch {
} catch (error) {
// Only an absent default cache is optional. Explicit inputs and other I/O errors must fail.
if (override || (error as NodeJS.ErrnoException).code !== 'ENOENT') {
throw new Error(`Cannot read real-package fixture ${override ?? cached}: ${String(error)}`)
}
// Offline by default: the published package is audited by a separate network test.
available = false
}
if (available) {
const checksBeforeRealPackage = checks.length
const catalogModule = await import(pathToFileURL(await compile('src/main/capabilities/skill-recommendations.ts', 'catalog.mjs')).href)
const entry = catalogModule.SKILL_RECOMMENDATIONS.find((item: { id: string }) => item.id === 'archify')
check('the shipped catalog contains the archify recommendation', !!entry, true)
@@ -485,9 +492,8 @@ console.log(JSON.stringify({ result: 'PASS', checks: checks.length, phase: 'arch
check('the published package keeps its recommendation origin', installed.origin?.recommendationId, 'archify')
const document = await skills.readSkill(installed.id)
check('the published package keeps its resource files', document.files.length > 100, true)
console.log(JSON.stringify({ result: 'PASS', checks: checks.length - checksBeforeRealPackage, phase: 'real-package' }))
} else {
console.log(JSON.stringify({ result: 'SKIP', phase: 'real-package', reason: 'published package not present in .tmp' }))
console.log(JSON.stringify({ result: 'SKIP', phase: 'real-package', checks: 0, reason: 'published package is unavailable; optional package checks were not run', path: override ?? cached }))
}
}
console.log(JSON.stringify({ result: 'PASS', checks: checks.length, phase: 'real-package' }))