feat(atlas): add canContinueTrackedBoulderSession for lineage-aware continuation

- Implement canContinueTrackedBoulderSession helper function
- Add lineage validation for appended descendant sessions
- Add agent matching logic for tracked sessions
- Add comprehensive tests for lineage continuation scenarios
- Add persisted lineage tests for boulder state tracking

🤖 Generated with assistance of OhMyOpenCode
This commit is contained in:
YeonGyu-Kim
2026-04-05 17:14:47 +09:00
parent 9199dd545f
commit cd71ced0fb
3 changed files with 332 additions and 31 deletions
+8 -7
View File
@@ -100,7 +100,7 @@ describe("atlas hook idle-event session lineage", () => {
assert.equal(promptCalls.length, 0)
})
it("appends boulder-owned subagent sessions during idle when lineage reaches tracked session", async () => {
it("does not append lineage-only subagent sessions during idle even when lineage reaches tracked session", async () => {
const subagentSessionID = "subagent-session-456"
const intermediateParentSessionID = "subagent-parent-789"
@@ -120,11 +120,11 @@ describe("atlas hook idle-event session lineage", () => {
},
})
assert.equal(readBoulderState(testDirectory)?.session_ids.includes(subagentSessionID), true)
assert.equal(promptCalls.length, 1)
assert.equal(readBoulderState(testDirectory)?.session_ids.includes(subagentSessionID), false)
assert.equal(promptCalls.length, 0)
})
it("does not inject continuation for boulder-lineage subagent with non-matching agent", async () => {
it("does not inject continuation for lineage-only subagent with non-matching agent", async () => {
const subagentSessionID = "subagent-session-agent-mismatch"
writeIncompleteBoulder({ agent: "atlas" })
@@ -142,11 +142,11 @@ describe("atlas hook idle-event session lineage", () => {
},
})
assert.equal(readBoulderState(testDirectory)?.session_ids.includes(subagentSessionID), true)
assert.equal(readBoulderState(testDirectory)?.session_ids.includes(subagentSessionID), false)
assert.equal(promptCalls.length, 0)
})
it("injects continuation for boulder-lineage subagent with matching agent", async () => {
it("does not inject continuation for lineage-only subagent with matching agent until explicitly tracked", async () => {
const subagentSessionID = "subagent-session-agent-match"
writeIncompleteBoulder({ agent: "atlas" })
@@ -164,7 +164,8 @@ describe("atlas hook idle-event session lineage", () => {
},
})
assert.equal(promptCalls.length, 1)
assert.equal(readBoulderState(testDirectory)?.session_ids.includes(subagentSessionID), false)
assert.equal(promptCalls.length, 0)
})
it("injects continuation for explicitly tracked boulder session regardless of agent", async () => {