Skip to content

feat: give ls --json each thread's lineage and its PRs' T3 snapshots - #43

Open
goobles-agent[bot] wants to merge 2 commits into
mainfrom
feat/ls-lineage-pr-snapshots
Open

goobles-agent[bot] wants to merge 2 commits into
mainfrom
feat/ls-lineage-pr-snapshots

Conversation

@goobles-agent

@goobles-agent goobles-agent Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

t3ctl ls --json now passes on two things T3's shell snapshot already has:

  • parentThreadId and rootThreadId on each thread, from its lineage. A reader can then find every subagent an orchestrator thread started (rootThreadId is the orchestrator's id, parentThreadId set).
  • linkedAt and snapshot on 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), or null before 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 ls already reads.

The old comment said ls leaves state out because T3's copy can be stale. The snapshot now carries syncedAt, 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 for parentThreadId/rootThreadId and the updated PR contract test
  • npm run build
  • node dist/t3ctl.js ls --json --all against goobles-agentbox: "ORCH: Gearset Replacement" has rootThreadId = its own id, 419 threads point at it as their root, and its PRs carry snapshots with checksState and branches

After 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.

- 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>
@goobles-agent
goobles-agent Bot requested a review from Goobles October 29, 2026 19:24

@goobles-agent goobles-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@goobles-agent goobles-agent Bot added the bot reviewed Reviewed by an agent label Oct 29, 2026
- 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>

@goobles-agent goobles-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot reviewed Reviewed by an agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant