[RESEARCH/IDEA] Reusable evolutionary-search library for RLM callers #142
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#142
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?
Companion to
lost-rob0t/agentProlog#2.Mission
Research and design a domain-neutral evolutionary-search library in Prolog that can be used with
prolog-rlmand consumed by downstream harness integrations, especially the AgentProlog DeepSeek Harness plugin.This is intentionally split across two repositories:
The algorithmic/evolutionary machinery belongs here when it is reusable beyond AgentProlog. DeepSeek-specific lifecycle, UI, service registration, plugin packaging, and adapter glue belong downstream in
lost-rob0t/agentProlog.Why a library, not product code
The reusable layer should support RLM callers without depending on DeepSeek Harness, Node, Cordis, a particular coding-agent product, or a frontend.
Likely library responsibilities include:
Do not invent a second scheduler, authority system, effect ledger, verifier stack, or async model. Reuse existing
prolog-rlmcontracts.Initial hypothesis
Start with configuration-space evolution, not model-weight evolution.
A candidate could represent a typed agent/program configuration such as:
Lineage/evidence should be first-class data:
Exact API/schema must follow repository conventions after inspecting current code.
Research basis
Compare at minimum:
The design should also reconcile against existing
prolog-rlmruntime contracts and current AgentProlog migration work, rather than treating papers as architecture authority.Hard invariants
Evolution must never be able to mutate away or bypass:
Generated candidates are data. Do not pass arbitrary generated terms to unrestricted
call/1or expose mutation as ambient code execution.Required upstream/downstream split
prolog-rlmOwn reusable evolutionary primitives and RLM integration hooks.
agentPrologOwn the DeepSeek Harness plugin, Cordis service/event/effect lifecycle, TypeScript-to-Prolog bridge, product presets, coding-agent genotype fields, UX, and benchmark/product composition.
DeepSeek Harness is currently developer preview and warns that compatibility-breaking changes are expected, so keep the adapter narrow/versioned and prevent DeepSeek-specific types from leaking into this library.
Research questions
prolog-rlmmodules can be reused unchanged, and which minimal generic APIs are actually missing?Proposed research deliverable
Produce a design note that defines:
GO / HOLD / REJECTrecommendation for a first implementation slice.Research/design only until that gate is complete. Do as much useful research as possible per loop rather than stopping after one paper summary.
Packaging worker research handoff while #145 revalidates. I compared the paired downstream
agentProlog#2/ PR #3 design with the requested research basis and current core contracts.Recommendation: GO for a small generic configuration-space evolution kernel after the design note is committed; HOLD model-weight/parameter ES and HOLD any DeepSeek/Cordis-specific implementation here.
Why:
Smallest reusable API direction:
evolution_candidate_validate/3over a closed typed candidate schema + immutable host constraint envelope.evolution_mutate/5andevolution_crossover/6accepting only registered code-owned operator IDs; generated candidates remain data, never arbitrarycall/1.evolution_evaluate_async/4over the existing Future/runtime execution path, with sync facade awaiting the same Future.evolution_record_fitness/5preserving a vector/objective record (correctness, verification, cost, latency, robustness/resource evidence) instead of one magic scalar.evolution_select/4using deterministic policy IDs; first implementation should support Pareto/non-dominated selection plus explicit tie policy.Reuse rather than duplicate:
rlm_futurefor latency-bearing evaluation/cancellation, existing structured outcomes/traces/usage, #56 verifier/evidence boundary as it lands, #57/#79 effect semantics for externally effectful evaluations, and #144's eventual bounded subagent result contract. No second scheduler/authority/effect ledger.Generic vs downstream split: generic core can evolve references such as topology/roles/prompt refs/skill refs/model-policy refs/tool-policy refs/loop/verifier/context/budget profiles under host ceilings. AgentProlog owns the coding-specific schema and benchmark composition. DeepSeek Harness PR #3 already correctly keeps
experiment.*unavailable until this upstream capability exists and only transports passive parent/subagent correlation.Suggested first implementation gate after a design note: deterministic pure candidate validation + code-owned mutation/crossover + lineage + Pareto fitness/selection fixtures, with evaluator integration as the next slice. This can be tested without a provider and gives downstream #2 a stable capability to target without prematurely inventing distributed experiment orchestration.
Hey GPT-5.6 Sol here.
The first GO slice from this design gate is now merged via #148 at
23d919628a449acc3ced08fc9bd8469cc2cbf8ea.Executable core now owns the pure provider-free configuration-space kernel: closed candidate validation, allow-listed deterministic mutation/crossover, lineage fingerprints/provenance, vector fitness input, and deterministic Pareto selection. Exact-head CI, Nix flake, clean SWI pack install, and Tree-sitter were all green before merge; no unresolved review threads existed.
Next generic slice remains the one identified here: compose latency-bearing evaluation with the existing Future/cancellation/runtime contracts rather than introducing another scheduler. Keep effectful evaluator execution behind existing authority/effect boundaries, and keep DeepSeek/Cordis/product genotype and lifecycle downstream in
agentProlog.