Skip to content

Track post-cap restart safety findings from PR #121 #156

Closed

Description

@brettheap

PR #121 received additional automated findings after the repository's two-round Copilot cap. This issue records the verified findings under the 2026-09-16 ruling in AGENTS.md. The PR remains held while its legacy compatibility implementation is completed.

  • Handoff comparison and replacement were separate operations, allowing a cooperating writer to overwrite changed input. Serialize ownership and checksum checks with atomic replacement under the existing helper writer mutex.
  • Truncated or malformed schema-1 records could be silently repaired during a transition. Validate all mandatory fields, duplicates, identity keys, numeric counters, absolute paths and digest syntax before any write.
  • A signal after the launcher exited could offer retry while a descendant still held the lane. Require affirmative all-holder absence before recording a retryable failure.
  • Pane respawn did not forward the configured control root. Preserve both LANES_LANE_STATE_ROOT and AGENT_PROTOCOL_ROOT with shell-safe quoting.
  • Interactive retry did not repeat the holder check after the preceding attempt failed. Check all holders before every claimed attempt launches and keep unknown/live ownership indeterminate.
  • An ordinary first launch with --dir and no register row failed when PROJECTS_ROOT was absent. Use the resolved checkout as a read hint after explicit-root and recorded-directory precedence, while continuing to refuse unreadable existing intents.

The launcher-boundary finding was checked against the current workBenches claude-profile implementation: an existing TMUX pane uses the foreground path and forwards the restart environment. The earlier new-session behavior is historical incident evidence, now clarified in the manual.

Implementation and sandbox regressions are being completed in #121. This issue does not release the merge hold or authorize changes to managed lane state.

Later post-cap review also identified four bounded safety cases fixed in the same held implementation: known current/recorded pane identity is required; child readiness rejects zombie/unknown process state; pane respawn preserves launcher host/OS/container values; and existing unusable state-root ancestors fail closed rather than answering absent intent. Sandbox regressions cover these cases.

Final stabilization at a950672 addresses seven further verified post-cap cases:

  • Require an existing absolute Claude checkout before preservation, and verify the entire pending identity, launch facts and handoff checksum before respawn. Fault-injected pending records cannot authorize killing the old pane.
  • Compare handoff filesystem identity at row/prompt gates so equivalent parent/leaf symlink spellings remain valid; preserve the links while publishing their target.
  • Reject record/control delimiters in launch facts instead of changing path bytes; preserve exact field values through read/write APIs.
  • Create intent temporaries exclusively with same-directory mktemp and private permissions; never follow the prior predictable temporary-name symlink.
  • Reject unknown keys, malformed lines and delimiters through the shared schema parser, including generated records before publication.
  • Fence both source and destination lane names during rename under the existing mutex. Unfinished/failed or malformed restart ownership refuses before canonical input changes.
  • Stop observers cooperatively through private cancellation markers and reap owned jobs. Never signal a numeric observer PID that may have been recycled; cover TERM between fork and PID publication too.

The expert panel verified these changes on inspection. New entrypoint regressions are in tests/test_supervised_restart_regressions.py; the serialized local run and current-head CI are in progress. The hold remains unchanged.

At 0e4b311, the final post-cap triage also:

  • Writes current pending profile/window/directory/handoff facts explicitly, preventing a prior operation's account profile from leaking into a new restart.
  • Defers TERM/HUP during claim CAS and claim-identity publication, then reconciles only the successfully owned attempt. A confirmed-empty holder read permits failure before any child launch; a lost CAS leaves the competing intent unchanged.
  • Resolves physical handoff targets under the shared writer mutex, so a waiting publisher cannot retain an obsolete symlink target.
  • Rejects blank lines as malformed schema content, alongside unknown keys and control delimiters.
  • Documents the existing legacy rename exception precisely: it shares the mutex and refuses unfinished recovery; its four-file transaction has EXIT rollback and existing stamp-failure regression coverage, rather than a crash-atomic guarantee. Restart preservation and resume-stamp publication retain the stronger atomic checksum contract.

The focused serialized rerun is queued and current-head CI is running. These updates do not release the existing merge hold.

Final helper hardening at 733557c requires the locked publication target to have the same filesystem identity as the operation's recorded handoff. Preservation binds that handoff through preparing-state CAS before publication. An installed but unreadable, non-executable, nonregular or broken managed reader refuses instead of falling back to an absence scan. The handoff skill now documents the legacy rename exception too. Five sandbox cases cover valid/wrong-target publication and unusable reader types. The expert panel found no blockers in these changes. Current-head CI is running; local serialization remains queued.

Activity

  1. added a commit that references this issue on Oct 4, 2026
    7ae8b40
  2. brettheap commented on Oct 4, 2026

    @brettheap
    ContributorAuthor

    Validation update: the serialized focused restart run at 733557c passed all 111 tests (874 deselected, 653.47s). Full CI run 37236724516 passed the other 984 tests but failed the older shell helper test: 3532 assertions passed and five failed in two fixtures that omitted the checkout directory and therefore hit the new preflight before their intended preservation errors. Test-only commit 69838c5 supplies the existing sandbox checkout in both calls, without changing runtime code or weakening assertions; QA confirmed reachability. The touched shell suite and new exact-head CI run 37238782354 are running. All PR discussions are resolved with precise fixed/deferred dispositions. Deferred cases remain open separately in #158 and #159. The user merge hold remains.

  3. brettheap commented on Oct 4, 2026

    @brettheap
    ContributorAuthor

    Final stabilization head: 69838c5
    PR: #121
    CI: https://github.com/opensoft/openRepoTools/actions/runs/37238782354

    All per-push checks passed:

    • Full suite: 985 passed in 1272.68s.
    • No submodule: 777 passed, 208 skipped in 1453.50s.
    • Windows: 153 passed, 832 skipped in 4.89s.
    • Guard/hygiene: 165 passed, 820 deselected in 4.05s.
    • macOS Bash 3.2 parse: passed.
    • SonarCloud: passed.

    Local focused restart verification: 111 passed, 874 deselected in 653.47s at 733557c; runtime files are identical at 69838c5.
    Local touched shell suite: 3537 passed, 0 failed, 0 skipped, 0 pending at 69838c5.
    Shell parsing, error-level ShellCheck, Python fixture compilation and strict OpenSpec validation passed.

    Nine-role expert review covered implemented stabilization; QA reviewed the final two fixture input corrections. All 53 discussions resolved. Exact-head @codex review request at 22:07:13Z received a quota refusal at 22:07:21Z; no fresh bot review is claimed.

    Implemented post-cap fixes: #156. Deferred rename durability: #158. Five accepted post-cap follow-ups: #159 (Git membership, ordinary handoff mutation interleaving, exit-2 ambiguity, ready operation token, missing holder pane evidence). They are not claimed fixed. An additional fresh-flag comment was dismissed with independently checked control-flow evidence.

    Completion checkpoint: T013 local validation and T016 current-head per-push validation are complete; task-file checkboxes describe the pre-push snapshot. T017 remains pending the user's existing hold release, full macOS landing gate and squash merge. No ready label applied and no merge performed. Preserve branch/worktree. #97's checkout and authority are untouched by this work.

    The feature worktree is clean and its HEAD equals origin/feat/supervised-context-restart. GitHub's PR base is daed209 and reports CLEAN/MERGEABLE. The main checkout is clean.

  4. chatgpt-codex-connector commented on Oct 4, 2026

    @chatgpt-codex-connector

    You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions