Skip to content

refactor(lifecycle): move branch and PR ownership out of root - #1136

Open
ScriptedAlchemy wants to merge 15 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
sol/project-lifecycle-1073
Open

refactor(lifecycle): move branch and PR ownership out of root#1136
ScriptedAlchemy wants to merge 15 commits into
codex/tracedecay-total-redesign-plan-reopenedfrom
sol/project-lifecycle-1073

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

  • move GitHub PR tracking into tracedecay-application and branch publication into tracedecay-code-index-runtime
  • keep root only for cross-owner lifecycle composition and daemon-owned cancellation/shutdown
  • cancel and join manual branch publications before dependent shutdown; a JoinSet drain no longer detaches a still-mutating task
  • return typed PR cleanup receipts and preserve managed state until every owned worktree/branch/ref is gone
  • remove dead/test-only public lifecycle façades

Part of #1073 and the #707 simplification audit.

Verification

  • PR suite: 21; branch publication: 7; retained state: 4; dashboard reader: 2
  • paused-time 60s publication stall cancels and joins before receipt
  • cancelled teardown keeps artifacts and ownership; uncanceled retry removes all
  • affected check/clippy with zero warnings
  • formatting, cycle/metadata, diff hygiene, and commitlint

…plan-reopened' into sol/project-lifecycle-1073
…plan-reopened' into sol/project-lifecycle-1073

# Conflicts:
#	crates/tracedecay-dashboard-api/src/settings_api.rs
#	crates/tracedecay/src/config.rs
…plan-reopened' into sol/project-lifecycle-1073
…plan-reopened' into sol/project-lifecycle-1073
…plan-reopened' into sol/project-lifecycle-1073
…plan-reopened' into sol/project-lifecycle-1073
…plan-reopened' into sol/project-lifecycle-1073
@changeset-bot

changeset-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 51d1cac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

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 Completed 2026-09-09T08:24:34.103144Z 51d1cac 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 51d1cacbd1

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

config: project_editable_settings(&project_configuration),
tracedecay_dir_gitignored: crate::config::is_in_gitignore(&state.project_root),
pr_autotrack: pr_autotrack_payload(state),
pr_autotrack: pr_autotrack_payload(state)?,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preflight PR state before committing settings

When pr-autotrack.json is malformed or unreadable, this fallible projection runs only while constructing the response, after each PATCH handler has already committed its configuration mutation. The endpoint therefore returns a configuration-authority error even though the requested setting changed, misleading clients and causing retries to encounter the new revision; read this state before committing or represent PR status as a typed unavailable field in the successful response.

AGENTS.md reference: AGENTS.md:L9-L12

Useful? React with 👍 / 👎.

Some(&schedulers),
&branch,
&lifecycle,
&PrCommandControlV1::with_cancellation(cancellation.clone()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the previous branch when cancellation interrupts refresh

When an already-tracked manual branch has advanced, activation first unmounts and deletes its prior worktree and refs before rebuilding them. Passing the shutdown cancellation token here makes that reconstruction interruptible; cancellation after deletion returns before branch publication or metadata rollback, leaving durable branch metadata pointing at artifacts that no longer exist until the operator manually retries. Defer cancellation once replacement becomes destructive, or restore/settle the prior metadata and artifacts on failure.

AGENTS.md reference: AGENTS.md:L180-L183

Useful? React with 👍 / 👎.

std::mem::take(&mut *owned)
};
while let Some(result) = tasks.join_next().await {
if let Err(error) = result {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Report publication join failures in the shutdown receipt

If an admitted publication task panics or is aborted, join_next() returns Err, but this branch only logs the failure and the method still returns (). Because engine/shutdown.rs registers this method with ShutdownOwner::new, the terminal receipt records the owner as clean despite a failed task and potentially partial branch mutation; return a failure and use a result/status shutdown owner instead.

AGENTS.md reference: AGENTS.md:L141-L143

Useful? React with 👍 / 👎.

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