[EPIC] AgentProlog programmable configuration, hooks, tools, and detectors #126
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#126
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?
Goal
Build a genuinely programmable AgentProlog configuration layer on top of #74/#75/#77, and make every frontend, including the DeepSeek Harness path, use it instead of owning frontend-local settings semantics.
There are exactly two configuration front doors:
config.prolog;Prolog is the primary configuration language. The target experience should feel closer to Emacs configuration than to a static application preferences file: trusted user configuration may define predicates, hooks, tools, detectors, helper code, loaders, and extension registrations.
Trust and execution model
User config
The XDG user config is trusted executable operator code:
with
$HOME/.configfallback.AgentProlog loads this file as executable Prolog under the user's process authority. This is intentional. It is host extension code, not a sandboxed data format.
The stock config module should provide helpers such as JSON loading so a user can write a tiny Prolog config that imports JSON when desired.
Project config
Project configuration may also be executable Prolog, but repository presence alone is not trust. Executable project config requires an explicit trusted-project decision bound to the structured project identity from #75. Untrusted projects may expose inert/discoverable config candidates, but AgentProlog must not silently execute repository code.
Project trust is therefore a real host-code trust decision. It is still distinct from the AgentProlog runtime authority modes used for individual registered operations.
Runtime boundary
Trusted config itself has the privileges of the AgentProlog process and may call ordinary Prolog/system APIs. Do not claim that arbitrary trusted config is capability-sandboxed.
The canonical capability/authority/effect guarantees continue to apply to AgentProlog-managed operations registered through those runtimes: tools, provider calls, durable effects, approvals, confined project mutations, and so on. A config-defined tool does not gain an invocation bypass merely because its handler was registered by trusted config.
Editing config
Editing user or project configuration is itself an AgentProlog file mutation and must cross the normal authority boundary. AgentProlog must never silently self-modify its configuration.
Config files created or rewritten through AgentProlog default to mode
0600; existing files with broader permissions should be tightened on an authorized write. Atomic replace/write semantics are preferred.The approval should make clear that editing executable config is privileged: after reload, the changed file runs as host extension code.
Configuration surface
The runtime must be able to configure and extend:
Secrets should remain external references by default rather than casually serialized frontend-visible preferences.
Hook / extension model
Create a typed extension-point registry, but allow trusted
config.prologto register actual Prolog handlers. Registry/catalog views expose identities and sanitized metadata, not executable closures to the model.Initial extension points should cover config, project, session, prompt compilation, provider/model calls, tool lifecycle, authority, durable effects, turn/step lifecycle, errors/repair, loop detection, verification, and safe UI projection.
Reuse existing
rlm_chainmiddleware,rlm_tool_loader, recursion guards, authority/effect boundaries, andprolog_agent_ui_v1rather than cloning them.Error and loop detectors
Trusted config may define/register detector predicates. Detectors consume structured observations/events and produce structured decisions/evidence. Their recommendations flow through the runtime that owns cancellation, repair, authority, and effects.
Loop detection should grow beyond the current recursive fingerprint guard to repeated equivalent tool calls, repeated model/tool cycles, repeated failed repairs, non-progressing turns/steps, repeated provider outputs, and project-specific detectors. #42 remains open until its existing fingerprint bug is actually fixed.
DeepSeek Harness integration
#124/#125 must ultimately stop owning a private provider/model/session settings authority. Harness config UI/editing becomes a client of AgentProlog config APIs.
OpenRouter remains a normal/default route. Direct DeepSeek remains optional.
Dependencies
Child issues
config.prolog+ JSON loader + project trust/discoveryAcceptance criteria
config.prologis executable trusted user configuration and can define/register Prolog behavior.0600.Closing the AgentProlog programmable-configuration epic and children (#127-#131) per the restored canonical boundary (#141, 2026-08-31): product code does not move back into prolog-rlm. The epic targeted the nested prolog-rlm/agentProlog/ harness and DeepSeek Harness frontend that were removed from main by PR #187; product configuration/UX (XDG config.prolog, hooks, config-defined tools, detectors, Harness settings routing) is owned by lost-rob0t/agentProlog. None of these are current prolog-rlm runtime gaps that prevent building a coding agent: docs/prolog-agent-roadmap.md's 'still missing' list does not include them. Re-file in lost-rob0t/agentProlog if the programmable config layer is still wanted.