Skip to content

verify.sh run: check harness logins before any install or GitHub write #146

Closed

Description

@ericlitman

Problem

verify.sh run does not check that the harness logins work before it starts. On #145 the first live-gate run on cbf6520 reached the first headless claude -p session, which failed with "OAuth session expired and could not be refreshed". The verifier then published a failed evidence comment (#145 (comment)) and set live-gate=failure on the candidate, although no feature had run. verify.sh doctor had passed minutes before, because it checks only binary versions and CLI flags (scripts/doctor.ts), and run does not call the doctor at all.

At that time, claude auth status in the same environment reported "loggedIn": false, so a preflight would have caught it. The cause was a stale Keychain login. Eric's SSH login had gone to ~/.claude/.credentials.json, and the desktop-launched CLI reads the Keychain item first.

Acceptance criteria

  • Before any candidate install, harness session, or GitHub write, verify.sh run checks the login of each harness that has a named feature, --self-test included. Claude uses claude auth status and requires "loggedIn": true. Codex uses codex login status, with the run's own CODEX_HOME after the auth.json symlink is in place.
  • The check runs with the same environment the candidate sessions get: real HOME, USER, and LOGNAME, and normal operator config.
  • A failed check exits nonzero with a message that names the harness and the fix (for example, "run claude auth login from a shell on this Mac, not over SSH"). It publishes no comment and no status.
  • verify.sh doctor reports the same login checks in doctor.json. Candidate-mode doctor stays as it is.
  • The checks read only the login state the CLIs report. They do not read, parse, or copy credential files or Keychain items, as AGENTS.md requires.
  • A unit test proves a logged-out Claude stops run before any GitHub call. The live gate for the PR runs project-skill in both harnesses (--self-test), because this changes the verifier.

Source

Found during the #145 live gate (Cursor pstack 0.15.17 sync, Open Pstack 1.6.0). The review record is at ~/projects/docs/projects/open-pstack/records/2026-10-11-pr-144/review.md.

Activity

  1. ericlitman commented on Oct 11, 2026

    @ericlitman
    OwnerAuthor

    Design pass (advisor: Astra, gpt-6-astra high, read-only)

    Verdict: proceed with changes. The plan is below. Accepted and rejected points are listed with their basis.

    Plan

    • verify() calls a new Driver.preflight(receipt) after final feature selection and before the try whose catch publishes failure evidence. It runs only when requiredHarnesses(receipt) is non-empty, so --self-test and the implicit project-skill pair are covered.
    • MacDriver.preflight runs the parent doctor for those harnesses. The doctor call moves out of prepare, so a missing binary also stops the run before any publication.
    • In parent mode, the doctor adds one login check per harness, using the probe home it already creates:
      • Claude: claude auth status, with "loggedIn": true in its JSON required.
      • Codex: codex login status with CODEX_HOME set to the probe home's .codex, after linkCodexAuth. Exit 0 is required. removeCodexHome runs afterwards in all cases.
      • Each result goes into doctor.json. Candidate mode is unchanged.
    • A failed check throws an error that names the harness and the fix. cli.ts prints that message to stderr. No comment and no status are published.

    Accepted from the review

    • The criterion "before any GitHub call" becomes "before any GitHub write". verify() must read the PR and its files to know which harnesses to check. The unit test asserts no comment, no status and no install.
    • The remediation message must reach stderr. Today cli.ts prints only "inspect retained failure.json".
    • A failed or malformed status command is reported as "login check failed". Only a parsed "loggedIn": false establishes a logout.
    • One shared check serves both doctor and run.

    Rejected

    • Checking logins in the actual session homes and reusing them in prepare. Basis: the laziness rule, and nothing fails without it. Claude has no run-owned home, so both environments come from the same isolatedEnv. Codex reads the same symlinked auth.json in either home. The doctor's existing probe home needs no new state handling.
  2. added a commit that references this issue on Oct 11, 2026
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