Skip to content

feat(lattice): gate live schedule writers - #4333

Open
mgazza wants to merge 2 commits into
feat/lattice-schedule-authorityfrom
feat/lattice-schedule-integration
Open

feat(lattice): gate live schedule writers#4333
mgazza wants to merge 2 commits into
feat/lattice-schedule-authorityfrom
feat/lattice-schedule-integration

Conversation

@mgazza

@mgazza mgazza commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add the default-off BatPred runtime seam for compiling and dispatching complete Lattice schedules
  • persist an arming marker and reload durable authority before every writer decision
  • fence Execute.execute_plan, inverter balancing, Gateway plan publication/republish, and Gateway command publication behind one shared writer-exclusion barrier
  • make activation transitions exclusive and drain already admitted legacy writers before Lattice dispatch
  • keep replacement and cancellation ownership decisions restart-safe and fail closed on missing, corrupt, or unknowable durable state
  • support OFF, SHADOW, and ACTIVE modes while preserving the never-armed legacy path

Safety

Both activation gates remain false by default. OFF and SHADOW do not send a Lattice schedule.

Once a scope has been armed, missing authority, invalid clock/storage, UNKNOWN receipts, or incomplete runtime bindings keep every legacy writer closed. The durable marker is loaded before the clock or mode decision, and an absent marker is never cached.

Activation remains blocked until the Gateway can durably fence or retire any already retained legacy plan. This PR does not enable production writes and does not claim that prerequisite is complete.

Validation

  • 75 focused tests pass, plus 45 subtests, on Python 3.14
  • execute, balancing, and Gateway adjacent suites pass in the implementation review
  • the legacy execute suite independently passed before the local balance runner encountered its existing configured REST retry path
  • Black, Ruff, cspell, pre-commit, and diff checks pass
  • GitNexus: CRITICAL expected live scope, 106 changed symbols across 21 execution flows; all direct writer seams were reviewed and gated

Stack

  • base: feat(lattice): add durable schedule authority core #4323
  • Gateway schedule transport: Predictive-Cloud-Ltd/predbat-gateway#237
  • Gateway cancellation/retirement prerequisite: pending next stacked Gateway PR
  • tracking: Predictive-Cloud-Ltd/predbat-saas-infra#557
  • programme: Predictive-Cloud-Ltd/predbat-saas-infra#466

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.

1 participant