Add first-class managed conversation runtime with bounded rolling context #101
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#101
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
rlm_completion/4is intentionally a bounded fresh-root primitive. Interactive AgentProlog-style sessions need durable conversational continuity without replaying lifetime history into every model request.Canonical contract
rlm_completion/4; keep the stateless primitive public and unchanged.max_context_tokens, output reserve, safety margin, minimum recent turns, and fail-closed overflow behavior.Cold-history boundary
The runtime does not edit an old message to replace its contents with retrieval instructions. Instead,
rlm_conversation_runtimeinserts a mandatory provider-visiblemanaged_cold_history_boundarycontext unit when the projected conversation extends beyondmin_recent_turns.The boundary reports the prefix outside the guaranteed hot tail and instructs the planner to retrieve authoritative original history before guessing, using bounded operations such as:
It is charged in the normal token ledger and exposed through
cold_history_boundarystatus. Specialized callers can disable it withcold_history_boundary(false); default is enabled.Warm context versus compaction
Warm context is wired into the managed runtime. Automatic compaction is not.
When
warm_store(ArtifactStore)is present, the public runtime loads/ranks existing warm artifacts, converts them into multi-representation context units, and admits them into the same CLP(FD) packer as hot context and the cold boundary. Callers do not need manual warmcontext_units/1plumbing.A normal managed turn does not choose a range, call a summarizer, publish a new warm artifact, or trigger compaction under token pressure. Warm production remains an explicit API.
Current implementation slices
Remaining work
Invariants