Skip to content

fix(install): require cleanup-safe runtime and persistence paths #237

Open

Description

@ebarti

Implementation progress — 27 October 2026

Partial implementation; substantive work remains. #264 supplies the durable runtime/offline-recovery foundation; #268 adds retained managed generations. #248 also contains the narrow uv 0.12.17 registration compatibility repair.

Authenticated legacy-owner enrollment/cutover and native source-successor acknowledgement remain incomplete. Historical installation/capture compatibility failures remain unresolved. Complete native descendant settlement depends on #242. No active installation or rollout is established by these PRs.

The referenced candidates are open and unmerged in stack #253. This progress map is non-closing; issue acceptance remains authoritative. Historical text below calling #238 open is superseded: #238 merged as c43cf0b.

Problem and evidence

The reliability incident lost the installed controller/virtual environment when an old managed chat worktree was cleaned up. A separate temporary Git common directory was also lost after reboot. Automatic worktree cleanup is an enabled, supported user setting and must remain usable.

The current local installation has already been moved to an independent permanent runtime. Its installation recovery code validates the independent Git directory, environment/import paths and executable bindings. However, the ordinary installer still derives ROOT from its invoking checkout and registers links into that source; permanent migration protection must become an installation-wide guarantee.

The inspected local recovery head is bfc918a; inspected public main is fc1eab1. Reuse and land the existing repair under review where applicable, then verify the supported installation. Do not treat an isolated local fix as repository-wide delivery.

Required behavior

  • Production install, upgrade, service registration and launcher registration must resolve to an independently owned durable installation and persistence root.
  • Validate the full dependency chain: source and Git common/object directories, editable imports, virtual environment, bundled tools, shebangs, service working directory, plugin/helper links, configuration, databases, journals and recovery evidence.
  • Do not depend on disposable managed worktrees, temporary directories or Git object alternates pointing into them. Account for configured managed-worktree roots and aliases rather than matching only one default path spelling.
  • Provide a supported migration from an unsafe installation that preserves original runs, journals, permissions, candidates and budgets, with recoverable rollback and independently verified readiness.
  • Keep development/trial installations explicit and isolated; they must not replace the production registration or its state.
  • Explain which data is durable and which caches/checkouts may be removed. Do not require disabling cleanup, pinning every chat or increasing the retention limit.

Acceptance

In owned fixtures, install/upgrade from a disposable checkout, remove that checkout and its temporary ancestors, then restart and use the installed CLI/API. Verify imports, persisted runs and recovery remain available. Test indirect path dependencies, failed migration and rollback. Read back the actual active installation after the approved upgrade.

Reference: managed and permanent worktrees and cleanup.

Existing implementation to reuse

PR #238 is open at bfc918a545ce820f47c814e99a6fe5e92b1c3fc1, matching the inspected installed runtime. Reuse its already-installed permanent-runtime migration and exact environment/import/lock validation. This issue makes cleanup-safe paths an invariant of ordinary installs and upgrades as well.

Dependencies

No blocking prerequisite in this issue set. This work can proceed in parallel with the other independent foundations; integrated qualification will verify their composition.

Blocks:

Activity

  1. ebarti commented on Oct 26, 2026

    @ebarti
    OwnerAuthor

    Independent audit evidence, 2026-10-26: P1 — ordinary successful registration still depends on its setup checkout. Reusing this issue because the symptom, owning boundary and acceptance scope match.

    Current state verified: PR #238 is merged at c43cf0bec931f4651fdeefdfc82a9e7d523c36b2; the live service reports clean bfc918a545ce820f47c814e99a6fe5e92b1c3fc1. Both commits have tree 7bc096ef3c1ce21bd6f24156c54e748a0a3206af. The active editable import resolves inside the permanent runtime. This finding concerns ordinary registration, not a demonstrated failure of that migrated installation.

    Observed trigger and reproduction. In an owned disposable local clone, run the actual public installer with explicit fixture skills/Codex destinations, then rename only the fixture source checkout:

    # REPO is an existing checkout of the audited commit; PYTHON is Python 3.12.
    fixture=$(mktemp -d)
    git clone --no-hardlinks "$REPO" "$fixture/source"
    mkdir "$fixture/codex"
    DEVFLOW_PYTHON="$PYTHON" sh "$fixture/source/scripts/install.sh" \
      "$fixture/skills" "$fixture/codex"
    mv "$fixture/source" "$fixture/removed-source"
    test -f "$fixture/skills/devflow-local-delivery/SKILL.md"
    test -f "$fixture/skills/devflow/scripts/state.py"
    test -f "$fixture/skills/devflow/references/implementation-worker.md"

    The installer returned 0 and reported installation complete. All three files were readable before source removal and unavailable afterward. readlink showed each registration still targeting the old fixture source. The four copied agent definitions survived. No service/provider was started and no production installation, setting, delivery or source was modified.

    Code evidence and cause. install.sh:4 derives ROOT from the invoking checkout. install-service-entry.py:125 selects the service beneath it; lines 193–200 register source-bound helper/reference/service links. Successful pointer creation is treated as completed installation before independent source custody exists. Cleanup exposes the failure later.

    Expected invariant / smallest coherent fix. Ordinary production install and upgrade must first adopt or reuse an independently owned durable installation, then publish and verify registrations against that owner. Reuse the stronger permanent-installation custody. Preserve explicit isolated development installs and the existing migration/rollback checks; do not solve this by disabling cleanup.

    Acceptance additions.

    • Run the ordinary public installer and upgrade from a disposable source; remove that source and prove registered skill/helper/reference loading plus CLI/API restart from retained runtime.
    • Exercise failed migration/rollback and indirect Git-common/object, editable-import, environment and launcher dependencies.
    • Read back the actual active installation separately from fixture results.

    This probe proves registration loss. It does not claim an already migrated live runtime failed or that full restart/rehydration was exercised.

    Overlap/dependencies. Open/closed issue searches for install/cleanup, installer/crash and install/symlink plus all-state related PR searches found this issue as the owning scope. #238 supplies useful permanent-runtime work but leaves this ordinary path. #246 remains related integrated qualification; the existing #237 → #241 dependency remains sufficient. No new prerequisite is asserted.

  2. ebarti commented on Oct 26, 2026

    @ebarti
    OwnerAuthor

    Additional reproduced installation compatibility gap: a legitimate environment created by CI-pinned uv 0.12.17 contains both the editable runtime PTH and uv's standard _virtualenv.pth/module. The existing destination verifier required exactly one PTH, so public installed-location preflight refused before reaching its intended plugin check. The same fixture with uv 0.13.5 reached and completed the location flow.

    The small repair in #248 recognizes only the exact upstream uv0.12.17 bytes and module hash, keeps current-file ownership/link/destination checks, and refuses extra registrations and import shadows. It has focused and actual uv-environment evidence plus independent scoped review. This is a present-environment compatibility fix; retrospective startup-code authenticity is an inherited boundary, not a newly established guarantee.

    The larger #237 durable installation/update/recovery layer remains in progress. A native source-successor transition is still distinct unfinished work: the existing location acknowledgement refuses a different current acknowledgement. It must preserve exact closed execution/native custody and prior authorization instead of using row status as closure or weakening the original gate. No active installation has been changed.

  3. ebarti commented on Oct 27, 2026

    @ebarti
    OwnerAuthor

    Implementation finding in the existing #237 scope — P1: installer rollback can lose a concurrent replacement after a crash. In an owned public old-updater fixture, a second writer replaced a captured target after validation. The updater moved that replacement into its private backup and exited before authenticating it. Restore reconstructed the earlier bytes and discarded the backup; the only copy of the replacement was lost. Observed foreign_copy_preserved: false; expected is to retain the displaced object and an actionable conflict until its owner can reconcile it.

    The owning boundary is scripts/install-rollback.py's capture/effect/restore sequence, especially effect and restore_targets. PR #264 now preserves unverified displaced objects, reattaches their public name where safe, retains backups and conflict state, and syncs journal and namespace changes before retirement. Identity-only checks stream instead of introducing a global size cap on valid legacy files.

    Validation on exact source d73ade91: 64 rollback, service-entry and upgrade tests plus 27 subtests passed, including an actual public old-updater fault, process exit after real capture, oversized replacements and ordered sync failures. The three affected files on the restacked candidate match those bytes, and root separately passed six targeted cases. These tests use owned disposable files; no installed runtime or active delivery changed. This corrects the observed crash window but does not complete #237's legacy enrollment or source-successor transition; #237 remains open.

  4. ebarti commented on Oct 27, 2026

    @ebarti
    OwnerAuthor

    Partial installation repair is proposed in #268: retained managed generations with preflight, activation, offline rollback and managed-start namespace binding. Owned public installation/process tests passed on the integrated candidate. Legacy owners without authenticated custody and native descendant closure remain unresolved; #242 remains a dependency. No active installation has been changed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions