Add managed conversation runtime and token-budget solver #102
No reviewers
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!102
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/conversation-runtime"
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?
What changed
Starts #101 with the first real managed-conversation slice.
rlm_conversationwith memory and persistent append-only transcript stores;conversation_context_pack/3andconversation_token_ledger/3;conversation_turn/4as a managed layer above the existing statelessrlm_completion/4primitive;rlm_context_budget, a provider-visible context ledger and CLP(FD) packing solver;max_context_tokensfrom provider physical context size and uses the smaller hard ceiling;prolog/rlm.pl;docs/conversation-runtime.md.Why
The existing completion runtime deliberately creates bounded fresh roots. That is a good primitive but the wrong default contract for an OpenCode/Claude Code-style interactive agent. AgentProlog needs a durable complete transcript plus a bounded rolling provider-visible projection, with old turns still addressable through RLM rather than silently forgotten.
This slice establishes that boundary without changing
rlm_completion/4semantics.Important invariants
Current limitations / next slices
This PR intentionally does not pretend #101 is complete. Follow-up work remains for:
Validation
The canonical test runner includes
rlm_context_budget_test.plandrlm_conversation_test.pl, andtest/load_all.plchecks both new runtime modules.An earlier exact head passed the full deterministic CI job, including static loads, PlUnit, benchmark/conformance, deep-recursion, CLI smoke, persistent graph resume, durable artifact restart, and whitespace checks. Its REAL OpenRouter job failed only because
openrouter/freerouted the streaming sentinel test tonvidia/nemotron-3.5-content-safety:free, which returned a safety classification instead ofSTREAM_OK; this is the existing #46 router-safety defect. GitHub Actions on the current exact head remains authoritative.