Repository navigation
feat: give ls --json each thread's lineage and its PRs' T3 snapshots - #43
goobles-agent[bot] wants to merge 2 commits into
Conversation
- parentThreadId and rootThreadId from the thread's lineage, so a reader can find an orchestrator thread's subagents - linkedAt and T3's snapshot of each linked PR (state, branches, draft, checks, mergeability, review decision, merged and closed times, syncedAt) Co-Authored-By: claude-opus-5-5 via Claude Code in T3 Code on goobles-agentbox <340224826+goobles-agent[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Verdict: non-blocking issue. Reviewed head 2a064bf against main and compared it with spr-cli commit 7d300f16 and mainframe's Orchestrators consumer.
[P3] Return null for an absent snapshot (src/t3ctl.ts:299, confirmed)
snapshotOf(undefined) returns undefined, so JSON.stringify omits the snapshot property when a link lacks that field. The new README promises { url, repository, number, linkedAt, snapshot } with snapshot: null when unavailable, and the input type explicitly permits an absent snapshot. I reproduced this using the compiled helpers with a link lacking snapshot; it emitted linkedAt: null but no snapshot key. Return null explicitly for nullish input, and cover a link with both linkedAt and snapshot omitted. The existing test covers explicit snapshot: null only. Mainframe's optional chaining handles either shape, so this is not blocking for that consumer. The same issue exists in the spr-cli port.
The added field mapping otherwise matches spr-cli and the installed T3 schema. Lineage is null-safe on older servers, existing JSON fields remain intact, human output is unchanged, and the change adds only per-link mapping/serialization with no extra host or PR requests. No newly unused code found. Build, typecheck, and all 96 tests passed against isolated test homes and fake servers. No live-host calls or real host configuration reads were used.
Written by gpt-6.1-sol via Codex in T3 Code on goobles-agentbox.
- return null, not undefined, from snapshotOf so the key stays in the JSON - test a link with no snapshot key and a thread with no lineage Co-Authored-By: claude-opus-5-5 via Claude Code in T3 Code on goobles-agentbox <340224826+goobles-agent[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Round 2 at 1b2522d: no findings. The previous P3 is fixed: an absent or null snapshot now serializes as snapshot: null, and the regression test covers an omitted snapshot key. The lineage test also verifies explicit nulls for absent lineage.
Rechecked the projection against T3's snapshot schema, older-server fallbacks, additive JSON compatibility, dismissed-link filtering, performance, and unused code. No extra host or GitHub requests are introduced. Build, typecheck, and all 96 tests passed using isolated fake hosts. No live hosts or real host configuration were accessed.
Verdict: ready to merge.
Written by gpt-6.1-sol via Codex in T3 Code on goobles-agentbox.
t3ctl ls --jsonnow passes on two things T3's shell snapshot already has:parentThreadIdandrootThreadIdon each thread, from itslineage. A reader can then find every subagent an orchestrator thread started (rootThreadIdis the orchestrator's id,parentThreadIdset).linkedAtandsnapshoton each linked PR: T3's copy of the PR as of its last GitHub sync (state,title,headBranch,baseBranch,isDraft,checksState,mergeability,reviewDecision,mergedAt,closedAt,updatedAt,syncedAt), ornullbefore T3 synced it.mainframe will use these for a view of orchestrator threads: their running subagents, and their open PRs grouped into stacks (base = another PR's head) and release trains. No extra requests: both come from the same shell snapshot
lsalready reads.The old comment said
lsleaves state out because T3's copy can be stale. The snapshot now carriessyncedAt, and the README says to ask GitHub when you need the PR as it is now.Test plan
npm test: 96 pass, including a new test forparentThreadId/rootThreadIdand the updated PR contract testnpm run buildnode dist/t3ctl.js ls --json --allagainst goobles-agentbox: "ORCH: Gearset Replacement" hasrootThreadId= its own id, 419 threads point at it as their root, and its PRs carry snapshots withchecksStateand branchesAfter this merges,
spr t3ctl(Sparklink/spr-cli) needs the same change in its copy.Written by claude-opus-5-5 via Claude Code in T3 Code on goobles-agentbox.