Skip to content

feat(lattice): add fragment adapter registry - #4328

Open
mgazza wants to merge 1 commit into
feat/lattice-compiled-publicationfrom
feat/lattice-fragment-adapter-registry
Open

feat(lattice): add fragment adapter registry#4328
mgazza wants to merge 1 commit into
feat/lattice-compiled-publicationfrom
feat/lattice-fragment-adapter-registry

Conversation

@mgazza

@mgazza mgazza commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a brand-neutral registry for local and cloud integrations that publish Lattice fragments
  • discover publishers through the structural lattice_fragment_adapter() contract
  • persist immutable provider snapshots with generation and semantic-fingerprint fencing
  • let every registered integration invalidate the aggregate compiler when its observed state changes
  • coalesce invalidation bursts into fresh-read compilation with one bounded follow-up when state changes during a compile
  • keep registry membership frozen once compilation starts and reject runtime unregister attempts
  • keep discovery and all production wiring default-off

Safety properties

  • invalidation never mutates compiled configuration directly; it only requests a fresh read of every registered fragment
  • OFFLINE, DEGRADED, removal, restart, feedback, CAS-conflict, and mid-compile invalidations all preserve fail-closed state
  • same-generation semantic mutation is rejected
  • adapter state and the compiler's observed cursor remain generation/fingerprint bound
  • failed adapter CAS leaves the compiler invalidated, so it cannot publish from an uncommitted snapshot
  • no configuration materializer, MQTT subscription, Home Assistant callback, or control write is wired

Verification

  • python3.9 -m unittest apps/predbat/tests/test_lattice_fragment_adapters.py apps/predbat/tests/test_lattice_autoconfig.py apps/predbat/tests/test_lattice_compiled_publication.py — 89 passed
  • Black, Ruff, cspell, and pre-commit checks passed
  • GitNexus staged change detection: LOW, exactly two files, zero affected execution flows

Stacked on #4326. Tracks Predictive-Cloud-Ltd/predbat-saas-infra#561 and #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