gioser

tawasuyu/khipu

Sovereign local-first P2P notes, content-addressed, in Rust.

⎇ bf782ebef1b560208994c5868a1f222678cd82f1 00_unanchay/khipu/khipu-gravity/README.md Markdown · 20 líneas · 723 B Historia crudo

feat: khipu standalone — notas P2P soberanas content-addressed, local-first (front-door, git-dep al monorepo) bf782ebef · Sergio ·

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