Bundle AgentProlog + DeepSeek harness in prolog-rlm #132

Closed
lost-rob0t wants to merge 14 commits from agent/127-agentprolog-config into main
lost-rob0t commented 2026-08-19 17:24:20 +00:00 (Migrated from github.com)

Closes #127. Implements the current in-repo product direction tracked by #184.

Architectural correction — 2026-08-27

This PR is the active implementation base for the user-approved repository boundary:

lost-rob0t/prolog-rlm
├── prolog/                 reusable RLM runtime/library
├── agentProlog/            bundled application + trusted operator config
├── harness/deepseek_tui/   bundled reference harness/frontend
└── flake.nix               library + application + harness outputs

There is no separate downstream AgentProlog product owner in the target architecture, and #184 is no longer an optional independent official-DSH product track. #141 is superseded.

The library/application dependency rule remains strict:

harness -> prolog_agent_ui_v1 -> AgentProlog -> public prolog-rlm APIs

Nothing under reusable prolog/ may import frontend/product code. One repository does not mean one monolithic runtime.

Current implementation

The branch now reuses the already-existing reusable prolog_agent_ui_v1 + prolog_agent_ui_facade boundary rather than inventing a second harness transport.

Added in this recovery:

  • agentProlog/prolog/agentprolog_ui.pl — application adapter over the canonical UI protocol;
  • bin/agentprolog-ui.pl — persistent UTF-8 NDJSON protocol server;
  • run.submit — starts one canonical rlm_async Future around the AgentProlog/RLM execution path;
  • session.poll — observes that Future without frontend-owned execution state;
  • session.cancel — cancels the canonical Future and linked child work;
  • deterministic deferred-Future tests for negotiation, request correlation, exactly-once terminal projection and cancellation;
  • apps.agentprolog-ui and packaged protocol smoke in the flake;
  • a persistent Go prolog_agent_ui_v1 client for the bundled Bubble Tea v2 frontend;
  • Esc cancellation from the TUI to canonical Prolog execution;
  • deepseek-harness --check now performs a real Go -> packaged agentprolog-ui negotiation and clean shutdown;
  • a committed Go dependency lockfile for the harness.

AgentProlog application

bin/agentprolog.pl and agentProlog/prolog/agentprolog_cli.pl remain a thin application facade over canonical rlm_cli behavior.

The application does not duplicate:

  • provider/model execution;
  • planning/recursion/subagents;
  • prompt/context compilation;
  • tools/capabilities/authority/effects;
  • history/memory;
  • verification/repair;
  • tracing/usage semantics.

Provider profiles and trusted operator configuration are application policy only.

Programmable configuration

agentprolog_config remains the single AgentProlog operator/configuration authority:

  • trusted executable XDG config.prolog;
  • JSON through the same resolution path;
  • generation-aware reload;
  • project trust gating;
  • frontend-visible projection;
  • secret-like setting rejection;
  • privileged atomic writes.

Configuration does not grant tool capability/effect authority and must remain compatible with generic scoped-state/project-policy boundaries.

Salvage rule from old PR #125

Do not revive #125 wholesale. Port only useful behavioral contracts with fresh TDD against current APIs.

Salvaged/already represented:

  • protocol/handshake versioning;
  • request/session correlation;
  • cancellation reaching canonical Prolog execution;
  • persistent process boundary;
  • focused harness integration checks.

Still to harden before leaving draft:

  • explicit post-negotiation child-process crash regression;
  • canonical runtime status/usage projection in the interactive harness;
  • exact-head CI/Nix evidence.

Explicitly do not restore:

  • the upstream DSH submodule/full source build;
  • custom DSH headless runner;
  • broad Cordis/profile disable patches;
  • private deepseek-harness.json settings;
  • any second provider/tool/history/planner/authority runtime.

Flake outputs

packages.prolog-rlm
packages.default            # reusable prolog-rlm library/package
packages.agentprolog
packages.deepseek-harness

apps.swipl
apps.agentprolog
apps.agentprolog-ui
apps.deepseek-harness

Verification status

  • architecture/issue state reconciled around #184;
  • canonical existing UI protocol reused rather than duplicated;
  • deterministic request/cancel lifecycle tests added;
  • bundled Go TUI switched off one-shot CLI stdout scraping;
  • real packaged Go <-> Prolog negotiation check added;
  • missing Go checksum lockfile identified from Actions and committed;
  • pin actual Nix vendorHash if the next fixed-output build requests it;
  • exact-head deterministic CI green;
  • exact-head Nix flake check green;
  • clean SWI pack + Tree-sitter lanes green;
  • live-provider lanes reviewed separately where credentials exist;
  • explicit post-negotiation process-crash regression;
  • canonical runtime status/usage surfaced in the interactive harness.

Do not weaken deterministic CI or claim old-head evidence for a moved head.

  • #184 — canonical bundled-product/harness migration epic
  • #183 — canonical permanent RLM context/prompt compiler ownership
  • #219 — retrieval/source-aware RLM work remains reusable runtime functionality
  • #141 — superseded standalone downstream-product architecture
  • #231 — old closure rationale superseded; useful generic status work remains valid
Closes #127. Implements the current in-repo product direction tracked by #184. ## Architectural correction — 2026-08-27 This PR is the active implementation base for the user-approved repository boundary: ```text lost-rob0t/prolog-rlm ├── prolog/ reusable RLM runtime/library ├── agentProlog/ bundled application + trusted operator config ├── harness/deepseek_tui/ bundled reference harness/frontend └── flake.nix library + application + harness outputs ``` There is **no separate downstream AgentProlog product owner** in the target architecture, and #184 is no longer an optional independent official-DSH product track. #141 is superseded. The library/application dependency rule remains strict: ```text harness -> prolog_agent_ui_v1 -> AgentProlog -> public prolog-rlm APIs ``` Nothing under reusable `prolog/` may import frontend/product code. One repository does not mean one monolithic runtime. ## Current implementation The branch now reuses the already-existing reusable `prolog_agent_ui_v1` + `prolog_agent_ui_facade` boundary rather than inventing a second harness transport. Added in this recovery: - `agentProlog/prolog/agentprolog_ui.pl` — application adapter over the canonical UI protocol; - `bin/agentprolog-ui.pl` — persistent UTF-8 NDJSON protocol server; - `run.submit` — starts one canonical `rlm_async` Future around the AgentProlog/RLM execution path; - `session.poll` — observes that Future without frontend-owned execution state; - `session.cancel` — cancels the canonical Future and linked child work; - deterministic deferred-Future tests for negotiation, request correlation, exactly-once terminal projection and cancellation; - `apps.agentprolog-ui` and packaged protocol smoke in the flake; - a persistent Go `prolog_agent_ui_v1` client for the bundled Bubble Tea v2 frontend; - `Esc` cancellation from the TUI to canonical Prolog execution; - `deepseek-harness --check` now performs a real Go -> packaged `agentprolog-ui` negotiation and clean shutdown; - a committed Go dependency lockfile for the harness. ## AgentProlog application `bin/agentprolog.pl` and `agentProlog/prolog/agentprolog_cli.pl` remain a thin application facade over canonical `rlm_cli` behavior. The application does not duplicate: - provider/model execution; - planning/recursion/subagents; - prompt/context compilation; - tools/capabilities/authority/effects; - history/memory; - verification/repair; - tracing/usage semantics. Provider profiles and trusted operator configuration are application policy only. ## Programmable configuration `agentprolog_config` remains the single AgentProlog operator/configuration authority: - trusted executable XDG `config.prolog`; - JSON through the same resolution path; - generation-aware reload; - project trust gating; - frontend-visible projection; - secret-like setting rejection; - privileged atomic writes. Configuration does not grant tool capability/effect authority and must remain compatible with generic scoped-state/project-policy boundaries. ## Salvage rule from old PR #125 Do not revive #125 wholesale. Port only useful behavioral contracts with fresh TDD against current APIs. Salvaged/already represented: - protocol/handshake versioning; - request/session correlation; - cancellation reaching canonical Prolog execution; - persistent process boundary; - focused harness integration checks. Still to harden before leaving draft: - explicit post-negotiation child-process crash regression; - canonical runtime status/usage projection in the interactive harness; - exact-head CI/Nix evidence. Explicitly do **not** restore: - the upstream DSH submodule/full source build; - custom DSH headless runner; - broad Cordis/profile disable patches; - private `deepseek-harness.json` settings; - any second provider/tool/history/planner/authority runtime. ## Flake outputs ```text packages.prolog-rlm packages.default # reusable prolog-rlm library/package packages.agentprolog packages.deepseek-harness apps.swipl apps.agentprolog apps.agentprolog-ui apps.deepseek-harness ``` ## Verification status - [x] architecture/issue state reconciled around #184; - [x] canonical existing UI protocol reused rather than duplicated; - [x] deterministic request/cancel lifecycle tests added; - [x] bundled Go TUI switched off one-shot CLI stdout scraping; - [x] real packaged Go <-> Prolog negotiation check added; - [x] missing Go checksum lockfile identified from Actions and committed; - [ ] pin actual Nix `vendorHash` if the next fixed-output build requests it; - [ ] exact-head deterministic CI green; - [ ] exact-head Nix flake check green; - [ ] clean SWI pack + Tree-sitter lanes green; - [ ] live-provider lanes reviewed separately where credentials exist; - [ ] explicit post-negotiation process-crash regression; - [ ] canonical runtime status/usage surfaced in the interactive harness. Do not weaken deterministic CI or claim old-head evidence for a moved head. ## Related - #184 — canonical bundled-product/harness migration epic - #183 — canonical permanent RLM context/prompt compiler ownership - #219 — retrieval/source-aware RLM work remains reusable runtime functionality - #141 — superseded standalone downstream-product architecture - #231 — old closure rationale superseded; useful generic status work remains valid
lost-rob0t commented 2026-08-25 00:18:35 +00:00 (Migrated from github.com)

Trusted configuration dependency from #183

The approved RLM context ADARD is now #183: https://github.com/lost-rob0t/prolog-rlm/issues/183

This config runtime is the natural trusted-host surface for future/default-profile controls such as enabling/disabling the bundled permanent RLM operating skills. Preserve the authority boundary from #183:

  • permanence/default activation is host policy, not skill-authored metadata;
  • global/per-skill disable is a trusted configuration action;
  • changing visibility never grants tool capability/effect authority;
  • config should point the canonical prompt compiler at policy, not create another skill/context selector.

No need to broaden this PR unless the approved implementation slice explicitly includes those settings; this comment records the dependency/ownership boundary.

Workflow gate

Normal ARARD flow is the default. Auto-RAGE is not the default and RAGE may begin only after an explicit design approval. Any new configuration semantics outside an approved design return to ARARD first.

## Trusted configuration dependency from #183 The approved RLM context ADARD is now **#183**: https://github.com/lost-rob0t/prolog-rlm/issues/183 This config runtime is the natural trusted-host surface for future/default-profile controls such as enabling/disabling the bundled permanent RLM operating skills. Preserve the authority boundary from #183: - permanence/default activation is host policy, not skill-authored metadata; - global/per-skill disable is a trusted configuration action; - changing visibility never grants tool capability/effect authority; - config should point the canonical prompt compiler at policy, not create another skill/context selector. No need to broaden this PR unless the approved implementation slice explicitly includes those settings; this comment records the dependency/ownership boundary. ### Workflow gate Normal **ARARD** flow is the default. **Auto-RAGE is not the default and RAGE may begin only after an explicit design approval.** Any new configuration semantics outside an approved design return to ARARD first.
lost-rob0t commented 2026-08-27 04:32:08 +00:00 (Migrated from github.com)

Superseded by the 2026-08-27 in-repo product decision

The earlier HOLD rationale in this comment depended on #141's standalone/downstream AgentProlog ownership. That architecture is now explicitly superseded by the user's correction in #184.

Current rule:

  • AgentProlog application/config and the bundled harness live in this repository;
  • reusable prolog/ remains independently consumable and must not import product/frontend code;
  • PR #132 is the active current-main implementation base;
  • #75/#77 still constrain generic scoped-state/project-policy semantics, but they are not a reason to move product composition to another repository;
  • useful old Harness behavior is salvaged into the in-repo product with fresh TDD, not by reviving PR #125.

Continue implementation under #184 and the updated PR body.

## Superseded by the 2026-08-27 in-repo product decision The earlier HOLD rationale in this comment depended on #141's standalone/downstream AgentProlog ownership. That architecture is now explicitly superseded by the user's correction in #184. Current rule: - AgentProlog application/config and the bundled harness live in **this repository**; - reusable `prolog/` remains independently consumable and must not import product/frontend code; - PR #132 is the active current-main implementation base; - #75/#77 still constrain generic scoped-state/project-policy semantics, but they are **not** a reason to move product composition to another repository; - useful old Harness behavior is salvaged into the in-repo product with fresh TDD, not by reviving PR #125. Continue implementation under #184 and the updated PR body.
nsaspy changed title from WIP: Bundle AgentProlog + DeepSeek harness in prolog-rlm to Bundle AgentProlog + DeepSeek harness in prolog-rlm 2026-08-27 20:02:08 +00:00
Owner

Repository-state correction — 2026-08-31

This PR is closed and unmerged and is no longer an active implementation base.

Canonical authority remains #184, whose body has now been reconciled to current repository state:

  • new AgentProlog/DSH harness work starts from current canonical main;
  • merged prolog_agent_ui_v1 + its facade are the frontend boundary to consume;
  • this PR is a salvage source only for useful tested contracts such as persistent process lifecycle, negotiation/versioning, request/session correlation, exactly-once terminal projection, cancellation propagation, and crash handling;
  • do not revive this branch wholesale and do not name it as the base of a new implementation branch;
  • PR #125 remains salvage-only for the same reason.

Fresh implementation should use TDD against current public/runtime/protocol APIs and keep frontend semantics out of DSH.

## Repository-state correction — 2026-08-31 This PR is **closed and unmerged** and is no longer an active implementation base. Canonical authority remains #184, whose body has now been reconciled to current repository state: - new AgentProlog/DSH harness work starts from current canonical `main`; - merged `prolog_agent_ui_v1` + its facade are the frontend boundary to consume; - this PR is a **salvage source only** for useful tested contracts such as persistent process lifecycle, negotiation/versioning, request/session correlation, exactly-once terminal projection, cancellation propagation, and crash handling; - do not revive this branch wholesale and do not name it as the base of a new implementation branch; - PR #125 remains salvage-only for the same reason. Fresh implementation should use TDD against current public/runtime/protocol APIs and keep frontend semantics out of DSH.
nsaspy closed this pull request 2026-09-04 14:37:22 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.