Skip to content

Fix(test): resume tests stop calling GitHub #1659

Closed

Description

@daniboomerang

Tier: 1
Project: cli
Type: fix

Objectives

O1. No test in processes/vinaya/tests/resume.test.ts spawns gh or reaches the network: every checkpoint-resume path in those tests answers the held-pull-request-conflict question from a stub.
O2. bun test processes/vinaya/tests/resume.test.ts completes with every test passing when GitHub is unreachable (for example with HTTPS_PROXY pointed at an unroutable address), and no single test takes longer than one second.
O3. Every test that passed before still passes, with no test timeout raised.

Documentation

  • processes/vinaya/tests/resume.test.ts — stubRun, which builds the run options and the task input without a stub for the held-pull-request-conflict read (O1, O2)
  • processes/vinaya/tests/run-lifecycle.test.ts — the existing pattern that stubs options.heldPullRequestConflicts (O1)
  • processes/vinaya/bin/run-engine.ts — heldPullRequestConflictsLive, the live fallback that runs gh pr list when the option is not set (O1)

Planner's rationale

Boundary — One thing: the resume tests stop calling GitHub. Pinned files: processes/vinaya/tests/resume.test.ts, processes/vinaya/process.yaml. Out: processes/vinaya/bin/run-engine.ts and the CLI's gh helper (a timeout on it is a separate change); test timeouts; any other test file.

Traps to avoid — Do NOT raise Bun's per-test timeout. Do NOT change the production fallback in run-engine.ts. Stub the read the way run-lifecycle.test.ts already does (options.heldPullRequestConflicts = async () => false), or give the task input a bound findOpenPrForBranch that returns null; keep the existing test cases that assert a conflict by stubbing true explicitly.

Suggested agent-class — low: one test file, one stub.

Stop-and-escalate — Stop if a resume test needs the real forge answer to assert what it asserts.

Docs to keep coherent — no-doc-surface

Premises

  • processes/vinaya/tests/resume.test.ts contains taskInput: { branch: BRANCH } as TaskInput,
  • processes/vinaya/tests/run-lifecycle.test.ts contains second.options.heldPullRequestConflicts = async () => false
  • processes/vinaya/bin/run-engine.ts contains export function heldPullRequestConflictsLive(task: TaskInput | undefined): () => Promise<boolean> {

Surface

in: processes/vinaya, .changeset
out: apps/vinaya-portal, apps/log-server, packages, harness, aeg-root, .github/workflows

atta-labs/process-version-bump: a test-only change that does not alter how the process behaves; if the check still requires it, processes/vinaya/process.yaml gets a patch bump in the same change.

reader-resolvable-prose: test comments describe the stub itself and carry no Issue or pull-request numbers and no tranche slugs.

Parts

Part 1 (O1, O2, O3) — stubRun sets a stubbed held-pull-request-conflict read by default; tests that need a conflict stub it to true.

Test plan

bun test processes/vinaya/tests/resume.test.ts → passes, every test under one second
bun test processes/vinaya/tests/resume.test.ts → passes with GitHub unreachable (HTTPS_PROXY set to an unroutable address), every test under one second
bun test processes/vinaya/tests/run-lifecycle.test.ts → passes
bun apps/cli/src/index.ts check --all → every check passes

Stop conditions

  • A resume test cannot assert its behaviour without the real forge answer.

Origin

Principal-directed, 2026-10-25. Inside the Developer sandbox, bun test processes/vinaya/tests/prepare-run.test.ts processes/vinaya/tests/resume.test.ts took 6m45s and the full processes/vinaya/tests run hit the 10-minute tool limit, against 12s outside the sandbox. The cause: resume.test.ts's stubRun leaves the held-pull-request-conflict read unstubbed, so a checkpoint resume runs the real gh pr list with retries and no timeout; with GitHub unreachable each call waits about 30 seconds. Outside the sandbox the slowest test already takes 4.9s, close to the 5s default timeout.

Activity

  1. daniboomerang commented on Oct 25, 2026

    @daniboomerang
    MemberAuthor

    Brief hash: 24009b1511728533884eb9620befe8e61e2b13c412b5825bde2f34b9a011a760
    For: [model] (coding-agent CLI on a dev machine, dispatched locally, unattended)
    Reason: Suggested agent-class — low: one test file, one stub.
    Owner: the Principal
    Goal: Fix(test): resume tests stop calling GitHub
    Project: ** cli
    Tier: 1

    Closes #1659

    You are the AEG Developer. Run bun apps/cli/src/index.ts doctrine --role developer --print and read its output first. Mandatory.

    Objectives

    O1. No test in processes/vinaya/tests/resume.test.ts spawns gh or reaches the network: every checkpoint-resume path in those tests answers the held-pull-request-conflict question from a stub.
    O2. bun test processes/vinaya/tests/resume.test.ts completes with every test passing when GitHub is unreachable (for example with HTTPS_PROXY pointed at an unroutable address), and no single test takes longer than one second.
    O3. Every test that passed before still passes, with no test timeout raised.

    Documentation

    • processes/vinaya/tests/resume.test.ts — stubRun, which builds the run options and the task input without a stub for the held-pull-request-conflict read (O1, O2)
    • processes/vinaya/tests/run-lifecycle.test.ts — the existing pattern that stubs options.heldPullRequestConflicts (O1)
    • processes/vinaya/bin/run-engine.ts — heldPullRequestConflictsLive, the live fallback that runs gh pr list when the option is not set (O1)

    Premises

    Checked against the code when this task Issue was cut, and again against the default branch at dispatch — facts, not claims.

    • processes/vinaya/tests/resume.test.ts contains taskInput: { branch: BRANCH } as TaskInput,
    • processes/vinaya/tests/run-lifecycle.test.ts contains second.options.heldPullRequestConflicts = async () => false
    • processes/vinaya/bin/run-engine.ts contains export function heldPullRequestConflictsLive(task: TaskInput | undefined): () => Promise<boolean> {

    2. Context — read before doing anything

    • Backlog Issue: Fix(test): resume tests stop calling GitHub #1659, no tranche. Branch task/issue-1659. Depends-on: —, Conflicts-with: —.
    • Read Issue Fix(test): resume tests stop calling GitHub #1659 in full for the complete rationale — do not re-derive it.
    • Revision: rendered at b39fb00e8e327a1a9ba79de16fc84eeeb5154a25 — the checkout's HEAD equaled the remote default branch, and no pinned file below carried an uncommitted change, when these facts were read.
    • Boundary — One thing: the resume tests stop calling GitHub. Pinned files: processes/vinaya/tests/resume.test.ts, processes/vinaya/process.yaml. Out: processes/vinaya/bin/run-engine.ts and the CLI's gh helper (a timeout on it is a separate change); test timeouts; any other test file.
    • Traps to avoid — Do NOT raise Bun's per-test timeout. Do NOT change the production fallback in run-engine.ts. Stub the read the way run-lifecycle.test.ts already does (options.heldPullRequestConflicts = async () => false), or give the task input a bound findOpenPrForBranch that returns null; keep the existing test cases that assert a conflict by stubbing true explicitly.

    3. Technical dependencies

    Dependency rationale — none: this single-fix Issue declares no Depends-on or Conflicts-with edge.

    4. Technical surface map

    Create:

    • (none — every surface file already exists)

    Modify:

    • processes/vinaya
    • .changeset

    Out of surface: apps/vinaya-portal, apps/log-server, packages, harness, aeg-root, .github/workflows — a change there, or to any path no Surface in: glob covers, is still published: the review-loop driver records each such path in the pull request body's beyond-Surface block, and the reviewers judge it like any change.

    Premise pins

    Premise:

    • processes/vinaya/bin/run-engine.ts sha256: 5e918f14b6f473e114dec98da5c94e4c8b8bf6576149b452e947c7bd9a4d773e
    • processes/vinaya/process.yaml sha256: ebbabbc8e5b4943e6e334b02283220ec36c659553b5bb43f901cc6ecb9836b60
    • processes/vinaya/tests/resume.test.ts sha256: 95020485d1aebb086f5258d0b6a139c93661a143d0e78aad43c0bb9a409e1ef3

    5. Pre-flight checks

    Step 0 (mandatory, verbatim):

    bun install --frozen-lockfile --silent
    
    1. Clean status; parent origin/main; branch suffix literal-matches the task id.
    2. Under the review loop (bun apps/cli/src/index.ts task run), the driver has already run the dispatch-readiness gate plus, on this repository toolchain, its own fuller derivation from its own unsandboxed process before dispatching you (re-derived at render time: it was ready), and dispatches you only when that verdict is READY — a NOT READY verdict refuses the turn before it starts, so being dispatched is the verdict: look for no file and run neither script, whose own gh call fails inside your sandbox. Working manually, with no driver behind you, fall back to roles/developer.md's own items 3/5/7 prose — each a complete, hand-run forge check in its own right.

    On any failure: STOP and report.

    6. Numbered parts — publish once with publish_changes when every Part is done, then open_pull_request

    1. Part 1 (O1, O2, O3): stubRun sets a stubbed held-pull-request-conflict read by default; tests that need a conflict stub it to true.

      Files (touches the repo root):

      • processes/vinaya/bin/run-engine.ts
      • processes/vinaya/process.yaml
      • processes/vinaya/tests/resume.test.ts

      The pre-push hook runs the affected suite on your one push and refuses it on failure — do not run it yourself per Part.

    7. Documentation-update list

    .vinaya/doc-owners derivation matched zero bindings against this task's surface — no mechanically-derived doc updates. Confirm no additional doc artifact applies before treating this list as final.

    8. Verification before claiming done

    • Under the review loop, the controller runs the static gates: the commit hook applies safe format and lint fixes to staged files, typechecks affected packages, and runs the Vinaya checks; the pre-push hook runs the affected suite; run_checks and CI provide the authoritative results. Do not hand-run or paste static-gate commands. Working manually, run this repository's declared typecheck, lint/format, build, and documentation-gate commands yourself.
    • The pre-push hook runs the affected suite once, on your one push, and refuses it on failure; CI runs the full suite.
    • Every blast-radius consumer named in §4, re-verified by name.
    • The tier checklist in bun apps/cli/src/index.ts doctrine --role developer --print genuinely satisfied; use the controller's run_checks result, hooks, and CI as gate evidence.

    9. Test Plan

    bun test processes/vinaya/tests/resume.test.ts → passes, every test under one second
    bun test processes/vinaya/tests/resume.test.ts → passes with GitHub unreachable (HTTPS_PROXY set to an unroutable address), every test under one second
    bun test processes/vinaya/tests/run-lifecycle.test.ts → passes
    bun apps/cli/src/index.ts check --all → every check passes
    

    10. Stop conditions

    • A resume test cannot assert its behaviour without the real forge answer.

    Stop-and-escalate — Stop if a resume test needs the real forge answer to assert what it asserts.

    11. Constraints

    Autonomy: Do not stop to ask clarifying questions. For any ambiguity not covered by a Section 10 stop condition, choose the most reasonable option consistent with this brief, record the choice in the PR body at open, or in a PR comment after open, and continue. Halt only for the explicit Section 10 stop conditions — and when you halt, record the blocker in a PR comment or an Issue comment rather than waiting interactively for input.

    12. Deliverable

    • PR title (exact): Fix(test): resume tests stop calling GitHub
    • Open the PR only via the open_pull_request tool (title and body); publish your commits with publish_changes and update the body with update_pull_request_body/refresh_evidence — you hold no gh/git push credential.
    • Publish once, with publish_changes, when every Part is done; then open the pull request with open_pull_request. Publish again only to answer review findings or a red gate — a refused hook, a failing check, a merge conflict.
    • PR body = the Developer's PR report (print it with bun apps/cli/src/index.ts doctrine --template pr-report --print), with Closes #1659 at the top of the header block. This brief stays frozen on the task Issue and never rides in the body.
    • Pre-open: tier checklist satisfied. The documentation gate is the controller's — run_checks and CI run it.
    • Include git diff origin/main...HEAD --stat as context only; Surface is judged by the driver's surface-scope check, never by this hand-run diff. Token use needs no report — the Vinaya log records it.
    • Then STOP. Review and Verification are separate invocations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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