aihr 0.2.0__py3-none-any.whl

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 (130) hide show
  1. aihr-0.2.0.data/data/share/aihr/configs/deployable.yaml +26 -0
  2. aihr-0.2.0.data/data/share/aihr/configs/fleet.yaml +56 -0
  3. aihr-0.2.0.data/data/share/aihr/configs/hr.toml.example +26 -0
  4. aihr-0.2.0.data/data/share/aihr/configs/knowledge.yaml +824 -0
  5. aihr-0.2.0.data/data/share/aihr/configs/models.yaml +81 -0
  6. aihr-0.2.0.data/data/share/aihr/configs/seats.yaml +206 -0
  7. aihr-0.2.0.data/data/share/aihr/configs/thresholds.yaml +78 -0
  8. aihr-0.2.0.dist-info/METADATA +299 -0
  9. aihr-0.2.0.dist-info/RECORD +130 -0
  10. aihr-0.2.0.dist-info/WHEEL +5 -0
  11. aihr-0.2.0.dist-info/entry_points.txt +2 -0
  12. aihr-0.2.0.dist-info/licenses/LICENSE +21 -0
  13. aihr-0.2.0.dist-info/top_level.txt +1 -0
  14. hr/__init__.py +3 -0
  15. hr/__main__.py +5 -0
  16. hr/adapters/__init__.py +127 -0
  17. hr/adapters/anthropic_compat.py +307 -0
  18. hr/adapters/anthropic_messages.py +43 -0
  19. hr/adapters/anthropic_stream.py +162 -0
  20. hr/adapters/base.py +115 -0
  21. hr/adapters/fleet.py +86 -0
  22. hr/adapters/openai_compat.py +253 -0
  23. hr/adapters/openai_endpoint.py +126 -0
  24. hr/adapters/openai_protocol.py +184 -0
  25. hr/apply.py +220 -0
  26. hr/assign/__init__.py +6 -0
  27. hr/assign/ranker.py +204 -0
  28. hr/bank_selection.py +253 -0
  29. hr/bank_versions.py +114 -0
  30. hr/bench/__init__.py +29 -0
  31. hr/bench/engine.py +295 -0
  32. hr/bench/engine_interactive.py +167 -0
  33. hr/bench/engine_results.py +58 -0
  34. hr/bench/engine_runners.py +142 -0
  35. hr/bench/engine_storage.py +134 -0
  36. hr/bench/livebench.py +163 -0
  37. hr/bench/manifest.py +57 -0
  38. hr/bench/prompt_image.py +47 -0
  39. hr/bench/prompts.py +301 -0
  40. hr/bench/scorer_attention.py +135 -0
  41. hr/bench/scorer_code.py +204 -0
  42. hr/bench/scorer_instruction.py +266 -0
  43. hr/bench/scorer_reasoning.py +255 -0
  44. hr/bench/scorer_runtime.py +76 -0
  45. hr/bench/scorer_shared.py +107 -0
  46. hr/bench/scorers.py +14 -0
  47. hr/bench/stress_prompts.py +94 -0
  48. hr/bench/truths.py +281 -0
  49. hr/benchmark_banks.py +300 -0
  50. hr/calibrate.py +14 -0
  51. hr/calibration_cli.py +177 -0
  52. hr/calibration_items.py +237 -0
  53. hr/calibration_models.py +157 -0
  54. hr/calibration_persistence.py +129 -0
  55. hr/calibration_runner.py +270 -0
  56. hr/cli.py +69 -0
  57. hr/cli_app.py +65 -0
  58. hr/cli_apply.py +170 -0
  59. hr/cli_inventory.py +221 -0
  60. hr/cli_knowledge.py +149 -0
  61. hr/cli_report_base.py +165 -0
  62. hr/cli_report_commands.py +125 -0
  63. hr/cli_report_verdict.py +165 -0
  64. hr/cli_selection.py +85 -0
  65. hr/config.py +305 -0
  66. hr/config_resources.py +73 -0
  67. hr/db.py +176 -0
  68. hr/db_schema.py +249 -0
  69. hr/decision.py +256 -0
  70. hr/deployable.py +130 -0
  71. hr/deployment_manager.py +1222 -0
  72. hr/discover.py +192 -0
  73. hr/fleet.py +228 -0
  74. hr/fleet_policy.py +91 -0
  75. hr/graders/__init__.py +32 -0
  76. hr/graders/base.py +150 -0
  77. hr/graders/citation.py +152 -0
  78. hr/graders/constraint.py +240 -0
  79. hr/graders/constraint_dsl.py +138 -0
  80. hr/graders/exact_match.py +234 -0
  81. hr/graders/llm_judge.py +117 -0
  82. hr/graders/schema_valid.py +244 -0
  83. hr/graders/unit_test.py +140 -0
  84. hr/health.py +253 -0
  85. hr/health_metrics.py +143 -0
  86. hr/items/__init__.py +43 -0
  87. hr/items/loader.py +287 -0
  88. hr/items/payloads.py +189 -0
  89. hr/items/schema.py +225 -0
  90. hr/keyscan.py +264 -0
  91. hr/models.py +32 -0
  92. hr/opencfg.py +107 -0
  93. hr/plugin_safety.py +845 -0
  94. hr/publish.py +151 -0
  95. hr/recommend.py +804 -0
  96. hr/recommendation_constraints.py +318 -0
  97. hr/reference.py +39 -0
  98. hr/registry.py +96 -0
  99. hr/release_manifest.py +308 -0
  100. hr/research.py +38 -0
  101. hr/sandbox.py +98 -0
  102. hr/scheduler/__init__.py +15 -0
  103. hr/scheduler/taxonomy.py +258 -0
  104. hr/schema_migration.py +78 -0
  105. hr/scorer_calibration.py +764 -0
  106. hr/seats/__init__.py +20 -0
  107. hr/seats/health_gates.py +210 -0
  108. hr/seats/health_policy.py +104 -0
  109. hr/seats/rolespec.py +217 -0
  110. hr/seats/seed.py +194 -0
  111. hr/stage0.py +264 -0
  112. hr/stage0_call.py +155 -0
  113. hr/stage0_cli.py +184 -0
  114. hr/stage0_loop.py +125 -0
  115. hr/stage0_plan.py +89 -0
  116. hr/stage0_selection.py +251 -0
  117. hr/stage0_stats.py +201 -0
  118. hr/stage0_storage.py +344 -0
  119. hr/stage1.py +265 -0
  120. hr/stage1_cli.py +210 -0
  121. hr/stage1_loop.py +301 -0
  122. hr/stage1_plan.py +103 -0
  123. hr/stage1_resume.py +148 -0
  124. hr/stage1_selection.py +163 -0
  125. hr/stage1_state.py +157 -0
  126. hr/stage1_stats.py +71 -0
  127. hr/stats/__init__.py +10 -0
  128. hr/stats/bootstrap.py +131 -0
  129. hr/stats/empirical_bernstein.py +230 -0
  130. hr/stats/sequential.py +183 -0
@@ -0,0 +1,26 @@
1
+ # deployable.yaml — the ONLY hand-maintained model list in this repo.
2
+ #
3
+ # Every model the opencode config declares (opencode.jsonc provider.*;
4
+ # models) is derived automatically — add/retire it there and it flows into
5
+ # stage sweep pools / discover / routing / the deployable set with ZERO
6
+ # edits here (hr/fleet.py resolves the fleet at runtime).
7
+ #
8
+ # `extra_deployable:` lists models served OUTSIDE the opencode config —
9
+ # registry-only providers (kimi-for-coding, deepseek) opencode loads from
10
+ # its own registry. This is user policy, not a mirror.
11
+ #
12
+ # Drift guard: an entry that duplicates a config-declared model is REJECTED
13
+ # at runtime (hr.fleet.merge_with_extras) — the model must be removed from
14
+ # this list, not duplicated. Add the provider's wire here and in the
15
+ # `wire_overrides:` map of configs/fleet.yaml.
16
+ # EXAMPLES ONLY — this tracked file ships with an EMPTY list. A live
17
+ # machine's extra models live in the gitignored configs/deployable.local.yaml
18
+ # overlay (deep-merged by hr.config.load_yaml; the overlay LIST REPLACES
19
+ # this one, it is not appended). First-install: `cp configs/deployable.yaml
20
+ # configs/deployable.local.yaml`, then fill the list with your registry-only
21
+ # models (provider/slug) and declare each provider's wire in the
22
+ # configs/fleet.local.yaml wire_overrides map. An extra duplicating a
23
+ # config-declared model is still REJECTED at runtime (drift guard).
24
+ extra_deployable: []
25
+ # example:
26
+ # - example-provider/example-model-a
@@ -0,0 +1,56 @@
1
+ # fleet.yaml — OPTIONAL overrides for the dynamically derived model fleet.
2
+ #
3
+ # The fleet is NOT snapshotted here anymore (hr-unification todo 23's static
4
+ # manifest was rejected: fixed model names drift from opencode's live config).
5
+ # At RUNTIME hr derives the full inventory from the opencode config files
6
+ # themselves — every `provider.*.models` entry in opencode.jsonc (global +
7
+ # project, project merged over global) becomes a fleet model, its wire type
8
+ # derives from the provider's `npm` field via an explicit table, and new
9
+ # models flow into the stage sweep pools / `hr discover` / adapter routing
10
+ # with ZERO edits in this repo.
11
+ #
12
+ # This file exists only for the policy knobs a derivation cannot answer:
13
+ #
14
+ # wire_overrides: wire type for providers whose npm field is absent or
15
+ # unknown. Registry-only providers (kimi-for-coding,
16
+ # deepseek) are NOT declared in opencode.jsonc — their
17
+ # models live under configs/deployable.yaml
18
+ # `extra_deployable:`, and their wire MUST be declared
19
+ # here. The config-declared `azure` gateway carries no
20
+ # npm field either, so its wire is declared here too. A
21
+ # config-declared provider with a known npm needs nothing.
22
+ # Unknown npm + no override = fail loud at runtime (never
23
+ # a silent guess).
24
+ #
25
+ # scope_excludes: providers kept OUT of the default discover/sweep scope.
26
+ # Everything the opencode config declares is in scope by
27
+ # default (new providers auto-inherit); an explicit
28
+ # exclusion here is the ONLY way to opt a provider out.
29
+ #
30
+ # gateway_urls: per-provider gateway base URL used when a provider has
31
+ # NO options.baseURL in the opencode config (registry-only
32
+ # providers such as kimi-for-coding / deepseek, served via
33
+ # their own gateways) — the auth.json fallback in
34
+ # hr.config.get_provider_config and the anthropic adapter
35
+ # resolve through it. Endpoint URLs are routing data, not
36
+ # credentials. A provider with no config block, no gateway
37
+ # entry and no auth entry is a fail-loud config error.
38
+
39
+ # EXAMPLES ONLY — this tracked file ships with zero real deployment values.
40
+ # A live machine declares its real overrides in the gitignored
41
+ # configs/fleet.local.yaml overlay (deep-merged by hr.config.load_yaml:
42
+ # dicts merge per key, LIST VALUES ARE REPLACED, not merged). Keep the real
43
+ # wire_overrides / scope_excludes / gateway_urls entries there; wire
44
+ # overrides must cover every registry-only provider served via the
45
+ # deployable extra_deployable list, and gateway_urls covers providers with
46
+ # no options.baseURL in the opencode config. Unknown npm + no override =
47
+ # fail loud at runtime (never a silent guess).
48
+
49
+ wire_overrides:
50
+ example-provider: anthropic-compat
51
+
52
+ scope_excludes:
53
+ - example-excluded-provider
54
+
55
+ gateway_urls:
56
+ example-provider: https://gateway.example.invalid/v1
@@ -0,0 +1,26 @@
1
+ # HR v1 configuration template.
2
+ # Copy to hr.toml and adjust for your environment.
3
+ #
4
+ # Secrets (db_password, API keys) are NEVER stored here.
5
+ # Set them via environment variables instead:
6
+ # HR_DSN — full PostgreSQL connection string (preferred); overrides individual db_* fields
7
+ # HR_DB_PASSWORD — password for the wiki DB (required if HR_DSN is not set)
8
+ # HR_DB_USER — DB username (default: "wikijs")
9
+ # HR_BAILIAN_API_KEY — Bailian provider API key
10
+ # WIKI_API_KEY_FILE — path to Wiki.js JWT token file (default: ~/.wikijs-api-key)
11
+
12
+ # --- Database connection (non-secret fields) ---
13
+ db_host = "localhost"
14
+ db_port = 5432
15
+ db_name = "wiki"
16
+ db_user = "wikijs"
17
+
18
+ # Example HR_DSN (uncomment and fill in real values):
19
+ # dsn = "postgresql://username:PASSWORD@localhost:5432/wiki"
20
+
21
+ # --- Optional Wiki.js publish target for `hr publish` ---
22
+ # Without this [wiki] section the command prints "wiki not configured,
23
+ # skipping" and exits 0 — the wiki is an optional publish target.
24
+ # [wiki]
25
+ # graphql_url = "http://localhost:3000/graphql"
26
+ # api_key_file = "~/.wikijs-api-key"