benchside 0.4.1__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.
- benchside/__init__.py +1 -0
- benchside/_content/app/SKILL.md +155 -0
- benchside/_content/app/references/app-api.md +261 -0
- benchside/_content/app/references/generic-agents.md +69 -0
- benchside/_content/app/references/metascience.md +346 -0
- benchside/_content/app/references/native-memory.md +429 -0
- benchside/_content/app/references/onboarding.md +313 -0
- benchside/_content/app/references/sharing.md +159 -0
- benchside/_content/app/scripts/benchside_app.py +311 -0
- benchside/_content/app-requirements.txt +197 -0
- benchside/_content/claude/bench-init/SKILL.md +37 -0
- benchside/_content/claude/bench-share/SKILL.md +44 -0
- benchside/_content/fixtures/.gitkeep +0 -0
- benchside/_content/legacy-skill-digests.json +26 -0
- benchside/_content/personas/journal-club.yaml +45 -0
- benchside/_content/personas/methods-clinic.yaml +49 -0
- benchside/_content/personas/peer-review.yaml +45 -0
- benchside/_content/personas/pi-hypothesis.yaml +121 -0
- benchside/_content/personas/pi.yaml +87 -0
- benchside/_content/personas/repro-check.yaml +45 -0
- benchside/_content/personas/results-meeting.yaml +46 -0
- benchside/_content/personas/study-design.yaml +50 -0
- benchside/_content/templates/app-role.md.tmpl +31 -0
- benchside/_content/templates/blocks/capture-contract.md +40 -0
- benchside/_content/templates/blocks/sovereignty.md +36 -0
- benchside/_content/templates/skill.md.tmpl +54 -0
- benchside/application/__init__.py +0 -0
- benchside/application/app.py +458 -0
- benchside/application/bridge.py +55 -0
- benchside/application/contributions.py +39 -0
- benchside/application/di.py +35 -0
- benchside/application/metascience.py +671 -0
- benchside/application/native.py +1088 -0
- benchside/application/packaging.py +19 -0
- benchside/application/sharing.py +439 -0
- benchside/application/submission_failures.py +28 -0
- benchside/cli/__init__.py +0 -0
- benchside/cli/hooks.py +159 -0
- benchside/cli/install.py +276 -0
- benchside/cli/journal.py +232 -0
- benchside/cli/main.py +761 -0
- benchside/cli/runtime.py +245 -0
- benchside/cli/sharing.py +66 -0
- benchside/cli/ui/__init__.py +5 -0
- benchside/cli/ui/_glyphs.py +21 -0
- benchside/cli/ui/_model.py +66 -0
- benchside/cli/ui/_renderer.py +110 -0
- benchside/cli/ui/_rich.py +75 -0
- benchside/config.py +122 -0
- benchside/domain/__init__.py +0 -0
- benchside/domain/authoring/__init__.py +0 -0
- benchside/domain/authoring/command/__init__.py +0 -0
- benchside/domain/authoring/command/compile.py +28 -0
- benchside/domain/authoring/model/__init__.py +0 -0
- benchside/domain/authoring/model/flow.py +27 -0
- benchside/domain/authoring/model/persona.py +56 -0
- benchside/domain/authoring/model/skill.py +32 -0
- benchside/domain/authoring/model/value.py +42 -0
- benchside/domain/authoring/port/__init__.py +5 -0
- benchside/domain/authoring/port/renderer.py +17 -0
- benchside/domain/authoring/port/repository.py +28 -0
- benchside/domain/authoring/port/skill_writer.py +19 -0
- benchside/domain/authoring/query/__init__.py +0 -0
- benchside/domain/authoring/query/get_persona.py +30 -0
- benchside/domain/authoring/query/list_personas.py +21 -0
- benchside/domain/authoring/service/__init__.py +0 -0
- benchside/domain/authoring/service/authoring.py +99 -0
- benchside/domain/authoring/util/__init__.py +0 -0
- benchside/domain/authoring/util/di/__init__.py +3 -0
- benchside/domain/authoring/util/di/provider.py +15 -0
- benchside/domain/consultation/__init__.py +0 -0
- benchside/domain/consultation/command/__init__.py +0 -0
- benchside/domain/consultation/command/capture_gap.py +28 -0
- benchside/domain/consultation/command/close.py +29 -0
- benchside/domain/consultation/command/open.py +36 -0
- benchside/domain/consultation/command/raise_critique.py +30 -0
- benchside/domain/consultation/command/record_decision.py +30 -0
- benchside/domain/consultation/command/resolve_critique.py +32 -0
- benchside/domain/consultation/command/state_hypothesis.py +28 -0
- benchside/domain/consultation/event/__init__.py +22 -0
- benchside/domain/consultation/event/closed.py +13 -0
- benchside/domain/consultation/event/critique_raised.py +12 -0
- benchside/domain/consultation/event/critique_resolved.py +12 -0
- benchside/domain/consultation/event/decision_recorded.py +13 -0
- benchside/domain/consultation/event/gap_observed.py +16 -0
- benchside/domain/consultation/event/hypothesis_stated.py +12 -0
- benchside/domain/consultation/event/opened.py +23 -0
- benchside/domain/consultation/event/question.py +16 -0
- benchside/domain/consultation/event/research_recorded.py +9 -0
- benchside/domain/consultation/model/__init__.py +0 -0
- benchside/domain/consultation/model/consultation.py +60 -0
- benchside/domain/consultation/model/project.py +78 -0
- benchside/domain/consultation/model/value.py +150 -0
- benchside/domain/consultation/port/__init__.py +6 -0
- benchside/domain/consultation/port/repository.py +32 -0
- benchside/domain/consultation/query/__init__.py +0 -0
- benchside/domain/consultation/query/get_consultation.py +28 -0
- benchside/domain/consultation/query/recall_project.py +97 -0
- benchside/domain/consultation/service/__init__.py +0 -0
- benchside/domain/consultation/service/consultation.py +373 -0
- benchside/domain/consultation/util/__init__.py +0 -0
- benchside/domain/consultation/util/di/__init__.py +3 -0
- benchside/domain/consultation/util/di/provider.py +33 -0
- benchside/domain/export/__init__.py +0 -0
- benchside/domain/export/command/__init__.py +0 -0
- benchside/domain/export/command/export_observations.py +31 -0
- benchside/domain/export/command/grant_consent.py +26 -0
- benchside/domain/export/command/revoke_consent.py +20 -0
- benchside/domain/export/event/__init__.py +19 -0
- benchside/domain/export/event/consent_granted.py +9 -0
- benchside/domain/export/event/consent_revoked.py +8 -0
- benchside/domain/export/event/observations_exported.py +12 -0
- benchside/domain/export/event/reporting.py +24 -0
- benchside/domain/export/model/__init__.py +0 -0
- benchside/domain/export/model/ledger.py +40 -0
- benchside/domain/export/model/metascience.py +418 -0
- benchside/domain/export/model/reporting.py +193 -0
- benchside/domain/export/model/value.py +79 -0
- benchside/domain/export/model/wire.py +104 -0
- benchside/domain/export/port/__init__.py +5 -0
- benchside/domain/export/port/redactor.py +27 -0
- benchside/domain/export/port/repository.py +25 -0
- benchside/domain/export/port/sink.py +19 -0
- benchside/domain/export/query/__init__.py +0 -0
- benchside/domain/export/query/consent_status.py +30 -0
- benchside/domain/export/query/preview_export.py +37 -0
- benchside/domain/export/service/__init__.py +0 -0
- benchside/domain/export/service/consent.py +53 -0
- benchside/domain/export/service/export.py +171 -0
- benchside/domain/export/service/reporting.py +281 -0
- benchside/domain/export/util/__init__.py +0 -0
- benchside/domain/export/util/di/__init__.py +3 -0
- benchside/domain/export/util/di/provider.py +22 -0
- benchside/domain/shared/__init__.py +0 -0
- benchside/domain/shared/command.py +44 -0
- benchside/domain/shared/error.py +51 -0
- benchside/domain/shared/event.py +46 -0
- benchside/domain/shared/model/__init__.py +31 -0
- benchside/domain/shared/model/aggregate.py +9 -0
- benchside/domain/shared/model/capture.py +33 -0
- benchside/domain/shared/model/entity.py +5 -0
- benchside/domain/shared/model/gap.py +89 -0
- benchside/domain/shared/model/ids.py +64 -0
- benchside/domain/shared/model/provenance.py +16 -0
- benchside/domain/shared/model/value.py +17 -0
- benchside/domain/shared/port/__init__.py +4 -0
- benchside/domain/shared/port/base.py +9 -0
- benchside/domain/shared/port/journal.py +36 -0
- benchside/domain/shared/query.py +42 -0
- benchside/domain/shared/service.py +31 -0
- benchside/infrastructure/__init__.py +9 -0
- benchside/infrastructure/content/__init__.py +0 -0
- benchside/infrastructure/content/loader.py +108 -0
- benchside/infrastructure/content/renderer.py +129 -0
- benchside/infrastructure/content/writer.py +26 -0
- benchside/infrastructure/files.py +43 -0
- benchside/infrastructure/http_sink.py +128 -0
- benchside/infrastructure/journal/__init__.py +0 -0
- benchside/infrastructure/journal/di.py +85 -0
- benchside/infrastructure/journal/projection.py +244 -0
- benchside/infrastructure/journal/registry.py +24 -0
- benchside/infrastructure/journal/store.py +134 -0
- benchside/infrastructure/placeholders.py +28 -0
- benchside/infrastructure/readable_records.py +211 -0
- benchside/infrastructure/readable_refresh.py +58 -0
- benchside/infrastructure/redaction.py +44 -0
- benchside/infrastructure/session_context.py +225 -0
- benchside/infrastructure/storage_layout.py +104 -0
- benchside/reporting.py +333 -0
- benchside/util/__init__.py +0 -0
- benchside/util/di/__init__.py +4 -0
- benchside/util/di/base.py +16 -0
- benchside/util/di/scope.py +18 -0
- benchside-0.4.1.dist-info/METADATA +97 -0
- benchside-0.4.1.dist-info/RECORD +178 -0
- benchside-0.4.1.dist-info/WHEEL +4 -0
- benchside-0.4.1.dist-info/entry_points.txt +2 -0
- benchside-0.4.1.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
"""Run the installed source or packaged runtime with one JSON request on stdin."""
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import hashlib
|
|
5
|
+
import importlib.util
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
import shutil
|
|
9
|
+
import stat
|
|
10
|
+
import subprocess
|
|
11
|
+
import sys
|
|
12
|
+
import tempfile
|
|
13
|
+
import zipfile
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def private_cache_directory(identity):
|
|
18
|
+
"""A shared temporary parent must not let another account substitute our code."""
|
|
19
|
+
base = Path(tempfile.gettempdir()).resolve()
|
|
20
|
+
for parent in (base, *base.parents):
|
|
21
|
+
info = parent.lstat()
|
|
22
|
+
if (
|
|
23
|
+
not stat.S_ISDIR(info.st_mode)
|
|
24
|
+
or info.st_uid not in {0, os.getuid()}
|
|
25
|
+
or (info.st_mode & 0o022 and not info.st_mode & stat.S_ISVTX)
|
|
26
|
+
):
|
|
27
|
+
raise RuntimeError("Unsafe ancestor for the Benchside runtime cache")
|
|
28
|
+
directory = base
|
|
29
|
+
for name in (f"benchside-runtime-v2-{os.getuid()}", identity):
|
|
30
|
+
directory /= name
|
|
31
|
+
try:
|
|
32
|
+
directory.mkdir(mode=0o700)
|
|
33
|
+
except FileExistsError:
|
|
34
|
+
pass
|
|
35
|
+
info = directory.lstat()
|
|
36
|
+
if not stat.S_ISDIR(info.st_mode) or info.st_uid != os.getuid() or info.st_mode & 0o077:
|
|
37
|
+
raise RuntimeError("Runtime cache must be a private, owned directory without symlinks")
|
|
38
|
+
return directory
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def cache_file(path, flags, *, private=False):
|
|
42
|
+
"""Never follow a lock/manifest symlink or open a special file."""
|
|
43
|
+
descriptor = os.open(path, flags | os.O_NOFOLLOW | os.O_NONBLOCK, 0o600)
|
|
44
|
+
info = os.fstat(descriptor)
|
|
45
|
+
if (
|
|
46
|
+
not stat.S_ISREG(info.st_mode)
|
|
47
|
+
or info.st_uid != os.getuid()
|
|
48
|
+
or info.st_nlink != 1
|
|
49
|
+
or info.st_mode & (0o077 if private else 0o022)
|
|
50
|
+
):
|
|
51
|
+
os.close(descriptor)
|
|
52
|
+
raise RuntimeError("Unsafe file in the Benchside runtime cache")
|
|
53
|
+
return descriptor
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def cache_inventory(directory):
|
|
57
|
+
"""Detect changed, injected or missing executable content before import."""
|
|
58
|
+
if not stat.S_ISDIR(directory.lstat().st_mode):
|
|
59
|
+
raise RuntimeError("Runtime cache must not contain links or special files")
|
|
60
|
+
inventory = {}
|
|
61
|
+
for path in (directory, *sorted(directory.rglob("*"))):
|
|
62
|
+
info = path.lstat()
|
|
63
|
+
if info.st_uid != os.getuid() or info.st_mode & 0o022:
|
|
64
|
+
raise RuntimeError("Unsafe ownership or permissions in the runtime cache")
|
|
65
|
+
if stat.S_ISDIR(info.st_mode):
|
|
66
|
+
continue
|
|
67
|
+
if not stat.S_ISREG(info.st_mode):
|
|
68
|
+
raise RuntimeError("Runtime cache must not contain links or special files")
|
|
69
|
+
with os.fdopen(cache_file(path, os.O_RDONLY), "rb") as handle:
|
|
70
|
+
inventory[str(path.relative_to(directory))] = hashlib.file_digest(
|
|
71
|
+
handle, "sha256"
|
|
72
|
+
).hexdigest()
|
|
73
|
+
return inventory
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def seal_cache(directory):
|
|
77
|
+
"""Installers may create permissive bookkeeping files inside our private tree."""
|
|
78
|
+
if not stat.S_ISDIR(directory.lstat().st_mode):
|
|
79
|
+
raise RuntimeError("Runtime cache must not contain links or special files")
|
|
80
|
+
for path in (directory, *sorted(directory.rglob("*"))):
|
|
81
|
+
info = path.lstat()
|
|
82
|
+
if info.st_uid != os.getuid() or not (
|
|
83
|
+
stat.S_ISDIR(info.st_mode) or (stat.S_ISREG(info.st_mode) and info.st_nlink == 1)
|
|
84
|
+
):
|
|
85
|
+
raise RuntimeError("Unsafe file produced by the offline runtime installer")
|
|
86
|
+
path.chmod(stat.S_IMODE(info.st_mode) & 0o700, follow_symlinks=False)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def run_source(request, source):
|
|
90
|
+
repair = (
|
|
91
|
+
"Restore or reinstall the Benchside source environment, then have your agent "
|
|
92
|
+
"rerun bench setup for this skill location. Keep using the existing research-record storage."
|
|
93
|
+
)
|
|
94
|
+
try:
|
|
95
|
+
settings = json.loads(source.read_text())
|
|
96
|
+
if set(settings) != {"schema", "python", "package_root"} or (
|
|
97
|
+
settings["schema"] != "benchside.source.v1"
|
|
98
|
+
):
|
|
99
|
+
raise ValueError("Invalid source runtime configuration")
|
|
100
|
+
interpreter = Path(settings["python"])
|
|
101
|
+
package_root = Path(settings["package_root"])
|
|
102
|
+
if not interpreter.is_absolute() or not package_root.is_absolute():
|
|
103
|
+
raise ValueError("Source runtime paths must be absolute")
|
|
104
|
+
if not interpreter.is_file() or not os.access(interpreter, os.X_OK):
|
|
105
|
+
raise ValueError("The saved Python interpreter is unavailable")
|
|
106
|
+
if not (package_root / "benchside/application/bridge.py").is_file():
|
|
107
|
+
raise ValueError("The saved Benchside source is unavailable")
|
|
108
|
+
response = subprocess.run(
|
|
109
|
+
[
|
|
110
|
+
str(interpreter),
|
|
111
|
+
"-I",
|
|
112
|
+
"-B",
|
|
113
|
+
"-c",
|
|
114
|
+
(
|
|
115
|
+
"import sys; sys.path.insert(0, sys.argv[1]); "
|
|
116
|
+
"from benchside.application.bridge import main; raise SystemExit(main())"
|
|
117
|
+
),
|
|
118
|
+
str(package_root),
|
|
119
|
+
],
|
|
120
|
+
input=json.dumps(request),
|
|
121
|
+
capture_output=True,
|
|
122
|
+
text=True,
|
|
123
|
+
check=False,
|
|
124
|
+
timeout=240,
|
|
125
|
+
)
|
|
126
|
+
result = json.loads(response.stdout)
|
|
127
|
+
if not isinstance(result, dict) or type(result.get("ok")) is not bool:
|
|
128
|
+
raise ValueError("The installed runtime did not return a valid response")
|
|
129
|
+
except (OSError, KeyError, TypeError, ValueError) as error:
|
|
130
|
+
raise RuntimeError(
|
|
131
|
+
f"Benchside's source runtime could not start: {error}. {repair}"
|
|
132
|
+
) from error
|
|
133
|
+
except subprocess.TimeoutExpired as error:
|
|
134
|
+
raise RuntimeError(
|
|
135
|
+
"Benchside's source runtime timed out. Check the saved records before retrying; "
|
|
136
|
+
"the action may already have completed."
|
|
137
|
+
) from error
|
|
138
|
+
return result
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def bootstrap():
|
|
142
|
+
if sys.version_info < (3, 11): # noqa: UP036 - this bootstrap runs before package installation.
|
|
143
|
+
raise RuntimeError("Benchside needs Python 3.11 or later in this app")
|
|
144
|
+
root = Path(__file__).resolve().parents[1]
|
|
145
|
+
manifest = json.loads((root / "runtime/manifest.json").read_text())
|
|
146
|
+
wheel = root / "runtime" / manifest["wheel"]
|
|
147
|
+
requirements = root / "runtime/requirements.txt"
|
|
148
|
+
if hashlib.sha256(wheel.read_bytes()).hexdigest() != manifest["wheel_sha256"]:
|
|
149
|
+
raise RuntimeError("Packaged runtime checksum does not match")
|
|
150
|
+
if hashlib.sha256(requirements.read_bytes()).hexdigest() != manifest["requirements_sha256"]:
|
|
151
|
+
raise RuntimeError("Dependency lock checksum does not match")
|
|
152
|
+
dependencies = manifest.get("dependency_wheels")
|
|
153
|
+
if not dependencies:
|
|
154
|
+
raise RuntimeError("This package has no offline dependencies; install a rebuilt release")
|
|
155
|
+
wheelhouse = root / "runtime/wheels"
|
|
156
|
+
for name, digest in dependencies.items():
|
|
157
|
+
if Path(name).name != name or not name.endswith(".whl"):
|
|
158
|
+
raise RuntimeError("Invalid dependency wheel name")
|
|
159
|
+
if hashlib.sha256((wheelhouse / name).read_bytes()).hexdigest() != digest:
|
|
160
|
+
raise RuntimeError(f"Packaged dependency checksum does not match: {name}")
|
|
161
|
+
identity = hashlib.sha256(
|
|
162
|
+
(json.dumps(manifest, sort_keys=True) + sys.version).encode(),
|
|
163
|
+
).hexdigest()
|
|
164
|
+
directory = private_cache_directory(identity)
|
|
165
|
+
site = directory / "site"
|
|
166
|
+
# First-use setup is isolated and locked. It never installs into the project.
|
|
167
|
+
import fcntl
|
|
168
|
+
|
|
169
|
+
descriptor = cache_file(directory / ".install.lock", os.O_RDWR | os.O_CREAT, private=True)
|
|
170
|
+
with os.fdopen(descriptor, "r+") as lock:
|
|
171
|
+
fcntl.flock(lock, fcntl.LOCK_EX)
|
|
172
|
+
marker = directory / ".ready.json"
|
|
173
|
+
if marker.exists() or marker.is_symlink():
|
|
174
|
+
with os.fdopen(cache_file(marker, os.O_RDONLY, private=True)) as handle:
|
|
175
|
+
receipt = json.load(handle)
|
|
176
|
+
if (
|
|
177
|
+
receipt.get("identity") != identity
|
|
178
|
+
or not receipt.get("files")
|
|
179
|
+
or receipt["files"] != cache_inventory(site)
|
|
180
|
+
):
|
|
181
|
+
raise RuntimeError(
|
|
182
|
+
"Runtime cache integrity check failed. Have your agent verify ownership "
|
|
183
|
+
f"and move aside only this generated cache directory: {directory}. "
|
|
184
|
+
"Then rerun the installed skill to rebuild the runtime offline from its "
|
|
185
|
+
"verified bundle. Keep the installed package and research-record storage "
|
|
186
|
+
"in place; do not edit the cache contents or its integrity receipt."
|
|
187
|
+
)
|
|
188
|
+
else:
|
|
189
|
+
if site.exists() or site.is_symlink():
|
|
190
|
+
seal_cache(site) # Validate incomplete installer output before discarding it.
|
|
191
|
+
shutil.rmtree(site)
|
|
192
|
+
site.mkdir(mode=0o700)
|
|
193
|
+
if importlib.util.find_spec("pip"):
|
|
194
|
+
installer = [sys.executable, "-m", "pip", "install", "--disable-pip-version-check"]
|
|
195
|
+
elif shutil.which("uv"):
|
|
196
|
+
installer = ["uv", "pip", "install", "--python", sys.executable]
|
|
197
|
+
else:
|
|
198
|
+
raise RuntimeError("The app needs pip or uv to install the bundled runtime")
|
|
199
|
+
# Host installer settings must not add remote find-links or indexes.
|
|
200
|
+
environment = {
|
|
201
|
+
key: value
|
|
202
|
+
for key, value in os.environ.items()
|
|
203
|
+
if not key.startswith(("PIP_", "UV_")) or key == "UV_CACHE_DIR"
|
|
204
|
+
}
|
|
205
|
+
environment.update(
|
|
206
|
+
PIP_CONFIG_FILE=os.devnull,
|
|
207
|
+
UV_OFFLINE="true",
|
|
208
|
+
UV_NO_CONFIG="true",
|
|
209
|
+
UV_LINK_MODE="copy",
|
|
210
|
+
)
|
|
211
|
+
subprocess.run(
|
|
212
|
+
installer
|
|
213
|
+
+ [
|
|
214
|
+
"--target",
|
|
215
|
+
str(site),
|
|
216
|
+
"--no-index",
|
|
217
|
+
"--no-deps",
|
|
218
|
+
"--find-links",
|
|
219
|
+
str(wheelhouse),
|
|
220
|
+
"--only-binary=:all:",
|
|
221
|
+
"--require-hashes",
|
|
222
|
+
"-r",
|
|
223
|
+
str(requirements),
|
|
224
|
+
],
|
|
225
|
+
check=True,
|
|
226
|
+
env=environment,
|
|
227
|
+
stdout=sys.stderr,
|
|
228
|
+
timeout=180,
|
|
229
|
+
)
|
|
230
|
+
with zipfile.ZipFile(wheel) as archive:
|
|
231
|
+
for name in archive.namelist():
|
|
232
|
+
target = (site / name).resolve()
|
|
233
|
+
if not target.is_relative_to(site.resolve()):
|
|
234
|
+
raise RuntimeError("Unsafe runtime archive path")
|
|
235
|
+
archive.extractall(site)
|
|
236
|
+
seal_cache(site)
|
|
237
|
+
receipt = {"identity": identity, "files": cache_inventory(site)}
|
|
238
|
+
with os.fdopen(
|
|
239
|
+
cache_file(marker, os.O_WRONLY | os.O_CREAT | os.O_EXCL, private=True), "w"
|
|
240
|
+
) as handle:
|
|
241
|
+
json.dump(receipt, handle)
|
|
242
|
+
handle.flush()
|
|
243
|
+
os.fsync(handle.fileno())
|
|
244
|
+
sys.dont_write_bytecode = True
|
|
245
|
+
sys.path.insert(0, str(site))
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def response_summary(response, path):
|
|
249
|
+
"""Keep opaque native state in the file, not in the model's copy buffer."""
|
|
250
|
+
summary = {**response, "response_file": str(path)}
|
|
251
|
+
result = response.get("result")
|
|
252
|
+
if isinstance(result, dict) and "snapshot" in result and "markdown" in result:
|
|
253
|
+
summary["result"] = {k: v for k, v in result.items() if k not in {"snapshot", "markdown"}}
|
|
254
|
+
summary["result"]["candidate"] = {
|
|
255
|
+
key: result["snapshot"][key] for key in ("workspace_id", "revision", "sha256")
|
|
256
|
+
}
|
|
257
|
+
return summary
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def main(argv=None):
|
|
261
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
262
|
+
parser.add_argument(
|
|
263
|
+
"--response-file", type=Path, help="new private file for the complete response"
|
|
264
|
+
)
|
|
265
|
+
args = parser.parse_args(argv or [])
|
|
266
|
+
output = None
|
|
267
|
+
try:
|
|
268
|
+
if args.response_file:
|
|
269
|
+
if not args.response_file.is_absolute():
|
|
270
|
+
raise ValueError(
|
|
271
|
+
"Use an absolute response-file path in a private working directory"
|
|
272
|
+
)
|
|
273
|
+
# Reserve before running anything: a bad destination must not trigger
|
|
274
|
+
# a submission, and retries must never overwrite an unsaved candidate.
|
|
275
|
+
descriptor = os.open(args.response_file, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
|
|
276
|
+
output = os.fdopen(descriptor, "w", encoding="utf-8")
|
|
277
|
+
request = json.load(sys.stdin)
|
|
278
|
+
if not isinstance(request, dict) or not isinstance(request.get("action"), str):
|
|
279
|
+
raise TypeError("Provide a JSON object with an action")
|
|
280
|
+
source = Path(__file__).resolve().parents[1] / "runtime/source.json"
|
|
281
|
+
if source.is_file():
|
|
282
|
+
response = run_source(request, source)
|
|
283
|
+
else:
|
|
284
|
+
bootstrap()
|
|
285
|
+
from benchside.application.bridge import run
|
|
286
|
+
|
|
287
|
+
response = {"ok": True, "result": run(request)}
|
|
288
|
+
except Exception as error: # noqa: BLE001 - the process boundary must return a JSON error.
|
|
289
|
+
response = {
|
|
290
|
+
"ok": False,
|
|
291
|
+
"error": str(error),
|
|
292
|
+
"code": getattr(error, "code", "setup_failed"),
|
|
293
|
+
}
|
|
294
|
+
displayed = response
|
|
295
|
+
if output is not None:
|
|
296
|
+
try:
|
|
297
|
+
with output:
|
|
298
|
+
json.dump(response, output, ensure_ascii=False)
|
|
299
|
+
output.flush()
|
|
300
|
+
os.fsync(output.fileno())
|
|
301
|
+
displayed = response_summary(response, args.response_file)
|
|
302
|
+
except OSError as error:
|
|
303
|
+
# The action may have completed; preserve its full result/receipt on
|
|
304
|
+
# stdout rather than implying it failed and inviting a duplicate send.
|
|
305
|
+
displayed = {**response, "response_file_error": str(error)}
|
|
306
|
+
print(json.dumps(displayed, ensure_ascii=False))
|
|
307
|
+
return 0 if response["ok"] else 1
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
if __name__ == "__main__":
|
|
311
|
+
raise SystemExit(main(sys.argv[1:]))
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# This file was autogenerated by uv via the following command:
|
|
2
|
+
# uv export --no-dev --no-emit-project --format requirements-txt --output-file content/app-requirements.txt
|
|
3
|
+
annotated-types==0.8.0 \
|
|
4
|
+
--hash=sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7 \
|
|
5
|
+
--hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0
|
|
6
|
+
# via pydantic
|
|
7
|
+
dishka==1.10.1 \
|
|
8
|
+
--hash=sha256:51fb624b9acc948b90f57128460061d1f3a1780121fe1c7d14c565e8bbff2083 \
|
|
9
|
+
--hash=sha256:84f40c1115eb391ce3fb558fd7946c5bcaf6361c35b77b7a185b7697a5720ec7
|
|
10
|
+
# via benchside
|
|
11
|
+
markdown-it-py==4.2.0 \
|
|
12
|
+
--hash=sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49 \
|
|
13
|
+
--hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a
|
|
14
|
+
# via rich
|
|
15
|
+
mdurl==0.1.2 \
|
|
16
|
+
--hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \
|
|
17
|
+
--hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba
|
|
18
|
+
# via markdown-it-py
|
|
19
|
+
pydantic==2.13.4 \
|
|
20
|
+
--hash=sha256:45a282cde31d808236fd7ea9d919b128653c8b38b393d1c4ab335c62924d9aba \
|
|
21
|
+
--hash=sha256:c40756b57adaa8b1efeeced5c196f3f3b7c435f90e84ea7f443901bec8099ef6
|
|
22
|
+
# via
|
|
23
|
+
# benchside
|
|
24
|
+
# pydantic-settings
|
|
25
|
+
pydantic-core==2.46.4 \
|
|
26
|
+
--hash=sha256:00c603d540afdd6b80eb39f078f33ebd46211f02f33e34a32d9f053bba711de0 \
|
|
27
|
+
--hash=sha256:0186750b482eefa11d7f435892b09c5c606193ef3375bcf94aa00ae6bfb66262 \
|
|
28
|
+
--hash=sha256:041bde0a48fd37cf71cab1c9d56d3e8625a3793fef1f7dd232b3ff37e978ecda \
|
|
29
|
+
--hash=sha256:0c563b08bca408dc7f65f700633d8442fffb2421fc47b8101377e9fd65051ff0 \
|
|
30
|
+
--hash=sha256:0cbe8b01f948de4286c74cdd6c667aceb38f5c1e26f0693b3983d9d74887c65e \
|
|
31
|
+
--hash=sha256:0ce40cd7b21210e99342afafbd4d0f76d784eb5b1d60f3bdc566be4983c6c73b \
|
|
32
|
+
--hash=sha256:0e96592440881c74a213e5ad528e2b24d3d4f940de2766bed9010ab1d9e51594 \
|
|
33
|
+
--hash=sha256:133878133d271ade3d41d1bfb2a45ec38dbdbda40bc065921c6b04e4630127e2 \
|
|
34
|
+
--hash=sha256:14d4edf427bdcf950a8a02d7cb44a08614388dd6e1bdcbf4f67504fa7887da9c \
|
|
35
|
+
--hash=sha256:14f4c5d6db102bd796a627bbb3a17b4cf4574b9ae861d8b7c9a9661c6dd3362d \
|
|
36
|
+
--hash=sha256:17299feefe090f2caa5b8e37222bb5f663e4935a8bfa6931d4102e5df1a9f398 \
|
|
37
|
+
--hash=sha256:184c081504d17f1c1066e430e117142b2c77d9448a97f7b65c6ac9fd9aee238d \
|
|
38
|
+
--hash=sha256:18e5ceec2ab67e6d5f1a9085e5a24c9c4e2ac4545730bfe668680bca05e555f3 \
|
|
39
|
+
--hash=sha256:1a7dd0b3ee80d90150e3495a3a13ac34dbcbfd4f012996a6a1d8900e91b5c0fb \
|
|
40
|
+
--hash=sha256:1d8ba486450b14f3b1d63bc521d410ec7565e52f887b9fb671791886436a42f7 \
|
|
41
|
+
--hash=sha256:2108ba5c1c1eca18030634489dc544844144ee36357f2f9f780b93e7ddbb44b5 \
|
|
42
|
+
--hash=sha256:23ace664830ee0bfe014a0c7bc248b1f7f25ed7ad103852c317624a1083af462 \
|
|
43
|
+
--hash=sha256:2412e734dcb48da14d4e4006b82b46b74f2518b8a26ee7e58c6844a6cd6d03c4 \
|
|
44
|
+
--hash=sha256:29c61fc04a3d840155ff08e475a04809278972fe6aef51e2720554e96367e34b \
|
|
45
|
+
--hash=sha256:3009f12e4e90b7f88b4f9adb1b0c4a3d58fe7820f3238c190047209d148026df \
|
|
46
|
+
--hash=sha256:3245406455a5d98187ec35530fd772b1d799b26667980872c8d4614991e2c4a2 \
|
|
47
|
+
--hash=sha256:372429a130e469c9cd698925ce5fc50940b7a1336b0d82038e63d5bbc4edc519 \
|
|
48
|
+
--hash=sha256:3a233125ac121aa3ffba9a2b59edfc4a985a76092dc8279586ab4b71390875e7 \
|
|
49
|
+
--hash=sha256:3bf92c5d0e00fefaab325a4d27828fe6b6e2a21848686b5b60d2d9eeb09d76c6 \
|
|
50
|
+
--hash=sha256:3ecbc122d18468d06ca279dc26a8c2e2d5acb10943bb35e36ae92096dc3b5565 \
|
|
51
|
+
--hash=sha256:3fb702cd90b0446a3a1c5e470bfa0dd23c0233b676a9099ddcc964fa6ca13898 \
|
|
52
|
+
--hash=sha256:428e04521a40150c85216fc8b85e8d39fece235a9cf5e383761238c7fa9b96fb \
|
|
53
|
+
--hash=sha256:4c63ebc82684aa89d9a3bcbd13d515b3be44250dc68dd3bd81526c1cb31286c3 \
|
|
54
|
+
--hash=sha256:4fc73cb559bdb54b1134a706a2802a4cddd27a0633f5abb7e53056268751ac6a \
|
|
55
|
+
--hash=sha256:4fcbe087dbc2068af7eda3aa87634eba216dbda64d1ae73c8684b621d33f6596 \
|
|
56
|
+
--hash=sha256:56cb4851bcaf3d117eddcef4fe66afd750a50274b0da8e22be256d10e5611987 \
|
|
57
|
+
--hash=sha256:5855698a4856556d86e8e6cd8434bc3ac0314ee8e12089ae0e143f64c6256e4e \
|
|
58
|
+
--hash=sha256:5a4330cdbc57162e4b3aa303f588ba752257694c9c9be3e7ebb11b4aca659b5d \
|
|
59
|
+
--hash=sha256:5b712b53160b79a5850310b912a5ef8e57e56947c8ad690c227f5c9d7e561712 \
|
|
60
|
+
--hash=sha256:5d5902252db0d3cedf8d4a1bc68f70eeb430f7e4c7104c8c476753519b423008 \
|
|
61
|
+
--hash=sha256:617d7e2ca7dcb8c5cf6bcb8c59b8832c94b36196bbf1cbd1bfb56ed341905edd \
|
|
62
|
+
--hash=sha256:62f875393d7f270851f20523dd2e29f082bcc82292d66db2b64ea71f64b6e1c1 \
|
|
63
|
+
--hash=sha256:633147d34cf4550417f12e2b1a0383973bdf5cdfde212cb09e9a581cf10820be \
|
|
64
|
+
--hash=sha256:66ce7632c22d837c95301830e111ad0128a32b8207533b60896a96c4915192ea \
|
|
65
|
+
--hash=sha256:6b3ace8194b0e5204818c92802dcdca7fc6d88aabbb799d7c795540d9cd6d292 \
|
|
66
|
+
--hash=sha256:6f2eeda33a839975441c86a4119e1383c50b47faf0cbb5176985565c6bb02c33 \
|
|
67
|
+
--hash=sha256:7027560ee92211647d0d34e3f7cd6f50da56399d26a9c8ad0da286d3869a53f3 \
|
|
68
|
+
--hash=sha256:7283d57845ecf5a163403eb0702dfc220cc4fbdd18919cb5ccea4f95ee1cdab4 \
|
|
69
|
+
--hash=sha256:7a5f930472650a82629163023e630d160863fce524c616f4e5186e5de9d9a49b \
|
|
70
|
+
--hash=sha256:7bfb192b3f4b9e8a89b6277b6ce787564f62cfd272055f6e685726b111dc7826 \
|
|
71
|
+
--hash=sha256:811ff8e9c313ab425368bcbb36e5c4ebd7108c2bbf4e4089cfbb0b01eff63fac \
|
|
72
|
+
--hash=sha256:8233f2947cf85404441fd7e0085f53b10c93e0ee78611099b5c7237e36aacbf7 \
|
|
73
|
+
--hash=sha256:82cf5301172168103724d49a1444d3378cb20cdee30b116a1bd6031236298a5d \
|
|
74
|
+
--hash=sha256:85bb3611ff1802f3ee7fdd7dbff26b56f343fb432d57a4728fdd49b6ef35e2f4 \
|
|
75
|
+
--hash=sha256:86e1a4418c6cd97d60c95c71164158eaf7324fae7b0923264016baa993eba6fc \
|
|
76
|
+
--hash=sha256:8c5dac79fa1614d1e06ca695109c6105923bd9c7d1d6c918d4e637b7e6b32fd3 \
|
|
77
|
+
--hash=sha256:8d0820e8192167f80d88d64038e609c31452eeca865b4e1d9950a27a4609b00b \
|
|
78
|
+
--hash=sha256:8daafc69c93ee8a0204506a3b6b30f586ef54028f52aeeeb5c4cfc5184fd5914 \
|
|
79
|
+
--hash=sha256:9037063db01f09b09e237c282b6792bd4da634b5402c4e7f0c61effed7701a04 \
|
|
80
|
+
--hash=sha256:90884113d8b48f760e9587002789ddd741e76ab9f89518cd1e43b1f1a52ec44b \
|
|
81
|
+
--hash=sha256:926c9541b14b12b1681dca8a0b75feb510b06c6341b70a8e500c2fdcff837cce \
|
|
82
|
+
--hash=sha256:9401557acd873c3a7f3eb9383edef8ac4968f9510e340f4808d427e75667e7b4 \
|
|
83
|
+
--hash=sha256:9551187363ffc0de2a00b2e47c25aeaeb1020b69b668762966df15fc5659dd5a \
|
|
84
|
+
--hash=sha256:962ccbab7b642487b1d8b7df90ef677e03134cf1fd8880bf698649b22a69371f \
|
|
85
|
+
--hash=sha256:97e7cf2be5c77b7d1a9713a05605d49460d02c6078d38d8bef3cbe323c548424 \
|
|
86
|
+
--hash=sha256:9aa768456404a8bf48a4406685ac2bec8e72b62c69313734fa3b73cf33b3a894 \
|
|
87
|
+
--hash=sha256:9bc519fbf2b7578398853d815009ae5e4d4603d12f4e3f91da8c06852d3da3e9 \
|
|
88
|
+
--hash=sha256:9d56801be94b86a9da183e5f3766e6310752b99ff647e38b09a9500d88e46e76 \
|
|
89
|
+
--hash=sha256:9fa8ae11da9e2b3126c6426f147e0fba88d96d65921799bb30c6abd1cb2c97fb \
|
|
90
|
+
--hash=sha256:a0f62d0a58f4e7da165457e995725421e0064f2255d8eccebc49f41bbc23b109 \
|
|
91
|
+
--hash=sha256:aaa2a54443eff1950ba5ddc6b6ccda0d9c84a364276a62f969bdf2a390650848 \
|
|
92
|
+
--hash=sha256:ad785e92e6dc634c21555edc8bd6b64957ab844541bcb96a1366c202951ae526 \
|
|
93
|
+
--hash=sha256:af8244b2bef6aaad6d92cda81372de7f8c8d36c9f0c3ea36e827c60e7d9467a0 \
|
|
94
|
+
--hash=sha256:b2f69dec1725e79a012d920df1707de5caf7ed5e08f3be4435e25803efc47458 \
|
|
95
|
+
--hash=sha256:b8458003118a712e66286df6a707db01c52c0f52f7db8e4a38f0da1d3b94fc4e \
|
|
96
|
+
--hash=sha256:bfec22eab3c8cc2ceec0248aec886624116dc079afa027ecc8ad4a7e62010f8a \
|
|
97
|
+
--hash=sha256:c1b3f518abeca3aa13c712fd202306e145abf59a18b094a6bafb2d2bbf59192c \
|
|
98
|
+
--hash=sha256:c50f2528cf200c5eed56faf3f4e22fcd5f38c157a8b78576e6ba3168ec35f000 \
|
|
99
|
+
--hash=sha256:c68fcd102d71ea85c5b2dfac3f4f8476eff42a9e078fd5faefff6d145063536b \
|
|
100
|
+
--hash=sha256:c7a7bd4e39e8e4c12c39cd480356842b6a8a06e41b23a55a5e3e191718838ddf \
|
|
101
|
+
--hash=sha256:c94f0688e7b8d0a67abf40e57a7eaaecd17cc9586706a31b76c031f63df052b4 \
|
|
102
|
+
--hash=sha256:cbaf13819775b7f769bf4a1f066cb6df7a28d4480081a589828ef190226881cd \
|
|
103
|
+
--hash=sha256:cd2213145bcc2ba85884d0ac63d222fece9209678f77b9b4d76f054c561adb28 \
|
|
104
|
+
--hash=sha256:ce5c1d2a8b27468f433ca974829c44060b8097eedc39933e3c206a90ee49c4a9 \
|
|
105
|
+
--hash=sha256:d396ec2b979760aaf3218e76c24e65bd0aca24983298653b3a9d7a45f9e47b30 \
|
|
106
|
+
--hash=sha256:d51026d73fcfd93610abc7b27789c26b313920fcfb20e27462d74a7f8b06e983 \
|
|
107
|
+
--hash=sha256:db06ffe51636ffe9ca531fe9023dd64bdd794be8754cb5df57c5498ae5b518a7 \
|
|
108
|
+
--hash=sha256:e0d65b8c354be7fb5f720c3caa8bc940bc2d20ce749c8e06135f07f8ed95dd7c \
|
|
109
|
+
--hash=sha256:e739fee756ba1010f8bcccb534252e85a35fe45ae92c295a06059ce58b74ccd3 \
|
|
110
|
+
--hash=sha256:e846ae7835bf0703ae43f534ab79a867146dadd59dc9ca5c8b53d5c8f7c9ef02 \
|
|
111
|
+
--hash=sha256:e9c26f834c65f5752f3f06cb08cb86a913ceb7274d0db6e267808a708b46bc89 \
|
|
112
|
+
--hash=sha256:f027324c56cd5406ca49c124b0db10e56c69064fec039acc571c29020cc87c76 \
|
|
113
|
+
--hash=sha256:f99626688942fb746e545232e7726926f3be91b5975f8b55327665fafda991c7 \
|
|
114
|
+
--hash=sha256:f9fa868638bf362d3d138ea55829cefb3d5f4b0d7f142234382a15e2485dbec4 \
|
|
115
|
+
--hash=sha256:fbdb89b3e1c94a30cc5edfce477c6e6a5dc4d8f84665b455c27582f211a1c72c \
|
|
116
|
+
--hash=sha256:fc010ab034c8c7452522748bf937df58020d256ccae0874463d1f4d01758af8e \
|
|
117
|
+
--hash=sha256:fc3e9034a63de20e15e8ade85358bc6efc614008cab72898b4b4952bea0509ff
|
|
118
|
+
# via pydantic
|
|
119
|
+
pydantic-settings==2.14.2 \
|
|
120
|
+
--hash=sha256:a20c97b37910b6550d5ea50fbcc2d4187defe58cd57070b73863d069419c9440 \
|
|
121
|
+
--hash=sha256:c19dd64b19097f1de80184f0cc7b0272a13ae6e170cbf240a3e27e381ed14a5f
|
|
122
|
+
# via benchside
|
|
123
|
+
pygments==2.20.0 \
|
|
124
|
+
--hash=sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f \
|
|
125
|
+
--hash=sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176
|
|
126
|
+
# via rich
|
|
127
|
+
python-dotenv==1.2.2 \
|
|
128
|
+
--hash=sha256:1d8214789a24de455a8b8bd8ae6fe3c6b69a5e3d64aa8a8e5d68e694bbcb285a \
|
|
129
|
+
--hash=sha256:2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3
|
|
130
|
+
# via pydantic-settings
|
|
131
|
+
pyyaml==6.0.3 \
|
|
132
|
+
--hash=sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c \
|
|
133
|
+
--hash=sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3 \
|
|
134
|
+
--hash=sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6 \
|
|
135
|
+
--hash=sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c \
|
|
136
|
+
--hash=sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65 \
|
|
137
|
+
--hash=sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a \
|
|
138
|
+
--hash=sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1 \
|
|
139
|
+
--hash=sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310 \
|
|
140
|
+
--hash=sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4 \
|
|
141
|
+
--hash=sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea \
|
|
142
|
+
--hash=sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e \
|
|
143
|
+
--hash=sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac \
|
|
144
|
+
--hash=sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9 \
|
|
145
|
+
--hash=sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7 \
|
|
146
|
+
--hash=sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35 \
|
|
147
|
+
--hash=sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb \
|
|
148
|
+
--hash=sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b \
|
|
149
|
+
--hash=sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c \
|
|
150
|
+
--hash=sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd \
|
|
151
|
+
--hash=sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824 \
|
|
152
|
+
--hash=sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065 \
|
|
153
|
+
--hash=sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c \
|
|
154
|
+
--hash=sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c \
|
|
155
|
+
--hash=sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764 \
|
|
156
|
+
--hash=sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196 \
|
|
157
|
+
--hash=sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b \
|
|
158
|
+
--hash=sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00 \
|
|
159
|
+
--hash=sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac \
|
|
160
|
+
--hash=sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8 \
|
|
161
|
+
--hash=sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e \
|
|
162
|
+
--hash=sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28 \
|
|
163
|
+
--hash=sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3 \
|
|
164
|
+
--hash=sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5 \
|
|
165
|
+
--hash=sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf \
|
|
166
|
+
--hash=sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5 \
|
|
167
|
+
--hash=sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702 \
|
|
168
|
+
--hash=sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788 \
|
|
169
|
+
--hash=sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d \
|
|
170
|
+
--hash=sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc \
|
|
171
|
+
--hash=sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba \
|
|
172
|
+
--hash=sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5 \
|
|
173
|
+
--hash=sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26 \
|
|
174
|
+
--hash=sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f \
|
|
175
|
+
--hash=sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b \
|
|
176
|
+
--hash=sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be \
|
|
177
|
+
--hash=sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c \
|
|
178
|
+
--hash=sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6 \
|
|
179
|
+
--hash=sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0
|
|
180
|
+
# via benchside
|
|
181
|
+
rich==15.0.0 \
|
|
182
|
+
--hash=sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb \
|
|
183
|
+
--hash=sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36
|
|
184
|
+
# via benchside
|
|
185
|
+
typing-extensions==4.16.0 \
|
|
186
|
+
--hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \
|
|
187
|
+
--hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5
|
|
188
|
+
# via
|
|
189
|
+
# pydantic
|
|
190
|
+
# pydantic-core
|
|
191
|
+
# typing-inspection
|
|
192
|
+
typing-inspection==0.4.2 \
|
|
193
|
+
--hash=sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7 \
|
|
194
|
+
--hash=sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464
|
|
195
|
+
# via
|
|
196
|
+
# pydantic
|
|
197
|
+
# pydantic-settings
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bench-init
|
|
3
|
+
description: Set up Benchside in Claude Code, choose where research records live, and make all seven scientific roles available. Use when the researcher asks to initialize Benchside in a local project.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Set up Benchside
|
|
7
|
+
|
|
8
|
+
Read the installed sibling `../benchside/SKILL.md` and follow its onboarding
|
|
9
|
+
reference. Ask where the researcher wants records stored: a durable local folder,
|
|
10
|
+
private native documents, or a compatible installed cloud connector. Do not choose
|
|
11
|
+
local storage merely because this is Claude Code. The agent runs setup commands;
|
|
12
|
+
the researcher need not use a terminal or provide a model API key.
|
|
13
|
+
|
|
14
|
+
The shared Benchside skill contains all seven roles and uses its installed
|
|
15
|
+
`scripts/benchside_app.py` entry, which remembers a source installation's runtime.
|
|
16
|
+
Prefer this route for projects also used from another agent.
|
|
17
|
+
List existing projects in the chosen store and reuse the selected project ID.
|
|
18
|
+
|
|
19
|
+
`bench init --yes` installs the same shared entry locally without legacy role skills
|
|
20
|
+
or transcript hooks. Restore an existing app project before creating a new one.
|
|
21
|
+
If the researcher specifically wants the legacy per-project slash commands and
|
|
22
|
+
Claude Code lifecycle hooks, explain that `bench init --yes --legacy-cli` writes project identity
|
|
23
|
+
in `.bench/config.yaml`, role skills in `.claude/skills`, and tagged session hooks in
|
|
24
|
+
`.claude/settings.json`. SessionStart restores legacy CLI recall; SessionEnd archives
|
|
25
|
+
the transcript locally. Follow their request before enabling these hooks. This is
|
|
26
|
+
optional; the shared skill records without hooks and works with native memory too.
|
|
27
|
+
Legacy role skills require explicit invocation so automatic discovery does not
|
|
28
|
+
switch between two journal systems. Shared setup marks only recognized, unedited
|
|
29
|
+
Benchside-generated legacy skills this way and preserves custom skills.
|
|
30
|
+
Legacy CLI journals and app project IDs are separate; do not imply automatic migration.
|
|
31
|
+
For existing legacy research, let the researcher choose to continue its CLI journal
|
|
32
|
+
or explicitly migrate it. Do not create an empty app project and claim it restored
|
|
33
|
+
their previous work.
|
|
34
|
+
|
|
35
|
+
Optional reporting always requires separate consent, exact preview and approval.
|
|
36
|
+
The shared onboarding flow also offers optional discipline/career-stage categories
|
|
37
|
+
and a separate choice to include them in reviewed usage reports.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bench-share
|
|
3
|
+
description: Review optional Benchside workflow observations, usability feedback and usage counts, control each consent choice, and send only explicitly approved drafts. Use when the researcher wants to share or review sharing preferences.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Optional Benchside sharing
|
|
7
|
+
|
|
8
|
+
Use `bench share status` to read existing choices. Offer workflow observations,
|
|
9
|
+
usability feedback and weekly usage counts together, each optional. Private
|
|
10
|
+
scientific records and source documents are never part of these submissions.
|
|
11
|
+
|
|
12
|
+
After the researcher chooses, enable only those channels with
|
|
13
|
+
`bench share grant --channel gaps|feedback|usage`. Gaps also need `--kinds`
|
|
14
|
+
with their chosen kinds (missing_tool, unfindable_data, manual_toil, dead_end,
|
|
15
|
+
missing_index). Disable choices with `bench share revoke --channel <channel>`;
|
|
16
|
+
`--channel all` stops all future reporting. Revocation does not delete past submissions.
|
|
17
|
+
|
|
18
|
+
For feedback, ask for ease of use (1–5), whether they would use it again
|
|
19
|
+
(yes/no/unsure), and an optional comment. Save using `bench share feedback --ease
|
|
20
|
+
<rating> --again <answer> --comment "<their text>"`, with `--role`, `--host` and
|
|
21
|
+
`--surface` if known. Never invent ratings.
|
|
22
|
+
|
|
23
|
+
Use `bench share preview --channel <channel>`; feedback also needs
|
|
24
|
+
`--feedback-id <returned ID>`. Gaps can select `--only <observation ID>` repeatedly
|
|
25
|
+
and use `--edits <JSON file>` mapping selected IDs to complete reviewed gap objects.
|
|
26
|
+
Feedback previews can use `--comment "<reviewed replacement>"`.
|
|
27
|
+
|
|
28
|
+
Show the complete prepared content, recipient and any redaction findings.
|
|
29
|
+
Usage includes a random installation ID, weekly counts, role/app/version
|
|
30
|
+
information and standard failure counts, with no research text. Installation
|
|
31
|
+
counts are not exact people. New feedback and workflow observations share that random contributor ID so
|
|
32
|
+
Science Works can group contributions over time. Explain this before consent;
|
|
33
|
+
old unlinked grants need a renewed choice. It identifies a store, not a person.
|
|
34
|
+
Public software/dataset names and versions can explain a problem, but private
|
|
35
|
+
scientific findings and source passages must be removed from model-derived gaps.
|
|
36
|
+
|
|
37
|
+
After the researcher explicitly approves a displayed batch, send that exact
|
|
38
|
+
batch with `bench share send --draft <returned draft ID> --approve-sha256
|
|
39
|
+
<displayed digest>`. Any edits need a new preview and approval. Retry an uncertain
|
|
40
|
+
send with the same draft. No automatic retries, broad approvals, or unattended
|
|
41
|
+
uploads. Each batch needs review.
|
|
42
|
+
|
|
43
|
+
`bench share history` returns receipts for review and operator-assisted removal.
|
|
44
|
+
Never claim a send succeeded unless the command confirms a verified receipt.
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"journal-club": [
|
|
3
|
+
"b71cc491e3c73c85bfb5da8d2382837a2a46c1cebeb5e6eb577be1c2bf657e60"
|
|
4
|
+
],
|
|
5
|
+
"methods-clinic": [
|
|
6
|
+
"78c84bddca11a27294e82fd89eb56c394a3c12d52d46f4ca7a1a34aa25d51a34"
|
|
7
|
+
],
|
|
8
|
+
"peer-review": [
|
|
9
|
+
"6f4b25304bf1cb4de92494bbba92f6c45cae08d20c23b50df9bcbd235e57d7cf"
|
|
10
|
+
],
|
|
11
|
+
"pi": [
|
|
12
|
+
"7faf319d845e58395f1ca0c2e1a6a2cf0156b5c580b9c6229e09f5dd2a86d1eb"
|
|
13
|
+
],
|
|
14
|
+
"repro-check": [
|
|
15
|
+
"2c38a397e7d21d2fd150993f6691f28e2c44b55910e0f30edfdf70729a5fe52a"
|
|
16
|
+
],
|
|
17
|
+
"results-meeting": [
|
|
18
|
+
"236fb61b880f93660d20fbc7c660e48c3f9c5772cb544c9730112a8b024f2f90"
|
|
19
|
+
],
|
|
20
|
+
"study-design": [
|
|
21
|
+
"4d5ad35b9345be105e70f6c9af471ec2327e78441548c1ce60204b147025634f"
|
|
22
|
+
],
|
|
23
|
+
"bench-share": [
|
|
24
|
+
"5337386c02554e420a82daa2d34ae81d5fa6d5f79af48f30524e7be97149e7e5"
|
|
25
|
+
]
|
|
26
|
+
}
|