Skip to content

Seed last_finished post-provenance and keep restart contract events valid - #382

Merged
lbacik merged 1 commit into
mainfrom
fix/producer-suite-restart
Nov 10, 2026
Merged

lbacik merged 1 commit into
mainfrom
fix/producer-suite-restart

Conversation

@lbacik

@lbacik lbacik commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Fixes #381. Three failures in the producer job on main came out after #380.

Changes

  • last_finished survives a restart (lifecycle.py). attach_post_provenance now seeds the reporter it receives. Before, the seed ran in the constructor when telemetry was still None, so it did nothing. This also hit production.
  • No claim_opened without attempt_id (contract_events.py). next_issue_claimed fires before the checkpoint exists. An attempt-scoped event (claim_opened, phase_changed, outcome_recorded, attempt_finished, attempt_released, sealed) with no Attempt ID now stays native.<name>. The Claim still opens once, at issue_claimed.
  • stop_plan.remaining = requested N (contract_status.py). This matches the suite and the reference stub-producer. Only counted advances. The store's internal counter is unchanged.

Tests

  • Each fix has a new unit test that fails without it.
  • ruff: clean.
  • Locally on macOS, the full pytest run has 10 failures in test_attempt_processes.py and test_control_offline.py. The same 10 fail on a clean main on this machine, and they pass on CI (Linux).
  • The local Docker run of the producer_suite was still going when this PR was opened, so the producer job on this PR is the check for that part.

🤖 Generated with Claude Code

…alid

The producer suite still failed on main after #380:

- Telemetry is attached after provenance, so the constructor's disk seed
  of last_finished found no reporter and did nothing. last_finished read
  null after every restart, in production too. attach_post_provenance
  now seeds the reporter it receives.
- next_issue_claimed fires at the priority boundary, before the
  checkpoint names an Attempt, so it projected a claim_opened with no
  attempt_id. That broke the schema for every later snapshot. An
  attempt-scoped event with no Attempt ID now stays native.<name>.
- stop_plan.remaining is the plan's requested N, as the suite and the
  reference stub-producer read it; only counted advances.

Fixes #381

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Producer suite fails on main after restart: last_finished, prioritized claim_opened, stop_plan.remaining

1 participant