trantor 0.18.26 → 0.18.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.26",
3
+ "version": "0.18.28",
4
4
  "description": "Trantor — the hub-world for AI agent crews: live message bus, presence, project Kanban/flow board + crew orchestration for independent AI coding agents (Claude, Codex, Gemini, Kimi, DeepSeek)",
5
5
  "mcpServers": {
6
6
  "relay": {
@@ -66,10 +66,35 @@ function ensureSeatWorktree(sourceDir) {
66
66
  }
67
67
 
68
68
  try { mkdirSync(join(homedir(), ".agent-bus", "worktrees", safePathSegment(PROJ)), { recursive: true }); } catch {}
69
- const r = spawnSync("git", ["-C", root, "worktree", "add", "-B", branch, seatDir, "HEAD"], {
69
+
70
+ // Fast-forward the base branch before branching: the worktree should build
71
+ // against the latest main, not a stale checkout. (#5403)
72
+ const base = gitOut(["-C", root, "rev-parse", "--abbrev-ref", "HEAD"], root);
73
+ if (base) {
74
+ const remote = gitOut(["-C", root, "rev-parse", "--abbrev-ref", `${base}@{upstream}`], root);
75
+ if (remote) {
76
+ const ff = spawnSync("git", ["-C", root, "merge", "--ff-only", remote], { stdio: "ignore", timeout: 15000 });
77
+ if (ff && ff.status === 0) console.log(`\x1b[2m[runner]\x1b[0m ${base} fast-forwarded to ${remote}`);
78
+ }
79
+ }
80
+
81
+ const r = spawnSync("git", ["-C", root, "worktree", "add", "--no-track", "-B", branch, seatDir, "HEAD"], {
70
82
  encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], timeout: 30000,
71
83
  });
72
- if (r.status === 0) return seatDir;
84
+ if (r.status === 0) {
85
+ // Persist the base branch so the Review lens can name the real base instead
86
+ // of guessing via merge-base. Stale metadata is unset, not trusted. (#5403)
87
+ if (base) {
88
+ spawnSync("git", ["-C", seatDir, "config", `branch.${branch}.base`, base], { stdio: "ignore", timeout: 5000 });
89
+ }
90
+ // Set push.autoSetupRemote so a plain git push creates and sets upstream on
91
+ // first push (git >= 2.37, older clients ignore it). (#5403)
92
+ const pushAuto = gitOut(["-C", seatDir, "config", "--get", "push.autoSetupRemote"], seatDir);
93
+ if (!pushAuto) {
94
+ spawnSync("git", ["-C", seatDir, "config", "push.autoSetupRemote", "true"], { stdio: "ignore", timeout: 5000 });
95
+ }
96
+ return seatDir;
97
+ }
73
98
  console.log(`\x1b[33m[runner]\x1b[0m could not create ${branch} worktree — using ${sourceDir}`);
74
99
  return sourceDir;
75
100
  }
package/bin/policy.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  // trantor policy — the autonomy ladder's admin surface (PRD §6): show levels + links,
3
3
  // set a project's level, declare that two projects are codependent.
4
- // trantor policy show | set <project> <1-4> | link <a> <b> --reason "<why>"
4
+ // trantor policy show | set <project> <1-4> | link <a> <b> --reason "<why>" | unlink <a> <b>
5
5
  // Drafted by scrooge (deepseek-v4-flash), integrated by the orchestrator.
6
6
  import { readFileSync } from "node:fs";
7
7
  import { join } from "node:path";
@@ -30,7 +30,7 @@ const post = async (hub, payload) => {
30
30
 
31
31
  const legend = { 1: "1 observe", 2: "2 warn", 3: "3 gate", 4: "4 auto" };
32
32
  function usage() {
33
- console.log('usage: trantor policy show | set <project> <1-4> | link <a> <b> --reason "<why>"');
33
+ console.log('usage: trantor policy show | set <project> <1-4> | link <a> <b> --reason "<why>" | unlink <a> <b>');
34
34
  process.exit(1);
35
35
  }
36
36
 
@@ -71,4 +71,13 @@ if (cmd === "link") {
71
71
  process.exit(0);
72
72
  }
73
73
 
74
+ if (cmd === "unlink") {
75
+ if (!arg1 || !arg2) usage();
76
+ for (const hub of hubs) {
77
+ try { await post(hub, { unlink: { projects: [arg1, arg2] } }); console.log(`✓ ${arg1} ↮ ${arg2} on ${hub}`); }
78
+ catch (err) { console.warn(`⚠ ${hub}: ${err.message}`); }
79
+ }
80
+ process.exit(0);
81
+ }
82
+
74
83
  usage();
package/hub.mjs CHANGED
@@ -1504,6 +1504,12 @@ const server = http.createServer(async (req, res) => {
1504
1504
  declaredBy: auth?.identity?.name || String(b.by || ""), ts: now() });
1505
1505
  }
1506
1506
  }
1507
+ // Unlink is link's inverse (#5397 shipped the app's Unlink button before this existed —
1508
+ // a declared codependency the operator can make, they must also be able to unmake).
1509
+ if (b.unlink && Array.isArray(b.unlink.projects) && b.unlink.projects.length >= 2) {
1510
+ const key = b.unlink.projects.slice(0, 4).map(x => canon(String(x).slice(0, 80))).sort().join(" ");
1511
+ p.links = (p.links || []).filter(l => (l.projects || []).slice().sort().join(" ") !== key);
1512
+ }
1507
1513
  state.orgPolicy = p; dirty = true;
1508
1514
  return json(res, 200, { ok: true, ...overseerPolicy() });
1509
1515
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trantor",
3
- "version": "0.18.26",
3
+ "version": "0.18.28",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "trantor": "bin/cli.mjs"