Keep managed source paths canonical across outer workbench aliases (#713)

This commit is contained in:
Quixos Development Agent 01f26965-84fa-4a79-8069-725682c13065
2026-10-31 14:09:51 +00:00
parent e13fde36fb
commit 31d155fd88
5 changed files with 90 additions and 13 deletions
+20
View File
@@ -156,6 +156,26 @@ test(
);
assert.equal(graph.resources[0].directory, "resources/Named");
assert.equal(graph.directResources[0].directory, "resources/Named");
const alias = `${workbench}-guest-alias`;
await fs.symlink(workbench, alias);
context.after(() => fs.unlink(alias));
const graphFile = path.join(workbench, ".quixos/resource-graph.json");
await fs.writeFile(
graphFile,
JSON.stringify({
...graph,
resources: graph.resources.map((entry: { directory: string }) => ({
...entry,
directory: path.join(alias, entry.directory),
})),
}),
);
assert.equal((await discoverUpgradeSpec(alias)).nodes[1]!.directory, "resources/Named");
const aliasPlan = await planPinUpgrades(alias, { ...(await discoverUpgradeSpec(alias)), bootstrap: true });
await applyPinUpgrades(aliasPlan);
const refreshed = JSON.parse(await fs.readFile(graphFile, "utf8"));
assert.equal(refreshed.resources[0].directory, "resources/Named");
assert.equal(refreshed.directResources[0].directory, "resources/Named");
// A retained workbench can move without keeping its original absolute path
// alive. Recovery journals remain bound to their original writer/root.
const relocated = `${workbench}-relocated`;