Skip to content

[ops]: stamp unattended runtime epoch across live receipts and enforce epoch alignment #2014

@svelderrainruiz

Description

@svelderrainruiz

Summary

#2012 stamped a current unattended runtime epoch at manager startup and quarantined stale active receipts before daemon reuse.

The remaining ownership gap is inside the live active surfaces themselves: heartbeat, daemon report, delivery state, runtime state, and task packet are still mostly trusted by timestamp freshness. That means a wrong-epoch receipt can still look fresh enough until later rescue logic suppresses it.

This child should propagate runtimeEpochId through the live unattended receipt surfaces and make readers require epoch alignment explicitly.

Why this rail exists

After #2012:

  • startup ownership is explicit
  • stale active runtime receipts are quarantined on manager start
  • status can show the current epoch and startup quarantine activity

But the runtime control plane still needs a stronger invariant:

  • active unattended receipts must prove they belong to the current manager epoch
  • readers must reject mismatched-epoch receipts even when timestamps are fresh

That closes the ownership loop from manager startup through the live daemon/observer surfaces.

Acceptance Criteria

  • The current runtimeEpochId is propagated into unattended heartbeat/report/state surfaces that participate in active runtime reads.
  • Delivery/status/runtime readers require epoch alignment when a current epoch is present.
  • A wrong-epoch but timestamp-fresh receipt is rejected fail-closed.
  • Handoff/status diagnostics expose epoch-alignment reasons distinctly from generic stale-timestamp reasons.
  • Tests cover cross-epoch mismatch fixtures on the active runtime path.

Likely seams

  • tools/priority/lib/delivery-agent-manager.ts
  • tools/priority/lib/delivery-agent-common.ts
  • tools/priority/runtime-daemon.mjs
  • tools/priority/runtime-supervisor.mjs
  • tools/priority/__tests__/delivery-agent-common.test.mjs
  • tools/priority/__tests__/delivery-agent-manager-contract.test.mjs
  • tools/priority/__tests__/runtime-daemon.test.mjs

Program linkage

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciCI/CD, workflows, and pipeline changesgovernancePolicy, approvals, and operating model

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions