hyperloop 0.7.0__tar.gz → 0.8.1__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.
- {hyperloop-0.7.0 → hyperloop-0.8.1}/.gitignore +1 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/CHANGELOG.md +16 -0
- hyperloop-0.8.1/LICENSE +202 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/PKG-INFO +68 -2
- {hyperloop-0.7.0 → hyperloop-0.8.1}/README.md +66 -1
- {hyperloop-0.7.0 → hyperloop-0.8.1}/pyproject.toml +2 -1
- hyperloop-0.8.1/src/hyperloop/adapters/matrix_setup.py +335 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/cli.py +9 -9
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/config.py +9 -3
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/fakes/probe.py +1 -1
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_compose.py +1 -1
- {hyperloop-0.7.0 → hyperloop-0.8.1}/uv.lock +1 -1
- {hyperloop-0.7.0 → hyperloop-0.8.1}/.github/workflows/ci.yaml +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/.github/workflows/release.yaml +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/.pre-commit-config.yaml +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/.python-version +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/CLAUDE.md +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/base/implementer.yaml +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/base/kustomization.yaml +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/base/pm.yaml +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/base/process-improver.yaml +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/base/process.yaml +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/base/rebase-resolver.yaml +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/base/verifier.yaml +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/specs/observability.md +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/specs/prompts/checklist.md +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/specs/prompts/checks/check_result_file.sh +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/specs/prompts/rules.md +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/specs/spec.md +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/specs/tasks/task-001.md +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/specs/tasks/task-002.md +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/specs/tasks/task-003.md +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/specs/tasks/task-004.md +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/specs/tasks/task-005.md +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/specs/tasks/task-006.md +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/__init__.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/__main__.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/adapters/__init__.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/adapters/git_state.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/adapters/local.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/adapters/matrix_probe.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/adapters/probe.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/adapters/serial.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/adapters/structlog_probe.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/compose.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/domain/__init__.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/domain/decide.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/domain/deps.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/domain/model.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/domain/pipeline.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/logging.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/loop.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/ports/__init__.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/ports/pr.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/ports/probe.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/ports/runtime.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/ports/serial.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/ports/state.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/src/hyperloop/pr.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/__init__.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/fakes/__init__.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/fakes/pr.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/fakes/runtime.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/fakes/serial.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/fakes/state.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_cli.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_config.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_decide.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_deps.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_e2e.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_fakes.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_git_state.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_local_runtime.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_loop.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_matrix_probe.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_model.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_pipeline.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_pr.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_probe.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_serial_agents.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_smoke.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_state_contract.py +0 -0
- {hyperloop-0.7.0 → hyperloop-0.8.1}/tests/test_structlog_probe.py +0 -0
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- version list -->
|
|
4
4
|
|
|
5
|
+
## v0.8.1 (2026-04-15)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **matrix**: Auto-create room independently of registration
|
|
10
|
+
([`cb4c0a6`](https://github.com/jsell-rh/hyperloop/commit/cb4c0a665a018a6739ff0fb70e333e7f69202e54))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## v0.8.0 (2026-04-15)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
- **matrix**: Auto-register bot and create room
|
|
18
|
+
([`fc0d2dd`](https://github.com/jsell-rh/hyperloop/commit/fc0d2dd77cfc11f392af635ec516b3f131bc5a81))
|
|
19
|
+
|
|
20
|
+
|
|
5
21
|
## v0.7.0 (2026-04-15)
|
|
6
22
|
|
|
7
23
|
### Features
|
hyperloop-0.8.1/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyperloop
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: Orchestrator that walks tasks through composable process pipelines using AI agents
|
|
5
|
+
License-File: LICENSE
|
|
5
6
|
Requires-Python: >=3.12
|
|
6
7
|
Requires-Dist: httpx>=0.27
|
|
7
8
|
Requires-Dist: pyyaml>=6.0.3
|
|
@@ -244,13 +245,78 @@ merge:
|
|
|
244
245
|
poll_interval: 30 # seconds between orchestrator cycles
|
|
245
246
|
max_rounds: 50 # max retry rounds per task before failure
|
|
246
247
|
max_rebase_attempts: 3 # max rebase retries before full loop retry
|
|
248
|
+
|
|
249
|
+
observability:
|
|
250
|
+
log_format: console # console (human-readable) | json (for log aggregators)
|
|
251
|
+
log_level: info # debug | info | warning | error
|
|
252
|
+
|
|
253
|
+
matrix: # optional — omit entire section to disable
|
|
254
|
+
homeserver: https://matrix.example.com
|
|
255
|
+
registration_token_env: MATRIX_REGISTRATION_TOKEN # env var — auto-registers bot + creates room
|
|
256
|
+
# bot_username: hyperloop-bot # override default (hyperloop-{repo_name})
|
|
257
|
+
# room_id: "!abc123:example.com" # override auto-created room
|
|
258
|
+
# token_env: MATRIX_ACCESS_TOKEN # override auto-registered token
|
|
259
|
+
verbose: false # true: send worker_spawned, cycle_completed, etc.
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
## Observability
|
|
263
|
+
|
|
264
|
+
Hyperloop uses structured logging via [structlog](https://www.structlog.org/). Every interesting moment in the orchestrator lifecycle emits a typed probe call that gets rendered as a structured log entry.
|
|
265
|
+
|
|
266
|
+
### Log output
|
|
267
|
+
|
|
268
|
+
Console mode (default):
|
|
269
|
+
```
|
|
270
|
+
2026-04-15T14:23:01Z [info ] worker_reaped cycle=7 duration_s=142.3 role=verifier spec_ref=specs/persistence.md task_id=task-003 verdict=pass
|
|
271
|
+
2026-04-15T14:23:01Z [warning ] task_looped_back cycle=7 findings_count=3 round=2 spec_ref=specs/widget.md task_id=task-001
|
|
247
272
|
```
|
|
248
273
|
|
|
274
|
+
JSON mode (`log_format: json`):
|
|
275
|
+
```json
|
|
276
|
+
{"timestamp": "2026-04-15T14:23:01Z", "level": "info", "event": "worker_reaped", "task_id": "task-003", "role": "verifier", "verdict": "pass", "cycle": 7, "duration_s": 142.3}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Matrix notifications
|
|
280
|
+
|
|
281
|
+
Send real-time status updates to a [Matrix](https://matrix.org/) room. Each task's messages are threaded together.
|
|
282
|
+
|
|
283
|
+
**Quickstart (auto-setup):** Just provide a homeserver and a registration token. Hyperloop registers a bot user and creates a room automatically:
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
export MATRIX_REGISTRATION_TOKEN=your_synapse_registration_token
|
|
287
|
+
```
|
|
288
|
+
```yaml
|
|
289
|
+
# .hyperloop.yaml
|
|
290
|
+
observability:
|
|
291
|
+
matrix:
|
|
292
|
+
homeserver: https://matrix.example.com
|
|
293
|
+
registration_token_env: MATRIX_REGISTRATION_TOKEN
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
Credentials and room ID are cached in `.hyperloop/matrix-state.json` (gitignored) so registration only happens once.
|
|
297
|
+
|
|
298
|
+
**Manual setup:** If you already have a bot account and room, provide them directly:
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
export MATRIX_ACCESS_TOKEN=syt_your_token_here
|
|
302
|
+
```
|
|
303
|
+
```yaml
|
|
304
|
+
observability:
|
|
305
|
+
matrix:
|
|
306
|
+
homeserver: https://matrix.example.com
|
|
307
|
+
room_id: "!abc123:example.com"
|
|
308
|
+
token_env: MATRIX_ACCESS_TOKEN
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
High-signal events are always sent (worker results, task completions/failures, merge outcomes, orchestrator halt). Set `verbose: true` to also see worker spawns, cycle completions, and intake runs. Noisy events (cycle starts, gate polls, phase transitions) are never sent to Matrix.
|
|
312
|
+
|
|
313
|
+
Matrix failures are logged and swallowed — a Matrix outage never stalls the orchestrator.
|
|
314
|
+
|
|
249
315
|
## Development
|
|
250
316
|
|
|
251
317
|
```bash
|
|
252
318
|
uv sync --all-extras
|
|
253
|
-
uv run pytest # run tests (
|
|
319
|
+
uv run pytest # run tests (~390 tests)
|
|
254
320
|
uv run ruff check . # lint
|
|
255
321
|
uv run ruff format --check . # format check
|
|
256
322
|
uv run pyright # type check
|
|
@@ -227,13 +227,78 @@ merge:
|
|
|
227
227
|
poll_interval: 30 # seconds between orchestrator cycles
|
|
228
228
|
max_rounds: 50 # max retry rounds per task before failure
|
|
229
229
|
max_rebase_attempts: 3 # max rebase retries before full loop retry
|
|
230
|
+
|
|
231
|
+
observability:
|
|
232
|
+
log_format: console # console (human-readable) | json (for log aggregators)
|
|
233
|
+
log_level: info # debug | info | warning | error
|
|
234
|
+
|
|
235
|
+
matrix: # optional — omit entire section to disable
|
|
236
|
+
homeserver: https://matrix.example.com
|
|
237
|
+
registration_token_env: MATRIX_REGISTRATION_TOKEN # env var — auto-registers bot + creates room
|
|
238
|
+
# bot_username: hyperloop-bot # override default (hyperloop-{repo_name})
|
|
239
|
+
# room_id: "!abc123:example.com" # override auto-created room
|
|
240
|
+
# token_env: MATRIX_ACCESS_TOKEN # override auto-registered token
|
|
241
|
+
verbose: false # true: send worker_spawned, cycle_completed, etc.
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Observability
|
|
245
|
+
|
|
246
|
+
Hyperloop uses structured logging via [structlog](https://www.structlog.org/). Every interesting moment in the orchestrator lifecycle emits a typed probe call that gets rendered as a structured log entry.
|
|
247
|
+
|
|
248
|
+
### Log output
|
|
249
|
+
|
|
250
|
+
Console mode (default):
|
|
251
|
+
```
|
|
252
|
+
2026-04-15T14:23:01Z [info ] worker_reaped cycle=7 duration_s=142.3 role=verifier spec_ref=specs/persistence.md task_id=task-003 verdict=pass
|
|
253
|
+
2026-04-15T14:23:01Z [warning ] task_looped_back cycle=7 findings_count=3 round=2 spec_ref=specs/widget.md task_id=task-001
|
|
230
254
|
```
|
|
231
255
|
|
|
256
|
+
JSON mode (`log_format: json`):
|
|
257
|
+
```json
|
|
258
|
+
{"timestamp": "2026-04-15T14:23:01Z", "level": "info", "event": "worker_reaped", "task_id": "task-003", "role": "verifier", "verdict": "pass", "cycle": 7, "duration_s": 142.3}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Matrix notifications
|
|
262
|
+
|
|
263
|
+
Send real-time status updates to a [Matrix](https://matrix.org/) room. Each task's messages are threaded together.
|
|
264
|
+
|
|
265
|
+
**Quickstart (auto-setup):** Just provide a homeserver and a registration token. Hyperloop registers a bot user and creates a room automatically:
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
export MATRIX_REGISTRATION_TOKEN=your_synapse_registration_token
|
|
269
|
+
```
|
|
270
|
+
```yaml
|
|
271
|
+
# .hyperloop.yaml
|
|
272
|
+
observability:
|
|
273
|
+
matrix:
|
|
274
|
+
homeserver: https://matrix.example.com
|
|
275
|
+
registration_token_env: MATRIX_REGISTRATION_TOKEN
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Credentials and room ID are cached in `.hyperloop/matrix-state.json` (gitignored) so registration only happens once.
|
|
279
|
+
|
|
280
|
+
**Manual setup:** If you already have a bot account and room, provide them directly:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
export MATRIX_ACCESS_TOKEN=syt_your_token_here
|
|
284
|
+
```
|
|
285
|
+
```yaml
|
|
286
|
+
observability:
|
|
287
|
+
matrix:
|
|
288
|
+
homeserver: https://matrix.example.com
|
|
289
|
+
room_id: "!abc123:example.com"
|
|
290
|
+
token_env: MATRIX_ACCESS_TOKEN
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
High-signal events are always sent (worker results, task completions/failures, merge outcomes, orchestrator halt). Set `verbose: true` to also see worker spawns, cycle completions, and intake runs. Noisy events (cycle starts, gate polls, phase transitions) are never sent to Matrix.
|
|
294
|
+
|
|
295
|
+
Matrix failures are logged and swallowed — a Matrix outage never stalls the orchestrator.
|
|
296
|
+
|
|
232
297
|
## Development
|
|
233
298
|
|
|
234
299
|
```bash
|
|
235
300
|
uv sync --all-extras
|
|
236
|
-
uv run pytest # run tests (
|
|
301
|
+
uv run pytest # run tests (~390 tests)
|
|
237
302
|
uv run ruff check . # lint
|
|
238
303
|
uv run ruff format --check . # format check
|
|
239
304
|
uv run pyright # type check
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "hyperloop"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.8.1"
|
|
4
4
|
description = "Orchestrator that walks tasks through composable process pipelines using AI agents"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
@@ -57,6 +57,7 @@ ignore = []
|
|
|
57
57
|
pythonVersion = "3.12"
|
|
58
58
|
typeCheckingMode = "strict"
|
|
59
59
|
reportMissingTypeStubs = false
|
|
60
|
+
reportPrivateUsage = false
|
|
60
61
|
|
|
61
62
|
[tool.pytest.ini_options]
|
|
62
63
|
testpaths = ["tests"]
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
"""Matrix auto-setup — bot registration, room creation, credential caching.
|
|
2
|
+
|
|
3
|
+
On first run: registers a bot user via the Matrix registration API, creates
|
|
4
|
+
a notification room, and caches credentials in ``.hyperloop/matrix-state.json``.
|
|
5
|
+
On subsequent runs: loads from cache and skips registration/room-creation.
|
|
6
|
+
|
|
7
|
+
Explicit ``token_env`` and ``room_id`` in config always take precedence over
|
|
8
|
+
auto-setup and cache.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import json
|
|
14
|
+
import logging
|
|
15
|
+
import secrets
|
|
16
|
+
from typing import TYPE_CHECKING, cast
|
|
17
|
+
|
|
18
|
+
import httpx
|
|
19
|
+
|
|
20
|
+
if TYPE_CHECKING:
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
from hyperloop.config import MatrixConfig
|
|
24
|
+
|
|
25
|
+
_log = logging.getLogger(__name__)
|
|
26
|
+
|
|
27
|
+
_CACHE_FILE = ".hyperloop/matrix-state.json"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# ---------------------------------------------------------------------------
|
|
31
|
+
# Cache
|
|
32
|
+
# ---------------------------------------------------------------------------
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def _load_cache(repo_path: Path, homeserver: str) -> dict[str, str] | None:
|
|
36
|
+
"""Load cached Matrix credentials if they match the current homeserver."""
|
|
37
|
+
cache_path = repo_path / _CACHE_FILE
|
|
38
|
+
if not cache_path.is_file():
|
|
39
|
+
return None
|
|
40
|
+
try:
|
|
41
|
+
raw: object = json.loads(cache_path.read_text())
|
|
42
|
+
if not isinstance(raw, dict):
|
|
43
|
+
return None
|
|
44
|
+
data: dict[str, object] = cast("dict[str, object]", raw)
|
|
45
|
+
if data.get("homeserver") != homeserver:
|
|
46
|
+
return None
|
|
47
|
+
return {k: str(v) for k, v in data.items()}
|
|
48
|
+
except (json.JSONDecodeError, OSError):
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _ensure_gitignored(repo_path: Path) -> None:
|
|
53
|
+
"""Ensure .hyperloop/ is in the target repo's .gitignore."""
|
|
54
|
+
gitignore = repo_path / ".gitignore"
|
|
55
|
+
entry = ".hyperloop/"
|
|
56
|
+
if gitignore.is_file():
|
|
57
|
+
content = gitignore.read_text()
|
|
58
|
+
if entry in content.splitlines():
|
|
59
|
+
return
|
|
60
|
+
if not content.endswith("\n"):
|
|
61
|
+
content += "\n"
|
|
62
|
+
gitignore.write_text(content + entry + "\n")
|
|
63
|
+
else:
|
|
64
|
+
gitignore.write_text(entry + "\n")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _save_cache(
|
|
68
|
+
repo_path: Path,
|
|
69
|
+
*,
|
|
70
|
+
homeserver: str,
|
|
71
|
+
user_id: str,
|
|
72
|
+
access_token: str,
|
|
73
|
+
room_id: str,
|
|
74
|
+
password: str,
|
|
75
|
+
) -> None:
|
|
76
|
+
"""Persist Matrix credentials to the cache file."""
|
|
77
|
+
_ensure_gitignored(repo_path)
|
|
78
|
+
cache_path = repo_path / _CACHE_FILE
|
|
79
|
+
cache_path.parent.mkdir(parents=True, exist_ok=True)
|
|
80
|
+
cache_path.write_text(
|
|
81
|
+
json.dumps(
|
|
82
|
+
{
|
|
83
|
+
"homeserver": homeserver,
|
|
84
|
+
"user_id": user_id,
|
|
85
|
+
"access_token": access_token,
|
|
86
|
+
"room_id": room_id,
|
|
87
|
+
"password": password,
|
|
88
|
+
},
|
|
89
|
+
indent=2,
|
|
90
|
+
)
|
|
91
|
+
+ "\n"
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
# ---------------------------------------------------------------------------
|
|
96
|
+
# Matrix API calls
|
|
97
|
+
# ---------------------------------------------------------------------------
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _register_bot(
|
|
101
|
+
client: httpx.Client,
|
|
102
|
+
homeserver: str,
|
|
103
|
+
registration_token: str,
|
|
104
|
+
username: str,
|
|
105
|
+
password: str,
|
|
106
|
+
) -> tuple[str, str]:
|
|
107
|
+
"""Register a bot user. Returns (user_id, access_token).
|
|
108
|
+
|
|
109
|
+
Uses Synapse's shared-secret registration flow. If the user already
|
|
110
|
+
exists (HTTP 400), falls back to login with the given password.
|
|
111
|
+
"""
|
|
112
|
+
url = f"{homeserver}/_matrix/client/v3/register"
|
|
113
|
+
body = {
|
|
114
|
+
"username": username,
|
|
115
|
+
"password": password,
|
|
116
|
+
"auth": {
|
|
117
|
+
"type": "m.login.registration_token",
|
|
118
|
+
"token": registration_token,
|
|
119
|
+
},
|
|
120
|
+
"initial_device_display_name": "hyperloop",
|
|
121
|
+
"inhibit_login": False,
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
resp = client.post(url, json=body)
|
|
125
|
+
|
|
126
|
+
if resp.status_code == 200:
|
|
127
|
+
data = resp.json()
|
|
128
|
+
return str(data["user_id"]), str(data["access_token"])
|
|
129
|
+
|
|
130
|
+
if resp.status_code == 401:
|
|
131
|
+
# Server requires a different auth flow — try the flows it offers
|
|
132
|
+
data = resp.json()
|
|
133
|
+
flows = data.get("flows", [])
|
|
134
|
+
session = data.get("session", "")
|
|
135
|
+
|
|
136
|
+
# Check if m.login.registration_token is among the available flows
|
|
137
|
+
for flow in flows:
|
|
138
|
+
stages = flow.get("stages", [])
|
|
139
|
+
if "m.login.registration_token" in stages:
|
|
140
|
+
body["auth"] = {
|
|
141
|
+
"type": "m.login.registration_token",
|
|
142
|
+
"token": registration_token,
|
|
143
|
+
"session": session,
|
|
144
|
+
}
|
|
145
|
+
resp = client.post(url, json=body)
|
|
146
|
+
if resp.status_code == 200:
|
|
147
|
+
data = resp.json()
|
|
148
|
+
return str(data["user_id"]), str(data["access_token"])
|
|
149
|
+
|
|
150
|
+
if resp.status_code == 400:
|
|
151
|
+
# User likely already exists — try login
|
|
152
|
+
return _login(client, homeserver, username, password)
|
|
153
|
+
|
|
154
|
+
resp.raise_for_status()
|
|
155
|
+
msg = f"Unexpected registration response: {resp.status_code}"
|
|
156
|
+
raise RuntimeError(msg)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def _login(
|
|
160
|
+
client: httpx.Client,
|
|
161
|
+
homeserver: str,
|
|
162
|
+
username: str,
|
|
163
|
+
password: str,
|
|
164
|
+
) -> tuple[str, str]:
|
|
165
|
+
"""Log in with username/password. Returns (user_id, access_token)."""
|
|
166
|
+
url = f"{homeserver}/_matrix/client/v3/login"
|
|
167
|
+
body = {
|
|
168
|
+
"type": "m.login.password",
|
|
169
|
+
"identifier": {"type": "m.id.user", "user": username},
|
|
170
|
+
"password": password,
|
|
171
|
+
"initial_device_display_name": "hyperloop",
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
resp = client.post(url, json=body)
|
|
175
|
+
resp.raise_for_status()
|
|
176
|
+
data = resp.json()
|
|
177
|
+
return str(data["user_id"]), str(data["access_token"])
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def _create_room(
|
|
181
|
+
client: httpx.Client,
|
|
182
|
+
homeserver: str,
|
|
183
|
+
access_token: str,
|
|
184
|
+
room_name: str,
|
|
185
|
+
) -> str:
|
|
186
|
+
"""Create a private Matrix room. Returns the room_id."""
|
|
187
|
+
url = f"{homeserver}/_matrix/client/v3/createRoom"
|
|
188
|
+
body = {
|
|
189
|
+
"name": room_name,
|
|
190
|
+
"topic": "hyperloop orchestrator notifications",
|
|
191
|
+
"visibility": "private",
|
|
192
|
+
"preset": "private_chat",
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
resp = client.post(
|
|
196
|
+
url,
|
|
197
|
+
json=body,
|
|
198
|
+
headers={"Authorization": f"Bearer {access_token}"},
|
|
199
|
+
)
|
|
200
|
+
resp.raise_for_status()
|
|
201
|
+
data = resp.json()
|
|
202
|
+
return str(data["room_id"])
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
# ---------------------------------------------------------------------------
|
|
206
|
+
# Public API
|
|
207
|
+
# ---------------------------------------------------------------------------
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def ensure_matrix_ready(
|
|
211
|
+
config: MatrixConfig,
|
|
212
|
+
repo_path: Path,
|
|
213
|
+
) -> tuple[str, str]:
|
|
214
|
+
"""Ensure Matrix credentials and room are available.
|
|
215
|
+
|
|
216
|
+
Resolution order for **access_token**:
|
|
217
|
+
1. Explicit ``token_env`` env var
|
|
218
|
+
2. Cached token from ``.hyperloop/matrix-state.json``
|
|
219
|
+
3. Auto-register via ``registration_token_env``
|
|
220
|
+
|
|
221
|
+
Resolution order for **room_id**:
|
|
222
|
+
1. Explicit ``room_id`` in config
|
|
223
|
+
2. Cached room_id
|
|
224
|
+
3. Auto-create via Matrix API
|
|
225
|
+
|
|
226
|
+
Returns:
|
|
227
|
+
(access_token, room_id) tuple. Either or both may be empty string
|
|
228
|
+
if Matrix cannot be set up (logged as warning, never raises).
|
|
229
|
+
"""
|
|
230
|
+
import os
|
|
231
|
+
|
|
232
|
+
homeserver = config.homeserver.rstrip("/")
|
|
233
|
+
cache = _load_cache(repo_path, homeserver)
|
|
234
|
+
|
|
235
|
+
# --- Resolve access token ---
|
|
236
|
+
explicit_token = os.environ.get(config.token_env) if config.token_env else ""
|
|
237
|
+
cached_token = cache.get("access_token", "") if cache else ""
|
|
238
|
+
access_token = explicit_token or cached_token
|
|
239
|
+
|
|
240
|
+
if not access_token:
|
|
241
|
+
# Try auto-registration
|
|
242
|
+
registration_token = (
|
|
243
|
+
os.environ.get(config.registration_token_env) if config.registration_token_env else ""
|
|
244
|
+
)
|
|
245
|
+
if registration_token:
|
|
246
|
+
try:
|
|
247
|
+
access_token = _auto_register(
|
|
248
|
+
config, repo_path, homeserver, registration_token, cache
|
|
249
|
+
)
|
|
250
|
+
except Exception:
|
|
251
|
+
_log.exception("Matrix bot registration failed")
|
|
252
|
+
else:
|
|
253
|
+
_log.warning("Matrix: no access token and no registration token — skipping")
|
|
254
|
+
return "", ""
|
|
255
|
+
|
|
256
|
+
if not access_token:
|
|
257
|
+
return "", ""
|
|
258
|
+
|
|
259
|
+
# --- Resolve room_id ---
|
|
260
|
+
cached_room = cache.get("room_id", "") if cache else ""
|
|
261
|
+
room_id = config.room_id or cached_room
|
|
262
|
+
|
|
263
|
+
if not room_id:
|
|
264
|
+
try:
|
|
265
|
+
room_id = _auto_create_room(config, repo_path, homeserver, access_token)
|
|
266
|
+
except Exception:
|
|
267
|
+
_log.exception("Matrix room creation failed")
|
|
268
|
+
return access_token, ""
|
|
269
|
+
|
|
270
|
+
return access_token, room_id
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
def _auto_register(
|
|
274
|
+
config: MatrixConfig,
|
|
275
|
+
repo_path: Path,
|
|
276
|
+
homeserver: str,
|
|
277
|
+
registration_token: str,
|
|
278
|
+
cache: dict[str, str] | None,
|
|
279
|
+
) -> str:
|
|
280
|
+
"""Register a bot user and cache credentials. Returns access_token."""
|
|
281
|
+
repo_name = repo_path.name
|
|
282
|
+
username = config.bot_username or f"hyperloop-{repo_name}"
|
|
283
|
+
|
|
284
|
+
password = cache.get("password", "") if cache else ""
|
|
285
|
+
if not password:
|
|
286
|
+
password = secrets.token_urlsafe(32)
|
|
287
|
+
|
|
288
|
+
client = httpx.Client(timeout=30.0)
|
|
289
|
+
try:
|
|
290
|
+
user_id, access_token = _register_bot(
|
|
291
|
+
client, homeserver, registration_token, username, password
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
_save_cache(
|
|
295
|
+
repo_path,
|
|
296
|
+
homeserver=homeserver,
|
|
297
|
+
user_id=user_id,
|
|
298
|
+
access_token=access_token,
|
|
299
|
+
room_id=config.room_id,
|
|
300
|
+
password=password,
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
_log.info("Matrix bot registered: %s", user_id)
|
|
304
|
+
return access_token
|
|
305
|
+
finally:
|
|
306
|
+
client.close()
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def _auto_create_room(
|
|
310
|
+
config: MatrixConfig,
|
|
311
|
+
repo_path: Path,
|
|
312
|
+
homeserver: str,
|
|
313
|
+
access_token: str,
|
|
314
|
+
) -> str:
|
|
315
|
+
"""Create a room and update the cache. Returns room_id."""
|
|
316
|
+
repo_name = repo_path.name
|
|
317
|
+
client = httpx.Client(timeout=30.0)
|
|
318
|
+
try:
|
|
319
|
+
room_id = _create_room(client, homeserver, access_token, f"hyperloop-{repo_name}")
|
|
320
|
+
|
|
321
|
+
# Update cache with the new room_id
|
|
322
|
+
cache = _load_cache(repo_path, homeserver) or {}
|
|
323
|
+
_save_cache(
|
|
324
|
+
repo_path,
|
|
325
|
+
homeserver=homeserver,
|
|
326
|
+
user_id=cache.get("user_id", ""),
|
|
327
|
+
access_token=cache.get("access_token", access_token),
|
|
328
|
+
room_id=room_id,
|
|
329
|
+
password=cache.get("password", ""),
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
_log.info("Matrix room created: %s", room_id)
|
|
333
|
+
return room_id
|
|
334
|
+
finally:
|
|
335
|
+
client.close()
|
|
@@ -95,11 +95,12 @@ def _make_composer(cfg: Config, state: StateStore) -> tuple[PromptComposer, Proc
|
|
|
95
95
|
return PromptComposer.load_from_kustomize(cfg.overlay, state, base_ref=cfg.base_ref)
|
|
96
96
|
|
|
97
97
|
|
|
98
|
-
def _build_probe(obs_cfg: ObservabilityConfig) -> OrchestratorProbe:
|
|
98
|
+
def _build_probe(obs_cfg: ObservabilityConfig, repo_path: Path) -> OrchestratorProbe:
|
|
99
99
|
"""Construct an OrchestratorProbe from observability config.
|
|
100
100
|
|
|
101
101
|
Always includes a StructlogProbe. Optionally adds a MatrixProbe if
|
|
102
|
-
Matrix config is present and
|
|
102
|
+
Matrix config is present and credentials can be resolved (explicit
|
|
103
|
+
token, cached credentials, or auto-registration).
|
|
103
104
|
"""
|
|
104
105
|
from hyperloop.adapters.probe import MultiProbe
|
|
105
106
|
from hyperloop.adapters.structlog_probe import StructlogProbe
|
|
@@ -110,17 +111,16 @@ def _build_probe(obs_cfg: ObservabilityConfig) -> OrchestratorProbe:
|
|
|
110
111
|
probes: list[OrchestratorProbe] = [StructlogProbe()]
|
|
111
112
|
|
|
112
113
|
if obs_cfg.matrix is not None:
|
|
113
|
-
import os
|
|
114
|
-
|
|
115
114
|
from hyperloop.adapters.matrix_probe import MatrixProbe
|
|
115
|
+
from hyperloop.adapters.matrix_setup import ensure_matrix_ready
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
if
|
|
117
|
+
access_token, room_id = ensure_matrix_ready(obs_cfg.matrix, repo_path)
|
|
118
|
+
if access_token and room_id:
|
|
119
119
|
probes.append(
|
|
120
120
|
MatrixProbe(
|
|
121
121
|
homeserver=obs_cfg.matrix.homeserver,
|
|
122
|
-
room_id=
|
|
123
|
-
access_token=
|
|
122
|
+
room_id=room_id,
|
|
123
|
+
access_token=access_token,
|
|
124
124
|
verbose=obs_cfg.matrix.verbose,
|
|
125
125
|
)
|
|
126
126
|
)
|
|
@@ -246,7 +246,7 @@ def run(
|
|
|
246
246
|
# Build observability probe
|
|
247
247
|
obs_cfg = getattr(cfg, "observability", None)
|
|
248
248
|
if obs_cfg is not None:
|
|
249
|
-
probe = _build_probe(obs_cfg)
|
|
249
|
+
probe = _build_probe(obs_cfg, repo_path)
|
|
250
250
|
else:
|
|
251
251
|
from hyperloop.adapters.probe import NullProbe
|
|
252
252
|
|
|
@@ -30,6 +30,8 @@ class MatrixConfig:
|
|
|
30
30
|
room_id: str
|
|
31
31
|
token_env: str
|
|
32
32
|
verbose: bool
|
|
33
|
+
registration_token_env: str # env var holding the registration token
|
|
34
|
+
bot_username: str
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
@dataclass(frozen=True)
|
|
@@ -141,6 +143,8 @@ def _flatten_yaml(raw: dict[str, object]) -> dict[str, object]:
|
|
|
141
143
|
flat["matrix_room_id"] = mx.get("room_id", "")
|
|
142
144
|
flat["matrix_token_env"] = mx.get("token_env", "")
|
|
143
145
|
flat["matrix_verbose"] = mx.get("verbose", False)
|
|
146
|
+
flat["matrix_registration_token_env"] = mx.get("registration_token_env", "")
|
|
147
|
+
flat["matrix_bot_username"] = mx.get("bot_username", "")
|
|
144
148
|
|
|
145
149
|
return flat
|
|
146
150
|
|
|
@@ -195,14 +199,16 @@ def load_config(
|
|
|
195
199
|
# Build ObservabilityConfig
|
|
196
200
|
matrix_cfg: MatrixConfig | None = None
|
|
197
201
|
homeserver = str(values.get("matrix_homeserver", ""))
|
|
198
|
-
room_id = str(values.get("matrix_room_id", ""))
|
|
199
202
|
token_env = str(values.get("matrix_token_env", ""))
|
|
200
|
-
|
|
203
|
+
registration_token_env = str(values.get("matrix_registration_token_env", ""))
|
|
204
|
+
if homeserver and (token_env or registration_token_env):
|
|
201
205
|
matrix_cfg = MatrixConfig(
|
|
202
206
|
homeserver=homeserver,
|
|
203
|
-
room_id=
|
|
207
|
+
room_id=str(values.get("matrix_room_id", "")),
|
|
204
208
|
token_env=token_env,
|
|
205
209
|
verbose=bool(values.get("matrix_verbose", False)),
|
|
210
|
+
registration_token_env=registration_token_env,
|
|
211
|
+
bot_username=str(values.get("matrix_bot_username", "")),
|
|
206
212
|
)
|
|
207
213
|
|
|
208
214
|
obs_cfg = ObservabilityConfig(
|
|
@@ -343,7 +343,7 @@ class TestCheckKustomize:
|
|
|
343
343
|
def test_raises_when_missing(self, monkeypatch: pytest.MonkeyPatch) -> None:
|
|
344
344
|
from hyperloop.compose import check_kustomize_available
|
|
345
345
|
|
|
346
|
-
monkeypatch.setattr(shutil, "which", lambda _name: None)
|
|
346
|
+
monkeypatch.setattr(shutil, "which", lambda _name: None) # type: ignore[arg-type]
|
|
347
347
|
|
|
348
348
|
with pytest.raises(SystemExit, match="kustomize CLI not found"):
|
|
349
349
|
check_kustomize_available()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|