fix: couple derived DING to agent lifecycle - #154
Merged
schickling merged 2 commits intoAug 3, 2026
Merged
Conversation
agent-tool: Codex agent-tool-version: 0.145.0 agent-runtime: Codex 0.145.0 agent-session-lookup: unavailable tooling-profile: dotfiles@unknown-dirty
agent-tool: Codex agent-tool-version: 0.145.0 agent-runtime: Codex 0.145.0 agent-session-lookup: unavailable tooling-profile: dotfiles@unknown-dirty
schickling-assistant
marked this pull request as ready for review
August 3, 2026 14:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A compact agent's generated DING was reconciled as an independent sibling. After the canonical agent exhausted fail-mode restarts or became lifecycle-ineligible, the DING could remain running or be relaunched without a live target terminal.
Goal
Keep generated companions coupled to the canonical agent's eligibility and terminal lifecycle while preserving same-pass healthy startup, retirement, exact-task selection, and explicitly authored sibling independence.
Decisions
derivedrelationship into resolved launch targets; do not infer dependency from the task name, because an authoredexec "ding"is independent.adopt-onlyheld agent suppresses a missing companion and stops an exact generated companion proved live.Verification
report.torn_downempty, and selecting an absent generated DING leftreport.heldempty.CI=1 nix develop -c cargo test --test run failed_compact_agent -- --nocapture: 2 failure-seam tests passed after the fix.CI=1 nix develop -c cargo test --test run selected_missing_derived_ding -- --nocapture: 1 exact-selector test passed after the fix.CI=1 nix develop -c cargo test --test run --test invariants --test targeted_reconcile -- --nocapture --test-threads=2: all 37 supervision tests and the invariant-reference test passed; the two CLI-only targeted tests also passed. The unchanged real-PTY test reportedrestarted (1)where its fixture expectslaunched (1).CI=1 nix develop -c cargo test --test targeted_reconcile targeted_once_cli_ -- --nocapture --test-threads=1: 2 bounded targeted CLI tests passed.CI=1 CARGO_BUILD_JOBS=2 nix develop -c cargo test --all-targets --all-features -- --test-threads=2: all targets beforematerializepassed;up_materialize_only_writes_the_overlay_without_needing_ptyfailed because its fixed/usr/bin:/binPATH cannot rungit rev-parsein the Nix shell. The exact isolated test fails identically on cleanorigin/mainat509ffb4, and the materialization implementation/tests are unchanged by this PR.cargo clippy --all-targets --all-features -- -D warningsreached the repository but failed on eight unchanged baseline warnings:agent_author.rs:311and:729(too_many_arguments),agent_publish.rs:393(needless_borrows_for_generic_args),catalog_lock.rs:231(let_and_return),catalog_transaction.rs:1195(needless_borrow) and:1778(too_many_arguments),eval_run.rs:521(too_many_arguments), andmessage.rs:835(too_many_arguments).Complexity
No new module or dependency. The planner carries the authored derived bit plus exact live-derived IDs so execution can make dependency-aware decisions without guessing from names or re-observing runtime state.
Concerns
Draft PR #135 overlaps
src/reconcile.rs,src/run.rs, and shared documentation on a different stacked base. If that stack resumes, one side will need a semantic rebase around launch planning.Friction & bottlenecks
Follow-ups
main.References
Closes #149
Related: #135