[P0] Prompt compiler rejects closed anonymous-dict schemas and false-fails most compiler tests #158

Closed
opened 2026-08-21 22:29:24 +00:00 by lost-rob0t · 1 comment
lost-rob0t commented 2026-08-21 22:29:24 +00:00 (Migrated from github.com)

Failure

Restoring the real aggregate PlUnit runner in #151/#152 exposes a near-total failure of rlm_prompt_compiler_test.pl.

The first common boundary is deterministic catalog registration. Normal tool schemas in the existing fixtures contain SWI anonymous dicts such as:

arguments:_{type:object, properties:_{}},
result:_{type:object, properties:_{}},
limits:_{time_limit:1.0, max_output_bytes:4096}

sanitize_tool_schema/2 currently calls raw ground/1 through require_ground/2 on arguments, result, and limits. In SWI-Prolog an anonymous dict tag is a variable, so otherwise-closed declarative schema data is rejected as nonground. The compiler therefore never reaches trigger scoring, conflict/supersession, dependency closure, capability filtering, ledgering, or fingerprint behavior in most tests.

This is the same representation-class bug tracked generically in #154 and already fixed narrowly for recursive-plan fingerprints in #135.

Required invariant

Closed model-visible/configuration data must treat only the anonymous dict tag as representation metadata:

  • normalize anonymous dict tags to a stable code-owned sentinel;
  • preserve named dict tags;
  • recursively reject genuine variable values;
  • reject cyclic values;
  • store canonical closed schema data so compilation fingerprints are deterministic.

Do not relax capability/authority semantics or accept executable callables.

Acceptance

  • ordinary fixture tool schemas register successfully;
  • phrase/verb/object/explicit/negation activation tests reach their intended logic;
  • conflict, supersession and dependency tests reach their intended logic;
  • capability-denied units remain rejected rather than authorized;
  • compiler token ledger and mandatory-overflow behavior work on canonical schema values;
  • identical material inputs produce identical compiler fingerprints;
  • genuine variable schema values still fail closed;
  • cyclic schema values fail closed;
  • restored aggregate test/run_tests.pl remains the merge oracle.

Discovered during post-false-green remediation after #60.

## Failure Restoring the real aggregate PlUnit runner in #151/#152 exposes a near-total failure of `rlm_prompt_compiler_test.pl`. The first common boundary is deterministic catalog registration. Normal tool schemas in the existing fixtures contain SWI anonymous dicts such as: ```prolog arguments:_{type:object, properties:_{}}, result:_{type:object, properties:_{}}, limits:_{time_limit:1.0, max_output_bytes:4096} ``` `sanitize_tool_schema/2` currently calls raw `ground/1` through `require_ground/2` on `arguments`, `result`, and `limits`. In SWI-Prolog an anonymous dict tag is a variable, so otherwise-closed declarative schema data is rejected as nonground. The compiler therefore never reaches trigger scoring, conflict/supersession, dependency closure, capability filtering, ledgering, or fingerprint behavior in most tests. This is the same representation-class bug tracked generically in #154 and already fixed narrowly for recursive-plan fingerprints in #135. ## Required invariant Closed model-visible/configuration data must treat only the anonymous dict tag as representation metadata: - normalize anonymous dict tags to a stable code-owned sentinel; - preserve named dict tags; - recursively reject genuine variable values; - reject cyclic values; - store canonical closed schema data so compilation fingerprints are deterministic. Do not relax capability/authority semantics or accept executable callables. ## Acceptance - [ ] ordinary fixture tool schemas register successfully; - [ ] phrase/verb/object/explicit/negation activation tests reach their intended logic; - [ ] conflict, supersession and dependency tests reach their intended logic; - [ ] capability-denied units remain rejected rather than authorized; - [ ] compiler token ledger and mandatory-overflow behavior work on canonical schema values; - [ ] identical material inputs produce identical compiler fingerprints; - [ ] genuine variable schema values still fail closed; - [ ] cyclic schema values fail closed; - [ ] restored aggregate `test/run_tests.pl` remains the merge oracle. Discovered during post-false-green remediation after #60.
lost-rob0t commented 2026-08-24 08:08:02 +00:00 (Migrated from github.com)

Completed on current main by the rlm_closed_data-backed schema boundary integrated in #177. Focused exact-head verification passed 26/26 across closed-data and prompt-compiler contracts; full aggregate remains 762/762. PR #159 was closed as superseded.

Completed on current main by the rlm_closed_data-backed schema boundary integrated in #177. Focused exact-head verification passed 26/26 across closed-data and prompt-compiler contracts; full aggregate remains 762/762. PR #159 was closed as superseded.
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/prolog-rlm#158
No description provided.