Skip to content

fix(polymarket): complete legacy rollback before full-cycle health #519

Description

@proerror77

Parent

#499

Defect

The governed rollback restores the legacy Python collector, then waits up to
180 seconds for a new full-cycle health.json before restoring the saved upload
timer state. Production Python publishes health only after an approximately
35-minute catalog/trade cycle. The collector is already active with the exact
saved unit and a stable PID/InvocationID/NRestarts, but rollback exits early,
leaves both timers inactive, and leaves immutable evidence at
PASSED.rollback-pending.sha256.

Focused production proof: post-cutover smoke invocation
t-jpn6sictxlowsg0 restored Python PID 745169, InvocationID
973ec6842b8e4939a5641afae17ef5a0, NRestarts 0, while health was correctly
not yet published; the rollback then failed before restoring timers.

Change contract

For a legacy Python rollback, verify the exact restored collector runtime and
canonical saved unit identity, restore the saved collector/timer state, and
finalize rollback without requiring a new full-cycle health publication. Keep
the existing advanced-health requirement for a Rust-to-Rust rollback.

Acceptance criteria

  • Legacy rollback does not wait for health.json before restoring the
    checksum-protected saved timer state.
  • Legacy rollback still requires the exact Python ExecStart, stable
    PID/InvocationID/NRestarts, canonical FragmentPath, and empty DropInPaths.
  • Saved enabled/active collector and timer state is restored before rollback
    returns success.
  • Rust-to-Rust rollback still requires a new clean Rust health publication.
  • A focused counterexample proves missing legacy health does not strand the
    timers, while a changed legacy PID/unit still fails closed.

Runtime control

  • Target: ECS i-6we6afeqsvv8uo1ixmyo Polymarket raw-ops rollback.
  • Candidate: PR fix(polymarket): complete legacy rollback before health #520 head
    cf2102890de62195d3cd10272405d7c41c88095c, based on exact main
    3896eed3a504bfd0e1e424af20a5681a1162ec3a.
  • Controller: /root only.
  • Rollback: Revert the focused control-plane commit; production recovery uses
    the existing checksum-protected rollback snapshot.
  • Stop rule: Any snapshot checksum, canonical unit, PID/InvocationID,
    NRestarts, saved timer-state, or immutable marker mismatch fails closed.

Out of scope

Gate duration, collector/uploader data semantics, Python cycle performance,
quote-collector RuntimeMaxSec, research, snapshot/#235, evaluator/MCTS, and CI
restructuring.

Development workflow

This is a small, fully specified safety-boundary defect with a focused failing
production proof, so a PRD is unnecessary. Implement test-first, then run the
focused control-plane tests, ShellCheck, and code review.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingready-for-agentFully specified and safe for an autonomous agentruntimeRequires deployment, runtime mutation, or live evidence for closure

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions