Skip to content

refactor(server): move thread family deletion behind a seam - #911

Merged
lastobelus merged 1 commit into
lastcode/mainfrom
lastcode/reseat-orchestrator-archive
Nov 30, 2026
Merged

lastobelus merged 1 commit into
lastcode/mainfrom
lastcode/reseat-orchestrator-archive

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Why

Deleting owned descendants with their parent is fork-only behavior. It grew from upstream's side-chat cleanup into owned descendants and worktree cleanup, and all of it sat inline in the delete case of the Orchestrator.ts dispatcher. That block keeps showing up in upstream replay diffs. This is part of the Orchestrator conflict-reduction work and follows the archive planner extraction.

What changed

Worktree planning, descendant deletion and effect collection now live in one fork-owned module, apps/server/src/orchestration-v2/LastCodeThreadFamilyDeletion.ts. The delete case calls it.

  • Dispatcher owns locks, the receipt, the participant guard and the commit.
  • Deletion planner produces each thread's events and effects.
  • Protected-descendant test (ThreadFamilyLifecycle.integration.test.ts) now asserts that every thread in the family stays active and that the root command queues no effects.

Measured effect

Against the shared upstream baseline:

Before After
Downstream lines added in the delete case 139 2
Changed lines in the Orchestrator.ts diff 7,361 7,219
Total lines in Orchestrator.ts 23,128 22,984

In the 14-day sample, two upstream changes touched the delete case or its three-line context. The table measures the diff against that baseline. Nightly conflict frequency remains to be measured.

Verification

  • 148 focused tests passed.
  • Quick CI passed.
  • The changed-file check passed, including 158 tests.

Local review: 1 round with GPT-6.1 Terra (xhigh), approved at dca9ceef530b5866e90f89192c92827e03dae79f.

Implemented with GPT-6.2 Sol (xhigh), Codex through LastCode.

Family deletion adds a large fork-specific block to the upstream
dispatcher. Move worktree planning, descendant deletion and effect
collection behind one call, preserving the dispatcher locks, receipt and
commit path. Strengthen the protected-descendant test to cover the whole
family and the effect outbox.

Implemented with GPT-6.2 Sol (xhigh), Codex through LastCode.

Carry-Group: incubator
Carry-Fix: #720
Carry-Observation: Keep family deletion with its fork-owned lifecycle behavior. The inline delete case grew from upstream side chats to owned descendants and worktree cleanup.
Carry-Evidence: #742
@lastobelus
lastobelus marked this pull request as ready for review November 30, 2026 00:08
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T00:10:05.919813Z dca9cee Manual request
ℹ️ 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.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@lastobelus lastobelus changed the title refactor(server): move thread family deletion out of Orchestrator refactor(server): move thread family deletion behind a seam Nov 30, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: dca9ceef53

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit 357cc5f into lastcode/main Nov 30, 2026
52 of 66 checks passed
@lastobelus
lastobelus deleted the lastcode/reseat-orchestrator-archive branch November 30, 2026 00:23
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