nx_observatory.nx
buildroot/runtime/nx_observatory.nx
about
nx_observatory.nx -- external watcher for paired-cell dyads.
Astronomical observatories watch celestial bodies from a distance
without touching them. Nishi observatory watches nx_dyad pairs
(or organism-level cell sets) from outside the cells' isolation
boundaries -- it READS what cells emit but never writes into them.
Per [[feedback-cell-immune-system-ransomware-judo-ddos-by-bit]]:
"verify D observer received parallel telemetry without vacuole
bytes crossing." Observatory is the substrate primitive for that
"parallel telemetry without crossing." Sees both A's and B's
outputs side by side; computes a comparison metric; surfaces
divergence + agreement counts.
Naming: nx_observer is too generic (Observer pattern in nearly
every framework). nx_observatory keeps biology/science-domain
distance and matches the "external scientific instrument"
semantic exactly.
Composes:
nx_dyad -- the paired cells being watched
nx_provenance_chain -- observatory's reading is a transform;
chain-logged
nx_evict_journal -- significant divergence events logged
nx_xenocell -- when one cell of the dyad turns hostile, the
observatory catches the deviation before it
spreads
V1 ships:
- struct NxObservatory with dyad pointer + sample ring +
agreement_count / divergence_count
- sample(): grab one reading of A and B's outputs, compute
diff bytes, increment agree-or-diverge counter
- agreement_q10(): Q10 ratio of agreements to total samples
- is_divergent(): predicate firing when divergence_count
exceeds caller-supplied threshold
Gap list (V1 honest perf verdict):
- byte-equality diff is coarse (V2 supports semantic-diff
callbacks for structured outputs)
dependencies 3 imports · 2 importers
imports: nx_syscalls.nxnx_tier.nxnx_dyad.nx
imported by: nx_failover_compose_test.nxnx_observatory_test.nx
structs
| 74 | struct NxObservatorySample |
| 89 | struct NxObservatory |
consts
| 60 | const NX_MAGIC_1024: i64 = 1024 |
| 64 | const NX_OBS_OK: nx_int = 0 |
| 65 | const NX_OBS_ERR_BAD_DYAD: nx_int = 1 |
| 66 | const NX_OBS_ERR_OUT_OF_RANGE: nx_int = 2 |
| 99 | const NX_OBS_SAMPLE_BYTES: nx_size = 40 |
functions
| 103 | func nx_observatory_new(dyad: *NxDyad, capacity: nx_size) -> *NxObservatory |
| 119 | func _obs_at(o: *NxObservatory, idx: nx_size) -> *NxObservatorySample |
| 130 | func nx_observatory_sample(o: *NxObservatory, |
| 169 | func nx_observatory_agreement_q10(o: *NxObservatory) -> nx_int |
| 181 | func nx_observatory_is_divergent(o: *NxObservatory, threshold_q10: nx_int) -> nx_int |
| 191 | func nx_observatory_sample_count(o: *NxObservatory) -> nx_size called by 1: main |
| 200 | func nx_observatory_total_diff_bytes(o: *NxObservatory) -> nx_size |