const path = require('path');
const fs = require('fs');

async function testDiag() {
    const bridgePath = process.cwd();
    // we want to list latest brainDir and check state summary instead.
    const brainDir = path.resolve(bridgePath, '.gemini/antigravity/brain');
    if (fs.existsSync(brainDir)) {
        const brainDirs = fs.readdirSync(brainDir, { withFileTypes: true })
            .filter(dirent => dirent.isDirectory() && dirent.name.length === 36)
            .map(dirent => {
                const stats = fs.statSync(path.join(brainDir, dirent.name));
                return { name: dirent.name, time: stats.mtimeMs };
            })
            .sort((a, b) => b.time - a.time);
            
        console.log(`Latest brain UUIDs:`, brainDirs.slice(0, 3));
    }
}
testDiag();
