seat: give role sessions a git identity and report the checkout commit (row 104, #1598)
sandboxArgv sets GIT_AUTHOR_NAME/EMAIL and GIT_COMMITTER_NAME/EMAIL from
the instance and business ids (name = instance id, email
<instance>@<business>.mosaic.invalid); spawnSession and the launcher pass
the ids through. checkout results carry the clone's commit (a kept clone
gets none), and the bundle prompt names it. allowed() is unchanged.
Packet agents/darkwing/work/queue-104/r1/ (manifest f99f2ae7). Dewey
approved round 1 in 28293 (posted under jarvis by mistake; 28294 is
Dewey's confirmation). Sage's gate on f00613106 plus the candidate:
every package suite and scripts/test-*.sh green (test-release failed 3
activation checks once, not reproduced; rerun 14/0).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -104,6 +104,7 @@ test("the prompt's built-in tools line is the harness's own names, as the manife
|
||||
});
|
||||
|
||||
// Row 91 (#1585): the prompt names each project clone, and why a kept one wasn't updated.
|
||||
// Row 104 (#1598): and the commit each was at, when it refreshes, and the git config warning.
|
||||
test("the prompt names the project clones in the workspace, and none when there are none", (t) => {
|
||||
const line = (b) => readFileSync(b.files.prompt, "utf8").split("\n").filter((l) => l.startsWith("- Project clones: "));
|
||||
const plain = build(t, resolvedFor(t, "pm"));
|
||||
@@ -111,10 +112,12 @@ test("the prompt names the project clones in the workspace, and none when there
|
||||
const dir = scratch(t);
|
||||
const session = (checkouts) => ({ run: "run-1", launchedBy: "pm", workspace: join(dir, "ws"), toolSocket: join(dir, "tools.sock"), turnMarker: join(dir, "turn.done"), checkouts });
|
||||
const two = build(t, resolvedFor(t, "pm"), { session: session([
|
||||
{ project: "stack", path: join(dir, "ws", "stack"), outcome: "updated", branch: "main" },
|
||||
{ project: "stack", path: join(dir, "ws", "stack"), outcome: "updated", branch: "main", commit: "a".repeat(40) },
|
||||
{ project: "site", path: join(dir, "ws", "site"), outcome: "kept", reason: "dirty" },
|
||||
{ project: "docs", path: join(dir, "ws", "docs"), outcome: "current", branch: "dev", commit: null },
|
||||
]) });
|
||||
assert.deepEqual(line(two), [`- Project clones: stack at ${join(dir, "ws", "stack")}, on branch main; site at ${join(dir, "ws", "site")}, not updated at this launch (dirty). Each is a git clone of the project. The host fetches from its origin at each launch; the origin is outside this sandbox.`]);
|
||||
const after = "Each is a git clone of the project. The host fetches from its origin and fast-forwards a clean clone only at a launch, never during a session; the origin is outside this sandbox. Don't set git config in a clone. Any key that `git clone` didn't write, user.name and user.email included, makes every later launch keep that clone as it is. Your commits already carry your role instance's name and address from the environment.";
|
||||
assert.deepEqual(line(two), [`- Project clones: stack at ${join(dir, "ws", "stack")}, on branch main at commit ${"a".repeat(40)} when this session started; site at ${join(dir, "ws", "site")}, not updated at this launch (dirty); docs at ${join(dir, "ws", "docs")}, on branch dev at a commit the host couldn't read when this session started. ${after}`]);
|
||||
const prompt = readFileSync(two.files.prompt, "utf8");
|
||||
assert.ok(prompt.indexOf("- Workspace: ") < prompt.indexOf("- Project clones: "));
|
||||
assert.deepEqual(line(build(t, resolvedFor(t, "pm"), { session: session([]) })), []);
|
||||
|
||||
Reference in New Issue
Block a user