Skip to content

F: stamp a publish outcome with the state version the publish last saw #114

Closed

Description

@mchwang

Why

From the #103 review (PR #110); low confidence. Store.recordPublish stamps the publish outcome with the task's state version as of the moment it records it. It does not use the version the publish last checked under a guard. TaskPublishing.owed() treats a settled outcome at the current version as "nothing owed".

So suppose a change by someone else lands between the publisher's last guarded write and recordPublish, and leaves the task publishable. That later state would count as settled, and no publish would be owed for it.

In today's code no such interleaving was found:

  • recordPublish runs right after the publisher returns, with no I/O in between.
  • Cancel leads to cancelled, which is not publishable.

Needed

  • Either have PullRequestPublisher.publish return the state version it last saw and record that, or show that no write can land in that gap and document why.

Tests

  • If a gap is found: a write in it leaves the publish owed, and the next trigger publishes.

🤖 Generated with Claude Code

Activity

  1. mchwang commented on Oct 4, 2026

    @mchwang
    ContributorAuthor

    Resolved by a fix, not just documentation. Implemented in PR #123, which is stacked on #110.

    The suspected gap is real. In two places the publisher makes a GitHub call after its last Store write:

    • a draft change that fails and leaves the PR ready (leftReady);
    • a draft change refused because drafts are unsupported.

    The outcome was stamped with the version current at recording time. So a change someone else made during that call counted as seen, and a publish that change made owed could be suppressed.

    The fix:

    • Every publish outcome now carries a required seenVersion, read where its path returns.
    • On the two paths above, it is read from before the GitHub call.
    • Store.recordPublish stamps it.
    • Because the field is required, the type checker makes every return path, including future ones, decide it.

    This issue closes when PR #123 reaches main.

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