foundation capa

foundation-observation

Layer-3 observation datum: value + time + provenance, the Env comonad. No tokio, no sqlx, no I/O -- buildable for WASM/CI/edge targets unmodified.

Layer-3 observation datum: value + time + provenance, the Env comonad. No tokio, no sqlx, no I/O -- buildable for WASM/CI/edge targets unmodified.

Tierfoundation
Roleunclassified (baselined)
Pathcrates/foundation/observation
Edition2021
Targetsfoundation_observation
Public items6 across 0 modules
Tests7

What it is for

Layer-3 observation datum, per docs/planning/MEASUREMENT-LAYERS-DECOMPOSITION.md must never claim a cause.

Observation<T> is the Env comonad (coreader): it composes downward via Observation::map/Observation::extend and deliberately has no bind/flatten/join — joining observations of different measurands is meaningless, so the type does not offer a way to do it.

No tokio, no sqlx, no filesystem or network I/O. This crate is pure data plus two operations, buildable for WASM, CI, an edge function, or a future no_std target without modification.

Capabilities

Observation

Layer-3 observation datum, per docs/planning/MEASUREMENT-LAYERS-DECOMPOSITION.md

Item
pub struct Observation<T>

Observation<T>

Layer-3 observation datum, per docs/planning/MEASUREMENT-LAYERS-DECOMPOSITION.md

Item
Observation<T> :: fn new(value : T, occurred_at : DateTime <Utc>, provenance : Provenance) -> Self
Observation<T> :: fn extract(& self) -> & T
Observation<T> :: fn map <U>(self, f : impl FnOnce(T) -> U) -> Observation <U>
Observation<T> :: fn extend <U>(& self, f : impl Fn(& Observation <T>) -> U) -> Observation <U> where T : Clone,

Provenance

Layer-3 observation datum, per docs/planning/MEASUREMENT-LAYERS-DECOMPOSITION.md

Item
pub struct Provenance

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub struct ProvenanceWhere a measurement came from — enough to judge whether to trust it, never enough to claim why it happened
pub struct Observation<T>Layer 3's datum: value + time + provenance, nothing else
Observation<T> :: fn new(value : T, occurred_at : DateTime <Utc>, provenance : Provenance) -> SelfBuild an observation
Observation<T> :: fn extract(& self) -> & TThe one way out of the envelope: the payload, and nothing else.
Observation<T> :: fn map <U>(self, f : impl FnOnce(T) -> U) -> Observation <U>Transform the payload; time and provenance pass through unchanged.
Observation<T> :: fn extend <U>(& self, f : impl Fn(& Observation <T>) -> U) -> Observation <U> where T : Clone,Comonadic extend: build a new observation whose payload is computed from the whole current observation (value, time, and provenance all visible to f), carried at the same time/provenance as self.

No pub use re-exports: every item above is declared in this crate.

Boundary

Depends on no other workspace tier.

Shares tier foundation with 27 other crates: foundation-audit-log, foundation-basemodels, foundation-bounded-io, foundation-conversation-closure, foundation-crypto-sign, foundation-decisioning, foundation-encounter-vocabulary, foundation-fs-metadata, … (27 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)foundation
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/foundation/observation
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
chrono^0.4serdenoalways
serde^1derivenoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
serde_json^1noalways

Build. None.

Depended on by. Nothing in this workspace.

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
libfoundation_observation`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

No workspace crate depends on this one.

Verification

KindCount
Unit tests7
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root200

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc66
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 6
    "No rustdoc detected" : 0

Metrics

MetricValue
Rust source files1
Source lines182
Code lines122
Public API items6
Public modules0
Tests7
Examples0
Cargo features0
Direct runtime dependencies2
Workspace reverse dependencies0
pie showData
    title Public API by kind
    "method" : 4
    "struct" : 2
pie showData
    title Rust source composition
    "Code" : 122
    "Blank or comment" : 60

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las foundation · Manual