[P0][agentProlog-worker] Rebuild Prolog-RLM plugin UX + canonical context meter + bottom-row mode controls #18

Open
opened 2026-09-11 04:54:15 +00:00 by nsaspy · 0 comments
Owner

Operator directive

This is the first issue for the AgentProlog worker when a Machine Spirit worker slot is rotated into lost-rob0t/agentProlog.

The current Prolog-RLM/AgentProlog integration UI is not acceptable. It is visually poor, exposes the wrong information hierarchy, and does not make canonical Prolog-RLM context/mode state obvious or trustworthy.

Reuse existing architecture and mode work, especially #9, #7/#11, and the canonical upstream prolog_agent_ui_v1 / conversation/context contracts. Do not create frontend-owned mode or context truth.

Goal

Make the DeepSeek Harness AgentProlog/Prolog-RLM integration feel like a first-class native coding-agent control surface:

  • clean and unobtrusive;
  • Prolog-RLM actually owns/manages context;
  • important RLM state lives in the bottom row/status bar, not as a giant plugin panel;
  • one-click enable/disable;
  • one-click reasoning-mode selection/cycling;
  • live context meter;
  • slash commands for all reasoning modes;
  • full Playwright, end-to-end, and live LLM verification through llm.starintel.actor.

A — Fix context ownership first

The UI must not fake a context meter over DeepSeek Harness-local history if Prolog-RLM is supposed to be the context authority.

Trace the complete live path:

DSH user turn
-> AgentProlog AgentFactory/plugin
-> persistent bridge/sidecar
-> canonical Prolog-RLM conversation/runtime
-> prompt/context compiler
-> provider request

Prove which layer currently owns:

  • conversation/history;
  • retained/summarized context;
  • prompt/context selection;
  • context-window budget;
  • current used/remaining context estimate;
  • compaction/truncation decisions;
  • requested/effective reasoning mode.

Required correction:

  • Prolog-RLM is authoritative for the managed conversation/context used for inference.
  • DSH session/events remain a presentation projection and must not silently become a second independent history/context authority.
  • normal turns, reconnect/resume, mode changes, cancellation and tool activity preserve the same canonical conversation identity where supported.
  • if the generic runtime lacks a required context-inspection seam, open/fix the smallest upstream prolog-rlm issue rather than implementing a fake AgentProlog-only context engine.
  • no duplicated compaction/summarization policy in the frontend plugin.

Context inspection contract

Expose a bounded typed state sufficient for UI, ideally via existing public protocol/facade semantics or the smallest upstream extension:

context window limit
estimated/actual context used
remaining context
usage percentage
last context-management action
conversation/session identity
requested mode
effective mode

Do not dump entire hidden prompts/context into the UI just to calculate a meter.

B — Replace the ugly plugin presentation

The normal AgentProlog experience should not be a large intrusive Prolog-RLM panel.

Move normal RLM controls/status to a compact bottom row/status bar integrated with the official Harness UI.

Target bottom-row items:

1. RLM enable/disable control

Compact state such as:

RLM: ON
RLM: OFF

Requirements:

  • clearly shows canonical state;
  • keyboard reachable;
  • toggling is explicit and deterministic;
  • OFF means the documented non-RLM path, not half-enabled ambiguous behavior;
  • if runtime architecture cannot safely support hot enable/disable for an active session, define the smallest truthful session-boundary behavior instead of pretending.

2. Mode control

Compact control showing requested/effective mode, e.g.:

MODE: DIRECT
MODE: SYMBOLIC
MODE: SYMBOLIC-RECURSIVE
MODE: AUTO→SYMBOLIC

Clicking should open/cycle/select among:

  • direct
  • symbolic
  • symbolic-recursive
  • auto

Use the canonical mode state from #9/upstream. Do not add a UI-local mode variable.

3. Context meter

Compact bottom-row meter, e.g.:

CTX 42%  132k/315k

or another readable equivalent.

Requirements:

  • value comes from Prolog-RLM context/runtime inspection;
  • updates after turns/context-management actions;
  • hover/click can expose bounded detail such as remaining tokens and last compaction action;
  • color/state thresholds may indicate healthy/warning/critical without becoming visual noise;
  • never fabricate precision not supplied by the runtime; clearly distinguish estimates if exact provider tokenization is unavailable.

4. Optional compact runtime indicator

If useful and already available canonically, show one compact status item for busy/idle/error/connecting. Do not turn the bottom row into a telemetry dashboard.

C — Slash commands

Implement/finish the canonical mode commands in the Harness input path:

/direct
/symbolic
/symbolic-recursive
/auto

Requirements:

  • same canonical transition path as the bottom-row control;
  • no second slash-command-owned mode state;
  • command result gives concise confirmation including requested/effective mode;
  • mode survives subsequent normal turns until changed;
  • invalid or unsupported transition fails visibly and structurally;
  • slash mode changes preserve conversation/context identity and do not silently reset context.

Also provide discoverable slash completion/help if the official Harness command surface supports it cleanly.

D — Visual/interaction direction

Keep the official Harness UI as the main shell. AgentProlog should feel integrated rather than bolted on.

Requirements:

  • remove/reduce the oversized/ugly plugin surface used for ordinary operation;
  • bottom-row controls align with surrounding Harness spacing/typography;
  • compact icons/text with useful tooltips;
  • clear focus/hover/disabled/error states;
  • keyboard navigation works;
  • narrow viewport remains usable;
  • no giant cards, debug dumps, neon clutter, or duplicate sidebars just to expose RLM state;
  • deeper Prolog/runtime inspection can remain in an optional detailed view, but normal operation belongs in the bottom row.

E — Playwright + real E2E gate

Every user-visible behavior in this issue requires Playwright coverage and end-to-end coverage. Unit/component tests are necessary but not sufficient.

Playwright must exercise the actual built official Harness + out-of-tree AgentProlog plugin, not a fake standalone page.

Minimum Playwright scenarios:

  1. load the real AgentProlog Harness profile;
  2. confirm bottom-row RLM state is visible;
  3. toggle RLM OFF/ON and verify canonical state reflected after reload/reconnect as designed;
  4. select every reasoning mode through UI controls;
  5. select every reasoning mode through slash commands;
  6. verify UI mode display matches canonical requested/effective state;
  7. submit turns and verify context meter changes from runtime-reported state;
  8. verify mode changes do not reset the canonical conversation/context identity;
  9. exercise reconnect/reload and verify state reconstruction;
  10. exercise context warning/high-usage presentation with a deterministic fixture/runtime seam;
  11. verify keyboard navigation/focus of bottom-row controls;
  12. verify narrow viewport does not hide or corrupt controls;
  13. capture screenshots/video/trace on failure.

End-to-end integration must include the real chain:

Harness UI
-> AgentProlog Cordis plugin / AgentFactory
-> persistent sidecar
-> Prolog-RLM managed conversation/context
-> provider call
-> canonical response/event projection
-> Harness UI

No test may declare success merely because the DOM changed while the sidecar/runtime failed.

F — Live LLM gate via llm.starintel.actor

In addition to hermetic/mock E2E, run an opt-in but mandatory-when-requested live integration suite against the operator's llm.starintel.actor endpoint.

Use the existing provider/config/auth path; do not commit credentials, tokens, internal auth headers, or secrets.

Live test must prove at minimum:

  1. Harness starts with AgentProlog plugin and real Prolog-RLM sidecar;
  2. one direct turn reaches llm.starintel.actor and returns a real model result;
  3. one symbolic turn reaches the same live provider through canonical Prolog-RLM routing;
  4. one symbolic-recursive turn executes when supported/configured and reports real canonical state;
  5. /auto selects an effective mode and completes a live turn;
  6. context usage/state returned after live turns updates the bottom-row meter;
  7. mode changes do not create a second independent conversation/history;
  8. reconnect/resume continues the same canonical managed conversation where supported;
  9. provider failure/timeout is surfaced as failure, never rendered as successful model output;
  10. safe evidence records endpoint identity (llm.starintel.actor), model/provider route, session/run IDs, mode, context metrics, status and timestamps without logging credentials or raw secrets.

Live-test configuration law

  • Live tests are opt-in for ordinary contributor runs so offline development remains possible.
  • CI/manual validation that explicitly requests the live lane must hard-fail if required configuration is missing; never silently downgrade to mocks.
  • The worker may not mark this issue accepted without a recent successful live llm.starintel.actor validation receipt from the candidate head.

G — Testing standard for AgentProlog going forward

This issue establishes a product rule for subsequent AgentProlog UI/integration work:

unit/component tests
+ protocol/integration tests
+ Playwright for user-facing UI
+ real end-to-end bridge/runtime tests
+ live llm.starintel.actor validation when the change touches inference/context/modes/provider flow

No UI-only fake test is sufficient for behavior whose truth lives in Prolog-RLM.

Acceptance

  • Prolog-RLM, not Harness-local UI state, owns inference context/history management.
  • Typed context inspection is available without exposing giant hidden prompts.
  • Normal Prolog-RLM UI is compact bottom-row controls/status rather than the current ugly panel.
  • RLM enable/disable control works and reflects canonical state.
  • Mode control supports direct, symbolic, symbolic-recursive, and auto through the canonical #9/upstream path.
  • /direct, /symbolic, /symbolic-recursive, /auto work from the normal input surface.
  • Context meter reflects real Prolog-RLM state and updates after turns/context-management events.
  • Mode changes preserve canonical conversation/context identity.
  • Reload/reconnect reconstructs the same canonical state rather than frontend-local guesses.
  • Playwright covers all main user interactions on the real built Harness integration.
  • Real E2E covers UI -> plugin -> sidecar -> Prolog-RLM -> provider -> UI.
  • Live LLM validation through llm.starintel.actor passes on the candidate head.
  • Live test fails closed when explicitly requested but not correctly configured.
  • Screenshots/traces from Playwright and a redacted live-test receipt are attached/referenced before acceptance.

Worker law

When the Machine Spirit completion gate rotates a worker into AgentProlog, claim this issue first. Reconcile #9 and any active PRs before coding so mode work is reused rather than duplicated.

## Operator directive This is the **first issue for the AgentProlog worker** when a Machine Spirit worker slot is rotated into `lost-rob0t/agentProlog`. The current Prolog-RLM/AgentProlog integration UI is not acceptable. It is visually poor, exposes the wrong information hierarchy, and does not make canonical Prolog-RLM context/mode state obvious or trustworthy. Reuse existing architecture and mode work, especially #9, #7/#11, and the canonical upstream `prolog_agent_ui_v1` / conversation/context contracts. Do **not** create frontend-owned mode or context truth. ## Goal Make the DeepSeek Harness AgentProlog/Prolog-RLM integration feel like a first-class native coding-agent control surface: - clean and unobtrusive; - Prolog-RLM actually owns/manages context; - important RLM state lives in the **bottom row/status bar**, not as a giant plugin panel; - one-click enable/disable; - one-click reasoning-mode selection/cycling; - live context meter; - slash commands for all reasoning modes; - full Playwright, end-to-end, and **live LLM** verification through `llm.starintel.actor`. ## A — Fix context ownership first The UI must not fake a context meter over DeepSeek Harness-local history if Prolog-RLM is supposed to be the context authority. Trace the complete live path: ```text DSH user turn -> AgentProlog AgentFactory/plugin -> persistent bridge/sidecar -> canonical Prolog-RLM conversation/runtime -> prompt/context compiler -> provider request ``` Prove which layer currently owns: - conversation/history; - retained/summarized context; - prompt/context selection; - context-window budget; - current used/remaining context estimate; - compaction/truncation decisions; - requested/effective reasoning mode. Required correction: - Prolog-RLM is authoritative for the managed conversation/context used for inference. - DSH session/events remain a presentation projection and must not silently become a second independent history/context authority. - normal turns, reconnect/resume, mode changes, cancellation and tool activity preserve the same canonical conversation identity where supported. - if the generic runtime lacks a required context-inspection seam, open/fix the smallest upstream `prolog-rlm` issue rather than implementing a fake AgentProlog-only context engine. - no duplicated compaction/summarization policy in the frontend plugin. ### Context inspection contract Expose a bounded typed state sufficient for UI, ideally via existing public protocol/facade semantics or the smallest upstream extension: ```text context window limit estimated/actual context used remaining context usage percentage last context-management action conversation/session identity requested mode effective mode ``` Do not dump entire hidden prompts/context into the UI just to calculate a meter. ## B — Replace the ugly plugin presentation The normal AgentProlog experience should **not** be a large intrusive Prolog-RLM panel. Move normal RLM controls/status to a compact **bottom row/status bar** integrated with the official Harness UI. Target bottom-row items: ### 1. RLM enable/disable control Compact state such as: ```text RLM: ON RLM: OFF ``` Requirements: - clearly shows canonical state; - keyboard reachable; - toggling is explicit and deterministic; - OFF means the documented non-RLM path, not half-enabled ambiguous behavior; - if runtime architecture cannot safely support hot enable/disable for an active session, define the smallest truthful session-boundary behavior instead of pretending. ### 2. Mode control Compact control showing requested/effective mode, e.g.: ```text MODE: DIRECT MODE: SYMBOLIC MODE: SYMBOLIC-RECURSIVE MODE: AUTO→SYMBOLIC ``` Clicking should open/cycle/select among: - `direct` - `symbolic` - `symbolic-recursive` - `auto` Use the canonical mode state from #9/upstream. Do not add a UI-local mode variable. ### 3. Context meter Compact bottom-row meter, e.g.: ```text CTX 42% 132k/315k ``` or another readable equivalent. Requirements: - value comes from Prolog-RLM context/runtime inspection; - updates after turns/context-management actions; - hover/click can expose bounded detail such as remaining tokens and last compaction action; - color/state thresholds may indicate healthy/warning/critical without becoming visual noise; - never fabricate precision not supplied by the runtime; clearly distinguish estimates if exact provider tokenization is unavailable. ### 4. Optional compact runtime indicator If useful and already available canonically, show one compact status item for busy/idle/error/connecting. Do not turn the bottom row into a telemetry dashboard. ## C — Slash commands Implement/finish the canonical mode commands in the Harness input path: ```text /direct /symbolic /symbolic-recursive /auto ``` Requirements: - same canonical transition path as the bottom-row control; - no second slash-command-owned mode state; - command result gives concise confirmation including requested/effective mode; - mode survives subsequent normal turns until changed; - invalid or unsupported transition fails visibly and structurally; - slash mode changes preserve conversation/context identity and do not silently reset context. Also provide discoverable slash completion/help if the official Harness command surface supports it cleanly. ## D — Visual/interaction direction Keep the official Harness UI as the main shell. AgentProlog should feel integrated rather than bolted on. Requirements: - remove/reduce the oversized/ugly plugin surface used for ordinary operation; - bottom-row controls align with surrounding Harness spacing/typography; - compact icons/text with useful tooltips; - clear focus/hover/disabled/error states; - keyboard navigation works; - narrow viewport remains usable; - no giant cards, debug dumps, neon clutter, or duplicate sidebars just to expose RLM state; - deeper Prolog/runtime inspection can remain in an optional detailed view, but normal operation belongs in the bottom row. ## E — Playwright + real E2E gate **Every user-visible behavior in this issue requires Playwright coverage and end-to-end coverage.** Unit/component tests are necessary but not sufficient. Playwright must exercise the actual built official Harness + out-of-tree AgentProlog plugin, not a fake standalone page. Minimum Playwright scenarios: 1. load the real AgentProlog Harness profile; 2. confirm bottom-row RLM state is visible; 3. toggle RLM OFF/ON and verify canonical state reflected after reload/reconnect as designed; 4. select every reasoning mode through UI controls; 5. select every reasoning mode through slash commands; 6. verify UI mode display matches canonical requested/effective state; 7. submit turns and verify context meter changes from runtime-reported state; 8. verify mode changes do not reset the canonical conversation/context identity; 9. exercise reconnect/reload and verify state reconstruction; 10. exercise context warning/high-usage presentation with a deterministic fixture/runtime seam; 11. verify keyboard navigation/focus of bottom-row controls; 12. verify narrow viewport does not hide or corrupt controls; 13. capture screenshots/video/trace on failure. End-to-end integration must include the real chain: ```text Harness UI -> AgentProlog Cordis plugin / AgentFactory -> persistent sidecar -> Prolog-RLM managed conversation/context -> provider call -> canonical response/event projection -> Harness UI ``` No test may declare success merely because the DOM changed while the sidecar/runtime failed. ## F — Live LLM gate via llm.starintel.actor In addition to hermetic/mock E2E, run an **opt-in but mandatory-when-requested live integration suite** against the operator's `llm.starintel.actor` endpoint. Use the existing provider/config/auth path; do not commit credentials, tokens, internal auth headers, or secrets. Live test must prove at minimum: 1. Harness starts with AgentProlog plugin and real Prolog-RLM sidecar; 2. one `direct` turn reaches `llm.starintel.actor` and returns a real model result; 3. one `symbolic` turn reaches the same live provider through canonical Prolog-RLM routing; 4. one `symbolic-recursive` turn executes when supported/configured and reports real canonical state; 5. `/auto` selects an effective mode and completes a live turn; 6. context usage/state returned after live turns updates the bottom-row meter; 7. mode changes do not create a second independent conversation/history; 8. reconnect/resume continues the same canonical managed conversation where supported; 9. provider failure/timeout is surfaced as failure, never rendered as successful model output; 10. safe evidence records endpoint identity (`llm.starintel.actor`), model/provider route, session/run IDs, mode, context metrics, status and timestamps without logging credentials or raw secrets. ### Live-test configuration law - Live tests are opt-in for ordinary contributor runs so offline development remains possible. - CI/manual validation that explicitly requests the live lane must **hard-fail** if required configuration is missing; never silently downgrade to mocks. - The worker may not mark this issue accepted without a recent successful live `llm.starintel.actor` validation receipt from the candidate head. ## G — Testing standard for AgentProlog going forward This issue establishes a product rule for subsequent AgentProlog UI/integration work: ```text unit/component tests + protocol/integration tests + Playwright for user-facing UI + real end-to-end bridge/runtime tests + live llm.starintel.actor validation when the change touches inference/context/modes/provider flow ``` No UI-only fake test is sufficient for behavior whose truth lives in Prolog-RLM. ## Acceptance - [ ] Prolog-RLM, not Harness-local UI state, owns inference context/history management. - [ ] Typed context inspection is available without exposing giant hidden prompts. - [ ] Normal Prolog-RLM UI is compact bottom-row controls/status rather than the current ugly panel. - [ ] RLM enable/disable control works and reflects canonical state. - [ ] Mode control supports `direct`, `symbolic`, `symbolic-recursive`, and `auto` through the canonical #9/upstream path. - [ ] `/direct`, `/symbolic`, `/symbolic-recursive`, `/auto` work from the normal input surface. - [ ] Context meter reflects real Prolog-RLM state and updates after turns/context-management events. - [ ] Mode changes preserve canonical conversation/context identity. - [ ] Reload/reconnect reconstructs the same canonical state rather than frontend-local guesses. - [ ] Playwright covers all main user interactions on the real built Harness integration. - [ ] Real E2E covers UI -> plugin -> sidecar -> Prolog-RLM -> provider -> UI. - [ ] Live LLM validation through `llm.starintel.actor` passes on the candidate head. - [ ] Live test fails closed when explicitly requested but not correctly configured. - [ ] Screenshots/traces from Playwright and a redacted live-test receipt are attached/referenced before acceptance. ## Worker law When the Machine Spirit completion gate rotates a worker into AgentProlog, **claim this issue first**. Reconcile #9 and any active PRs before coding so mode work is reused rather than duplicated.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/agentProlog#18
No description provided.