feat(core): observer harness — shared bind/concurrent/tri-state read path (#1201) - #1215
Merged
Conversation
…path (#1201) Native observers all run the same flow: bind on the applier's transport, read declared entities concurrently, map each read onto the #1089 tri-state. k8s (#1074) and Fly (#767) already embody it; the shell-out observers drifted apart re-deriving it. observeEntities() owns the shape — bind-or-not-observe-all with a typed reason, bounded concurrency (boundedConcurrently when a transport ships no pool), per-entity tri-state routing, and a per-entity throw degrading to read-failed rather than a silent absence that would classify as a spurious create. A lexicon supplies an ObserverAdapter (transport + per-entity read); endpoint/emulator override lives in the adapter's bind(), so it behaves identically across lexicons by construction. Additive on @intentius/chant/observation — no contract change, no export-map change. Conformance tests cover tri-state routing, typed bind failure, loud rethrow, per-entity read-failed, adapter-pool use, and boundedConcurrently limit/coverage. Foundation for the per-cloud observers (#1206/#1209/#1212).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1201 (CC foundation, epic #1197).
What
Adds
observeEntities()+ObserverAdapter+boundedConcurrentlyto@intentius/chant/observation— the shared control flow every native observer runs: bind on the applier's transport, read declared entities concurrently, map each read onto the #1089 tri-state (present / absent / not-observed).Why
k8s (#1074) and Fly (#767) already embody this flow; the shell-out observers (aws/gcp/azure) each re-derive it inconsistently, which is how they drifted. The harness owns:
read()throw degrading toread-failedrather than a silent absence that would classify as a spuriouscreate.A lexicon supplies only an adapter (transport + per-entity read). Endpoint/emulator override lives in the adapter's
bind(), so it behaves identically across lexicons by construction.Scope / risk
Additive — no change to the observation contract or the package export map, so no ripple to lexicon serializers. Existing observers are untouched; per-lexicon adoption is the lane O work (#1206/#1209/#1212).
Tests
6 new conformance tests (tri-state routing, typed bind failure, loud rethrow, per-entity read-failed, adapter-pool use, boundedConcurrently limit+coverage).
observation.test.ts18/18 green; coretsc --noEmitclean.