Skip to content

fix(platforms): PlatformProvider has no error contract — postPRComment is still unchecked and the ready gate's report-post catch is empty (#1312 follow-up) #1315

Closed

Description

@admarble

Tier: mechanical Found: 2026-10-04, upstream research on #1312

Problem. PlatformProvider (src/lib/workflow/platforms/platform-provider.ts) does not say how a method reports failure. GitHubProvider uses three conventions at once:

  • Sync helpers return null, [] or false.
  • fetchIssue, getPRStatus and createPR throw.
  • postComment, addLabel, removeLabel and postPRComment call spawnSync and ignore its result, so they never fail.

The write methods came from #368 (PR #379, 2026-03-22) with no callers. Five months later #937 and #964 called postComment inside try/catch as "best-effort, caught and logged". That contract was never true, because the method cannot throw. #1312 fixes postComment, addLabel and removeLabel. This issue covers the rest of the class.

Not in #1312:

  1. postPRComment (github.ts:995) has the same unchecked spawnSync. It has no callers yet, so the next caller inherits a silent failure.
  2. The ready gate's postReport catch (ready-gate.ts:726) is empty. When postComment throws after bug(run): GitHubProvider.postComment ignores gh's exit status, so a failed QA verdict post is silent #1312, the sequant ready / --ready-gate gap report is still lost with no log line.
  3. The interface has no documented error contract, so a second provider (or a new method) can reintroduce the shape.

AC

  • AC-1: PlatformProvider's doc comment states that every async method rejects on failure (non-zero exit, timeout, spawn error) and never resolves on failure. Evidence: the interface doc comment in the diff.
  • AC-2: postPRComment rejects when gh exits non-zero, times out or fails to spawn, and the error carries gh's stderr. Evidence: a unit test with a stubbed spawnSync returning status: 1, mutation-verified by removing the status check.
  • AC-3: When postReport rejects, the ready gate logs a warning with the error, not an empty catch. Evidence: a ready-gate unit test with a rejecting postReport asserts the warning.
  • AC-4: No async write method in GitHubProvider calls spawnSync without checking status, error and signal. Evidence: a unit test that stubs a failing spawnSync and asserts every async write method on the provider rejects.

Non-Goals

  • Changing the sync helpers' null/[] convention.
  • Retrying posts.

Graph metadata

Activity

  1. admarble commented on Oct 5, 2026

    @admarble
    ContributorAuthor

    Runner context (before sequant run)

    Phase rules (exec and qa):

  2. admarble commented on Oct 5, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 4/4 met

    Gaps:

    • The documented PlatformProvider error contract is contradicted by getIssueComments and checkAuth in the reference implementation
    • createPR failure paths (timeout/spawn error) are not covered by the AC-4 failing-spawnSync test
    • The new contract is false for two existing methods. The comment says every async method "never resolves on failure", but:
    • GitHubProvider.getIssueComments (github.ts:1018-1046) resolves [] on non-zero exit, spawn error or bad JSON.
    • checkAuth resolves false on a spawn error.

    Suggestions:

    • Add a createPR failure case (status null with a timeout error) so AC-4's "every async write method" is shown by a test, not only by reading the code.
  3. added 3 commits that reference this issue on Oct 5, 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