context-compiler 0.7.2__tar.gz → 0.7.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. {context_compiler-0.7.2 → context_compiler-0.7.3}/AGENTS.md +10 -0
  2. {context_compiler-0.7.2 → context_compiler-0.7.3}/PKG-INFO +7 -7
  3. {context_compiler-0.7.2 → context_compiler-0.7.3}/README.md +6 -6
  4. {context_compiler-0.7.2 → context_compiler-0.7.3}/docs/DescriptionAndMilestones.md +6 -6
  5. {context_compiler-0.7.2 → context_compiler-0.7.3}/docs/DesignPhilosophy.md +4 -4
  6. {context_compiler-0.7.2 → context_compiler-0.7.3}/docs/llm-preprocessor.md +4 -5
  7. {context_compiler-0.7.2 → context_compiler-0.7.3}/docs/multi-engine.md +3 -3
  8. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/integrations/README.md +1 -1
  9. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/integrations/litellm/README.md +1 -1
  10. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/integrations/litellm_proxy/README.md +1 -1
  11. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/integrations/openwebui/README.md +5 -5
  12. {context_compiler-0.7.2 → context_compiler-0.7.3}/experimental/preprocessor/README.md +5 -5
  13. {context_compiler-0.7.2 → context_compiler-0.7.3}/pyproject.toml +1 -1
  14. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/README.md +12 -0
  15. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/api/public-api-v1.json +2 -1
  16. context_compiler-0.7.3/tests/fixtures/conformance/checkpoint/008_export_checkpoint_json_wrapper_shape.json +38 -0
  17. context_compiler-0.7.3/tests/fixtures/conformance/checkpoint/009_import_checkpoint_json_restores_authoritative_state_no_pending.json +39 -0
  18. context_compiler-0.7.3/tests/fixtures/conformance/checkpoint/010_checkpoint_json_round_trip_state_and_pending_parity.json +37 -0
  19. context_compiler-0.7.3/tests/fixtures/conformance/checkpoint/011_pending_clarification_through_checkpoint_json_restore_yes_resolution.json +45 -0
  20. context_compiler-0.7.3/tests/fixtures/conformance/checkpoint/012_import_checkpoint_json_malformed_rejected.json +25 -0
  21. context_compiler-0.7.3/tests/fixtures/conformance/checkpoint/013_import_checkpoint_json_invalid_shape_rejected.json +25 -0
  22. context_compiler-0.7.3/tests/fixtures/conformance/checkpoint/014_import_checkpoint_json_invalid_authoritative_state_rejected.json +25 -0
  23. context_compiler-0.7.3/tests/fixtures/conformance/checkpoint/015_import_checkpoint_json_invalid_payload_is_all_or_nothing.json +42 -0
  24. context_compiler-0.7.3/tests/fixtures/conformance/controller/001_step_update_envelope_and_state_snapshot.json +39 -0
  25. context_compiler-0.7.3/tests/fixtures/conformance/controller/002_preview_mutating_update_reports_would_mutate_and_no_live_mutation.json +58 -0
  26. context_compiler-0.7.3/tests/fixtures/conformance/controller/003_preview_idempotent_update_reports_non_mutating.json +69 -0
  27. context_compiler-0.7.3/tests/fixtures/conformance/controller/004_preview_clarify_reports_non_mutating_and_restores_pending.json +54 -0
  28. context_compiler-0.7.3/tests/fixtures/conformance/controller/005_preview_pending_yes_reports_mutation_but_preserves_live_pending.json +67 -0
  29. context_compiler-0.7.3/tests/fixtures/conformance/controller/006_state_diff_structural_changes.json +52 -0
  30. context_compiler-0.7.3/tests/fixtures/preprocessor/parse-canonical-directive-prohibit-peanuts.json +6 -0
  31. context_compiler-0.7.3/tests/fixtures/preprocessor/parse-malformed-near-miss-rejected.json +6 -0
  32. context_compiler-0.7.3/tests/fixtures/preprocessor/parse-multiple-directives-rejected.json +6 -0
  33. context_compiler-0.7.3/tests/fixtures/preprocessor/parse-no-directive-sentinel.json +6 -0
  34. context_compiler-0.7.3/tests/fixtures/preprocessor/parse-source-input-structured-json-directive-self-accepted.json +7 -0
  35. context_compiler-0.7.3/tests/fixtures/preprocessor/parse-unknown-directive-like-rejected.json +6 -0
  36. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_fixtures.py +59 -0
  37. {context_compiler-0.7.2 → context_compiler-0.7.3}/uv.lock +1 -1
  38. {context_compiler-0.7.2 → context_compiler-0.7.3}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  39. {context_compiler-0.7.2 → context_compiler-0.7.3}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  40. {context_compiler-0.7.2 → context_compiler-0.7.3}/.github/pull_request_template.md +0 -0
  41. {context_compiler-0.7.2 → context_compiler-0.7.3}/.github/workflows/ci.yml +0 -0
  42. {context_compiler-0.7.2 → context_compiler-0.7.3}/.github/workflows/publish-pypi.yml +0 -0
  43. {context_compiler-0.7.2 → context_compiler-0.7.3}/.github/workflows/stress-tests.yml +0 -0
  44. {context_compiler-0.7.2 → context_compiler-0.7.3}/.gitignore +0 -0
  45. {context_compiler-0.7.2 → context_compiler-0.7.3}/.pre-commit-config.yaml +0 -0
  46. {context_compiler-0.7.2 → context_compiler-0.7.3}/CODE_OF_CONDUCT.md +0 -0
  47. {context_compiler-0.7.2 → context_compiler-0.7.3}/CONTRIBUTING.md +0 -0
  48. {context_compiler-0.7.2 → context_compiler-0.7.3}/LICENSE +0 -0
  49. {context_compiler-0.7.2 → context_compiler-0.7.3}/SECURITY.md +0 -0
  50. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/01_llm_contradiction_clarify.py +0 -0
  51. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/02_llm_constraint_guardrail.py +0 -0
  52. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/03_llm_premise_guardrail.py +0 -0
  53. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/04_llm_tool_denylist_guardrail.py +0 -0
  54. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/05_llm_prompt_drift_vs_state.py +0 -0
  55. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/06_llm_context_compaction.py +0 -0
  56. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/07_llm_prompt_vs_state.py +0 -0
  57. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/08_llm_replacement_precondition.py +0 -0
  58. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/09_llm_pending_clarification.py +0 -0
  59. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/README.md +0 -0
  60. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/__init__.py +0 -0
  61. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/common.py +0 -0
  62. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/llm_client.py +0 -0
  63. {context_compiler-0.7.2 → context_compiler-0.7.3}/demos/run_demo.py +0 -0
  64. {context_compiler-0.7.2 → context_compiler-0.7.3}/docs/DirectiveGrammarSpec.md +0 -0
  65. {context_compiler-0.7.2 → context_compiler-0.7.3}/docs/README.md +0 -0
  66. {context_compiler-0.7.2 → context_compiler-0.7.3}/docs/demos-results.md +0 -0
  67. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/litellm_proxy_additional_findings.md +0 -0
  68. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/litellm_proxy_behavioral_comparisons.md +0 -0
  69. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/swe-bench/README.md +0 -0
  70. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/swe-bench/RUBRIC.md +0 -0
  71. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/swe-bench/manifest.json +0 -0
  72. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/swe-bench/swe-bench.py +0 -0
  73. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/swe-bench/tasks/django__django-12453.json +0 -0
  74. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/swe-bench/tasks/django__django-13158.json +0 -0
  75. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/swe-bench/tasks/django__django-13964.json +0 -0
  76. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/swe-bench/tasks/django__django-15252.json +0 -0
  77. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/swe-bench/tasks/matplotlib__matplotlib-23299.json +0 -0
  78. {context_compiler-0.7.2 → context_compiler-0.7.3}/evals/swe-bench/tasks/psf__requests-1963.json +0 -0
  79. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/01_persistent_guardrails.py +0 -0
  80. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/02_configuration_and_correction.py +0 -0
  81. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/03_ambiguity_with_clarification.py +0 -0
  82. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/04_tool_governance_denylist.py +0 -0
  83. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/05_llm_integration_pattern.py +0 -0
  84. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/06_transcript_replay.py +0 -0
  85. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/07_single_policy_correction.py +0 -0
  86. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/README.md +0 -0
  87. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/_util.py +0 -0
  88. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/integrations/litellm/basic.py +0 -0
  89. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/integrations/litellm/with_preprocessor.py +0 -0
  90. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/integrations/litellm_proxy/config.example.yaml +0 -0
  91. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/integrations/litellm_proxy/context_compiler_precall_hook.py +0 -0
  92. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/integrations/litellm_proxy/context_compiler_precall_hook_with_preprocessor.py +0 -0
  93. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/integrations/openwebui/open_webui_pipe.py +0 -0
  94. {context_compiler-0.7.2 → context_compiler-0.7.3}/examples/integrations/openwebui/open_webui_pipe_with_preprocessor.py +0 -0
  95. {context_compiler-0.7.2 → context_compiler-0.7.3}/experimental/__init__.py +0 -0
  96. {context_compiler-0.7.2 → context_compiler-0.7.3}/experimental/preprocessor/__init__.py +0 -0
  97. {context_compiler-0.7.2 → context_compiler-0.7.3}/experimental/preprocessor/constants.py +0 -0
  98. {context_compiler-0.7.2 → context_compiler-0.7.3}/experimental/preprocessor/heuristic_preprocessor.py +0 -0
  99. {context_compiler-0.7.2 → context_compiler-0.7.3}/experimental/preprocessor/output_validation.py +0 -0
  100. {context_compiler-0.7.2 → context_compiler-0.7.3}/experimental/preprocessor/prompt_utils.py +0 -0
  101. {context_compiler-0.7.2 → context_compiler-0.7.3}/experimental/preprocessor/prompts/default.txt +0 -0
  102. {context_compiler-0.7.2 → context_compiler-0.7.3}/experimental/preprocessor/prompts/llama.txt +0 -0
  103. {context_compiler-0.7.2 → context_compiler-0.7.3}/host_support/__init__.py +0 -0
  104. {context_compiler-0.7.2 → context_compiler-0.7.3}/host_support/confirmation.py +0 -0
  105. {context_compiler-0.7.2 → context_compiler-0.7.3}/host_support/provider_mode.py +0 -0
  106. {context_compiler-0.7.2 → context_compiler-0.7.3}/src/context_compiler/__init__.py +0 -0
  107. {context_compiler-0.7.2 → context_compiler-0.7.3}/src/context_compiler/const.py +0 -0
  108. {context_compiler-0.7.2 → context_compiler-0.7.3}/src/context_compiler/controller.py +0 -0
  109. {context_compiler-0.7.2 → context_compiler-0.7.3}/src/context_compiler/decision_constants.py +0 -0
  110. {context_compiler-0.7.2 → context_compiler-0.7.3}/src/context_compiler/engine.py +0 -0
  111. {context_compiler-0.7.2 → context_compiler-0.7.3}/src/context_compiler/observability.py +0 -0
  112. {context_compiler-0.7.2 → context_compiler-0.7.3}/src/context_compiler/repl.py +0 -0
  113. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/checkpoint/001_import_checkpoint_non_object_rejected.json +0 -0
  114. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/checkpoint/002_import_checkpoint_unsupported_version_rejected.json +0 -0
  115. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/checkpoint/003_import_checkpoint_invalid_pending_shape_rejected.json +0 -0
  116. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/checkpoint/004_import_checkpoint_invalid_replacement_shape_rejected.json +0 -0
  117. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/checkpoint/005_import_checkpoint_invalid_authoritative_state_rejected_atomically.json +0 -0
  118. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/checkpoint/006_import_checkpoint_pending_null_clears_existing_pending.json +0 -0
  119. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/checkpoint/007_import_checkpoint_pending_absent_clears_existing_pending.json +0 -0
  120. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/state-json/001_export_json_canonical_sorted_compact.json +0 -0
  121. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/state-json/002_import_json_invalid_json_rejected.json +0 -0
  122. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/state-json/003_import_json_non_object_rejected.json +0 -0
  123. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/state-json/004_import_json_unsupported_version_rejected.json +0 -0
  124. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/state-json/005_import_json_empty_normalized_policy_key_rejected_atomically.json +0 -0
  125. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/state-json/006_import_json_valid_normalized_policy_key_accepted.json +0 -0
  126. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/001_set_premise_update.json +0 -0
  127. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/002_use_item_normalization.json +0 -0
  128. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/003_conflict_prohibit_clarify.json +0 -0
  129. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/004_remove_policy_missing_idempotent_update.json +0 -0
  130. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/005_exact_prefix_passthrough_leading_space.json +0 -0
  131. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/006_near_miss_set_premise_to.json +0 -0
  132. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/007_near_miss_change_premise_missing_to.json +0 -0
  133. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/008_replace_missing_source_clarify_prompt.json +0 -0
  134. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/009_pending_affirmative_normalized_token.json +0 -0
  135. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/010_pending_negative_normalized_token.json +0 -0
  136. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/011_pending_unmatched_reuses_prompt.json +0 -0
  137. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/012_clear_premise_populated_update.json +0 -0
  138. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/013_clear_premise_already_null_update.json +0 -0
  139. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/014_reset_policies_populated_update.json +0 -0
  140. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/015_reset_policies_already_empty_update.json +0 -0
  141. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/016_clear_state_populated_update.json +0 -0
  142. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/017_clear_state_already_empty_update.json +0 -0
  143. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/018_pending_affirmative_punctuation_token.json +0 -0
  144. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/step/019_pending_negative_punctuation_token.json +0 -0
  145. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/transcript/001_user_only_replay_state.json +0 -0
  146. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/transcript/002_non_string_user_content_ignored.json +0 -0
  147. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/transcript/003_stops_at_first_clarify_later_yes.json +0 -0
  148. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/conformance/transcript/004_stops_at_first_clarify_later_no.json +0 -0
  149. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/controller/preview_clarify_no_mutation.json +0 -0
  150. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/controller/preview_idempotent_no_mutation.json +0 -0
  151. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/README.md +0 -0
  152. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/expected/contradiction_clarify.json +0 -0
  153. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/expected/pending_clarify_no.json +0 -0
  154. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/expected/pending_clarify_unmatched.json +0 -0
  155. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/expected/pending_clarify_yes.json +0 -0
  156. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/expected/premise_lifecycle.json +0 -0
  157. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/expected/replacement_clarify.json +0 -0
  158. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/scenarios/contradiction_clarify.json +0 -0
  159. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/scenarios/pending_clarify_no.json +0 -0
  160. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/scenarios/pending_clarify_unmatched.json +0 -0
  161. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/scenarios/pending_clarify_yes.json +0 -0
  162. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/scenarios/premise_lifecycle.json +0 -0
  163. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/engine-regression/structured/scenarios/replacement_clarify.json +0 -0
  164. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/admin-alias-remove-policies-unknown.json +0 -0
  165. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/admin-alias-reset-policy-unknown.json +0 -0
  166. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/ambiguous-directive-adjacent.json +0 -0
  167. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/canonical-directive-bracket-wrapper.json +0 -0
  168. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/canonical-directive-case-normalized-use-docker.json +0 -0
  169. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/canonical-directive-clear-state-period.json +0 -0
  170. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/canonical-directive-clear-state.json +0 -0
  171. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/canonical-directive-paren-wrapper.json +0 -0
  172. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/canonical-directive-prohibit-peanuts.json +0 -0
  173. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/canonical-directive-quoted-payload-use-docker.json +0 -0
  174. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/canonical-directive-reset-policies-bang.json +0 -0
  175. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/canonical-directive-whitespace-collapsed-use-docker.json +0 -0
  176. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/fenced-code-block-directive-unknown.json +0 -0
  177. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/inline-prose-code-directive-unknown.json +0 -0
  178. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/list-prefix-directive-unknown.json +0 -0
  179. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/malformed-replacement-instead-docker-unknown.json +0 -0
  180. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/meta-prefix-directive-unknown.json +0 -0
  181. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/mixed-directive-task-unknown.json +0 -0
  182. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/mixed-intent-unknown.json +0 -0
  183. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/modal-please-clear-state-unknown.json +0 -0
  184. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/multiline-multi-directive-unknown.json +0 -0
  185. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/natural-language-dont-use-unknown.json +0 -0
  186. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/near-miss-change-premise-missing-to-unknown.json +0 -0
  187. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/near-miss-change-premise-to-empty-unknown.json +0 -0
  188. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/near-miss-prohibit-empty-unknown.json +0 -0
  189. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/near-miss-remove-policy-empty-unknown.json +0 -0
  190. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/near-miss-set-premise-empty-unknown.json +0 -0
  191. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/near-miss-set-premise-to-unknown.json +0 -0
  192. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/near-miss-use-empty-unknown.json +0 -0
  193. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/near-miss-use-instead-of-missing-new-item-unknown.json +0 -0
  194. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/near-miss-use-instead-of-missing-old-item-unknown.json +0 -0
  195. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/nested-wrapper-clear-state-unknown.json +0 -0
  196. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/ordinary-non-directive.json +0 -0
  197. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/parse-source-input-fenced-code-rejected.json +0 -0
  198. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/parse-source-input-inline-prose-code-rejected.json +0 -0
  199. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/parse-source-input-mixed-directive-task-rejected.json +0 -0
  200. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/parse-source-input-multiline-rejected.json +0 -0
  201. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/parse-source-input-question-form-rejected.json +0 -0
  202. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/parse-source-input-quoted-payload-locked.json +0 -0
  203. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/parse-source-input-reported-speech-rejected.json +0 -0
  204. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/parse-source-input-safe-canonical-use-docker.json +0 -0
  205. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/parse-source-input-safe-canonicalization-use-docker.json +0 -0
  206. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/public-api-v1.json +0 -0
  207. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/question-can-you-use-docker-unknown.json +0 -0
  208. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/question-use-docker-unknown.json +0 -0
  209. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/quoted-exact-use-docker-backtick-unknown.json +0 -0
  210. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/quoted-exact-use-docker-single-unknown.json +0 -0
  211. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/quoted-exact-use-docker-unknown.json +0 -0
  212. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/quoted-reported-unknown.json +0 -0
  213. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/reported-speech-docs-say-unknown.json +0 -0
  214. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/sentence-adjacent-directive-unknown.json +0 -0
  215. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/unsupported-alias-unknown.json +0 -0
  216. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/validator-invalid-json-shape-unknown.json +0 -0
  217. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/validator-malformed-json-text-unknown.json +0 -0
  218. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/validator-malformed-sentinel-unknown.json +0 -0
  219. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/validator-malformed-text-unknown.json +0 -0
  220. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/validator-multi-candidate-directive-unknown.json +0 -0
  221. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/validator-sentinel-no-directive.json +0 -0
  222. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/validator-source-input-allow-safe-directive.json +0 -0
  223. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/validator-source-input-block-change-premise-rewrite.json +0 -0
  224. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/validator-source-input-block-set-premise-rewrite.json +0 -0
  225. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/fixtures/preprocessor/validator-structured-json-directive.json +0 -0
  226. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_04_grammar_edge_cases.py +0 -0
  227. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_04_llm_tool_governance.py +0 -0
  228. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_07_llm_prompt_engineering_comparison.py +0 -0
  229. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_api_contract_fixture.py +0 -0
  230. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_controller.py +0 -0
  231. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_decision_constants.py +0 -0
  232. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_demo_01_04_behavior.py +0 -0
  233. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_demo_05_prompt_contract.py +0 -0
  234. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_demo_07_output_clarity.py +0 -0
  235. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_demo_08_09_behavior.py +0 -0
  236. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_demo_compaction.py +0 -0
  237. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_demo_oracle_properties.py +0 -0
  238. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_engine.py +0 -0
  239. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_example_integrations_imports.py +0 -0
  240. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_examples.py +0 -0
  241. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_examples_behavior.py +0 -0
  242. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_examples_smoke.py +0 -0
  243. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_host_confirmation.py +0 -0
  244. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_host_observability.py +0 -0
  245. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_litellm_checkpoint_integration.py +0 -0
  246. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_litellm_integration_error_paths.py +0 -0
  247. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_litellm_preprocessor_model_config.py +0 -0
  248. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_llm_client.py +0 -0
  249. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_llm_demos.py +0 -0
  250. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_openwebui_pipe.py +0 -0
  251. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_openwebui_preprocessor_pipe.py +0 -0
  252. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_precompiler_prompt_utils.py +0 -0
  253. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_preprocessor_api_contract_fixture.py +0 -0
  254. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_preprocessor_conformance.py +0 -0
  255. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_preprocessor_heuristic.py +0 -0
  256. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_preprocessor_heuristic_properties.py +0 -0
  257. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_preprocessor_output_validation.py +0 -0
  258. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_preprocessor_validator_properties.py +0 -0
  259. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_properties.py +0 -0
  260. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_provider_helper.py +0 -0
  261. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_repl.py +0 -0
  262. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_repl_coverage.py +0 -0
  263. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_repl_properties.py +0 -0
  264. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_run_demo.py +0 -0
  265. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_smoke.py +0 -0
  266. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_structured_regression.py +0 -0
  267. {context_compiler-0.7.2 → context_compiler-0.7.3}/tests/test_transcript_replay.py +0 -0
@@ -75,6 +75,7 @@ Prefer modern typing syntax:
75
75
 
76
76
  ## PR guidance
77
77
  - Never open or merge a PR targeting `main` from `main`; always use a feature branch.
78
+ - Always use the repository PR template when creating or updating PR descriptions.
78
79
  - PR titles must use the same format as commits: `<type>: <summary>`.
79
80
  - PR descriptions should include:
80
81
  - what changed
@@ -82,6 +83,11 @@ Prefer modern typing syntax:
82
83
  - Do not include a dedicated "Validation" section in PR text.
83
84
  - Keep PR scope aligned to the requested task; if scope grows, ask for guidance before expanding.
84
85
 
86
+ ## Issue guidance
87
+ - Always use the repository issue templates when creating or updating issues.
88
+ - Use `bug_report` for defects and regressions.
89
+ - Use `feature_request` for new capabilities or enhancements.
90
+
85
91
  ## CI
86
92
  Do not modify GitHub CI workflows unless explicitly asked.
87
93
 
@@ -105,6 +111,10 @@ Prefer plain, concrete wording when accurate. Examples:
105
111
 
106
112
  Avoid describing features only in architectural terms when a behavior-first explanation is possible.
107
113
 
114
+ Prefer direct subjects and strong verbs.
115
+ Avoid noun stacks and passive phrasing when a simpler active sentence is clearer.
116
+ Use simpler wording unless technical precision requires formal terminology.
117
+
108
118
  Specification and contract documents are different:
109
119
  - preserve precise terminology
110
120
  - preserve unambiguous behavioral guarantees
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: context-compiler
3
- Version: 0.7.2
3
+ Version: 0.7.3
4
4
  Summary: Deterministic conversational state engine for LLM applications.
5
5
  Project-URL: Homepage, https://github.com/rlippmann/context-compiler
6
6
  Project-URL: Repository, https://github.com/rlippmann/context-compiler
@@ -40,11 +40,11 @@ Description-Content-Type: text/markdown
40
40
  [![Python versions](https://img.shields.io/pypi/pyversions/context-compiler)](https://pypi.org/project/context-compiler/)
41
41
  [![License](https://img.shields.io/pypi/l/context-compiler)](https://pypi.org/project/context-compiler/)
42
42
 
43
- Some behaviors require explicit host-side state machinery.
43
+ Some behaviors require explicit host-side state handling.
44
44
 
45
45
  Context Compiler is a deterministic host-side state layer for LLM applications.
46
- It handles explicit state transitions for premise and policies so that mutation
47
- rules are fixed and repeatable.
46
+ It applies explicit premise and policy updates so state changes stay fixed and
47
+ repeatable.
48
48
 
49
49
  ## What prompting and reinjection can do
50
50
 
@@ -59,17 +59,17 @@ pending confirmations from checkpoints.
59
59
  ## What prompting cannot do by itself
60
60
 
61
61
  Prompt text (including reinjected state text) helps, but it does not give your
62
- app controlled rules for when state can change. By itself, it does not provide:
62
+ app clear rules for when state can change. By itself, it does not provide:
63
63
 
64
64
  - rules your app controls for state changes
65
65
  - replacement precondition checks (`use X instead of Y` when `Y` may be absent)
66
66
  - confirmation flows that must complete before anything else changes
67
- - clear decisions about when a change is blocked
67
+ - clear rules for when to block a change
68
68
  - reliable checkpoint restore for both saved state and pending confirmation flow
69
69
 
70
70
  ## What Context Compiler provides
71
71
 
72
- Context Compiler provides fixed host-side state machinery:
72
+ Context Compiler provides fixed host-side state handling:
73
73
 
74
74
  - deterministic directive handling for explicit user state changes
75
75
  - clarification instead of silent overwrite for blocked/ambiguous changes
@@ -4,11 +4,11 @@
4
4
  [![Python versions](https://img.shields.io/pypi/pyversions/context-compiler)](https://pypi.org/project/context-compiler/)
5
5
  [![License](https://img.shields.io/pypi/l/context-compiler)](https://pypi.org/project/context-compiler/)
6
6
 
7
- Some behaviors require explicit host-side state machinery.
7
+ Some behaviors require explicit host-side state handling.
8
8
 
9
9
  Context Compiler is a deterministic host-side state layer for LLM applications.
10
- It handles explicit state transitions for premise and policies so that mutation
11
- rules are fixed and repeatable.
10
+ It applies explicit premise and policy updates so state changes stay fixed and
11
+ repeatable.
12
12
 
13
13
  ## What prompting and reinjection can do
14
14
 
@@ -23,17 +23,17 @@ pending confirmations from checkpoints.
23
23
  ## What prompting cannot do by itself
24
24
 
25
25
  Prompt text (including reinjected state text) helps, but it does not give your
26
- app controlled rules for when state can change. By itself, it does not provide:
26
+ app clear rules for when state can change. By itself, it does not provide:
27
27
 
28
28
  - rules your app controls for state changes
29
29
  - replacement precondition checks (`use X instead of Y` when `Y` may be absent)
30
30
  - confirmation flows that must complete before anything else changes
31
- - clear decisions about when a change is blocked
31
+ - clear rules for when to block a change
32
32
  - reliable checkpoint restore for both saved state and pending confirmation flow
33
33
 
34
34
  ## What Context Compiler provides
35
35
 
36
- Context Compiler provides fixed host-side state machinery:
36
+ Context Compiler provides fixed host-side state handling:
37
37
 
38
38
  - deterministic directive handling for explicit user state changes
39
39
  - clarification instead of silent overwrite for blocked/ambiguous changes
@@ -10,9 +10,9 @@ conversations, and state can conflict over time.
10
10
  This project adds a deterministic state layer that is independent of the model.
11
11
  The model handles interpretation and generation; the engine handles premise and
12
12
  policies. Only explicit user directives can change state.
13
- By separating reasoning from state ownership, the system improves reliability
14
- without requiring model retraining. The system never derives authoritative state
15
- from model responses.
13
+ When the model reasons and the engine owns state, behavior stays reliable
14
+ without retraining the model. The system never derives authoritative state from
15
+ model responses.
16
16
  The goal is not to make the model smarter, but to make interactions
17
17
  predictable: once a statement is corrected or scoped, future responses
18
18
  must respect that change.
@@ -64,7 +64,7 @@ After correcting or constraining the assistant once, the behavior remains consis
64
64
  ### M3 — Cross-Session Recall (implemented, engine-level / host-enabled)
65
65
 
66
66
  **Goal**
67
- Extend app-level workflows around persisted exported state safely and intentionally.
67
+ Help apps safely reuse saved exported state.
68
68
 
69
69
  **Core capability:**
70
70
 
@@ -77,8 +77,8 @@ Extend app-level workflows around persisted exported state safely and intentiona
77
77
 
78
78
  **Deliverables:**
79
79
 
80
- - App-side storage/recovery patterns built on the existing import/export API
81
- - App-side storage/recovery patterns for checkpoint object/checkpoint JSON continuation restore
80
+ - App-side storage and recovery patterns built on the existing import/export API
81
+ - App-side storage and recovery patterns for checkpoint object and checkpoint JSON restore
82
82
 
83
83
  **User-visible outcome:**
84
84
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## The Problem with Implicit State
4
4
 
5
- Modern LLM applications typically manage conversational state implicitly the model reads the transcript, infers what constraints are active, and generates a response accordingly. This works well for short conversations and simple tasks.
5
+ Modern LLM applications often manage conversational state implicitly: the model reads the transcript, infers active constraints, and generates a response. This works well for short conversations and simple tasks.
6
6
 
7
7
  It breaks down reliably in longer conversations, correction flows, and multi-turn constraint management. Constraints drift. Corrections get partially applied or treated as additive rather than authoritative replacements. Contradictions accumulate instead of resolving. The model interprets intent rather than enforcing it.
8
8
 
@@ -16,7 +16,7 @@ Explicit state management is not a new idea. Earlier AI systems maintained struc
16
16
 
17
17
  The core insight is simple: maintain an explicit active set of rules rather than inferring the relevant context from history each time. What is in the active set is known with certainty. What is not in it is not active.
18
18
 
19
- These approaches succeeded in narrow, well-defined domains precisely because explicit state gives you guarantees that implicit inference cannot. The limitation was not the state management approach it was that handling natural language and ambiguity was extraordinarily difficult. Those problems consumed most of the design effort.
19
+ These approaches succeeded in narrow, well-defined domains because explicit state gives guarantees that implicit inference cannot. The limitation was not state management itself. Handling natural language and ambiguity was the hard part, and that work consumed most of the design effort.
20
20
 
21
21
  Modern LLMs handle natural language interpretation and generation far more effectively than earlier systems. This changes the calculus: the language interface problem is largely addressed. As end-to-end neural approaches became dominant, many systems shifted toward transcript-driven implicit state management, assuming a capable model could handle state implicitly.
22
22
 
@@ -26,8 +26,8 @@ That assumption is incorrect in practice, for the structural reason described ab
26
26
 
27
27
  Context Compiler applies explicit state management to the modern LLM context, with a clear division of responsibilities:
28
28
 
29
- - The LLM handles what it is genuinely good at — language understanding, reasoning, generation, handling ambiguity in user intent
30
- - The deterministic engine handles what probabilistic systems handle poorly maintaining explicit state across turns, enforcing constraints, guaranteeing that corrections replace rather than compete with prior state
29
+ - The LLM handles what it does well: language understanding, reasoning, generation, and ambiguity in user intent
30
+ - The deterministic engine handles what probabilistic systems handle poorly: keep explicit state across turns, enforce constraints, and make corrections replace prior state instead of competing with it
31
31
 
32
32
  The preprocessor layer bridges the two: it uses the LLM's language understanding to translate natural language directive intent into canonical form, which the deterministic engine can then process reliably. Fuzzy where it needs to be fuzzy, deterministic where determinism matters.
33
33
 
@@ -15,8 +15,7 @@ layer. Do not rely on repo-relative preprocessor paths.
15
15
 
16
16
  ## Architectural framing
17
17
 
18
- The preprocessor is a helper layer in your app, not the source of truth for
19
- state changes.
18
+ The preprocessor helps your app, but it does not own state changes.
20
19
 
21
20
  Model/tool-description translation can help with simple direct cases, but
22
21
  integrations should not rely on model intent translation alone to decide when
@@ -25,10 +24,10 @@ state changes.
25
24
  In simpler hosts without an embedded model, this preprocessor provides a
26
25
  conservative translation path.
27
26
 
28
- In model-assisted hosts, the app still checks outputs before applying them.
27
+ In model-assisted hosts, the app still validates outputs before applying them.
29
28
 
30
29
  Both paths send canonical directives to the same deterministic engine. The
31
- engine still controls state updates.
30
+ engine controls state updates.
32
31
 
33
32
  In MCP/tool-calling environments, over-eager tool calling on conversational or
34
33
  ambiguous input is a known failure mode. Conservative preprocessing and
@@ -36,7 +35,7 @@ validation help reduce unintended mutation.
36
35
 
37
36
  ## Required flow
38
37
 
39
- Recommended conceptual flow:
38
+ Recommended flow:
40
39
 
41
40
  1. heuristic preprocessing
42
41
  2. validate candidate output
@@ -73,7 +73,7 @@ Introduce multiple engines only when you need **independent lifecycle or isolati
73
73
  ## Combining Policies from Multiple Sources
74
74
 
75
75
  If you need to combine constraints from separate sources, do it explicitly in
76
- host code by replaying directives through `step(...)` into a target engine.
76
+ host code: replay directives through `step(...)` into a target engine.
77
77
 
78
78
  Pattern:
79
79
 
@@ -81,5 +81,5 @@ Pattern:
81
81
  2. Replay each directive via `engine.step(...)`
82
82
  3. Handle any returned `clarify` decisions explicitly
83
83
 
84
- This keeps conflict handling in normal engine semantics and avoids adding merge
85
- semantics to core state APIs.
84
+ This keeps conflict handling in normal engine behavior and avoids adding merge
85
+ rules to core state APIs.
@@ -29,7 +29,7 @@ See the LiteLLM examples README for setup and usage:
29
29
  - Context Compiler runs before each LLM call.
30
30
  - If result is `clarify`, show the question and do not call the LLM.
31
31
  - If result is `passthrough`, send normal user input.
32
- - If result is `update`, use updated state and call the model with saved state added to the prompt.
32
+ - If result is `update`, use updated state and call the model with saved state in the prompt.
33
33
 
34
34
  ## LiteLLM Proxy
35
35
 
@@ -105,7 +105,7 @@ Use `llama` only for LLM-only preprocessing with Llama-family models.
105
105
 
106
106
  ## Usage pattern
107
107
 
108
- These files are importable integration references for host applications.
108
+ You can import these files as integration references in host applications.
109
109
 
110
110
  - Import `handle_turn(...)` from either `basic.py` or `with_preprocessor.py`.
111
111
  - Create and retain an engine instance in host/session state.
@@ -1,7 +1,7 @@
1
1
  # LiteLLM Proxy (pre-call hook)
2
2
 
3
3
  This example shows how to run Context Compiler inside a LiteLLM proxy pre-call hook.
4
- The hook applies fixed state handling before any upstream model call.
4
+ The hook applies fixed state rules before any upstream model call.
5
5
 
6
6
  Available hook files:
7
7
 
@@ -1,9 +1,9 @@
1
1
  # Open WebUI Pipe Integration
2
2
 
3
- Examples of Open WebUI Pipe Functions that run Context Compiler.
3
+ Examples of Open WebUI Pipe Functions that use Context Compiler.
4
4
 
5
5
  Tested target: Open WebUI `v0.8.12` (latest at time of testing).
6
- Runtime-validated on stock Docker Open WebUI with a real backend model provider.
6
+ Validated at runtime on stock Docker Open WebUI with a real backend model provider.
7
7
 
8
8
  Compatibility note: OpenWebUI `0.9.x` changed `Users.get_user_by_id` to async.
9
9
  These examples support both sync (`0.8.x`) and async (`0.9.x`) user lookup.
@@ -49,11 +49,11 @@ If using `open_webui_pipe_with_preprocessor.py`:
49
49
  - Optional: set `PREPROCESSOR_MODEL_ID` to route fallback precompilation through
50
50
  a separate model. If unset, fallback uses `BASE_MODEL_ID`.
51
51
  - Fallback routing is Open WebUI-native (no LiteLLM dependency for this pipe).
52
- - The heuristic preprocessor is intentionally conservative/high-precision and
52
+ - The heuristic preprocessor is intentionally conservative and high-precision, and
53
53
  may abstain on mixed-prose natural language (for example, `i think we should
54
54
  use docker`). In those cases, behavior may remain passthrough unless fallback
55
55
  precompilation returns a validated canonical directive.
56
- - Invalid configured model ids return explicit runtime misconfiguration errors:
56
+ - If you configure invalid model ids, the pipe returns explicit runtime errors:
57
57
  - `BASE_MODEL_ID` not found in Open WebUI models
58
58
  - `PREPROCESSOR_MODEL_ID` not found in Open WebUI models
59
59
 
@@ -80,7 +80,7 @@ Use the Open WebUI model picker/list to copy exact model ids for `BASE_MODEL_ID`
80
80
  - No Redis/DB/external storage.
81
81
  - No Filters or Pipelines.
82
82
  - No production hardening.
83
- - Version-coupled to Open WebUI internal helper/import paths.
83
+ - Tied to Open WebUI internal helper/import paths by version.
84
84
 
85
85
  ## Manual Validation
86
86
 
@@ -1,12 +1,12 @@
1
1
  # Experimental Preprocessor Package
2
2
 
3
- This package provides optional app-layer preprocessing utilities for Context
4
- Compiler integrations.
3
+ This package provides optional preprocessing helpers for app integrations with
4
+ Context Compiler.
5
5
 
6
6
  It is experimental and separate from the deterministic core engine in `src/`.
7
7
 
8
- Model/tool-description translation can help with simple direct cases, but raw
9
- model output is not safe by itself for state changes. The app must validate
8
+ Model or tool-description translation can help in simple direct cases, but raw
9
+ model output is not safe for state changes on its own. The app must validate
10
10
  outputs before applying them.
11
11
 
12
12
  In MCP/tool-calling environments, over-eager tool calling on conversational or
@@ -65,7 +65,7 @@ Raw preprocessor/LLM outputs must not be passed directly to the compiler.
65
65
  Raw model output must never directly change state.
66
66
 
67
67
  The preprocessor does not expand directive grammar. It may emit only validated
68
- canonical directives accepted by the compiler.
68
+ canonical directives that the compiler accepts.
69
69
 
70
70
  Conservative boundary policy:
71
71
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "context-compiler"
7
- version = "0.7.2"
7
+ version = "0.7.3"
8
8
  description = "Deterministic conversational state engine for LLM applications."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -73,6 +73,18 @@ Portable checkpoint import contract coverage for
73
73
  `engine.import_checkpoint(...)`, including deterministic validation/error
74
74
  boundaries, atomic failure behavior, and pending-clarification clearing semantics.
75
75
 
76
+ ## Controller fixtures
77
+
78
+ For [`conformance/controller/`](conformance/controller/):
79
+
80
+ Portable controller contract coverage for:
81
+
82
+ * `step(engine, user_input)` result envelope and state snapshot
83
+ * `preview(engine, user_input)` result envelope, `would_mutate`, and non-mutation of live engine state
84
+ * `state_diff(state_before, state_after)` deterministic structural diff output
85
+
86
+ These fixtures keep a minimal, language-neutral contract matrix for controller APIs.
87
+
76
88
  ## Source of truth
77
89
 
78
90
  Fixtures reflect current Python behavior and tests.
@@ -26,7 +26,8 @@
26
26
  "export_checkpoint",
27
27
  "import_checkpoint",
28
28
  "export_checkpoint_json",
29
- "import_checkpoint_json"
29
+ "import_checkpoint_json",
30
+ "has_pending_clarification"
30
31
  ]
31
32
  }
32
33
  }
@@ -0,0 +1,38 @@
1
+ {
2
+ "id": "checkpoint_export_checkpoint_json_wrapper_shape",
3
+ "kind": "checkpoint",
4
+ "initial_state": {
5
+ "premise": null,
6
+ "policies": {},
7
+ "version": 2
8
+ },
9
+ "prelude": [
10
+ "set premise concise replies",
11
+ "use docker"
12
+ ],
13
+ "action": {
14
+ "fn": "export_checkpoint_json"
15
+ },
16
+ "expected": {
17
+ "payload_json_parseable": true,
18
+ "payload_object": {
19
+ "checkpoint_version": 1,
20
+ "authoritative_state": {
21
+ "premise": "concise replies",
22
+ "policies": {
23
+ "docker": "use"
24
+ },
25
+ "version": 2
26
+ },
27
+ "pending": null
28
+ },
29
+ "has_pending_clarification": false,
30
+ "state": {
31
+ "premise": "concise replies",
32
+ "policies": {
33
+ "docker": "use"
34
+ },
35
+ "version": 2
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "id": "checkpoint_import_checkpoint_json_restores_authoritative_state_no_pending",
3
+ "kind": "checkpoint",
4
+ "initial_state": {
5
+ "premise": null,
6
+ "policies": {},
7
+ "version": 2
8
+ },
9
+ "action": {
10
+ "fn": "import_checkpoint_json",
11
+ "payload": "{\"authoritative_state\":{\"policies\":{\"pytest\":\"use\"},\"premise\":\"baseline\",\"version\":2},\"checkpoint_version\":1,\"pending\":null}"
12
+ },
13
+ "expected": {
14
+ "has_pending_clarification": false,
15
+ "state": {
16
+ "premise": "baseline",
17
+ "policies": {
18
+ "pytest": "use"
19
+ },
20
+ "version": 2
21
+ },
22
+ "followup": {
23
+ "input": "yes",
24
+ "decision": {
25
+ "kind": "passthrough",
26
+ "state": null,
27
+ "prompt_to_user": null
28
+ },
29
+ "state": {
30
+ "premise": "baseline",
31
+ "policies": {
32
+ "pytest": "use"
33
+ },
34
+ "version": 2
35
+ },
36
+ "has_pending_clarification": false
37
+ }
38
+ }
39
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "id": "checkpoint_checkpoint_json_round_trip_state_and_pending_parity",
3
+ "kind": "checkpoint",
4
+ "initial_state": {
5
+ "premise": null,
6
+ "policies": {},
7
+ "version": 2
8
+ },
9
+ "prelude": [
10
+ "use kubectl instead of docker"
11
+ ],
12
+ "action": {
13
+ "fn": "checkpoint_json_round_trip"
14
+ },
15
+ "expected": {
16
+ "state": {
17
+ "premise": null,
18
+ "policies": {},
19
+ "version": 2
20
+ },
21
+ "has_pending_clarification": true,
22
+ "followup": {
23
+ "input": "maybe",
24
+ "decision": {
25
+ "kind": "clarify",
26
+ "state": null,
27
+ "prompt_to_user": "Did you mean to use \"kubectl\" instead?"
28
+ },
29
+ "state": {
30
+ "premise": null,
31
+ "policies": {},
32
+ "version": 2
33
+ },
34
+ "has_pending_clarification": true
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "id": "checkpoint_pending_clarification_through_checkpoint_json_restore_yes_resolution",
3
+ "kind": "checkpoint",
4
+ "initial_state": {
5
+ "premise": null,
6
+ "policies": {},
7
+ "version": 2
8
+ },
9
+ "prelude": [
10
+ "use kubectl instead of docker"
11
+ ],
12
+ "action": {
13
+ "fn": "checkpoint_json_round_trip"
14
+ },
15
+ "expected": {
16
+ "state": {
17
+ "premise": null,
18
+ "policies": {},
19
+ "version": 2
20
+ },
21
+ "has_pending_clarification": true,
22
+ "followup": {
23
+ "input": "yes",
24
+ "decision": {
25
+ "kind": "update",
26
+ "state": {
27
+ "premise": null,
28
+ "policies": {
29
+ "kubectl": "use"
30
+ },
31
+ "version": 2
32
+ },
33
+ "prompt_to_user": null
34
+ },
35
+ "state": {
36
+ "premise": null,
37
+ "policies": {
38
+ "kubectl": "use"
39
+ },
40
+ "version": 2
41
+ },
42
+ "has_pending_clarification": false
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "id": "checkpoint_import_checkpoint_json_malformed_rejected",
3
+ "kind": "checkpoint",
4
+ "initial_state": {
5
+ "premise": null,
6
+ "policies": {},
7
+ "version": 2
8
+ },
9
+ "action": {
10
+ "fn": "import_checkpoint_json",
11
+ "payload": "{"
12
+ },
13
+ "expected": {
14
+ "error": {
15
+ "type": "ValueError",
16
+ "message_contains": "Invalid JSON payload"
17
+ },
18
+ "has_pending_clarification": false,
19
+ "state": {
20
+ "premise": null,
21
+ "policies": {},
22
+ "version": 2
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "id": "checkpoint_import_checkpoint_json_invalid_shape_rejected",
3
+ "kind": "checkpoint",
4
+ "initial_state": {
5
+ "premise": null,
6
+ "policies": {},
7
+ "version": 2
8
+ },
9
+ "action": {
10
+ "fn": "import_checkpoint_json",
11
+ "payload": "[]"
12
+ },
13
+ "expected": {
14
+ "error": {
15
+ "type": "ValueError",
16
+ "message_contains": "Invalid checkpoint payload"
17
+ },
18
+ "has_pending_clarification": false,
19
+ "state": {
20
+ "premise": null,
21
+ "policies": {},
22
+ "version": 2
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "id": "checkpoint_import_checkpoint_json_invalid_authoritative_state_rejected",
3
+ "kind": "checkpoint",
4
+ "initial_state": {
5
+ "premise": null,
6
+ "policies": {},
7
+ "version": 2
8
+ },
9
+ "action": {
10
+ "fn": "import_checkpoint_json",
11
+ "payload": "{\"checkpoint_version\":1,\"authoritative_state\":{\"premise\":null,\"policies\":[],\"version\":2},\"pending\":null}"
12
+ },
13
+ "expected": {
14
+ "error": {
15
+ "type": "ValueError",
16
+ "message_contains": "Invalid state payload"
17
+ },
18
+ "has_pending_clarification": false,
19
+ "state": {
20
+ "premise": null,
21
+ "policies": {},
22
+ "version": 2
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "id": "checkpoint_import_checkpoint_json_invalid_payload_is_all_or_nothing",
3
+ "kind": "checkpoint",
4
+ "initial_state": {
5
+ "premise": null,
6
+ "policies": {},
7
+ "version": 2
8
+ },
9
+ "prelude": [
10
+ "use kubectl instead of docker"
11
+ ],
12
+ "action": {
13
+ "fn": "import_checkpoint_json",
14
+ "payload": "{\"checkpoint_version\":1,\"authoritative_state\":{\"premise\":\"new premise\",\"policies\":{\"pytest\":\"use\"},\"version\":2},\"pending\":{\"kind\":\"replacement\",\"replacement\":{\"kind\":\"use_only\",\"new_item\":\"kubectl\",\"old_item\":\"docker\"},\"prompt_to_user\":\"confirm?\"}}"
15
+ },
16
+ "expected": {
17
+ "error": {
18
+ "type": "ValueError",
19
+ "message_contains": "Invalid checkpoint payload"
20
+ },
21
+ "has_pending_clarification": true,
22
+ "state": {
23
+ "premise": null,
24
+ "policies": {},
25
+ "version": 2
26
+ },
27
+ "followup": {
28
+ "input": "maybe",
29
+ "decision": {
30
+ "kind": "clarify",
31
+ "state": null,
32
+ "prompt_to_user": "Did you mean to use \"kubectl\" instead?"
33
+ },
34
+ "state": {
35
+ "premise": null,
36
+ "policies": {},
37
+ "version": 2
38
+ },
39
+ "has_pending_clarification": true
40
+ }
41
+ }
42
+ }