Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ For each recognized participant, `last_interactions` says when the character las

Use `.with_activity(ActivityRef::Thread(thread_id))` or `.with_activity(ActivityRef::OpenLoop(open_loop_id))` to recall ongoing work without a topic. Thread membership, open-loop sources and linked memories supply candidates within the retrieval limits. The result echoes the activity with `Found` or `Unknown`; finding an activity does not guarantee an admitted memory. With tracing enabled, each section assignment reports its set of `CueKind` values: `Topic`, `Participant`, `Place` and `Activity`.

Thread members are taken most recent first.
Thread members are taken most recent first by creation time; an open loop's source episodes are taken most recent first by recorded scene time.

Candidate, graph root and section selection serve each cue kind's floor from its own order. Keyed and named routes take their kind's floor before reminders. Descriptions contribute their most recent recallable occasions at or before the scene time, as many as the kind's floor and at least one. Spare room follows score order at candidate and section caps; only root selection shares spare turns among kinds. A reminder can bring memories resting on its occasion. A person or thread reached only through that reminder is a leaf: it can be included, but recall does not continue through it. When a topic, key or name also reaches the occasion, linked history inherits that route’s score; the occasion itself keeps its best matching score. The pack keeps its final score order.

Each cue kind has a floor at the merged candidate cap, the graph root cap and each section cap. The **provisional** defaults are one slot each for participant, place, activity and topic. Floors apply per kind, not per person or place: five people share one participant floor. `context.cue_floors` is a calibration knob for measured defaults; applications are not expected to set it. Slots are reserved in successive rounds in that order. Unused room returns to the common pool, and selected memories keep their original order. A zero floor reserves nothing for that kind; a zero cap admits nothing. A single kind also receives its floor from its own queue, then fills remaining room in final-ranked order. Topic-only retrieval keeps its selection. Calibration uses the public companion evaluation repository, a development aid outside the core library.
Each cue kind has a floor at the merged candidate cap, the graph root cap and each section cap. The measured defaults reserve one slot each for participant, place, activity and topic. Floors apply per kind, not per person or place: five people share one participant floor. `context.cue_floors` is a calibration knob for measured defaults; applications are not expected to set it. Slots are reserved in successive rounds in that order. Unused room returns to the common pool, and selected memories keep their original order. A zero floor reserves nothing for that kind; a zero cap admits nothing. A single kind also receives its floor from its own queue, then fills remaining room in final-ranked order. Topic-only retrieval keeps its selection. Calibration uses the public companion evaluation repository, a development aid outside the core library.

With tracing enabled, `floor_admissions` identifies the object, stage and cue kind when a reserved or spare turn admitted an object outside that stage's original capped prefix. Earlier-stage evidence remains even when a later stage omits the object.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Plan: every cue the scene gives can bring its memories, and no cue drowns another

- status: in_progress
- status: completed
- generated: 2026-09-21
- last_updated: 2026-09-21
- last_updated: 2026-09-23
- work_type: code

## Goal
Expand Down Expand Up @@ -176,6 +176,8 @@ One crate, shared files: sequential, one worker at a time, each PR stacked on th
- 2026-09-21 Task_2 implemented (16692bd) and approved at Tier D: a notion's share is its distinct episodes over all episodes, counted once per episode however the write linked it, on the two paths that lead to experiences; in a store of 24 occasions with five participants each, the notion present in all of them went from 15 admitted observation edges to none on the `remember` path and from 3 episode edges to none on a caller-built one, while a rare participant kept all of its three and the belief about the ubiquitous notion stayed.
- 2026-09-21 Task_3 implemented (4eec349) and approved at Tier D and Tier A: floors per cue kind at the candidate merge, root selection and the section caps, served by one helper in successive rounds in the order participant, place, activity, topic, with unused room returned and original order kept. Three cue-only memories each lost at a different choke point before the change are admitted after it; topic-only and single-kind retrievals are unchanged. Values are 1 per kind and provisional, at `context.cue_floors`.

- 2026-09-23 Task_4 completed: the companion calibration supports retaining one reserved slot per cue kind; ADR-I-0036 is proposed, with Tier A changes applied and its promoted evidence linked. ADR-I-0022 remains accepted pending the decider's explicit acceptance and atomic retirement. The completion audit also corrects open-loop source episode order to recorded scene time descending, with a regression that reverses ID and creation-time order.

## Decision Log (append-only; re-plans and major discoveries)

- 2026-09-21 Decision: the routes work is two plans, and this is the first.
Expand Down Expand Up @@ -206,6 +208,15 @@ One crate, shared files: sequential, one worker at a time, each PR stacked on th
- User approval: decided under the standing instruction and logged for presentation.
- Record proposed: the measured floors, at Task_4.

- 2026-09-22 Decision: retain the measured cue-floor defaults and propose their complete decision record.
- Trigger / new insight: the scene-overlap calibration keeps six of eight on-topic memories at the default floors, equal to the topic-alone result, while higher participant or place floors admit more weakly similar occasions at the topic's expense.
- Plan delta (what changed): participant, place, activity and topic floors remain one and are described as measured defaults; no executable code, configuration or tests change. The record carries forward experience-share participant reach and selection of beliefs about a named notion outside entity-root selectivity.
- Tradeoffs considered: raising the floors has no measured benefit in the overlap cases; a zero reservation still recalls an occasion, so a description-similarity bound is a separate decision requiring suitable evidence.
- Record proposed: [ADR-I-0036: Retain measured retrieval bounds with one reserved slot per cue kind](../../../decisions/implementation/ADR-I-0036-retain-measured-retrieval-bounds-with-one-reserved-slot-per-cue-kind.md), a complete replacement of ADR-I-0022. It constrains future defaults to a measured basis that preserves cue room, experience-based participant reach and recall of named-notion state; extra reserved scene room loses conversational relevance in the measured corpus.
- Acceptance: proposed only, pending the decider's explicit acceptance of the record. ADR-I-0022 remains accepted and unmoved until that acceptance and the atomic retirement step.

- 2026-09-23 Decision: the scene-words plan supersedes the Design paragraph's sharing of spare slots by turns at all three caps; turns apply only at root selection, while candidate and section spare room follows score order.

## Notes
- Risks: admission changes move the pollution and context-size baselines of ADR-I-0022; the companion repository re-measures once, at its own closing task. A calibration corpus authored for other pressures may not isolate these three floors; Task_4 names the pressure it needs.
- Edge cases, with the expected result: a scene whose only participant is ubiquitous brings the latest recorded occasion with that participant; asking about a day still needs the time route; an activity naming a closed thread is found and brings its memories, though the thread itself has no pack section today; a memory carrying every kind takes one slot; at every cap it credits each kind only when it is the head of that kind's queue.
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
status: proposed
adr_type: implementation
date: 2026-09-22
deciders: ["ebigunso"]
consulted: ["GPT-6"]
informed: []
supersedes: [ADR-I-0022-retain-measured-retrieval-defaults.md]
superseded_by: null
depends_on: [ADR-I-0010-use-continuous-selectivity-and-smooth-fanout.md, ../design/ADR-D-0022-recall-is-activation-by-scene-cues.md]
---

# ADR-I-0036: Retain measured retrieval bounds with one reserved slot per cue kind

## Context and Problem Statement

Retrieval has finite room for memories brought by the topic and by the scene. Increasing a bound can admit more context without recovering anything relevant; reducing a cue's reservation can let another cue occupy all the room. The decision is which measured defaults to retain and where their selectivity rule applies, while preserving recall of both experiences and what the character knows about a named notion.

The defaults retained on the measurement basis are smoothing and fanout shaping at one, the relation/object fanout ranges of zero to twenty for beliefs about a notion, one to five for participant experiences and zero to fifteen for thread memories, candidate limits of 48 vector candidates and twelve graph roots, and one reserved slot each for participant, place, activity and topic.

The binding-scale calibration uses one central notion with 48 experiences across salience levels and embedding clusters, with scored selectivity decisions. Changing smoothing, fanout shaping or individual fanout caps does not improve the returned sets; larger root limits recover no additional relevant memory and increase context size. The scene-overlap calibration uses 48 experiences at one workplace with one described companion, identical and reworded descriptions, eight graded on-topic memories, both identifier orders, default caps and deterministic embeddings. With one reserved slot per kind, participant and place pressure, separately and together, leaves six of eight topic memories, equal to the topic-alone result. Sweeping a competing participant or place floor through zero, one, two, three and five leaves six, six, five, five and three topic memories; a stranger's description brings one, one, two, three and five occasions. A zero reservation still recalls one occasion: it does not disable the cue. These synthetic results do not establish a similarity bound for natural-language descriptions.

Familiarity also changes what an entity-root cap means. A notion present in nearly every experience is a weak clue to which occasion matters, but knowing much about someone must not erase that knowledge when the scene names them: a measured case with 200 beliefs about a named notion brought none under inverse-frequency selection.

## Decision

Retain the retrieval defaults as measured, and reserve one slot for each cue kind the scene gives. A floor reserves room per given kind, not per person or place; unused room remains available to the other memories. Topic-only retrieval keeps its selection.

The participant-episode budget follows the share of distinct experiences a notion takes part in, across the paths by which those experiences are reached. A ubiquitous notion brings its latest eligible occasion, and a more distinctive notion can bring more; repeated observations of one occasion do not make it several experiences. Missing or unhealthy statistics retain the conservative latest-occasion fallback. No identity receives special treatment.

Beliefs about a notion the scene names are chosen outside entity-root selectivity, within the existing hard bounds. Naming a notion is a direct cue to what is known about it, not an inference from its rarity. The retained inverse-frequency rule does not suppress that state; other entity-root expansion keeps its measured scope, without generalizing the rule to non-entity roots.

## Why

The defaults are retained on measured evidence: one reserved slot per given cue kind prevents starvation by another, while more reserved scene room admits weaker occasions at the conversation's expense. Participant reach follows the share of experiences the notion takes part in, whereas beliefs about a notion the scene names are chosen outside entity-root selectivity because a named root is not inferred.

## Rejected Alternatives

- Raise the cue floors together: extra participant or place reservations reduce on-topic retention in the measured overlap cases; reopen if a representative calibration shows useful recall gained without that loss.
- Use a zero floor to silence an unfamiliar description: a floor controls reservation, and zero still admits an occasion; assess a description-similarity bound separately when suitable embedding evidence exists.
- Tighten fanout caps or enlarge the root cap without a measured recall benefit: the measured changes either preserve the same output or add context cost; reopen when a binding workload demonstrates relevant memories recovered or irrelevant context avoided.
- Apply inverse-frequency suppression to beliefs about a named notion: rejected outright; the scene's direct cue must not lose its state because the character knows a great deal about it.

## Decision Boundary

Invariant: retrieval defaults require a measured basis that preserves room for each given cue kind; participant reach measures distinct experiences, and beliefs about a named notion remain outside entity-root selectivity. Hard bounds, conservative fallback and entity-neutrality remain constraints on calibration.

Not covered: replacement values justified by renewed calibration, the formulas and counter representation, the ordering and propagation of individual candidate routes, description-similarity or topic-relevance bounds, and selectivity for non-entity roots. Numeric defaults live in configuration and code; this record does not make their measured values universal constants.

## Validation

- Pin the library and evaluation inputs, vary one default at a time, repeat each configuration and compare returned identities, order, context size and the library's cue evidence against the topic-alone and description-removed controls.
- Exercise participant and place pressure separately and together, including reworded descriptions, unfamiliar descriptions, and identifiers ordered against occasion time; report which cue kinds and pressures ran, rather than treating an unchanged inactive floor as proof of protection.
- Verify that a ubiquitous participant reaches its latest eligible occasion across episode and observation paths, and that a named notion with many beliefs still brings its eligible state within the hard caps.
- Preserve the default-value and topic-only retrieval checks. Keep the complete calibration artifacts in the public companion evaluation repository; its tooling is a development aid, not core library functionality.

## Revisit When

A measured similarity bound for descriptions or a relevance bound for the topic changes which memories compete; a change to retrieval routes or pack admission changes which memories compete; a representative corpus replaces the synthetic workload; or a different statistics regime invalidates the scored-decision calibration. Repeat the affected calibration before changing the values. The scene-overlap measurement uses deterministic synthetic embeddings, so production embedding behavior requires separate evidence.

## More Information

- [ADR-I-0010](ADR-I-0010-use-continuous-selectivity-and-smooth-fanout.md) defines continuous selectivity; [ADR-D-0022](../design/ADR-D-0022-recall-is-activation-by-scene-cues.md) requires recall by scene cues and room for each kind.
- The public companion evaluation repository, `CharacterMemoryEvals`, retains the scene reminder calibration at `docs/evidence/calibration/scene-reminders-2026-09-21/corrected-description-reading.md`, with the complete table and raw measurements recoverable at `CharacterMemoryEvals@784c2784260196352d7cc5184e0992260f0b1b0b`; its tooling is a development aid, not core library functionality. The first reading in that directory rested on a probe whose wording carried the same vector as a stored wording, so it is kept and marked superseded rather than removed.
- The [retrieval calibration closeout](../../roadmap/roadmap-phases/v0_1_5_closeout_report.md) points to the binding-scale sweeps and their limitations.
2 changes: 1 addition & 1 deletion src/api/types/retrieval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl Default for RetrievalCandidateLimits {
}
}

/// Calibration values for measured defaults, provisionally one slot per cue kind.
/// Measured defaults reserve one slot per cue kind.
/// Applications are not expected to set these. Floors apply per kind, not per
/// person or place: five people share the participant floor.
///
Expand Down
Loading
Loading