Skip to content

contributions: merged PR never reaches a terminal observation state, so 'observation unavailable' wakes recur forever #4669

Description

@slee029

Summary

fm-contributions.sh poll never reaches a terminal observation state for a merged PR. Every poll cycle stamps error: forge observation unavailable or changed during read on a record whose observation payload is actually correct and complete, so the authenticated check surfaces a check: contributions: observation unavailable for <url> wake forever.

Observed 3 times in ~30 minutes for one merged PR, each time waking supervision for a contribution that needs no attention.

The contradiction

The stored record carries the error alongside correct data:

error:       forge observation unavailable or changed during read
checked_at:  2026-09-16T20:02:20Z          # fresh on every wake, seconds old
observation: present
  head  = 6c842af66f572da8be017cb3627c535afcc9f513   # matches the merged head exactly
  state = merged
  checks = [{name: "Lint & Test", status: completed, conclusion: success}, ...]

pending_events is empty and no event token exists, so ack has nothing to consume — there is no supported way to retire the signal.

What was refuted

  • Not budget or slowness. Direct forge reads measured 1.24s (pulls/<n>) and 1.56s (commits/<sha>/check-runs) — well inside the documented 5s per-call cap and the 20s FM_CONTRIBUTIONS_BUDGET.
  • Not staleness/expiry. checked_at is seconds old at each wake, nowhere near the 900s FM_CONTRIBUTIONS_MAX_AGE.
  • Not a failed read. The observation payload is complete and matches the forge exactly.

Probable cause

The help states an observation is "one coherent forge read (a PR head is rechecked after fetching checks/reviews)". For a merged PR that recheck appears to classify the terminal state as changed during read. Because the owning task's backlog row legitimately retains its completion artifact link (links: "pr:<url>"), the URL stays owned and is re-polled indefinitely, failing the same benign way each cycle.

Impact

A merged PR on a closed task generates an unclearable supervision wake on every poll cadence. The only workarounds are both wrong: deleting the completion artifact link (which AGENTS.md §10 requires preserving, and which destroys the record of what shipped), or fabricating an event token to ack.

Suggested fix

Treat a terminal PR state (merged, or closed + merged: true) as a coherent, final observation rather than re-erroring, so the record settles and stops producing wakes.

Activity

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

    ready-for-prTriage: real bug or VISION-aligned feature, open for a PR

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions