fix(orchestrator): keep subagents behind their agent on the 3D time axis
With depth = time, #agents/3d drew subagents behind the session that spawned them. A subagent took the mtime of its meta.json, which is rewritten when it finishes, and a session took the moment the hub first saw its name, or the window end when it had none. Sessions now take the first line of their transcript and subagents the first line of theirs, both from /api/subagents, with the old values as fallback. SpaceView.notBeforeParent moves a spawned node without a time, or with one before its parent's, to its parent's time, nested subagents included, so no subagent lies before the agent that spawned it. The 3D signature carries the time, so the nodes move once the lifetimes load. 🎯 Fix: 93 % 💥 Break: 2 % 💸 Cost: 100 % ⏱️ Time: – 🛡️ Security: 100 % 🏆 Score: 91 🚦 Gate: ✅ 90/5, cost and time <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ba97f7cc2e
commit
86b55dbc91
4 files changed
+38
-7
No files matched your search
@@ -92,6 +92,11 @@ console.log(JSON.stringify({
|
||||
spawn: [0, 1, 2, 4, 9].map((level) => S.depthOf("spawn", {ts: now, level}, [low, now])),
|
||||
none: [S.depthOf("none", {ts: low, level: 3}, [low, now]), S.depthOf("none", {ts: now, level: 0}, [low, now])],
|
||||
},
|
||||
parents: S.notBeforeParent([
|
||||
{id: "c", kind: "chair", ts: 200}, {id: "s", kind: "session", parent: "c", ts: 100}, {id: "w", kind: "twig", parent: "v", ts: 120},
|
||||
{id: "t", kind: "twig", parent: "s", ts: 50}, {id: "u", kind: "twig", parent: "t"}, {id: "v", kind: "twig", parent: "s", ts: 150},
|
||||
{id: "x", kind: "subagent", parent: "gone", ts: 30}, {id: "y", kind: "twig", parent: "z", ts: 5}, {id: "z", kind: "twig", parent: "y", ts: 7},
|
||||
], new Set(["twig", "subagent"])).map((node) => [node.id, node.ts]),
|
||||
same: [S.scene(input), S.scene(JSON.parse(JSON.stringify(input)))].every((other) => JSON.stringify(other) === JSON.stringify(built)),
|
||||
lines: Object.fromEntries(built.lines.map((entry) => [entry.sub || entry.node, {kind: entry.kind, level: entry.level, alive: entry.alive, stamps: entry.points.map((point) => point.ts), first: entry.points[0], name: entry.timeline[0].name}])),
|
||||
labels: built.labels.filter((label) => built.lines[label.line].node === "s5").map((label) => [label.at.ts, label.text]),
|
||||
@@ -174,6 +179,9 @@ class TestSpaceModule(unittest.TestCase):
|
||||
self.assertEqual(axis["spawn"], [-300, -150, 0, 300, 300])
|
||||
self.assertEqual(axis["none"], [0, 0])
|
||||
|
||||
def test_a_subagent_never_lies_before_the_agent_that_spawned_it(self):
|
||||
self.assertEqual(self.data["parents"], [["c", 200], ["s", 100], ["w", 150], ["t", 100], ["u", 100], ["v", 150], ["x", 30], ["y", 7], ["z", 7]])
|
||||
|
||||
def test_world_lines_are_deterministic_and_follow_the_layout_of_their_time(self):
|
||||
self.assertTrue(self.data["same"])
|
||||
lines = self.data["lines"]
|
||||
|
||||
Reference in new issue
Block a user