# `MingaKnowledgeGraph.Score`
[🔗](https://github.com/jsmestad/minga-knowledge-graph/blob/main/lib/minga_knowledge_graph/score.ex#L1)

Pure familiarity scoring and decay.

Familiarity rises with how often you open and edit a file (with
diminishing returns) and decays toward zero the longer you go without
touching it. A 0.0..1.0 score maps to a 0..4 heat bucket the file tree
renders as a tint (0 = coldest/unfamiliar, 4 = warmest/familiar).

# ponytail: open + edit counts and recency approximate "how well you know
# this file". Real dwell time (focus duration) is a stronger signal; add it
# if the buckets feel too coarse.

# `stats`

```elixir
@type stats() :: %{
  first_seen: integer(),
  last_seen: integer(),
  open_count: non_neg_integer(),
  edit_count: non_neg_integer()
}
```

# `level`

```elixir
@spec level(float()) :: 0..4
```

Maps a 0.0..1.0 familiarity score to a 0..4 heat bucket.

# `score`

```elixir
@spec score(stats(), integer()) :: float()
```

Familiarity in 0.0..1.0 for `stats` evaluated at `now` (unix seconds).

Activity saturates (so the 100th edit adds little), then decays by how long
it has been since `last_seen`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
