remgu 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 (40) hide show
  1. remgu-0.1.0/LICENSE +201 -0
  2. remgu-0.1.0/NOTICE +4 -0
  3. remgu-0.1.0/PKG-INFO +199 -0
  4. remgu-0.1.0/README.md +175 -0
  5. remgu-0.1.0/pyproject.toml +49 -0
  6. remgu-0.1.0/setup.cfg +4 -0
  7. remgu-0.1.0/src/remgu/__init__.py +15 -0
  8. remgu-0.1.0/src/remgu/consistency/__init__.py +9 -0
  9. remgu-0.1.0/src/remgu/consistency/consistency.py +22 -0
  10. remgu-0.1.0/src/remgu/consistency/consistency_issue.py +23 -0
  11. remgu-0.1.0/src/remgu/consistency/consistency_report.py +27 -0
  12. remgu-0.1.0/src/remgu/consistency/research_checker.py +124 -0
  13. remgu-0.1.0/src/remgu/example/__init__.py +9 -0
  14. remgu-0.1.0/src/remgu/example/candidate.py +21 -0
  15. remgu-0.1.0/src/remgu/example/example_provider.py +26 -0
  16. remgu-0.1.0/src/remgu/example/example_selector.py +57 -0
  17. remgu-0.1.0/src/remgu/example/top_k_selector.py +88 -0
  18. remgu-0.1.0/src/remgu/experiment.py +139 -0
  19. remgu-0.1.0/src/remgu/file_storage.py +165 -0
  20. remgu-0.1.0/src/remgu/models/__init__.py +10 -0
  21. remgu-0.1.0/src/remgu/models/execution.py +24 -0
  22. remgu-0.1.0/src/remgu/models/motivation.py +17 -0
  23. remgu-0.1.0/src/remgu/models/research_metadata.py +19 -0
  24. remgu-0.1.0/src/remgu/models/review.py +20 -0
  25. remgu-0.1.0/src/remgu/research_cli.py +255 -0
  26. remgu-0.1.0/src/remgu/run.py +229 -0
  27. remgu-0.1.0/src/remgu.egg-info/PKG-INFO +199 -0
  28. remgu-0.1.0/src/remgu.egg-info/SOURCES.txt +38 -0
  29. remgu-0.1.0/src/remgu.egg-info/dependency_links.txt +1 -0
  30. remgu-0.1.0/src/remgu.egg-info/entry_points.txt +2 -0
  31. remgu-0.1.0/src/remgu.egg-info/requires.txt +1 -0
  32. remgu-0.1.0/src/remgu.egg-info/top_level.txt +1 -0
  33. remgu-0.1.0/tests/test_cli.py +152 -0
  34. remgu-0.1.0/tests/test_example_provider.py +44 -0
  35. remgu-0.1.0/tests/test_example_selector.py +50 -0
  36. remgu-0.1.0/tests/test_experiment.py +72 -0
  37. remgu-0.1.0/tests/test_research_checker.py +96 -0
  38. remgu-0.1.0/tests/test_research_models.py +41 -0
  39. remgu-0.1.0/tests/test_run.py +194 -0
  40. remgu-0.1.0/tests/test_top_k_selector.py +48 -0
remgu-0.1.0/LICENSE ADDED
@@ -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 Mstislav Maslennikov
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.
remgu-0.1.0/NOTICE ADDED
@@ -0,0 +1,4 @@
1
+ ReMgu
2
+ Copyright 2026 Mstislav Maslennikov
3
+
4
+ This project was originally developed by Mstislav Maslennikov.
remgu-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,199 @@
1
+ Metadata-Version: 2.4
2
+ Name: remgu
3
+ Version: 0.1.0
4
+ Summary: Experiment lifecycle management for reproducible ML research
5
+ Author-email: Mstislav Maslennikov <ml.arch@inbox.ru>
6
+ Maintainer-email: Mstislav Maslennikov <ml.arch@inbox.ru>
7
+ License-Expression: Apache-2.0
8
+ Project-URL: Homepage, https://github.com/graph-ml-research/remgu
9
+ Project-URL: Repository, https://github.com/graph-ml-research/remgu
10
+ Project-URL: Issues, https://github.com/graph-ml-research/remgu/issues
11
+ Project-URL: Documentation, https://github.com/graph-ml-research/remgu#readme
12
+ Keywords: machine-learning,research,experiments,reproducibility,ml-research
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ License-File: NOTICE
22
+ Requires-Dist: PyYAML>=6.0
23
+ Dynamic: license-file
24
+
25
+ # ReMgu
26
+
27
+ **English** | [Русский](README.ru.md)
28
+
29
+ Experiment lifecycle management for reproducible ML research.
30
+
31
+ ReMgu connects a research hypothesis to a concrete run, its metrics and diagnostic examples, and a written conclusion with the next step. It stores this record as ordinary files in `.research/`, so the history can be inspected, versioned, and reviewed without a tracking server.
32
+
33
+ > **Current scope:** run lifecycle, parameters, metrics, diagnostic samples, and read-only consistency checks. Knowledge-base management, agent workflows, report/site generation, and `research update` are not implemented in this version.
34
+
35
+ ## Start here
36
+
37
+ | What you want to do | Interface | Guide |
38
+ |---|---|---|
39
+ | Create a run before training | CLI | [CLI workflow](docs/en/cli.md#1-create-a-run) |
40
+ | Run existing training code and log results | Python API | [Python API](docs/en/python-api.md#minimal-training-example) |
41
+ | Record parameters, metrics, and diagnostic examples | Python API | [Run artifacts](docs/en/python-api.md#record-parameters-metrics-and-examples) |
42
+ | Review a completed run and record the conclusion | CLI | [CLI workflow](docs/en/cli.md#2-review-a-completed-run) |
43
+ | Inspect previous runs and the active run | CLI | [CLI workflow](docs/en/cli.md#3-inspect-run-history) |
44
+ | Find incomplete or inconsistent research records | CLI / API | [Consistency check](docs/en/consistency-check.md) |
45
+ | Understand the files ReMgu creates | Reference | [On-disk format](docs/en/data-format.md) |
46
+
47
+ ## The research loop
48
+
49
+ ```text
50
+ question / observation
51
+ ↓
52
+ hypothesis + motivation
53
+ ↓
54
+ run-001
55
+ ├── params.yaml
56
+ ├── metrics.csv
57
+ └── samples.jsonl
58
+ ↓
59
+ execution: completed / failed / aborted
60
+ ↓
61
+ conclusion + next step
62
+ ↓
63
+ next hypothesis
64
+ ```
65
+
66
+ A **run** is one concrete execution. The hypothesis and motivation explain why it exists; execution metadata records what happened; review metadata records what was learned and what should happen next.
67
+
68
+
69
+ ## Installation
70
+
71
+ ReMgu requires Python 3.10 or newer.
72
+
73
+ ### Option 1: Use ReMgu in your project code
74
+ If you want to import ReMgu in your training code (`from remgu import Experiment`), install the package into your project environment:
75
+
76
+ ```bash
77
+ pip install remgu
78
+ ```
79
+
80
+ The `research` command will then be available while you are inside that environment:
81
+
82
+ ```bash
83
+ research --help
84
+ ```
85
+
86
+ ### Option 2: Use only the research command line
87
+
88
+ If you need ReMgu only as the `research` command (without importing it in code), install it via [pipx](https://pipx.pypa.io):
89
+
90
+ ```bash
91
+ pipx install remgu
92
+ ```
93
+
94
+ Pipx creates a dedicated environment for `remgu` and adds the `research` command to `PATH`.
95
+ The command will be available from any directory, without activating any environment.
96
+
97
+ ```bash
98
+ research --help
99
+ ```
100
+
101
+ Upgrade: `pipx upgrade remgu`.
102
+
103
+
104
+ ## Quick start
105
+
106
+ From a checkout of this repository, install the dependency and create a run:
107
+
108
+ ```bash
109
+ research new \
110
+ --hypothesis "Increasing hidden_dim to 512 improves NDCG@20" \
111
+ --motivation-type previous_run \
112
+ --reference run-001
113
+ ```
114
+
115
+ The command prints the new run ID. It creates `.research/` in the current directory unless `--base-path` is supplied. The reference above is illustrative: use an existing run ID, or omit `--reference` and use `--motivation-type new` for a new research direction.
116
+
117
+ In your training script:
118
+
119
+ ```python
120
+ from remgu import Experiment, Motivation
121
+
122
+ experiment = Experiment("graph-mamba")
123
+ with experiment.run() as run:
124
+ run.log_params({"hidden_dim": 512, "learning_rate": 1e-3})
125
+
126
+ # Replace this block with your training and evaluation code.
127
+ run.log_metric("ndcg_at_20", 0.428, step=1)
128
+ run.collect({"example_id": "user-104", "score": 0.12, "reason": "large_regression"})
129
+ ```
130
+
131
+ The no-argument `experiment.run()` resumes the active run created by the CLI. Exiting the `with` block marks a still-running run as completed; an uncaught exception marks it as failed and records its type and message.
132
+
133
+ After validating the result, review it:
134
+
135
+ ```bash
136
+ research finish run-001 \
137
+ --conclusion "NDCG@20 increased from 0.401 to 0.428 on the fixed validation set" \
138
+ --next-step "Repeat with three random seeds"
139
+ ```
140
+
141
+ Use the actual ID printed by `research new`; `run-001` is only an example. Full walkthroughs: [CLI](docs/en/cli.md) · [Python API](docs/en/python-api.md).
142
+
143
+ ## Interfaces
144
+
145
+ ### Command line
146
+
147
+ ```bash
148
+ research --help
149
+ research new --help
150
+ research status
151
+ research previous --limit 10
152
+ research resume run-001
153
+ research finish run-001 --conclusion "..." --next-step "..."
154
+ research check
155
+ ```
156
+
157
+ The CLI defaults to `.research/`. Pass `--base-path /path/to/research-data` before the subcommand to use another directory.
158
+
159
+ ### Python API
160
+
161
+ ```python
162
+ from remgu import Experiment, Motivation, Run, ExampleProvider, TopKSelector
163
+ ```
164
+
165
+ - `Experiment` opens the active run or creates one programmatically.
166
+ - `Run` tracks execution state and writes parameters, metrics, and diagnostic records.
167
+ - `Motivation` describes why a hypothesis is being tested.
168
+ - `TopKSelector` keeps the highest- or lowest-scoring diagnostic records in bounded memory.
169
+ - `ExampleSelector` merges named selection criteria and annotates why each example was selected.
170
+ - `ExampleProvider` defines how a stored example ID can be resolved to source data and a readable description.
171
+
172
+ See the [API guide](docs/en/python-api.md) for signatures and complete examples.
173
+
174
+ ## Design principles
175
+
176
+ - **Research context stays with the run.** A run stores its hypothesis and motivation, not just a metric dump.
177
+ - **Ordinary training scripts stay ordinary.** ReMgu wraps the code you already run; it does not require a new training framework.
178
+ - **Files are the source of truth.** YAML, CSV, and JSONL are human-readable and easy to version or inspect.
179
+ - **Execution and review are separate.** A successful process is not the same thing as a scientifically reviewed result.
180
+ - **Checks are read-only.** `research check` reports problems without repairing or rewriting run records.
181
+
182
+ ## Documentation
183
+
184
+ - [CLI workflows](docs/en/cli.md)
185
+ - [Python API](docs/en/python-api.md)
186
+ - [Consistency checks](docs/en/consistency-check.md)
187
+ - [On-disk data format](docs/en/data-format.md)
188
+ - [Architecture and boundaries](docs/en/architecture.md)
189
+ - [Russian documentation](README.ru.md)
190
+
191
+ ## Development status
192
+
193
+ ReMgu is an evolving research tool. The current implementation is intentionally file-based and small. The documentation describes the implementation in this repository; future knowledge management, publication, and agent features are explicitly out of scope until implemented.
194
+
195
+ ## Attribution and license
196
+
197
+ Copyright 2026 Mstislav Maslennikov. Developed and maintained by Mstislav Maslennikov. Licensed under [Apache License 2.0](LICENSE).
198
+
199
+ Originally developed to support research work of students at the Open Information Technologies Laboratory, Faculty of Computational Mathematics and Cybernetics, Lomonosov Moscow State University. It is maintained as an independent research software project.
remgu-0.1.0/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # ReMgu
2
+
3
+ **English** | [Русский](README.ru.md)
4
+
5
+ Experiment lifecycle management for reproducible ML research.
6
+
7
+ ReMgu connects a research hypothesis to a concrete run, its metrics and diagnostic examples, and a written conclusion with the next step. It stores this record as ordinary files in `.research/`, so the history can be inspected, versioned, and reviewed without a tracking server.
8
+
9
+ > **Current scope:** run lifecycle, parameters, metrics, diagnostic samples, and read-only consistency checks. Knowledge-base management, agent workflows, report/site generation, and `research update` are not implemented in this version.
10
+
11
+ ## Start here
12
+
13
+ | What you want to do | Interface | Guide |
14
+ |---|---|---|
15
+ | Create a run before training | CLI | [CLI workflow](docs/en/cli.md#1-create-a-run) |
16
+ | Run existing training code and log results | Python API | [Python API](docs/en/python-api.md#minimal-training-example) |
17
+ | Record parameters, metrics, and diagnostic examples | Python API | [Run artifacts](docs/en/python-api.md#record-parameters-metrics-and-examples) |
18
+ | Review a completed run and record the conclusion | CLI | [CLI workflow](docs/en/cli.md#2-review-a-completed-run) |
19
+ | Inspect previous runs and the active run | CLI | [CLI workflow](docs/en/cli.md#3-inspect-run-history) |
20
+ | Find incomplete or inconsistent research records | CLI / API | [Consistency check](docs/en/consistency-check.md) |
21
+ | Understand the files ReMgu creates | Reference | [On-disk format](docs/en/data-format.md) |
22
+
23
+ ## The research loop
24
+
25
+ ```text
26
+ question / observation
27
+ ↓
28
+ hypothesis + motivation
29
+ ↓
30
+ run-001
31
+ ├── params.yaml
32
+ ├── metrics.csv
33
+ └── samples.jsonl
34
+ ↓
35
+ execution: completed / failed / aborted
36
+ ↓
37
+ conclusion + next step
38
+ ↓
39
+ next hypothesis
40
+ ```
41
+
42
+ A **run** is one concrete execution. The hypothesis and motivation explain why it exists; execution metadata records what happened; review metadata records what was learned and what should happen next.
43
+
44
+
45
+ ## Installation
46
+
47
+ ReMgu requires Python 3.10 or newer.
48
+
49
+ ### Option 1: Use ReMgu in your project code
50
+ If you want to import ReMgu in your training code (`from remgu import Experiment`), install the package into your project environment:
51
+
52
+ ```bash
53
+ pip install remgu
54
+ ```
55
+
56
+ The `research` command will then be available while you are inside that environment:
57
+
58
+ ```bash
59
+ research --help
60
+ ```
61
+
62
+ ### Option 2: Use only the research command line
63
+
64
+ If you need ReMgu only as the `research` command (without importing it in code), install it via [pipx](https://pipx.pypa.io):
65
+
66
+ ```bash
67
+ pipx install remgu
68
+ ```
69
+
70
+ Pipx creates a dedicated environment for `remgu` and adds the `research` command to `PATH`.
71
+ The command will be available from any directory, without activating any environment.
72
+
73
+ ```bash
74
+ research --help
75
+ ```
76
+
77
+ Upgrade: `pipx upgrade remgu`.
78
+
79
+
80
+ ## Quick start
81
+
82
+ From a checkout of this repository, install the dependency and create a run:
83
+
84
+ ```bash
85
+ research new \
86
+ --hypothesis "Increasing hidden_dim to 512 improves NDCG@20" \
87
+ --motivation-type previous_run \
88
+ --reference run-001
89
+ ```
90
+
91
+ The command prints the new run ID. It creates `.research/` in the current directory unless `--base-path` is supplied. The reference above is illustrative: use an existing run ID, or omit `--reference` and use `--motivation-type new` for a new research direction.
92
+
93
+ In your training script:
94
+
95
+ ```python
96
+ from remgu import Experiment, Motivation
97
+
98
+ experiment = Experiment("graph-mamba")
99
+ with experiment.run() as run:
100
+ run.log_params({"hidden_dim": 512, "learning_rate": 1e-3})
101
+
102
+ # Replace this block with your training and evaluation code.
103
+ run.log_metric("ndcg_at_20", 0.428, step=1)
104
+ run.collect({"example_id": "user-104", "score": 0.12, "reason": "large_regression"})
105
+ ```
106
+
107
+ The no-argument `experiment.run()` resumes the active run created by the CLI. Exiting the `with` block marks a still-running run as completed; an uncaught exception marks it as failed and records its type and message.
108
+
109
+ After validating the result, review it:
110
+
111
+ ```bash
112
+ research finish run-001 \
113
+ --conclusion "NDCG@20 increased from 0.401 to 0.428 on the fixed validation set" \
114
+ --next-step "Repeat with three random seeds"
115
+ ```
116
+
117
+ Use the actual ID printed by `research new`; `run-001` is only an example. Full walkthroughs: [CLI](docs/en/cli.md) · [Python API](docs/en/python-api.md).
118
+
119
+ ## Interfaces
120
+
121
+ ### Command line
122
+
123
+ ```bash
124
+ research --help
125
+ research new --help
126
+ research status
127
+ research previous --limit 10
128
+ research resume run-001
129
+ research finish run-001 --conclusion "..." --next-step "..."
130
+ research check
131
+ ```
132
+
133
+ The CLI defaults to `.research/`. Pass `--base-path /path/to/research-data` before the subcommand to use another directory.
134
+
135
+ ### Python API
136
+
137
+ ```python
138
+ from remgu import Experiment, Motivation, Run, ExampleProvider, TopKSelector
139
+ ```
140
+
141
+ - `Experiment` opens the active run or creates one programmatically.
142
+ - `Run` tracks execution state and writes parameters, metrics, and diagnostic records.
143
+ - `Motivation` describes why a hypothesis is being tested.
144
+ - `TopKSelector` keeps the highest- or lowest-scoring diagnostic records in bounded memory.
145
+ - `ExampleSelector` merges named selection criteria and annotates why each example was selected.
146
+ - `ExampleProvider` defines how a stored example ID can be resolved to source data and a readable description.
147
+
148
+ See the [API guide](docs/en/python-api.md) for signatures and complete examples.
149
+
150
+ ## Design principles
151
+
152
+ - **Research context stays with the run.** A run stores its hypothesis and motivation, not just a metric dump.
153
+ - **Ordinary training scripts stay ordinary.** ReMgu wraps the code you already run; it does not require a new training framework.
154
+ - **Files are the source of truth.** YAML, CSV, and JSONL are human-readable and easy to version or inspect.
155
+ - **Execution and review are separate.** A successful process is not the same thing as a scientifically reviewed result.
156
+ - **Checks are read-only.** `research check` reports problems without repairing or rewriting run records.
157
+
158
+ ## Documentation
159
+
160
+ - [CLI workflows](docs/en/cli.md)
161
+ - [Python API](docs/en/python-api.md)
162
+ - [Consistency checks](docs/en/consistency-check.md)
163
+ - [On-disk data format](docs/en/data-format.md)
164
+ - [Architecture and boundaries](docs/en/architecture.md)
165
+ - [Russian documentation](README.ru.md)
166
+
167
+ ## Development status
168
+
169
+ ReMgu is an evolving research tool. The current implementation is intentionally file-based and small. The documentation describes the implementation in this repository; future knowledge management, publication, and agent features are explicitly out of scope until implemented.
170
+
171
+ ## Attribution and license
172
+
173
+ Copyright 2026 Mstislav Maslennikov. Developed and maintained by Mstislav Maslennikov. Licensed under [Apache License 2.0](LICENSE).
174
+
175
+ Originally developed to support research work of students at the Open Information Technologies Laboratory, Faculty of Computational Mathematics and Cybernetics, Lomonosov Moscow State University. It is maintained as an independent research software project.
@@ -0,0 +1,49 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "remgu"
7
+ version = "0.1.0"
8
+ description = "Experiment lifecycle management for reproducible ML research"
9
+ readme = { file = "README.md", content-type = "text/markdown" }
10
+ requires-python = ">=3.10"
11
+ license = "Apache-2.0"
12
+ authors = [
13
+ { name = "Mstislav Maslennikov", email = "ml.arch@inbox.ru" },
14
+ ]
15
+ maintainers = [
16
+ { name = "Mstislav Maslennikov", email = "ml.arch@inbox.ru" },
17
+ ]
18
+ keywords = ["machine-learning", "research", "experiments", "reproducibility", "ml-research"]
19
+ classifiers = [
20
+ "Development Status :: 3 - Alpha",
21
+ "Intended Audience :: Science/Research",
22
+ "Operating System :: OS Independent",
23
+ "Programming Language :: Python :: 3",
24
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
25
+ ]
26
+ dependencies = ["PyYAML>=6.0"]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/graph-ml-research/remgu"
30
+ Repository = "https://github.com/graph-ml-research/remgu"
31
+ Issues = "https://github.com/graph-ml-research/remgu/issues"
32
+ Documentation = "https://github.com/graph-ml-research/remgu#readme"
33
+
34
+ [project.scripts]
35
+ research = "remgu.research_cli:main"
36
+
37
+ [dependency-groups]
38
+ dev = [
39
+ "build>=1.2",
40
+ "pytest>=8.0",
41
+ "twine>=6.0",
42
+ ]
43
+
44
+ [tool.setuptools.packages.find]
45
+ where = ["src"]
46
+
47
+ [tool.pytest.ini_options]
48
+ testpaths = ["tests"]
49
+ addopts = "-ra"
remgu-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,15 @@
1
+ # Copyright 2026 Mstislav Maslennikov
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ from .experiment import Experiment
4
+ from .models import Motivation
5
+ from .run import Run
6
+
7
+
8
+
9
+ __all__ = ["Experiment", "Motivation", "Run"]
10
+
11
+
12
+ from remgu.example.example_provider import ExampleProvider
13
+ from remgu.example.example_selector import ExampleSelector, TopKSelector
14
+
15
+ __all__ += ["ExampleProvider", "ExampleSelector", "TopKSelector"]
@@ -0,0 +1,9 @@
1
+ # Copyright 2026 Mstislav Maslennikov
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ """Read-only research-record consistency checks."""
4
+
5
+ from .consistency_issue import ConsistencyIssue
6
+ from .consistency_report import ConsistencyReport
7
+ from .research_checker import ResearchChecker
8
+
9
+ __all__ = ["ConsistencyIssue", "ConsistencyReport", "ResearchChecker"]