ever-research 0.2.0__py3-none-any.whl

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 (50) hide show
  1. ever_research-0.2.0.dist-info/METADATA +191 -0
  2. ever_research-0.2.0.dist-info/RECORD +50 -0
  3. ever_research-0.2.0.dist-info/WHEEL +5 -0
  4. ever_research-0.2.0.dist-info/entry_points.txt +2 -0
  5. ever_research-0.2.0.dist-info/licenses/LICENSE +202 -0
  6. ever_research-0.2.0.dist-info/top_level.txt +1 -0
  7. harness/__init__.py +9 -0
  8. harness/central.py +148 -0
  9. harness/cli.py +33 -0
  10. harness/core/README.md +68 -0
  11. harness/core/__init__.py +0 -0
  12. harness/core/check.py +74 -0
  13. harness/core/experiment.py +180 -0
  14. harness/core/layout.py +305 -0
  15. harness/core/naming.py +81 -0
  16. harness/core/project.py +213 -0
  17. harness/core/test_project_experiment.py +184 -0
  18. harness/core/test_project_layout.py +173 -0
  19. harness/core/test_project_structure.py +146 -0
  20. harness/core/workspace.py +81 -0
  21. harness/distribution.py +245 -0
  22. harness/mcp.py +52 -0
  23. harness/projects/README.md +489 -0
  24. harness/projects/__init__.py +4 -0
  25. harness/projects/maintenance.py +157 -0
  26. harness/projects/manage.py +650 -0
  27. harness/projects/operations.md +147 -0
  28. harness/projects/researchharness.skill.md.in +21 -0
  29. harness/projects/resources.py +143 -0
  30. harness/projects/standalone/agents.md +17 -0
  31. harness/projects/standalone/maintain.py +104 -0
  32. harness/projects/standalone/offline/check.py +102 -0
  33. harness/projects/standalone/offline/operations.md +107 -0
  34. harness/projects/structure.py +76 -0
  35. harness/projects/test_project_operations.py +280 -0
  36. harness/public_resources.zip +0 -0
  37. harness/utils/__init__.py +39 -0
  38. harness/utils/compare.py +65 -0
  39. harness/utils/limits.py +168 -0
  40. harness/utils/packages.py +37 -0
  41. harness/utils/probe.py +210 -0
  42. harness/utils/release/__init__.py +385 -0
  43. harness/utils/release/rh.py +98 -0
  44. harness/utils/release/verify.py +163 -0
  45. harness/utils/test_environment_limits.py +262 -0
  46. harness/utils/transfer/README.md +224 -0
  47. harness/utils/transfer/__init__.py +25 -0
  48. harness/utils/transfer/archive.py +354 -0
  49. harness/utils/transfer/b2.py +313 -0
  50. harness/utils/transfer/test_transfer.py +510 -0
@@ -0,0 +1,191 @@
1
+ Metadata-Version: 2.4
2
+ Name: ever-research
3
+ Version: 0.2.0
4
+ Summary: Local research project bindings, shared skills, and utilities
5
+ License-Expression: Apache-2.0
6
+ Requires-Python: <3.13,>=3.11
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: PyYAML<7,>=6
10
+ Requires-Dist: pyspellchecker<1,>=0.9
11
+ Requires-Dist: filelock<4,>=3.16
12
+ Requires-Dist: platformdirs<5,>=4
13
+ Provides-Extra: dev
14
+ Requires-Dist: pytest>=7; extra == "dev"
15
+ Requires-Dist: build>=1.2; extra == "dev"
16
+ Requires-Dist: ruff==0.15.22; extra == "dev"
17
+ Provides-Extra: mcp
18
+ Requires-Dist: mcp<2,>=1.9; extra == "mcp"
19
+ Dynamic: license-file
20
+
21
+ [English](README.md) | [中文](README.zh-CN.md)
22
+
23
+ # EverResearch
24
+
25
+ **Less time managing research code. More time doing research.**
26
+
27
+ Research projects grow messy. Scripts pile up, configurations drift, datasets move, and experiment results become hard to trace.
28
+
29
+ EverResearch helps you and your coding agent keep research projects organized, maintainable, and reproducible.
30
+
31
+ ## Purpose and main function
32
+
33
+ - **Organize your research.** Keep datasets, models, tasks, configurations, and experiments in a consistent structure.
34
+ - **Maintain projects with AI.** Let your coding agent understand and maintain your project instead of fixing files one by one.
35
+ - **Make experiments traceable.** Keep configurations, execution records, and results connected.
36
+ - **Catch problems early.** Check project structure and experiment records before small inconsistencies become bigger problems.
37
+ - **Reuse what works.** Apply the same research maintenance workflows across different projects.
38
+
39
+ ## Scope of application
40
+
41
+ **Start from scratch or bring your existing code.**
42
+
43
+ Whether you're building a new research project or cleaning up an existing codebase, EverResearch helps your coding agent organize it into a consistent structure.
44
+
45
+ ```text
46
+ YourProject/
47
+ ├── base/ # Shared code and execution
48
+ ├── datasets/ # Data loading and processing
49
+ ├── models/ # Model implementations
50
+ ├── tasks/ # Training, evaluation, and analysis
51
+ ├── conf/ # Experiment configurations
52
+ ├── experiment/ # Experiment records and results
53
+ ├── scripts/ # Standalone utilities
54
+ ├── tests/ # Tests and checks
55
+ └── doc/ # Project documentation
56
+ ```
57
+
58
+ Each component has a clear responsibility, making it easier for agents to understand, modify, and extend your research without losing track of how everything fits together.
59
+
60
+ **EverResearch keeps code and results reusable, readable, and traceable throughout agent-driven development.**
61
+
62
+ As your project evolves, shared maintenance workflows help keep its structure, configurations, and experiment records consistent.
63
+
64
+ ## See It in Action
65
+
66
+ **From scattered research code to an organized, maintainable project.**
67
+
68
+ **Before EverResearch**
69
+
70
+ - Scripts and configurations scattered across folders
71
+ - Dataset paths tied to individual machines
72
+ - Experiments difficult to track or revisit
73
+ - Every new project requires another round of cleanup
74
+
75
+ **With EverResearch**
76
+
77
+ - Consistent project organization
78
+ - Reusable workflows for your coding agent
79
+ - Local data and environments connected to each project
80
+ - Structured experiment records and checks
81
+
82
+ *A real project walkthrough will show the workflow from project inspection to organized code and reviewable results.*
83
+
84
+ ## Install
85
+
86
+ **Use an agent plugin.** Choose your platform and follow its installation
87
+ entry. The plugin includes the `rh` command and prepares its own Python
88
+ environment on first use.
89
+
90
+ | Platform | Installation and first check |
91
+ | --- | --- |
92
+ | Codex | [Codex](https://github.com/OpenSAE/EverResearch/tree/main/plugins/codex-plugin) |
93
+ | Claude | [Claude Code, Cowork and web](https://github.com/OpenSAE/EverResearch/tree/main/plugins/claude-plugin) |
94
+ | Cursor | [Cursor](https://github.com/OpenSAE/EverResearch/tree/main/plugins/cursor-plugin) |
95
+ | GitHub Copilot CLI, Qwen Code, Skills CLI | [Agent Plugin](https://github.com/OpenSAE/EverResearch/tree/main/plugins/agent-plugin) |
96
+ | Gemini CLI | [Gemini extension](https://github.com/OpenSAE/EverResearch/tree/main/plugins/gemini-extension) |
97
+ | OpenCode | [OpenCode](https://github.com/OpenSAE/EverResearch/tree/main/plugins/opencode) |
98
+ | OpenClaw | [OpenClaw](https://github.com/OpenSAE/EverResearch/tree/main/plugins/openclaw) |
99
+ | DeepSeek Harness | [DeepSeek Harness](https://github.com/OpenSAE/EverResearch/tree/main/plugins/deepseek) |
100
+ | Shell and other agents | [Terminal and npm installer](https://github.com/OpenSAE/EverResearch/tree/main/plugins/installer) |
101
+
102
+ **Use the terminal.** Install OpenSAE's Python wheel directly from GitHub:
103
+
104
+ ```bash
105
+ uv tool install https://raw.githubusercontent.com/OpenSAE/EverResearch/main/plugins/installer/ever_research-0.2.0-py3-none-any.whl
106
+ rh doctor --json
107
+ rh projects project check ./MyProject
108
+ ```
109
+
110
+ To install the CLI and add project-local skills in one step, run this from your
111
+ project directory:
112
+
113
+ ```bash
114
+ npm exec --yes --package=https://raw.githubusercontent.com/OpenSAE/EverResearch/main/plugins/installer/opensae-ever-research-0.2.0.tgz -- ever-research
115
+ ```
116
+
117
+ Choose an agent explicitly with `--agent codex`, or install the complete skill
118
+ set with the Skills CLI:
119
+
120
+ ```bash
121
+ npx --yes skills add https://github.com/OpenSAE/EverResearch/tree/main/plugins/agent-plugin --all -y
122
+ ```
123
+
124
+ Then ask the agent to inspect your research project's directory structure and
125
+ tell you what it verified. File-only environments can review available files.
126
+ Automated checks run where the project and Python are accessible.
127
+
128
+ For development, use `uv pip install -e .` in an active environment. See the
129
+ [build and verification guide](src/harness/utils/release/README.md) for source
130
+ builds, the BirdStudy example, and optional MCP access.
131
+
132
+ ### One Skill to Coordinate Your Research
133
+
134
+ **`maintain-project` is the central coordinator of EverResearch.**
135
+
136
+ It guides your coding agent through the entire project, coordinating specialized skills for each component:
137
+
138
+ | Skill | What it manages |
139
+ | --- | --- |
140
+ | [`maintain-dataset`](.agents/skills/maintain-dataset/SKILL.md) | Datasets, preprocessing, and data loading |
141
+ | [`maintain-model`](.agents/skills/maintain-model/SKILL.md) | Model implementations and variants |
142
+ | [`maintain-task`](.agents/skills/maintain-task/SKILL.md) | Training, evaluation, and research tasks |
143
+ | [`maintain-conf`](.agents/skills/maintain-conf/SKILL.md) | Configurations and parameters |
144
+ | [`maintain-experiment`](.agents/skills/maintain-experiment/SKILL.md) | Experiment execution and result records |
145
+ | [`maintain-base`](.agents/skills/maintain-base/SKILL.md) | Shared code and execution workflows |
146
+
147
+ You don't need to manage every component separately. Start with [`maintain-project`](.agents/skills/maintain-project/SKILL.md) for project-wide work, or use a specialized skill when you want to focus on one part.
148
+
149
+ As your research evolves, the same workflows help keep your code organized and your results traceable.
150
+
151
+ ### Keep maintenance consistent
152
+
153
+ The managed section of each connected project's `AGENTS.md` links to [14 operation guides](src/harness/projects/operations.md). Each guide explains how to choose the right destination, carry out the change, and check the result. Run `rh projects apply <project-id>` again to refresh an existing connection.
154
+
155
+ For repeat structure checks, use `rh projects maintenance <project-root>`. It records changes and previous checks in the local EverResearch workspace. Unchanged files reuse cached findings, so subsequent checks can focus on changes.
156
+
157
+ Enable lightweight follow-up checks for a connected project with `rh projects apply <project-id> --lightweight-checks on`.
158
+
159
+ ## Built for Everyday Research
160
+
161
+ Whether you're starting a new experiment, adding a dataset, switching models, or returning to an old project, EverResearch gives you a consistent way to keep your research code under control.
162
+
163
+ **Your research keeps moving. Your codebase should keep up.**
164
+
165
+ ## Achievements
166
+
167
+ The release ships the CUB-200 example. EverResearch has also used the following public projects to illustrate the same structure for configuration, datasets, models, and tasks.
168
+
169
+ | Template | Files | Publication checks passed |
170
+ | --- | ---: | ---: |
171
+ | CUB-200 | 60 | 100% |
172
+ | [Depth Anything 3](https://github.com/ByteDance-Seed/Depth-Anything-3) | 144 | 100% |
173
+ | [FastVLM](https://github.com/apple-aiml-research/ml-fastvlm) | 111 | 100% |
174
+ | [FlagEmbedding](https://github.com/FlagOpen/FlagEmbedding) | 896 | 100% |
175
+ | [LightEval](https://github.com/huggingface/lighteval) | 465 | 100% |
176
+ | [LLMLingua](https://github.com/microsoft/LLMLingua) | 108 | 100% |
177
+ | [RF-DETR](https://github.com/roboflow/rf-detr) | 604 | 100% |
178
+ | [SAM2](https://github.com/facebookresearch/sam2) | 382 | 100% |
179
+ | [VGGT](https://github.com/facebookresearch/vggt) | 137 | 100% |
180
+
181
+ Publication checks cover required directories, a README, file scope, Python syntax, and notebook outputs. File counts cover the published template contents.
182
+
183
+ ## Future Development
184
+
185
+ - **Long-Horizon Research** — Set ambitious research goals and let AI agents autonomously plan, execute, and refine research workflows.
186
+ - **Knowledge Interface** — Help AI agents understand scientific concepts, reason with domain knowledge, and actively contribute to research discussions and paper writing.
187
+ - **Research RSI** — Enable AI agents to progressively improve their research capabilities through domain knowledge, experimental feedback, and human supervision.
188
+
189
+ ## License
190
+
191
+ [Apache 2.0](LICENSE)
@@ -0,0 +1,50 @@
1
+ ever_research-0.2.0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
2
+ harness/__init__.py,sha256=kRfQZ3MkwPBDYyv8rhS9qEAq1y0cx27LxGfFLOZtZeE,271
3
+ harness/central.py,sha256=j70bHNXdniIX5-Pl7mWCfMVU66hk_pYmmq5rrTFBezc,6112
4
+ harness/cli.py,sha256=U76MKlZ7Py_uE5WD9-vt4w7xgg_liKb_7sVMPfi3gA4,1117
5
+ harness/distribution.py,sha256=Di3jm9MlSa-UzDXIdLQBcuOsj28I3ek-fxlfgVUTA1o,10517
6
+ harness/mcp.py,sha256=oEVPg0Gf-A1ks2aCs9i__bjw5pQrap0nRgd7-kQz1BM,1847
7
+ harness/public_resources.zip,sha256=BR43x8O-NgHQw5Y2aXH52bXerU9Ko96NelbJjCJ_u6c,553342
8
+ harness/core/README.md,sha256=H9kcIK_jfd7GctWGbz-aWXmufAOaHANgIw2u2kFdDlg,8598
9
+ harness/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
+ harness/core/check.py,sha256=CgqrlBAIaVBMVHzrbSQpKDO3yENGJswAZdQBoSOwBak,3886
11
+ harness/core/experiment.py,sha256=z8xKnkm6PBZ1xHNd_VbBjiXialI_B7MTJJRezlx-Eus,8351
12
+ harness/core/layout.py,sha256=FXi1NzeESxhW6-UD4ZPxr5VsFsVP7FBeZbEbyXoSAd0,14444
13
+ harness/core/naming.py,sha256=_6Rx4rYjTO0t5aKsy7gRFkeMiSeA3OK2kiJ-J2GwEk8,3414
14
+ harness/core/project.py,sha256=ZfUiz1MZN_QwbvRa_OVkJ8rwFM6vXDTco4WYamqCiCg,9009
15
+ harness/core/test_project_experiment.py,sha256=frLCVIZhA-3uxksDplrtwk2-eo1kKKcIPjW5p6Wz46s,7585
16
+ harness/core/test_project_layout.py,sha256=MlTcHP0keezoY8Ios8V4dOAplbljJZDLb1x8y2iRemw,7232
17
+ harness/core/test_project_structure.py,sha256=71LyUcR5TVzq5kTqUrwb-9U7f8N-65a-mw407tLnFBw,7098
18
+ harness/core/workspace.py,sha256=1eioixM1c86q_b9sjW5c8AcCGLSGWhHXStsl0AjHrRI,3094
19
+ harness/projects/README.md,sha256=54W0lkXEm6aRBf2m6xzS-mlXlzdIkSspCDRAv__QVGc,70529
20
+ harness/projects/__init__.py,sha256=s-8_Hvuht3QCmpgQ7VOicpV0Oc0DhezxVZRe7czhYdc,235
21
+ harness/projects/maintenance.py,sha256=oUbFOkA1oku3P5PnmipIIzwH7bQG5cCPCVe3sY7-ZxM,6647
22
+ harness/projects/manage.py,sha256=CX-o8OWVAYts8Hdtk3r-EVOIrRlsiArfi4uvrUZRmC0,35887
23
+ harness/projects/operations.md,sha256=2NJaPnCP10_8Gxd7AoN8tSBWbCSC8Mo8Azalt-7HPzU,20772
24
+ harness/projects/researchharness.skill.md.in,sha256=UJepM7zNj-YB9gXm082A5g0L6DauK-17o6e_zVva3zM,1937
25
+ harness/projects/resources.py,sha256=F7a53Ckn2YRvuTDXpBVjEZxtSoaMSuQNDuq90LG1K3A,6465
26
+ harness/projects/structure.py,sha256=AUqj1F3haqnx8tGvHDeOR6vY4eUNipccCTqPPnS3tXk,3331
27
+ harness/projects/test_project_operations.py,sha256=zx_Ivggzp7_cjmJ7yQN8gShwfZnE1rbCg2LV9-yO-K8,13244
28
+ harness/projects/standalone/agents.md,sha256=FFjzqank8Vm6hC4ZKhN3BfMitDFqqG8C8JlwGAwszr0,1561
29
+ harness/projects/standalone/maintain.py,sha256=Vkl7khYtoh_x2YXrEEv6QqSOUueGPHdzsSPfDbvucmw,4191
30
+ harness/projects/standalone/offline/check.py,sha256=No3bPNXd1sgO489SMifz98BvbMSG989Nl718UWyt6bM,3993
31
+ harness/projects/standalone/offline/operations.md,sha256=b4t2n0fvovQ7FQdp4OJNP2peaFxwbuY6VLLV4gOWzwY,8962
32
+ harness/utils/__init__.py,sha256=EUiUmhNC5KdIiHWpWCtOeJNGatbEcv19FQ7lRTrbZDU,1173
33
+ harness/utils/compare.py,sha256=SlvqN7fxKILzw53f-_EmrzWwVrVtTJF4eHlKQyL79nw,2096
34
+ harness/utils/limits.py,sha256=uzS6xADnZoV8vGGMWXZrWYrF3R8_wlCHi94ATw3ZX5o,7345
35
+ harness/utils/packages.py,sha256=JWQFoDhMd1lNP-20YQ29xzfqBlt-us995I-FAEPYV5A,941
36
+ harness/utils/probe.py,sha256=hc52O9EGdARf_C-yTO-LD_XkeG-kRnSQBExfcQaP8z8,7721
37
+ harness/utils/test_environment_limits.py,sha256=Ssy3-lIlXIDuGh1CxOnOLluBI27vY9JHfkqGE7x0_rY,11584
38
+ harness/utils/release/__init__.py,sha256=ea6iU6D_-OFPJdRJFcGrE3zf6mElWTFVoZVopM1xYTA,19415
39
+ harness/utils/release/rh.py,sha256=zRFUH7YkRJONq2umu_0K7Q_sJ8AxxkSL_vAIj40751M,3841
40
+ harness/utils/release/verify.py,sha256=X27PXxzTqGsIBl5pbFbDrE1MXQtyKfZjIjwdXDeWsUs,8132
41
+ harness/utils/transfer/README.md,sha256=LYq4VF3l_HL_mIEcqDYbnvAyU9krz56stgc_6lKAe8g,16573
42
+ harness/utils/transfer/__init__.py,sha256=ug5evsQCSh5LkuVnvF-D51tq_0PAayzcDpWapme9M50,911
43
+ harness/utils/transfer/archive.py,sha256=HcimpDczaNPAsFFvPTSiBTjXmKybXwplB8saWZ57dYs,15759
44
+ harness/utils/transfer/b2.py,sha256=Euhr4PZtVh7shkYOP4e42r2PgwACJFouQhcaLg4_nxA,13686
45
+ harness/utils/transfer/test_transfer.py,sha256=CQC5tACuWOuJgaqjXSjPFhbr4Hpmjjr63jvrUcaJlts,19336
46
+ ever_research-0.2.0.dist-info/METADATA,sha256=4c7cIntF-WwTnVOUwUwA82IOc5SzbFIQVI57lXY-qK8,9547
47
+ ever_research-0.2.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
48
+ ever_research-0.2.0.dist-info/entry_points.txt,sha256=4hXsjDaNRSCIeAm8qlkfbCAUWm5Ub8k81mjKfSBqVRA,40
49
+ ever_research-0.2.0.dist-info/top_level.txt,sha256=x-rLjMrbemUK1OrGmsoti7tX11nXhe4H3jJSbXppyT8,8
50
+ ever_research-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ rh = harness.cli:main
@@ -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.
@@ -0,0 +1 @@
1
+ harness
harness/__init__.py ADDED
@@ -0,0 +1,9 @@
1
+ """Provision ResearchHarness Workspace entrance and type of project error.
2
+
3
+ For central project access and tool call.
4
+ """
5
+
6
+ from .central import HarnessContext, ProjectError, load_harness
7
+
8
+ __version__ = "0.2.0"
9
+ __all__ = ["HarnessContext", "ProjectError", "load_harness"]
harness/central.py ADDED
@@ -0,0 +1,148 @@
1
+ """Position central workspace, connect registered items and save the current source path.
2
+
3
+ For project access, resource selection and structural results search. Path binding is stored in the machine working area..
4
+ """
5
+
6
+ from dataclasses import dataclass
7
+ from hashlib import sha256
8
+ from importlib.resources import files
9
+ from io import BytesIO
10
+ import json
11
+ import os
12
+ from pathlib import Path
13
+ import re
14
+ from tempfile import TemporaryDirectory
15
+ from zipfile import ZipFile
16
+
17
+ from platformdirs import user_cache_path, user_data_path, user_state_path
18
+
19
+ from .core.workspace import save, update_lock
20
+
21
+
22
+ class ProjectError(ValueError):
23
+ """The project, resources or in-house registration is not operational."""
24
+
25
+
26
+ def identity(value: str) -> str:
27
+ if not isinstance(value, str) or not re.fullmatch(r"[a-z0-9][a-z0-9_-]{0,79}", value):
28
+ raise ProjectError(f"Invalid item or resource identifier:{value!r}")
29
+ return value
30
+
31
+
32
+ @dataclass(frozen=True)
33
+ class HarnessContext:
34
+ root: Path
35
+ state: Path | None = None
36
+
37
+ @property
38
+ def workspace(self) -> Path:
39
+ return self.root.parent if self.state is None else self.state
40
+
41
+ @property
42
+ def state_root(self) -> Path:
43
+ return self.root if self.state is None else self.state
44
+
45
+ @property
46
+ def data_root(self) -> Path:
47
+ if self.state is None:
48
+ return self.workspace / "data"
49
+ override = os.environ.get("RH_DATA_ROOT")
50
+ return Path(override).expanduser().absolute() if override else user_data_path("researchharness") / "data"
51
+
52
+ def store_path(self, path: Path) -> str:
53
+ workspace = self.workspace
54
+ if path.is_relative_to(workspace):
55
+ return path.relative_to(workspace).as_posix()
56
+ return str(path)
57
+
58
+ def bound_path(self, value: str) -> Path:
59
+ path = Path(value).expanduser()
60
+ if path.is_absolute():
61
+ return path
62
+ if ".." in path.parts:
63
+ raise ProjectError(f"Relative bind paths beyond workspace:{value}")
64
+ return self.workspace / path
65
+
66
+ def resolve(self, relative: str, *, exists: bool = False) -> Path:
67
+ requested = Path(relative)
68
+ writable = requested.parts[:1] == (".workspace",) or requested.parts[:2] == ("src", "project")
69
+ base = self.state_root if writable else self.root
70
+ path = (base / requested).resolve()
71
+ if requested.is_absolute() or ".." in requested.parts or not path.is_relative_to(base):
72
+ raise ProjectError(f"The path goes beyond the central working area.:{relative}")
73
+ if exists and not path.exists():
74
+ raise ProjectError(f"Central file not found:{relative}")
75
+ return path
76
+
77
+ def bindings(self) -> dict:
78
+ path = self.resolve(".workspace/harness/core/central/project_roots.json")
79
+ return json.loads(path.read_text(encoding="utf-8")) if path.exists() else {}
80
+
81
+ def project_root(self, project_id: str) -> Path:
82
+ raw = self.bindings().get(identity(project_id))
83
+ if raw is None:
84
+ raise ProjectError(f"Project has not bound the path of the machine:{project_id}")
85
+ return self.source_directory(self.bound_path(raw))
86
+
87
+ def project_record(self, project_id: str, filename: str | None = None) -> Path:
88
+ """Locate the local record, including an existing record from the old layout."""
89
+ name = identity(project_id)
90
+ current = self.resolve(f"src/project/maintained/{name}")
91
+ if not current.exists() and name != "maintained":
92
+ legacy = self.resolve(f"src/project/{name}")
93
+ if legacy.is_dir():
94
+ current = legacy
95
+ if filename is None:
96
+ return current
97
+ return self.resolve((current / filename).relative_to(self.state_root).as_posix())
98
+
99
+ def source_directory(self, value: str | Path) -> Path:
100
+ path = Path(value).expanduser().resolve(strict=True)
101
+ if not path.is_dir() or path == self.root:
102
+ raise ProjectError(f"The project path should point to a separate source directory:{path}")
103
+ return path
104
+
105
+ def register(self, project_id: str, source: str) -> Path:
106
+ project_id = identity(project_id)
107
+ path = self.source_directory(source)
108
+ target = self.resolve(".workspace/harness/core/central/project_roots.json")
109
+ with update_lock(target):
110
+ bindings = self.bindings()
111
+ for name, bound in bindings.items():
112
+ if name != project_id and self.bound_path(bound).resolve() == path:
113
+ raise ProjectError(f"This directory has been bound to the item. {name}")
114
+ bindings[project_id] = self.store_path(path)
115
+ save(target, bindings, source=__file__)
116
+ return path
117
+
118
+
119
+ def load_harness(root: str | Path | None = None) -> HarnessContext:
120
+ if root is None:
121
+ checkout = Path(__file__).resolve().parents[2]
122
+ if not (checkout / ".agents/skills").is_dir():
123
+ state = Path(os.environ.get("RH_STATE_DIR") or user_state_path("researchharness"))
124
+ return HarnessContext(installed_resources(), state.expanduser().resolve())
125
+ root = checkout
126
+ context = HarnessContext(Path(root).expanduser().resolve(strict=True))
127
+ context.resolve(".agents/skills", exists=True)
128
+ return context
129
+
130
+
131
+ def installed_resources() -> Path:
132
+ """Materialize versioned resources so tools and agents can open real file paths."""
133
+ archive = files("harness").joinpath("public_resources.zip")
134
+ if not archive.is_file():
135
+ raise ProjectError("Install a ResearchHarness release wheel or supply --harness-root")
136
+ content = archive.read_bytes()
137
+ cache = user_cache_path("researchharness").resolve()
138
+ root = cache / ("resources-" + sha256(content).hexdigest())
139
+ if root.is_dir():
140
+ return root
141
+ with update_lock(root):
142
+ if not root.is_dir():
143
+ with TemporaryDirectory(dir=cache) as temporary:
144
+ destination = Path(temporary) / "resources"
145
+ with ZipFile(BytesIO(content)) as bundle:
146
+ bundle.extractall(destination)
147
+ destination.replace(root)
148
+ return root
harness/cli.py ADDED
@@ -0,0 +1,33 @@
1
+ """Command entry for project access, binding of in-house resources, review of structural results and independent tools.
2
+
3
+ Local operation for visible selection of items and workspaces.
4
+ """
5
+
6
+ import sys
7
+
8
+ from .projects.manage import main as projects_main
9
+
10
+
11
+ def main(argv=None):
12
+ arguments = list(sys.argv[1:] if argv is None else argv)
13
+ if arguments[:1] == ["projects"]:
14
+ return projects_main(arguments[1:])
15
+ if arguments[:1] == ["utils"]:
16
+ from .utils import main as utils_main
17
+
18
+ return utils_main(arguments[1:])
19
+ if arguments and arguments[0] in {"doctor", "guide", "skills"}:
20
+ from .distribution import main as distribution_main
21
+
22
+ return distribution_main(arguments[0], arguments[1:])
23
+ if arguments[:1] == ["mcp"]:
24
+ from .mcp import main as mcp_main
25
+
26
+ return mcp_main(arguments[1:])
27
+ stream = sys.stdout if not arguments or arguments == ["--help"] else sys.stderr
28
+ print("Usage: rh {projects,utils,doctor,guide,skills,mcp} --help", file=stream)
29
+ return 0 if stream is sys.stdout else 2
30
+
31
+
32
+ if __name__ == "__main__":
33
+ raise SystemExit(main())