Skip to content

fix(join): tell an account named null from none, stop the check without ps, and copy without cmp - #3995

Merged
devswha merged 4 commits into
mainfrom
fix/join-followups
Nov 16, 2026
Merged

devswha merged 4 commits into
mainfrom
fix/join-followups

Conversation

@devswha

@devswha devswha commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Change

Refs #3983 (items 5, 6, 7 and 8; items 1 to 4 stay open there).

Four small follow-ups to the trial join (#3973), and one found on a minimal AlmaLinux 10, all in scripts/join/:

  • Item 6: an account whose id is the text null was read as no account. The account read now gives no account and
    an account with an id in two forms that cannot meet (null, and the id after a =), so such a machine is named
    as in that account: the ending (exit 38 when it was in it before) and the undo both say so. An account answer
    with an empty id is still no answer, as before.
  • Item 7: whether the check of the kit's server still runs is read from /proc/<pid>/stat (its state and its
    parent) instead of ps, as running, ended or unknown. A process with that pid that /proc does not show as the
    join's child (its entry unreadable, or /proc of another PID namespace) is unknown, never ended. The join waits on
    the check only once it is seen ended, so no wait in the stop is unbounded; a check still running or unknown after
    the stop's 2 s is named with its pid and the join refuses (exit 14), with ps or without it.
  • Item 8: the refusal for a check that did not end names what it was sent: "after TERM", or "after TERM and KILL"
    (a KILL skipped because the process stopped being the kit's server after TERM is not claimed), or that it was not
    signalled because the join could not tell that it is still the kit's server. It is said in English and Korean, and
    it gives no command that signals the pid: it says how to look at the process first (ps -o pid,user,args -p <pid>,
    or ls -l /proc/<pid>/exe, which shows its program, "(deleted)" once its temporary folder is gone) and to stop it
    only if it is the kit's ovis-server serve. An interruption that cannot stop the check says the same. The ending
    names the account as the one the machine is in now, instead of "the one the add above names".
  • cmp: the official almalinux:10 image has no diffutils, and the join used cmp once, to check the programs
    it copied into the trial folder, so it stopped there after the yes (exit 14). It now hashes each copy from the copy
    itself (stdin) with sha256sum, which it already requires and checks for before the question, and compares it
    with the sum the kit's SHA256SUMS lists for that file, which is never empty. A sha256sum that fails there gives
    nothing, which matches no sum, so the copy is refused (exit 14) and rolled back; and the copy's path does not
    change the hash, so a HOME holding a backslash reaches the settings refusal the README names (exit 2). Dropping the
    need is smaller than refusing such machines: no new requirement, and nothing else in the join uses cmp.
  • Item 5: no change to the join. The container suite gains a case in which every account read before the add gets
    a body that passes the whole-object check, then stalls until curl times out: once {"account":null} whole, once
    a body cut at a nested closing brace. Only the download's exit status makes them no answer, so a run again is
    kept (exit 39), never removed.

The container suite also gains:

  • the account named null (exit 38 naming it; the undo says the machine was in it);
  • the check on a machine without ps (exit 14, the pid named, no command that signals it, nothing sent, no hang);
  • the join in a PID namespace without a /proc of its own, where the check's /proc entry cannot be read while it
    lives (exit 14 naming the pid, no hang);
  • a machine without cmp (the join installs and starts its server, exit 30 without a terminal for the add, and the
    undo gives everything back);
  • a sha256sum that fails once the programs are copied (exit 14, rolled back, nothing left).

The README says each of these.

Validation

  • bun test scripts/join/kit.test.ts and the three conventions.test.ts files: 65 pass, 0 fail.
  • sh -n, dash -n and bash -n on join.sh: clean. bun run typecheck: pass.
  • The changed helpers on their own, in dash and bash, against main's join.sh and this one: main reads
    {"account":"null"} as no account and, with ps gone, a live child of the shell as ended; this one reads an
    account null and a running child (a program name holding ) included). With stand-ins for the process checks
    (nothing signalled), a check that stops being the kit's server after TERM is said "after TERM", and one that
    stays it "after TERM and KILL". With a live child's /proc entry unreadable, the stop returns after its 2 s with
    the check unknown, and nothing is waited for.
  • The join container suite (OVIS_JOIN_CONTAINER_QA=1 bun test scripts/join/join.contract.test.ts), once, at this
    head, on Ubuntu 24.04 containers on an internal network with a real herdr 0.9.5: 48 pass, 0 fail (602 s).
  • bun run check fast: pass (unit: 17890 pass, 0 fail, 54 skip).
  • A HOME holding a backslash is checked by reading, not run: the copy check no longer depends on the path, and the
    next step refuses such a value (exit 2) and rolls back.
  • Not run: the new cases against main's join.sh in containers, and the join on an almalinux:10 machine itself
    (the no-cmp case stands in for it).

…ut ps, and say what was signalled

Four follow-ups to #3973, in scripts/join only:

- An account whose id is the text `null` was read as no account. The account read now keeps the two apart, so such
  a machine is named as in that account (and by the undo), never taken for one in no account.
- Whether the check of the kit's server still runs is read from /proc/<pid>/stat instead of ps. On a machine without
  ps a live process that is no longer that server made the stop wait for ever; it is now named and the join refuses
  (exit 14), as with ps.
- The refusal for a check that did not end says "after TERM and KILL" only when they were sent; otherwise it says the
  process was not signalled because it is no longer the kit's server.
- The ending names the account as the one the machine is in now, instead of "the one the add above names".

The container suite gains a case for a whole answer, and one cut at a nested closing brace, each followed by a stall:
only the download's exit status makes them no answer (a run again is kept, exit 39). It also gains the account named
null and the check on a machine without ps.
…nals the check was sent

- The programs copied into the trial folder are now checked against the kit's copies by SHA-256 (sha256sum is
  already required) instead of cmp. A machine without diffutils, such as a minimal AlmaLinux 10, no longer stops
  after the yes with exit 14.
- The refusal for a check of the kit's server that did not end names what it was sent: TERM, or TERM and KILL. A
  KILL that was skipped because the process stopped being the kit's server after TERM is no longer claimed.

The container suite gains a machine without cmp: the join installs and starts its server, and the undo gives
everything back.
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes

    • Account IDs equal to null are now distinguished from unavailable account information.
    • Account, health, and pairing status are recognized only when a complete, valid response is received; incomplete responses no longer count as successful checks.
    • Server shutdown checks now have time limits and report when a process does not stop. Joins refuse servers that do not respond.
    • Install verification and probe cleanup work in environments where common system utilities are unavailable.
  • Documentation

    • Clarified how account status is determined and displayed, and how server checks and shutdown failures are handled.

The join script now distinguishes a literal null account ID from no account, checks probe processes through /proc, reports probe shutdown attempts, and verifies installed files with SHA-256 hashes. Contract tests cover account-status timeouts, probe cleanup, and operation without ps or cmp.

Changes: Join behavior updates

Layer / File(s) Summary
Account status interpretation
scripts/join/join.sh, scripts/join/join.contract.test.ts, scripts/join/README.md
The script distinguishes the account ID null from no account and updates account messages. Tests cover stalled status responses and the literal null account ID. The README describes successful status reads and account reporting.
Probe detection and shutdown
scripts/join/join.sh, scripts/join/join.contract.test.ts, scripts/join/README.md
The script reads probe state from /proc/<pid>/stat and reports whether it sent TERM or TERM and KILL. Tests cover a missing ps command and a probe that removes its executable. The README documents bounded shutdown checks and their outcomes.
Installed-file verification
scripts/join/join.sh, scripts/join/join.contract.test.ts
The script uses SHA-256 hashes instead of cmp to verify installed files. A contract test covers installation and undo when cmp is unavailable.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related issues

  • devswha/ovis#3983 — This issue includes a sha256sum path-handling concern in the same verification code path. The PR changes that path but does not establish that unusual path handling is fixed.

Possibly related PRs

  • devswha/ovis#3973 — This PR adds the trial join flow and the join code that this PR updates.
Merge Risk: Minimal · up to 04bcf

The join script now handles an account named "null", checks processes without needing ps, and verifies copied files without cmp. No merge-blocking problem was identified in the supplied changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main changes: an account named null is distinguished from none, the process check no longer uses ps, and the copy step no longer uses cmp. The title is specific and matches the cha…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template: it has a Change section that explains the problem and resulting behavior, and a Validation section that lists the checks run and the checks skipped. It…
Full details: Title check

Explanation

The title names the main changes: an account named null is distinguished from none, the process check no longer uses ps, and the copy step no longer uses cmp. The title is specific and matches the changeset, which touches scripts/join/ and covers all three items. It is long at 96 characters, but it is not vague.

Full details: Description check

Explanation

The description follows the repository template: it has a Change section that explains the problem and resulting behavior, and a Validation section that lists the checks run and the checks skipped. It also links the tracking issue (#3983) and describes the join, probe, and copy-verification changes in detail. The author states that tests against main's join.sh and a real almalinux:10 machine were not run, which the template asks for. The description is mostly complete. The one template gap is that the Change section asks for a feature to link an issue where a maintainer agreed to it, but this PR is a bug-fix follow-up and it does reference the issue #3983. The validation lists specific commands and results, including the container suite, which covers the HTTP/WS contract-test note in the template.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b0b5f3c and 04bcfa0.

Files selected for processing: 3

  • scripts/join/README.md
  • scripts/join/join.contract.test.ts
  • scripts/join/join.sh

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

…one seen ended, and match each copy to its listed sum

- A check of the kit's server that did not end, or could not be told, is named with its pid and with what it was
  sent, in English and Korean, and the join stops (exit 14). It gives no command that signals that pid: it says how
  to look at the process first (ps -o pid,user,args -p <pid>, or ls -l /proc/<pid>/exe) and to stop it only if it
  is the kit's ovis-server serve. An interruption that cannot stop it says the same.
- Whether the check still runs is read as running, ended or unknown. A process with that pid that /proc does not
  show as the join's child (its entry unreadable, or /proc of another PID namespace) is unknown, not ended: it is
  refused with its pid (exit 14). The join waits on the check only once it is seen ended, so no wait in the stop is
  unbounded.
- Each program copied into the trial folder is hashed from the copy itself (stdin) and compared with the sum the
  kit's SHA256SUMS lists for it, which is never empty: a sha256sum that fails matches nothing and is refused, and
  the copy's path no longer changes the hash, so a HOME holding a backslash reaches the settings refusal (exit 2).

The container suite gains a join in a PID namespace without its own /proc (exit 14 naming the pid, no hang) and a
sha256sum that fails at the copy (exit 14, rolled back); the no-ps case checks that the refusal names the pid and
gives no kill command.
… refusals, and check the stand-in before the test ends it

- The undo's refusal for a trial server that did not end now says how to look at the process first and to stop it
  only if its program is the trial's bin/ovis-server, with a Korean line first, as the check's refusal does.
- The refusal after an interruption that could not stop the check says what it was sent (TERM, TERM and KILL, or
  nothing), in Korean and English, as the check's refusal does.
- The no-ps contract case ends the stand-in it leaves running only while its program still reads as the stand-in's
  own deleted one.
@devswha
devswha merged commit 73341eb into main Nov 16, 2026
16 of 17 checks passed
@devswha
devswha deleted the fix/join-followups branch November 16, 2026 21:53
@devswha

devswha commented Nov 16, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head f43db30b4e3c as 73341ebf6efe on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
claude CLEAR
codex CLEAR

devswha added a commit that referenced this pull request Nov 28, 2026
…l when a run again fails (#4973)

Refs #3983 (items 2/18, 12, 14, 23/24; the rest is fixed by #3995 or
low/contrived, see the issue comment).

- **2 / 18:** `j_sha256` in `join.sh` and the pasted line from `kit.ts`
hash the kit's files from stdin instead of passing paths to `sha256sum`,
so a temporary folder whose name holds a backslash no longer fails the
check (it refused with exit 16).
- **12:** on a run again, the four failures after the earlier install
was stopped (the copy of the kit's programs among them) now say that the
install stays, stopped, and how to undo; the unused `j_rollback` is
gone.
- **23 / 24:** the undo's "look first" line gives one `ls -l
/proc/<pid>/exe` per pid (it printed `ls -l /proc/1 2/exe`) and names
the `(deleted)` form.
- **14:** the README's sentence on cut-off answers now matches what
`j_whole` checks.

**Tests:** `scripts/join/join.local.test.ts` (new, 3 cases, outside
containers: a scratch HOME, a compiled stand-in herdr, failing
systemctl/loginctl stubs) and a new case in `scripts/join/kit.test.ts`.
On main they fail with exit 16 / the old copy refusal / `ls -l
/proc/221419 221425/exe`; with the fix, 20 pass / 0 fail (15 s on
old-desktop). `sh -n` under sh, dash, bash and busybox;
`scripts/conventions.test.ts`; typecheck.

Changelog fragment included.
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