openshard 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 (226) hide show
  1. openshard-0.1.0/LICENSE +21 -0
  2. openshard-0.1.0/PKG-INFO +553 -0
  3. openshard-0.1.0/README.md +526 -0
  4. openshard-0.1.0/openshard/__init__.py +6 -0
  5. openshard-0.1.0/openshard/analysis/__init__.py +0 -0
  6. openshard-0.1.0/openshard/analysis/repo.py +180 -0
  7. openshard-0.1.0/openshard/cli/__init__.py +0 -0
  8. openshard-0.1.0/openshard/cli/main.py +2613 -0
  9. openshard-0.1.0/openshard/cli/run_output.py +2188 -0
  10. openshard-0.1.0/openshard/cli/ui/__init__.py +1 -0
  11. openshard-0.1.0/openshard/cli/ui/console.py +19 -0
  12. openshard-0.1.0/openshard/cli/ui/home.py +318 -0
  13. openshard-0.1.0/openshard/cli/ui/run_screen.py +149 -0
  14. openshard-0.1.0/openshard/cli/ui/theme.py +15 -0
  15. openshard-0.1.0/openshard/config/__init__.py +0 -0
  16. openshard-0.1.0/openshard/config/settings.py +76 -0
  17. openshard-0.1.0/openshard/cost/__init__.py +0 -0
  18. openshard-0.1.0/openshard/cost/baseline.py +159 -0
  19. openshard-0.1.0/openshard/evals/__init__.py +0 -0
  20. openshard-0.1.0/openshard/evals/adjustments.py +181 -0
  21. openshard-0.1.0/openshard/evals/registry.py +67 -0
  22. openshard-0.1.0/openshard/evals/runner.py +138 -0
  23. openshard-0.1.0/openshard/evals/stats.py +265 -0
  24. openshard-0.1.0/openshard/execution/__init__.py +0 -0
  25. openshard-0.1.0/openshard/execution/gates.py +82 -0
  26. openshard-0.1.0/openshard/execution/generator.py +403 -0
  27. openshard-0.1.0/openshard/execution/opencode_executor.py +195 -0
  28. openshard-0.1.0/openshard/execution/runner.py +18 -0
  29. openshard-0.1.0/openshard/execution/stages.py +170 -0
  30. openshard-0.1.0/openshard/history/__init__.py +0 -0
  31. openshard-0.1.0/openshard/history/adjustments.py +99 -0
  32. openshard-0.1.0/openshard/history/failure_memory.py +122 -0
  33. openshard-0.1.0/openshard/history/feedback.py +102 -0
  34. openshard-0.1.0/openshard/history/feedback_scoring.py +174 -0
  35. openshard-0.1.0/openshard/history/interactions.py +101 -0
  36. openshard-0.1.0/openshard/history/metrics.py +199 -0
  37. openshard-0.1.0/openshard/history/native_steps.py +113 -0
  38. openshard-0.1.0/openshard/history/run_checkpoints.py +107 -0
  39. openshard-0.1.0/openshard/history/sandbox_apply_receipts.py +99 -0
  40. openshard-0.1.0/openshard/history/session_events.py +58 -0
  41. openshard-0.1.0/openshard/history/session_signals.py +178 -0
  42. openshard-0.1.0/openshard/history/shard_contract.py +1195 -0
  43. openshard-0.1.0/openshard/models/__init__.py +0 -0
  44. openshard-0.1.0/openshard/models/advisory.py +133 -0
  45. openshard-0.1.0/openshard/models/feedback_advisory.py +91 -0
  46. openshard-0.1.0/openshard/models/mode_policy.py +53 -0
  47. openshard-0.1.0/openshard/models/registry.py +752 -0
  48. openshard-0.1.0/openshard/native/__init__.py +0 -0
  49. openshard-0.1.0/openshard/native/backends.py +223 -0
  50. openshard-0.1.0/openshard/native/context.py +3614 -0
  51. openshard-0.1.0/openshard/native/dispatch.py +183 -0
  52. openshard-0.1.0/openshard/native/executor.py +1588 -0
  53. openshard-0.1.0/openshard/native/loop.py +66 -0
  54. openshard-0.1.0/openshard/native/osn_loop_recorder.py +101 -0
  55. openshard-0.1.0/openshard/native/repo_context.py +121 -0
  56. openshard-0.1.0/openshard/native/sandbox.py +75 -0
  57. openshard-0.1.0/openshard/native/sandbox_apply.py +195 -0
  58. openshard-0.1.0/openshard/native/sandbox_diff.py +104 -0
  59. openshard-0.1.0/openshard/native/skills.py +120 -0
  60. openshard-0.1.0/openshard/native/tool_runner.py +98 -0
  61. openshard-0.1.0/openshard/native/tools.py +385 -0
  62. openshard-0.1.0/openshard/planning/__init__.py +0 -0
  63. openshard-0.1.0/openshard/planning/generator.py +117 -0
  64. openshard-0.1.0/openshard/providers/__init__.py +3 -0
  65. openshard-0.1.0/openshard/providers/anthropic.py +117 -0
  66. openshard-0.1.0/openshard/providers/base.py +73 -0
  67. openshard-0.1.0/openshard/providers/cache.py +43 -0
  68. openshard-0.1.0/openshard/providers/manager.py +105 -0
  69. openshard-0.1.0/openshard/providers/openai.py +119 -0
  70. openshard-0.1.0/openshard/providers/openrouter.py +252 -0
  71. openshard-0.1.0/openshard/review/__init__.py +0 -0
  72. openshard-0.1.0/openshard/review/checks.py +185 -0
  73. openshard-0.1.0/openshard/review/domain_files.py +101 -0
  74. openshard-0.1.0/openshard/review/terraform_checker.py +528 -0
  75. openshard-0.1.0/openshard/routing/__init__.py +0 -0
  76. openshard-0.1.0/openshard/routing/engine.py +262 -0
  77. openshard-0.1.0/openshard/routing/form_factor_policy.py +114 -0
  78. openshard-0.1.0/openshard/routing/profiles.py +111 -0
  79. openshard-0.1.0/openshard/routing/workflow_selector.py +88 -0
  80. openshard-0.1.0/openshard/run/__init__.py +0 -0
  81. openshard-0.1.0/openshard/run/pipeline.py +2646 -0
  82. openshard-0.1.0/openshard/run/timeline.py +102 -0
  83. openshard-0.1.0/openshard/run/validator_policy.py +51 -0
  84. openshard-0.1.0/openshard/scoring/__init__.py +0 -0
  85. openshard-0.1.0/openshard/scoring/filter.py +72 -0
  86. openshard-0.1.0/openshard/scoring/policy.py +82 -0
  87. openshard-0.1.0/openshard/scoring/requirements.py +37 -0
  88. openshard-0.1.0/openshard/scoring/scorer.py +136 -0
  89. openshard-0.1.0/openshard/scoring/shortlist.py +84 -0
  90. openshard-0.1.0/openshard/security/__init__.py +0 -0
  91. openshard-0.1.0/openshard/security/paths.py +84 -0
  92. openshard-0.1.0/openshard/skills/__init__.py +0 -0
  93. openshard-0.1.0/openshard/skills/context.py +25 -0
  94. openshard-0.1.0/openshard/skills/discovery.py +82 -0
  95. openshard-0.1.0/openshard/skills/matcher.py +57 -0
  96. openshard-0.1.0/openshard/tui/__init__.py +1 -0
  97. openshard-0.1.0/openshard/tui/action_blocks.py +135 -0
  98. openshard-0.1.0/openshard/tui/app.py +564 -0
  99. openshard-0.1.0/openshard/tui/ask_mode.py +222 -0
  100. openshard-0.1.0/openshard/tui/commands.py +113 -0
  101. openshard-0.1.0/openshard/tui/plan_mode.py +55 -0
  102. openshard-0.1.0/openshard/tui/state.py +104 -0
  103. openshard-0.1.0/openshard/tui/styles.tcss +114 -0
  104. openshard-0.1.0/openshard/verification/__init__.py +23 -0
  105. openshard-0.1.0/openshard/verification/executor.py +87 -0
  106. openshard-0.1.0/openshard/verification/plan.py +243 -0
  107. openshard-0.1.0/openshard/workflow_packs/__init__.py +0 -0
  108. openshard-0.1.0/openshard/workflow_packs/builtin.py +118 -0
  109. openshard-0.1.0/openshard/workflow_packs/packs.py +62 -0
  110. openshard-0.1.0/openshard.egg-info/PKG-INFO +553 -0
  111. openshard-0.1.0/openshard.egg-info/SOURCES.txt +224 -0
  112. openshard-0.1.0/openshard.egg-info/dependency_links.txt +1 -0
  113. openshard-0.1.0/openshard.egg-info/entry_points.txt +2 -0
  114. openshard-0.1.0/openshard.egg-info/requires.txt +16 -0
  115. openshard-0.1.0/openshard.egg-info/top_level.txt +1 -0
  116. openshard-0.1.0/pyproject.toml +55 -0
  117. openshard-0.1.0/setup.cfg +4 -0
  118. openshard-0.1.0/tests/test_action_blocks.py +376 -0
  119. openshard-0.1.0/tests/test_ask_mode.py +117 -0
  120. openshard-0.1.0/tests/test_backend_execution_result.py +65 -0
  121. openshard-0.1.0/tests/test_baseline_cost.py +284 -0
  122. openshard-0.1.0/tests/test_cache.py +71 -0
  123. openshard-0.1.0/tests/test_candidate_diff_apply.py +665 -0
  124. openshard-0.1.0/tests/test_candidate_ranking.py +506 -0
  125. openshard-0.1.0/tests/test_cli_models.py +157 -0
  126. openshard-0.1.0/tests/test_cli_native_loop.py +475 -0
  127. openshard-0.1.0/tests/test_cli_package.py +29 -0
  128. openshard-0.1.0/tests/test_cli_repo_summary.py +113 -0
  129. openshard-0.1.0/tests/test_cli_tui.py +43 -0
  130. openshard-0.1.0/tests/test_cost.py +74 -0
  131. openshard-0.1.0/tests/test_deepagents_backend.py +251 -0
  132. openshard-0.1.0/tests/test_demo_command.py +140 -0
  133. openshard-0.1.0/tests/test_demo_tasks.py +98 -0
  134. openshard-0.1.0/tests/test_eval_adjustments.py +457 -0
  135. openshard-0.1.0/tests/test_evals.py +1258 -0
  136. openshard-0.1.0/tests/test_export_runs.py +444 -0
  137. openshard-0.1.0/tests/test_failure_memory.py +863 -0
  138. openshard-0.1.0/tests/test_failure_memory_routing_advisory.py +799 -0
  139. openshard-0.1.0/tests/test_feedback.py +236 -0
  140. openshard-0.1.0/tests/test_feedback_cli.py +95 -0
  141. openshard-0.1.0/tests/test_feedback_scoring.py +342 -0
  142. openshard-0.1.0/tests/test_feedback_signals.py +208 -0
  143. openshard-0.1.0/tests/test_feedback_stats.py +276 -0
  144. openshard-0.1.0/tests/test_filter.py +127 -0
  145. openshard-0.1.0/tests/test_form_factor_policy.py +267 -0
  146. openshard-0.1.0/tests/test_gates.py +94 -0
  147. openshard-0.1.0/tests/test_generator_parse.py +587 -0
  148. openshard-0.1.0/tests/test_history_adjustments.py +116 -0
  149. openshard-0.1.0/tests/test_home_screen.py +206 -0
  150. openshard-0.1.0/tests/test_interactions.py +383 -0
  151. openshard-0.1.0/tests/test_iterative_retry_loop.py +547 -0
  152. openshard-0.1.0/tests/test_last_rendering.py +4988 -0
  153. openshard-0.1.0/tests/test_manager.py +159 -0
  154. openshard-0.1.0/tests/test_metrics.py +384 -0
  155. openshard-0.1.0/tests/test_model_advisory.py +363 -0
  156. openshard-0.1.0/tests/test_model_mode_policy.py +201 -0
  157. openshard-0.1.0/tests/test_model_registry.py +366 -0
  158. openshard-0.1.0/tests/test_model_stats.py +253 -0
  159. openshard-0.1.0/tests/test_native_candidate_agents.py +744 -0
  160. openshard-0.1.0/tests/test_native_clarification_request.py +287 -0
  161. openshard-0.1.0/tests/test_native_context_provenance.py +523 -0
  162. openshard-0.1.0/tests/test_native_context_usage_summary.py +376 -0
  163. openshard-0.1.0/tests/test_native_executor.py +6483 -0
  164. openshard-0.1.0/tests/test_native_failure_memory.py +292 -0
  165. openshard-0.1.0/tests/test_native_model_candidate_scoring.py +470 -0
  166. openshard-0.1.0/tests/test_native_model_policy.py +258 -0
  167. openshard-0.1.0/tests/test_native_model_policy_receipt.py +198 -0
  168. openshard-0.1.0/tests/test_native_model_selection_decision.py +398 -0
  169. openshard-0.1.0/tests/test_native_multistep_loop.py +867 -0
  170. openshard-0.1.0/tests/test_native_plan_ledger.py +393 -0
  171. openshard-0.1.0/tests/test_native_receipt.py +1494 -0
  172. openshard-0.1.0/tests/test_native_repo_context.py +244 -0
  173. openshard-0.1.0/tests/test_native_routing_preview.py +487 -0
  174. openshard-0.1.0/tests/test_native_routing_receipt.py +405 -0
  175. openshard-0.1.0/tests/test_native_run_trust_score.py +449 -0
  176. openshard-0.1.0/tests/test_native_skills.py +109 -0
  177. openshard-0.1.0/tests/test_native_step_events.py +485 -0
  178. openshard-0.1.0/tests/test_native_tier_dispatch.py +776 -0
  179. openshard-0.1.0/tests/test_native_tool_runner.py +407 -0
  180. openshard-0.1.0/tests/test_native_tools.py +601 -0
  181. openshard-0.1.0/tests/test_native_validation_contract.py +372 -0
  182. openshard-0.1.0/tests/test_native_verification_plan.py +308 -0
  183. openshard-0.1.0/tests/test_osn_loop.py +639 -0
  184. openshard-0.1.0/tests/test_osn_loop_bounded_v0.py +408 -0
  185. openshard-0.1.0/tests/test_osn_loop_summary.py +548 -0
  186. openshard-0.1.0/tests/test_path_safety.py +296 -0
  187. openshard-0.1.0/tests/test_plan_mode.py +56 -0
  188. openshard-0.1.0/tests/test_policy_scoring.py +207 -0
  189. openshard-0.1.0/tests/test_profiles.py +557 -0
  190. openshard-0.1.0/tests/test_readonly_task.py +951 -0
  191. openshard-0.1.0/tests/test_repo_analysis.py +313 -0
  192. openshard-0.1.0/tests/test_requirements.py +77 -0
  193. openshard-0.1.0/tests/test_review_checks.py +238 -0
  194. openshard-0.1.0/tests/test_routing_integration.py +686 -0
  195. openshard-0.1.0/tests/test_run_checkpoints.py +750 -0
  196. openshard-0.1.0/tests/test_run_history.py +805 -0
  197. openshard-0.1.0/tests/test_run_output.py +513 -0
  198. openshard-0.1.0/tests/test_sandbox.py +310 -0
  199. openshard-0.1.0/tests/test_sandbox_apply.py +780 -0
  200. openshard-0.1.0/tests/test_sandbox_apply_receipts.py +446 -0
  201. openshard-0.1.0/tests/test_sandbox_diff.py +407 -0
  202. openshard-0.1.0/tests/test_scored_routing_result.py +147 -0
  203. openshard-0.1.0/tests/test_scorer.py +231 -0
  204. openshard-0.1.0/tests/test_session_events.py +171 -0
  205. openshard-0.1.0/tests/test_session_signals.py +406 -0
  206. openshard-0.1.0/tests/test_shard_contract.py +2177 -0
  207. openshard-0.1.0/tests/test_shell_policy.py +442 -0
  208. openshard-0.1.0/tests/test_shortlist.py +131 -0
  209. openshard-0.1.0/tests/test_skills_context.py +83 -0
  210. openshard-0.1.0/tests/test_skills_discovery.py +172 -0
  211. openshard-0.1.0/tests/test_skills_matcher.py +152 -0
  212. openshard-0.1.0/tests/test_skills_stats.py +208 -0
  213. openshard-0.1.0/tests/test_stack_guard.py +145 -0
  214. openshard-0.1.0/tests/test_terraform_checker.py +1247 -0
  215. openshard-0.1.0/tests/test_tier_model_mapping.py +406 -0
  216. openshard-0.1.0/tests/test_tui_app.py +1989 -0
  217. openshard-0.1.0/tests/test_tui_commands.py +336 -0
  218. openshard-0.1.0/tests/test_tui_state.py +210 -0
  219. openshard-0.1.0/tests/test_validator_policy.py +417 -0
  220. openshard-0.1.0/tests/test_validator_stage.py +374 -0
  221. openshard-0.1.0/tests/test_verification_contract_result.py +246 -0
  222. openshard-0.1.0/tests/test_verification_execution.py +237 -0
  223. openshard-0.1.0/tests/test_verification_output.py +64 -0
  224. openshard-0.1.0/tests/test_verification_plan.py +253 -0
  225. openshard-0.1.0/tests/test_workflow_packs.py +107 -0
  226. openshard-0.1.0/tests/test_workflow_selector.py +250 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Michael
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.
@@ -0,0 +1,553 @@
1
+ Metadata-Version: 2.4
2
+ Name: openshard
3
+ Version: 0.1.0
4
+ Summary: The control layer for AI coding agents.
5
+ Author-email: Michael Obasa <michaelobasa2@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/MichaelObasa/openshard
8
+ Project-URL: Repository, https://github.com/MichaelObasa/openshard
9
+ Project-URL: Bug Tracker, https://github.com/MichaelObasa/openshard/issues
10
+ Requires-Python: >=3.11
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: click>=8.1
14
+ Requires-Dist: pyyaml>=6.0
15
+ Requires-Dist: httpx>=0.27
16
+ Requires-Dist: rich>=13.7
17
+ Requires-Dist: textual>=0.70
18
+ Provides-Extra: anthropic
19
+ Requires-Dist: anthropic>=0.40; extra == "anthropic"
20
+ Provides-Extra: openai
21
+ Requires-Dist: openai>=1.0; extra == "openai"
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=8.0; extra == "dev"
24
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
25
+ Requires-Dist: ruff>=0.4; extra == "dev"
26
+ Dynamic: license-file
27
+
28
+ # OpenShard
29
+
30
+ <p align="center">
31
+ <strong>The control layer for AI coding agents.</strong>
32
+ </p>
33
+
34
+ <p align="center">
35
+ AI coding agents can write code, but engineering teams still need to understand what ran, what changed, what context was used, whether checks passed, what it cost and a way of proving it. OpenShard wraps AI coding agent runs with routing, review boundaries, checks, evidence, cost tracking, evals, feedback, and durable Shard receipts.
36
+ </p>
37
+
38
+ <p align="center">
39
+ <strong>Agents write code. OpenShard controls the run and proves what happened.</strong>
40
+ </p>
41
+
42
+ <p align="center">
43
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=for-the-badge" alt="License"></a>
44
+ <a href="#"><img src="https://img.shields.io/badge/status-alpha-orange?style=for-the-badge" alt="Status"></a>
45
+ <a href="#"><img src="https://img.shields.io/badge/python-3.11%2B-3776AB?style=for-the-badge&logo=python&logoColor=white" alt="Python"></a>
46
+ <a href="#"><img src="https://img.shields.io/badge/CLI-terminal-black?style=for-the-badge" alt="CLI"></a>
47
+ </p>
48
+
49
+ ---
50
+
51
+ ## Why OpenShard exists
52
+ AI coding agents are becoming good enough to work on real repos, infrastructure, and production-shaped systems.
53
+
54
+ That creates a new problem. Not “can the model write code?” but:
55
+ - Which model or workflow handled the task?
56
+ - What files did it inspect?
57
+ - What did it change?
58
+ - Did checks pass, fail, skip, or not run?
59
+ - What did the run cost?
60
+ - Was anything risky gated or reviewed?
61
+ - Is there a durable receipt of what happened?
62
+
63
+ OpenShard is built for the work around the agent: routing, verification, policy, evidence, cost awareness, and auditability.
64
+ The valuable unit is not a single model call. It is a completed engineering task with evidence, checks, cost, and a receipt.
65
+
66
+ ---
67
+
68
+ ## What OpenShard does
69
+ OpenShard is a CLI tool for controlling and recording AI coding agent runs.
70
+
71
+ It can:
72
+ - Run real repo tasks through a controlled execution path
73
+ - Route work across models and workflows where available
74
+ - Classify task risk
75
+ - Gate risky writes and commands
76
+ - Record model used, risk, checks, changed files, evidence, cost, and result
77
+ - Produce durable Shard receipts for every run
78
+ - Support read-only review flows that preserve `Changed 0 files`
79
+ - Provide workflow packs for repeatable engineering reviews
80
+ - Compare models and workflows through local evals
81
+ - Track feedback and session signals around runs
82
+
83
+ OpenShard is not trying to replace Claude Code, Codex, Cursor, OpenCode, or other coding agents.
84
+
85
+ Those tools do the coding work.
86
+
87
+ OpenShard sits around them as the control and audit layer.
88
+
89
+ ---
90
+
91
+ ## Current developer loop
92
+
93
+ The current local developer loop is:
94
+
95
+ ```text
96
+ Ask -> Plan -> Run -> Inspect -> Feedback
97
+ ```
98
+
99
+ **Ask**
100
+ Ask OpenShard product, model, command, and policy questions.
101
+
102
+ **Plan**
103
+ Generate a local execution plan. Plan Mode v1 is deterministic and local: it does not scan the repo, call a provider, or write files.
104
+
105
+ **Run**
106
+ Send a real repo task through OpenShard’s controlled execution path.
107
+
108
+ **Inspect**
109
+ Review the result, actions taken, evidence, checks, changed files, cost estimate, model choice, and Shard receipt.
110
+
111
+ **Feedback**
112
+ Record whether the result was accepted, partial, rejected, or needs more work.
113
+
114
+ ---
115
+
116
+ ## Quick install
117
+
118
+ **Recommended: `pipx`**
119
+
120
+ ```bash
121
+ pipx install git+https://github.com/MichaelObasa/openshard.git
122
+ ```
123
+
124
+ Run:
125
+
126
+ ```bash
127
+ openshard tui
128
+ ```
129
+
130
+ **Alternative: `uv`**
131
+
132
+ ```bash
133
+ uv tool install git+https://github.com/MichaelObasa/openshard.git
134
+ ```
135
+
136
+ **Local development:**
137
+
138
+ ```bash
139
+ git clone https://github.com/MichaelObasa/openshard.git
140
+ cd openshard
141
+ pip install -e .
142
+ ```
143
+
144
+ See [docs/install.md](docs/install.md) for upgrade instructions and notes.
145
+
146
+ ---
147
+
148
+ ## Quick demo
149
+
150
+ <p align="center">
151
+ <img src="demos/Openshard_Final_Demo_Full.gif" alt="OpenShard Demo" width="800"/>
152
+ </p>
153
+
154
+ Launch the TUI:
155
+
156
+ ```bash
157
+ openshard tui
158
+ ```
159
+
160
+ Inside the TUI:
161
+
162
+ ```text
163
+ /ask what models do you support?
164
+ /plan review this repo for production readiness
165
+ /packs
166
+ /pack production-iac-hardening
167
+ ```
168
+
169
+ Run a real repo task:
170
+
171
+ ```text
172
+ Review and harden this deliberately flawed Terraform codebase. Assess it through security/compliance posture, 2am operability, and developer experience for a 5-10 person engineering team. Identify critical, high, and medium risks. Explain trade-offs. Do not apply changes directly without review.
173
+ ```
174
+
175
+ Inspect the latest run:
176
+
177
+ ```text
178
+ /last more
179
+ ```
180
+
181
+ Or from the shell:
182
+
183
+ ```bash
184
+ openshard last --more
185
+ ```
186
+
187
+ <p align="center">
188
+ <img src="demos/openshard_last_--more.gif" alt="OpenShard Last --more" width="800"/>
189
+ </p>
190
+
191
+ Leave feedback:
192
+
193
+ ```bash
194
+ openshard feedback --outcome accepted --note "Useful review"
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Production IaC demo
200
+
201
+ The `examples/production-infra-demo/` directory contains a fictional GCP workload called **DocuVault** — a sanitised demo scenario for OpenShard.
202
+
203
+ The infrastructure is intentionally production-shaped: networking, IAM, Cloud SQL, Cloud Run, storage, secrets, monitoring, and logging.
204
+
205
+ It is deliberately flawed to serve as the input for an infrastructure-as-code hardening review.
206
+
207
+ All names, project IDs, resource IDs, CIDRs, and accounts are fake and public-safe. No employer or customer details. Designed to show a serious IaC review, not a toy example.
208
+
209
+ See:
210
+ - [`examples/production-infra-demo/README.md`](examples/production-infra-demo/README.md)
211
+ - [`examples/production-infra-demo/demo-task.md`](examples/production-infra-demo/demo-task.md)
212
+
213
+ A typical production IaC review can show:
214
+ - Critical, high, and medium findings
215
+ - File-level evidence such as `iam.tf`, `secrets.tf`, `database.tf`, `network.tf`, and `storage.tf`
216
+ - Verification output from tools like `terraform fmt`, `terraform validate`, and `tflint` when available
217
+ - A clear `Changed 0 files` receipt for read-only reviews
218
+ - Model selection and cost tracking
219
+ - A `/last more` view with the full Shard, findings, checks, evidence, and cost comparison
220
+
221
+ This is the core OpenShard use case: let AI help with serious engineering work, but keep the control, evidence, and receipt layer visible.
222
+
223
+ ---
224
+
225
+ ## Shard receipts
226
+ A Shard is the durable receipt for an AI engineering run.
227
+
228
+ It can show:
229
+ - Task and agent
230
+ - Model used
231
+ - Strategy
232
+ - Risk level
233
+ - Context provenance
234
+ - Inspected files
235
+ - Changed and touched files
236
+ - Checks and their outcomes
237
+ - Findings, when structured findings exist
238
+ - Cost
239
+ - Actions timeline
240
+ - Result
241
+
242
+ OpenShard can also record feedback and infer session signals around a run.
243
+
244
+ ```bash
245
+ openshard last --more # expanded receipt for the latest run
246
+ openshard last --full # full stored details
247
+ ```
248
+
249
+ Raw developer content is not stored by default.
250
+
251
+ ---
252
+
253
+ ## One run, end to end
254
+
255
+ A normal OpenShard run can capture:
256
+ 1. **Task** - the user request or workflow pack prompt.
257
+ 2. **Routing** - which model or workflow was selected.
258
+ 3. **Risk** - whether the task is low, medium, high, or requires stronger review.
259
+ 4. **Execution** - what the agent did during the run.
260
+ 5. **Checks** - verification results, including passed, failed, skipped, or not run.
261
+ 6. **Evidence** - files inspected, findings, and relevant source references.
262
+ 7. **Changes** - files changed, touched, or left untouched.
263
+ 8. **Cost** - estimated spend for the run.
264
+ 9. **Receipt** - a durable Shard record that can be inspected later.
265
+
266
+ The point is simple: every AI coding run should leave behind enough evidence for a developer or team to understand what happened.
267
+
268
+ ---
269
+
270
+ ## How OpenShard is different
271
+
272
+ OpenShard is not a chatbot, IDE, or even a generic agent framework.
273
+ It's the layer around agentic coding work.
274
+
275
+ | Layer | What it does |
276
+ |---|---|
277
+ | Coding agent | Generates code, edits files, answers task prompts |
278
+ | Model router | Chooses which model or workflow should handle the job |
279
+ | Verification layer | Runs checks and records whether they passed, failed, skipped, or were not run |
280
+ | Policy layer | Gates risky writes, commands, and high-risk work |
281
+ | Receipt layer | Records model, cost, evidence, checks, changed files, and result |
282
+ | Eval layer | Compares models and workflows by outcome, cost, speed, and safety |
283
+
284
+ OpenShard can work alongside tools like Claude Code, Codex, Cursor, OpenCode, LangChain, LangGraph, OpenRouter, and provider APIs.
285
+
286
+ The goal is not to replace every coding agent.
287
+ The goal is to make AI coding work controllable, inspectable, and measurable.
288
+
289
+ ---
290
+
291
+ ## Workflow packs
292
+
293
+ Workflow packs are pre-built prompts for repeatable engineering reviews.
294
+ ```bash
295
+ openshard packs list
296
+ openshard packs show production-iac-hardening
297
+ openshard packs prompt production-iac-hardening
298
+ ```
299
+
300
+ Built-in packs include:
301
+ - `repo-explanation`
302
+ - `production-iac-hardening`
303
+ - `terraform-networking-review`
304
+ - `iam-security-review`
305
+ - `cicd-safety-review`
306
+ - `powershell-automation-review`
307
+
308
+ Workflow packs make common review patterns repeatable without forcing users to rewrite long prompts every time.
309
+
310
+ ---
311
+
312
+ ## Command reference
313
+ Most developers should start with the TUI:
314
+
315
+ ```bash
316
+ openshard tui # Launch the OpenShard terminal UI
317
+ ```
318
+ Run tasks:
319
+
320
+ ```bash
321
+ openshard run "Review this repo for risks" # Run a task through OpenShard from the shell
322
+ openshard run --workflow native "Fix this bug" # Run using the native workflow path
323
+ ```
324
+ Inspect the latest run:
325
+
326
+ ```bash
327
+ openshard last # Show the latest run summary
328
+ openshard last --more # Show the expanded Shard receipt
329
+ openshard last --full # Show full stored/debug details
330
+ ```
331
+ Record feedback:
332
+
333
+ ```bash
334
+ openshard feedback --outcome accepted # Mark the latest run as accepted
335
+ openshard feedback --outcome partial # Mark the latest run as partly useful
336
+ openshard feedback --outcome rejected # Mark the latest run as not useful
337
+ openshard feedback --outcome needs_work # Mark the latest run as needing more work
338
+ ```
339
+ Infer local session signals:
340
+
341
+ ```bash
342
+ openshard session infer # Infer local behavioural/session signals from run history
343
+ ```
344
+ Workflow packs:
345
+
346
+ ```bash
347
+ openshard packs list # List available workflow packs
348
+ openshard packs show production-iac-hardening # Show details for a workflow pack
349
+ openshard packs prompt production-iac-hardening # Print the pack prompt
350
+ ```
351
+ Model registry and policy:
352
+
353
+ ```bash
354
+ openshard models list # List registered models
355
+ openshard models role reasoning # Show reasoning-capable models
356
+ openshard models role cheap_control # Show low-cost/control models
357
+ openshard models mode ask # Show Ask Mode model policy
358
+ openshard models mode plan # Show Plan Mode model policy
359
+ ```
360
+ Local evals:
361
+
362
+ ```bash
363
+ openshard eval list # List eval suites
364
+ openshard eval validate --suite basic # Validate an eval suite
365
+ openshard eval run --suite basic # Run an eval suite
366
+ openshard eval report # Show latest eval report
367
+ openshard eval compare # Compare models by eval results
368
+ openshard eval stats # Show eval stats
369
+ ```
370
+ Useful TUI commands:
371
+
372
+ ```text
373
+ /ask what models do you support? # Ask OpenShard product/model questions
374
+ /plan review this repo for production readiness # Generate a local plan without writing files
375
+ /packs # List workflow packs inside the TUI
376
+ /pack production-iac-hardening # Load a workflow pack inside the TUI
377
+ /last # Show the latest run
378
+ /last more # Show expanded run details
379
+ /last full # Show full debug/audit details
380
+ /feedback accepted # Record feedback for the latest run
381
+ /clear # Clear the output panel
382
+ /quit # Exit the TUI
383
+ ```
384
+ ---
385
+
386
+ ## What works today
387
+ OpenShard is still alpha, but the core local loop is working.
388
+
389
+ Current features include:
390
+ - Local CLI and TUI (`openshard tui`)
391
+ - Ask Mode for local product/model/command Q&A
392
+ - Plan Mode v1 for deterministic local plans
393
+ - Controlled run path for real repo tasks
394
+ - OpenShard Native execution harness
395
+ - Task classification and risk handling
396
+ - Model registry and model policy inspection
397
+ - Routing across models/workflows where available
398
+ - Shard receipts with model, risk, files, checks, cost, evidence, and result
399
+ - `/last`, `/last more`, and `/last --full`
400
+ - Read-only review handling that preserves `Changed 0 files`
401
+ - Intent-specific review handling for Terraform/IaC, CI/CD, auth/security, tests, and docs/onboarding
402
+ - Workflow packs for repeatable engineering reviews
403
+ - Feedback signals
404
+ - Session signal inference
405
+ - Local run history
406
+ - Local eval harness
407
+ - Eval comparison by pass rate and cost-per-pass
408
+ - Cost comparison in `/last more`
409
+ - Production-shaped Terraform demo
410
+ - 5,500+ passing tests and green CI
411
+
412
+ ---
413
+
414
+ ## What is not built yet
415
+ OpenShard is early and intentionally local-first.
416
+
417
+ Not built yet:
418
+ - No hosted team platform yet
419
+ - No cloud sync yet
420
+ - No hosted dashboard for teams yet
421
+ - No IDE integration yet
422
+ - No PyPI or Homebrew release yet — install from GitHub
423
+ - Plan Mode is not repo-aware yet
424
+ - Ask Mode and Plan Mode are local deterministic v1 flows
425
+ - Feedback advisory does not automatically change routing yet
426
+ - External harness adapters are experimental and not guaranteed
427
+ - Not a full Claude Code, Codex, or Cursor replacement
428
+
429
+ ---
430
+
431
+ ## Developer setup
432
+
433
+ ```bash
434
+ git clone https://github.com/MichaelObasa/openshard.git
435
+ cd openshard
436
+ pip install -e .
437
+ python -m pytest -q
438
+ python -m ruff check .
439
+ ```
440
+
441
+ ---
442
+
443
+ ## Advanced: evals
444
+
445
+ OpenShard includes a local eval harness for checking routing and workflow behaviour.
446
+
447
+ ```bash
448
+ openshard eval list
449
+ openshard eval validate --suite basic
450
+ openshard eval run --suite basic
451
+ openshard eval report
452
+ openshard eval compare
453
+ openshard eval stats
454
+ ```
455
+
456
+ The goal is not just to ask “which model is best?”
457
+
458
+ The better question is:
459
+ > Which model or workflow succeeds most reliably for this type of task, at what cost, with what safety profile?
460
+
461
+ The eval system can track:
462
+ - Pass rate
463
+ - Verification outcomes
464
+ - Duration
465
+ - Token usage where available
466
+ - Cost where available
467
+ - Cost per passing run
468
+ - Unsafe file attempts
469
+ - Model ranking across eval runs
470
+
471
+ This is the foundation for smarter routing over time: routing based on actual task outcomes.
472
+
473
+ ---
474
+
475
+ ## Current validation state
476
+ OpenShard is still early, but it is not just a prototype.
477
+
478
+ Current validation includes:
479
+
480
+ - 5,500+ passing tests
481
+ - Green CI
482
+ - Ruff-clean Python codebase
483
+ - Local CLI/TUI workflow
484
+ - Production-shaped Terraform demo
485
+ - Workflow packs for repeatable reviews
486
+ - Shard receipts for run history
487
+ - Eval tooling for model and workflow comparison
488
+ - Pre-launch usage from developers testing it on real work
489
+
490
+ The project is alpha, but the core loop is working:
491
+
492
+ ```text
493
+ Run the task -> inspect what happened -> verify the output -> create a receipt
494
+ ```
495
+
496
+ ---
497
+
498
+ ## Roadmap
499
+
500
+ Near-term roadmap:
501
+ - Public open-source launch
502
+ - More real-world developer testing
503
+ - Better repo-aware planning
504
+ - Stronger model/workflow ranking from real outcomes
505
+ - More workflow packs
506
+ - More repo analyzers for common stacks
507
+ - Cleaner setup and release packaging
508
+ - Hosted/team run history
509
+ - Team policies and shared approval gates
510
+ - Dashboards for cost, model usage, and verification outcomes
511
+
512
+ Longer-term, OpenShard should become the control plane teams use to manage AI engineering work.
513
+
514
+ ---
515
+
516
+ ## Why open source?
517
+ Routing decisions should be inspectable.
518
+
519
+ If a tool decides which model touches security-sensitive code, developers should be able to see why.
520
+
521
+ OpenShard is open because trust, integrations, and routing policies improve when real users can inspect and extend the system.
522
+
523
+ Open source also keeps the local-first layer useful on its own. Hosted and team features can come later, but the core control layer should be understandable and inspectable.
524
+
525
+ ---
526
+
527
+ ## Contributing
528
+
529
+ Contributions are welcome around:
530
+ - Routing policies and scoring logic
531
+ - Repo analyzers for new stacks
532
+ - Model profiles and capability data
533
+ - Evaluation datasets
534
+ - Provider integrations
535
+ - Workflow packs
536
+ - CLI/TUI UX improvements
537
+ - Documentation and examples
538
+
539
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
540
+
541
+ ---
542
+
543
+ ## Security
544
+ If you find a security issue, please report it privately before opening a public issue.
545
+
546
+ See [SECURITY.md](SECURITY.md).
547
+
548
+ ---
549
+
550
+ ## License
551
+
552
+ MIT
553
+ ````