Skip to content

A source can be set to decay: Lore's score, a retrieval record, and the option column - #18

Merged
gedaiu merged 3 commits into
re-devfrom
feat/source-decay
Oct 22, 2026
Merged

gedaiu merged 3 commits into
re-devfrom
feat/source-decay

Conversation

@gedaiu

@gedaiu gedaiu commented Oct 21, 2026

Copy link
Copy Markdown

Slice 1 of 5 of RC-003 (a source may decay). Nothing reads the new column or table yet, so no behaviour changes.

What is in it.

  • sources.decay (NULL = off) and document_salience (retrieval count, last retrieval, half-life), migration 9004, idempotent. CURRENT_SCHEMA_VERSION 107 to 108.
  • utopia_store::decay: DecaySettings (Lore's defaults, unknown fields refused) and score_importance, Lore's scoreImportance ported unchanged. Text length counts UTF-16 units, as JS does.
  • docs/decisions/re-cinq/RC-003-a-source-may-decay.md.

Tests. The score test uses 19 vectors whose expected values were computed by Lore's own scoreImportance at the same now, covering every adjustment, both clamps, the half-life default and the UTF-16 case. A store test pins the column default, the object-only check, the half-life range and the cascade on document delete.

Depends on. #17 (merge of upstream dev), because this branch is cut from it; the diff here narrows to this slice once #17 is in. #16 also takes migration 9003 and bumps the schema version, so whichever merges second renumbers the version to 109.

Checked locally: cargo fmt --all, cargo clippy -D warnings on utopia-store and utopia-cli, the new unit and store tests, utopia-cli tests, and the migration run twice. The full workspace suite is left to CI.

🤖 Generated with Claude Code

Floating-Y and others added 3 commits October 21, 2026 23:59
* Record why source checkpoints need bounded continuation

Signed-off-by: Floating-Y <[email protected]>

* Record why source syncs stop at timestamp boundaries

Signed-off-by: Floating-Y <[email protected]>

* Clarify how source syncs advance past a completed timestamp group

Signed-off-by: Floating-Y <[email protected]>

---------

Signed-off-by: Floating-Y <[email protected]>
@gedaiu
gedaiu merged commit 7dc1158 into re-dev Oct 22, 2026
6 checks passed
gedaiu added a commit to re-cinq/lore that referenced this pull request Oct 22, 2026
0.1.0-re.17 = re.16 + a source option to let its documents decay
(re-cinq/utopia#18 to #23, #25, #27; RC-003) + #16 (embed_names runs on
the fast lane) + three upstream syncs (#17, #24, #26).

**Decay.** A source with `decay` set scores its documents like Lore
scores a memory (0 to 10, same adjustments, checked against Lore's own
function), records each search that returns one, ranks the unread ones
at 0.6, and once a day takes a source over its `max_items` back to it by
deleting the lowest scores (restorable, one `decay.evict` audit row).
Off by default: a source without it behaves as before. A document the
sweep evicted is not restored by a pusher that sends the same content
again, which Lore's memory pass would otherwise do on every run. The
switch is in a source's settings in the web UI.

**Nothing turns it on yet.** This PR only changes the image. After the
apply, the trial is a click in Utopia's UI: the `memories` source of
re-cinq/lore's base, max 5000 (a cap of 500 would delete most of it:
Lore's is per agent, Utopia's per source). No Lore code is needed for
that.

Tag `v0.1.0-re.17` (re-dev `a5ea1023`), digest
`sha256:f2cb3f9276164b7654215e015e8a48d45dc0ffd5086a0dc305e281495b8d4bec`
(the index: amd64 and arm64, as for re.16). Three migrations run on
start: fork `9003` (embed_names job priority), `9004` (`sources.decay`,
`document_salience`) and `9005` (`decay_evictions`); all idempotent.
Needs a terraform apply from main, and the apply restarts Utopia.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants