fix: harden planner context protocol #278

Closed
lost-rob0t wants to merge 4 commits from rage/277-planner-protocol-context into main
lost-rob0t commented 2026-08-27 17:19:33 +00:00 (Migrated from github.com)

Summary

  • Add exact typed context and tool envelopes to the mandatory root-planner protocol.
  • Give parse and structural retries one bounded latest-error diagnostic without echoing candidate/provider output.
  • Add a real OpenRouter acceptance test that uses opaque context and the registered confined project_read tool without a fixed plan or planner_instruction.

Runtime invariant

The model may select only the typed operations granted by the host; Prolog validates capabilities, structure, budgets, and registered-tool authority before execution. Live assertions inspect runtime transitions and bound evidence values independently of model prose.

Non-goals

  • No widening of model authority or capability possession.
  • No product-specific Auto-Dig behavior in the reusable runtime.
  • The separate task-framing plus retrieved-evidence composition gap remains outside this slice.

Verification

  • swipl -q -s test/check_runtime.pl
  • swipl -q -s test/load_all.pl
  • swipl -q -s test/run_tests.pl (996/996)
  • swipl -q -s benchmark/run.pl -- deterministic (16/16)
  • swipl -q -s benchmark/run.pl -- deep-experiment (15/15)
  • swipl -q -s bin/prolog-rlm.pl -- demo --json
  • swipl -q -s test/live_planner_context_openrouter_test.pl -g "run_tests(live_planner_context_openrouter),halt" (1/1 against OpenRouter)
  • git diff --check

Refs #277

## Summary - Add exact typed `context` and `tool` envelopes to the mandatory root-planner protocol. - Give parse and structural retries one bounded latest-error diagnostic without echoing candidate/provider output. - Add a real OpenRouter acceptance test that uses opaque context and the registered confined `project_read` tool without a fixed plan or `planner_instruction`. ## Runtime invariant The model may select only the typed operations granted by the host; Prolog validates capabilities, structure, budgets, and registered-tool authority before execution. Live assertions inspect runtime transitions and bound evidence values independently of model prose. ## Non-goals - No widening of model authority or capability possession. - No product-specific Auto-Dig behavior in the reusable runtime. - The separate task-framing plus retrieved-evidence composition gap remains outside this slice. ## Verification - `swipl -q -s test/check_runtime.pl` - `swipl -q -s test/load_all.pl` - `swipl -q -s test/run_tests.pl` (996/996) - `swipl -q -s benchmark/run.pl -- deterministic` (16/16) - `swipl -q -s benchmark/run.pl -- deep-experiment` (15/15) - `swipl -q -s bin/prolog-rlm.pl -- demo --json` - `swipl -q -s test/live_planner_context_openrouter_test.pl -g "run_tests(live_planner_context_openrouter),halt"` (1/1 against OpenRouter) - `git diff --check` Refs #277
Owner

RAGE checkpoint on exact head 93f69adeadb83b1b946c6250d1a4597eeef2428a after full live backlog/ownership reconciliation.

Adversarial review: GO on design, HOLD on completion. The slice keeps planner syntax as inert protocol data; capability/authority/budget enforcement remains host-owned, repair diagnostics are bounded and do not echo rejected provider output, capability/budget denials remain non-repairable, and the registry-tool result-envelope validation closes an execution-time structural failure without granting new callable authority. No downstream product logic is added.

Exact-head evidence currently returned by GitHub:

  • deterministic CI job: success;
  • Nix flake: success;
  • Clean SWI pack install: success;
  • Tree-sitter FFI: success;
  • REAL OpenRouter: core + structured repair + benchmark passed; depth 0/1/2 still in progress;
  • pinned Paid OpenRouter: core + structured repair + benchmark passed; depth 0/1/2 still in progress.

No reviews, PR conversation comments, or unresolved review threads existed before this checkpoint. Do not reuse this partial evidence as a full green gate; wait for both credential-backed recursion + CLI-smoke lanes to complete on this same immutable head. Canonical main is currently 7165680e31fa67053f19887026cd00e4e59ed0aa.

RAGE checkpoint on exact head `93f69adeadb83b1b946c6250d1a4597eeef2428a` after full live backlog/ownership reconciliation. Adversarial review: **GO on design, HOLD on completion**. The slice keeps planner syntax as inert protocol data; capability/authority/budget enforcement remains host-owned, repair diagnostics are bounded and do not echo rejected provider output, capability/budget denials remain non-repairable, and the registry-tool result-envelope validation closes an execution-time structural failure without granting new callable authority. No downstream product logic is added. Exact-head evidence currently returned by GitHub: - deterministic CI job: success; - Nix flake: success; - Clean SWI pack install: success; - Tree-sitter FFI: success; - REAL OpenRouter: core + structured repair + benchmark passed; depth 0/1/2 still in progress; - pinned Paid OpenRouter: core + structured repair + benchmark passed; depth 0/1/2 still in progress. No reviews, PR conversation comments, or unresolved review threads existed before this checkpoint. Do not reuse this partial evidence as a full green gate; wait for both credential-backed recursion + CLI-smoke lanes to complete on this same immutable head. Canonical `main` is currently `7165680e31fa67053f19887026cd00e4e59ed0aa`.
nsaspy closed this pull request 2026-08-28 03:22:03 +00:00
Owner

Superseded by #286, which carries the full rebased prolog-rlm-v1 consolidation, provider-native direct runtime, cache/cost policy, deterministic evidence, and remaining shared-session work. Issues #277 and #279 remain open pending exact-head acceptance.

Superseded by #286, which carries the full rebased prolog-rlm-v1 consolidation, provider-native direct runtime, cache/cost policy, deterministic evidence, and remaining shared-session work. Issues #277 and #279 remain open pending exact-head acceptance.

Pull request closed

Sign in to join this conversation.
No description provided.