hugpy-oracle 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. hugpy_oracle-0.2.2/LICENSE +41 -0
  2. hugpy_oracle-0.2.2/PKG-INFO +62 -0
  3. hugpy_oracle-0.2.2/README.md +30 -0
  4. hugpy_oracle-0.2.2/deploy/hugpy-steward.service +33 -0
  5. hugpy_oracle-0.2.2/deploy/hugpy-steward.timer +14 -0
  6. hugpy_oracle-0.2.2/pyproject.toml +68 -0
  7. hugpy_oracle-0.2.2/setup.cfg +4 -0
  8. hugpy_oracle-0.2.2/src/hugpy_oracle/__init__.py +310 -0
  9. hugpy_oracle-0.2.2/src/hugpy_oracle/audio_master.py +1306 -0
  10. hugpy_oracle-0.2.2/src/hugpy_oracle/authority.py +636 -0
  11. hugpy_oracle-0.2.2/src/hugpy_oracle/benchmark.py +4682 -0
  12. hugpy_oracle-0.2.2/src/hugpy_oracle/benchmark_cases.py +1172 -0
  13. hugpy_oracle-0.2.2/src/hugpy_oracle/catalog.py +1446 -0
  14. hugpy_oracle-0.2.2/src/hugpy_oracle/cli.py +168 -0
  15. hugpy_oracle-0.2.2/src/hugpy_oracle/config.py +145 -0
  16. hugpy_oracle-0.2.2/src/hugpy_oracle/contracts.py +1202 -0
  17. hugpy_oracle-0.2.2/src/hugpy_oracle/dag_runtime.py +1437 -0
  18. hugpy_oracle-0.2.2/src/hugpy_oracle/evaluation.py +581 -0
  19. hugpy_oracle-0.2.2/src/hugpy_oracle/interim_ledger.py +2293 -0
  20. hugpy_oracle-0.2.2/src/hugpy_oracle/performance.py +3528 -0
  21. hugpy_oracle-0.2.2/src/hugpy_oracle/pipeline.py +38 -0
  22. hugpy_oracle-0.2.2/src/hugpy_oracle/pipelines.py +34 -0
  23. hugpy_oracle-0.2.2/src/hugpy_oracle/plan.py +961 -0
  24. hugpy_oracle-0.2.2/src/hugpy_oracle/postproduction.py +2766 -0
  25. hugpy_oracle-0.2.2/src/hugpy_oracle/probes.py +773 -0
  26. hugpy_oracle-0.2.2/src/hugpy_oracle/production.py +1111 -0
  27. hugpy_oracle-0.2.2/src/hugpy_oracle/prompt_compiler.py +702 -0
  28. hugpy_oracle-0.2.2/src/hugpy_oracle/providers.py +234 -0
  29. hugpy_oracle-0.2.2/src/hugpy_oracle/py.typed +0 -0
  30. hugpy_oracle-0.2.2/src/hugpy_oracle/recipes/__init__.py +1 -0
  31. hugpy_oracle-0.2.2/src/hugpy_oracle/recipes/video_performance.py +565 -0
  32. hugpy_oracle-0.2.2/src/hugpy_oracle/relay/__init__.py +0 -0
  33. hugpy_oracle-0.2.2/src/hugpy_oracle/relay/hooks.py +145 -0
  34. hugpy_oracle-0.2.2/src/hugpy_oracle/relay/performance_relay.py +469 -0
  35. hugpy_oracle-0.2.2/src/hugpy_oracle/relay/prompt_coordination.py +1731 -0
  36. hugpy_oracle-0.2.2/src/hugpy_oracle/repair.py +156 -0
  37. hugpy_oracle-0.2.2/src/hugpy_oracle/repair_controller.py +324 -0
  38. hugpy_oracle-0.2.2/src/hugpy_oracle/router.py +374 -0
  39. hugpy_oracle-0.2.2/src/hugpy_oracle/routing_matrix.py +1005 -0
  40. hugpy_oracle-0.2.2/src/hugpy_oracle/runtime.py +815 -0
  41. hugpy_oracle-0.2.2/src/hugpy_oracle/schema_export.py +343 -0
  42. hugpy_oracle-0.2.2/src/hugpy_oracle/scorecard.py +274 -0
  43. hugpy_oracle-0.2.2/src/hugpy_oracle/screenplay.py +2294 -0
  44. hugpy_oracle-0.2.2/src/hugpy_oracle/script_first.py +1926 -0
  45. hugpy_oracle-0.2.2/src/hugpy_oracle/segments.py +1305 -0
  46. hugpy_oracle-0.2.2/src/hugpy_oracle/selection.py +889 -0
  47. hugpy_oracle-0.2.2/src/hugpy_oracle/spatial.py +945 -0
  48. hugpy_oracle-0.2.2/src/hugpy_oracle/spatial_eval.py +786 -0
  49. hugpy_oracle-0.2.2/src/hugpy_oracle/spatial_sources.py +1067 -0
  50. hugpy_oracle-0.2.2/src/hugpy_oracle/speech.py +453 -0
  51. hugpy_oracle-0.2.2/src/hugpy_oracle/stationary_scenario.py +1373 -0
  52. hugpy_oracle-0.2.2/src/hugpy_oracle/steward.py +390 -0
  53. hugpy_oracle-0.2.2/src/hugpy_oracle/storyboard.py +938 -0
  54. hugpy_oracle-0.2.2/src/hugpy_oracle/tone_scale.py +52 -0
  55. hugpy_oracle-0.2.2/src/hugpy_oracle/validation.py +19 -0
  56. hugpy_oracle-0.2.2/src/hugpy_oracle/validator.py +517 -0
  57. hugpy_oracle-0.2.2/src/hugpy_oracle/worldbuild.py +1086 -0
  58. hugpy_oracle-0.2.2/src/hugpy_oracle.egg-info/PKG-INFO +62 -0
  59. hugpy_oracle-0.2.2/src/hugpy_oracle.egg-info/SOURCES.txt +99 -0
  60. hugpy_oracle-0.2.2/src/hugpy_oracle.egg-info/dependency_links.txt +1 -0
  61. hugpy_oracle-0.2.2/src/hugpy_oracle.egg-info/entry_points.txt +2 -0
  62. hugpy_oracle-0.2.2/src/hugpy_oracle.egg-info/requires.txt +8 -0
  63. hugpy_oracle-0.2.2/src/hugpy_oracle.egg-info/scm_file_list.json +95 -0
  64. hugpy_oracle-0.2.2/src/hugpy_oracle.egg-info/scm_version.json +8 -0
  65. hugpy_oracle-0.2.2/src/hugpy_oracle.egg-info/top_level.txt +1 -0
  66. hugpy_oracle-0.2.2/tests/conftest.py +34 -0
  67. hugpy_oracle-0.2.2/tests/test_import_policy.py +107 -0
  68. hugpy_oracle-0.2.2/tests/test_oracle_audio_master.py +643 -0
  69. hugpy_oracle-0.2.2/tests/test_oracle_authority.py +452 -0
  70. hugpy_oracle-0.2.2/tests/test_oracle_benchmark.py +1034 -0
  71. hugpy_oracle-0.2.2/tests/test_oracle_cli.py +71 -0
  72. hugpy_oracle-0.2.2/tests/test_oracle_config.py +51 -0
  73. hugpy_oracle-0.2.2/tests/test_oracle_contracts.py +579 -0
  74. hugpy_oracle-0.2.2/tests/test_oracle_dag_parallel.py +138 -0
  75. hugpy_oracle-0.2.2/tests/test_oracle_dag_runtime.py +500 -0
  76. hugpy_oracle-0.2.2/tests/test_oracle_hooks.py +90 -0
  77. hugpy_oracle-0.2.2/tests/test_oracle_performance.py +1248 -0
  78. hugpy_oracle-0.2.2/tests/test_oracle_performance_vigilant.py +166 -0
  79. hugpy_oracle-0.2.2/tests/test_oracle_plan.py +568 -0
  80. hugpy_oracle-0.2.2/tests/test_oracle_postproduction.py +1306 -0
  81. hugpy_oracle-0.2.2/tests/test_oracle_probes.py +565 -0
  82. hugpy_oracle-0.2.2/tests/test_oracle_production.py +578 -0
  83. hugpy_oracle-0.2.2/tests/test_oracle_prompt_compiler_steward.py +274 -0
  84. hugpy_oracle-0.2.2/tests/test_oracle_providers.py +134 -0
  85. hugpy_oracle-0.2.2/tests/test_oracle_recipe_dag.py +212 -0
  86. hugpy_oracle-0.2.2/tests/test_oracle_repair_controller.py +221 -0
  87. hugpy_oracle-0.2.2/tests/test_oracle_runtime.py +540 -0
  88. hugpy_oracle-0.2.2/tests/test_oracle_runtime_normalize.py +39 -0
  89. hugpy_oracle-0.2.2/tests/test_oracle_schema_export.py +366 -0
  90. hugpy_oracle-0.2.2/tests/test_oracle_screenplay.py +1258 -0
  91. hugpy_oracle-0.2.2/tests/test_oracle_script_first.py +853 -0
  92. hugpy_oracle-0.2.2/tests/test_oracle_segments.py +749 -0
  93. hugpy_oracle-0.2.2/tests/test_oracle_selection.py +320 -0
  94. hugpy_oracle-0.2.2/tests/test_oracle_spatial.py +309 -0
  95. hugpy_oracle-0.2.2/tests/test_oracle_spatial_eval.py +339 -0
  96. hugpy_oracle-0.2.2/tests/test_oracle_spatial_sources.py +482 -0
  97. hugpy_oracle-0.2.2/tests/test_oracle_speech.py +633 -0
  98. hugpy_oracle-0.2.2/tests/test_oracle_stationary.py +879 -0
  99. hugpy_oracle-0.2.2/tests/test_oracle_validator.py +662 -0
  100. hugpy_oracle-0.2.2/tests/test_oracle_vigilant_live.py +149 -0
  101. hugpy_oracle-0.2.2/tests/test_tts_seat.py +450 -0
@@ -0,0 +1,41 @@
1
+ hugpy — Source-Available License
2
+
3
+ Copyright (c) 2026 putkoff (hugpy.ai). All rights reserved.
4
+
5
+ Permission is granted, free of charge, to use this software ("hugpy") for
6
+ personal and non-commercial purposes, and for time-limited commercial
7
+ evaluation, subject to the following conditions:
8
+
9
+ 1. Non-commercial use means use by an individual for personal purposes, or
10
+ use by a non-profit or educational institution for its own internal
11
+ purposes. Any use by, for, or on behalf of a for-profit business or in
12
+ connection with revenue-generating activity is commercial use — including
13
+ internal business use, use in producing goods or services, and use on
14
+ paid engagements.
15
+
16
+ 2. Commercial use requires a commercial license from the copyright holder.
17
+ Exception: a business may evaluate the software internally for up to
18
+ thirty (30) days free of charge; continued use after that requires a
19
+ commercial license.
20
+
21
+ 3. Redistribution of this software, in source or binary form, modified or
22
+ unmodified, is not permitted without prior written permission from the
23
+ copyright holder. Downloading the software from an official distribution
24
+ channel (PyPI, npm, hugpy.ai) is not redistribution.
25
+
26
+ 4. Modification for personal use or internal evaluation is permitted;
27
+ distribution of modified versions is not.
28
+
29
+ 5. This notice must be retained in all copies or substantial portions of
30
+ the software.
31
+
32
+ 6. Any use outside these terms automatically terminates this license.
33
+
34
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING
38
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
39
+ IN THE SOFTWARE.
40
+
41
+ For commercial licensing or redistribution permission: https://hugpy.ai
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.4
2
+ Name: hugpy-oracle
3
+ Version: 0.2.2
4
+ Summary: Hugpy oracle: creative planning, model selection, screenplay and storyboard generation, DAG runtime, repair, evaluation and ledgers over the video pipeline
5
+ Author-email: putkoff <support@hugpy.ai>
6
+ License-Expression: LicenseRef-Proprietary
7
+ Project-URL: Homepage, https://hugpy.ai
8
+ Project-URL: Documentation, https://github.com/hugpy/hugpy/blob/main/py/cinema/hugpy_oracle/README.md
9
+ Project-URL: Repository, https://github.com/hugpy/hugpy
10
+ Project-URL: Source, https://github.com/hugpy/hugpy/tree/main/py/cinema/hugpy_oracle
11
+ Project-URL: Issues, https://github.com/hugpy/hugpy/issues
12
+ Project-URL: Changelog, https://github.com/hugpy/hugpy/releases
13
+ Project-URL: Architecture, https://github.com/hugpy/hugpy/blob/main/PARTITION.md
14
+ Keywords: hugpy,llm,self-hosted,planning,video,orchestration,evaluation
15
+ Classifier: Development Status :: 3 - Alpha
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: hugpy-platform
25
+ Requires-Dist: hugpy-control
26
+ Requires-Dist: hugpy-engine
27
+ Requires-Dist: hugpy-media
28
+ Requires-Dist: hugpy-video
29
+ Provides-Extra: test
30
+ Requires-Dist: pytest>=8; extra == "test"
31
+ Dynamic: license-file
32
+
33
+ # hugpy-oracle
34
+
35
+ `hugpy_oracle` — extracted from `abstract_hugpy_dev` as part of the Hugpy
36
+ partition. Ownership and allowed dependencies are declared in
37
+ `py/partition.toml`; see `PARTITION.md` at the workspace root.
38
+
39
+ Allowed Python dependencies inside the ecosystem: hugpy_platform, hugpy_control, hugpy_engine, hugpy_media, hugpy_video.
40
+
41
+ ## Seams
42
+
43
+ - `hugpy_oracle.providers` — Protocols for what the oracle needs from packages
44
+ it must not import, each with a safe default: `DossierSource` (curation's
45
+ dossier store), `DoctrineSource` (fleet doctrine), `TaskCapabilityGate`
46
+ (fleet's capability-honesty rule), `LoadStateSource` (model residency per
47
+ worker). The composition root installs implementations with `set_*()`.
48
+ Worker rosters and the blocklist come from `hugpy_engine.placement`.
49
+ - `hugpy_oracle.relay.hooks` / `hugpy_oracle.install_hooks()` — the oracle's
50
+ side of `hugpy_video.hooks`: the `PromptCoordinator` implementation and the
51
+ `(oracle, performance)` bus runner.
52
+ - `hugpy_oracle.config` — every state root (reliability ledger, routing
53
+ matrix, benchmark battery, run journals) resolved in one place; per-store env
54
+ vars (`ORACLE_LEDGER_PATH`, `ORACLE_BENCHMARK_ROOT`, ...) win, then
55
+ `HUGPY_ORACLE_HOME` / `HUGPY_ORACLE_RUNS_ROOT`, then `hugpy_platform.app_dirs`.
56
+
57
+ ## Command line
58
+
59
+ `hugpy-oracle steward [--apply] [--api URL|--local] [--ledger PATH]` runs one
60
+ steward pass (remote against a running central when `HUGPY_API` is set,
61
+ otherwise in-process over the shared ledger); `deploy/hugpy-steward.{service,timer}`
62
+ schedule it. `hugpy-oracle install-hooks` reports what the video hooks wired.
@@ -0,0 +1,30 @@
1
+ # hugpy-oracle
2
+
3
+ `hugpy_oracle` — extracted from `abstract_hugpy_dev` as part of the Hugpy
4
+ partition. Ownership and allowed dependencies are declared in
5
+ `py/partition.toml`; see `PARTITION.md` at the workspace root.
6
+
7
+ Allowed Python dependencies inside the ecosystem: hugpy_platform, hugpy_control, hugpy_engine, hugpy_media, hugpy_video.
8
+
9
+ ## Seams
10
+
11
+ - `hugpy_oracle.providers` — Protocols for what the oracle needs from packages
12
+ it must not import, each with a safe default: `DossierSource` (curation's
13
+ dossier store), `DoctrineSource` (fleet doctrine), `TaskCapabilityGate`
14
+ (fleet's capability-honesty rule), `LoadStateSource` (model residency per
15
+ worker). The composition root installs implementations with `set_*()`.
16
+ Worker rosters and the blocklist come from `hugpy_engine.placement`.
17
+ - `hugpy_oracle.relay.hooks` / `hugpy_oracle.install_hooks()` — the oracle's
18
+ side of `hugpy_video.hooks`: the `PromptCoordinator` implementation and the
19
+ `(oracle, performance)` bus runner.
20
+ - `hugpy_oracle.config` — every state root (reliability ledger, routing
21
+ matrix, benchmark battery, run journals) resolved in one place; per-store env
22
+ vars (`ORACLE_LEDGER_PATH`, `ORACLE_BENCHMARK_ROOT`, ...) win, then
23
+ `HUGPY_ORACLE_HOME` / `HUGPY_ORACLE_RUNS_ROOT`, then `hugpy_platform.app_dirs`.
24
+
25
+ ## Command line
26
+
27
+ `hugpy-oracle steward [--apply] [--api URL|--local] [--ledger PATH]` runs one
28
+ steward pass (remote against a running central when `HUGPY_API` is set,
29
+ otherwise in-process over the shared ledger); `deploy/hugpy-steward.{service,timer}`
30
+ schedule it. `hugpy-oracle install-hooks` reports what the video hooks wired.
@@ -0,0 +1,33 @@
1
+ # hugpy-steward.service — one oracle steward pass (k113c / TODO-17): the
2
+ # selection system checks itself — calibration of selection scores against
3
+ # judge verdicts, failure streaks per (capability, model), starvation of
4
+ # eligible models, gap share of failures, routing-matrix staleness, cache
5
+ # honesty — and applies BOUNDED rebalancing to the live selection policy.
6
+ #
7
+ # NOT INSTALLED/ENABLED BY THIS FILE. Operator installs after review:
8
+ #
9
+ # sudo cp deploy/hugpy-steward.{service,timer} /etc/systemd/system/
10
+ # sudo systemctl daemon-reload
11
+ # sudo systemctl enable --now hugpy-steward.timer
12
+ # systemctl list-timers hugpy-steward*; journalctl -u hugpy-steward -f
13
+ #
14
+ # ``hugpy-oracle steward`` (entry point of the hugpy-oracle distribution).
15
+ # With HUGPY_API set it POSTs to the running central's /api/oracle/steward so
16
+ # the rebalance lands on the LIVE selector; without it the pass runs
17
+ # in-process against the shared reliability ledger (report + rebalance of a
18
+ # throwaway selector, i.e. report-only). ``--apply`` applies rebalancing
19
+ # (bounded ±0.05 weight steps, exploration 6..30); drop it for report-only.
20
+ # The report is JSON on stdout (journal); alarms (streak / gap_rate) exit
21
+ # non-zero so the unit shows failed in systemctl — that IS the alert until
22
+ # the UI feed renders it (TODO-18).
23
+
24
+ [Unit]
25
+ Description=hugpy oracle steward: self-check + bounded rebalance
26
+ After=network-online.target hugpy-api-dev.service
27
+ Wants=network-online.target
28
+
29
+ [Service]
30
+ Type=oneshot
31
+ # central API port on this box (sentinel uses 7002)
32
+ Environment=HUGPY_API=http://127.0.0.1:7002
33
+ ExecStart=/usr/bin/env hugpy-oracle steward --apply
@@ -0,0 +1,14 @@
1
+ # hugpy-steward.timer — 15-minute cadence for the oracle steward pass.
2
+ # sudo systemctl enable --now hugpy-steward.timer
3
+ [Unit]
4
+ Description=hugpy oracle steward: periodic self-check
5
+
6
+ [Timer]
7
+ OnBootSec=3m
8
+ OnUnitActiveSec=15m
9
+ RandomizedDelaySec=60
10
+ Persistent=true
11
+ Unit=hugpy-steward.service
12
+
13
+ [Install]
14
+ WantedBy=timers.target
@@ -0,0 +1,68 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "setuptools-scm>=8"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "hugpy-oracle"
7
+ dynamic = ["version"]
8
+ description = "Hugpy oracle: creative planning, model selection, screenplay and storyboard generation, DAG runtime, repair, evaluation and ledgers over the video pipeline"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "LicenseRef-Proprietary"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "putkoff", email = "support@hugpy.ai" }]
14
+ keywords = [
15
+ "hugpy",
16
+ "llm",
17
+ "self-hosted",
18
+ "planning",
19
+ "video",
20
+ "orchestration",
21
+ "evaluation",
22
+ ]
23
+ classifiers = [
24
+ "Development Status :: 3 - Alpha",
25
+ "Intended Audience :: Developers",
26
+ "Operating System :: OS Independent",
27
+ "Programming Language :: Python :: 3",
28
+ "Programming Language :: Python :: 3 :: Only",
29
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
30
+ ]
31
+ dependencies = [
32
+ "hugpy-platform",
33
+ "hugpy-control",
34
+ "hugpy-engine",
35
+ "hugpy-media",
36
+ "hugpy-video",
37
+ ]
38
+
39
+ [project.urls]
40
+ Homepage = "https://hugpy.ai"
41
+ Documentation = "https://github.com/hugpy/hugpy/blob/main/py/cinema/hugpy_oracle/README.md"
42
+ Repository = "https://github.com/hugpy/hugpy"
43
+ Source = "https://github.com/hugpy/hugpy/tree/main/py/cinema/hugpy_oracle"
44
+ Issues = "https://github.com/hugpy/hugpy/issues"
45
+ Changelog = "https://github.com/hugpy/hugpy/releases"
46
+ Architecture = "https://github.com/hugpy/hugpy/blob/main/PARTITION.md"
47
+
48
+ [project.optional-dependencies]
49
+ test = ["pytest>=8"]
50
+
51
+ [project.scripts]
52
+ hugpy-oracle = "hugpy_oracle.cli:main"
53
+
54
+ [tool.setuptools.packages.find]
55
+ where = ["src"]
56
+
57
+ [tool.setuptools.package-data]
58
+ hugpy_oracle = ["py.typed", "**/*.json", "**/*.sh", "**/*.md", "**/*.txt"]
59
+
60
+ # ---------------------------------------------------------------------------
61
+ # Lockstep workspace version (2026-09-22): every in-tree hugpy-* distribution
62
+ # takes ONE version from the workspace git tag (vX.Y.Z at the repo root), so a
63
+ # release is a tag and a build always carries the commit it came from
64
+ # (X.Y.Z.devN+g<sha>[.dirty] between tags). A checkout without git metadata
65
+ # builds as 0.0.0+unknown, which central refuses to advertise to workers.
66
+ [tool.setuptools_scm]
67
+ root = "../../.."
68
+ fallback_version = "0.0.0+unknown"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,310 @@
1
+ """hugpy_oracle: decisions and plans over Hugpy's execution packages.
2
+
3
+ The oracle owns creative planning, model selection, screenplay/storyboard,
4
+ the plan DAG runtime, repair/evaluation, benchmarks, the reliability ledger
5
+ and scorecards. It produces IMMUTABLE plans/specs and submits them to
6
+ ``hugpy_video`` through video's public job API; it never writes video's
7
+ state files. It imports ``hugpy_platform``, ``hugpy_control``,
8
+ ``hugpy_engine``, ``hugpy_media`` and ``hugpy_video`` only; the fleet, the
9
+ curation store and the HTTP server reach it through the Protocols in
10
+ :mod:`hugpy_oracle.providers` (fleet/curation) and ``hugpy_video.hooks``
11
+ (video), installed by the composition root.
12
+
13
+ Import is cheap by construction: every public name below is resolved LAZILY
14
+ on first attribute access (PEP 562), so ``import hugpy_oracle`` pulls no
15
+ registry, no catalog and no third-party stack. ``from hugpy_oracle import X``
16
+ keeps working for every name in ``__all__``.
17
+
18
+ Module map (historical wave labels kept for the record): contracts (k90a),
19
+ router/runtime/scorecard (k90b), evaluation/repair (k90c), authority (k97),
20
+ speech (k98), catalog + probes + schema_export (k101), audio_master (k102),
21
+ plan + validator (k103), production + segments (k104), dag_runtime /
22
+ repair_controller / selection / prompt_compiler / steward / spatial /
23
+ recipes (k111-k113), relay (k106 / k121).
24
+ """
25
+
26
+ from __future__ import annotations
27
+
28
+ import importlib
29
+ from typing import Any
30
+
31
+ try: # the installed distribution's version: the workspace tag/commit, never a literal
32
+ from importlib.metadata import version as _dist_version
33
+ __version__ = _dist_version("hugpy-oracle")
34
+ except Exception: # noqa: BLE001 — source tree without metadata
35
+ __version__ = "0.0.0+unknown"
36
+
37
+ # public name -> (submodule, attribute). One entry per exported name.
38
+ _LAZY: dict[str, tuple[str, str]] = {
39
+ # audio_master
40
+ 'AudioBuildResult': ('audio_master', 'AudioBuildResult'),
41
+ 'AudioGap': ('audio_master', 'AudioGap'),
42
+ 'AudioMaster': ('audio_master', 'AudioMaster'),
43
+ 'DialogueTimeline': ('audio_master', 'DialogueTimeline'),
44
+ 'Line': ('audio_master', 'Line'),
45
+ 'LineTiming': ('audio_master', 'LineTiming'),
46
+ 'SpeechCandidate': ('audio_master', 'SpeechCandidate'),
47
+ 'SpeechPolicy': ('audio_master', 'SpeechPolicy'),
48
+ 'VoiceKind': ('audio_master', 'VoiceKind'),
49
+ 'VoiceProfile': ('audio_master', 'VoiceProfile'),
50
+ 'WordTiming': ('audio_master', 'WordTiming'),
51
+ 'build_audio_master': ('audio_master', 'build_audio_master'),
52
+ 'candidate_seed': ('audio_master', 'candidate_seed'),
53
+ # authority
54
+ 'AuthorityDecision': ('authority', 'AuthorityDecision'),
55
+ 'CAPABILITY_ACCESS': ('authority', 'CAPABILITY_ACCESS'),
56
+ 'IDENTITY_CONDITIONED': ('authority', 'IDENTITY_CONDITIONED'),
57
+ 'VOICE_CONDITIONED': ('authority', 'VOICE_CONDITIONED'),
58
+ 'check_authority': ('authority', 'check'),
59
+ 'refusal_receipt': ('authority', 'refusal_receipt'),
60
+ 'refusal_scorecard': ('authority', 'refusal_scorecard'),
61
+ 'required_authorities': ('authority', 'required_authorities'),
62
+ # catalog
63
+ 'LEGACY_TASK_CAPABILITY': ('catalog', 'LEGACY_TASK_CAPABILITY'),
64
+ 'LEGACY_TASK_EXCLUDED': ('catalog', 'LEGACY_TASK_EXCLUDED'),
65
+ 'STUDIO_CAPABILITY_EXCLUDED': ('catalog', 'STUDIO_CAPABILITY_EXCLUDED'),
66
+ 'STUDIO_CAPABILITY_NAME': ('catalog', 'STUDIO_CAPABILITY_NAME'),
67
+ 'capability_version': ('catalog', 'capability_version'),
68
+ 'get_capability': ('catalog', 'get_capability'),
69
+ 'list_capabilities': ('catalog', 'list_capabilities'),
70
+ 'registry_snapshot': ('catalog', 'registry_snapshot'),
71
+ 'registry_version': ('catalog', 'registry_version'),
72
+ 'resolve_owners': ('catalog', 'resolve_owners'),
73
+ 'unmapped_tasks': ('catalog', 'unmapped_tasks'),
74
+ # contracts
75
+ 'AccessKind': ('contracts', 'AccessKind'),
76
+ 'ArtifactKind': ('contracts', 'ArtifactKind'),
77
+ 'ArtifactRef': ('contracts', 'ArtifactRef'),
78
+ 'AuthorityKind': ('contracts', 'AuthorityKind'),
79
+ 'Authorization': ('contracts', 'Authorization'),
80
+ 'BudgetHints': ('contracts', 'BudgetHints'),
81
+ 'CapabilityView': ('contracts', 'CapabilityView'),
82
+ 'Check': ('contracts', 'Check'),
83
+ 'CheckKind': ('contracts', 'CheckKind'),
84
+ 'DEFAULT_CAPABILITY_VERSION': ('contracts', 'DEFAULT_CAPABILITY_VERSION'),
85
+ 'Eligibility': ('contracts', 'Eligibility'),
86
+ 'ExecutionReceipt': ('contracts', 'ExecutionReceipt'),
87
+ 'FailureClass': ('contracts', 'FailureClass'),
88
+ 'FrozenMap': ('contracts', 'FrozenMap'),
89
+ 'GoalSpec': ('contracts', 'GoalSpec'),
90
+ 'InputKind': ('contracts', 'InputKind'),
91
+ 'InputRef': ('contracts', 'InputRef'),
92
+ 'JudgeResult': ('contracts', 'JudgeResult'),
93
+ 'PlannerMode': ('contracts', 'PlannerMode'),
94
+ 'ProbeCheck': ('contracts', 'ProbeCheck'),
95
+ 'ProbeResult': ('contracts', 'ProbeResult'),
96
+ 'ProbeStatus': ('contracts', 'ProbeStatus'),
97
+ 'Provenance': ('contracts', 'Provenance'),
98
+ 'QualityProfile': ('contracts', 'QualityProfile'),
99
+ 'RepairCode': ('contracts', 'RepairCode'),
100
+ 'ResourceHints': ('contracts', 'ResourceHints'),
101
+ 'RightsManifest': ('contracts', 'RightsManifest'),
102
+ 'Scorecard': ('contracts', 'Scorecard'),
103
+ 'SourceRegistry': ('contracts', 'SourceRegistry'),
104
+ 'canonical_json': ('contracts', 'canonical_json'),
105
+ 'coerce_artifact_kind': ('contracts', 'coerce_artifact_kind'),
106
+ # dag_runtime
107
+ 'DagRuntime': ('dag_runtime', 'DagRuntime'),
108
+ 'JournalError': ('dag_runtime', 'JournalError'),
109
+ 'NodeContext': ('dag_runtime', 'NodeContext'),
110
+ 'NodeRecord': ('dag_runtime', 'NodeRecord'),
111
+ 'NodeResult': ('dag_runtime', 'NodeResult'),
112
+ 'NodeState': ('dag_runtime', 'NodeState'),
113
+ 'RepairBudgetExceeded': ('dag_runtime', 'RepairBudgetExceeded'),
114
+ 'ResourceBroker': ('dag_runtime', 'ResourceBroker'),
115
+ 'RunJournal': ('dag_runtime', 'RunJournal'),
116
+ 'RunRecord': ('dag_runtime', 'RunRecord'),
117
+ 'RunState': ('dag_runtime', 'RunState'),
118
+ 'StepReport': ('dag_runtime', 'StepReport'),
119
+ 'derive_cache_key': ('dag_runtime', 'derive_cache_key'),
120
+ # evaluation
121
+ 'DEFAULT_EVALUATED': ('evaluation', 'DEFAULT_EVALUATED'),
122
+ 'RUBRICS': ('evaluation', 'RUBRICS'),
123
+ 'THRESHOLDS': ('evaluation', 'THRESHOLDS'),
124
+ 'evaluate': ('evaluation', 'evaluate'),
125
+ 'parse_judge_verdict': ('evaluation', 'parse_judge_verdict'),
126
+ # plan
127
+ 'AcceptanceTest': ('plan', 'AcceptanceTest'),
128
+ 'CycleError': ('plan', 'CycleError'),
129
+ 'Edge': ('plan', 'Edge'),
130
+ 'FrozenParams': ('plan', 'FrozenParams'),
131
+ 'NodeKind': ('plan', 'NodeKind'),
132
+ 'PlanGraph': ('plan', 'PlanGraph'),
133
+ 'PlanNode': ('plan', 'PlanNode'),
134
+ 'Port': ('plan', 'Port'),
135
+ 'ResourceRequest': ('plan', 'ResourceRequest'),
136
+ 'RetryPolicy': ('plan', 'RetryPolicy'),
137
+ 'goal_digest': ('plan', 'goal_digest'),
138
+ 'sibling_check': ('plan', 'sibling_check'),
139
+ 'sibling_violations': ('plan', 'sibling_violations'),
140
+ # probes
141
+ 'PROBE_BUDGET_S': ('probes', 'PROBE_BUDGET_S'),
142
+ 'PROBE_SPECS': ('probes', 'PROBE_SPECS'),
143
+ 'ProbeSpec': ('probes', 'ProbeSpec'),
144
+ 'probe_capability': ('probes', 'probe_capability'),
145
+ 'register_probe': ('probes', 'register_probe'),
146
+ 'run_probe': ('probes', 'run_probe'),
147
+ # production
148
+ 'CAMERA_KEYS': ('production', 'CAMERA_KEYS'),
149
+ 'CAMERA_MOVES': ('production', 'CAMERA_MOVES'),
150
+ 'CAMERA_VIEWS': ('production', 'CAMERA_VIEWS'),
151
+ 'ContinuityBible': ('production', 'ContinuityBible'),
152
+ 'ContinuityState': ('production', 'ContinuityState'),
153
+ 'GenerationSnapshot': ('production', 'GenerationSnapshot'),
154
+ 'LockRefused': ('production', 'LockRefused'),
155
+ 'ProductionError': ('production', 'ProductionError'),
156
+ 'ProductionLock': ('production', 'ProductionLock'),
157
+ 'RunPromptLedger': ('production', 'RunPromptLedger'),
158
+ 'RunPromptRefused': ('production', 'RunPromptRefused'),
159
+ 'SHOT_SIZES': ('production', 'SHOT_SIZES'),
160
+ 'ShotPlan': ('production', 'ShotPlan'),
161
+ 'ShotPlanEntry': ('production', 'ShotPlanEntry'),
162
+ 'prompt_digest': ('production', 'prompt_digest'),
163
+ # prompt_compiler
164
+ 'ContextPlan': ('prompt_compiler', 'ContextPlan'),
165
+ 'compile_context': ('prompt_compiler', 'compile_context'),
166
+ 'render_prompt': ('prompt_compiler', 'render_prompt'),
167
+ # recipes.video_performance
168
+ 'VisualResult': ('recipes.video_performance', 'VisualResult'),
169
+ 'build_visual_graph': ('recipes.video_performance', 'build_visual_graph'),
170
+ 'resume_visual_stages': ('recipes.video_performance', 'resume_visual_stages'),
171
+ 'run_performance_on_dag': ('recipes.video_performance', 'run_performance_on_dag'),
172
+ 'run_visual_stages': ('recipes.video_performance', 'run_visual_stages'),
173
+ # repair
174
+ 'RepairDecision': ('repair', 'RepairDecision'),
175
+ 'attempt_repair': ('repair', 'attempt_repair'),
176
+ 'execute_repair': ('repair', 'execute_repair'),
177
+ # repair_controller
178
+ 'RepairController': ('repair_controller', 'RepairController'),
179
+ 'RepairPlan': ('repair_controller', 'RepairPlan'),
180
+ 'RepairPolicy': ('repair_controller', 'RepairPolicy'),
181
+ # router
182
+ 'CAPABILITY_TASK': ('router', 'CAPABILITY_TASK'),
183
+ 'RouteDecision': ('router', 'RouteDecision'),
184
+ 'RouteRefusal': ('router', 'RouteRefusal'),
185
+ 'infer_capability': ('router', 'infer_capability'),
186
+ 'resolve_route': ('router', 'resolve_route'),
187
+ # runtime
188
+ 'DispatchTimeout': ('runtime', 'DispatchTimeout'),
189
+ 'GoalShapeError': ('runtime', 'GoalShapeError'),
190
+ 'SYNC_DEADLINE_ENV': ('runtime', 'SYNC_DEADLINE_ENV'),
191
+ 'execute_route': ('runtime', 'execute_route'),
192
+ 'run_bounded': ('runtime', 'run_bounded'),
193
+ 'sync_deadline_s': ('runtime', 'sync_deadline_s'),
194
+ # schema_export
195
+ 'export_all': ('schema_export', 'export_all'),
196
+ 'json_schema_for': ('schema_export', 'json_schema_for'),
197
+ # scorecard
198
+ 'build_deferred_scorecard': ('scorecard', 'build_deferred_scorecard'),
199
+ 'build_gap_scorecard': ('scorecard', 'build_gap_scorecard'),
200
+ 'build_technical_scorecard': ('scorecard', 'build_technical_scorecard'),
201
+ # segments
202
+ 'CompileRefused': ('segments', 'CompileRefused'),
203
+ 'JOINT_MODES': ('segments', 'JOINT_MODES'),
204
+ 'LockedContext': ('segments', 'LockedContext'),
205
+ 'LockedSegmentBrief': ('segments', 'LockedSegmentBrief'),
206
+ 'SEGMENT_CAPABILITY': ('segments', 'SEGMENT_CAPABILITY'),
207
+ 'SegmentSpec': ('segments', 'SegmentSpec'),
208
+ 'SiblingViolation': ('segments', 'SiblingViolation'),
209
+ 'assert_siblings': ('segments', 'assert_siblings'),
210
+ 'build_locked_context': ('segments', 'build_locked_context'),
211
+ 'compile_segments': ('segments', 'compile_segments'),
212
+ 'default_prompt_writer': ('segments', 'default_prompt_writer'),
213
+ 'execution_order': ('segments', 'execution_order'),
214
+ 'render_dependencies': ('segments', 'render_dependencies'),
215
+ 'segment_seed': ('segments', 'segment_seed'),
216
+ 'shot_plan_from_windows': ('segments', 'shot_plan_from_windows'),
217
+ 'shot_windows_from_audio': ('segments', 'shot_windows_from_audio'),
218
+ 'to_plan_graph': ('segments', 'to_plan_graph'),
219
+ # selection
220
+ 'ReliabilityLedger': ('selection', 'ReliabilityLedger'),
221
+ 'SelectionDecision': ('selection', 'SelectionDecision'),
222
+ 'SelectionPolicy': ('selection', 'SelectionPolicy'),
223
+ 'Selector': ('selection', 'Selector'),
224
+ # spatial
225
+ 'CANONICAL': ('spatial', 'CANONICAL'),
226
+ 'ConditioningRequest': ('spatial', 'ConditioningRequest'),
227
+ 'SpatialSceneManifest': ('spatial', 'SpatialSceneManifest'),
228
+ 'SpatialValidation': ('spatial', 'SpatialValidation'),
229
+ 'TierFallback': ('spatial', 'TierFallback'),
230
+ 'TierProfile': ('spatial', 'TierProfile'),
231
+ 'ToneProfile': ('spatial', 'ToneProfile'),
232
+ 'convert_points': ('spatial', 'convert_points'),
233
+ 'frame_alignment_report': ('spatial', 'frame_alignment_report'),
234
+ 'tone_profile': ('spatial', 'tone_profile'),
235
+ 'validate_manifest': ('spatial', 'validate_manifest'),
236
+ # steward
237
+ 'HealthReport': ('steward', 'HealthReport'),
238
+ 'Steward': ('steward', 'Steward'),
239
+ 'StewardPolicy': ('steward', 'StewardPolicy'),
240
+ # tone_scale
241
+ 'tone_to_operator': ('tone_scale', 'to_operator'),
242
+ 'tone_to_unit': ('tone_scale', 'to_unit'),
243
+ # validator
244
+ 'ErrorCode': ('validator', 'ErrorCode'),
245
+ 'ValidationError': ('validator', 'ValidationError'),
246
+ 'ValidationReport': ('validator', 'ValidationReport'),
247
+ 'validate': ('validator', 'validate'),
248
+ 'validate_plan': ('validator', 'validate'),
249
+ }
250
+
251
+
252
+ def __getattr__(name: str) -> Any:
253
+ try:
254
+ module_name, attr = _LAZY[name]
255
+ except KeyError:
256
+ raise AttributeError(f"module 'hugpy_oracle' has no attribute {name!r}") from None
257
+ module = importlib.import_module(f"hugpy_oracle.{module_name}")
258
+ value = getattr(module, attr)
259
+ globals()[name] = value # cache: later lookups skip __getattr__
260
+ return value
261
+
262
+
263
+ def __dir__() -> list[str]:
264
+ return sorted(set(globals()) | set(_LAZY))
265
+
266
+
267
+ def install_hooks(video_hooks: Any = None, video_jobs: Any = None) -> dict[str, Any]:
268
+ """Install the oracle's implementations into video's seams: the prompt
269
+ coordinator (``hugpy_video.hooks``) and the ``video_performance`` bus job
270
+ (``hugpy_video.jobs``). Returns a report of what was wired; a video
271
+ without those seams wires nothing."""
272
+ from hugpy_oracle.relay.hooks import install_hooks as _install
273
+ return _install(video_hooks, video_jobs)
274
+
275
+
276
+ __all__ = [
277
+ "__version__", "install_hooks",
278
+ 'DagRuntime', 'JournalError', 'NodeContext', 'NodeRecord', 'NodeResult', 'NodeState',
279
+ 'RepairBudgetExceeded', 'ResourceBroker', 'RunJournal', 'RunRecord', 'RunState', 'StepReport',
280
+ 'derive_cache_key', 'RepairController', 'RepairPlan', 'RepairPolicy', 'ReliabilityLedger', 'SelectionDecision',
281
+ 'SelectionPolicy', 'Selector', 'ContextPlan', 'compile_context', 'render_prompt', 'HealthReport',
282
+ 'Steward', 'StewardPolicy', 'VisualResult', 'build_visual_graph', 'resume_visual_stages', 'run_performance_on_dag',
283
+ 'run_visual_stages', 'tone_to_operator', 'tone_to_unit', 'CANONICAL', 'ConditioningRequest', 'SpatialSceneManifest',
284
+ 'SpatialValidation', 'TierFallback', 'TierProfile', 'ToneProfile', 'convert_points', 'frame_alignment_report',
285
+ 'tone_profile', 'validate_manifest', 'ArtifactKind', 'ArtifactRef', 'Authorization', 'AuthorityKind',
286
+ 'BudgetHints', 'CapabilityView', 'Check', 'CheckKind', 'Eligibility', 'ExecutionReceipt',
287
+ 'FailureClass', 'GoalSpec', 'InputKind', 'InputRef', 'JudgeResult', 'PlannerMode',
288
+ 'QualityProfile', 'RepairCode', 'ResourceHints', 'RightsManifest', 'Scorecard', 'SourceRegistry',
289
+ 'AccessKind', 'DEFAULT_CAPABILITY_VERSION', 'FrozenMap', 'ProbeCheck', 'ProbeResult', 'ProbeStatus',
290
+ 'Provenance', 'canonical_json', 'coerce_artifact_kind', 'AuthorityDecision', 'CAPABILITY_ACCESS', 'IDENTITY_CONDITIONED',
291
+ 'VOICE_CONDITIONED', 'check_authority', 'refusal_receipt', 'refusal_scorecard', 'required_authorities', 'LEGACY_TASK_CAPABILITY',
292
+ 'LEGACY_TASK_EXCLUDED', 'STUDIO_CAPABILITY_NAME', 'STUDIO_CAPABILITY_EXCLUDED', 'get_capability', 'list_capabilities', 'resolve_owners',
293
+ 'unmapped_tasks', 'PROBE_BUDGET_S', 'PROBE_SPECS', 'ProbeSpec', 'capability_version', 'export_all',
294
+ 'json_schema_for', 'probe_capability', 'register_probe', 'registry_snapshot', 'registry_version', 'run_probe',
295
+ 'AudioBuildResult', 'AudioGap', 'AudioMaster', 'DialogueTimeline', 'Line', 'LineTiming',
296
+ 'SpeechCandidate', 'SpeechPolicy', 'VoiceKind', 'VoiceProfile', 'WordTiming', 'build_audio_master',
297
+ 'candidate_seed', 'AcceptanceTest', 'CycleError', 'Edge', 'FrozenParams', 'NodeKind',
298
+ 'PlanGraph', 'PlanNode', 'Port', 'ResourceRequest', 'RetryPolicy', 'goal_digest',
299
+ 'sibling_check', 'sibling_violations', 'ErrorCode', 'ValidationError', 'ValidationReport', 'validate',
300
+ 'validate_plan', 'CAMERA_KEYS', 'CAMERA_MOVES', 'CAMERA_VIEWS', 'SHOT_SIZES', 'ContinuityBible',
301
+ 'ContinuityState', 'GenerationSnapshot', 'LockRefused', 'ProductionError', 'ProductionLock', 'RunPromptLedger',
302
+ 'RunPromptRefused', 'ShotPlan', 'ShotPlanEntry', 'prompt_digest', 'JOINT_MODES', 'SEGMENT_CAPABILITY',
303
+ 'CompileRefused', 'LockedContext', 'LockedSegmentBrief', 'SegmentSpec', 'SiblingViolation', 'assert_siblings',
304
+ 'build_locked_context', 'compile_segments', 'default_prompt_writer', 'execution_order', 'render_dependencies', 'segment_seed',
305
+ 'shot_plan_from_windows', 'shot_windows_from_audio', 'to_plan_graph', 'CAPABILITY_TASK', 'RouteDecision', 'RouteRefusal',
306
+ 'infer_capability', 'resolve_route', 'GoalShapeError', 'execute_route', 'SYNC_DEADLINE_ENV', 'DispatchTimeout',
307
+ 'run_bounded', 'sync_deadline_s', 'build_technical_scorecard', 'build_gap_scorecard', 'build_deferred_scorecard', 'DEFAULT_EVALUATED',
308
+ 'RUBRICS', 'THRESHOLDS', 'evaluate', 'parse_judge_verdict', 'RepairDecision', 'attempt_repair',
309
+ 'execute_repair',
310
+ ]