Wire compiler visibility contract into root planner #216

Merged
lost-rob0t merged 11 commits from rage/176-root-planner-tool-projection into main 2026-08-26 07:06:42 +00:00
lost-rob0t commented 2026-08-25 17:11:46 +00:00 (Migrated from github.com)

Advances #176.

RAGE slice

TDD-first from canonical main 49d86f88730b4a0f5dc4a7cf300b8f09ef5845b0. Current exact candidate head is 774454dba55855932f672f2de23b9e65936ede99.

The production defect was the root planner receiving capability-filtered raw tool_discover/2 schemas even though rlm_prompt_compiler already owned contextual activation and final packed tool-schema filtering.

Realization

  • split trusted executable bindings from provider-visible schema projection in rlm_completion;
  • keep the full capability-filtered RuntimeTools unchanged for plan_run / authority / effects;
  • import registry schemas into an ephemeral rlm_prompt_compiler catalog and compile the current query through the existing symbolic selector;
  • default prompt_compile_mode(compiled) exposes only compiler-active schemas;
  • prompt_compile_mode(all_tools) remains compatibility mode but uses the same compiler path;
  • invalid prompt compile modes fail closed before planner dispatch as structured kind:invalid_prompt_compile_mode;
  • planner wording now says Active tool schemas rather than Registered tool schemas;
  • ephemeral compiler catalogs are destroyed with setup_call_cleanup/3;
  • document the public compiler visibility/authority contract in docs/prompt-compiler.md and reconcile docs/prolog-agent-roadmap.md so downstream readiness matches the candidate runtime.

No new selector, tool registry, authority layer, effect path, scheduler, or downstream product logic was introduced.

TDD contract

Negative behavior is asserted as expected runtime behavior while required CI remains green. In particular, invalid mode tests assert the structured failure and zero planner dispatch rather than intentionally failing CI.

Production-path tests prove:

  • capability-denied registry schemas remain hidden under all_tools;
  • contextual compiled mode exposes the relevant schema and hides an unrelated capability-allowed schema in the exact captured planner request;
  • all_tools preserves compatibility visibility;
  • invalid trusted mode fails before planner invocation;
  • planner payload uses Active tool schemas and does not regress to Registered tool schemas.

Exact-head verification

Exact head 774454dba55855932f672f2de23b9e65936ede99 is green for all returned required workflows:

  • canonical CI deterministic unit/load suite;
  • deterministic benchmark/conformance suite;
  • deterministic deep-recursion experiment;
  • credential-free CLI/trace smoke;
  • fresh-process persistent graph and artifact restart checks;
  • whitespace checks;
  • credential-backed REAL OpenRouter core, structured repair, benchmark, depth 0/1/2 recursion, and CLI smoke;
  • pinned Paid OpenRouter equivalents;
  • Nix flake;
  • clean SWI pack install;
  • Tree-sitter FFI.

Current PR review submissions, review threads, and conversation comments are empty; the PR is non-draft and mergeable on this head.

Remaining #176 scope

This PR is the smallest production root-planner projection slice and does not close the epic. Follow-up #176 work still includes the broader host-owned catalog lifecycle, prompt-projection observability/fingerprint exposure, lifecycle regressions for host/ephemeral catalogs, MCP/project-instruction/managed-context compiler adoption, and research-record closure against the now-real implementation.

Direct trusted tools(...) bindings remain execution inputs rather than an implicit provider-visible schema catalog; that boundary is documented in docs/prompt-compiler.md.

This PR also does not touch #175/#212 deadline policy, #211/#213 result projection, Agent Zero product composition, or AgentProlog product integration.

Advances #176. ## RAGE slice TDD-first from canonical `main` `49d86f88730b4a0f5dc4a7cf300b8f09ef5845b0`. Current exact candidate head is `774454dba55855932f672f2de23b9e65936ede99`. The production defect was the root planner receiving capability-filtered raw `tool_discover/2` schemas even though `rlm_prompt_compiler` already owned contextual activation and final packed tool-schema filtering. ## Realization - split trusted executable bindings from provider-visible schema projection in `rlm_completion`; - keep the full capability-filtered `RuntimeTools` unchanged for `plan_run` / authority / effects; - import registry schemas into an ephemeral `rlm_prompt_compiler` catalog and compile the current query through the existing symbolic selector; - default `prompt_compile_mode(compiled)` exposes only compiler-active schemas; - `prompt_compile_mode(all_tools)` remains compatibility mode but uses the same compiler path; - invalid prompt compile modes fail closed before planner dispatch as structured `kind:invalid_prompt_compile_mode`; - planner wording now says `Active tool schemas` rather than `Registered tool schemas`; - ephemeral compiler catalogs are destroyed with `setup_call_cleanup/3`; - document the public compiler visibility/authority contract in `docs/prompt-compiler.md` and reconcile `docs/prolog-agent-roadmap.md` so downstream readiness matches the candidate runtime. No new selector, tool registry, authority layer, effect path, scheduler, or downstream product logic was introduced. ## TDD contract Negative behavior is asserted as expected runtime behavior while required CI remains green. In particular, invalid mode tests assert the structured failure and zero planner dispatch rather than intentionally failing CI. Production-path tests prove: - capability-denied registry schemas remain hidden under `all_tools`; - contextual `compiled` mode exposes the relevant schema and hides an unrelated capability-allowed schema in the exact captured planner request; - `all_tools` preserves compatibility visibility; - invalid trusted mode fails before planner invocation; - planner payload uses `Active tool schemas` and does not regress to `Registered tool schemas`. ## Exact-head verification Exact head `774454dba55855932f672f2de23b9e65936ede99` is green for all returned required workflows: - canonical CI deterministic unit/load suite; - deterministic benchmark/conformance suite; - deterministic deep-recursion experiment; - credential-free CLI/trace smoke; - fresh-process persistent graph and artifact restart checks; - whitespace checks; - credential-backed REAL OpenRouter core, structured repair, benchmark, depth 0/1/2 recursion, and CLI smoke; - pinned Paid OpenRouter equivalents; - Nix flake; - clean SWI pack install; - Tree-sitter FFI. Current PR review submissions, review threads, and conversation comments are empty; the PR is non-draft and mergeable on this head. ## Remaining #176 scope This PR is the smallest production root-planner projection slice and **does not close the epic**. Follow-up #176 work still includes the broader host-owned catalog lifecycle, prompt-projection observability/fingerprint exposure, lifecycle regressions for host/ephemeral catalogs, MCP/project-instruction/managed-context compiler adoption, and research-record closure against the now-real implementation. Direct trusted `tools(...)` bindings remain execution inputs rather than an implicit provider-visible schema catalog; that boundary is documented in `docs/prompt-compiler.md`. This PR also does not touch #175/#212 deadline policy, #211/#213 result projection, Agent Zero product composition, or AgentProlog product integration.
Sign in to join this conversation.
No description provided.