sembl-stack 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 (142) hide show
  1. sembl_stack-0.1.0/.github/workflows/release.yml +67 -0
  2. sembl_stack-0.1.0/.gitignore +14 -0
  3. sembl_stack-0.1.0/LICENSE +201 -0
  4. sembl_stack-0.1.0/PKG-INFO +165 -0
  5. sembl_stack-0.1.0/README.md +135 -0
  6. sembl_stack-0.1.0/docs/LAUNCH-PREP-JULY1.md +116 -0
  7. sembl_stack-0.1.0/docs/PROCESS-ACTION-PLAN.md +369 -0
  8. sembl_stack-0.1.0/docs/SPEC-coderabbit-prep.md +454 -0
  9. sembl_stack-0.1.0/docs/SPEC-gate-0.2.0.md +90 -0
  10. sembl_stack-0.1.0/docs/SPEC-l8-rollback.md +270 -0
  11. sembl_stack-0.1.0/docs/SPEC-merge-stage.md +269 -0
  12. sembl_stack-0.1.0/docs/SPEC-reconcile-live.md +325 -0
  13. sembl_stack-0.1.0/docs/SPEC-review-standby.md +73 -0
  14. sembl_stack-0.1.0/docs/SPEC-tui-phase0.md +69 -0
  15. sembl_stack-0.1.0/docs/SPEC-tui-phase1-onboarding.md +111 -0
  16. sembl_stack-0.1.0/docs/eval-metric-O3.md +99 -0
  17. sembl_stack-0.1.0/docs/memory-plane-hypothesis.md +141 -0
  18. sembl_stack-0.1.0/docs/process-self-improvement.md +77 -0
  19. sembl_stack-0.1.0/eval/README.md +32 -0
  20. sembl_stack-0.1.0/eval/SPEC-through-deploy.md +119 -0
  21. sembl_stack-0.1.0/eval/build_corpus.py +138 -0
  22. sembl_stack-0.1.0/eval/corpus/01-greenfield-snake/case.json +29 -0
  23. sembl_stack-0.1.0/eval/corpus/02-feature-inscope/case.json +27 -0
  24. sembl_stack-0.1.0/eval/corpus/03-refactor-inscope/case.json +25 -0
  25. sembl_stack-0.1.0/eval/corpus/04-docs-tolerance/case.json +26 -0
  26. sembl_stack-0.1.0/eval/corpus/05-out-of-scope-infra/case.json +25 -0
  27. sembl_stack-0.1.0/eval/corpus/06-forbidden-workflow/case.json +26 -0
  28. sembl_stack-0.1.0/eval/corpus/07-fabricated-file/case.json +26 -0
  29. sembl_stack-0.1.0/eval/corpus/08-feature-with-stray/case.json +26 -0
  30. sembl_stack-0.1.0/eval/corpus/09-clean-diff-fabricated-report/case.json +26 -0
  31. sembl_stack-0.1.0/eval/corpus/10-rogue-combined/case.json +27 -0
  32. sembl_stack-0.1.0/eval/corpus/11-unevidenced-tests/case.json +24 -0
  33. sembl_stack-0.1.0/eval/corpus/12-over-churn/case.json +28 -0
  34. sembl_stack-0.1.0/eval/corpus/13-runtime-break-passes-gate/case.json +21 -0
  35. sembl_stack-0.1.0/eval/corpus/14-quality-defect-passes-gate/case.json +20 -0
  36. sembl_stack-0.1.0/eval/harness.py +121 -0
  37. sembl_stack-0.1.0/eval/through_deploy.py +109 -0
  38. sembl_stack-0.1.0/eval/two_axis.py +103 -0
  39. sembl_stack-0.1.0/examples/flagship-feedback-board/.env.example +6 -0
  40. sembl_stack-0.1.0/examples/flagship-feedback-board/.gitignore +12 -0
  41. sembl_stack-0.1.0/examples/flagship-feedback-board/README.md +76 -0
  42. sembl_stack-0.1.0/examples/flagship-feedback-board/bounds.json +27 -0
  43. sembl_stack-0.1.0/examples/flagship-feedback-board/next-env.d.ts +6 -0
  44. sembl_stack-0.1.0/examples/flagship-feedback-board/next.config.ts +11 -0
  45. sembl_stack-0.1.0/examples/flagship-feedback-board/package-lock.json +1106 -0
  46. sembl_stack-0.1.0/examples/flagship-feedback-board/package.json +36 -0
  47. sembl_stack-0.1.0/examples/flagship-feedback-board/postcss.config.mjs +3 -0
  48. sembl_stack-0.1.0/examples/flagship-feedback-board/scripts/check-deploy-readiness.mjs +127 -0
  49. sembl_stack-0.1.0/examples/flagship-feedback-board/scripts/postdeploy-health.mjs +92 -0
  50. sembl_stack-0.1.0/examples/flagship-feedback-board/sembl.stack.yaml +28 -0
  51. sembl_stack-0.1.0/examples/flagship-feedback-board/specs/001-feedback-board/bounds.json +27 -0
  52. sembl_stack-0.1.0/examples/flagship-feedback-board/specs/001-feedback-board/requirements.md +8 -0
  53. sembl_stack-0.1.0/examples/flagship-feedback-board/specs/001-feedback-board/tasks.md +9 -0
  54. sembl_stack-0.1.0/examples/flagship-feedback-board/src/app/actions.ts +105 -0
  55. sembl_stack-0.1.0/examples/flagship-feedback-board/src/app/api/health/route.ts +9 -0
  56. sembl_stack-0.1.0/examples/flagship-feedback-board/src/app/auth/callback/route.ts +28 -0
  57. sembl_stack-0.1.0/examples/flagship-feedback-board/src/app/globals.css +453 -0
  58. sembl_stack-0.1.0/examples/flagship-feedback-board/src/app/layout.tsx +20 -0
  59. sembl_stack-0.1.0/examples/flagship-feedback-board/src/app/page.tsx +125 -0
  60. sembl_stack-0.1.0/examples/flagship-feedback-board/src/components/auth-panel.tsx +96 -0
  61. sembl_stack-0.1.0/examples/flagship-feedback-board/src/components/feedback-board.tsx +119 -0
  62. sembl_stack-0.1.0/examples/flagship-feedback-board/src/components/feedback-form.tsx +79 -0
  63. sembl_stack-0.1.0/examples/flagship-feedback-board/src/lib/env.ts +18 -0
  64. sembl_stack-0.1.0/examples/flagship-feedback-board/src/lib/feedback.ts +57 -0
  65. sembl_stack-0.1.0/examples/flagship-feedback-board/src/lib/supabase/client.ts +20 -0
  66. sembl_stack-0.1.0/examples/flagship-feedback-board/src/lib/supabase/server.ts +31 -0
  67. sembl_stack-0.1.0/examples/flagship-feedback-board/src/middleware.ts +42 -0
  68. sembl_stack-0.1.0/examples/flagship-feedback-board/supabase/.gitignore +8 -0
  69. sembl_stack-0.1.0/examples/flagship-feedback-board/supabase/config.toml +408 -0
  70. sembl_stack-0.1.0/examples/flagship-feedback-board/supabase/migrations/202606200001_feedback_board.sql +42 -0
  71. sembl_stack-0.1.0/examples/flagship-feedback-board/supabase/migrations/20260621070532_harden_feedback_item_grants.sql +4 -0
  72. sembl_stack-0.1.0/examples/flagship-feedback-board/task.yaml +3 -0
  73. sembl_stack-0.1.0/examples/flagship-feedback-board/tsconfig.json +43 -0
  74. sembl_stack-0.1.0/examples/flagship-feedback-board/vercel.json +4 -0
  75. sembl_stack-0.1.0/examples/tasks/login-redirect/README.md +54 -0
  76. sembl_stack-0.1.0/examples/tasks/login-redirect/repo/infra/deploy.yaml +1 -0
  77. sembl_stack-0.1.0/examples/tasks/login-redirect/repo/specs/001-feature/bounds.json +5 -0
  78. sembl_stack-0.1.0/examples/tasks/login-redirect/repo/specs/001-feature/tasks.md +3 -0
  79. sembl_stack-0.1.0/examples/tasks/login-redirect/repo/src/app/__init__.py +1 -0
  80. sembl_stack-0.1.0/examples/tasks/login-redirect/task.yaml +4 -0
  81. sembl_stack-0.1.0/pyproject.toml +36 -0
  82. sembl_stack-0.1.0/sembl.stack.yaml +20 -0
  83. sembl_stack-0.1.0/sembl_stack/__init__.py +3 -0
  84. sembl_stack-0.1.0/sembl_stack/adapters/__init__.py +0 -0
  85. sembl_stack-0.1.0/sembl_stack/adapters/_redact.py +19 -0
  86. sembl_stack-0.1.0/sembl_stack/adapters/base.py +179 -0
  87. sembl_stack-0.1.0/sembl_stack/adapters/codegraph_cbm.py +95 -0
  88. sembl_stack-0.1.0/sembl_stack/adapters/deploy_vercel.py +215 -0
  89. sembl_stack-0.1.0/sembl_stack/adapters/execute_aider.py +115 -0
  90. sembl_stack-0.1.0/sembl_stack/adapters/execute_claude.py +114 -0
  91. sembl_stack-0.1.0/sembl_stack/adapters/execute_mock.py +53 -0
  92. sembl_stack-0.1.0/sembl_stack/adapters/execute_opencode.py +114 -0
  93. sembl_stack-0.1.0/sembl_stack/adapters/merge_git.py +107 -0
  94. sembl_stack-0.1.0/sembl_stack/adapters/postdeploy_http.py +82 -0
  95. sembl_stack-0.1.0/sembl_stack/adapters/review_coderabbit.py +215 -0
  96. sembl_stack-0.1.0/sembl_stack/adapters/review_llm.py +142 -0
  97. sembl_stack-0.1.0/sembl_stack/adapters/review_mock.py +42 -0
  98. sembl_stack-0.1.0/sembl_stack/adapters/sandbox_worktree.py +79 -0
  99. sembl_stack-0.1.0/sembl_stack/adapters/spec_sembl.py +91 -0
  100. sembl_stack-0.1.0/sembl_stack/adapters/verify_sembl.py +77 -0
  101. sembl_stack-0.1.0/sembl_stack/artifacts.py +207 -0
  102. sembl_stack-0.1.0/sembl_stack/cli.py +759 -0
  103. sembl_stack-0.1.0/sembl_stack/config.py +87 -0
  104. sembl_stack-0.1.0/sembl_stack/contextgraph.py +154 -0
  105. sembl_stack-0.1.0/sembl_stack/doctor.py +111 -0
  106. sembl_stack-0.1.0/sembl_stack/loop.py +380 -0
  107. sembl_stack-0.1.0/sembl_stack/onboarding.py +272 -0
  108. sembl_stack-0.1.0/sembl_stack/presets.py +114 -0
  109. sembl_stack-0.1.0/sembl_stack/profile.py +193 -0
  110. sembl_stack-0.1.0/sembl_stack/reconciliation.py +138 -0
  111. sembl_stack-0.1.0/sembl_stack/registry.py +91 -0
  112. sembl_stack-0.1.0/sembl_stack/rsi.py +188 -0
  113. sembl_stack-0.1.0/sembl_stack/runner.py +134 -0
  114. sembl_stack-0.1.0/sembl_stack/session.py +86 -0
  115. sembl_stack-0.1.0/sembl_stack/specgraph.py +146 -0
  116. sembl_stack-0.1.0/sembl_stack/store.py +112 -0
  117. sembl_stack-0.1.0/sembl_stack/tracing.py +51 -0
  118. sembl_stack-0.1.0/sembl_stack/transport/__init__.py +0 -0
  119. sembl_stack-0.1.0/sembl_stack/transport/mcp_client.py +58 -0
  120. sembl_stack-0.1.0/sembl_stack/tui.py +86 -0
  121. sembl_stack-0.1.0/sembl_stack/views.py +74 -0
  122. sembl_stack-0.1.0/sembl_stack/wizard.py +233 -0
  123. sembl_stack-0.1.0/tests/test_artifacts_store.py +71 -0
  124. sembl_stack-0.1.0/tests/test_codegraph_cbm.py +124 -0
  125. sembl_stack-0.1.0/tests/test_contextgraph.py +80 -0
  126. sembl_stack-0.1.0/tests/test_deploy_postdeploy.py +450 -0
  127. sembl_stack-0.1.0/tests/test_loop_manifest.py +105 -0
  128. sembl_stack-0.1.0/tests/test_loop_smoke.py +92 -0
  129. sembl_stack-0.1.0/tests/test_merge_git.py +136 -0
  130. sembl_stack-0.1.0/tests/test_onboarding_logic.py +51 -0
  131. sembl_stack-0.1.0/tests/test_opencode_adapter.py +102 -0
  132. sembl_stack-0.1.0/tests/test_profile.py +219 -0
  133. sembl_stack-0.1.0/tests/test_reconciliation.py +64 -0
  134. sembl_stack-0.1.0/tests/test_review.py +356 -0
  135. sembl_stack-0.1.0/tests/test_rsi.py +122 -0
  136. sembl_stack-0.1.0/tests/test_runner.py +174 -0
  137. sembl_stack-0.1.0/tests/test_scrub_secrets.py +59 -0
  138. sembl_stack-0.1.0/tests/test_session.py +80 -0
  139. sembl_stack-0.1.0/tests/test_spec_sembl.py +18 -0
  140. sembl_stack-0.1.0/tests/test_specgraph.py +38 -0
  141. sembl_stack-0.1.0/tests/test_verdict_binding.py +197 -0
  142. sembl_stack-0.1.0/uv.lock +2370 -0
@@ -0,0 +1,67 @@
1
+ name: Publish to PyPI
2
+
3
+ # Runs when you publish a GitHub Release (Releases -> Draft a new release ->
4
+ # pick a tag like vX.Y.Z -> Publish). The release tag MUST match the version in
5
+ # pyproject.toml and sembl_stack/__init__.py, or the build step fails.
6
+ #
7
+ # Publishing uses PyPI Trusted Publishing (OIDC): no API token is stored anywhere.
8
+ # Before the first release, register this repo + workflow as a trusted publisher
9
+ # for the `sembl-stack` project on PyPI (https://pypi.org/manage/account/publishing/).
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ jobs:
16
+ build:
17
+ name: Build distribution
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.12"
25
+
26
+ - name: Verify release tag and all version surfaces agree
27
+ run: |
28
+ TAG="${GITHUB_REF_NAME#v}"
29
+ VER="$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")"
30
+ INIT="$(python -c "import re;print(re.search(r'__version__\s*=\s*\"([^\"]+)\"', open('sembl_stack/__init__.py').read()).group(1))")"
31
+ echo "release tag: $TAG | pyproject: $VER | __init__: $INIT"
32
+ if [ "$TAG" != "$VER" ] || [ "$VER" != "$INIT" ]; then
33
+ echo "::error::Version mismatch (tag '$TAG', pyproject '$VER', __init__ '$INIT'). They must all match."
34
+ exit 1
35
+ fi
36
+
37
+ - name: Build sdist and wheel
38
+ run: |
39
+ python -m pip install --upgrade build
40
+ python -m build
41
+
42
+ - name: Check distribution metadata
43
+ run: |
44
+ python -m pip install --upgrade twine
45
+ python -m twine check dist/*
46
+
47
+ - name: Upload built distribution
48
+ uses: actions/upload-artifact@v4
49
+ with:
50
+ name: dist
51
+ path: dist/
52
+
53
+ publish:
54
+ name: Publish to PyPI
55
+ needs: build
56
+ runs-on: ubuntu-latest
57
+ permissions:
58
+ id-token: write # required for Trusted Publishing (OIDC); no token needed
59
+ steps:
60
+ - name: Download built distribution
61
+ uses: actions/download-artifact@v4
62
+ with:
63
+ name: dist
64
+ path: dist/
65
+
66
+ - name: Publish to PyPI
67
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,14 @@
1
+ # Example target repos are git-inited locally for demos; don't nest their .git
2
+ examples/**/repo/.git/
3
+ # Local-only tests (kept off the repo by request)
4
+ tests/local/
5
+ # Run artifacts (the run store) are local-only
6
+ .sembl/
7
+ examples/**/repo/.sembl/
8
+ __pycache__/
9
+ *.egg-info/
10
+ .pytest_cache/
11
+ .test-tmp/
12
+ build/
13
+ dist/
14
+ .venv/
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Siddharth Totla (speedvibecode)
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,165 @@
1
+ Metadata-Version: 2.4
2
+ Name: sembl-stack
3
+ Version: 0.1.0
4
+ Summary: A swappable, spec-driven software factory: task to bounds, an agent writes in a sandbox, the Sembl gate judges the diff, PASS merges, deploys, and a post-deploy gate confirms or rolls back. Every stage an adapter behind one typed contract.
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: click>=8.1
9
+ Requires-Dist: langgraph>=0.2
10
+ Requires-Dist: mcp>=1.0
11
+ Requires-Dist: pyyaml>=6.0
12
+ Requires-Dist: sembl>=0.1.20
13
+ Provides-Extra: all
14
+ Requires-Dist: langfuse>=2.0; extra == 'all'
15
+ Requires-Dist: langgraph>=0.2; extra == 'all'
16
+ Requires-Dist: mcp>=1.0; extra == 'all'
17
+ Requires-Dist: sembl>=0.1.20; extra == 'all'
18
+ Requires-Dist: textual>=0.50; extra == 'all'
19
+ Provides-Extra: gate
20
+ Requires-Dist: sembl>=0.1.20; extra == 'gate'
21
+ Provides-Extra: mcp
22
+ Requires-Dist: mcp>=1.0; extra == 'mcp'
23
+ Provides-Extra: orchestrate
24
+ Requires-Dist: langgraph>=0.2; extra == 'orchestrate'
25
+ Provides-Extra: trace
26
+ Requires-Dist: langfuse>=2.0; extra == 'trace'
27
+ Provides-Extra: tui
28
+ Requires-Dist: textual>=0.50; extra == 'tui'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # sembl-stack
32
+
33
+ [![License: Apache 2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
34
+ [![Built around Sembl](https://img.shields.io/badge/gate-Sembl-ccff00.svg)](https://github.com/speedvibecode/sembl)
35
+
36
+ **A swappable, spec-driven software factory.** A task becomes declared bounds, an
37
+ agent writes the change inside a disposable sandbox, the **[Sembl](https://github.com/speedvibecode/sembl)
38
+ gate** judges the real diff against those bounds, a PASS merges and deploys, and a
39
+ post-deploy gate confirms it's healthy — or rolls it back. **Every stage is an
40
+ interchangeable adapter behind one typed artifact contract, and every run is
41
+ recorded.**
42
+
43
+ We sell **process correctness** — the change did what the spec declared, stayed in
44
+ bounds, is honestly evidenced, and reached production accountably — **never "the
45
+ model writes better code."** The stack takes no side in the agent wars: swap the
46
+ executor, the sandbox, or the deploy target with one line of config and the rest of
47
+ the pipeline doesn't notice.
48
+
49
+ [Website](https://sembl-stack.vercel.app) · [The gate (Sembl)](https://sembl.vercel.app) · [Architecture & plan](docs/PROCESS-ACTION-PLAN.md)
50
+
51
+ ```text
52
+ task ─▶ bounds ─▶ execute ─▶ sandbox ─▶ SEMBL GATE ─▶ merge ─▶ deploy ─▶ verify-in-prod
53
+ (L2) (L3) (L4) (L5) (L6.5) (L7) (L8)
54
+ every arrow is a typed artifact on disk
55
+ ```
56
+
57
+ ## Quickstart
58
+
59
+ ```bash
60
+ pip install sembl-stack sembl # the stack + the gate it runs at its core
61
+ sembl-stack init # scaffold sembl.stack.yaml + task.yaml from a preset
62
+ sembl-stack doctor # config-aware preflight
63
+ sembl-stack loop task.yaml # plan → execute → gate → retry-on-BLOCK
64
+ sembl-stack runs [<id>] # list / inspect runs
65
+ sembl-stack apply <id> # apply the accepted patch (a BLOCK is never applied)
66
+ ```
67
+
68
+ **Presets** (`sembl-stack init --preset …`):
69
+
70
+ | Preset | What runs | Needs |
71
+ |--------|-----------|-------|
72
+ | `just-gate` | gate any diff, nothing else | only `sembl` |
73
+ | `gate+sandbox` | the whole loop with a mock executor | no API keys |
74
+ | `full-loop` | real agent + sandbox + gate | an executor key |
75
+
76
+ Swap any layer in `sembl.stack.yaml` — e.g. `execute: opencode`, `execute: aider` —
77
+ with no code change.
78
+
79
+ ## The stage map (L0–L8)
80
+
81
+ Each stage consumes and produces typed artifacts; that hand-off *is* the whole
82
+ interface, which is what makes every stage swappable.
83
+
84
+ | Stage | Does | Artifact flow | Who owns it |
85
+ |-------|------|---------------|-------------|
86
+ | **L0** Protocol & hub | one wire between stages | — | **we own** (the contract) |
87
+ | **L1** Repo intel | code-graph context | `Task → Context` | adapter |
88
+ | **L2** Spec → bounds | scope the change | `Task → Bounds` | **we own** (`sembl`) |
89
+ | **L3** Execute | write the change | `Task + Bounds → Change` | adapter (claude / aider / opencode) |
90
+ | **L4** Sandbox | contain a bad diff | `Change → Change` | adapter (disposable clone) |
91
+ | **L5** Verify | gate the diff | `Change + Bounds → Verdict` | **the gate** (`sembl`) |
92
+ | **L5.5** Review (advisory) | code-quality signal | `diff → findings` | adapter (`llm` — BYO agent-CLI reviewer; CodeRabbit optional) |
93
+ | **L6** Orchestrate | loop, retry, trace | wiring + `* → Trace` | **we own** (LangGraph) |
94
+ | **L6.5** Merge | gated merge | `Verdict(PASS) → MergeRecord` | **we own** |
95
+ | **L7** Deploy | ship | `Verdict(PASS) → Delivery` | adapter |
96
+ | **L8** Verify-in-prod | gate production | `Delivery → Verdict` | **the gate** (health + rollback) |
97
+
98
+ We own exactly three things: the **artifact contract + stage Protocol**, the **gate
99
+ (L5 + the post-deploy L8)**, and the **glue + layer-replacement protocol**.
100
+ Everything else is deliberately a best-in-class tool behind an interface.
101
+
102
+ ## The accountable spine
103
+
104
+ A verdict is bound to the change it judged — most agent pipelines stop at "the check
105
+ passed"; this one guarantees a verdict can only ship the exact change it was issued
106
+ for:
107
+
108
+ - **Verdicts carry their subject.** Every verdict is stamped with the SHA-256 and
109
+ file set of the diff it judged. `apply` recomputes the patch hash and refuses a
110
+ verdict issued for a different patch; `merge` refuses if the merge would ship files
111
+ the verdict never saw.
112
+ - **BLOCK means blocked.** A BLOCK verdict is never applied and never merged — the
113
+ loop retries the executor instead. Overrides (`--skip-binding-check`) exist but are
114
+ recorded permanently in the `MergeRecord`.
115
+ - **Production is gated too.** After deploy, the L8 gate checks the live delivery
116
+ (health + payload, deterministically) and triggers a rollback when it fails.
117
+
118
+ Every run leaves a complete paper trail in `.sembl/runs/<id>/`:
119
+
120
+ ```text
121
+ .sembl/runs/2ca41f/
122
+ ├─ task.json # what was asked
123
+ ├─ bounds.json # the declared contract
124
+ ├─ change.json # the actual diff
125
+ ├─ verdict.json # the gate's judgement + subject binding
126
+ ├─ merge-record.json # what shipped, and under whose PASS
127
+ └─ trace.json # the timeline
128
+ ```
129
+
130
+ ## The guided TUI (optional)
131
+
132
+ `pip install "sembl-stack[tui]"` adds a Textual wizard. Run bare `sembl-stack` and
133
+ press `r`: the stage rail runs the real loop under your configured profile,
134
+ streaming per-stage status (pending/running/pass/fail) live and showing the final
135
+ verdict — byte-identical to a headless `sembl-stack loop`, because it drives the
136
+ same adapters.
137
+
138
+ ## The full picture
139
+
140
+ **→ [`docs/PROCESS-ACTION-PLAN.md`](docs/PROCESS-ACTION-PLAN.md)** is the single
141
+ source of truth: architecture, the L0–L8 stage map with build status, the eval
142
+ metric, locked decisions, the guided-TUI vision, and the remaining-work plan.
143
+
144
+ Reference: [`process-self-improvement.md`](docs/process-self-improvement.md)
145
+ (north-star theory) · [`eval-metric-O3.md`](docs/eval-metric-O3.md) (the metric) ·
146
+ [`memory-plane-hypothesis.md`](docs/memory-plane-hypothesis.md).
147
+
148
+ ## Local development
149
+
150
+ ```bash
151
+ uv sync --extra all
152
+ uv pip install -e ../sembl # or: pip install sembl
153
+ .venv/Scripts/python -m pytest -q # run from the repo root (corpus paths are cwd-relative)
154
+ ```
155
+
156
+ ## Releasing
157
+
158
+ Publishing uses GitHub Actions + PyPI Trusted Publishing (OIDC); no tokens are
159
+ stored. `.github/workflows/release.yml` builds and publishes when you publish a
160
+ GitHub Release whose tag (`vX.Y.Z`) matches `pyproject.toml` and
161
+ `sembl_stack/__init__.py`.
162
+
163
+ ---
164
+
165
+ Agents write the code. **sembl-stack makes the whole pipeline accountable.**
@@ -0,0 +1,135 @@
1
+ # sembl-stack
2
+
3
+ [![License: Apache 2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
4
+ [![Built around Sembl](https://img.shields.io/badge/gate-Sembl-ccff00.svg)](https://github.com/speedvibecode/sembl)
5
+
6
+ **A swappable, spec-driven software factory.** A task becomes declared bounds, an
7
+ agent writes the change inside a disposable sandbox, the **[Sembl](https://github.com/speedvibecode/sembl)
8
+ gate** judges the real diff against those bounds, a PASS merges and deploys, and a
9
+ post-deploy gate confirms it's healthy — or rolls it back. **Every stage is an
10
+ interchangeable adapter behind one typed artifact contract, and every run is
11
+ recorded.**
12
+
13
+ We sell **process correctness** — the change did what the spec declared, stayed in
14
+ bounds, is honestly evidenced, and reached production accountably — **never "the
15
+ model writes better code."** The stack takes no side in the agent wars: swap the
16
+ executor, the sandbox, or the deploy target with one line of config and the rest of
17
+ the pipeline doesn't notice.
18
+
19
+ [Website](https://sembl-stack.vercel.app) · [The gate (Sembl)](https://sembl.vercel.app) · [Architecture & plan](docs/PROCESS-ACTION-PLAN.md)
20
+
21
+ ```text
22
+ task ─▶ bounds ─▶ execute ─▶ sandbox ─▶ SEMBL GATE ─▶ merge ─▶ deploy ─▶ verify-in-prod
23
+ (L2) (L3) (L4) (L5) (L6.5) (L7) (L8)
24
+ every arrow is a typed artifact on disk
25
+ ```
26
+
27
+ ## Quickstart
28
+
29
+ ```bash
30
+ pip install sembl-stack sembl # the stack + the gate it runs at its core
31
+ sembl-stack init # scaffold sembl.stack.yaml + task.yaml from a preset
32
+ sembl-stack doctor # config-aware preflight
33
+ sembl-stack loop task.yaml # plan → execute → gate → retry-on-BLOCK
34
+ sembl-stack runs [<id>] # list / inspect runs
35
+ sembl-stack apply <id> # apply the accepted patch (a BLOCK is never applied)
36
+ ```
37
+
38
+ **Presets** (`sembl-stack init --preset …`):
39
+
40
+ | Preset | What runs | Needs |
41
+ |--------|-----------|-------|
42
+ | `just-gate` | gate any diff, nothing else | only `sembl` |
43
+ | `gate+sandbox` | the whole loop with a mock executor | no API keys |
44
+ | `full-loop` | real agent + sandbox + gate | an executor key |
45
+
46
+ Swap any layer in `sembl.stack.yaml` — e.g. `execute: opencode`, `execute: aider` —
47
+ with no code change.
48
+
49
+ ## The stage map (L0–L8)
50
+
51
+ Each stage consumes and produces typed artifacts; that hand-off *is* the whole
52
+ interface, which is what makes every stage swappable.
53
+
54
+ | Stage | Does | Artifact flow | Who owns it |
55
+ |-------|------|---------------|-------------|
56
+ | **L0** Protocol & hub | one wire between stages | — | **we own** (the contract) |
57
+ | **L1** Repo intel | code-graph context | `Task → Context` | adapter |
58
+ | **L2** Spec → bounds | scope the change | `Task → Bounds` | **we own** (`sembl`) |
59
+ | **L3** Execute | write the change | `Task + Bounds → Change` | adapter (claude / aider / opencode) |
60
+ | **L4** Sandbox | contain a bad diff | `Change → Change` | adapter (disposable clone) |
61
+ | **L5** Verify | gate the diff | `Change + Bounds → Verdict` | **the gate** (`sembl`) |
62
+ | **L5.5** Review (advisory) | code-quality signal | `diff → findings` | adapter (`llm` — BYO agent-CLI reviewer; CodeRabbit optional) |
63
+ | **L6** Orchestrate | loop, retry, trace | wiring + `* → Trace` | **we own** (LangGraph) |
64
+ | **L6.5** Merge | gated merge | `Verdict(PASS) → MergeRecord` | **we own** |
65
+ | **L7** Deploy | ship | `Verdict(PASS) → Delivery` | adapter |
66
+ | **L8** Verify-in-prod | gate production | `Delivery → Verdict` | **the gate** (health + rollback) |
67
+
68
+ We own exactly three things: the **artifact contract + stage Protocol**, the **gate
69
+ (L5 + the post-deploy L8)**, and the **glue + layer-replacement protocol**.
70
+ Everything else is deliberately a best-in-class tool behind an interface.
71
+
72
+ ## The accountable spine
73
+
74
+ A verdict is bound to the change it judged — most agent pipelines stop at "the check
75
+ passed"; this one guarantees a verdict can only ship the exact change it was issued
76
+ for:
77
+
78
+ - **Verdicts carry their subject.** Every verdict is stamped with the SHA-256 and
79
+ file set of the diff it judged. `apply` recomputes the patch hash and refuses a
80
+ verdict issued for a different patch; `merge` refuses if the merge would ship files
81
+ the verdict never saw.
82
+ - **BLOCK means blocked.** A BLOCK verdict is never applied and never merged — the
83
+ loop retries the executor instead. Overrides (`--skip-binding-check`) exist but are
84
+ recorded permanently in the `MergeRecord`.
85
+ - **Production is gated too.** After deploy, the L8 gate checks the live delivery
86
+ (health + payload, deterministically) and triggers a rollback when it fails.
87
+
88
+ Every run leaves a complete paper trail in `.sembl/runs/<id>/`:
89
+
90
+ ```text
91
+ .sembl/runs/2ca41f/
92
+ ├─ task.json # what was asked
93
+ ├─ bounds.json # the declared contract
94
+ ├─ change.json # the actual diff
95
+ ├─ verdict.json # the gate's judgement + subject binding
96
+ ├─ merge-record.json # what shipped, and under whose PASS
97
+ └─ trace.json # the timeline
98
+ ```
99
+
100
+ ## The guided TUI (optional)
101
+
102
+ `pip install "sembl-stack[tui]"` adds a Textual wizard. Run bare `sembl-stack` and
103
+ press `r`: the stage rail runs the real loop under your configured profile,
104
+ streaming per-stage status (pending/running/pass/fail) live and showing the final
105
+ verdict — byte-identical to a headless `sembl-stack loop`, because it drives the
106
+ same adapters.
107
+
108
+ ## The full picture
109
+
110
+ **→ [`docs/PROCESS-ACTION-PLAN.md`](docs/PROCESS-ACTION-PLAN.md)** is the single
111
+ source of truth: architecture, the L0–L8 stage map with build status, the eval
112
+ metric, locked decisions, the guided-TUI vision, and the remaining-work plan.
113
+
114
+ Reference: [`process-self-improvement.md`](docs/process-self-improvement.md)
115
+ (north-star theory) · [`eval-metric-O3.md`](docs/eval-metric-O3.md) (the metric) ·
116
+ [`memory-plane-hypothesis.md`](docs/memory-plane-hypothesis.md).
117
+
118
+ ## Local development
119
+
120
+ ```bash
121
+ uv sync --extra all
122
+ uv pip install -e ../sembl # or: pip install sembl
123
+ .venv/Scripts/python -m pytest -q # run from the repo root (corpus paths are cwd-relative)
124
+ ```
125
+
126
+ ## Releasing
127
+
128
+ Publishing uses GitHub Actions + PyPI Trusted Publishing (OIDC); no tokens are
129
+ stored. `.github/workflows/release.yml` builds and publishes when you publish a
130
+ GitHub Release whose tag (`vX.Y.Z`) matches `pyproject.toml` and
131
+ `sembl_stack/__init__.py`.
132
+
133
+ ---
134
+
135
+ Agents write the code. **sembl-stack makes the whole pipeline accountable.**