Bootstrap rein-openweights: minimal agentic loop over OpenRouter (REIN-OW-WP-0001)
Implements T01-T04: - tools.py: green-commit-only-equivalent tool surface (read/write/edit/ glob/grep + git status/diff/log/add+commit), path-traversal guarded. - openrouter_client.py: own minimal chat-completions client — llm-connect's OpenRouterAdapter takes a single prompt string and never surfaces tool_calls, so it can't drive a multi-turn tool-calling loop without a breaking change to its frozen Core ABC. llm-connect stays an optional dependency (pyproject.toml), not load-bearing. - loop.py: plan -> tool call -> observe -> repeat, budget- and turn-bounded, tool errors reported back to the model instead of crashing the loop. - credentials.py: own OpenBao AppRole/ambient-token acquisition, per glas-harness ADR-002 (Option B) — glas-harness does not broker this. - runner.py/hub.py: commit-verified success criterion + State Hub progress/token reporting, mirroring rein-aharness's model. 26 tests, all mocked at the httpx/subprocess boundary — no real OpenRouter or OpenBao calls made. T05 (Forgejo repo creation) stays open, deferred to the operator. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
ac5407a83e
commit
4ee612140b
21 changed files with 1207 additions and 36 deletions
34
pyproject.toml
Normal file
34
pyproject.toml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "rein-openweights"
|
||||
version = "0.1.0"
|
||||
description = "Agentic tool-use harness driving current open-weight models via OpenRouter"
|
||||
requires-python = ">=3.11"
|
||||
dependencies = [
|
||||
"httpx>=0.27",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
rein-openweights = "rein_openweights.cli:main"
|
||||
|
||||
[tool.uv.sources]
|
||||
llm-connect = { path = "../llm-connect", editable = true }
|
||||
|
||||
[project.optional-dependencies]
|
||||
# llm-connect stays optional per glas-harness ADR-002: the base agentic
|
||||
# loop uses its own OpenRouter client and budget tracker (see
|
||||
# openrouter_client.py, budget.py) so it never becomes load-bearing.
|
||||
# This extra is only for future opt-in use of llm-connect's diagnostics/
|
||||
# replay/structured-JSON helpers.
|
||||
llm-connect = ["llm-connect"]
|
||||
dev = ["pytest>=8"]
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/rein_openweights"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
pythonpath = ["src"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue