Skip to main content

Module sense

Module sense 

Source
Expand description

Sense path — the input twin (Phase 4): microphone PCM → forward DSP → the ∫Ψ > τ → Fact bridge, every capture under the deontic/standpoint consent gate (surveillance-refusal default). Gated like place_time (needs crate::modalities). Phase 4 — the sense path (the input twin of the renderer; STELLAR §D).

The renderer projects the manifold → percept (output). The sense path is its twin: a physical signal → the manifold → a discrete Fact the values/epistemic layer can reason over. It is the same ∫Ψ > τ → Fact bridge (crate::modalities::manifold_logic) the legal-logic layer already uses, with a microphone front-end.

§What this is (honest scope)

  • Acoustic (microphone) is the live band — real forward DSP: a Hann-windowed DFT of PCM samples → magnitude bins → dominant tonal bin. (There is no forward STFT elsewhere in the crate; the audio::stft_bake path synthesises spectra for the sidecar raster, it does not analyse a captured signal. So this is the analysis primitive.)
  • RF / Wi-Fi CSI is DEFERRED ([band_available]) — it needs an SDR / radio plus explicit hardware permission, and may never be available in-browser. Documented, not stubbed-as-done.

§The rails (RENDERER_DEFINITION §8; the memories) — load-bearing here

  • Every sense runs under the deontic/standpoint gate. [sense_permitted] fails closed: no Active PERMIT consent for this agent + this environmentrefused. That is surveillance-refusal by construction — the default is to not capture. An Active FORBID always wins.
  • Own-environment + consent. The consent norm binds (agent) PERMIT capture(environment); sensing is authorised per environment the agent holds consent for.
  • Biometrics never leave the device. The pipeline emits only a discrete symbolic Fact (an acoustic-tone-detected quin + the dominant frequency / energy scalars). The raw samples are never stored, returned, or embedded — there is no voiceprint, no audio, in the output.
  • Delegates, does not reinvent the logic. The continuous→discrete decision is manifold_logic::continuous_to_fact; the consent decision is logic::deontic. Only the forward DSP and the field-packing live here.

Enums§

SenseBand
The physical bands the sense path can ingest.
SenseOutcome
The outcome of a gated sense attempt.

Constants§

FACT_ACOUSTIC_TONE
The discrete fact emitted when acoustic energy crosses the bridge threshold.
MAX_SENSE_NORMS
Max consent norms evaluated in one sense_permitted pass (stack-bounded, zero-heap).
P_PERCEIVED
Predicate stamp for a percept→fact quin.
P_SENSE_CAPTURE
Property-path for a capture/sense action governed by a consent norm.
SENSE_BINS
Number of DFT magnitude bins computed for a captured frame (analysis resolution).

Functions§

band_available
Whether a band is available for live sensing. Only SenseBand::Acoustic is; RF is deferred.
bin_to_hz
Centre frequency (Hz) of DFT bin bin for an fft_size-point transform at sample_rate.
dft_magnitudes
Forward windowed DFT magnitudes: for each bin k in 0..out.len(), write |X_k| of the Hann-windowed real samples. Zero-heap — results go in the caller’s out slice.
dominant_bin
The dominant tonal bin (skipping DC bin 0): (bin, magnitude), or None if there is no non-DC bin.
hann
Hann window coefficient for sample n of a len-sample frame (reduces spectral leakage).
pack_percept
Pack the percept scalars (dominant Hz, integrated energy) into one metadata word — the only quantitative residue that leaves the sense path. hz in the high 32 bits, energy in the low.
perceived_fact_quin
Build the discrete percept→fact NQuin: where sensed (subject = environment), the percept stamp (P_PERCEIVED), what (object = fact_id), the consenting standpoint (context), and the dominant-Hz / energy scalars in metadata. No raw audio — only this discrete fact.
sense_acoustic_to_fact
The Phase-4 pipeline. Microphone PCM samples → (consent gate) → forward DSP → the ∫Ψ > τ → Fact bridge → a discrete Fact NQuin, or a refusal.
sense_norm
Build a consent norm for sensing: (agent) OPCODE capture(environment) in a frame, optionally expiring. Consent is OP_PERMIT; a prohibition is OP_FORBID.
sense_permitted
The sense gate. true iff agent has Active consent to capture environment: there is an Active PERMIT bound to (agent, environment) and no Active FORBID bound to it.
unpack_percept
Inverse of pack_percept.