Skip to content

feat(core): observer harness — shared bind/concurrent/tri-state read path (#1201) - #1215

Merged
lex00 merged 1 commit into
mainfrom
feat/1201-observe-harness
Jul 29, 2026
Merged

feat(core): observer harness — shared bind/concurrent/tri-state read path (#1201)#1215
lex00 merged 1 commit into
mainfrom
feat/1201-observe-harness

Conversation

@lex00

@lex00 lex00 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Closes #1201 (CC foundation, epic #1197).

What

Adds observeEntities() + ObserverAdapter + boundedConcurrently to @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:

  • bind-or-not-observe-all with a typed reason (a loud refusal rethrows instead of degrading to a hole);
  • bounded concurrency — N entities is not N serial spawns, whether or not a transport ships its own pool;
  • per-entity tri-state routing, with a per-entity read() throw degrading to read-failed rather than a silent absence that would classify as a spurious create.

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.ts 18/18 green; core tsc --noEmit clean.

…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).
@lex00
lex00 merged commit 288054b into main Jul 29, 2026
5 checks passed
@lex00
lex00 deleted the feat/1201-observe-harness branch July 29, 2026 23:07
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.

feat(core): native-observer harness + shared read-path contract

1 participant