[SUPERSEDED] Standalone AgentProlog downstream product boundary #141
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#141
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#1.Mission
Make
prolog-rlma clean, flake-consumable reusable runtime for the standalonelost-rob0t/agentPrologproduct while preservingprolog-rlmas a domain-neutral SWI-Prolog runtime/library.Work autonomously and do as much useful work as possible per loop. Do not merely complete one trivial checklist item and stop. Before each slice, inspect current
main, applicable repository instructions, docs/design/research, issues/comments, recent PRs/commits, source, tests, and CI; reconcile stale prose against merged executable truth.Correct integration decision
prolog-rlmitself is NOT an AgentProlog plugin.Do not route the runtime through
rlm_tool_loader, and do not confuse XDGconfig.prologwith a package/plugin architecture.The intended composition is:
AgentProlog consumes this repository as a pinned Nix flake input and normal SWI-Prolog package/library dependency.
prolog-rlmalready has a SWIpack.pland clean SWI-pack installation validation. Preserve that supported package identity while adding clean Nix flake consumption rather than replacing one packaging mechanism with an unrelated runtime copy.Dependency direction remains:
Never make core import or depend on AgentProlog product code.
When this repository should be edited
Implement changes in
prolog-rlmwhen standalone AgentProlog exposes a missing or incorrect generic runtime contract, including:Do not put coding-product-specific implementations in core merely because AgentProlog needs them. Concrete repository/Git/process/test tools, Bubble Tea rendering, editor UX, product defaults, and coding-specific composition belong downstream.
If a missing behavior is truly product-specific, cross-link/hand it back to
lost-rob0t/agentProlog#1rather than bloating core.Existing extension boundaries: use them accurately
External tool packs
The existing
rlm_tool_loader/docs/external-tool-libraries.mdcontract is the package/extension seam for concrete external tools.Core owns:
External libraries own concrete tool implementations.
Use this for future AgentProlog filesystem/Git/process/test tool packs where appropriate.
Do not turn it into a universal runtime plugin loader.
config.prologExisting/planned programmable AgentProlog configuration (
#126and children) is runtime/operator configuration and trusted customization. It is not the packaging mechanism by which AgentProlog embedsprolog-rlm.Do not cite
config.prologas evidence that the runtime already has a general binary/package plugin ABI.Other pluggable contracts
Where current generic APIs already intentionally support multiple implementations (providers, parser backends, external tools, MCP adapters, frontend protocol clients, etc.), extend those existing contracts rather than inventing parallel systems.
Never create
authority_v2, another scheduler, another effect ledger, another verifier stack, or another protocol merely to satisfy AgentProlog.Nix flake packaging
Add/maintain first-class Nix flake packaging so downstream consumers can depend on this repository directly.
Create/maintain:
Expose sensible outputs, following repository conventions, such as:
If a runnable CLI app output is appropriate, expose it without making the library packaging depend on the CLI.
The flake package must produce a usable SWI-Prolog library/pack that allows a consumer to load the installed runtime outside the source checkout.
Preserve and integrate the existing clean-pack install invariant: a fresh process outside the repository must be able to load the packaged
library(rlm)(or the canonical public library entrypoint).Use Nix for external/native build dependencies. Do not require downstream AgentProlog to perform ad-hoc clones or runtime downloads to consume core.
Provide a documented consumption example equivalent to:
and demonstrate how downstream packaging obtains the SWI library path/package artifact without reaching into arbitrary internal source paths.
Audit current nested AgentProlog code
Substantial product code still lives under:
Audit it and all related support code/docs/tests.
Classify each relevant component as:
Reference exact files/modules/functions.
The classification must be based on semantics, not directory location. Some code under
agentProlog/may reveal missing generic runtime behavior that belongs in core; some code elsewhere may actually be product-facing and should migrate downstream.Frontend protocol ownership
Preserve the renderer-independent semantics of
prolog_agent_ui_v1where they represent a reusable, authoritative product/runtime boundary.Determine explicitly which pieces belong:
prolog-rlmruntime/facade support;Do not let a Bubble Tea/OpenTUI/Emacs client become authoritative execution logic.
Preserve, where canonical:
If protocol semantics are inherently AgentProlog-product-specific, keep the reusable transport/runtime primitives generic and migrate the product facade downstream instead of permanently coupling core to one coding UI.
Headless workflow support
Ensure core public APIs are sufficient for downstream AgentProlog to implement one headless coding workflow:
Do not implement a special AgentProlog scheduler in core.
Reuse and complete existing generic work where needed, especially relevant slices under:
Do not assume old issue text is current. Inspect merged code/tests first.
External coding-tool integration contract
Standalone AgentProlog should be able to ship concrete filesystem/Git/process/test packs outside core using
rlm_tool_loader.Audit whether the existing loader and runtime execution contracts are sufficient for safe tools equivalent to:
Core should not implement those concrete coding catalogs unless an item is genuinely generic and already belongs here.
Core should provide/fix generic contracts needed to preserve:
If the loader/runtime cannot safely support the downstream pack, create a focused upstream child issue and fix the contract here rather than letting AgentProlog bypass it.
Compare current nested harness against standalone target
Maintain an upstream-facing migration matrix covering:
Use this to migrate code deliberately and prevent duplicated runtime behavior.
Verification
Use TDD and executable evidence.
At minimum ensure:
nix flake checkexercises meaningful runtime/package checks;Do not weaken CI to obtain green.
OLD HARNESS REMOVAL GATE
DO NOT REMOVE
prolog-rlm/agentProlog/yet.The nested harness is a migration source and compatibility reference until standalone AgentProlog reaches verified parity.
You may inspect, test, refactor generic portions, migrate product portions, and mark readiness accurately. Do not delete, gut, or replace it with an empty stub.
Final removal requires a separate explicit user command. Keep the corresponding cutover/removal work blocked until that command is given.
Autonomous-loop contract
For every autonomous work cycle on this epic:
lost-rob0t/agentProlog#1;agentProlog#1rather than implementing product-specific code here;The loop must search beyond this issue body each run. This issue is a mission contract, not frozen repository truth.
Deliverables
prolog-rlm;New research child: #142 defines the reusable evolutionary-search library side. The paired downstream AgentProlog work is lost-rob0t/agentProlog#2, implemented as a DeepSeek Harness/Cordis plugin with a thin Prolog bridge. Keep generic evolution mechanics here; keep DeepSeek/product glue downstream.
Subagent/prompt audit on current
main(f21df8ea5bf89c85d0d516f170e1f157c553d800) found a real generic-runtime gap and is now tracked as #144.Executable truth:
rlm_agentalready supplies supervised spawn, capability/authority narrowing, bounded mailboxes/workers, cancellation propagation and traces;rlm_planroutesspawn_agentthrough the ordinary tool boundary;rlm_completionsupplies bounded recursive model calls. Butspawn_agentonly yields a child handle, not a bounded RLM subagent result/evidence envelope, and there is no canonical unknown/unresolved -> delegate -> resume/replan path. Successful child result correlation is likewise not an end-to-end first-class fallback contract.Prompt compiler truth: the substantial compiler is still on diverged
agent/prompt-context-compiler(18 ahead / 14 behind current main). It already has bounded deterministic capability/context selection, but no typed KB short-prompt -> loop-command binding that resolvesunknown -> delegateto the RLM subagent tool. #144 scopes the smallest coherent upstream slice and explicitly avoids #122/#125/#132 surfaces and any AgentProlog-specific TypeScript behavior.OLD HARNESS REMOVAL GATE — LIFTED
The user has now explicitly authorized cleaning the repository first by removing the old harnesses.
This supersedes the previous
DO NOT REMOVE prolog-rlm/agentProlog/ yetgate in this issue.Cleanup is tracked in #186. The required behavior is:
prolog-rlm;prolog-rlmruntime-only and downstream-consumable;No future worker should treat the old removal gate as active.
Architecture update — 2026-08-27
The current operator direction supersedes the earlier standalone-product repository boundary in this issue.
AgentProlog now belongs in the
prolog-rlmrepository as a separately packaged application layer whileprolog/remains an independently consumable library.Canonical dependency direction:
Rules:
packages.defaultstays the reusableprolog-rlmlibrary;prolog/;Treat earlier “standalone
lost-rob0t/agentPrologonly” prose as historical, not the current repository boundary.