hiveplane 0.1.0__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 (138) hide show
  1. hiveplane-0.1.0/.gitignore +128 -0
  2. hiveplane-0.1.0/CHANGELOG.md +66 -0
  3. hiveplane-0.1.0/CONTRIBUTING.md +59 -0
  4. hiveplane-0.1.0/LICENSE +21 -0
  5. hiveplane-0.1.0/PKG-INFO +467 -0
  6. hiveplane-0.1.0/README.md +419 -0
  7. hiveplane-0.1.0/SECURITY.md +68 -0
  8. hiveplane-0.1.0/pyproject.toml +148 -0
  9. hiveplane-0.1.0/src/hiveplane/__init__.py +12 -0
  10. hiveplane-0.1.0/src/hiveplane/adapters/__init__.py +49 -0
  11. hiveplane-0.1.0/src/hiveplane/adapters/base.py +96 -0
  12. hiveplane-0.1.0/src/hiveplane/adapters/dispatch.py +95 -0
  13. hiveplane-0.1.0/src/hiveplane/adapters/errors.py +91 -0
  14. hiveplane-0.1.0/src/hiveplane/adapters/graph.py +40 -0
  15. hiveplane-0.1.0/src/hiveplane/adapters/langgraph.py +306 -0
  16. hiveplane-0.1.0/src/hiveplane/adapters/loader.py +63 -0
  17. hiveplane-0.1.0/src/hiveplane/adapters/raw_worker.py +305 -0
  18. hiveplane-0.1.0/src/hiveplane/adapters/reporter.py +52 -0
  19. hiveplane-0.1.0/src/hiveplane/adapters/stub.py +58 -0
  20. hiveplane-0.1.0/src/hiveplane/adapters/worker.py +329 -0
  21. hiveplane-0.1.0/src/hiveplane/api/__init__.py +1 -0
  22. hiveplane-0.1.0/src/hiveplane/api/app.py +433 -0
  23. hiveplane-0.1.0/src/hiveplane/api/approvals.py +88 -0
  24. hiveplane-0.1.0/src/hiveplane/api/certifications.py +75 -0
  25. hiveplane-0.1.0/src/hiveplane/api/deps.py +62 -0
  26. hiveplane-0.1.0/src/hiveplane/api/policy.py +37 -0
  27. hiveplane-0.1.0/src/hiveplane/api/readiness.py +161 -0
  28. hiveplane-0.1.0/src/hiveplane/api/registry.py +238 -0
  29. hiveplane-0.1.0/src/hiveplane/api/runs.py +101 -0
  30. hiveplane-0.1.0/src/hiveplane/api/sandbox_channel.py +220 -0
  31. hiveplane-0.1.0/src/hiveplane/api/spend.py +22 -0
  32. hiveplane-0.1.0/src/hiveplane/budget/__init__.py +1 -0
  33. hiveplane-0.1.0/src/hiveplane/budget/errors.py +25 -0
  34. hiveplane-0.1.0/src/hiveplane/budget/models.py +64 -0
  35. hiveplane-0.1.0/src/hiveplane/budget/pricing.py +54 -0
  36. hiveplane-0.1.0/src/hiveplane/budget/service.py +163 -0
  37. hiveplane-0.1.0/src/hiveplane/budget/store.py +197 -0
  38. hiveplane-0.1.0/src/hiveplane/budget/summary.py +56 -0
  39. hiveplane-0.1.0/src/hiveplane/certification/__init__.py +1 -0
  40. hiveplane-0.1.0/src/hiveplane/certification/corpus.py +81 -0
  41. hiveplane-0.1.0/src/hiveplane/certification/diff.py +63 -0
  42. hiveplane-0.1.0/src/hiveplane/certification/engine.py +170 -0
  43. hiveplane-0.1.0/src/hiveplane/certification/errors.py +39 -0
  44. hiveplane-0.1.0/src/hiveplane/certification/executor.py +186 -0
  45. hiveplane-0.1.0/src/hiveplane/certification/models.py +389 -0
  46. hiveplane-0.1.0/src/hiveplane/certification/runner.py +239 -0
  47. hiveplane-0.1.0/src/hiveplane/certification/service.py +142 -0
  48. hiveplane-0.1.0/src/hiveplane/certification/signing.py +87 -0
  49. hiveplane-0.1.0/src/hiveplane/certification/store.py +156 -0
  50. hiveplane-0.1.0/src/hiveplane/certification/workflow.py +210 -0
  51. hiveplane-0.1.0/src/hiveplane/checkpointing.py +207 -0
  52. hiveplane-0.1.0/src/hiveplane/cli.py +685 -0
  53. hiveplane-0.1.0/src/hiveplane/config.py +243 -0
  54. hiveplane-0.1.0/src/hiveplane/core/__init__.py +1 -0
  55. hiveplane-0.1.0/src/hiveplane/core/approval.py +35 -0
  56. hiveplane-0.1.0/src/hiveplane/core/decision.py +81 -0
  57. hiveplane-0.1.0/src/hiveplane/core/event.py +37 -0
  58. hiveplane-0.1.0/src/hiveplane/core/fanout.py +49 -0
  59. hiveplane-0.1.0/src/hiveplane/core/health.py +44 -0
  60. hiveplane-0.1.0/src/hiveplane/core/manifest.py +57 -0
  61. hiveplane-0.1.0/src/hiveplane/core/run.py +82 -0
  62. hiveplane-0.1.0/src/hiveplane/core/sandbox.py +63 -0
  63. hiveplane-0.1.0/src/hiveplane/core/shaping.py +52 -0
  64. hiveplane-0.1.0/src/hiveplane/core/spec.py +180 -0
  65. hiveplane-0.1.0/src/hiveplane/core/tools.py +60 -0
  66. hiveplane-0.1.0/src/hiveplane/core/triggers.py +71 -0
  67. hiveplane-0.1.0/src/hiveplane/core/types.py +66 -0
  68. hiveplane-0.1.0/src/hiveplane/core/usage.py +59 -0
  69. hiveplane-0.1.0/src/hiveplane/core/workload.py +56 -0
  70. hiveplane-0.1.0/src/hiveplane/execution/__init__.py +1 -0
  71. hiveplane-0.1.0/src/hiveplane/execution/admission.py +142 -0
  72. hiveplane-0.1.0/src/hiveplane/execution/errors.py +51 -0
  73. hiveplane-0.1.0/src/hiveplane/execution/fanout.py +190 -0
  74. hiveplane-0.1.0/src/hiveplane/execution/gates.py +234 -0
  75. hiveplane-0.1.0/src/hiveplane/execution/models.py +112 -0
  76. hiveplane-0.1.0/src/hiveplane/execution/recovery.py +77 -0
  77. hiveplane-0.1.0/src/hiveplane/execution/sandbox_spec.py +39 -0
  78. hiveplane-0.1.0/src/hiveplane/execution/service.py +477 -0
  79. hiveplane-0.1.0/src/hiveplane/execution/store.py +165 -0
  80. hiveplane-0.1.0/src/hiveplane/execution/story.py +188 -0
  81. hiveplane-0.1.0/src/hiveplane/execution/subprocess_spawner.py +94 -0
  82. hiveplane-0.1.0/src/hiveplane/execution/subprocess_worker.py +264 -0
  83. hiveplane-0.1.0/src/hiveplane/execution/tool_executor.py +62 -0
  84. hiveplane-0.1.0/src/hiveplane/execution/tools.py +313 -0
  85. hiveplane-0.1.0/src/hiveplane/execution/wiring.py +270 -0
  86. hiveplane-0.1.0/src/hiveplane/llm/__init__.py +3 -0
  87. hiveplane-0.1.0/src/hiveplane/llm/factory.py +47 -0
  88. hiveplane-0.1.0/src/hiveplane/llm/fake.py +86 -0
  89. hiveplane-0.1.0/src/hiveplane/llm/models.py +65 -0
  90. hiveplane-0.1.0/src/hiveplane/llm/openai.py +113 -0
  91. hiveplane-0.1.0/src/hiveplane/llm/provider.py +13 -0
  92. hiveplane-0.1.0/src/hiveplane/metrics.py +317 -0
  93. hiveplane-0.1.0/src/hiveplane/persistence/__init__.py +1 -0
  94. hiveplane-0.1.0/src/hiveplane/persistence/audit.py +113 -0
  95. hiveplane-0.1.0/src/hiveplane/persistence/base.py +23 -0
  96. hiveplane-0.1.0/src/hiveplane/persistence/migrate.py +28 -0
  97. hiveplane-0.1.0/src/hiveplane/persistence/migrations/env.py +45 -0
  98. hiveplane-0.1.0/src/hiveplane/persistence/migrations/script.py.mako +25 -0
  99. hiveplane-0.1.0/src/hiveplane/persistence/migrations/versions/0001_initial_schema.py +28 -0
  100. hiveplane-0.1.0/src/hiveplane/persistence/migrations/versions/0002_budget_aggregates.py +34 -0
  101. hiveplane-0.1.0/src/hiveplane/persistence/models.py +289 -0
  102. hiveplane-0.1.0/src/hiveplane/persistence/postgres_audit.py +90 -0
  103. hiveplane-0.1.0/src/hiveplane/persistence/run_store.py +216 -0
  104. hiveplane-0.1.0/src/hiveplane/policy/__init__.py +1 -0
  105. hiveplane-0.1.0/src/hiveplane/policy/approvals.py +114 -0
  106. hiveplane-0.1.0/src/hiveplane/policy/engine.py +296 -0
  107. hiveplane-0.1.0/src/hiveplane/policy/errors.py +39 -0
  108. hiveplane-0.1.0/src/hiveplane/policy/models.py +95 -0
  109. hiveplane-0.1.0/src/hiveplane/policy/packs.py +55 -0
  110. hiveplane-0.1.0/src/hiveplane/policy/store.py +136 -0
  111. hiveplane-0.1.0/src/hiveplane/py.typed +0 -0
  112. hiveplane-0.1.0/src/hiveplane/registry/__init__.py +1 -0
  113. hiveplane-0.1.0/src/hiveplane/registry/errors.py +117 -0
  114. hiveplane-0.1.0/src/hiveplane/registry/models.py +172 -0
  115. hiveplane-0.1.0/src/hiveplane/registry/seeding.py +92 -0
  116. hiveplane-0.1.0/src/hiveplane/registry/service.py +689 -0
  117. hiveplane-0.1.0/src/hiveplane/registry/store.py +410 -0
  118. hiveplane-0.1.0/src/hiveplane/sandbox/__init__.py +1 -0
  119. hiveplane-0.1.0/src/hiveplane/sandbox/egress.py +28 -0
  120. hiveplane-0.1.0/src/hiveplane/sandbox/errors.py +23 -0
  121. hiveplane-0.1.0/src/hiveplane/sandbox/manager.py +230 -0
  122. hiveplane-0.1.0/src/hiveplane/sandbox/models.py +40 -0
  123. hiveplane-0.1.0/src/hiveplane/shaping/__init__.py +1 -0
  124. hiveplane-0.1.0/src/hiveplane/shaping/injection.py +82 -0
  125. hiveplane-0.1.0/src/hiveplane/shaping/pipeline.py +122 -0
  126. hiveplane-0.1.0/src/hiveplane/telemetry.py +207 -0
  127. hiveplane-0.1.0/src/hiveplane/ui/__init__.py +3 -0
  128. hiveplane-0.1.0/src/hiveplane/ui/app.py +196 -0
  129. hiveplane-0.1.0/src/hiveplane/ui/client.py +190 -0
  130. hiveplane-0.1.0/src/hiveplane/ui/templates/approvals.html +80 -0
  131. hiveplane-0.1.0/src/hiveplane/ui/templates/base.html +79 -0
  132. hiveplane-0.1.0/src/hiveplane/ui/templates/certifications.html +101 -0
  133. hiveplane-0.1.0/src/hiveplane/ui/templates/error.html +10 -0
  134. hiveplane-0.1.0/src/hiveplane/ui/templates/fleet.html +89 -0
  135. hiveplane-0.1.0/src/hiveplane/ui/templates/not_found.html +7 -0
  136. hiveplane-0.1.0/src/hiveplane/ui/templates/run_detail.html +80 -0
  137. hiveplane-0.1.0/src/hiveplane/ui/templates/spend.html +61 -0
  138. hiveplane-0.1.0/src/hiveplane/ui/views.py +316 -0
@@ -0,0 +1,128 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ *.manifest
31
+ *.spec
32
+
33
+ # Unit test / coverage reports
34
+ htmlcov/
35
+ .tox/
36
+ .nox/
37
+ .coverage
38
+ .coverage.*
39
+ .cache
40
+ nosetests.xml
41
+ coverage.xml
42
+ *.cover
43
+ *.py,cover
44
+ .hypothesis/
45
+ .pytest_cache/
46
+ .mypy_cache/
47
+ .ruff_cache/
48
+ .dmypy.json
49
+ dmypy.json
50
+
51
+ # Virtual environments
52
+ .env
53
+ .venv
54
+ venv/
55
+ env/
56
+ ENV/
57
+ env.bak/
58
+ venv.bak/
59
+
60
+ # uv
61
+ .uv/
62
+ uv.lock
63
+
64
+ # Poetry
65
+ poetry.lock
66
+
67
+ # Jupyter Notebook
68
+ .ipynb_checkpoints
69
+
70
+ # pyenv
71
+ .python-version
72
+
73
+ # Django
74
+ *.log
75
+ local_settings.py
76
+ db.sqlite3
77
+ db.sqlite3-journal
78
+
79
+ # Docker run evidence is committed (M23, #93/#96): keep the runner logs.
80
+ !field_test/v0.1.0/docker/*.log
81
+
82
+ # Flask
83
+ instance/
84
+ .webassets-cache
85
+
86
+ # SQLite databases
87
+ *.sqlite3
88
+
89
+ # Environment files / secrets
90
+ .env
91
+ .env.*
92
+ !.env.example
93
+ !.env.ci
94
+ !.env.local
95
+ !.env.cloud
96
+ *.pem
97
+ *.key
98
+
99
+ # Docker / local state
100
+ docker-compose.override.yml
101
+ data/
102
+ .hiveplane/
103
+ *.pid
104
+
105
+ # Editor / OS
106
+ .idea/
107
+ .vscode/
108
+ *.swp
109
+ *.swo
110
+ .DS_Store
111
+ Thumbs.db
112
+
113
+ # Node / React UI
114
+ node_modules/
115
+ .next/
116
+ out/
117
+ .turbo/
118
+ *.tsbuildinfo
119
+
120
+ # Field-test vendored upstream agent repos (re-cloned via download scripts, not committed)
121
+ field_test/agents/proven/tooltrust/vendor/
122
+ field_test/agents/proven/evalforge/agents/
123
+ field_test/agents/proven/exectrace/agent-github/
124
+ field_test/agents/proven/exectrace/agent-weather/
125
+ field_test/agents/proven/exectrace/agent-crew/
126
+ field_test/agents/proven/exectrace/agent-chatbot/
127
+ field_test/agents/proven/exectrace/agent-react/
128
+ field_test/agents/proven/exectrace/agent-mcp/
@@ -0,0 +1,66 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2026-09-25
11
+
12
+ The first release: the certified control loop. Register agents, certify them against a
13
+ reproducible benchmark, admit only certified agents to production, run them under
14
+ budget/policy/sandbox, intervene on live runs, deliver results, and observe the fleet —
15
+ all locally on Docker Compose with real workloads.
16
+
17
+ ### Added
18
+
19
+ - **Foundation & data models** — workload manifest (`hiveplane/v1`), run state machine,
20
+ typed core models, settings, and the MCP tool registry with stable tool IDs and trust levels.
21
+ - **Registry service** — agent registration, desired-state validation, fleet catalog, tool
22
+ and trigger records, and certification attestation storage.
23
+ - **Certification pipeline (the thesis)** — reproducible benchmark runner, certification
24
+ engine, signed (Ed25519) attestations verified on read, promotion gate, and drift detector.
25
+ Production admission requires a valid, unexpired certification.
26
+ - **Run lifecycle & execution API** — task submission, persistent run state
27
+ (queued → running → paused/completed/failed), pause/resume/cancel controls, admission
28
+ gates, and durable pause/resume across restarts.
29
+ - **Policy engine & approvals** — deny-by-default tool policy, per-tool authorization,
30
+ escalation, and a human approval queue with attributed operator actions.
31
+ - **Budget enforcement** — per-run and per-day budgets enforced before expensive work,
32
+ with model pricing and usage accounting.
33
+ - **Execution sandbox & tool-output shaping** — isolated execution context with resource
34
+ caps and restricted egress; tool outputs inspected, bounded, and injection-scanned.
35
+ - **Runtime adapters & conformance** — raw-worker and LangGraph adapters plus a conformance
36
+ suite; model-identity binding reported from actual inference (model-swap defense).
37
+ - **State store & persistence** — PostgreSQL system of record with Alembic migrations and
38
+ a tamper-evident, chained-hash audit log.
39
+ - **Telemetry & observability** — OpenTelemetry-native traces, metrics, logs, and audit
40
+ events; fleet metrics and trace-linked debug context; Docker Compose stack with Tempo,
41
+ Prometheus, and Grafana.
42
+ - **CLI & operator UI** — `hiveplane` CLI (register, validate, certify, submit, runs,
43
+ approve) and a server-rendered operator UI (fleet list, run detail, approvals, spend).
44
+ - **Result fan-out** — delivery to Slack and generic webhooks with trace + attestation links.
45
+ - **Docker Compose reference stack** — one-command start; `.env` profiles for fake (hermetic),
46
+ local (OMLX), and cloud (OpenAI) model backends.
47
+ - **Field test** — 10/10 scenarios and all acceptance criteria A1–A20 pass against the live
48
+ stack; container-layer suite 25/25 green. See
49
+ [Field Test Report](docs/field-test/v0.1.0/FIELD_TEST_REPORT.md).
50
+
51
+ ### Security
52
+
53
+ - Deny-by-default tool policy and production admission gated on certification.
54
+ - Signed attestations verified on every read; persistent signing key.
55
+ - Secrets redacted from logs, traces, and audit events.
56
+ - Pre-release secret/dependency audit (trufflehog, `pip-audit`) clean — see
57
+ [Security audit](docs/release/v0.1.0/security-audit.md) and [SECURITY.md](SECURITY.md).
58
+
59
+ ### Known limitations
60
+
61
+ - Coverage gate is **92%** (local 93%; CI 95.45% with Postgres).
62
+ - Tier 2 platform coverage is one certified agent per framework (broader coverage deferred).
63
+ - Multi-tenant support, ROI dashboards, and Helm/cluster deployment deferred to v0.4.0.
64
+
65
+ [Unreleased]: https://github.com/deghosal-2026/hiveplane/compare/v0.1.0...HEAD
66
+ [0.1.0]: https://github.com/deghosal-2026/hiveplane/releases/tag/v0.1.0
@@ -0,0 +1,59 @@
1
+ # Contributing to HivePlane
2
+
3
+ Thanks for your interest. HivePlane is an open-source control plane for operating AI
4
+ agent fleets, and contributions of all kinds are welcome — bug reports, docs, workloads,
5
+ adapters, and code.
6
+
7
+ ## Getting started
8
+
9
+ ```bash
10
+ git clone https://github.com/deghosal-2026/hiveplane.git
11
+ cd hiveplane
12
+ python -m venv .venv && source .venv/bin/activate
13
+ pip install -e ".[dev]"
14
+ ```
15
+
16
+ Postgres-backed tests run only when a database is reachable; without one they skip. To
17
+ run the full suite as CI does, start Postgres (see `docker compose up -d postgres`) and
18
+ set the `HIVEPLANE_DATABASE__*` variables (see `.env.example`).
19
+
20
+ ## Quality gates
21
+
22
+ Every change must pass:
23
+
24
+ ```bash
25
+ make test # pytest (deterministic suite)
26
+ make cov # pytest with coverage report (>= 92%)
27
+ make lint # ruff
28
+ make type # mypy (strict)
29
+ make check # lint + type + cov
30
+ ```
31
+
32
+ CI (`.github/workflows/ci.yml`) runs the same gates on Python 3.12 and 3.13 against a
33
+ Postgres service, plus the operator UI browser tests and a Docker image build.
34
+
35
+ ## Making a change
36
+
37
+ 1. Open an issue describing the problem or feature (or comment on an existing one).
38
+ 2. Branch from `main`.
39
+ 3. Keep changes focused; add tests for behavior changes.
40
+ 4. Run the quality gates locally.
41
+ 5. Open a pull request with a clear description and link the issue.
42
+
43
+ Commit messages use a conventional prefix (`feat`, `fix`, `docs`, `test`, `ci`,
44
+ `security`, `chore`) with an optional scope, e.g. `fix(registry): reject empty tool ids`.
45
+
46
+ ## Adding a workload
47
+
48
+ See [`docs/workloads/CONTRIBUTING.md`](docs/workloads/CONTRIBUTING.md) for the workload
49
+ manifest format, corpus requirements, and validation steps.
50
+
51
+ ## Security
52
+
53
+ Do **not** open a public issue for a vulnerability — follow the process in
54
+ [SECURITY.md](SECURITY.md).
55
+
56
+ ## License
57
+
58
+ By contributing, you agree that your contributions are licensed under the
59
+ [MIT License](LICENSE).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Debashish Ghosal
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.