| … | … | @@ -144,14 +144,56 @@ activity currently has nowhere to go in the peer, because its author has no feed |
| 144 | 144 | at the view layer as a second source. The doorbell is that place. With it, a reply from Mastodon and |
| 145 | 145 | a reply from a favela stranger stop being two mechanisms. |
| 146 | 146 | |
| 147 | ## 8.5 Retention, per tier |
| 148 | |
| 149 | ⛔ **Evicting a mirrored byte is NOT a deletion, and needs no tombstone.** `SOCIAL-MODEL.md` §6.5 |
| 150 | requires retention to tombstone rather than silently drop — but that is about an author retaining |
| 151 | their OWN records, where absence in a replicated log is ambiguous and the signer's forward-only gate |
| 152 | stalls on a pointer whose bytes vanished. A mirror holds someone ELSE's record: the pointer is not |
| 153 | ours to tombstone, and dropping the bytes returns that record to **UNRESOLVED** on this node, which |
| 154 | is an honest state the system already reports and already recovers from. It is reversible — the next |
| 155 | fetch brings it back if any holder is online. |
| 156 | |
| 157 | ⇒ **Retention of your own records is a LOG question. Retention of a mirror is a CACHE question.** |
| 158 | Conflating them is what made this look hard. |
| 159 | |
| 160 | | tier | held until | evicted | |
| 161 | |---|---|---| |
| 162 | | **browse** | the peek ends | with the peek — including at restart, where peeks already evaporate | |
| 163 | | **follow** | you unfollow | only under budget pressure, oldest first | |
| 164 | | **interaction** | the subject is gone | last, and it is the smallest | |
| 165 | |
| 166 | **browse** answers the question `favela-peer/lib/node.js` leaves open beside `peek()`: *"a peek lasts |
| 167 | for the life of the daemon and then evaporates… The BYTES stay on disk until something collects them; |
| 168 | that is a separate question."* This is that answer — the bytes are a cache whose lifetime is the |
| 169 | peek's, and a restart that forgets the peek must collect them. |
| 170 | |
| 171 | **follow** has no clock. Following is the decision to keep, so the only thing that evicts a followed |
| 172 | feed's bytes is a **budget**, and the eviction order is: browse first (already ephemeral), then |
| 173 | followed records oldest-first, then interactions. ⛔ **Never a record you authored** — that is your |
| 174 | log, not a mirror of anyone. |
| 175 | |
| 176 | ★ **The budget is the ONE number that differs per device**, and that is the whole reason this |
| 177 | matters now. An always-on box can hold everything; a handset cannot, and the mirror fetches eagerly |
| 178 | on every append without a reader. One number, not a different design — which is what keeps a phone |
| 179 | from needing its own architecture. |
| 180 | |
| 181 | ⚠ **Eviction costs availability, and nothing measures it.** Drop the only second copy of a record |
| 182 | whose author is offline and it becomes unreadable for everyone. The right policy would prefer |
| 183 | evicting records with many known holders; we do not track holders, so a first cut cannot. Stated |
| 184 | rather than solved. |
| 185 | |
| 186 | `evictContent(hash)` and `compactIndex(opts)` already exist on the overlay. Nothing calls either. |
| 187 | |
| 147 | 188 | ## 9. Open |
| 148 | 189 | |
| 149 | 190 | 1. **Bounding the doorbell.** `knock` gets away with one row per feed because it is a single |
| 150 | 191 | yes/no. Likes and replies are per-post and per-person, so "one row" does not hold, and unbounded |
| 151 | 192 | means anyone may write into your feed for ever. Bounding by *relationship* is the likely shape — |
| 152 | 193 | whose ring is accepted is a choice, as following is. |
| 153 | | 2. **Retention per tier.** §3 names three lifetimes and nothing implements any of them. Mirror mode |
| 154 | | without retention is a disk-filler; `evictContent` and `compact` exist and nothing calls them. |
| 194 | 2. ~~**Retention per tier.**~~ **RESOLVED — §8.5.** A mirror is a cache, not a log, so eviction |
| 195 | needs no tombstone; browse evicts with the peek, follow only under budget, and the budget is the |
| 196 | one number that differs per device. Unimplemented, but decided. |
| 155 | 197 | 3. **Which feeds mirror.** All followed, or own-devices-only? Own-devices is bounded by construction |
| 156 | 198 | and fixes §0 on its own. |
| 157 | 199 | 4. **Does browsing spool or scratch?** A peek that spools becomes a durable mirror by accident. |