fix(#322): normalize surface manifest inputs before profile resolution (#325)

This commit is contained in:
Tom Boucher
2026-05-26 12:22:08 -04:00
committed by GitHub
parent e5a5a75938
commit 1f2ef131c5
3 changed files with 74 additions and 8 deletions

View File

@@ -703,6 +703,27 @@ describe('CLUSTERS data structure', () => {
// ─── listSurface ─────────────────────────────────────────────────────────────
describe('listSurface', () => {
test('accepts parsed gsd-file-manifest JSON objects without crashing (#322)', () => {
const dir = tmpDir('gsd-surface-list-');
try {
fs.writeFileSync(path.join(dir, '.gsd-source'), REAL_COMMANDS_DIR, 'utf8');
writeActiveProfile(dir, 'core');
const diskManifestShape = {
version: '1.0.0',
timestamp: new Date().toISOString(),
mode: 'core',
files: {},
};
const result = listSurface(dir, diskManifestShape, CLUSTERS);
assert.ok(Array.isArray(result.enabled), 'enabled must be array');
assert.ok(Array.isArray(result.disabled), 'disabled must be array');
assert.ok(typeof result.tokenCost === 'number', 'tokenCost must be number');
} finally {
fs.rmSync(dir, { recursive: true, force: true });
}
});
test('returns { enabled, disabled, tokenCost } structure', () => {
const dir = tmpDir('gsd-surface-list-');
try {