Keep every bot's computer work in its own workspace folder
Computers now mount only /home/gem/workspace from DATA_DIR/computers/<id>, so only the workspace persists and goes into the data archive. An older computer's whole home is moved aside to <id>-home-<ts> (kept, never archived) and its container recreated once by sync-computers. Each run works in bots/<bot>/users/<user> (also its cwd and HOME), with bots/<bot> for work every user shares and workspaces/<id> shared by a workspace's bots; the coordinator reaches the whole workspace. Computer tools are gated by withComputerDirs: bash and code start there, file tool paths and file: URLs outside the run's folders are refused, and so is sudo. search_computers, import_file and script tools start there too. The files browser shows members only the bots' folders they reach, their own user folder in each and their workspaces', with names on the id folders. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
coordinatorReplyNote,
|
||||
TasksNote,
|
||||
} from "./harness-prompts";
|
||||
import computerRunDirs from "@/src/utils/computer-work-dirs";
|
||||
|
||||
/**
|
||||
* Every note a bot reads names it by its own id, so a bot copying an
|
||||
@@ -46,8 +47,15 @@ describe("harness prompts", () => {
|
||||
expect(botFilesNote({ bot_id: 5 })).toContain("[folder:bot:5:reports]");
|
||||
});
|
||||
|
||||
test("the computer files note keeps naming the computer it was given", () => {
|
||||
expect(ComputerFilesNote({ computer_id: 8 })).toContain("[folder:computer:8:seo/coderank/raw]");
|
||||
test("the computer files note names the computer and the run's folders", () => {
|
||||
const note = ComputerFilesNote({
|
||||
computer_id: 8,
|
||||
dirs: computerRunDirs({ bot_id: 3, user_id: 7, workspace_id: 2 }),
|
||||
});
|
||||
|
||||
expect(note).toContain("[folder:computer:8:bots/3/users/7/seo/coderank/raw]");
|
||||
expect(note).toContain("/home/gem/workspace/bots/3/users/7");
|
||||
expect(note).toContain("/home/gem/workspace/workspaces/2");
|
||||
});
|
||||
|
||||
test("notes with nothing bot-specific carry no ref example", () => {
|
||||
|
||||
Reference in New Issue
Block a user