openreynolds 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.
- openreynolds-0.1.0/.gitattributes +4 -0
- openreynolds-0.1.0/.gitignore +22 -0
- openreynolds-0.1.0/CHANGELOG.md +80 -0
- openreynolds-0.1.0/CONTRIBUTING.md +70 -0
- openreynolds-0.1.0/LICENSE +21 -0
- openreynolds-0.1.0/PKG-INFO +557 -0
- openreynolds-0.1.0/README.md +514 -0
- openreynolds-0.1.0/SECURITY.md +68 -0
- openreynolds-0.1.0/openreynolds/__init__.py +3 -0
- openreynolds-0.1.0/openreynolds/__main__.py +11 -0
- openreynolds-0.1.0/openreynolds/backend/__init__.py +21 -0
- openreynolds-0.1.0/openreynolds/backend/base.py +141 -0
- openreynolds-0.1.0/openreynolds/backend/hosted.py +485 -0
- openreynolds-0.1.0/openreynolds/backend/local.py +52 -0
- openreynolds-0.1.0/openreynolds/browse.py +195 -0
- openreynolds-0.1.0/openreynolds/capture.py +110 -0
- openreynolds-0.1.0/openreynolds/cli.py +1619 -0
- openreynolds-0.1.0/openreynolds/commands.py +130 -0
- openreynolds-0.1.0/openreynolds/config.py +252 -0
- openreynolds-0.1.0/openreynolds/delivery.py +202 -0
- openreynolds-0.1.0/openreynolds/desk.py +251 -0
- openreynolds-0.1.0/openreynolds/images.py +129 -0
- openreynolds-0.1.0/openreynolds/llm/__init__.py +66 -0
- openreynolds-0.1.0/openreynolds/llm/anthropic_api.py +182 -0
- openreynolds-0.1.0/openreynolds/llm/base.py +204 -0
- openreynolds-0.1.0/openreynolds/llm/openai_api.py +334 -0
- openreynolds-0.1.0/openreynolds/llm/presets.py +104 -0
- openreynolds-0.1.0/openreynolds/loop.py +420 -0
- openreynolds-0.1.0/openreynolds/mirror.py +589 -0
- openreynolds-0.1.0/openreynolds/progress.py +755 -0
- openreynolds-0.1.0/openreynolds/prompt.py +119 -0
- openreynolds-0.1.0/openreynolds/stopping.py +154 -0
- openreynolds-0.1.0/openreynolds/store.py +174 -0
- openreynolds-0.1.0/openreynolds/terminal.py +32 -0
- openreynolds-0.1.0/openreynolds/toolbox/README.md +25 -0
- openreynolds-0.1.0/openreynolds/toolbox/animate.py +156 -0
- openreynolds-0.1.0/openreynolds/toolbox/cells_estimate.py +208 -0
- openreynolds-0.1.0/openreynolds/toolbox/geometry_view.py +309 -0
- openreynolds-0.1.0/openreynolds/toolbox/log_digest.py +167 -0
- openreynolds-0.1.0/openreynolds/toolbox/mesh_digest.py +138 -0
- openreynolds-0.1.0/openreynolds/toolbox/notes/bundle-layout.md +33 -0
- openreynolds-0.1.0/openreynolds/toolbox/notes/openfoam-agent-architecture.md +1083 -0
- openreynolds-0.1.0/openreynolds/toolbox/notes/openfoam-field-notes.md +311 -0
- openreynolds-0.1.0/openreynolds/toolbox/render.py +132 -0
- openreynolds-0.1.0/openreynolds/tools.py +541 -0
- openreynolds-0.1.0/openreynolds/tui.py +813 -0
- openreynolds-0.1.0/openreynolds/video.py +125 -0
- openreynolds-0.1.0/openreynolds/view.py +294 -0
- openreynolds-0.1.0/openreynolds/watch.py +390 -0
- openreynolds-0.1.0/pyproject.toml +90 -0
- openreynolds-0.1.0/tests/conftest.py +339 -0
- openreynolds-0.1.0/tests/test_asides.py +192 -0
- openreynolds-0.1.0/tests/test_briefing.py +188 -0
- openreynolds-0.1.0/tests/test_browse.py +211 -0
- openreynolds-0.1.0/tests/test_capture.py +143 -0
- openreynolds-0.1.0/tests/test_cli.py +1212 -0
- openreynolds-0.1.0/tests/test_commands.py +98 -0
- openreynolds-0.1.0/tests/test_config.py +228 -0
- openreynolds-0.1.0/tests/test_delivery.py +176 -0
- openreynolds-0.1.0/tests/test_desk.py +167 -0
- openreynolds-0.1.0/tests/test_hosted.py +191 -0
- openreynolds-0.1.0/tests/test_images.py +108 -0
- openreynolds-0.1.0/tests/test_llm.py +378 -0
- openreynolds-0.1.0/tests/test_loop.py +376 -0
- openreynolds-0.1.0/tests/test_mirror.py +791 -0
- openreynolds-0.1.0/tests/test_negative_obligation.py +46 -0
- openreynolds-0.1.0/tests/test_progress.py +476 -0
- openreynolds-0.1.0/tests/test_prompt.py +93 -0
- openreynolds-0.1.0/tests/test_seeing.py +199 -0
- openreynolds-0.1.0/tests/test_smoke_script.py +284 -0
- openreynolds-0.1.0/tests/test_stopping.py +297 -0
- openreynolds-0.1.0/tests/test_store.py +51 -0
- openreynolds-0.1.0/tests/test_terminal.py +86 -0
- openreynolds-0.1.0/tests/test_toolbox.py +378 -0
- openreynolds-0.1.0/tests/test_tools.py +391 -0
- openreynolds-0.1.0/tests/test_tui.py +729 -0
- openreynolds-0.1.0/tests/test_user_test.py +480 -0
- openreynolds-0.1.0/tests/test_video.py +165 -0
- openreynolds-0.1.0/tests/test_watch.py +411 -0
- openreynolds-0.1.0/tests/test_wiring.py +269 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# credentials — never commit these
|
|
2
|
+
.foamd_key
|
|
3
|
+
.env
|
|
4
|
+
*.key
|
|
5
|
+
|
|
6
|
+
# local study mirror
|
|
7
|
+
studies/
|
|
8
|
+
|
|
9
|
+
# python
|
|
10
|
+
__pycache__/
|
|
11
|
+
*.py[cod]
|
|
12
|
+
*.egg-info/
|
|
13
|
+
build/
|
|
14
|
+
dist/
|
|
15
|
+
.venv/
|
|
16
|
+
venv/
|
|
17
|
+
.pytest_cache/
|
|
18
|
+
.ruff_cache/
|
|
19
|
+
user-test*.log
|
|
20
|
+
|
|
21
|
+
# editor/agent scratch
|
|
22
|
+
.claude/
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are recorded here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.0] - 2026-08-27
|
|
10
|
+
|
|
11
|
+
The first release: the tool-use loop over a hosted OpenFOAM workspace, seven tools, the
|
|
12
|
+
terminal interface, watch mode with factual wakes, the local study mirror, capture,
|
|
13
|
+
stopping that verifies, the toolbox and the field notes -- and, since the first cut
|
|
14
|
+
on 2026-08-24:
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- An npm launcher (`launcher/`, published as `openreynolds`): `npm install -g
|
|
19
|
+
openreynolds` finds or installs `uv`, installs the Python package from PyPI once,
|
|
20
|
+
and runs it. No Python source ships in the npm tarball.
|
|
21
|
+
- `openreynolds login`: sign in from the terminal by approving a short code in the
|
|
22
|
+
browser; the service key lands in the config file. The service has a default address
|
|
23
|
+
now (`https://api.tryreynolds.com`), so a fresh install needs no URL.
|
|
24
|
+
- Bring your own model, not just your own key: `OPENREYNOLDS_PROVIDER` /
|
|
25
|
+
`openreynolds config --provider` pick Anthropic, OpenAI, Z.ai, DeepSeek, Moonshot,
|
|
26
|
+
MiniMax, OpenRouter or a local Ollama, or any endpoint speaking the Messages API or
|
|
27
|
+
Chat Completions (`openreynolds/llm/`). `ANTHROPIC_API_KEY` still works; the general
|
|
28
|
+
name is `OPENREYNOLDS_LLM_API_KEY`, and older config files are read as before.
|
|
29
|
+
- A live mirror: the study's files are synced to `./studies/<id>/files/` in the
|
|
30
|
+
background for the whole session, and a render the model just looked at arrives at
|
|
31
|
+
once. The interface's files pane reads from it.
|
|
32
|
+
- A progress bar for real compute -- solver time against `endTime`, residuals, Courant
|
|
33
|
+
number, snappyHexMesh phase -- shown only while a solve, mesh, decomposition or sync
|
|
34
|
+
is running.
|
|
35
|
+
- A front desk: a second, cheap agent that answers the user within seconds while the
|
|
36
|
+
main agent is mid-turn, and writes the plain-language "now" line. It is read-only
|
|
37
|
+
and cannot steer the agent. `OPENREYNOLDS_DESK=0` turns it off.
|
|
38
|
+
- Render delivery: every image the instance writes lands in a flat
|
|
39
|
+
`./studies/<id>/renders/` folder, frame directories are assembled into gifs locally,
|
|
40
|
+
and the interface has a renders tab. `openreynolds renders` lists them.
|
|
41
|
+
- `openreynolds video` encodes a frame set on the user's machine (ffmpeg, or imageio as
|
|
42
|
+
a fallback); the instance never carries an encoder.
|
|
43
|
+
- `openreynolds push` carries a local file or directory up to the study's workspace.
|
|
44
|
+
- `job_check` takes `wait_s`, holding the answer until the job ends or the user types.
|
|
45
|
+
- `python -m openreynolds` as an entry point beside the console script.
|
|
46
|
+
- `cli.session(..., interface=)`: a seam through which another interface (a web page,
|
|
47
|
+
a test harness) can drive a session using the same `View` the terminal uses.
|
|
48
|
+
- `-p` runs exit `1` when the model API would not complete a turn and `2` when
|
|
49
|
+
`--max-wait` ran out with a job still running, so a script can tell the two apart
|
|
50
|
+
from a run that finished.
|
|
51
|
+
- `OPENREYNOLDS_CAPTURE=0` switches transcript upload off from the environment; the
|
|
52
|
+
README says up front that transcripts go to the workspace service by default.
|
|
53
|
+
- Packaging metadata: project URLs, authorship, keywords, classifiers, a PEP 639
|
|
54
|
+
licence expression, the version read from the package, `video` and `toolbox`
|
|
55
|
+
extras, and an sdist that leaves study mirrors and engineering scaffolding behind.
|
|
56
|
+
CI runs on Windows and Python 3.11 as well.
|
|
57
|
+
- `SECURITY.md`, `CONTRIBUTING.md` and this changelog.
|
|
58
|
+
|
|
59
|
+
### Changed
|
|
60
|
+
|
|
61
|
+
- Turn-end syncs no longer block the session thread; the mirror is poked instead, so a
|
|
62
|
+
message typed during a long solve is read at once.
|
|
63
|
+
- After two model-API failures in a row the session says plainly what is happening and
|
|
64
|
+
how to resume, instead of repeating that the thread is intact.
|
|
65
|
+
- The thread sheds the pixels of images the model has already looked at, keeping the
|
|
66
|
+
path and description, so long render-and-look sessions stay a size the API accepts.
|
|
67
|
+
- Field notes: steady-versus-transient, the 2D recipe, `job_check wait_s` in place of
|
|
68
|
+
`sleep`, rendering next to the data, and what a steady solve that will not converge
|
|
69
|
+
usually means.
|
|
70
|
+
- The design document moved to `docs/design.md`.
|
|
71
|
+
|
|
72
|
+
### Fixed
|
|
73
|
+
|
|
74
|
+
- `openreynolds doctor` opened a real study on the platform every run to check that
|
|
75
|
+
capture worked. It now makes a read-only call and changes nothing.
|
|
76
|
+
- A duplicate copy of the architecture notes at the repository root is gone; the one
|
|
77
|
+
under the toolbox notes is the one that ships.
|
|
78
|
+
|
|
79
|
+
[Unreleased]: https://github.com/InviscidAI/OpenReynolds/compare/v0.1.0...HEAD
|
|
80
|
+
[0.1.0]: https://github.com/InviscidAI/OpenReynolds/releases/tag/v0.1.0
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
## Setting up
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
git clone https://github.com/InviscidAI/OpenReynolds
|
|
7
|
+
cd OpenReynolds
|
|
8
|
+
pip install -e ".[dev]"
|
|
9
|
+
python -m pytest tests -q
|
|
10
|
+
git config core.hooksPath .githooks
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The last line installs the pre-commit hook, which runs the whole suite before a commit
|
|
14
|
+
is allowed. It takes about half a minute. It exists because twice in one session a
|
|
15
|
+
commit went out red on the strength of the tests just written rather than the whole
|
|
16
|
+
suite, and discipline had already failed twice.
|
|
17
|
+
|
|
18
|
+
The suite runs against fakes -- no service account, no model key, no network. The
|
|
19
|
+
scripts under `scripts/` drive a live service and need credentials; `openreynolds doctor`
|
|
20
|
+
says whether yours work.
|
|
21
|
+
|
|
22
|
+
## The tests that will bite
|
|
23
|
+
|
|
24
|
+
A good part of the suite checks the *shape* of the code rather than its behaviour.
|
|
25
|
+
These are the ones a reasonable change trips over, and what each one wants:
|
|
26
|
+
|
|
27
|
+
- **Everything declared is read** (`tests/test_wiring.py`). Every click option, every
|
|
28
|
+
`Config` field, every `ToolContext` field, every `View` method and every `Backend`
|
|
29
|
+
method has to be read somewhere in the package. Four separate times something was
|
|
30
|
+
defined, documented, listed in `--help` and never wired up; the test turns that into
|
|
31
|
+
a failure. Adding a field means wiring it end to end in the same change.
|
|
32
|
+
- **The README mentions every subcommand** (`tests/test_wiring.py`). A command nobody
|
|
33
|
+
is told about is a command nobody uses. A new `@main.command("x")` needs the string
|
|
34
|
+
`openreynolds x` in the README.
|
|
35
|
+
- **Documents carry no hand-edited test counts** (`tests/test_wiring.py`). A number
|
|
36
|
+
that has to be edited by hand goes stale.
|
|
37
|
+
- **No imperative language in the system prompt or the briefing**
|
|
38
|
+
(`tests/test_prompt.py`, `tests/test_briefing.py`). "Always", "you should", "make
|
|
39
|
+
sure", "first,", "workflow" and their relatives fail the build. The prompt states
|
|
40
|
+
facts; decisions are the model's. Know-how belongs in the toolbox and the field
|
|
41
|
+
notes, where it is offered rather than imposed. The system prompt is also
|
|
42
|
+
byte-frozen (it is the cache prefix) and capped in length, so it changes rarely and
|
|
43
|
+
deliberately.
|
|
44
|
+
- **HTTP stays below the backend protocol** (`tests/test_negative_obligation.py`).
|
|
45
|
+
`openreynolds/backend/hosted.py` is the only module that knows a service exists.
|
|
46
|
+
Nothing above `backend/base.py` may import a transport or mention an endpoint.
|
|
47
|
+
|
|
48
|
+
The contract these tests enforce is in [`docs/design.md`](docs/design.md): the harness
|
|
49
|
+
may cap output, sync the toolbox, poll jobs and wake the model with facts, and capture
|
|
50
|
+
the transcript. It may not order the model's actions, gate or rewrite a tool call,
|
|
51
|
+
require approvals, inject checklists, or grade the output.
|
|
52
|
+
|
|
53
|
+
## Style
|
|
54
|
+
|
|
55
|
+
- Docstrings explain *why*, often with the incident that taught it.
|
|
56
|
+
[`docs/found-by-using-it.md`](docs/found-by-using-it.md) is the casebook; a fix that
|
|
57
|
+
came from using the thing usually earns an entry there.
|
|
58
|
+
- Commit messages are a sentence about what is now true, in the style of `git log`.
|
|
59
|
+
- Files are UTF-8. Git normalises line endings to LF (`.gitattributes`); on Windows the
|
|
60
|
+
working copies are typically CRLF, and an editor that rewrites a whole file's endings
|
|
61
|
+
makes a diff nobody can review -- keep each file the way you found it.
|
|
62
|
+
- Tests are named for the behaviour they protect (`test_a_failed_turn_does_not_...`),
|
|
63
|
+
and a test that exists because something went wrong says so in its docstring.
|
|
64
|
+
|
|
65
|
+
## Sending a change
|
|
66
|
+
|
|
67
|
+
Open a pull request against `main` with the suite green. Say what is now true that was
|
|
68
|
+
not before, and if the change came from a session that went wrong, what happened. A
|
|
69
|
+
change to the prompt, the briefing or the tool schemas is a change to what the model
|
|
70
|
+
sees and gets a closer look than the rest.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 InviscidAI
|
|
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.
|