[EPIC] Wire prompt compiler tool projection into the real rlm_completion planner surface #176
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#176
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
Make
rlm_prompt_compileractually control the tool schemas the root LLM sees in the productionrlm_completionpath, while keeping the full trusted runtime bindings available for execution and authority checks.This closes the current gap between:
and:
The implementation must preserve the architectural rule:
No new tool registry or model-facing interface should be created.
Research: current main behavior
1.
prolog/rlm_prompt_compiler.plis implementedThe compiler already provides:
It produces a structured
compiled_context{...}containing selected/rejected units, context units, tool schemas, token ledger, active units, reasons and a fingerprint.It performs bounded evidence-driven selection, dependency closure, capability/discovery filtering, conflicts/supersession, and shared context packing.
research/RLM-RESEARCH-010-symbolic-prompt-compiler.organdresearch/RLM-RESEARCH-011-managed-context-tool-discovery.orgdefine this as the provider-visible projection boundary.2. Current
rlm_completionbypasses itIn
prolog/rlm_completion.pl,completion_with_handle/...currently does:and
runtime_tools/4currently resolves registry schemas with:Therefore every schema returned by the runtime registry is still handed directly to the root planner when a registry is supplied.
That means prompt-compiler contextual activation/deactivation does not yet govern the actual production planner tool view.
3.
planner_prompt/7serializes those schemas directlyThe current planner prompt contains:
using the raw
ToolSchemasreturned bytool_discover/2.So the actual LLM-facing tool projection today is still owned by
rlm_completion, not byrlm_prompt_compiler.4. Compiler tests are currently isolated
Repository search of
prompt_compile/4shows compiler implementation/research/tests and other schema work, but no productionrlm_completioncall site on current main.The compiler test
context_deactivation_does_not_unregister_runtime_toolcorrectly proves that a tool may disappear from compiled context without runtime unregistering, but the production completion path does not yet consume that compiled tool list.5. Existing research already called for this integration
RLM-RESEARCH-011-managed-context-tool-discovery.orgexplicitly states the intended direction:This epic implements that already-researched contract rather than inventing a new architecture.
Design contract
Split the current ambiguous
runtime_toolsresponsibility into two explicit concepts:Conceptually:
Selection does not unregister tools. Selection does not grant authority. A tool hidden from the planner may remain registered and executable by trusted host code; a tool visible to the planner still must pass normal capability/schema/preflight/authority/effect checks when invoked.
Completion API / options
Do not add a second completion API.
Use existing
rlm_completion(..., Options, ...)configuration.Add/normalize compiler-related host options conceptually as:
Exact option naming may follow current conventions, but ownership must remain host-side.
Default mode
Target default after migration:
all_toolsremains an explicit compatibility/debug/benchmark mode as already specified by RLM-RESEARCH-010/011.If backwards-compatibility risk requires a staged rollout, implementation may temporarily require an explicit compiler option for one release/slice, but the issue must document that staging and include a test proving the intended eventual
compileddefault. Do not leave two indefinite ambiguous defaults.Catalog ownership
Preferred behavior:
prompt_catalog(Catalog), use it directly;tool_registry(Registry)exists, build a bounded ephemeral catalog projection from that registry for the completion call usingprompt_catalog_register_tool_registry/4;A long-lived host catalog remains preferable when Skills/instructions/MCP/resources need to coexist with tool metadata across turns.
Do not store executable handlers inside the prompt catalog.
Exact
rlm_completionflowRefactor
completion_with_handle/...so the order becomes conceptually:The important invariant is:
Do not replace
RuntimeToolswith only selected tools unless a separate authority design explicitly requires that later.Exact implementation files
1.
prolog/rlm_completion.plA. Imports
Import/use
rlm_prompt_compilerthrough the module-qualified style consistent with current architecture.B. Split
runtime_tools/4Current predicate:
currently conflates executable tools and model-visible schemas.
Refactor into explicit responsibilities, conceptually:
or equivalent names following current conventions.
runtime_tool_bindingsowns the full trusted execution list.provider_tool_projectionowns catalog creation/import/compile/render and returns at least:Do not pass raw handlers/callables into the compiler projection.
C. Compile input
The minimum compile input is the current normalized user
Query.Preferred shape:
For the first integration slice,
TrustedSignals,Needs,HostSelected, andHostDeniedmay default empty unless already available in Options.Expose host options for these only if they can be cleanly normalized through the existing compiler API. Do not parse arbitrary model output into trusted
selected/deniedfields.D. Compiler mode
For
compiledmode callprompt_compile/4normally.For
all_tools, use the compiler's existing compatibility mode instead of bypassing the compiler and directly callingtool_discover/2for planner exposure. This keeps one projection path and makes comparison deterministic.E. Planner prompt
Change
planner_prompt/...so it no longer labels raw registry results as:Use language that reflects actual model visibility, e.g.:
Add compiler-rendered text in one explicit section, e.g.:
Do not serialize the same full tool schema twice. If
prompt_render/3already includes full schema text inCompiledText, decide one canonical representation for the planner path:Active tool schemasfield in the typed-planner prompt.The token ledger must charge the actual representation used. Do not count one representation and render another.
F. Completion result observability
Add non-secret compiler metadata to the completion result/trajectory if a stable extension point exists:
Do not expose rejected hidden tool schemas or host-only catalog internals by default.
This makes it possible to prove which projection the planner actually received.
G. Cleanup
If completion creates an ephemeral prompt catalog, wrap it in
setup_call_cleanup/3and destroy it on success, failure, timeout, cancellation, or planner error.Host-owned catalogs supplied through Options must never be destroyed by completion cleanup.
2.
prolog/rlm_prompt_compiler.plA. Provider tool schemas must correspond to active packed units
Audit
selected_tool_schemas/2,active_units_from_pack/2, andprompt_render/3together.Current
tool_schemasare derived from pre-packSelectedEntries, whileactive_unitscome from the context pack.For mandatory imported tools these normally coincide, but a custom tool with
mandatory_context:falsecould theoretically be selected then omitted by packing while remaining inCompiled.tool_schemas.The provider-visible contract must be exact:
Implement one canonical helper, conceptually:
and ensure
prompt_render/3returns only schemas corresponding to active tool/mcp_tool units.If
pack(false)is used for inspection, preserve a clearly documented pre-pack state rather than pretending it is a provider-ready render.B. #174 integration
Issue #174 adds declarative
activation:always|relevantto the sameprompt_unitinterface.This completion epic must consume whatever final compiler contract #174 lands. It must not add its own special always-visible list.
If #176 lands before #174, tests should use current relevance behavior and add the always-visible integration regression when #174 lands.
3.
test/rlm_completion_test.plor canonical completion test fileAdd production-path tests proving the root planner sees compiled schemas rather than raw registry discovery.
If current completion tests use support planners that capture planner prompt text, extend those fixtures instead of building a separate test harness.
4.
test/rlm_prompt_compiler_test.plAdd/adjust active-schema packing regressions if
tool_schemasderivation changes.5.
docs/completion-runtime.mdReplace the current statement that the root planner receives
registered tool schemaswith the precise contract:Document
compiledvsall_toolsmode and catalog ownership.6. New stable runtime doc
Create:
This was already identified as missing in #174.
Required sections:
The doc must explicitly show:
7. Research/design source of truth
Update:
Add an
Implementation closure / completion integrationsection recording the exact landed path.Do not create another competing architecture research note for this integration; RLM-RESEARCH-011 already researched and required it.
Required regression matrix
completion_planner_hides_irrelevant_registered_toolgit_diffandproject_search;completion_executor_retains_hidden_runtime_bindingcompletion_all_tools_mode_preserves_compatibility_projectionall_toolsmode;completion_capability_denied_tool_not_visiblecompletion_compiler_projection_fingerprint_is_observablecompletion_prompt_uses_active_not_registered_wordingcompletion_does_not_duplicate_full_schema_renderingcompletion_ephemeral_catalog_is_cleaned_on_successcompletion_ephemeral_catalog_is_cleaned_on_planner_failurecompletion_ephemeral_catalog_is_cleaned_on_timeout_or_cancelcompletion_host_owned_catalog_is_not_destroyedcompletion_compiled_projection_can_include_instruction_or_skill_contextcompletion_pack_budget_applies_to_tool_projectionprovider_tool_schemas_are_subset_of_active_unitsoptional_selected_but_packed_out_tool_schema_is_not_sentalways_visible_tool_reaches_completion_planner_on_unrelated_queryactivation:always;relevant_tool_still_deactivates_between_completion_turnshidden_tool_cannot_be_model_selected_by_test_planner_without_schema_visibilityBackwards compatibility
all_toolsfor old projection behavior;tools(...)host bindings remain supported, but their model-visible schema story must be documented explicitly instead of silently bypassing compilation;Non-goals
prompt_unitactivation field);Dependencies / ordering
Acceptance gate
Complete only when:
rlm_completionno longer gives rawtool_discover/2output directly to the planner in normal compiled mode;all_toolsremains an explicit compatibility mode through the same compiler path;docs/prompt-compiler.md,docs/completion-runtime.md, and RLM-RESEARCH-011 reflect the landed contract;Implementation agents must re-read live main before editing, but they must preserve this separation of runtime execution bindings from provider-visible compiled tool schemas.
ADARD acceptance update: #183 extends the provider-surface gate beyond tool schemas. Completion integration must prove the exact provider-bound requests contain the active permanent RLM skills/instructions across root planner, recursive/subagent, RLM-internal model/leaf, and repair/retry calls. Internal compiler
selected/active_unitsassertions alone are insufficient. Trusted opt-out must remove them; user/model prose must not. Behavioral live tests must not spoon-feed the exact plan JSON.RAGE live-state revalidation — 2026-08-25
Revalidated against canonical
main49d86f88730b4a0f5dc4a7cf300b8f09ef5845b0after the #172 merge and after the #117/#197 and #200 permanent-context work.Analyze / deterministic defect evidence
The original #176 production gap still exists on this exact head.
rlm_completion:completion_with_handle/...still calls:while the issue's own audited
runtime_tools/4path obtains those planner-visible schemas directly fromtool_discover/2. The default operating skills are now correctly compiled byrlm_prompt_compiler, and #200 propagates their already-compiled system context into internal model/retry execution through the trustedprovider_context/2wrapper, but tool-schema visibility is still a separate raw-registry projection.So current production semantics are still:
instead of the intended single symbolic projection authority.
This is falsifiable without intentionally red CI: the production regression must assert the exact planner/provider request contains only compiler-active tool schemas while the full capable runtime bindings remain available to
plan_run; negative cases should assert the expected structured rejection/absence and keep the suite green.Research reconciliation
activation(always)plus defaultrlm-operate,rlm-recurse,rlm-facts, andrlm-constraints; do not recreate another skill selector.rlm_plan.mainand owns typed skill/role delegation policy; tool projection must not grant or widen child authority.a0-symbolicsPR #51 owns Agent Zero runtime-mode composition andagentPrologPR #8 owns the DeepSeek Harness AgentFactory. Neither owns this generic provider-visible tool projection contract.Design / adversarial review
The existing #176 design still survives current-main review. Keep two explicit products from the same trusted registry:
rlm_prompt_compiler-> provider-visible projection.Adversarial constraints:
selected/denied/always activation controls;all_toolscompatibility must still flow through one compiler projection path rather than bypassing it;Compiled.active_units, are the acceptance evidence;Decision
GO within the already-recorded #176/#183 architecture. The smallest safe realization slice is production-path root-planner tool-schema projection: retain
RuntimeToolsuntouched for execution, import sanitized registry schemas into an ephemeral/host-owned prompt catalog, compile the current query under host policy, and feed only the resulting active schemas to the root planner. Preserve the existing permanent-skill context path and avoid broadening into #175/#211/downstream product code.No implementation commit is claimed by this comment; exact-head CI/live/Nix evidence remains mandatory for any realization branch.
Realization ownership is now live on
rage/176-root-planner-tool-projection, cut from exact canonicalmain49d86f88730b4a0f5dc4a7cf300b8f09ef5845b0after the current open-issue/open-PR/review/downstream audit.Scope remains the GO slice already recorded above: root-planner provider-visible tool schemas must come from
rlm_prompt_compiler, while the full capability-filtered executableRuntimeToolsremain unchanged forplan_run/authority/effects. No #175 deadline work, #211 result-projection work, or downstream Agent Zero/AgentProlog product logic is included.TDD convention for this realization: the final branch must keep required CI green. Negative visibility/rejection contracts assert the expected structured absence/failure; no xfail/skip/intentional-red CI convention. Exact provider-bound request evidence plus full execution-binding preservation is required before a PR/merge claim.
RAGE scope correction — exact main
49d86f88730b4a0f5dc4a7cf300b8f09ef5845b0Fresh source audit narrows the remaining #176 defect.
rlm_prompt_compileralready enforces the compiler-level provider invariant after packing:maybe_pack_projection/3derivesActiveUnitsfrom the final context pack and then callsactive_tool_schemas/3, soCompiled.tool_schemasis filtered to tool/mcp_tool units that survived intoactive_units. The older checklist item asking #176 to invent that helper is therefore already satisfied on currentmainand should not be reimplemented.The production defect remains in
rlm_completion:runtime_tools/4still doestool_discover/2+ capability filtering and passes that raw list toplanner_prompt/7asRegistered tool schemas. Thus the compiler has the correct final schema projection, but the real root planner never consumes it.TDD contract for realization
Keep required CI green while asserting the behavioral contract:
compiledmode;all_toolscompatibility uses compiler mode rather than a raw-discovery bypass and exposes both;Active tool schemas, notRegistered tool schemas.Negative cases assert expected absence/rejection; no intentional red/xfail/skip CI convention.
Coordination audit
Open core transactions remain non-conflicting: #212 owns #175 deadline policy and its exact head
0109d25e2b22190d6d3339528f76c04748462c45currently has CI failing while Nix/Tree-sitter/Clean-pack/Paid OpenRouter are green; #213 owns #211 result projection and exact headfced85495700a0746ce49d7f697db3aab39f408dlikewise has CI failing while those other lanes are green. #132 remains draft/non-mergeable with no workflow runs on its current head. None has review submissions or unresolved review threads. Downstream A0 #51 and AgentProlog #8 still own product composition, not this generic compiler/provider projection.Decision remains GO, but realization should now be smaller: wire current compiler output into the root planner; do not touch
rlm_prompt_compilerpacking logic unless new evidence breaks that already-landed invariant.RAGE/TDD evidence update for #176 on exact branch head
c736625960a58e97f307b9f5ded3e3aa97face84(PR #216), based on canonicalmain49d86f88730b4a0f5dc4a7cf300b8f09ef5845b0.The production-path regression is now captured without intentionally red CI. The tool-visibility fixture registers two capability-allowed tools, invokes the real
rlm_completionroot-planner path, and classifies the current raw-registry projection as structuredraw_registry_visibility; the test asserts that expected failure contract. This isolates contextual prompt-compiler bypass from capability filtering.The first test commit exposed a test-only SWI binding mistake:
assertion(ProjectionOutcome = error(ProjectionError))did not preserve the binding used by the next assertion. That exact-head deterministic CI failure was treated as a blocker, not desired TDD evidence. Commitc736625960a58e97f307b9f5ded3e3aa97face84fixes the test by binding the structured failure outsideassertion/1.Exact-head verification for
c736625960a58e97f307b9f5ded3e3aa97face84is fully green:Decision remains GO for the previously recorded narrow realization: replace only the root planner's raw
tool_discover/2schema projection with the existing prompt compiler's active schema projection, while retaining the full trustedRuntimeToolsset for execution/authority/effects. Do not duplicate the already-landed post-packactive_tool_schemaslogic, and do not absorb #175/#211 or downstream product composition.RAGE adversarial refinement — production test boundaries
Revalidated against current
main49d86f88730b4a0f5dc4a7cf300b8f09ef5845b0, PR #216, and the current compiler implementation.One important test/design correction before realization: once
compiledbecomes the completion default, the existing capability-only regression must opt intoprompt_compile_mode(all_tools). Otherwise a missing schema could be caused by contextual activation rather than capability denial, and the test would stop proving the authority/visibility boundary it is named for.The realization matrix for the first slice should therefore keep these concerns independent:
compiled: query-relevant capability-allowed schema visible; unrelated capability-allowed schema absent;all_tools: all capability-allowed schemas visible through the compiler compatibility mode, never by rawtool_discover/2bypass;all_toolsmode;prompt_compile_modefails explicitly before planner invocation;RuntimeToolsremain unchanged for execution/authority checks regardless of provider visibility.Current
rlm_prompt_compileralready performs the needed final post-packactive_tool_schemasfiltering and already ownscompiled|all_tools; no second selector is justified. Tool-registry imports are declarative metadata only and do not contain executable handlers, so the smallest safe implementation remains wiring the root planner to that existing compiler projection while retaining the executor binding path.Adversarial decision remains GO for that narrow slice. Negative/rejection cases should assert their expected structured outcome while required CI remains green.
TDD refinement + exact-head verification
Advanced the owned #176 realization branch to exact head
2f2df1f7f3ef8982b8e383dfdec91fa87cbab6abwithout making required CI red.The production-path contract now separates two independent semantics explicitly:
prompt_compile_mode(all_tools), so a denied tool cannot disappear merely because contextual compiler selection hid it;prompt_compile_mode(compiled), so its expected structuredraw_registry_visibilityevidence specifically targets the compiler-controlled mode.This is still a test-first/falsifiable contract, not a production-fix claim. Current
rlm_completion:runtime_tools/4still capability-filterstool_discover/2output and passes those schemas directly toplanner_prompt/7; the production realization remains to split trusted runtime bindings from the compiler-owned provider-visible projection.Exact-head verification for
2f2df1f7f3ef8982b8e383dfdec91fa87cbab6abis green:The realization design remains unchanged:
RuntimeToolsstay complete forplan_run/authority/effects; registry schemas flow through the existingrlm_prompt_compilercatalog/import/compiled|all_toolspath before reaching the planner. PR #216 remains draft until that production path lands and a new exact head is fully reverified.TDD contract refinement — exact head
b19e5c795eea4f2c3abd7cf70957f12da8c056a5Live-state revalidation still supports the recorded GO decision. The compiler already owns sanitized registry import, capability eligibility,
compiled|all_tools, token-budget packing, and post-packactive_tool_schemas; realization should reuse those contracts rather than add another selector.I added one more green falsifiable contract before production glue:
prompt_compile_mode/1is a trusted completion option, but currentrlm_completionignores it. The new regression passesprompt_compile_mode(garbage_mode)and asserts the current structured contract failureinvalid_prompt_compile_mode_ignoredwhile required CI stays green. Realization must instead fail closed with explicitinvalid_prompt_compile_modebefore planner dispatch.Exact-head
b19e5c7…is mergeable as a draft TDD transaction and the current 12 check runs contain no failures; deterministic unit/load, copied-pack install, Tree-sitter, and pinned paid OpenRouter are successful. This is still TDD evidence only: productionrlm_completionhas not been changed, so no realization/merge claim is being made.The production boundary remains: full capability-filtered
RuntimeToolsstay unchanged forplan_run/authority/effects; only sanitized registry schemas flow through an ephemeral prompt catalog, current-query compilation, trustedcompiled|all_toolsmode, and the compiler's active-schema projection into the root planner request. #212/#175, #213/#211, a0-symbolics #51, and agentProlog #8 remain separate owned transactions.RAGE realization boundary refinement — exact main
49d86f88730b4a0f5dc4a7cf300b8f09ef5845b0, PR #216 headb19e5c795eea4f2c3abd7cf70957f12da8c056a5Source-level finding
The production seam is narrower than the earlier issue prose implied:
completion_with_handle/6already keeps full capability-filteredRuntimeToolsseparate and later passes them unchanged toplan_run/5throughtools(RuntimeTools).runtime_tools/4still callstool_discover/2and capability-filters that raw registry list before embedding it inplanner_prompt/7.rlm_prompt_compileralready supplies the required projection machinery:prompt_catalog_register_tool_registry/4,compiled|all_toolscandidate semantics, post-packactive_tool_schemas/3, andprompt_compiler_tool_schemas/2.Therefore realization should not modify tool registration, executable bindings, authority, effects, or the existing permanent-skill/provider-context path.
Trusted mode validation correction
One adversarial detail matters for the new host option contract. The compiler's internal
compile_mode/2treatsmode(all_tools)/all_tools(true)specially and otherwise defaults tocompiled; it is intentionally not a validator for a higher-levelprompt_compile_mode/1option. Sorlm_completionmust validate its trusted option explicitly:Do not pass arbitrary mode data through and let it silently collapse to
compiled.Smallest realization
runtime_toolsresponsible for executable bindings and registry acquisition only.prompt_catalog_register_tool_registry/4, compile the current query under the normalized root capabilities and trusted compile mode, and extractprompt_compiler_tool_schemas/2.tools(...)bindings executable-only unless/until they have an explicit declarative schema source; do not synthesize prompt authority from handlers.all_toolsso compiler relevance cannot mask capability enforcement.Adversarial decision
GO remains valid. This design preserves the key invariant: visibility is compiler-owned context projection; execution remains runtime/authority-owned possession. No second selector, no handler/callable enters compiler data, and no downstream Agent Zero/AgentProlog product logic moves into core.
Local checkout execution is unavailable in this worker environment because the runtime cannot currently resolve
github.com; GitHub connector reads/writes and exact-head Actions remain available. I am not claiming a production commit or new verification head from this note.RAGE live-state refinement against canonical
main49d86f88730b4a0f5dc4a7cf300b8f09ef5845b0and owned PR #216 headb19e5c795eea4f2c3abd7cf70957f12da8c056a5.Analyze / executable evidence
The production defect is still exactly at the completion boundary:
planner_promptstill labels that projectionRegistered tool schemas, so normal root completion still bypasses compiler contextual selection.The compiler side is already farther along than the original issue checklist:
rlm_prompt_compiler:maybe_pack_projection/3already computesactive_unitsfrom the final context pack and filterstool_schemasthroughactive_tool_schemas/3. Do not reimplement this in the realization.A second live mismatch is now pinned precisely:
rlm_prompt_compiler:compile_mode/2intentionally treats onlymode(all_tools)/all_tools(true)specially and otherwise defaults tocompiled. Therefore the trusted completion optionprompt_compile_mode/1must be validated at the completion boundary; passing an unknown value into the compiler cannot supply fail-closed semantics by itself.Current
completion_exception/2maps genericcompletion_fault(Fault)tokind:completion_fault. The #216 TDD contract requires invalid trusted mode to be an explicit structuredkind:invalid_prompt_compile_mode, so realization also needs a narrow exception mapping before the generic completion-fault clause rather than weakening the test.Research / ownership
Downstream evidence remains clean:
a0-symbolicsPR #51 owns Agent Zero native/RLM product composition and explicitly leaves symbolic selection/budgeting/planning/authority/effects to Prolog-RLM;agentPrologPR #8 owns the DeepSeek Harness AgentFactory/sidecar product integration and calls canonical Prolog runtime APIs. Neither owns this provider-projection defect.Recent merge #209 explicitly advances #172 without closing it; no #172 follow-up belongs in this #176 slice.
Design
Smallest production realization remains:
Rules:
compiled;all_toolsgoes through the same compiler path, never a raw-discovery bypass;invalid_prompt_compile_mode;setup_call_cleanup/3; supplied host catalog is never destroyed;Registered tool schemastoActive tool schemas;Adversarial review
GO, with these blockers on implementation correctness:
all_toolsso contextual relevance cannot create a false pass;No production implementation/verification claim is made by this note. PR #216 remains the owned realization transaction.
RAGE realization + exact-head verification — PR #216
Realization is now on
rage/176-root-planner-tool-projectionat exact heada7c1f58ee86ad2b9c61faf5323f4a3a8bdf99b0d.Realized invariant
rlm_completionno longer uses capability-filtered rawtool_discover/2results as the root planner surface. The path is now:The compiler's already-landed
active_tool_schemascontract remains canonical; no second selector was added.Additional fail-closed behavior landed for trusted
prompt_compile_mode/1: onlycompiledandall_toolsare accepted, and unknown values return structuredkind:invalid_prompt_compile_modebefore planner dispatch.Planner wording now says
Active tool schemas. Ephemeral compiler catalogs usesetup_call_cleanup/3.TDD evidence
The previous expected-defect contracts were inverted after realization into intended behavior while keeping CI green:
compiledexposes the relevant schema and hides an unrelated capability-allowed schema in the exact captured planner request;all_toolsexposes all capability-eligible schemas through the same compiler path;Active tool schemasvs the obsoleteRegistered tool schemaswording.Exact-head gate
All required returned workflows for
a7c1f58e…are successful:PR #216 is mergeable and has no reviews or unresolved review threads.
Scope reconciliation
This is a coherent production slice but does not close #176. Remaining epic work includes host-owned
prompt_cataloglifecycle/ownership, projection fingerprint/active-unit observability, non-tool compiled guidance reaching the planner, broader cleanup/failure lifecycle regressions, directtools(...)visibility contract, and the stable docs/research closure already listed in this issue.Merge is intentionally not claimed here: repository instructions require explicit merge-on-green authorization for the exact transaction.
Exact-head verification / reconciliation update
Revalidated the current #176 realization transaction against live remote state.
main:49d86f88730b4a0f5dc4a7cf300b8f09ef5845b0a7c1f58ee86ad2b9c61faf5323f4a3a8bdf99b0dThe automated failure issue #218 referred only to obsolete head
cbffcdd3e113e6ecd8d6bcab7c4bf42067ae1e16; it has now been closed after the later exact head went green.No merge performed in this RAGE pass: repository
AGENTS.mdrequires explicit merge-on-green authorization for the exact transaction. #216 is therefore a verified merge candidate, not merged evidence.#176 remains open after #216 because this PR is only the root-planner schema-projection slice. Remaining epic scope includes host-owned catalog lifecycle, projection fingerprint/active-unit observability, non-tool compiled guidance on the planner surface, direct
tools(...)visibility semantics/docs, lifecycle regressions, and the stable prompt-compiler/completion docs + RLM-RESEARCH-011 closure.#216 exact-head verification / docs reconciliation — 2026-08-26
Revalidated the current #176 transaction after the documentation/roadmap closure commits. Exact candidate head is
774454dba55855932f672f2de23b9e65936ede99on PR #216.Realization now present
tool_discover/2inventory;plan_run, authority and effect enforcement;compiledand compatibilityall_toolsboth use the canonicalrlm_prompt_compilerpath;prompt_compile_modefails before planner dispatch as structuredkind:invalid_prompt_compile_mode;docs/prompt-compiler.mdnow records the stable visibility/authority contract, including the direct trustedtools(...)boundary;docs/prolog-agent-roadmap.mdnow reflects that #216 supplies the root-planner local-tool projection while broader #176/#183 adoption remains open.Exact-head evidence
774454db...is green on all returned required workflows:PR #216 is non-draft and mergeable. Current review submissions, review threads and PR conversation comments are empty.
Remaining epic scope
Do not close #176 on this slice. Broader host-owned catalog lifecycle, projection observability/fingerprint exposure, lifecycle regressions, MCP/project-instruction/managed-context adoption, and research-record closure remain explicit follow-up scope.
Repository
AGENTS.mdstill requires explicit merge-on-green authorization, so this worker stops #216 at the verified PR boundary rather than merging it.RAGE reconciliation after #216 merge
Merged PR #216 into canonical
mainvia the repository-allowed rebase method with expected-head protection. Reviewed candidate head was774454dba55855932f672f2de23b9e65936ede99; canonical post-mergemainis now267697bef10a3fffff7c093e1435ece770e7444b.The landed slice establishes the production boundary:
rlm_prompt_compilerbefore root-planner exposure;prompt_compile_mode(compiled)uses contextual activation/final packed schemas;all_toolsremains compatibility visibility through the same compiler path;kind:invalid_prompt_compile_mode;setup_call_cleanup/3;Pre-merge exact candidate/synthetic-merge validation was green: deterministic PlUnit (887/887), benchmark/conformance, deep-recursion experiment, CLI/trace, fresh-process graph/artifact restart, whitespace, credential-backed REAL OpenRouter, Paid OpenRouter, Nix flake, clean SWI pack install, and Tree-sitter FFI. Post-merge canonical
267697be…has triggered the repository workflow set; no failure conclusion is currently present in the returned canonical check/run state (failure-report jobs are skipped as expected).Do NOT close #176: remaining epic scope still includes host-owned catalog lifecycle, projection fingerprint/observability on completion results, lifecycle regressions for ephemeral/host catalogs, MCP/project-instruction/managed-context compiler adoption, research-record implementation closure, and the broader single combined provider-context budgeting/packing story. The direct trusted
tools(...)provider-visibility boundary remains documented as execution-only unless schemas enter the registry/compiler path.Machine Spirit #403A handoff — prompt packing after semantic attention
#403A/TAPS is upstream of provider-visible context packing when semantic/world-model knowledge is involved. The prompt compiler should consume already-admitted projection units and preserve their dependency classes:
Budget packing must never keep a derived semantic conclusion while packing out a premise/rule/counterevidence item marked mandatory by its TAPS projection. If the closure cannot fit, either choose a smaller semantic candidate/result or expose a structural budget failure/partial projection; do not manufacture a dangling self-contained-looking answer.
This does not merge retrieval with the prompt compiler: #381/#403 choose/find semantic working sets; #176 continues to own provider-visible packing/tool projection. Existing invariant remains:
Refs #403 #381 #396.