mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-27 12:05:01 +02:00
fix(install): harden ECC installer lifecycle
Make Antigravity 2.0 installs native and safely migrate legacy state. Ensure doctor, repair, status projection, repeat installs, legacy Codex sync, and uninstall converge without losing user files. Exclude Python bytecode and harden repo-scan bootstrap guidance. Gate publishing and pull-request merges on one exact packed artifact completing install, repeat, drift, repair, status, and uninstall across Linux, macOS, and Windows. Co-authored-by: lorencifernando-coder <lorenci.fernando@gmail.com> Co-authored-by: Suliman Abdulrazzaq <suliman9000a@gmail.com> Co-authored-by: Wu Shuwen <mikewushuwen@outlook.com>
This commit is contained in:
co-authored by
lorencifernando-coder
Suliman Abdulrazzaq
Wu Shuwen
parent
eb49702651
commit
1db5c8ab4a
@@ -282,6 +282,77 @@ function runTests() {
|
||||
}
|
||||
})) passed++; else failed++;
|
||||
|
||||
if (test('reports preserved legacy Antigravity files as an incomplete uninstall', () => {
|
||||
const homeDir = createTempDir('uninstall-home-');
|
||||
const projectRoot = createTempDir('uninstall-project-');
|
||||
|
||||
try {
|
||||
const targetRoot = path.join(projectRoot, '.agent');
|
||||
fs.mkdirSync(path.join(targetRoot, 'rules'), { recursive: true });
|
||||
const normalizedTargetRoot = fs.realpathSync(targetRoot);
|
||||
const statePath = path.join(normalizedTargetRoot, 'ecc-install-state.json');
|
||||
const editedPath = path.join(normalizedTargetRoot, 'rules', 'common-coding-style.md');
|
||||
fs.writeFileSync(editedPath, 'customer edit\n');
|
||||
|
||||
writeState(statePath, {
|
||||
adapter: { id: 'antigravity-project', target: 'antigravity', kind: 'project' },
|
||||
targetRoot: normalizedTargetRoot,
|
||||
installStatePath: statePath,
|
||||
request: {
|
||||
profile: null,
|
||||
modules: [],
|
||||
includeComponents: [],
|
||||
excludeComponents: [],
|
||||
legacyLanguages: ['typescript'],
|
||||
legacyMode: true,
|
||||
},
|
||||
resolution: {
|
||||
selectedModules: ['legacy-antigravity-install'],
|
||||
skippedModules: [],
|
||||
},
|
||||
operations: [{
|
||||
kind: 'copy-file',
|
||||
moduleId: 'rules-core',
|
||||
sourceRelativePath: 'rules/common/coding-style.md',
|
||||
destinationPath: editedPath,
|
||||
strategy: 'flatten-copy',
|
||||
ownership: 'managed',
|
||||
scaffoldOnly: false,
|
||||
}],
|
||||
source: {
|
||||
repoVersion: CURRENT_PACKAGE_VERSION,
|
||||
repoCommit: 'abc123',
|
||||
manifestVersion: CURRENT_MANIFEST_VERSION,
|
||||
},
|
||||
});
|
||||
|
||||
const dryRun = run(['--target', 'antigravity', '--dry-run', '--json'], {
|
||||
cwd: projectRoot,
|
||||
homeDir,
|
||||
});
|
||||
assert.strictEqual(dryRun.code, 1);
|
||||
const parsed = JSON.parse(dryRun.stdout);
|
||||
assert.strictEqual(parsed.results[0].status, 'partial');
|
||||
assert.deepStrictEqual(parsed.results[0].plannedRemovals, []);
|
||||
assert.deepStrictEqual(parsed.results[0].retainedPaths, [editedPath]);
|
||||
assert.strictEqual(parsed.summary.partialCount, 1);
|
||||
|
||||
const applied = run(['--target', 'antigravity'], {
|
||||
cwd: projectRoot,
|
||||
homeDir,
|
||||
});
|
||||
assert.strictEqual(applied.code, 1);
|
||||
assert.ok(applied.stdout.includes('Status: PARTIAL'));
|
||||
assert.ok(applied.stdout.includes('Legacy Antigravity files were preserved'));
|
||||
assert.ok(applied.stdout.includes(editedPath));
|
||||
assert.ok(fs.existsSync(editedPath));
|
||||
assert.ok(fs.existsSync(statePath));
|
||||
} finally {
|
||||
cleanup(homeDir);
|
||||
cleanup(projectRoot);
|
||||
}
|
||||
})) passed++; else failed++;
|
||||
|
||||
console.log(`\nResults: Passed: ${passed}, Failed: ${failed}`);
|
||||
process.exit(failed > 0 ? 1 : 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user