1# khipu-gravity
2
3> Mass/decay algorithm for [khipu](../README.md).
4
5Pure physics of notes. Each note has `mass: f32`. Every tick (configurable, default 1h) mass decays: `mass *= exp(-dt / half_life)`. Each access reinforces it: `mass += boost`. When `mass < threshold`, the note falls off the visible horizon (not deleted, kept in archive). Pure computation — doesn't touch the store; the caller decides what to do with the result.
6
7## API
8
9```rust
10use khipu_gravity::{Gravity, Params};
11
12let g = Gravity::new(Params::default());
13let new_mass = g.decay(mass, dt);
14let new_mass = g.reinforce(mass, boost);
15```
16
17## Deps
18
19- `libm` for `exp` (no `std::math` when compiled to WASM)
20- Zero I/O or time deps (caller passes `dt`)
README.md
khipu-gravity
Mass/decay algorithm for khipu.
Pure physics of notes. Each note has mass: f32. Every tick (configurable, default 1h) mass decays: mass *= exp(-dt / half_life). Each access reinforces it: mass += boost. When mass < threshold, the note falls off the visible horizon (not deleted, kept in archive). Pure computation — doesn't touch the store; the caller decides what to do with the result.
API
use khipu_gravity::{Gravity, Params};
let g = Gravity::new(Params::default());
let new_mass = g.decay(mass, dt);
let new_mass = g.reinforce(mass, boost);
Deps
libm for exp (no std::math when compiled to WASM)
- Zero I/O or time deps (caller passes
dt)