ommat 0.5.1__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.
- ommat-0.5.1/.gitignore +10 -0
- ommat-0.5.1/CHANGELOG.md +273 -0
- ommat-0.5.1/CODE_OF_CONDUCT.md +84 -0
- ommat-0.5.1/CONTRIBUTING.md +49 -0
- ommat-0.5.1/LICENSE +21 -0
- ommat-0.5.1/PKG-INFO +223 -0
- ommat-0.5.1/README.md +191 -0
- ommat-0.5.1/RELEASING.md +17 -0
- ommat-0.5.1/SECURITY.md +22 -0
- ommat-0.5.1/docs/assets/demo/assistant.py +149 -0
- ommat-0.5.1/docs/assets/demo/assistant_design.py +108 -0
- ommat-0.5.1/docs/assets/demo/demo.tape +50 -0
- ommat-0.5.1/docs/assets/demo/draw.py +568 -0
- ommat-0.5.1/docs/assets/demo.gif +0 -0
- ommat-0.5.1/docs/assets/demo.svg +111 -0
- ommat-0.5.1/docs/assets/three-turns.gif +0 -0
- ommat-0.5.1/docs/how-to/add-a-source.md +1069 -0
- ommat-0.5.1/docs/how-to/add_a_source/chat_binding.py +208 -0
- ommat-0.5.1/docs/how-to/add_a_source/chat_endpoint.py +47 -0
- ommat-0.5.1/docs/how-to/add_a_source/chat_run.py +60 -0
- ommat-0.5.1/docs/how-to/add_a_source/idia_path.py +11 -0
- ommat-0.5.1/docs/how-to/add_a_source/idia_run.py +138 -0
- ommat-0.5.1/docs/how-to/add_a_source/per_candidate.py +123 -0
- ommat-0.5.1/docs/how-to/add_a_source/reports_design.py +109 -0
- ommat-0.5.1/docs/how-to/add_a_source/reports_run.py +103 -0
- ommat-0.5.1/docs/how-to/add_a_source/span_binding.py +160 -0
- ommat-0.5.1/docs/how-to/add_a_source/street_spotter.py +41 -0
- ommat-0.5.1/docs/how-to/add_a_source/triage_design.py +81 -0
- ommat-0.5.1/docs/how-to/combine-designs.md +167 -0
- ommat-0.5.1/docs/how-to/combine_designs/combine_design.py +99 -0
- ommat-0.5.1/docs/how-to/combine_designs/combine_run.py +41 -0
- ommat-0.5.1/docs/how-to/gate-a-source.md +119 -0
- ommat-0.5.1/docs/how-to/gate_a_source/gate_design.py +116 -0
- ommat-0.5.1/docs/how-to/gate_a_source/gate_run.py +40 -0
- ommat-0.5.1/docs/how-to/hand-off-a-turn.md +161 -0
- ommat-0.5.1/docs/how-to/hand_off_a_turn/agent_run.py +67 -0
- ommat-0.5.1/docs/how-to/hand_off_a_turn/support_design.py +77 -0
- ommat-0.5.1/docs/how-to/hand_off_a_turn/turn_run.py +56 -0
- ommat-0.5.1/docs/how-to/lay-out-a-design.md +243 -0
- ommat-0.5.1/docs/how-to/lay_out_a_design/refund_checks.py +36 -0
- ommat-0.5.1/docs/how-to/lay_out_a_design/refund_design.py +188 -0
- ommat-0.5.1/docs/how-to/lay_out_a_design/refund_run.py +33 -0
- ommat-0.5.1/docs/how-to/read-a-record.md +151 -0
- ommat-0.5.1/docs/how-to/read_a_record/desk_design.py +87 -0
- ommat-0.5.1/docs/how-to/read_a_record/desk_run.py +62 -0
- ommat-0.5.1/docs/spec/README.md +583 -0
- ommat-0.5.1/docs/tutorials/decide-with-idia.md +187 -0
- ommat-0.5.1/docs/tutorials/decide_with_idia/decide_live.py +124 -0
- ommat-0.5.1/docs/tutorials/street_reports/street_reports_design.py +266 -0
- ommat-0.5.1/docs/tutorials/write-a-design.md +344 -0
- ommat-0.5.1/docs/tutorials/write_a_design/helpdesk_design.py +149 -0
- ommat-0.5.1/docs/tutorials/write_a_design/helpdesk_run.py +85 -0
- ommat-0.5.1/pyproject.toml +122 -0
- ommat-0.5.1/scripts/check_subjects.py +93 -0
- ommat-0.5.1/scripts/record_idia_e2e.py +111 -0
- ommat-0.5.1/scripts/record_idia_tutorial.py +74 -0
- ommat-0.5.1/scripts/regenerate_idia_fixtures.py +63 -0
- ommat-0.5.1/skills/ommat/SKILL.md +186 -0
- ommat-0.5.1/skills/ommat/toml.md +77 -0
- ommat-0.5.1/src/ommat/__init__.py +114 -0
- ommat-0.5.1/src/ommat/_answer.py +415 -0
- ommat-0.5.1/src/ommat/_axis.py +97 -0
- ommat-0.5.1/src/ommat/_binding.py +269 -0
- ommat-0.5.1/src/ommat/_binding_kit.py +398 -0
- ommat-0.5.1/src/ommat/_canonical.py +410 -0
- ommat-0.5.1/src/ommat/_component.py +271 -0
- ommat-0.5.1/src/ommat/_decide.py +597 -0
- ommat-0.5.1/src/ommat/_design.py +779 -0
- ommat-0.5.1/src/ommat/_documents.py +211 -0
- ommat-0.5.1/src/ommat/_fixture.py +633 -0
- ommat-0.5.1/src/ommat/_form.py +767 -0
- ommat-0.5.1/src/ommat/_interpret.py +2095 -0
- ommat-0.5.1/src/ommat/_ledger.py +2312 -0
- ommat-0.5.1/src/ommat/_load.py +3862 -0
- ommat-0.5.1/src/ommat/_markers.py +140 -0
- ommat-0.5.1/src/ommat/_provenance.py +189 -0
- ommat-0.5.1/src/ommat/_read_view.py +423 -0
- ommat-0.5.1/src/ommat/_refs.py +157 -0
- ommat-0.5.1/src/ommat/_replay.py +227 -0
- ommat-0.5.1/src/ommat/_sorter.py +46 -0
- ommat-0.5.1/src/ommat/_table.py +788 -0
- ommat-0.5.1/src/ommat/_typed.py +176 -0
- ommat-0.5.1/src/ommat/_types.py +1013 -0
- ommat-0.5.1/src/ommat/_values.py +674 -0
- ommat-0.5.1/src/ommat/_views.py +689 -0
- ommat-0.5.1/src/ommat/authoring/__init__.py +16 -0
- ommat-0.5.1/src/ommat/authoring/_reader.py +607 -0
- ommat-0.5.1/src/ommat/bindings/__init__.py +49 -0
- ommat-0.5.1/src/ommat/bindings/conformance.py +534 -0
- ommat-0.5.1/src/ommat/bindings/idia.py +450 -0
- ommat-0.5.1/src/ommat/conversation/__init__.py +115 -0
- ommat-0.5.1/src/ommat/conversation/_exchanges.py +225 -0
- ommat-0.5.1/src/ommat/conversation/pydantic_ai.py +144 -0
- ommat-0.5.1/src/ommat/evaluation/__init__.py +92 -0
- ommat-0.5.1/src/ommat/evaluation/_answers.py +178 -0
- ommat-0.5.1/src/ommat/evaluation/_deciding.py +201 -0
- ommat-0.5.1/src/ommat/evaluation/_diff.py +230 -0
- ommat-0.5.1/src/ommat/evaluation/_edit.py +938 -0
- ommat-0.5.1/src/ommat/evaluation/_gold.py +380 -0
- ommat-0.5.1/src/ommat/evaluation/_grid.py +459 -0
- ommat-0.5.1/src/ommat/evaluation/_reach.py +252 -0
- ommat-0.5.1/src/ommat/evaluation/_refusal.py +77 -0
- ommat-0.5.1/src/ommat/evaluation/_rescore.py +192 -0
- ommat-0.5.1/src/ommat/evaluation/_screen.py +349 -0
- ommat-0.5.1/src/ommat/evaluation/_store.py +220 -0
- ommat-0.5.1/src/ommat/evaluation/_switching.py +1039 -0
- ommat-0.5.1/src/ommat/helpers/__init__.py +68 -0
- ommat-0.5.1/src/ommat/helpers/_call.py +63 -0
- ommat-0.5.1/src/ommat/helpers/_choice.py +293 -0
- ommat-0.5.1/src/ommat/helpers/_combinator.py +237 -0
- ommat-0.5.1/src/ommat/helpers/_combine.py +442 -0
- ommat-0.5.1/src/ommat/helpers/_dead.py +328 -0
- ommat-0.5.1/src/ommat/helpers/_determined.py +25 -0
- ommat-0.5.1/src/ommat/helpers/_many.py +107 -0
- ommat-0.5.1/src/ommat/helpers/_numbers.py +8 -0
- ommat-0.5.1/src/ommat/helpers/_points.py +590 -0
- ommat-0.5.1/src/ommat/lens/__init__.py +96 -0
- ommat-0.5.1/src/ommat/lens/__main__.py +72 -0
- ommat-0.5.1/src/ommat/lens/page.html +2467 -0
- ommat-0.5.1/src/ommat/outline/__init__.py +28 -0
- ommat-0.5.1/src/ommat/outline/__main__.py +112 -0
- ommat-0.5.1/src/ommat/outline/_common.py +282 -0
- ommat-0.5.1/src/ommat/outline/_design.py +472 -0
- ommat-0.5.1/src/ommat/outline/_layout.py +157 -0
- ommat-0.5.1/src/ommat/outline/_path.py +256 -0
- ommat-0.5.1/src/ommat/outline/_reach.py +116 -0
- ommat-0.5.1/src/ommat/outline/_review.py +179 -0
- ommat-0.5.1/src/ommat/outline/_text.py +650 -0
- ommat-0.5.1/src/ommat/outline/_turn.py +478 -0
- ommat-0.5.1/src/ommat/outline/_types.py +201 -0
- ommat-0.5.1/src/ommat/py.typed +0 -0
- ommat-0.5.1/src/ommat/types.py +105 -0
- ommat-0.5.1/tests/authoring_grounded.toml +46 -0
- ommat-0.5.1/tests/authoring_rules.py +39 -0
- ommat-0.5.1/tests/authoring_slice.toml +68 -0
- ommat-0.5.1/tests/authoring_table.toml +31 -0
- ommat-0.5.1/tests/conftest.py +25 -0
- ommat-0.5.1/tests/counting.py +40 -0
- ommat-0.5.1/tests/designs.py +307 -0
- ommat-0.5.1/tests/extraction.py +147 -0
- ommat-0.5.1/tests/format_1/design.json +1 -0
- ommat-0.5.1/tests/format_1/record.json +1 -0
- ommat-0.5.1/tests/format_10/design.json +1 -0
- ommat-0.5.1/tests/format_10/record.json +1 -0
- ommat-0.5.1/tests/format_10_record/broken.record.json +1 -0
- ommat-0.5.1/tests/format_10_record/design.json +1 -0
- ommat-0.5.1/tests/format_10_record/record.json +1 -0
- ommat-0.5.1/tests/format_11/design.json +1 -0
- ommat-0.5.1/tests/format_11/record.json +1 -0
- ommat-0.5.1/tests/format_12/broken.record.json +1 -0
- ommat-0.5.1/tests/format_12/design.json +1 -0
- ommat-0.5.1/tests/format_12/record.json +1 -0
- ommat-0.5.1/tests/format_2/design.json +1 -0
- ommat-0.5.1/tests/format_2/record.json +1 -0
- ommat-0.5.1/tests/format_3/design.json +1 -0
- ommat-0.5.1/tests/format_3/record.json +1 -0
- ommat-0.5.1/tests/format_4/design.json +1 -0
- ommat-0.5.1/tests/format_4/record.json +1 -0
- ommat-0.5.1/tests/format_5/design.json +1 -0
- ommat-0.5.1/tests/format_5/record.json +1 -0
- ommat-0.5.1/tests/format_6/design.json +1 -0
- ommat-0.5.1/tests/format_6/record.json +1 -0
- ommat-0.5.1/tests/format_7/design.json +1 -0
- ommat-0.5.1/tests/format_7/record.json +1 -0
- ommat-0.5.1/tests/format_7_record/design.json +1 -0
- ommat-0.5.1/tests/format_7_record/turn.record.json +1 -0
- ommat-0.5.1/tests/format_8/design.json +1 -0
- ommat-0.5.1/tests/format_9/design.json +1 -0
- ommat-0.5.1/tests/format_9/record.json +1 -0
- ommat-0.5.1/tests/idia_e2e.py +110 -0
- ommat-0.5.1/tests/idia_logs/classifier.json +347 -0
- ommat-0.5.1/tests/idia_logs/design.json +1 -0
- ommat-0.5.1/tests/idia_logs/extractor.json +296 -0
- ommat-0.5.1/tests/idia_logs/turn.record.json +1 -0
- ommat-0.5.1/tests/idia_logs/tutorial/classifier.json +686 -0
- ommat-0.5.1/tests/idia_logs/tutorial/extractor.json +581 -0
- ommat-0.5.1/tests/idia_logs/tutorial/output.txt +35 -0
- ommat-0.5.1/tests/ledger_logs.py +506 -0
- ommat-0.5.1/tests/lens_stub.js +125 -0
- ommat-0.5.1/tests/outline_showcase.py +246 -0
- ommat-0.5.1/tests/scripted.py +347 -0
- ommat-0.5.1/tests/showcase/broken.record.json +1 -0
- ommat-0.5.1/tests/showcase/decided.record.json +1 -0
- ommat-0.5.1/tests/showcase/design.json +1 -0
- ommat-0.5.1/tests/showcase/full.design.json +1 -0
- ommat-0.5.1/tests/showcase/idia.design.json +1 -0
- ommat-0.5.1/tests/showcase/idia.record.json +1 -0
- ommat-0.5.1/tests/showcase/level.record.json +1 -0
- ommat-0.5.1/tests/showcase/plain.design.json +1 -0
- ommat-0.5.1/tests/showcase/plain.record.json +1 -0
- ommat-0.5.1/tests/showcase/undecided.record.json +1 -0
- ommat-0.5.1/tests/test_alike.py +47 -0
- ommat-0.5.1/tests/test_answer.py +397 -0
- ommat-0.5.1/tests/test_answers.py +306 -0
- ommat-0.5.1/tests/test_authoring.py +1140 -0
- ommat-0.5.1/tests/test_binding.py +205 -0
- ommat-0.5.1/tests/test_binding_kit.py +577 -0
- ommat-0.5.1/tests/test_boundaries.py +483 -0
- ommat-0.5.1/tests/test_canonical.py +893 -0
- ommat-0.5.1/tests/test_check_subjects.py +31 -0
- ommat-0.5.1/tests/test_combine.py +636 -0
- ommat-0.5.1/tests/test_conformance.py +508 -0
- ommat-0.5.1/tests/test_conformance_fuzz.py +235 -0
- ommat-0.5.1/tests/test_conversation_pydantic_ai.py +364 -0
- ommat-0.5.1/tests/test_dead_grounded.py +294 -0
- ommat-0.5.1/tests/test_dead_questions.py +479 -0
- ommat-0.5.1/tests/test_decide.py +1831 -0
- ommat-0.5.1/tests/test_decide_many.py +206 -0
- ommat-0.5.1/tests/test_deciding_inputs.py +556 -0
- ommat-0.5.1/tests/test_defect_warning.py +236 -0
- ommat-0.5.1/tests/test_design.py +200 -0
- ommat-0.5.1/tests/test_determined.py +102 -0
- ommat-0.5.1/tests/test_do_and_diff.py +1395 -0
- ommat-0.5.1/tests/test_extraction.py +654 -0
- ommat-0.5.1/tests/test_extraction_turn.py +1021 -0
- ommat-0.5.1/tests/test_extras.py +538 -0
- ommat-0.5.1/tests/test_fixture.py +395 -0
- ommat-0.5.1/tests/test_format_10.py +152 -0
- ommat-0.5.1/tests/test_format_11.py +265 -0
- ommat-0.5.1/tests/test_format_12.py +221 -0
- ommat-0.5.1/tests/test_format_3.py +1141 -0
- ommat-0.5.1/tests/test_format_4.py +333 -0
- ommat-0.5.1/tests/test_format_5.py +52 -0
- ommat-0.5.1/tests/test_format_6.py +45 -0
- ommat-0.5.1/tests/test_format_7.py +48 -0
- ommat-0.5.1/tests/test_format_8.py +20 -0
- ommat-0.5.1/tests/test_from_record.py +454 -0
- ommat-0.5.1/tests/test_gold_answers.py +544 -0
- ommat-0.5.1/tests/test_gold_record.py +235 -0
- ommat-0.5.1/tests/test_grounded_lints.py +24 -0
- ommat-0.5.1/tests/test_grounded_rules.py +512 -0
- ommat-0.5.1/tests/test_grounded_sources.py +440 -0
- ommat-0.5.1/tests/test_groups.py +84 -0
- ommat-0.5.1/tests/test_helpers.py +438 -0
- ommat-0.5.1/tests/test_helpers_choice.py +540 -0
- ommat-0.5.1/tests/test_helpers_combinators.py +569 -0
- ommat-0.5.1/tests/test_how_to_add_a_source.py +255 -0
- ommat-0.5.1/tests/test_how_to_combine_designs.py +41 -0
- ommat-0.5.1/tests/test_how_to_gate_a_source.py +41 -0
- ommat-0.5.1/tests/test_how_to_hand_off_a_turn.py +53 -0
- ommat-0.5.1/tests/test_how_to_lay_out_a_design.py +95 -0
- ommat-0.5.1/tests/test_how_to_read_a_record.py +41 -0
- ommat-0.5.1/tests/test_idia_binding.py +1188 -0
- ommat-0.5.1/tests/test_idia_e2e.py +118 -0
- ommat-0.5.1/tests/test_interpret.py +3829 -0
- ommat-0.5.1/tests/test_key_order.py +747 -0
- ommat-0.5.1/tests/test_label_sets.py +886 -0
- ommat-0.5.1/tests/test_ledger.py +2175 -0
- ommat-0.5.1/tests/test_lens.py +4156 -0
- ommat-0.5.1/tests/test_load.py +2562 -0
- ommat-0.5.1/tests/test_load_document.py +859 -0
- ommat-0.5.1/tests/test_markers.py +324 -0
- ommat-0.5.1/tests/test_outline.py +1562 -0
- ommat-0.5.1/tests/test_own_functions.py +134 -0
- ommat-0.5.1/tests/test_package.py +370 -0
- ommat-0.5.1/tests/test_per_candidate.py +1173 -0
- ommat-0.5.1/tests/test_pick_each.py +397 -0
- ommat-0.5.1/tests/test_provenance.py +797 -0
- ommat-0.5.1/tests/test_pypi_readme.py +50 -0
- ommat-0.5.1/tests/test_question_reach.py +792 -0
- ommat-0.5.1/tests/test_read_points.py +676 -0
- ommat-0.5.1/tests/test_read_view.py +733 -0
- ommat-0.5.1/tests/test_readme.py +71 -0
- ommat-0.5.1/tests/test_record.py +767 -0
- ommat-0.5.1/tests/test_record_sets.py +503 -0
- ommat-0.5.1/tests/test_refs.py +234 -0
- ommat-0.5.1/tests/test_replay.py +1268 -0
- ommat-0.5.1/tests/test_rescore.py +554 -0
- ommat-0.5.1/tests/test_rescore_grid.py +1348 -0
- ommat-0.5.1/tests/test_reuse.py +1730 -0
- ommat-0.5.1/tests/test_scenario.py +527 -0
- ommat-0.5.1/tests/test_screen_switches.py +832 -0
- ommat-0.5.1/tests/test_showcase_documents.py +158 -0
- ommat-0.5.1/tests/test_skill.py +34 -0
- ommat-0.5.1/tests/test_slice.py +87 -0
- ommat-0.5.1/tests/test_sorter.py +254 -0
- ommat-0.5.1/tests/test_spec_citations.py +38 -0
- ommat-0.5.1/tests/test_stores.py +363 -0
- ommat-0.5.1/tests/test_street_reports.py +309 -0
- ommat-0.5.1/tests/test_switching_values.py +1787 -0
- ommat-0.5.1/tests/test_tables.py +1444 -0
- ommat-0.5.1/tests/test_targets.py +405 -0
- ommat-0.5.1/tests/test_turn_history.py +567 -0
- ommat-0.5.1/tests/test_tutorial.py +21 -0
- ommat-0.5.1/tests/test_tutorial_idia.py +71 -0
- ommat-0.5.1/tests/test_types.py +1389 -0
- ommat-0.5.1/tests/test_untested_basics.py +21 -0
- ommat-0.5.1/tests/test_untested_behaviour.py +284 -0
- ommat-0.5.1/tests/test_use_answers.py +549 -0
- ommat-0.5.1/tests/test_values.py +794 -0
- ommat-0.5.1/tests/test_views.py +1223 -0
- ommat-0.5.1/tests/test_wording.py +261 -0
- ommat-0.5.1/tests/transcript_turns.py +123 -0
- ommat-0.5.1/tests/typing_strict.py +12 -0
ommat-0.5.1/.gitignore
ADDED
ommat-0.5.1/CHANGELOG.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to ommat are recorded here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Before 1.0, a minor release may break the API; each break is listed under **Changed** or **Removed**.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [0.5.1] - 2026-11-29
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- The `idia` extra takes idia 0.3 from PyPI, `idia>=0.3,<0.4`, where it took idia 0.2 from its git tag. ommat and idia install from PyPI, as `pip install "ommat[idia]" "idia[openai,cloudflare]"`.
|
|
12
|
+
- `oracle_binding` drops a list extraction's span, keeping its values, when idia places an item nowhere, as idia 0.3 may for an item that repeats in the text, with a line `<source>: span dropped <ref>: an item placed nowhere in the text`. A fault idia 0.3 raises under its new rule `reported_invalid` is `invalid-answer` with a line naming the rule, as any fault is.
|
|
13
|
+
- The kind of model that answers a closed question with probabilities instead of prose is called a judgement model, not a decision model, in the package description, keywords and docstrings.
|
|
14
|
+
- The README as the package's metadata carries it, the PyPI project page, points each relative link at the file on GitHub and each image at the raw file, both at the release's tag.
|
|
15
|
+
|
|
16
|
+
## [0.5.0] - 2026-11-27
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- `decide_sync` and `replay_sync` take `runner=None`, an `asyncio.Runner` the caller owns. Each turn then runs by `runner.run` in a copy of the caller's context, not under `asyncio.run` on a fresh loop, so many turns on one thread share one loop and pay for none. A runner not exactly an `asyncio.Runner` is an `EntryRefusal`, raised before the coroutine is built; a closed runner raises its own `RuntimeError` and runs nothing.
|
|
21
|
+
- With a runner, a task a binding leaves is cancelled, and a `to_thread` thread past its timeout waited for, when the runner closes, not when the turn ends.
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- A design names no policy, and decide designates no entry: a turn's result is its record, and a caller reads each estimate it acts on from `decision.record.entries[ref]` and judges for itself whether an entry it acts on is undecided (holds a marker). Interpret fires every rule, as before; load refuses nothing for a rule nothing reads.
|
|
26
|
+
- The design document is format 12, where it was 11: it holds no `policy` member, and check 11 refuses a format-12 document holding one as a member its form does not have. **Every design hash changes**, so a record decided under 0.4.0 replays under the same design rebuilt with a `design-mismatch` finding, and the evaluation jobs refuse it `wrong-design` under it. Load refuses every stored design document of format 11 or earlier with check 11, naming its format; the outline and the lens still read them.
|
|
27
|
+
- The record is format 11, where it was 10, and `RECORD_FORMATS` is 1 to 11. Its `settings` item names no `policy`: the reader refuses `policy` in a format-11 record, and still requires it, a `d:` key of `providers` with no field path and no key of `grounded`, in a record of formats 8 to 10. Each old format reads to its own bytes and hash under its own rules.
|
|
28
|
+
- A broken entry writes `t:state` `Unavailable` with the entry cause in round 0 and nothing after it, where it also wrote the policy's ref with the same marker: the log ends at the `t:state` entry, and the reader refuses any item after a `t:state` entry holding a marker in a format-11 record, keeping the old order for formats 8 to 10. `defects` lists `t:state` alone for it, and `escalation(record, "t:state")` gives its cause; `escalation` at any rule's ref gives `None`, as the record holds no entry there.
|
|
29
|
+
- A record is unfinished when it holds a `cause` item, as a cancelled turn's, whatever entries it holds. Replay, the do-and-diff jobs, rescore and the gold jobs refuse such a record `unfinished` as before. A record an observer's exception ended is now finished however far it got, where one that ended before the policy's entry was unfinished: replay reruns it and reports the entries past its end as `entry` findings, its unanswered calls as `stale-question`; `use_answers`, `intervene`, `scenario`, `rescore` and `gold_record` rerun it; `deciding_inputs` and `question_reach` refuse it `baseline-differs`.
|
|
30
|
+
- The lens has two views, Gravity and Turn, where it had eight. Gravity, the design as bodies on a force layout in 3D, or 2D with `g3=0`, opens for any set with a design; Turn, what a record shows in plain words, opens for a record no design pairs with. Gravity's panel carries what the other views said: with a turn, the verdict, play over the rounds with each round's sources, and entry and target chips that filter; for a selection, its neighbours as reads, read by and bears on, a table's rows with the output beside the row number as the turn ran them or as declared, a rule's parameters and bounds, a question's or tool result's wording and whole answer as a distribution, a target's statement, questions and estimators, and for the policy what it decides between; with a table and no turn, a `fired, of N loaded turns` column, a count over the turns paired by hash; with nothing selected, the design summary. Turn's All turns table has a tally of the loaded turns, decided by value and undecided by marker ref, whose counts filter it, and a turn that no design pairs with lists its entries by round. The Path, Overview, Explore, Targets, Outcomes and Graph views, the bounds panel and the header's lines are removed, as are the turn-overlay and lineage-only checkboxes and the hash keys `state`, `und`, `sort`, `up`, `down`, `dir`, `info`, `table`, `tmode`, `tgt`, `gdrag`, `ghide`, `gdom`, `gx` and `gov`, which are ignored; an old `node=` link selects that node's body. A held `null` reads `none`, not `no value`.
|
|
31
|
+
- `combine` keeps one copy of a source or rule two parts declare alike under one id, as it keeps a type, group or target, and refuses one they declare differently; an id one part declares as a source and another as a rule is still refused. Before, a repeated id was refused even when alike. A question several parts ask alike now goes in a source each part declares alike, so each part runs alone and the combined design asks it once.
|
|
32
|
+
- `escalation(record, ref)` takes the ref of the entry the caller acts on, required, where `escalation(record)` read the policy's entry from the record's `settings`. It returns the marker's five members at `ref`, and `None` when `ref` holds a value or no entry, for old and new records alike; a `ref` that is not exactly a `str`, not a ref, or carries a field path is a `ValueError`. Pass the ref your design named as its policy for the result 0.4.0 gave.
|
|
33
|
+
- `to_chat_completions(record, design=None, *, refs, turn=None)` and `to_model_messages(record, design=None, *, refs, model_name=None, provider_name=None, turn=None)` take `refs`, a required, non-empty `list` or `tuple` of distinct `d:` refs of the record's rules. Decide's result is keyed by those refs, each `{"value": v}` or `{"undecided": {"kind", "root_cause", "refs"}}`, where it was `{"decision": v}` or `{"undecided": ...}` for the policy alone: the `decision` member is gone, and `refs=["d:<former policy>"]` gives `{"d:<former policy>": {"value": v}}`. Decide's arguments leave out every ref of `refs`, and with the design are cut to the reads of all their rules and every marker. A record with no entry at one of `refs` renders `[]`; a ref the record's `providers` lacks, or `refs` that are not such refs, is a `ValueError`.
|
|
34
|
+
- `dead_questions(loaded, refs, *, values=None)` takes `refs`, required: a non-empty `list` or `tuple` of declared whole `d:` refs a rule provides, a repeat counted once. A question is `live` when two runs differ at some ref of `refs` by the entry's value or marker bytes, a marker's cause and refs included, or one run holds no entry there, where the runs were compared by the policy's entry alone. `refs` not a list or tuple is a `TypeError`; one empty, or naming any other ref (a `q:` or `t:` ref, a field path, a grounded declared ref, a ref no rule provides), is a `ValueError` before any run. Pass `[the former policy's ref]` for the report 0.4.0 gave.
|
|
35
|
+
- `question_reach(records, loaded, *, refs, values=None)` and `question_reach_sync` take `refs`, required and checked as `dead_questions` checks it, before `values` and before any record is read. A trial reaches when the entry it wrote at some ref of `refs` differs from the record's by those bytes, or one of the two holds none, where it compared the policy's entry alone. Pass `refs=[the former policy's ref]` for the report 0.4.0 gave.
|
|
36
|
+
- `deciding_inputs` judges the entry at a record's `settings.policy` as it judges every other entry, by value, or by marker kind and cause code: a trial that changes only the cause refs of a marker at that ref does not make a read `deciding`, where it did.
|
|
37
|
+
- The do-and-diff jobs' refusal of a record before format 8 says that this engine does not rerun its turn, where it said the record holds no policy's entry; the reason, `wrong-design`, is unchanged.
|
|
38
|
+
- `rescore(records, recorded, designs, *, refs)`, `rescore_sync`, `rescore_grid(records, recorded, loaded, points, *, refs)` and `rescore_grid_sync` take `refs`, required and checked as `dead_questions` checks it, against every design of `designs`, or `recorded` with none, and against `loaded` for the grid, before any record is read, the `ValueError` opening with the design it names. A row is `{"design", "record", "entries", "stale"}`: the member `decision` is renamed `entries`, which maps each ref of `refs` the run wrote, in code-point order, to `{"value": v}` or `{"marker": {...}}`, or is `"not-determined"`. Pass `refs=[the former policy's ref]` and read `row["entries"][ref]` for 0.4.0's `row["decision"]`. A state that does not type gives `entries` `{}`, since a broken entry writes `t:state` alone, where `decision` held the policy's `Unavailable` marker. The grid's regions do not depend on `refs`, so it reruns as often whichever are named.
|
|
39
|
+
- `switching_values` lists no entry always: `entries` holds each ref whose entry some run changed, or that carries the leaf, where it also held the policy's entry always, and a caller reads `entries.get(ref)`. Every entry is compared by value, or marker kind and cause code, so a change of a marker's cause refs alone is no switch. A value whose design does not load counts as a change to every `d:` entry the record holds, so each is listed with its `not-loading` class. A run that asks a stale question lists every `d:` entry the record holds in the same way, with its `not-determined` class. The `switching-value` entry is format 3, where it was 2; the job, single and batch, refuses a key the store holds under a format other than 3 `unknown-entry`, before `held-key` and any replay.
|
|
40
|
+
- The outline and the lens read a design that names no policy, every design of format 12, and a record whose `settings` item names none, every record of format 11, keyed on the member, not the format. The outline keeps every key: the design's `policy` and `policy_node` are `null`, each node's `policy` false and `steps_to_policy` `null`; the turn's `policy`, `decision` and `escalation` are `null`, each entry's `policy` false, `lineage` empty, and `status` `unfinished` only at a `cause` item. Its text says `decision none: the record names no decision` and `why no decision: the record names none`, for a record before format 8 too, where it said the record holds no policy, and its `summary` gives `-` in the decision column where it gave `no-decision`; Turn's Bounds fold says nothing of a decision. Turn heads such a record by its status, `Finished in N rounds`, `Broken entry` or `Cancelled`, where it said `No decision`, lists `The tables that ran` in the order they ran, and leaves out the All turns table's decision and root columns and its tally when no loaded turn's record names a policy; Gravity draws such a design with no centre and no lean, and its panel names no steps to a policy. A record or design that names a policy draws as before.
|
|
41
|
+
- The lens's and the outline's commands take a JSON object with a `rules` object and no `log` list as a design, where they took one holding `policy`. Every design document of every format holds `rules`.
|
|
42
|
+
|
|
43
|
+
### Removed
|
|
44
|
+
|
|
45
|
+
- `Design.policy`. `Design(state, *, sources=..., rules=..., parameters=..., types=..., groups=..., name=..., targets=...)` takes `state` as its one positional field; `Design(state, "d:x")` and `Design(policy=...)` are a `TypeError`. Delete the argument; the rule it named stays an ordinary rule, read from the record at its ref.
|
|
46
|
+
- `combine`'s `policy=` and its checks: `combine(*parts, bind, name=None)` returns the union of the parts and the rules bound to their ports. A rule that reads across parts, the former top policy, goes in as a part of its own, `Part(Design(state, rules={"act": rule}))`, or is merged into the combined design with `dataclasses.replace`; passing `policy=` is a `TypeError`.
|
|
47
|
+
- The authoring reader's `policy` key: `design_from` requires `state` alone, and a document that still says `policy = "d:x"` is refused with `AuthoringError` as `document: unknown key 'policy'`. Delete the line.
|
|
48
|
+
- `transcript(record)`, deprecated since 0.4.0, and its export from `ommat`. Render the record with an `ommat.conversation` renderer, or read the record for every value.
|
|
49
|
+
- `Decision.estimate`. A `Decision` holds `record` and `design_hash`, and its `repr` is `Decision(record=…)`. Read the entry at the ref you act on, the one your design named as its policy for 0.4.0's value, from `decision.record.entries[ref]`: `{"value": v}` with the value as recorded, or `{"marker": {"kind", "cause": {"code", "refs"}}}` where `estimate` rebuilt an `Unsure`, `Unavailable` or `Unasked`; test `"value" in entry`. For the marker object, `escalation(decision.record, ref)` gives its kind and cause.
|
|
50
|
+
- The stopping certificate, which this engine reserved and never ran: `RunSettings.certificate_cap`, the `certificate` item and the `settled` cause code. `RunSettings(certificate_cap=...)` is a `TypeError`, as any unknown argument is, and `CauseCode.settled` is gone. A format-11 record's run settings hold no `certificate_cap`, and the reader refuses it there, as it refuses a `certificate` item and a `settled` code in a format-11 record. A record of formats 1 to 10 reads as before, `certificate_cap` required in its run settings; replay and the evaluation jobs refuse one whose `certificate_cap` is not null with an `EntryRefusal`, as decide refused that setting. Drop `certificate_cap=None` from any `RunSettings(...)` call.
|
|
51
|
+
- `Source.feedback`, a flag nothing in the engine acted on. `Source(..., feedback=...)` is a `TypeError`, as any unknown argument is; a format-12 design document's source holds no `feedback` member, and check 11 refuses one holding it as a member its form does not have; the authoring reader refuses a source's `feedback` key as an unknown key with its path. Every design hash changes again, since every source's document member went with it. The outline reads the flag of a design of format 11 or earlier as before, and gives each node of a source without it `feedback` false. Delete the argument.
|
|
52
|
+
|
|
53
|
+
### Fixed
|
|
54
|
+
|
|
55
|
+
- The design and evaluation stores write on Windows. Every write raised there: `_create` called `os.fchmod`, absent before Python 3.13, and synced the directory through `os.open`, which Windows refuses. It now skips both on Windows, which has no POSIX modes and cannot open a directory to sync it.
|
|
56
|
+
- The lens and the outline refuse a document nested deeper than 128 as too deep whatever its top-level type. A deep top-level array was refused as not a JSON object, and whether parsing caught the depth first depended on the C stack, so on Python 3.14 under Linux a 100,000-deep array took the wrong refusal.
|
|
57
|
+
- `dead_questions` runs every point on one event loop. It opened a loop per run, and on Windows each loop opens a loopback socket pair whose ports wait about two minutes to close, so some 16,000 runs exhausted the ephemeral ports and the lint stalled.
|
|
58
|
+
- A git install of ommat on Windows is byte for byte the one on macOS or Linux. Git's Windows default, `core.autocrlf=true`, wrote every installed file with CRLF; `.gitattributes` now keeps text LF in every checkout. A rule's source hash never depended on line endings, so no design hash changes.
|
|
59
|
+
|
|
60
|
+
## [0.4.0] - 2026-11-16
|
|
61
|
+
|
|
62
|
+
### Added
|
|
63
|
+
|
|
64
|
+
- `ommat.authoring`: `design_from(doc, version=None, values=None, types=None)` reads a parsed mapping, such as a TOML document read with `tomllib`, as the `Design` it says, and `slice_from` as the `Slice` of `sources`, `rules` and `parameters` a larger design merges. A document names a question by its kind, a rule by `fn`, `type` and `reads`, and a decision table by `rows` that name only the inputs they test, with `like` copying another table; it has `[types]` and `[labels]` names, a `version` and parameter `values` the caller may supply, and a rule's `params` may hold patterns. A slip in a document is an `AuthoringError`, a `ValueError`, naming its path; `load` refuses what the design gets wrong. The reader imports each rule's `fn`, so a document is as trusted as source code. Its designs hash as their Python twins do, `import ommat` does not import it, and it takes nothing beyond the standard library.
|
|
65
|
+
- A key path, `leaf.key`, names one key of a numeric mapping leaf. A function rule's `boundaries` may name one wherever it names a `number` leaf, load refusing under check 8 a key path whose leaf is no `mapping<string, number>` or lacks the key; the answer grid, the lints' read points and the outline's bounds read the key's value. `rescore_grid` takes a key path in a point, `{"clarify/part_at.email": 0.6}`, beside or in place of the leaf given whole, and refuses a point naming a leaf both ways as `overlapping-paths`, a new `RefusalReason` member; it checks paths in code-point order. A function rule naming a key's path sees that key alone: the grid refuses `hidden-leaf` a key it varies that the rule names neither way, and `switching_values` lists the rule in `unseen` unless it names every key. Each key of a mapping leaf is bucketed, and probed, against the comparisons naming the leaf whole or that key's path.
|
|
66
|
+
- `rescore_grid(records, recorded, loaded, points)` in `ommat.evaluation`, async with a `_sync` twin: `rescore` over the designs a list of parameter points gives, each point `loaded` with its leaves set, returning the same rows in the same order while rerunning each record once per region of points whose runs cannot differ, read from each rerun's compared values, a tie joining the side its predicate puts it on. A grid leaf a run could reach other than by a comparison the job can see is refused `hidden-leaf` before any run, and points not naming one leaf set `uneven-grid`, both new `RefusalReason` members. On a 1,089-point grid over 384 records it runs in a small fraction of `rescore`'s time, its rows equal.
|
|
67
|
+
- `switching_values_batch(records, loaded, paths, *, functions=None, results)` in `ommat.evaluation`, async with a `_sync` twin: the switching-value job for many records and leaves on one event loop, sharing the design's work, the entries in record then path order. Every record and path is checked, the document loaded with `functions`, refused `invalid-design`, and every key looked up, in that order, before any replay; a held key is refused `held-key`, naming each.
|
|
68
|
+
- The rescoring job in `ommat.evaluation`: `rescore(records, recorded, designs)`, async with a `_sync` twin, decides each recorded turn again under each of several designs from its own answers, as replay would but checking each asked source against the record under `recorded`, and returns each decision as plain data, building no record; a design that asks a question the record does not answer gives `not-determined` with the stale refs. Scoring a grid of settings this way runs about three times as fast as deciding each point, on one event loop.
|
|
69
|
+
- Path C of [Add a source](docs/how-to/add-a-source.md#path-c-write-a-binding-over-a-chat-endpoint): a binding over a chat-completions endpoint, through a transport the caller passes, that answers `noul` and `choice` questions with verbalised probabilities to two places, marks a refusal `refused`, a reply off its form `invalid-answer` and a failed request `timed-out` or `raised` on its own ref, and records one provider and model, its tokens, a reason for each null detail and a provider figure in `extras`, importing only `ommat` and `ommat.bindings`, with its example in `docs/how-to/add_a_source/`.
|
|
70
|
+
- A how-to, [Lay out a design module so it reads](docs/how-to/lay-out-a-design.md): a docstring map checked against the design in a test, sections in one order, rule functions named for their refs, refs as literals, a table's inputs named, one bar per decision, a read-back into the caller's type, and a check that a tidy moved nothing but the hash, with its example in `docs/how-to/lay_out_a_design/`.
|
|
71
|
+
- `ommat.outline`, outside the compatibility promise: `design_outline(document)` and `turn_outline(record_document, design_document=None)` give a stored design or turn, as bytes or parsed, as a plain dict of fixed shape, every key present and `null` where the documents give nothing; `render_design` and `render_turn` print it as deterministic text, one node, call or entry per line. A design's nodes are in the dependency graph's topological order, ties in code-point order, with its edges, parameters, targets and a table's rows in the notation. A turn's rounds hold each call's provenance and each entry's value or marker, then the decision, `escalation` and `defects`; with the design the record ran under, each entry adds its declared reads, params and inputs, marked declared, its wording and targets, and each bound its design declares for it, with the distance in the choice helpers' exact arithmetic and `short` or `clear`. `python -m ommat.outline PATH... [--json] [-o FILE]` prints the files or folders given, each record beside the design whose bytes its `design` item hashes.
|
|
72
|
+
- The outline at `outline_version` 2 computes, from the documents alone: for a design, `layout`, each node's column and row, its columns sorted by barycentre sweeps to cross fewer edges; `fingerprint`, a hash of its shape with the names erased; and `short`, a short label per ref. For a turn, `deciding_path`, the entries the decision rests on, back to its root; `near_misses`, every bound nearest first; and `summary`, one line of fixed columns. The text gains a `why` line, a `path` and a `near misses` block, a star on each entry of the path, and folds each call's wire members into one line, which `render_turn(outline, wire=True)` and `--wire` expand; `--oneline` prints each record's summary.
|
|
73
|
+
- The lens draws from the outline. `ommat.lens` embeds each design's and each record's outline and text form, and its page draws the design as its dependency graph, one band per round and a sub-column per wavefront, each edge by its role; a turn over that graph, each entry washed by what it holds and marked against the bounds its design declares, the lineage from the decision to its root as a tree, the round costs, and a headline from the outline's `why` line; a panel of every bound by entry; a sortable table of the turns with a tally; and the text form beside them. A record pairs with the design whose hash it holds, else with one of the same name with a notice, else is drawn alone. The page opens outline JSON, the output of `python -m ommat.outline --json`, where it opened records; the Design, Turn and Turns views, the selection folding, the grouping by question identity, each answer's per-label percentages, tracing a selection's lineage through a design alone, and opening a folder of records in the page are gone. `page` also takes designs as a mapping from a name to the bytes.
|
|
74
|
+
- The outline at `outline_version` 3 takes the engine's words. A design's node has `kind` `state`, `source` or `rule`, the policy a rule with `policy` true and id `rule:<name>`, and `round`, the round interpret runs it in, and `wavefront`, with `predecessors`; an edge says `dependency`; `layout` has one column per round and wavefront. A turn's `status` is `finished` or `unfinished`, an entry `holds` its value or marker kind and has `nearest`, and the turn has `lineage`, `nearest_bounds` with `on_lineage`, and `absent`. `render_turn(outline, detail=True)` and `--detail` expand each call's `call detail` line.
|
|
75
|
+
- The outline at `outline_version` 4 computes, over a design's dependency edges, each node's `steps_to_policy`, the fewest edges to the policy node or `null`; `requirements`, each source with a requirement as `{source, provider, decided_from, behind}`, the node providing its ref, that node and every node it depends on, and every node behind the source; each target's `questions`, `{ref, node, role}`, `role` `asks` or the latent role, `estimated_by`, `readers`, the other rules reading those questions, and `path`, from its nearest estimating rule, else its nearest reader, to the policy; and each table row's `tests`, `{input, read, node, cell}`, the inputs whose cell is not `-`. The text form adds `to policy n` or `no path to the policy` to a node's line, a `requirements` block, and each target's questions, estimators, readers and path. At `outline_version` 5 a turn's outline adds `review`, each source asked, not asked with why, or with no entry, and each table entry's rows matched, not matched or untested, with the row that gave the value and each test's entry; `summary_nearest`, the bound the summary names; and `why`, the text form's why line. The text form ends with a `sources` block and a `table` block per table entry, and the lens reads `why` and `summary_nearest` rather than composing them.
|
|
76
|
+
- The lens draws outline version 6 and opens on the Turn tab at the first turn when given records, else on a design's overview. Turn says what took place in the selected record in plain words: the decision, or what an undecided turn rests on and the bound the summary names; each table the turn ran, every row with its result and each test beside what the turn held; the lineage; each source asked, with its questions' wording and answers; each source not asked, grouped by why; the sources that wrote nothing; and, folded, the bounds and the record's details. A menu in the header picks the turn. Its other tabs are Overview, the counts, the policy, the sources with and without a source requirement, the policy table's outputs and the targets' reach; Explore, a slice of the dependency graph around one node in the layout's columns and rows, a sidebar of every round's sources and rules grouped by their requirement, a map of the whole design and the node's details, with the selected turn's entries marked on the slice, the sidebar and the map, the round costs, the lineage starred, and each box showing what its refs hold; Targets, each target's questions, estimating rules, readers and path to the policy, or a matrix; Outcomes, a card per table row with its tests and, with a turn selected, the row's result and the turn's values; Targets also shows what the turn held; and Graph, the dependency graph and turn views as before. A source requirement edge is violet. The hash gains `view`, `up`, `down`, `dir`, `info`, `table` and `tmode`, and Explore's keys are `n`, `p`, `[`, `]`, `i`, `o`, `m` and `/`.
|
|
77
|
+
- Combining designs in `ommat.helpers`: `combine(*parts, bind, policy, name=None)` unions parts, each `Part(design, ports)`, its ports the `d:` refs it reads and no declaration of it provides, into one design under a top policy, renaming nothing. `bind` gives each port a rule or table, or a `d:` ref the port takes through a pass-through table. It raises `InvalidCombination`, its `failures` each a `CombineFailure`, listing every failure: parts whose states differ, an id or parameter path two parts declare, a type, group, target or class tree two parts declare differently, a port a part provides, an unbound port and a bind key that is no port, among others; a type, group, target or class tree declared alike is kept once, and load checks the rest. `standalone(part, ports=None, *, given=())` gives each port in `ports` a constant and each port in `given` a value each turn from the source `ports`, under the oracle `ports`, so a part loads and decides alone. The guide [Combine small designs into one](docs/how-to/combine-designs.md) shows a workflow selector and a workflow asked in one call.
|
|
78
|
+
- The question-reach job in `ommat.evaluation`: `question_reach(records, loaded, *, values=None)`, async with a `_sync` twin, asks the dead-question lint's question from recorded turns, for a design whose cross product of read points is too large to run. For each record in list order, and each `q:` entry a returned call wrote, in log order, it sets the entry, as `intervene` sets one, to each of its declared question's read points other than its recorded value or marker, a grounded entry's own marker last, a candidate-valued question's each fixed label and then the first candidate at 1 over the labels the call asked, and replays once per point. A trial whose replay reports `stale-question` is undetermined, and any other reaches when the decision it wrote differs from the record's. It returns `{"records", "trials", "questions": {ref: {"status", "witness"}}, "narrowed"}`, each `q:` ref a source provides `live`, with the first reaching trial's record hash, entry ref and value as its witness, `not-determined`, `no-change-found` or `never-asked`. `values` is checked as `dead_questions` checks it, its keys `q:` refs, before any record is read; each record is then refused `invalid-record`, `unfinished`, `nothing-to-replay`, `wrong-design` or `baseline-differs`, naming its turn, before the next is read and before any trial.
|
|
79
|
+
- `ommat.helpers.top(r, ref, *, tie="abstain")`, the top label of an answer and its probability; at an exact tie it abstains, or with `tie="first"` gives the tied label first in the answer's `labels`. The helper version is 4, so a record written under version 3 replays with a `helpers-mismatch` finding.
|
|
80
|
+
- `ommat.bindings.fixed(values)`, a binding to no provider answering each asked ref from a mapping, for a fact the caller holds, such as the date, or a test's scripted answers; an asked ref it does not hold is `unsupported`, with a line of `warnings`.
|
|
81
|
+
- `ommat.DefectWarning`, a `UserWarning` that `decide`, `decide_sync` and each turn of `decide_many` emit once the record closes when it holds a defect, an entry `defects` lists, carrying `record` and `defects` and naming each defect with its traceback. `warnings.simplefilter("error", ommat.DefectWarning)`, or pytest's `filterwarnings = ["error::ommat.DefectWarning"]`, makes such a turn raise with its whole record; replay, the evaluation jobs and `dead_questions` emit none. A turn with a defect prints a warning by default, which an `ignore::ommat.DefectWarning` filter silences.
|
|
82
|
+
- `defects(record)`, every entry whose cause is a defect by `escalation`'s test, whatever the policy gave, so a rule that raised on a decided turn is found, and `None` for a record before format 8; and `Record.entries`, each entry item by its ref, for a record of any format.
|
|
83
|
+
- The gold-answers job in `ommat.evaluation`: `write_gold_answers(gold_set, records, labels, *, results, copy_from=None)`, sync, writes a labeller's labels, `labels` as `{turn_id: {ref: label}}`, for the `q:` entries the calls of `records` wrote, as format-2 `gold-answer` entries keyed by the gold set, the question identity from the call item, the turn id and a grounded ref's candidate, and returns them. A label is a name of the question's labels, a candidate-valued set's from the set's entry in the record, never a description, or an extraction question's `{"value": v}`; `None` writes nothing. With `copy_from`, a key given no label takes the old set's label, a format-1 one included. An unfinished record is refused, and a copied label is checked as a given one. Every record is read, every label checked and every key looked up before the first write; the writes themselves are not atomic across keys. `RefusalReason` gains `invalid-label`, `conflicting-labels`, `unknown-entry` and `empty-copy`.
|
|
84
|
+
- The switching-value job in `ommat.evaluation`: `switching_values(record, loaded, path, *, functions=None, results)`, async with a `_sync` twin, replays a record under each value of the parameter leaf at `path`, each value's design `loaded`'s document with the leaf replaced, loaded with `functions`, or `loaded`'s own callables, and kept nowhere, and writes and returns one `switching-value` entry keyed by the record hash, the design hash and `path`. A numeric leaf, or interval, is probed in two rounds at the values the turn compares it against, a table cell's input, a `candidate` read's members included, a pick helper's label probabilities for `bar` and `thresholds`, the lead for `margin`, `p_null` for `extract`'s `null_bar`, and a function rule's reads its `boundaries` field names, with the lints' gap and end values, and on an integer axis the integers either side of each; round 1 adds the values round 0's replays recompute, and a component comparing a value only round 1 finds is listed in `unseen`. An entry's result is its value, or its marker's kind and code; every ref some run changed is listed, a not-determined run included. It gets switching values, the slacks of its own class, and classes. A `boolean` or `label` leaf is tried at every value and partitioned, and a numeric mapping has each key varied alone. An entry a matched table row passes the leaf through as `Param`, in any run, `carries` it; `unseen` is empty only when every way the leaf reaches a component is a comparison the job probed: it also names the function components declaring the leaf whose `boundaries` field does not name it, a `C+`, `C<` or `C>` table aggregating a `Param` of it beside another row, each reader of an entry holding the leaf, a boolean or label entry a function declaring it provides excepted, and each component a load failure names; a run that leaves the record is `not-determined` and a value that fails load `not-loading`. `RefusalReason` gains `unknown-path`, `unsupported-leaf` and `unrepresentable-slack`; `baseline-differs` is shared with the deciding inputs, and neither job counts a `helpers-mismatch` alone as one.
|
|
85
|
+
- The deciding inputs in `ommat.evaluation`: `deciding_inputs(record, loaded, ref, *, functions=None)`, async with a `_sync` twin, maps each declared read of the rule providing the entry at `ref` to `deciding`, `not-deciding`, `markers-only` or `not-determined`, by whether some single intervention on the read, as `intervene` makes one, changes that entry's value, or its marker's kind and cause code. A `q:` or `t:` read is tried through its entry, a grounded declared ref's through each of its entries, at each marker a binding may return and the record's format holds, a `q:` answer at `refused` only, a `t:` entry also at each value of a finite type, and its call failed with each structural code when every entry that call wrote is of the read's declared ref; a `t:state` field at each value of a finite type; a `d:` read by a constant rule at `Unsure` and each value of a finite type. A finite type is `boolean` or a label, either nullable. An intervention the form refuses at its target is not run, and one whose replay leaves the record is undetermined; a read with no intervention run, or with one undetermined and none deciding, is `not-determined`. A field-path read of a `t:` or `d:` entry is tried through the whole entry. Each intervention is single, so `not-deciding` says no single intervention changes the entry; joint effects are not explored. It refuses as `intervene` does, then `not-found` for a ref that is no entry of the record a rule provides, then `baseline-differs` when replaying the record under `loaded` gives any finding but `helpers-mismatch`, which notes only the helper version.
|
|
86
|
+
- Many turns in `ommat.helpers`: `decide_many(states, loaded, bindings, *, concurrency, settings=None, codec=None, observer_for=None)`, async, decides one turn per state, at most `concurrency` at once, and returns each `Decision` or `TurnFailure` in input order, a repeated state decided each time. A turn ended alone, by an entry refusal, an observer's raise or its own cancellation, is collected with its record so far; cancelling the run, or a `BaseException` that is not an `Exception`, aborts it.
|
|
87
|
+
- Read points in `ommat.helpers`: `points(loaded, ref, *, values=None)` gives one read's points, the values the lints range it over, in their order and record form. Question reach builds its trials from it. "Lint points" are now "read points".
|
|
88
|
+
- The answers table in `ommat.evaluation`: `answers(records, loaded, *, gold_set=None, results=None)`, sync, gives one row per question a call answered in each record, per candidate for a per-candidate question: the answer or marker, the top label, the question's targets and the groups naming it with their reasons; with a gold set, the gold answer and whether the answer erred, a missing gold answer kept as a row. A record of another design is `wrong-design`.
|
|
89
|
+
- The gold record in `ommat.evaluation`: `gold_record(record, recorded_design, gold_set, *, results, rerun_design=None)`, async with a `_sync` twin, replays a recorded turn with every question it asked set to its gold answer, so its decision is what correct answers lead to under the design. A question with no gold answer is stale and listed in `missing`. It returns `{"record", "findings", "stale", "missing"}`.
|
|
90
|
+
- Live scenarios in `ommat.evaluation`: `scenario(record, recorded_design, interventions, bindings, *, rerun_design=None, functions=None)`, async with a `_sync` twin, is `intervene` with each stale source asked of `bindings`, whole, and every other answer pinned from the record. A mixed call keeps the live provenance and its warnings name the base record and each pinned ref; a live failure fails the whole call. The turn runs on a live clock under the base's settings with no forced cut. It returns `{"record", "findings", "stale", "pinned"}`.
|
|
91
|
+
- Do-and-diff's scenario with no live binding in `ommat.evaluation`: `intervene(record, recorded_design, interventions, *, rerun_design=None, functions=None)`, async with a `_sync` twin, replays a copy of a recorded turn once under a list of interventions, under `rerun_design`, a design the caller built, when given; `recorded_design` is the design the record was decided under. An intervention sets a `q:` or `t:` entry a returned call wrote to a value or to a marker a binding may return (`{"ref", "value"}`), pinning it; sets a returned call to `Failed` with a structural code, every entry it wrote `Unavailable` (`{"source", "code"}`); sets a `t:state` field (`{"path", "value"}`); replaces a rule by a one-row table outputting a value or `Unsure` (`{"rule", "output"}`), the rules so replaced loaded in one document; or asks a source afresh (`{"ask"}`), staling every ref of it. The targets are disjoint, so the list's order changes nothing. A record edit is made on a copy of the record, which gets its own `hash` and is read back through `read_record`. It returns `{"record", "findings", "stale"}`, the replay record, replay's findings and the stale refs; the edited copy is not returned. An empty list with `rerun_design` given replays under it alone. `RefusalReason` gains `null-call`, `failed-call`, `marker`, `nonconforming`, `fault-code`, `not-found`, `candidate-rule`, `invalid-edit`, `no-edit`, `duplicate-target`, `conflicting-edits` and `invalid-design`.
|
|
92
|
+
- The design store and the evaluation store in `ommat.evaluation`. `DesignStore(root)` keeps a loaded design's document under the design hash it carries, at `sha256/<hex>`, accepting the same bytes again and refusing others with `held-mismatch`, and `fetch(key, *, functions=None)` gives it back through `load`, refusing a malformed key with `bad-key`, a key not held with `not-held` and bytes that hash to another key with `hash-mismatch`. `EvaluationStore(root)` keeps write-once entries `{"kind", "format", "key", "value"}` of the kinds `gold-answer` and `switching-value` at `<kind>/sha256/<hex>`, the hash of the key's canonical bytes: `write` refuses with `invalid-entry`, `unknown-kind` and `held-key`, and `lookup(kind, key)` returns the entry or `None`, refusing a file that is not that entry with `misfiled-entry`. Each file is written whole by exclusive create. `RefusalReason` gains the eight reasons, and `EvaluationRefusal.key` holds a design hash or an evaluation key's members.
|
|
93
|
+
- The `Known` cell: a table cell, `Known` in the notation and `{"known": true}` in the document, matches any value, null included, and no marker. A row failing on it does not meet marker rule 2, so a row holding `Known` over an input gives way to the next row when that input is down; the input's entry keeps its marker. In a design written in Python, a label spelt `Known` is now written `{"is": "Known"}`.
|
|
94
|
+
- Groups give their reasons: `Group(refs, reason)`, `reason` a non-empty list of `convergent`, `discriminant`, `exclusive`, `exhaustive` and `consistent`, a misspelt or repeated one refused at load (check 9). The document holds a group as `{"refs", "reason"}`. "Correlated group" is now "group".
|
|
95
|
+
- A value cell (`is` or `one_of`) over a `pick_with_margin` or `pick_with_thresholds` input whose question has a candidate-valued label set may name one of its fixed labels, such as `none`; the input stays `string`, and a cell naming any other value still fails check 9, now listing the fixed labels.
|
|
96
|
+
- The lint and the lens over grounded forms: a grounded `t:` source's entries range over their declaration's points. A cell over a `candidate` read adds nothing to the grid. The lens links a `candidate` read to the set's card.
|
|
97
|
+
- Grounded sources of `t:` refs: a source grounded over a candidate set provides each `t:` ref once per candidate, under the grounded refs the engine forms and passes in `refs`; a binding reads each one's candidate with the new `ommat.bindings.candidate_of`. Each value is checked alone. A per-candidate question may hold a slot on a declared ref grounded over its own set, filled from that candidate's entry and given to the binding as a need under the grounded ref; a marker there leaves that candidate's question out.
|
|
98
|
+
- Grounded rules and tables: a function rule or a table declared `grounded=ref` over a candidate set runs once per candidate, reading `candidate`, `candidate.f` and the current candidate's entry of a declared ref grounded over the same set, and writes one entry per candidate at `d:x["<candidate>"]`, each with its own `derivation` or `rows`. A set holding a marker gives the declared ref the set's need marker, and an empty set writes nothing. A reader of the declared ref gets a `dict` by candidate value. Load refuses a `candidate` read outside a grounded component, a field it does not name, a table reading a grounded ref of another set, a field path on a grounded ref outside its set, and a grounded candidate set.
|
|
99
|
+
- Candidate sets of records: a candidate set may be a list of a record type whose `candidates` member names its candidate field, a `string` field, each other field a scalar, a scalar or null, or a list of a scalar. Its members are distinct by their candidate values; a per-candidate question's grounded refs, a candidate slot, a candidate-valued label set's labels, the read view's `dict` and an `in` cell over the set all go by the candidate value. The record's `settings` item names each set's candidate field under `sets`, null for a `list<string>` set, and `redact` digests a record candidate under its field's class. Load reserves the name `candidate`.
|
|
100
|
+
- Decision tables. A rule, the policy among them, may be a `Table`, under the hit policies `U`, `A`, `P`, `F`, `C+`, `C<`, `C>` and `C#`. An input is a read or a `Helper` calling `pick_with_margin`, `pick_with_thresholds`, `size`, `mass` or `extract` over one; a cell is written in the spec's notation (`-`, `Unsure`, `>= urgent/bar`, `[lo, hi]`, `{a, b}`, `in d:x`, a label) or the tagged form load writes in the document; an output is a value, `Unsure`, `Input(ref)` or `Param(path)`. A data rule is a one-input table. A table's entry holds `rows`, every matching row, and the marker contract's two rules pass an input's marker on. Load checks every cell, output and hit policy, and refuses overlapping rows under `U`, and under `A` when their outputs differ. The answer grid takes a table's comparisons, integer value cells and helper bindings, an integer literal included, and the dead-question lint runs over tables. The lens shows a table's inputs as its reads. A cell may list marker kinds, `Unsure or Unavailable` or `Undetermined` for all three, so one row takes an optional input's outage. `Helper`, `Input` and `Param` are public.
|
|
101
|
+
- The lens at scale: a selection in the Design or Turn view brings its links to the top of each column and folds the rest into a stub per column that says how many and why, never "unrelated", with a control to dim them in place instead; a page with a column past 40 cards turns compact, each card keeping its value on one line, its bars, a call's outcome and its boundary notes; an answer's labels past its leader and runner-up fold into one "Other" bar, keeping every label a threshold or mass bound names, and a call's long question list folds after four; a selected answer's question opens in the Turns view with "Compare across turns".
|
|
102
|
+
- The lens's Design and Turns views. `ommat.lens` shows a design with or without a record: its targets, questions, rules, the policy among them, and parameters, and the lineage of any card, a target's questions, latent links by role and estimating rules included, the rest dimmed as having no link declared. A turn's entries show their targets, and its answers the bars, thresholds, margins and mass bounds their design declares. The Turns view tables the records by design hash or by question identity. `python -m ommat.lens` writes a page for a design alone.
|
|
103
|
+
- Targets: a design may declare `targets={id: Target(statement, values=None)}`, the properties of the state its questions and rules are about. A `Question` takes `target`, the target it asks about, and `latent_targets`, each `{"target": id, "role": TargetRole}` with the role `reflective`, `formative` or `unknown`; a `Rule` takes `target`, the target it estimates. They guide a reader and gate nothing: no turn reads one, and a question's identity leaves them out. Load refuses an undeclared target id, a question's own target as latent, a link repeated under one role and a member of another form. `Target` and `TargetRole` are public.
|
|
104
|
+
- The lens has a Path tab, after Turn. It opens with a card for the policy and one for each rule result it reads, each giving what the rule held in the selected turn and one square per answer it declares: filled when the record shows the rule read it, through a helper of its derivation or by a table row that matched, open when it is declared alone, dashed when the turn holds no value for it. Every node has a lane, that of the one such result its dependencies first reach, and a selected rule draws the other rules of its lane as cards in the layout's columns. Under them a map draws the whole design as a grid, a row to a lane and a column to a round, each node once, with no lines: the selected rule's reads are lit, solid where the record shows the read and dashed where it is declared alone, with the reads the record shows further back and the nodes that read it. The selected rule opens its entries, parameters, table and the rule results it declares, then the answers it read and the ones it declares that are not recorded as read, each with its wording, top label and probability. The hash's `view` takes `path`, and `node` is its selected rule.
|
|
105
|
+
- Per-candidate picks: `ommat.helpers.pick_each_with_margin(r, ref, bar, margin)` and `pick_each_with_thresholds(r, ref, thresholds, margin)` read a per-candidate question's declared ref and return a new `dict` in the set's order from each candidate to its pick, to `Unsure` with `abstained` naming that candidate's grounded ref, or to its entry's marker unchanged, so a rule weighing every candidate no longer takes the argmax itself.
|
|
106
|
+
- A how-to, [Gate a source on an earlier estimate](docs/how-to/gate-a-source.md): a source requirement over a label-valued projection asks a later source only when an estimate holds a value, without sending the estimate, so `oracle_binding(provider, state=...)` still applies.
|
|
107
|
+
- `unsure_to_execute` runs an abstention search: for each question a rule on the policy's lineage, through the dependency graph, reads, or each candidate of a per-candidate one, it runs whole turns with that question, the subject, at its abstention point, every label 0 or a null extraction value, on which every pick and `extract` abstains, and reports a run whose plan is `execute` while a lineage rule returned a pick or `extract` over it. Reads the lineage rests on range one at a time from their first points and others hold one point, and each subject stops at its first finding, so the search grows with the sum of the reads' points, not their product. Once a lineage rule reads a question, the lint needs the free inputs `dead_questions` needs; a missing one is a `ValueError` naming every unfilled read.
|
|
108
|
+
- A spec section on source requirements: what a `SourceRequirement` declares and reads, that its ref orders the source and is not sent unless it is also a need, what the gated source gets, and the load checks that apply.
|
|
109
|
+
- `ommat.helpers.determined(r, *refs)` returns a `tuple` of its reads' values, or the marker of highest precedence among them unchanged, so a rule passes a read's marker on without testing each read.
|
|
110
|
+
- The context block and the handoff: a design may declare `context=Context(entries, plan=True, steps=True, record=True)`, each `ContextEntry(ref, text)` flagging `t:state` or a `d:` ref, with or without a field path, and wording it with a `Text` whose slots name refs or parameters. Compile renders the block into the `plan` item's new `context` member, an entry holding a marker instead of text when a slot reads one, and replay checks it byte for byte. `handoff(record)` gives the next reader the design, the record hash, the plan's kind, text and verdict kind, its steps with each argument tagged and resolved, only under a passed verdict, and the entries, each part under its switch; it never holds the guard's failures, a requirement, a probability or provenance. Load refuses a duplicate flagged ref, a `q:` ref, a slot over an `identifier` class and a text with no slot naming its flagged ref. `redact` digests each rendered text and the design's name. A how-to, `docs/how-to/hand-off-context.md`, shows it with the transcript and both renderers, with its examples and test in `docs/how-to/hand_off_context/`.
|
|
111
|
+
- The transcript: `transcript(record)` gives every source call of a turn and its conclusion, unworded, for an LLM conversation: each call's asked refs, recorded outcome and answers, the board's estimates, the plan, the verdict and the context entries as recorded, each value and marker tagged, and a passed `execute` plan's steps with their resolved arguments when it binds no earlier result. Each id is `om_`, 24 hex digits of the record hash and `_c<n>`, `_d` or `_s<n>`, so it fits a provider's tool-call id. It holds no `t:state`, provenance, prompt or derivation.
|
|
112
|
+
- `ommat.lens`, outside the compatibility promise: `page(records, designs=(), *, skipped=())` renders stored records as one self-contained HTML page, each round's calls and entries, the answers as percentages, the plan and the verdict, with the lineage of any entry, call or the plan a click away: from the record, and, with the design paired by its hash, from each rule's and the policy's declared reads and each source's needs, requirement, candidate set and the refs its questions read. `python -m ommat.lens PATH [-o FILE] [--open]` writes it for a record file or a folder of records and designs. The page loads nothing from the network and holds the records whole, user text included, so keep it as you keep them.
|
|
113
|
+
- `ommat.conversation`, outside the compatibility promise, wording nothing: `handoff_text(handoff)` renders a handoff as labelled lines for a model's instructions, and `to_chat_completions(view, *, turn=None)` renders a transcript as Chat Completions messages, each source call and decide a tool call with its result and the pending steps calls for the caller to run. `ommat[pydantic-ai]` adds `ommat.conversation.pydantic_ai.to_model_messages(view, *, model_name=None, provider_name=None, turn=None)`, the same as Pydantic AI messages, a failed call's return marked `outcome="failed"` and each response stamped, so an agent run with the history runs the pending calls with its own tools. The source calls and decide are marked as ommat's bookkeeping, and the pending calls not; each module's `is_bookkeeping(message)` tells one, and each module's `drop_earlier_bookkeeping(messages)`, the Pydantic AI one a history processor, drops an earlier turn's bookkeeping, each call with its result. Both renderers take an optional `turn`, which stems every id afresh, so one record rendered for two turns repeats no id. Every JSON string they write is in the ordered encoding, each object in the order the record holds it. A source's tool name maps `/` to `-`; a name no provider takes is a `ValueError`.
|
|
114
|
+
- The provenance profile: each call item states who answered and how, `provider`, `model_requested`, `model_reported`, `revision`, `runtime`, `elicitation`, `precision` and `prompt`, hashed, with `claimed`, the details the source asserts and cannot verify. A call that sent a request gives each detail a value or a reason in its `calls` entry's `missing`, from `not-reported`, `not-pinned`, `not-sent`, `hidden`, `not-applicable` and `not-exposed`, beside `request_id`, `calibrated` and `clients`, the versions of the libraries that made the call. `precision` may be `"unrounded"` or `{"step": "0.05"}` as well as decimal places. The idia binding maps idia's outcome onto it, a call whose requests name one package at two versions `Failed` with `invalid-return`, and the conformance suite's new `provenance` check holds a binding to it.
|
|
115
|
+
- Measured wording in, the same wording out: a `noul` may declare `yes` then `no` with at least one described, and a question's wording may be `ommat.Structured(template, slots)`, a JSON object or array whose string values are templates, its objects kept in the order written. Both reach a binding through `RenderedQuestion`, the idia binding sends them as idia takes them, and a provider whose capabilities carry neither form refuses that question alone, `unsupported`. An undescribed `noul` and a `Text` wording keep their bytes and identities.
|
|
116
|
+
- Candidate-valued label sets: a `choice` declared with labels `{"fixed": [...], "candidates": ref, "at": k}` is asked over its fixed part with the members of a `list<string>` candidate set placed after its first `k` fixed labels (by default after all of them), a source's `t:` ref declared `{"type": list<string>, "candidates": True}` or a rule's `d:` ref with `candidates=True`, rendered each time it is asked. The set's members are distinct, a repeat `invalid-return`. A question whose set is a marker, is empty, renders too many labels or holds a fixed name is left out of its batch, `call` null, with `need-unavailable` or `need-undetermined`, `when-false`, the new `CauseCode.label_overflow`, or `label-collision`, naming the set. Replay's `question-changed`, `from_record`, the redacted view, the dead-question lint, the idia binding and the conformance suite each handle it. A candidate set of records stays refused at load.
|
|
117
|
+
- Per-candidate questions: a source declared `grounded="<ref>"` over a `list<string>` candidate set, a source's `t:` set or a rule's with `candidates=True`, asks each question whose wording holds a slot `{"candidate": <ref>}` once per candidate, in the same request as its other questions, which are asked once. Each is asked under its grounded ref, `q:x["<candidate>"]`, the candidate as RFC 8785 writes a string, its wording rendered with the candidate, and one question identity covers every candidate. A rule reads the declared ref and gets a `dict` from each candidate, in the set's order, to its `Answer` or marker, or the set's need marker when the set held one; reading it also reads the set. An empty set asks nothing for the question. The set is a need only when declared. A choice helper reads one ref's answer, so a rule works on the `Answer` objects in the `dict`. Load still refuses grounded rules, grounded `t:` sources, a per-candidate extraction question or one over a candidate-valued label set, and a need or slot ref on a per-candidate question's declared ref. Over an empty set nothing is asked for that question, and a source left with nothing to ask is not called, its `when` not run, and not charged. Load refuses a group mixing grounded and ungrounded `q:` refs or refs over different sets.
|
|
118
|
+
- The record's `settings` item holds `grounded`, each per-candidate question's declared ref mapped to its set's ref, `{}` when the design grounds nothing; a format-6 record requires it. The call item keys a per-candidate question's one `questions` entry by its declared ref.
|
|
119
|
+
- `dead_questions` grounds a per-candidate question's entries from its set at each point, varying them fastest, reports it once under its declared ref, and has a new status, `not-grounded`, for a per-candidate question that no point grounded; it raises `ValueError` when a `d:` set differs between runs of one assignment, which it cannot fix.
|
|
120
|
+
- A how-to, `docs/how-to/add-a-source.md`: a new source answered through an idia provider, idia's `gliner` leaf among them, or by a binding of your own over a model in your process, with its example and test in `docs/how-to/add_a_source/`.
|
|
121
|
+
- A tutorial, `docs/tutorials/decide-with-idia.md`: the street-reports design decided with OpenAI's Decisions and Cloudflare's Clairic through `ommat[idia]`, each call's record read, replayed, and answered again from a stored record. Its script is in `docs/tutorials/decide_with_idia/`, and its test replays the live run from recorded logs.
|
|
122
|
+
- `ommat[idia]` and `ommat.bindings.idia`: `oracle_binding(provider, *, state=None)` binds an oracle to a provider through an idia `Dispatcher` over one leaf, one idia request per source under the call's `seconds`, each object sent in the order it is received, each answer, refusal, fault and failed request mapped to the value or marker ommat takes. `state` names a need that a label source sends as the whole JSON part, its value alone in place of an object keyed by refs, so a caller sends the state shape it measured a provider on; a label source that needs it beside another need, images aside, is `unsupported`, and a `state` that is not a non-empty string is a `ValueError`. Install it with `pip install "ommat[idia] @ git+https://github.com/CRSiegfried/ommat@v0.4.0"`, after idia 0.1.0 with the extras for its providers, as the README shows.
|
|
123
|
+
- `seconds`: interpret calls each binding as `binding(batch, seconds=s)`, `s` the time the call has, the smaller of the batch's timeout and the time left to the deadline. A binding converts it to its provider's deadline. A binding that does not take the keyword raises `TypeError` at its first call, so the call is `Failed` with `raised` on every ref of the batch.
|
|
124
|
+
- A binding may mark a ref `Unavailable` with `timed-out` or `raised` when the provider request that carried it ran out of time or failed, with the request's status and message as `warnings` lines; the other refs of the call stand, and the call is `returned`. Under a `returned` call these markers are the binding's; on a `Failed` call, the engine's. Replay returns them as recorded.
|
|
125
|
+
- The image need: a need whose value is exactly `{"media_type": ..., "data": ...}`, `media_type` naming an image media type such as `image/png` and `data` the image's bytes, declared `record(media_type=string, data=bytes_)`, is an image; a binding whose provider takes images sends it as one, and `ommat.bindings.image_need` reads it.
|
|
126
|
+
- `ommat.bindings`, the binding kit, what a binding author calls, which `import ommat` does not import, its eight names public under the same deprecation rule as `ommat.__all__`: `OracleBinding`, the type of a binding, `async def binding(batch, *, seconds)`, which `oracle_binding` returns; `RequestProvenance`, one request's provenance, which `call_result` folds; `extraction_value(value, guess, p_null, confidence, span)` returns the five-member dict an extraction question's ref takes, with each `date`, `time`, `datetime` and `timedelta` written in ommat's grammar, and raises `ValueError` for a value the grammar cannot hold; `bounded_warnings(lines)` returns a `warnings` tuple that conforms, escaping surrogates, leaving out blank lines, and past either bound ending with a line counting those left out; `json_value(value)` returns a need's value in record form, each answer as its document and a tuple as a list, and raises `TypeError` for `bytes` at any depth; `image_need(value)` returns an image need's `(media_type, data)`, or `None`; `prompt_text(prompt)` returns a mapping prompt as `json.dumps(prompt)`, its keys in the order given at every depth, raising `TypeError` for a key that is not a `str`, and a `str` or `None` as given; `call_result(values, requests, *, precision, warnings=())` folds each request's `RequestProvenance` into the call's `CallResult`: its distinct string details and `request_id` one per line, `runtime` and `clients` merged, a package at two versions a `ValueError`, `claimed` the union, `calibrated` false when any request says false, `missing` a reason only where every request lacks the detail, `usage` and `attempts` summed, `truncated` sorted, and no provenance when no request made an attempt. The idia binding uses the other seven.
|
|
127
|
+
- `ommat.bindings.conformance.check(binding, *, batches=None, deterministic=False)`: the binding conformance suite. It calls a binding with the given batches, or with its own covering each answer kind, an image need, a `t:` source, a candidate-valued question and a per-candidate question, and returns the protocol's failures as strings naming their check: `seconds`, `returns`, `values`, `markers`, `answers`, `per-ref-cause`, `warnings`, `precision`, `provenance`, `unsupported-provenance` and `deterministic`, which ignores `request_id`; an empty list passes.
|
|
128
|
+
|
|
129
|
+
### Changed
|
|
130
|
+
|
|
131
|
+
- Record format 10: whatever a provider reports beyond the provenance profile goes in `CallResult.extras`, one JSON object per request the call sent, in the order the requests were given, `{}` for a request that reports nothing more; interpret writes it in the call's `unhashed.calls` entry as `extras`, outside every hash and no detail, keeps one off its form under `invalid["extras"]` with no fault, and `redact` digests it as one value whatever the policy names. `usage` holds `input_tokens` and `output_tokens` alone, and `usage.passes` is no longer a detail. A binding that still returns `usage={"passes": ...}` gets its `usage` written null, and one that still gives a `missing` reason for `usage.passes` gets its `missing` written null, each with its repr under `invalid` and no error; a `claimed` naming `usage.passes` fails the call `invalid-return`. A call names one `provider` and one `model_requested`: either holding a line break is `invalid-return`, and `call_result` raises `ValueError` when its sent requests name two providers or two requested models. `RequestProvenance` takes `extras`. `ommat.bindings` exports `DETAILS`, `REASONS` and `USAGE_KEYS`. The conformance suite checks `extras`, the two usage keys and the one-line names, and its `deterministic` check leaves `extras` out. The idia binding needs idia 0.2: it maps each sent outcome's `extras` to its request's `extras` as given, Clairic's pass count among them, and reads no raw usage; ommat's recorded idia logs are upgraded to idia's log format 4. Records of formats 1 to 9 read as before, a format-8 or format-9 `passes` included; the reader refuses `extras` before format 10 and `passes` from it. A redacted view digests any `calls` entry member it does not know. The outline's `outline_version` is 8, its calls carrying `extras`.
|
|
132
|
+
- The redaction policy is the caller's. `redact(record, root_key, policy)` takes `policy`, required, a mapping from a ref of the record, or a ref and a field path into its shape, to `open`, `identifier` or `content`, or an object of fields; every value it names nothing for is `content`, numbers, labels, answers and probabilities included, and a candidate takes the policy's class at its set's ref wherever it is copied. Structure and the text the engine records with no type are treated as before, the policy naming neither. The view gains `applied`, the policy applied, each ref's class tree in full, and the per-turn key's info adds the hash of `applied` after the record hash, so views of one record under policies that apply differently share no digest; `redact` raises `ValueError` for a policy of another form or naming what the record lacks. In a record before format 9 the stored class trees are a floor: the class of a value is the more restrictive of the policy's, `content` where it names nothing, and the stored one, by `open` < `identifier` < `content`, so a policy never opens what the stored tree digests and `{}` digests all data. A literal argument no set tags is `content` whole.
|
|
133
|
+
- Record format 9 and design format 11: a design declares no `classes`, and `Design`, its document and `combine` have no class block; the `settings` item holds `shapes`, each ref's shape tree, `leaf` at each leaf, in place of `classes`, and the ledger holds each value to it as it held a value to its class tree and refuses a malformed one. Records of formats 1 to 8 read as before, with `classes`; load reads design format 11 alone and refuses a format-10 document with check 11, naming it. `Design` takes `state` and `policy` positionally and every other field by keyword, so a field added or removed never rebinds a positional argument. The outline's `outline_version` is 6, and the design outline no longer carries `classes`; a format-10 document's `classes` is listed under `other_members`.
|
|
134
|
+
- An answer's probabilities, and an extraction answer's `p_null` and `confidence`, are held as `float` when given as `int`, so a component reads the same type live and in replay. A record's bytes are unchanged.
|
|
135
|
+
- `switching_values` and `switching_values_batch` run about 3 times as fast, their entries unchanged, and `rescore` and `rescore_grid` gain from the same changes, their rows unchanged. A later run of a record takes a source's call from the record's first run, as it takes a rule's, when it asks the same sources together in the same round, none of their questions uses a leaf whose value differs and each is passed the refs, needs' values and labels it was passed there; the cost is charged to the budget again, and a function `when` is called as ever. Where no changed leaf is one a load check reads (a full load is taken otherwise), a probe's design is built from its changed parameter objects alone, its hash a fresh load's, and shares its base's decoded sources and shape. A record's entries are encoded once per record, and a probe's entry only when it differs from the record's. A probe keeps only its rerun's entries. An answer's sum is not summed where nothing keeps the flag. Over 8 records and 10 number leaves of a consumer's design, the switching job takes 0.18 s per record where it took 0.57 s.
|
|
136
|
+
- `rescore`, `rescore_grid` and `switching_values` work out each design's shape, its document without its leaves' values, once per loaded design, where they did it once per record: the shape and the decoded sources are held on the design and shared with each design `with_parameters` builds from it, across records and jobs. Rows and entries are unchanged; rescoring 8 records under 12 designs each loaded on its own, on a design of 82 function rules, takes 169 ms of CPU where it took 407 ms.
|
|
137
|
+
- `rescore_grid` keeps each rerun's log to the entries it reads, reads the compared values from an index of them built once per rerun, as `switching_values` now does once per log, and covers a point whose `boolean`, `label` and wording-slot values no other uncovered point shares without searching for its region. Rows are unchanged; on a design of 55 function rules and 8 number leaves over 1,383 records, a one-point grid runs in about the time of `rescore`, where it took two and a half times as long, and an 80-point grid about two and a half times as fast.
|
|
138
|
+
- `rescore`, `rescore_grid` and `switching_values` call a rule once per record rather than once per design where the designs cannot change what it reads: each later run of a record under a design differing only in leaf values takes a rule's outcome from the record's first run when the rule declares no changed leaf, its callable is the same and every entry its read view reaches is the same, exactly. Their rows and entries are unchanged; over sixteen designs whose leaves reach no costly upstream rule, a rescore runs about fifteen times as fast.
|
|
139
|
+
- `switching_values` builds each probed value's design without a full load when no load check reads that leaf's value, or a mapping leaf's changed keys, and reruns each probe writing no record; on a 1,089-point grid it runs about three and a half times as fast, its entries unchanged.
|
|
140
|
+
- A turn decodes its design's sources once per loaded design and hashes each question's identity once per design hash, where it did both on every turn, and `decide` decodes the closed record to look for a defect only when some item names a defect code. A 38-question turn decides about a quarter faster; records are unchanged.
|
|
141
|
+
- The renderers render a record as its turn history, minimal, for the next model. `to_chat_completions(record, design=None, *, turn=None)` and `to_model_messages(record, design=None, ...)` take the closed `Record`, where they took a `transcript` view, and give `[]` for a record before format 8 or one with no policy's entry. A source call's arguments are `{}`; a `noul`, `choice` or `score` answer is `[label, probability]`, its top label, an extraction `[value, confidence]`, a value has no tag and a marker is `{"marker", "cause"}`. Decide's arguments are the board itself; given the record's `LoadedDesign`, only the entries the policy reads and every marker. Decide's result is `{"decision": v}`, or `{"undecided": {"kind", "root_cause", "refs"}}` from the escalation view. A renderer raises `ValueError` for a record that is not exactly a `Record` and for a design that is not its `LoadedDesign`.
|
|
142
|
+
- The ready sources that name no oracle form one batch each round, under `default`, where each was a call of its own. The idia binding sends the sources of one call that share an equal state and options as one idia request; a source whose joined request the provider's preflight refuses goes alone, and so does one whose state differs.
|
|
143
|
+
- The policy is an ordinary rule, and its estimate is the turn's decision. A design names it as `Design(policy="d:<name>", rules={...})`, the `d:` ref of a function rule or a table it declares; load refuses a design with no policy, and a policy ref with a field path, with no provider, or that is grounded; any rule, table, source or `when` may read it as it reads any `d:` ref. Interpret fires it as any rule, and at a cut its drain fires every rule not yet fired, so every turn decide returns holds the policy's entry; its failures are any rule's. `Decision` holds the record alone and reads `estimate`, the policy's entry as a value or a rebuilt marker, and `design_hash` from it. A turn is undecided when the decision is a marker; `escalation(record)` gives the marker's kind, its cause, its root cause, found by following `required` causes to the entries they name, `defect`, whether the root cause is a `raised`, `invalid-return` or `undeclared-read` naming a rule or the codec, and the record hash, so a caller routes a defect apart from a turn it hands on. A broken entry writes `t:state` and then the policy's entry `Unavailable` with the entry cause, runs no interpret and writes no `cause` item.
|
|
144
|
+
- Record format 8: the `settings` item names the `policy`; each turn decide returns ends at the policy's entry; the log holds no `plan` or `verdict` item and no `cause` item but `cancelled`; and a `calls` entry's `usage` keys are the closed set `input_tokens`, `output_tokens` and `passes`, interpret writing `usage` null, its repr under `invalid`, for any other. Records of formats 1 to 7 read as before. Design format 10: the document's `policy` is a string ref; load reads format 10 alone and refuses every earlier format with check 11, naming it.
|
|
145
|
+
- The views and renderers show the decision. `transcript`'s `decide` is `{"id", "board", "decision"}`, the board leaving out the policy's entry, and its `design` member is `{"hash"}`, where 0.4.0 had `{"name", "hash"}`; the renderers' decide call takes the board and returns `{"decision"}`. Each view gives `None` for a record before format 8. The lens shows the decision, and a record before format 8 as its entries and calls alone.
|
|
146
|
+
- Replay and the evaluation jobs read the decision as the policy's entry. Replay returns `wrong-design` for a record before format 8, `unfinished` for one that holds no policy's entry or holds a `cause` item and `nothing-to-replay` for a marker at `t:state`, needing no codec. `FindingKind` gains `wrong_design`. Every evaluation job refuses a record before format 8 as `wrong-design`, after `invalid-record` and before any replay. The dead-question lint and question reach compare decisions by the canonical bytes of the policy entry's value or marker, cause and refs included, and the lint raises `ValueError` naming the point when a run's turn is a broken entry (its `t:state` entry a marker); a policy that returns any marker of its own is compared. `switching_values` reports the policy's entry as the decision, always listed and compared with its whole cause; its store entry is at format 2, `{"unseen", "entries"}`.
|
|
147
|
+
- Replay checks each source it asks against the base record, the record whose calls answer, and answers no stale question. A ref is stale when the base holds no answer for it, as for a source or ref the record never asked or a `Failed` call that cannot be given back whole; when a need's value differs from the base's entry, wording and per-candidate slots included; or when its question's kind, labels, value type, list flag or identity differ from the call item's. A stale ref gets no key, so it is written `not-returned`, and is named by one `stale-question` finding, `{"kind", "ref", "source", "clause"}`, its clause `no-answer`, `needs`, `question`, `payload` or `oracle`. It replaces `not-in-record`, `ref-not-in-record` and `question-changed`; a reworded question is no longer answered from the old answer. Given the base's design, as `intervene` is, the check also stales a `t:` ref whose declared type differs (`question`), and every other ref of a source whose payload differs (`payload`) or whose `oracle` key differs or that `intervene` asks afresh (`oracle`). `intervene` checks against the record as read, so an edit to a need, such as a `t:state` field a source needs, stales that source where its old answer was reused; an entry an edit set is never checked, and a call an edit failed comes back failed only when asked whole. Deciding inputs, question reach and switching values count `stale-question` alone as undetermined. `from_record` shares the check, so it also refuses a question whose identity differs.
|
|
148
|
+
- `intervene`, `deciding_inputs` and `switching_values` load an edited design with `loaded`'s own callables when `functions` is `None`, so a design whose rules are lambdas or closures needs no `functions` passed; given `functions` still override them.
|
|
149
|
+
- `dead_questions` also compares two runs that agree on every other read and hold each grounded entry at its first point, whatever entries each grounds, so a question whose answer changes a candidate set, such as a gate a finder rule reads, can be `live`.
|
|
150
|
+
- `intervene`'s refusal for a constant rule whose output is the string `Unsure` and whose design does not load ends "; Unsure is given as the class ommat.Unsure, not the string".
|
|
151
|
+
- `load` no longer refuses a decision table or a data rule. `Table` copies its sequence fields when built.
|
|
152
|
+
- `dead_questions` takes a `values` key for a label question with no grid entry: its list is the labels to try, each at 1, in place of every label, so a question of many labels no rule bounds costs only the labels a caller names. Its report gains `narrowed`, those questions in code-point order. A key for such a question was a `ValueError`; a key for a question the grid fills still is.
|
|
153
|
+
- Design format 8 and record format 7: a `candidates` member may name a candidate field, and the `settings` item holds `sets`. A record of formats 1 to 6 reads under its own rules, and the ledger refuses `sets` in one.
|
|
154
|
+
- `unsure_to_execute` runs the abstention search whenever a rule on the policy's lineage reads a question, which breaks callers of earlier releases three ways: a call without `values` for the free inputs the search's turns need, such as a `t:state` string field or a tool result, raises `ValueError` naming every unfilled read, and a `values` key for a read the lint's grid or types already fill is refused; the report gains an item per question whose abstention a lineage rule drops, beside the `d:` items, so a marker passed on to the policy is reported under both; and `points` counts the search's runs, which grow with the number of questions times the sum of the ranging reads' points.
|
|
155
|
+
|
|
156
|
+
- The helper version is 3, for the per-candidate picks and `determined`: a record of version 2 replays with a `helpers-mismatch` finding beside any other, and every record hash changes.
|
|
157
|
+
- jurat is renamed Ommat: the distribution, the package and the import are `ommat`, and the extra `ommat[idia]`.
|
|
158
|
+
- Key order is kept from declaration to wire to record, since the order of an object's keys is part of what a model reads. `ommat.types.record(b=..., a=...)` spells `record{b: ..., a: ...}`, its fields in the order declared, where it sorted them; a record value's fields stand in its type's order, and every other object keeps the order its author or producer gave it. A slot that renders an object writes it in that order, where it wrote canonical JSON.
|
|
159
|
+
- Records and design documents are format 6, each number moving only with its own document's rules. A design document holds a source's `payload_order`, a parameter leaf's `order` and, when its template is out of canonical order, a structured wording's `order`; a record's `entry`, `plan` and `verdict` items each hold `order`, an order object the ledger derives, beside canonical bytes that still sort. `Record.log`, the observer and replay give each object in the order its item's `order` holds, and replay compares items with `order` included, so a rerun that holds an object in another order is a finding. Every design hash and record hash changes, so golden hashes must be updated. `read_record` reads record formats 1 to 6 and `load` loads design documents of formats 1 to 6 to their own hash; a design before format 6 spells a record's fields in code-point order and holds no order member, and one before format 5 declares no context block; a record before format 6 holds no `order`, and one before format 5 holds no `context` in its `plan` item; a record before format 4 holding a binding's `timed-out` or `raised` under a `returned` call is refused, and one before format 5 holds `snapshot` in place of the provenance profile.
|
|
160
|
+
- `CallResult.snapshot` and `RequestProvenance(snapshot=...)` are renamed `revision`, beside the profile's other details; a call item from format 5 holds `revision` and no `snapshot`. `call_result` reads only the requests that made an attempt. A binding passing `snapshot=` now gets a `TypeError`.
|
|
161
|
+
- A call result's provenance is tested at the write: a provenance string, a `runtime` or a `claimed` off its form, or a `claimed` naming a detail that holds no value, fails the call with `invalid-return`; a `request_id`, `calibrated`, `missing` or `clients` off its form, a `missing` giving a reason for a detail that holds a value among them, fails nothing, its repr kept under `invalid`. The redacted view digests a call's `request_id`.
|
|
162
|
+
- decide and replay refuse an async observer with `EntryRefusal`, where its coroutine was dropped unawaited: an `async def` function or async generator function, a bound method or `functools.partial` of one, or an object whose class defines one as `__call__`.
|
|
163
|
+
- A binding is `async def binding(batch, *, seconds)`: every binding must take the keyword. The fixture binding, `from_record` and the tutorial's binding take it and ignore it.
|
|
164
|
+
- The tutorial's binding, `fixed_answers`, reads a `score` by its kind and marks a `t:` ref it does not answer `unsupported`, so it passes the conformance suite's own batches; the tutorial says what `seconds` is for.
|
|
165
|
+
- `precision` is the provider's declaration, recorded, and the engine does not check probabilities against it; a `noul`'s `no` is held as the binding's provider library derives it, neither rounded.
|
|
166
|
+
- `SourceCall.questions` keys a per-candidate question by each grounded ref, `q:x["<candidate>"]`, so a binding that looks a question up in the design by its key, or parses a ref by searching for `]`, must take the bracketed string off with a JSON parser first.
|
|
167
|
+
- The ledger and `read_record` admit a grounded ref as an entry's `ref`, in a cause's `refs` and as a `calls` entry's `sums` key or `truncated` ref, where they refused one everywhere; `redact` digests each candidate inside a grounded ref under its set's class. Replay grounds again from the set's entry and names a per-candidate question by its declared ref in `question-changed`, and `from_record` compares it with the stored call item's entry under that ref, answering the source's other refs and marking `unsupported` a candidate the stored turn did not ask.
|
|
168
|
+
- `RenderedQuestion.wording` is `str | dict | list`: a structured wording reaches a binding as a JSON object or array, so a binding that treats it as a string, `wording.strip()` among them, must handle the other two.
|
|
169
|
+
- `Question.labels` may be a mapping, `{"fixed", "candidates", "at"}`, for a candidate-valued label set, as well as a sequence or `None`; code that reads a design's labels as a sequence must handle it.
|
|
170
|
+
- `RenderedQuestion` and `SourceCall` check their fields when built, raising `TypeError` for a field of the wrong type and `ValueError` for a wrong value. `kind` and `value_type` take a member or its string and hold the member; a `noul` question's labels are `yes` and `no` and an extraction question's none; `descriptions` is as long as `labels`; an extraction question needs its `value_type` and `text`, and a question of another kind leaves its extraction members unset; a source call's `refs` and `questions` are not both non-empty. A string subclass is held as its string data. `CallResult` still checks nothing.
|
|
171
|
+
- `use_answers` compares the two records' state entries and `settings` items as replay compares items, `order` included, an item of a record before format 6 compared without `order` and `grounded`, and reads a plan finding that differs only in `context` with the plan's `order` taken over the rest alone.
|
|
172
|
+
- `from_record` compares a need with the stored record's by its ordered encoding, from record format 6, and bounds its `warnings` with `bounded_warnings`, and refuses with `unsupported` a source whose need is not a ref or holds a value outside the value domain, where it raised.
|
|
173
|
+
- Load check 4 refuses a source that provides no ref: a source provides one or more `q:` or `t:` refs. A design with such a source loaded before and now raises `InvalidDesign`.
|
|
174
|
+
- The redacted view digests a requirement's value, on a plan's step and in a refused verdict's failure, under its ref's class tree, as that ref's entry is; the value was open.
|
|
175
|
+
- The public API is what `ommat.__all__` lists and the `__all__` of `ommat.types`, `ommat.helpers`, `ommat.evaluation` and `ommat.bindings`, all under one deprecation rule. `ommat.bindings.conformance` and `ommat.bindings.idia` stay outside it and follow idia while idia is 0.x, and `ommat.conversation` and `ommat.conversation.pydantic_ai` stay outside it while they are validated.
|
|
176
|
+
|
|
177
|
+
### Deprecated
|
|
178
|
+
|
|
179
|
+
- `transcript(record)` emits a `DeprecationWarning` and leaves `ommat` in a later minor release. Pass the record to an `ommat.conversation` renderer, or read the record for every value.
|
|
180
|
+
|
|
181
|
+
### Removed
|
|
182
|
+
|
|
183
|
+
- The context block and the handoff. From `ommat`: `Context`, `ContextEntry` and `handoff`; from `ommat.conversation`: `handoff_text`. `Design` loses `context`, the design document its `context` member, and a record holds no `context` item. `FindingKind` has no `context`. `transcript` and the renderers stay. The how-to `hand-off-context.md` is replaced by `hand-off-a-turn.md`.
|
|
184
|
+
- The plan, the guard and the reference runner. From `ommat`: `Plan`, `PlanKind`, `Step`, `Origin`, `Binding`, `PlanDeclaration`, `Policy`, `PolicyTable`, `Requirement`, `Verdict`, `VerdictKind` and `GuardFailure`; from `ommat.helpers`: `run_plan`, `RunRefusal`, `BindingNotFound` and the `unsure_to_execute` lint. `Design` loses `requirements`, `default_deny`, `tools` and `plans`; `Decision` loses `plan` and `verdict`; `FindingKind` loses `plan` and `verdict`. A policy table is an ordinary `Table`. Compile, the seven plan rules, plan declarations, declared `reason` and `reply`, and default-deny go with them; `SourceRequirement` and the `refused` cause stay.
|
|
185
|
+
- The `calibrated` provenance detail, a provider's own claim that its probabilities are calibrated, which nothing checked. `CallResult` and `RequestProvenance` no longer take it, so a binding passing `calibrated=` gets a `TypeError`; `call_result` no longer folds it; the conformance kit no longer checks it; and the idia binding drops idia's `calibrated` from the call, its reason and its claim included. Record format 7 holds it nowhere, and the ledger refuses it there as a `calls` entry's member, a `missing` or `invalid` key or a `claimed` name; a record of formats 5 and 6 reads with it as before.
|
|
186
|
+
|
|
187
|
+
### Fixed
|
|
188
|
+
|
|
189
|
+
- A rule may return a marker whose cause names a grounded ref the turn wrote, such as one candidate's abstention, and a `plan` item's cause and context-entry markers may name one. Before, the first was `invalid-return`, and a flagged `d:` carrying such a marker broke the turn at compile's write. `redact` digests the candidate in each place.
|
|
190
|
+
- A `-0.0` a binding, a rule or the policy returns is held as `0.0` on the board, in an answer, in the plan and in the record's stored copy, where it stayed `-0.0` live while the record wrote `0` and replay read back `0.0`, so a rule that told them apart diverged in replay.
|
|
191
|
+
- The design lints probe both integers either side of a boundary that is not integral on an integer read, where they dropped it and could miss the values below or above it, so `dead_questions` could call a live question `no-change-found`.
|
|
192
|
+
- `t.list_`, `t.mapping` and `t.record` raise `ValueError` for a type nesting past the depth bound, where they returned a string load refused.
|
|
193
|
+
- `run_plan` runs a decision whose record holds a marker entry, where it raised `KeyError` before the first tool call.
|
|
194
|
+
- A marker a rule returns is `invalid-return` when a ref of its cause is not a ref the design provides, a source, rule or tool name, a parameter path, `policy`, `codec`, `rule:N` or `step:N`, where it was written as given: free text in a cause reached the record's hashed log and stayed open in the redacted view.
|
|
195
|
+
- `load` gives a function whose `__wrapped__` chain loops a null source hash, as for any function whose source cannot be read, where it raised `ValueError`.
|
|
196
|
+
|
|
197
|
+
## [0.3.0] - 2026-10-22
|
|
198
|
+
|
|
199
|
+
### Added
|
|
200
|
+
|
|
201
|
+
- A tutorial, `docs/tutorials/write-a-design.md`: one offline design taken through `load`, `decide`, the record and replay, its example tested. Its example files are in the repository at `docs/tutorials/write_a_design/`, for a reader who installed jurat from an index.
|
|
202
|
+
- Label descriptions: a `choice` or `score` label may be `{"name": ..., "description": ...}`, which the design document, the call item and the question's identity hold as declared. `RenderedQuestion.descriptions`, keyword-only, gives each label's description aligned with `labels`, `None` where a label has none. Answers, the answer grid, the lints and the `boundaries` checks read names only.
|
|
203
|
+
- `CallResult.warnings`: the binding's own lines about the call, recorded under the call in `unhashed` and outside every hash. A malformed value is kept in `invalid` and is never a fault.
|
|
204
|
+
- `CallResult.precision`: the decimal places the provider rounds probabilities to, hashed on the call item. A value that is not `None` or an integer from 0 to 17 is `invalid-return` for the whole call.
|
|
205
|
+
- `CauseCode.unsupported`: the marker a binding returns for a ref it will not put to any provider, with the reason as a line of `warnings`. It is the 24th cause code. A rule that returns the marker it read provides it unchanged, so `unsupported` stands on a `d:` entry with its refs as any binding code does.
|
|
206
|
+
- The record document's `hash` member: the record hash over the log. `read_record` recomputes it and refuses a document whose `hash` is missing or does not match.
|
|
207
|
+
- `jurat.evaluation`, the evaluation subpackage, with its first job: `use_answers(record, loaded, other)` and `use_answers_sync`, which rerun `record`'s turn under `loaded` with `other`'s calls answering and return `{"other", "findings"}`, `other` its record hash and the findings replay's. Both records are a `Record` or a stored document and must be finished turns of the loaded design with the same state entry and `settings` item. Each refusal is an `EvaluationRefusal`, its `reason` a `RefusalReason`; a replay record is a valid `record` or `other`, so two models decided under different parameter sets compare by replaying the second under the first's loaded design.
|
|
208
|
+
- `jurat.from_record(record, loaded)`: an oracle binding that answers a live turn's sources from a stored record, refusing with `unsupported` a source with no returned call or different needs, a changed question, a ref with no stored entry and a recorded marker other than `invalid-answer` or `invalid-return`, with null provenance and a `warnings` line naming the record's hash.
|
|
209
|
+
- `ReadView`, the view a function `when`, rule or policy is called with, is public, so a component can be annotated with it. `When`, `Rule` and `Policy` type `function` as `Callable[[ReadView], object]`, so a lambda passes pyright strict.
|
|
210
|
+
|
|
211
|
+
### Changed
|
|
212
|
+
|
|
213
|
+
- Records and design documents are format 3. Every design hash and record hash changes, so golden hashes must be updated. Every format-3 call item holds `precision`.
|
|
214
|
+
- An exception's recorded traceback starts at the component's own frame and names each file by its module, so the record holds no local paths from the traceback.
|
|
215
|
+
- `read_record` reads format-1 and format-2 records and `load` loads format-1 and format-2 design documents to their own hash, each under its format's rules. A format-2 record holding a described label, `precision`, `warnings`, `unsupported` or a `hash` member is refused.
|
|
216
|
+
- `Step` takes its arguments as any `Mapping`, read once through `items()`, and still keeps a read-only copy; a non-mapping is a `TypeError`. The recorded plan is unchanged.
|
|
217
|
+
- Check 4's message for a rule that provides another ref names the rule's own `d:` ref, and for another rule's `d:` ref, whose it would be.
|
|
218
|
+
- A `load` refusal for a type that does not fit names the type as written: check 9's text and `reference_date` refs, check 10's state declaration and parameter shape, check 8's boundary leaf, and check 9's boundary key and role leaves.
|
|
219
|
+
|
|
220
|
+
## [0.2.0] - 2026-10-22
|
|
221
|
+
|
|
222
|
+
### Added
|
|
223
|
+
|
|
224
|
+
- The `extraction` answer kind: a question that asks for a typed value read from a text. `Question` takes `value_type`, `is_list`, `text` and `reference_date`; `ValueType` names the six value types; `ExtractionAnswer` holds the answer's `value`, `guess`, `p_null`, `confidence` and `span`, and checks each when built. Dates, times, datetimes and durations are checked by jurat's own grammar, alike on every Python.
|
|
225
|
+
- `RenderedQuestion` gives an extraction question's `value_type`, `is_list`, `text` and `reference_date`, keyword-only; a question of another kind leaves them at `None`, `False`, `None` and `None`.
|
|
226
|
+
- `CallResult.truncated`: the `q:` refs whose answer came from a response the provider cut short, recorded under the call in `unhashed` and outside every hash.
|
|
227
|
+
- `jurat.helpers.extract`: an extraction answer's value, or `Unsure` with `abstained` when the value is null or `p_null` is at or above the bar.
|
|
228
|
+
- The extraction roles of a `boundaries` entry, `null`, `confidence` and `value`, and the dead-question lint's points over an extraction read; an extraction read with no `value` role takes its values from the lint's `values` argument.
|
|
229
|
+
|
|
230
|
+
### Changed
|
|
231
|
+
|
|
232
|
+
- Records and design documents are format 2, and the helper version is 2. Every design hash and record hash changes, so golden hashes must be updated.
|
|
233
|
+
- `AnswerKind` has a fourth member, `extraction`; code that matches on every kind must handle it.
|
|
234
|
+
- The ledger refuses a `q:` answer whose kind is not its call item's question's.
|
|
235
|
+
- 0.2.0 reads format-1 records and loads format-1 design documents to their own hash, each under format 1's rules, so a record written under 0.1.0 replays under its stored design with `helpers-mismatch` as its only finding.
|
|
236
|
+
|
|
237
|
+
## [0.1.0] - 2026-10-21
|
|
238
|
+
|
|
239
|
+
### Changed
|
|
240
|
+
|
|
241
|
+
- `Source.batch` is now `Source.oracle`, the name of the binding that answers the source, and the design document's `batch` member is `oracle`. Every design hash changes, so a record written under 0.0.1 names a design hash that no reloaded design has. `EntryRefusal` messages name the oracle, and a missing `default` binding says it serves the sources with no oracle.
|
|
242
|
+
- `load` refuses a source that provides both `q:` and `t:` refs (check 4). Split it into two sources that name one oracle: ready in the same round, they are still one call.
|
|
243
|
+
|
|
244
|
+
## [0.0.1] - 2026-10-20
|
|
245
|
+
|
|
246
|
+
### Added
|
|
247
|
+
|
|
248
|
+
- The design types: `Design`, `Source`, `Question`, `Text`, `Rule`, `Policy`, `When`, `Requirement`, `SourceRequirement`, `Group` and `Parameter`, with `Table`, `PolicyTable` and `PlanDeclaration` for the forms `load` refuses in this release.
|
|
249
|
+
- `jurat.types`: constructors for the type a field holds (`boolean`, `integer`, `number`, `string`, `bytes_`, `label`, `list_`, `mapping`, `record` and `nullable`).
|
|
250
|
+
- `load`: checks a `Design`, or its canonical document, before any turn runs and returns a `LoadedDesign`; an invalid design raises `InvalidDesign` naming each failed check.
|
|
251
|
+
- `decide` and `decide_sync`: one turn, interpret over rounds of sources and rules, then compile with the policy and the guard, returning the plan, the verdict and the record. Rules and the policy are Python functions.
|
|
252
|
+
- `RunSettings`: the run settings, with a round bound of 8 and a 60 s timeout by default; `EntryRefusal` for a wrong argument at `decide`'s entry, raised before any record is written.
|
|
253
|
+
- The markers `Unsure`, `Unavailable` and `Unasked`, each with its cause, for every value a turn could not settle.
|
|
254
|
+
- The record: its canonical JSON encoding and hashes, the observer, and `read_record` for a stored record, which raises `InvalidRecord` for one it cannot read.
|
|
255
|
+
- `replay` and `replay_sync`: a recorded turn rerun under a loaded design with no model call, reporting each difference as a finding.
|
|
256
|
+
- The record views: `escalation` and `redact`.
|
|
257
|
+
- The binding protocol between the engine and a model adapter: `SourceCall`, `RenderedQuestion` and `CallResult`.
|
|
258
|
+
- `jurat.helpers`: the choice helpers and combinators rules call, the design lints `dead_questions` and `unsure_to_execute`, and the reference runner `run_plan`, which raises `RunRefusal` for a plan it refuses before calling any tool and returns `BindingNotFound` for a step argument whose binding missed.
|
|
259
|
+
- Project scaffolding: package, license, code of conduct, contributing and security policies, CI.
|
|
260
|
+
|
|
261
|
+
### Not included
|
|
262
|
+
|
|
263
|
+
- `load` refuses decision tables, policy tables, data rules, plan declarations, candidate sets, candidate-valued label sets and grounded declarations.
|
|
264
|
+
- No state carries from one turn to the next.
|
|
265
|
+
|
|
266
|
+
[Unreleased]: https://github.com/CRSiegfried/ommat/compare/v0.5.1...HEAD
|
|
267
|
+
[0.5.1]: https://github.com/CRSiegfried/ommat/releases/tag/v0.5.1
|
|
268
|
+
[0.5.0]: https://github.com/CRSiegfried/ommat/releases/tag/v0.5.0
|
|
269
|
+
[0.4.0]: https://github.com/CRSiegfried/ommat/releases/tag/v0.4.0
|
|
270
|
+
[0.3.0]: https://github.com/CRSiegfried/jurat/compare/v0.2.0...v0.3.0
|
|
271
|
+
[0.2.0]: https://github.com/CRSiegfried/jurat/compare/v0.1.0...v0.2.0
|
|
272
|
+
[0.1.0]: https://github.com/CRSiegfried/jurat/compare/v0.0.1...v0.1.0
|
|
273
|
+
[0.0.1]: https://github.com/CRSiegfried/jurat/releases/tag/v0.0.1
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
+
|
|
9
|
+
## Our Standards
|
|
10
|
+
|
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
+
|
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
18
|
+
|
|
19
|
+
Examples of unacceptable behavior include:
|
|
20
|
+
|
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
22
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
23
|
+
* Public or private harassment
|
|
24
|
+
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
|
25
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
26
|
+
|
|
27
|
+
## Enforcement Responsibilities
|
|
28
|
+
|
|
29
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
+
|
|
31
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
32
|
+
|
|
33
|
+
## Scope
|
|
34
|
+
|
|
35
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
36
|
+
|
|
37
|
+
## Enforcement
|
|
38
|
+
|
|
39
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported privately to the maintainer, [@CRSiegfried](https://github.com/CRSiegfried), through GitHub. All complaints will be reviewed and investigated promptly and fairly.
|
|
40
|
+
|
|
41
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
42
|
+
|
|
43
|
+
## Enforcement Guidelines
|
|
44
|
+
|
|
45
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
46
|
+
|
|
47
|
+
### 1. Correction
|
|
48
|
+
|
|
49
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
50
|
+
|
|
51
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
52
|
+
|
|
53
|
+
### 2. Warning
|
|
54
|
+
|
|
55
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
56
|
+
|
|
57
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
58
|
+
|
|
59
|
+
### 3. Temporary Ban
|
|
60
|
+
|
|
61
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
62
|
+
|
|
63
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
64
|
+
|
|
65
|
+
### 4. Permanent Ban
|
|
66
|
+
|
|
67
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
68
|
+
|
|
69
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
70
|
+
|
|
71
|
+
## Attribution
|
|
72
|
+
|
|
73
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
74
|
+
|
|
75
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
76
|
+
|
|
77
|
+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
|
78
|
+
|
|
79
|
+
[homepage]: https://www.contributor-covenant.org
|
|
80
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
81
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
82
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
83
|
+
[translations]: https://www.contributor-covenant.org/translations
|
|
84
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in ommat. The design and the spec are still young, so contributions start with an issue.
|
|
4
|
+
|
|
5
|
+
## Issues first
|
|
6
|
+
|
|
7
|
+
- **Bugs:** open an issue with a minimal reproduction, the ommat and Python versions, and what you expected.
|
|
8
|
+
- **Changes and features:** open a proposal issue before writing code. Say what problem it solves and how it bears on the spec's guarantees.
|
|
9
|
+
- **Pull requests** are welcome once an issue is agreed. Link it in the PR. A PR without an agreed issue may be closed, however good the code is.
|
|
10
|
+
- **Security problems:** do not open an issue; follow [SECURITY.md](SECURITY.md).
|
|
11
|
+
|
|
12
|
+
## Development
|
|
13
|
+
|
|
14
|
+
The `idia` extra's source is idia's published tag, so `uv sync --all-extras` installs it from GitHub, with every other extra:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
uv sync --all-extras
|
|
18
|
+
uv run ruff check
|
|
19
|
+
uv run ruff format --check
|
|
20
|
+
uv run pyright
|
|
21
|
+
uv run pytest --cov -m "not slow"
|
|
22
|
+
uv run pytest -m slow
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
These are CI's steps in CI's order. CI runs them on Linux, macOS and Windows; a change that touches event loops, sockets, file paths or line endings needs the Windows legs green before it is ready for review.
|
|
26
|
+
|
|
27
|
+
To work against a checkout of idia beside this one, at `../idia`, install it over the locked version and keep `uv run` from syncing it back:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
git clone https://github.com/CRSiegfried/idia.git ../idia
|
|
31
|
+
uv sync --all-extras
|
|
32
|
+
uv pip install -e ../idia
|
|
33
|
+
export UV_NO_SYNC=1
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
With `UV_NO_SYNC` set, `uv run` uses the environment as it stands; unset it, or run `uv sync --all-extras`, to return to the locked version.
|
|
37
|
+
|
|
38
|
+
CI runs the same checks on Python 3.11–3.14 on Linux, macOS and Windows. On pushes to main it also runs `scripts/check_subjects.py`, which checks that commit subjects describe library changes.
|
|
39
|
+
|
|
40
|
+
## Ground rules for changes
|
|
41
|
+
|
|
42
|
+
- **The core imports only the standard library.** Integrations with third-party SDKs go in optional extras and are imported lazily.
|
|
43
|
+
- **The spec is normative.** A change that alters behavior the spec describes changes the spec in the same PR, with tests.
|
|
44
|
+
- **The public API is what `ommat.__all__` lists, and the `__all__` of `ommat.types`, `ommat.helpers`, `ommat.evaluation` and `ommat.bindings`.** Modules and names starting with an underscore are internal. The public names carry no stability promise before 1.0, when a compatibility policy is set. The conformance suite, `ommat.bindings.conformance`, the conversation renderers, `ommat.conversation` and `ommat.conversation.pydantic_ai`, and the shipped bindings, such as `ommat.bindings.idia` and its `oracle_binding`, are outside it: a shipped binding follows its provider library while that library is 0.x, so it may change in any minor release when the library changes, and the changelog says so.
|
|
45
|
+
- **Record user-visible changes** under `Unreleased` in [CHANGELOG.md](CHANGELOG.md).
|
|
46
|
+
|
|
47
|
+
## Conduct
|
|
48
|
+
|
|
49
|
+
This project follows the [Contributor Covenant](CODE_OF_CONDUCT.md).
|
ommat-0.5.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Christopher Siegfried
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|