Skip to content

Follow-up: batch-status owner route validates a stale heartbeat and coalescing tracks the wrong prior fingerprint #791

Description

@justin808

Context

PR #680 (Make cross-runner blocker owner routes navigable, merged 2026-09-07 10:07 UTC) added owner-route validation to skills/batch-status/bin/batch-status and a coalescing contract for blocker messages in docs/user-facing-coordination.md, workflows/pr-processing.md, and skills/pr-batch/bin/user-facing-coordination-contract-test.rb. Two review findings posted after the final refresh were triaged as advisory for the merge and are tracked here.

Problems

  1. Route validation can pick a stale heartbeat. In skills/batch-status/bin/batch-status (around line 475 and 505 at merge time), heartbeats.find selects the first same-agent heartbeat and validates the owner route against it. Coordination heartbeats are append-only telemetry (see skills/post-merge-audit/bin/completed-batch-publication-preflight around lines 818-820), so an earlier stale or previous-instance heartbeat can mark the new route inconsistent and clear a valid owner link while a later live heartbeat matches the active claim. Source: Codex P2 thread on Make cross-runner blocker owner routes navigable #680 at skills/batch-status/bin/batch-status:505.
  2. Coalescing tracks the prior observation, not the prior emitted message. The documented rule (doc line 174, workflow line 1276 at merge time) says to emit only when the fingerprint differs from the prior emitted message. The replay formula in user-facing-coordination-contract-test.rb around line 344 reassigns previous_fingerprint on every observation, emitted or not. Sequence: fingerprint A emits, a non-actionable observation moves the fingerprint to B without emitting, an actionable observation returns to A, and A is emitted again as a duplicate. The fixture owner-route-pr383-replay.json only exercises the monotonic A, A, B case. Source: claude thread on Make cross-runner blocker owner routes navigable #680 at skills/pr-batch/bin/user-facing-coordination-contract-test.rb:344.

Proposed fix

  • Select the latest heartbeat for the target and current claim instance before route validation, or fail closed when that identity is ambiguous. Add a batch-status test with two same-agent heartbeats where only the later one matches the active claim.
  • Track previous_emitted_fingerprint, updated only when a message is actually emitted, in both the contract-test replay formula and any implementation that mirrors it. Extend the replay fixture with an A, B (non-actionable), A sequence and assert a single emission of A.

Verification

  • LC_ALL=en_US.UTF-8 ruby skills/batch-status/bin/batch-status-test.rb
  • LC_ALL=en_US.UTF-8 ruby skills/pr-batch/bin/user-facing-coordination-contract-test.rb

Filed from the integration pass tracked on #742.

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

    P2Useful follow-up: schedule after higher-impact workcomplexity:neutralBounded repair, tests, docs or evidence with little net structural change. Not merge approval.triage:needs-scopeNarrow or reconcile the implementation/design before proceeding; see the triage assessment.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions