Skip to content

test(remote): close the last SSH recovery finding and its coverage gaps (upstream PR 68) - #323

Merged
hyperpolymath merged 1 commit into
fix/66-resumable-ssh-stagesfrom
claude/pr-68-ssh-recovery-coverage
Nov 10, 2026
Merged

hyperpolymath merged 1 commit into
fix/66-resumable-ssh-stagesfrom
claude/pr-68-ssh-recovery-coverage

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Change and reason

JoshuaJewell/MetaManifold-WebUI#68 has two open items at head 5115109:

  • Codecov reports 94.59% patch coverage, with 18 lines missing in remote_session.jl (12), phylogeny.jl (5) and remote_exec.jl (1).
  • One review finding is still open: "Retry attempts that finish without required outputs". A command that exits 0 without a required output wedged the stage. replay cannot fix this, because it cannot make a file appear that the command never wrote.

Production change (src/pipeline/remote_session.jl, one branch):

  • A zero exit that omits a required output is now retired. The attempt is cleaned up and its journal is archived as *.missing-outputs-<uuid>. An explicit rerun then launches a fresh attempt.
  • If the host refuses the cleanup, the journal stays. The remote attempt keeps its owner, and the next run retries the retirement.
  • This is the existing expire-succeeded transition of the Agda protocol model (succeeded 0 n ↦ removed 0 n). No new transition is needed. Please confirm that this reading of the model is the intended one.

Tests (three files):

  • The retirement and the fresh relaunch, and the refused retirement that keeps the journal.
  • A durable cancel request stops the old attempt of the same stage before a new one launches.
  • Receipt recovery replays the remote log before cleanup removes it.
  • The other lines that Codecov listed: the fetch error, a refused sweep, both superseded-journal branches, the owned-transport close, phylogeny's local and remote log branch, and the quoting in verify_remote_sizes.

This work starts from an earlier patch that was never run (notes/0004-pr68-ssh-recovery-coverage.patch in MetaManifold-Evidence). I ran it, and added three things it lacked: the refused-retirement test, the same-stage cancel test, and the log-replay assertion.

This pull request targets the branch of upstream PR 68. A merge here updates that pull request.

Validation

Julia 1.12.5, R 4.3.3, Linux, from the repository root.

  1. Coverage, with the same flags as CI:

    julia --project=. -t 2 --code-coverage=user --compiled-modules=no test/runtests.jl test_remote_stages.jl test_phylogeny.jl

    Result: 426 pass, 0 fail. Every instrumented line that this branch adds since upstream 89be534 is covered: remote_session.jl 295 of 295, phylogeny.jl 7 of 7, remote_exec.jl 1 of 1.

  2. Planted faults. I ran 14 deliberate corruptions of the changed lines, one at a time. The suite caught 12 at once. Two survived: a skipped cancel on a durable cancel request, and a skipped log replay on receipt recovery. I added a test for each, and each test now fails with its fault in place. Result: 14 of 14 caught.

  3. Baseline. At 5115109, three existing "cancel kills the process group" assertions fail in my sandbox, with and without this change. The cause is the sandbox: its PID 1 is slow to reap killed processes, so kill -0 on the group still succeeds for a moment. Inside a private PID namespace (unshare --pid --fork --mount-proc) all tests pass. The upstream CI passed these tests at 5115109.

Not run: test/remote_ssh.jl (needs a real SSH server), the Agda audit (no Agda in my sandbox; the model is unchanged), the full suite, and the frontend tests. No workflow runs on this pull request, because ci.yml on this branch starts only for pull requests into main. The upstream CI and Codecov run after the merge.

Scope

  • One production branch changes behaviour, as described above. Everything else is tests.
  • The three open review threads on PR 68 need a reply and a resolve by someone with write access to the upstream repository. Draft replies are in notes/pr68-ssh-recovery-review.md in MetaManifold-Evidence.
  • These regressions are Linux only (flock, setsid). The suite skips them elsewhere.
  • No lockfile change.

Contribution checks

  • I followed CONTRIBUTING.md.
  • This branch starts at the head of PR 68 (5115109) and contains no merges from fork main.
  • Every commit is signed and shows as Verified. (The managed signing identity decides this.)
  • CI has run and passes. (No workflow runs here. See Validation.)
  • Existing licensing, citation and acknowledgement text is unchanged.

Generated by Claude Code

SPDX-License-Identifier: AGPL-3.0-or-later

Codecov reports 18 uncovered changed lines on PR #68 at 94.59% patch
coverage, and one review finding is still open: a zero exit that omits a
required output wedged the stage.

Production change (src/pipeline/remote_session.jl):

- A zero exit that omits a required output is now retired: the attempt is
  cleaned up and its journal archived as `*.missing-outputs-<uuid>`. An
  explicit rerun then launches a fresh attempt. `replay` cannot do this,
  because it cannot make a file appear that the command never wrote.
- If the host refuses the cleanup, the journal stays, so the remote attempt
  keeps its owner, and the next run retries the retirement.
- This is the existing `expire-succeeded` transition of the Agda protocol
  model (succeeded 0 n to removed 0 n). No new transition is needed.

Tests:

- Retirement and fresh relaunch, and the refused retirement that keeps the
  journal until a later run retires the same attempt.
- A durable cancel request stops the old attempt of the same stage before
  a new one launches.
- Receipt recovery replays the remote log before cleanup removes it, and
  cleans up the retained attempt.
- The fetch's own missing-output error, a refused sweep, both
  superseded-journal branches with a stateful ControlMaster transport that
  records open, request and close events, phylogeny's local and remote log
  branch, and the single-quote escaping in verify_remote_sizes.
- The refusing transport uses `get(ENV, "PATH", "")`, and the
  owned-transport cases require `ProcessFailedException`.

Measured with Julia 1.12.5, `--code-coverage=user --compiled-modules=no`,
`test/runtests.jl test_remote_stages.jl test_phylogeny.jl`: 426 pass, 0
fail. Every instrumented line this branch adds to remote_session.jl (295),
phylogeny.jl (7) and remote_exec.jl (1) is covered. 14 planted faults in
those lines are all caught.

Linux only: these regressions use flock/setsid and are skipped elsewhere.

Co-authored-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0136P7ZoTPXfxg1C85rVNx78
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 442216e9-41bd-4fd0-9091-6b91eb25c4df

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 10, 2026 23:16
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T23:16:58.621835Z
We couldn’t complete this review. Comment @codex review to try again.
de11c7d Draft marked ready
ℹ️ 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

Copy link
Copy Markdown

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

@hyperpolymath
hyperpolymath merged commit 78a6c7b into fix/66-resumable-ssh-stages Nov 10, 2026
3 checks passed
@hyperpolymath
hyperpolymath deleted the claude/pr-68-ssh-recovery-coverage branch November 10, 2026 23:19
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.

3 participants