Skip to content

fix(pstack): align delegated task lifecycle with T3 - #47

Open
pb3975 wants to merge 2 commits into
chhoumann:mainfrom
pb3975:fix/t3-delegated-task-lifecycle
Open

pb3975 wants to merge 2 commits into
chhoumann:mainfrom
pb3975:fix/t3-delegated-task-lifecycle

Conversation

@pb3975

@pb3975 pb3975 commented Oct 24, 2026 •

Copy link
Copy Markdown

pstack's T3 mappings currently start Autopilot-full PR owners as ordinary top-level conversations and allow the same-conversation continuation exception to cover independent review rounds. The current T3 orchestration contract requires child tasks for delegated workers and a fresh delegated task for each independent review round.

This patch fixes the source substitutions and their distributed skill/playbook text:

  • Start PR owners with delegate_task and retain their task IDs. Reserve t3_thread_launch and create_threads for explicit requests for separate conversations.
  • Require a new delegate_task for each independent review round, with the original brief, prior findings, responses, unresolved objections, and a distinct round request ID that stays stable across retries.
  • Preserve legitimate t3_thread_send follow-ups that need the same child's conversation or running state. That exception cannot start an independent review round.
  • Use T3-managed isolation: "worktree" for writing children, based on the parent's local commit. Explain that uncommitted edits are not copied, and update the related fan-out, PR, and shipping guidance. For a different PR head, resolve the exact SHA before dispatch and check it out detached inside the verifier's assigned worktree; keep the parent checkout and live owner branch unchanged, confirm HEAD, and refresh setup for that target.

The existing fork registry records the affected policy files. Upstream pins stay at 4ec7ffa; this does not import an upstream update. The Unreleased entry leaves the version unchanged for inclusion in the next maintainer release, rather than competing with the release already proposed in #46.

Verification:

  • GitHub Actions: CI and Security are held with action_required; both have zero jobs. The upstream maintainer must approve the external-contributor workflow runs. This is separate from the passing local checks.
  • Six new regression checks cover the distributed skills and a temporary Git fixture with an active PR owner. Each new check failed before its fix and passes afterward. The existing PR-triggered test job runs them without a new workflow or dependency.
  • Root tests: 543 passed, 59 platform or opt-in skips.
  • Vendored tests: 119 passed. Skill script tests: 29 passed, 38 TLC-dependent skips.
  • Generator check, all three pinned upstream sync dry runs, vendored typecheck and formatting, shellcheck, Markdown lint, actionlint, and offline links passed.
  • Integration recheck: all six delegation regression tests and the diff whitespace check passed. The first commit also passed 160 focused delegation/sync tests with 14 filesystem-dependent skips, plus the generator check.

These checks verify the distributed instructions and sync boundary. They do not claim an end-to-end installed-plugin run inside T3. Astra review round 1 found a branch-ownership edge case: the parent cannot check out a PR branch already held by its owner worktree. Commit a0bfd09 fixes it by keeping the parent checkout unchanged and selecting the exact PR commit inside each verifier's isolated worktree. Two added checks cover the fix, including the real Git checkout recipe and dependency setup at the requested commit. Fresh Astra review round 2 passed at a0bfd09: the branch-ownership finding is resolved, all six delegation tests pass, and there are no new correctness findings or unresolved lifecycle contradictions in the reviewed diff. No live installed T3 task was exercised.

Produced by GPT-6.1-Sol through Codex in T3 Code, with GPT-6-Astra review, on behalf of @pb3975.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-24T13:40:38.190031Z fd3bf4c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant