feat(discord): git verbs for the Discord Sage on the shared-signals root, seat identity through a package credential helper, vault record protocol (#1509)

Row 24. A writable root that is a git work tree may carry a git object in
the binding; the seat then has git_status, git_commit (explicit paths, seat
author, Requested-by trailer from the envelope requester, push at once per
D6), git_pull (ff-only) and git_push (one branch, never force), plus
reserve_id and per-write clone locks under protocol vault. Git children run
with no host config and one credential helper, bin/git-credential.mjs,
reading the 0600 seat token file named in the binding; the fleet helper
serves only the Gitea hosts. Suite 58/58, node 143. rev-code-02 APPROVED
round 1 (#1509 comment 26375, tree 82ab962f).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
2026-09-18 07:52:35 -05:00
co-authored by Claude Fable 5.1
parent 1685deb423
commit 1949ed8d31
23 changed files with 1284 additions and 48 deletions
+3 -2
View File
@@ -255,6 +255,7 @@ test("tools: config accepts write: true only as a boolean, and enables the write
const { root, vault, c } = writeFixture();
assert.equal(c.roots[0].write, false);
assert.equal(c.roots[1].write, true);
assert.equal(c.roots[1].git, null, "no git key: the root carries git: null and no git verb is offered");
assert.deepEqual(enabledToolNames(c), ["list_dir", "read_file", "search", "write_file", "edit_file"]);
assert.throws(() => loadToolsConfig({ roots: [{ name: "v", path: vault, write: "yes" }] }), /write must be true or false/);
assert.throws(() => loadToolsConfig({ roots: [{ name: "v", path: vault, write: 1 }] }), /write must be true or false/);
@@ -308,14 +309,14 @@ test("tools: write_file leaves the exact bytes, edit_file replaces one exact mat
const { vault, c } = writeFixture();
const text = "# Names\n\n- one\n- two\n\u00e9\n";
const w = writeFile(c, { root: "vault", path: "Businesses/Names.md", text });
assert.deepEqual(w, { root: "vault", path: "Businesses/Names.md", bytes: Buffer.byteLength(text), created: true });
assert.deepEqual(w, { root: "vault", path: "Businesses/Names.md", bytes: Buffer.byteLength(text), created: true, git: false });
assert.equal(readFileSync(join(vault, "Businesses", "Names.md"), "utf8"), text);
assert.equal((lstatSync(join(vault, "Businesses", "Names.md")).mode & 0o777) <= 0o644, true);
const w2 = writeFile(c, { root: "vault", path: "Businesses/Names.md", text: "- three\n" });
assert.equal(w2.created, false);
assert.equal(readFileSync(join(vault, "Businesses", "Names.md"), "utf8"), "- three\n");
const e = editFile(c, { root: "vault", path: "Businesses/DYOR.md", old: "name: tbd", new: "name: chosen" });
assert.deepEqual(e, { root: "vault", path: "Businesses/DYOR.md", bytes: 21, created: false });
assert.deepEqual(e, { root: "vault", path: "Businesses/DYOR.md", bytes: 21, created: false, git: false });
assert.equal(readFileSync(join(vault, "Businesses", "DYOR.md"), "utf8"), "# DYOR\n\nname: chosen\n");
const set = createToolSet(c);
const r = set.call("write_file", { root: "vault", path: "Note.md", text: "hi\n" });