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.
Files changed (178) hide show
  1. benchside/__init__.py +1 -0
  2. benchside/_content/app/SKILL.md +155 -0
  3. benchside/_content/app/references/app-api.md +261 -0
  4. benchside/_content/app/references/generic-agents.md +69 -0
  5. benchside/_content/app/references/metascience.md +346 -0
  6. benchside/_content/app/references/native-memory.md +429 -0
  7. benchside/_content/app/references/onboarding.md +313 -0
  8. benchside/_content/app/references/sharing.md +159 -0
  9. benchside/_content/app/scripts/benchside_app.py +311 -0
  10. benchside/_content/app-requirements.txt +197 -0
  11. benchside/_content/claude/bench-init/SKILL.md +37 -0
  12. benchside/_content/claude/bench-share/SKILL.md +44 -0
  13. benchside/_content/fixtures/.gitkeep +0 -0
  14. benchside/_content/legacy-skill-digests.json +26 -0
  15. benchside/_content/personas/journal-club.yaml +45 -0
  16. benchside/_content/personas/methods-clinic.yaml +49 -0
  17. benchside/_content/personas/peer-review.yaml +45 -0
  18. benchside/_content/personas/pi-hypothesis.yaml +121 -0
  19. benchside/_content/personas/pi.yaml +87 -0
  20. benchside/_content/personas/repro-check.yaml +45 -0
  21. benchside/_content/personas/results-meeting.yaml +46 -0
  22. benchside/_content/personas/study-design.yaml +50 -0
  23. benchside/_content/templates/app-role.md.tmpl +31 -0
  24. benchside/_content/templates/blocks/capture-contract.md +40 -0
  25. benchside/_content/templates/blocks/sovereignty.md +36 -0
  26. benchside/_content/templates/skill.md.tmpl +54 -0
  27. benchside/application/__init__.py +0 -0
  28. benchside/application/app.py +458 -0
  29. benchside/application/bridge.py +55 -0
  30. benchside/application/contributions.py +39 -0
  31. benchside/application/di.py +35 -0
  32. benchside/application/metascience.py +671 -0
  33. benchside/application/native.py +1088 -0
  34. benchside/application/packaging.py +19 -0
  35. benchside/application/sharing.py +439 -0
  36. benchside/application/submission_failures.py +28 -0
  37. benchside/cli/__init__.py +0 -0
  38. benchside/cli/hooks.py +159 -0
  39. benchside/cli/install.py +276 -0
  40. benchside/cli/journal.py +232 -0
  41. benchside/cli/main.py +761 -0
  42. benchside/cli/runtime.py +245 -0
  43. benchside/cli/sharing.py +66 -0
  44. benchside/cli/ui/__init__.py +5 -0
  45. benchside/cli/ui/_glyphs.py +21 -0
  46. benchside/cli/ui/_model.py +66 -0
  47. benchside/cli/ui/_renderer.py +110 -0
  48. benchside/cli/ui/_rich.py +75 -0
  49. benchside/config.py +122 -0
  50. benchside/domain/__init__.py +0 -0
  51. benchside/domain/authoring/__init__.py +0 -0
  52. benchside/domain/authoring/command/__init__.py +0 -0
  53. benchside/domain/authoring/command/compile.py +28 -0
  54. benchside/domain/authoring/model/__init__.py +0 -0
  55. benchside/domain/authoring/model/flow.py +27 -0
  56. benchside/domain/authoring/model/persona.py +56 -0
  57. benchside/domain/authoring/model/skill.py +32 -0
  58. benchside/domain/authoring/model/value.py +42 -0
  59. benchside/domain/authoring/port/__init__.py +5 -0
  60. benchside/domain/authoring/port/renderer.py +17 -0
  61. benchside/domain/authoring/port/repository.py +28 -0
  62. benchside/domain/authoring/port/skill_writer.py +19 -0
  63. benchside/domain/authoring/query/__init__.py +0 -0
  64. benchside/domain/authoring/query/get_persona.py +30 -0
  65. benchside/domain/authoring/query/list_personas.py +21 -0
  66. benchside/domain/authoring/service/__init__.py +0 -0
  67. benchside/domain/authoring/service/authoring.py +99 -0
  68. benchside/domain/authoring/util/__init__.py +0 -0
  69. benchside/domain/authoring/util/di/__init__.py +3 -0
  70. benchside/domain/authoring/util/di/provider.py +15 -0
  71. benchside/domain/consultation/__init__.py +0 -0
  72. benchside/domain/consultation/command/__init__.py +0 -0
  73. benchside/domain/consultation/command/capture_gap.py +28 -0
  74. benchside/domain/consultation/command/close.py +29 -0
  75. benchside/domain/consultation/command/open.py +36 -0
  76. benchside/domain/consultation/command/raise_critique.py +30 -0
  77. benchside/domain/consultation/command/record_decision.py +30 -0
  78. benchside/domain/consultation/command/resolve_critique.py +32 -0
  79. benchside/domain/consultation/command/state_hypothesis.py +28 -0
  80. benchside/domain/consultation/event/__init__.py +22 -0
  81. benchside/domain/consultation/event/closed.py +13 -0
  82. benchside/domain/consultation/event/critique_raised.py +12 -0
  83. benchside/domain/consultation/event/critique_resolved.py +12 -0
  84. benchside/domain/consultation/event/decision_recorded.py +13 -0
  85. benchside/domain/consultation/event/gap_observed.py +16 -0
  86. benchside/domain/consultation/event/hypothesis_stated.py +12 -0
  87. benchside/domain/consultation/event/opened.py +23 -0
  88. benchside/domain/consultation/event/question.py +16 -0
  89. benchside/domain/consultation/event/research_recorded.py +9 -0
  90. benchside/domain/consultation/model/__init__.py +0 -0
  91. benchside/domain/consultation/model/consultation.py +60 -0
  92. benchside/domain/consultation/model/project.py +78 -0
  93. benchside/domain/consultation/model/value.py +150 -0
  94. benchside/domain/consultation/port/__init__.py +6 -0
  95. benchside/domain/consultation/port/repository.py +32 -0
  96. benchside/domain/consultation/query/__init__.py +0 -0
  97. benchside/domain/consultation/query/get_consultation.py +28 -0
  98. benchside/domain/consultation/query/recall_project.py +97 -0
  99. benchside/domain/consultation/service/__init__.py +0 -0
  100. benchside/domain/consultation/service/consultation.py +373 -0
  101. benchside/domain/consultation/util/__init__.py +0 -0
  102. benchside/domain/consultation/util/di/__init__.py +3 -0
  103. benchside/domain/consultation/util/di/provider.py +33 -0
  104. benchside/domain/export/__init__.py +0 -0
  105. benchside/domain/export/command/__init__.py +0 -0
  106. benchside/domain/export/command/export_observations.py +31 -0
  107. benchside/domain/export/command/grant_consent.py +26 -0
  108. benchside/domain/export/command/revoke_consent.py +20 -0
  109. benchside/domain/export/event/__init__.py +19 -0
  110. benchside/domain/export/event/consent_granted.py +9 -0
  111. benchside/domain/export/event/consent_revoked.py +8 -0
  112. benchside/domain/export/event/observations_exported.py +12 -0
  113. benchside/domain/export/event/reporting.py +24 -0
  114. benchside/domain/export/model/__init__.py +0 -0
  115. benchside/domain/export/model/ledger.py +40 -0
  116. benchside/domain/export/model/metascience.py +418 -0
  117. benchside/domain/export/model/reporting.py +193 -0
  118. benchside/domain/export/model/value.py +79 -0
  119. benchside/domain/export/model/wire.py +104 -0
  120. benchside/domain/export/port/__init__.py +5 -0
  121. benchside/domain/export/port/redactor.py +27 -0
  122. benchside/domain/export/port/repository.py +25 -0
  123. benchside/domain/export/port/sink.py +19 -0
  124. benchside/domain/export/query/__init__.py +0 -0
  125. benchside/domain/export/query/consent_status.py +30 -0
  126. benchside/domain/export/query/preview_export.py +37 -0
  127. benchside/domain/export/service/__init__.py +0 -0
  128. benchside/domain/export/service/consent.py +53 -0
  129. benchside/domain/export/service/export.py +171 -0
  130. benchside/domain/export/service/reporting.py +281 -0
  131. benchside/domain/export/util/__init__.py +0 -0
  132. benchside/domain/export/util/di/__init__.py +3 -0
  133. benchside/domain/export/util/di/provider.py +22 -0
  134. benchside/domain/shared/__init__.py +0 -0
  135. benchside/domain/shared/command.py +44 -0
  136. benchside/domain/shared/error.py +51 -0
  137. benchside/domain/shared/event.py +46 -0
  138. benchside/domain/shared/model/__init__.py +31 -0
  139. benchside/domain/shared/model/aggregate.py +9 -0
  140. benchside/domain/shared/model/capture.py +33 -0
  141. benchside/domain/shared/model/entity.py +5 -0
  142. benchside/domain/shared/model/gap.py +89 -0
  143. benchside/domain/shared/model/ids.py +64 -0
  144. benchside/domain/shared/model/provenance.py +16 -0
  145. benchside/domain/shared/model/value.py +17 -0
  146. benchside/domain/shared/port/__init__.py +4 -0
  147. benchside/domain/shared/port/base.py +9 -0
  148. benchside/domain/shared/port/journal.py +36 -0
  149. benchside/domain/shared/query.py +42 -0
  150. benchside/domain/shared/service.py +31 -0
  151. benchside/infrastructure/__init__.py +9 -0
  152. benchside/infrastructure/content/__init__.py +0 -0
  153. benchside/infrastructure/content/loader.py +108 -0
  154. benchside/infrastructure/content/renderer.py +129 -0
  155. benchside/infrastructure/content/writer.py +26 -0
  156. benchside/infrastructure/files.py +43 -0
  157. benchside/infrastructure/http_sink.py +128 -0
  158. benchside/infrastructure/journal/__init__.py +0 -0
  159. benchside/infrastructure/journal/di.py +85 -0
  160. benchside/infrastructure/journal/projection.py +244 -0
  161. benchside/infrastructure/journal/registry.py +24 -0
  162. benchside/infrastructure/journal/store.py +134 -0
  163. benchside/infrastructure/placeholders.py +28 -0
  164. benchside/infrastructure/readable_records.py +211 -0
  165. benchside/infrastructure/readable_refresh.py +58 -0
  166. benchside/infrastructure/redaction.py +44 -0
  167. benchside/infrastructure/session_context.py +225 -0
  168. benchside/infrastructure/storage_layout.py +104 -0
  169. benchside/reporting.py +333 -0
  170. benchside/util/__init__.py +0 -0
  171. benchside/util/di/__init__.py +4 -0
  172. benchside/util/di/base.py +16 -0
  173. benchside/util/di/scope.py +18 -0
  174. benchside-0.4.1.dist-info/METADATA +97 -0
  175. benchside-0.4.1.dist-info/RECORD +178 -0
  176. benchside-0.4.1.dist-info/WHEEL +4 -0
  177. benchside-0.4.1.dist-info/entry_points.txt +2 -0
  178. benchside-0.4.1.dist-info/licenses/LICENSE +201 -0
benchside/__init__.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = "0.4.1"
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: benchside
3
+ description: Scientific supervision, study design, methods troubleshooting, results discussion, reproducibility checks, journal club and peer review, with private project records. Use for research discussions, Benchside setup and recall, optional study surveys, or explicitly requested analysis of selected research conversations, including work without a Benchside role.
4
+ ---
5
+
6
+ # Benchside
7
+
8
+ Help the researcher do science, keep a useful record, and return to unfinished work.
9
+ The researcher does not need a terminal, API key or a separate chatbot.
10
+
11
+ Researchers can propose their own scientific role profiles through pull requests
12
+ to the Benchside repository. A future community resource would help researchers
13
+ find tools and workarounds that helped others with similar problems. That shared
14
+ recommendation/community feature is planned, not available; do not claim a
15
+ community lookup or publish private records to it.
16
+
17
+ For surveys or analysis of selected research activity, read [the metascience
18
+ guide](references/metascience.md) and use its independent workflow. Do not start
19
+ a research role or consultation just to run that workflow. All choices start off;
20
+ there is no account-wide log listener or implicit permission to read chats.
21
+
22
+ ## Start or return
23
+
24
+ Read [onboarding](references/onboarding.md) on first use or a storage change.
25
+ First run `{"action":"version"}` through the installed entry point. Reading a
26
+ manifest or creating a plugin does not prove execution. Check execution, durable
27
+ private memory and optional sending separately, as described in onboarding.
28
+ On return, restore and read the existing project; do not repeat synthetic writes
29
+ or connection checks unless re-verification is requested or a changed capability
30
+ needs checking. Preserve the saved participation choices.
31
+ If a capability is missing, state the precise limitation once; do not keep asking
32
+ the researcher to enable tools the account does not offer. Research discussion
33
+ can continue without pretending it has a saved journal.
34
+ Offer only accessible storage: a durable local directory, private app-native
35
+ storage, or a compatible installed cloud connector. Follow the researcher's
36
+ existing choice when returning.
37
+
38
+ Read [the app adapter guide](references/app-api.md). Packaged installations use
39
+ `scripts/benchside_app.py`; source installations created by `bench setup` use the
40
+ same entry, which remembers their Python environment. A checkout before setup can
41
+ use `uv run bench app`. The agent runs
42
+ the code and passes JSON on stdin. Never interpolate research text into shell
43
+ commands or ask the researcher to type developer commands.
44
+ Use only documented actions and returned IDs. If a call fails, read the error
45
+ and correct the request from the app guide. Do not invent a command, switch to
46
+ the legacy CLI, import internal modules, or edit journal JSON/JSONL to make an
47
+ app record appear saved. If the documented call cannot be completed, keep the
48
+ work unsaved and explain the blocker.
49
+
50
+ Discover existing projects in the chosen storage before creating one. Reuse a
51
+ selected `project_id` even when the app has changed. Keep the returned session ID
52
+ for this conversation. Do not use changing chat titles as identity.
53
+ For local stores, use a friendly project `title` and tell the researcher where
54
+ their chosen ODT and/or Markdown copies under `researcher/projects/<name>/` are saved.
55
+ These contain the complete saved journal and refresh automatically; their edits
56
+ are not imported. Keep all journal and consent state private in `agent/` for
57
+ organised stores. See the app guide before upgrading a legacy flat store; never
58
+ move an active store or delete its backup. For native or connected cloud storage, use [native memory](references/native-memory.md):
59
+ read the shared notebook, run the action, conditionally save and verify readback.
60
+ Group already justified private actions from the same turn with `native.batch`
61
+ to avoid a separate cloud save for every setup or recording step. Keep submission
62
+ previews and sends separate. Confirm one notebook save before refreshing its journal.
63
+ Use the launcher's `--response-file` option when the host can pass file contents
64
+ directly to its document tools; do not retype encoded state. Save a returned
65
+ `changed:true` candidate only through a supported exact-transfer route for normal
66
+ use; inline-copy storage is experimental and must be explained before selection.
67
+ If transfer fails, preserve the saved notebook and identify new work as unsaved.
68
+ When a supported save route is available, save a returned
69
+ `changed:true` candidate even when the inner action failed, then explain the
70
+ failure. A failed action and a failed save are different outcomes.
71
+ A disposable execution folder or uploaded source is not a durable journal.
72
+ Both apps can share one local directory or accessible cloud notebook; separate
73
+ private accounts are not automatically synchronized.
74
+
75
+ During first setup, explicitly ask whether the researcher wants to contribute to
76
+ Science Works' metascience research, following the onboarding guide's independent
77
+ choices. Keep existing preferences when returning. Declining or deciding later
78
+ leaves unchosen options off and does not block scientific work. Defer choosing
79
+ conversation sources and supporting activity categories until the first actual
80
+ analysis; opting in alone does not grant access to any source.
81
+ Offer optional broad discipline (choose any that apply) and career-stage categories during setup. Ask
82
+ separately whether to include them in reviewed usage reports; preserve existing
83
+ choices and never infer a demographic answer. Skipping does not affect any role.
84
+
85
+ Run `recall`, then use the role the researcher requested. Otherwise suggest one
86
+ relevant role in plain language when it would materially help the current task:
87
+ for example, “Would you like to work through the study design together?” Briefly
88
+ say what it adds, and let the researcher decline or continue normally. Do not
89
+ interrupt repeatedly, ask them to pick from the whole menu, or switch an active
90
+ role without agreement. Once declined, do not re-offer unless the task changes.
91
+ These instructions apply to every host/model that has loaded Benchside; they do
92
+ not create a background listener or permission to inspect other chats. Read only
93
+ the selected role's reference:
94
+
95
+ | Research activity | Role reference |
96
+ |---|---|
97
+ | Direction, exploratory questions, priorities and next steps | [Research supervisor](references/roles/pi.md) |
98
+ | A focused challenge to a proposed hypothesis and experiment | [Hypothesis reviewer](references/roles/pi-hypothesis.md) |
99
+ | Experiments, observational or computational study design | [Study-design consultant](references/roles/study-design.md) |
100
+ | A protocol, experiment or analysis is failing | [Methods troubleshooter](references/roles/methods-clinic.md) |
101
+ | Interpreting findings and choosing follow-up | [Results discussant](references/roles/results-meeting.md) |
102
+ | Making methods and analyses repeatable | [Reproducibility auditor](references/roles/repro-check.md) |
103
+ | Critical discussion of accessible papers | [Journal-club discussant](references/roles/journal-club.md) |
104
+ | Scientific review and revision priorities | [Scientific peer reviewer](references/roles/peer-review.md) |
105
+
106
+ Recall normally shows the latest five decisions and records, with total counts.
107
+ When asked about older work, use `recall` with `history:all` for the selected
108
+ project. Do not describe an item outside the recent view as missing or lost.
109
+
110
+ Call `start` for the role. It resumes an unambiguous open sitting or starts one.
111
+ Save meaningful checkpoints as the conversation progresses: the researcher's
112
+ actual decisions and reasons (`decide`), unresolved research questions (`question`),
113
+ and their answers when settled (`answer`). Use returned question IDs, not invented
114
+ critiques. A request for advice is not a decision: keep your recommendation in
115
+ discussion or a research record until the researcher chooses. Preserve supplied
116
+ decision wording exactly, with rationale separate;
117
+ do not turn suggested additions into agreed actions. Unknown answers stay open.
118
+ Before recording, distinguish supplied evidence from inference and proposals.
119
+ If a saved interpretation changes, append an explicit corrected record identifying
120
+ the old record, corrected claim and reason; follow the app guide. On recall, quote
121
+ decisions accurately and account for later corrections. Do not record every
122
+ utterance or the full chat. Batch related private saves within a turn; do not
123
+ wait until the conversation ends. These records stay private; usage can count
124
+ records but never includes their text. The adapter validates
125
+ them; never claim a record was saved after a failed call. A pause leaves the sitting
126
+ open. Only explicitly concluded or abandoned work changes those counts.
127
+ `pi` supports work without a hypothesis; `pi-hypothesis` is the focused reviewer.
128
+ Older saved sittings retain their original rules. If `start` reports
129
+ `role_update_available`, explain this only when it matters; a new broad sitting
130
+ can be opened with `new_sitting:true` without changing or closing the old one.
131
+
132
+ ## Optional sharing
133
+
134
+ Offer research-participation choices during first setup as described above. At a
135
+ natural stopping point, offer a review for the choices the researcher enabled:
136
+ workflow problems, usability feedback and usage counts. They can change choices
137
+ on request; do not repeatedly prompt after a decline or deferral. Declining any
138
+ choice must not affect scientific assistance.
139
+
140
+ Read [the sharing guide](references/sharing.md) before changing consent or sending.
141
+ Model-derived gaps must exclude private scientific findings and research-specific
142
+ details; public tool/dataset names and versions can remain. Share only the general workflow information allowed by
143
+ the sharing guide's optional context fields. Capture versions, workarounds and
144
+ impact from what the researcher already says; at most one useful follow-up at a
145
+ natural pause, with no requirement to fill missing fields. Follow
146
+ the sharing guides. Recording local observations is not permission to send them. Review each exact
147
+ prepared payload with the researcher, allow edits/exclusions, then send only the
148
+ approved draft and digest. Never approve a draft on the researcher's behalf.
149
+ For surveys only, agreement to the displayed study precedes answering; submit
150
+ the researcher's own answers as written without asking for approval again.
151
+
152
+ If optional study invitations were explicitly enabled, the metascience guide
153
+ also permits a quiet invitation check at a natural stopping point. It enforces
154
+ a weekly invitation limit. Survey participation and selected-activity analysis
155
+ remain independent of the three sharing choices above.
@@ -0,0 +1,261 @@
1
+ # App adapter
2
+
3
+ Sharing previews retain one current review batch per channel. A replacement
4
+ preview supersedes earlier drafts in that channel, so approve only the current
5
+ preview. An identical preview reuses its draft ID; failed sends retain those
6
+ exact bytes for retry. Original private observations/feedback and submitted
7
+ receipt history remain available.
8
+
9
+ The assistant executes `python3 <skill-directory>/scripts/benchside_app.py` for an
10
+ installed skill. Source setup saves `runtime/source.json` so this entry can use the
11
+ original Python environment and source directory from any working directory, even
12
+ when `bench` is not on PATH. Keep that environment/source available; after moving or
13
+ reinstalling it, rerun `bench setup` through the agent to refresh the saved paths.
14
+ Packaged skills use their bundled runtime instead. A checkout before setup can
15
+ use `uv run bench app`, or `bench app` when installed on PATH.
16
+ Provide one JSON object on stdin. Responses are JSON: `ok` plus `result`, or an
17
+ error. Read the result before continuing. Python 3.11+ and POSIX storage are required.
18
+ Use `{"action":"version"}` to check the running Benchside version without opening
19
+ research storage. Do not import modules directly from the sealed runtime cache.
20
+ `{"action":"connection.check"}` checks the official collector with a read-only
21
+ GET of `/v1/studies`, without opening a store or enabling participation. The result
22
+ includes `reachable`, `endpoint`, `method:GET` and `submitted:false`. This action
23
+ is called directly, not inside `native.run`/`native.batch`; it neither needs nor
24
+ updates a cloud notebook. It ignores test endpoint overrides. Success does not
25
+ prove that POST submissions work; only a verified receipt confirms delivery.
26
+
27
+ For native saves, the launcher accepts `--response-file /absolute/private/new-response.json`.
28
+ It writes the complete JSON response to a new owner-only file and prints a compact
29
+ summary: opaque `snapshot` and `markdown` are replaced by a `candidate` containing
30
+ the workspace ID, revision and digest. The full response file retains both fields
31
+ unchanged, including on inner action failure. Load `result.markdown` from that file
32
+ as data when constructing a guarded document-tool request; see [native memory](native-memory.md).
33
+ The file is a temporary transfer aid, not durable memory or a save confirmation.
34
+ Native requests accept an optional `document_limit_bytes` (32768–190000) for a
35
+ store that holds less than the default; Claude Docs uses 65536. Omit it elsewhere.
36
+ Use a fresh filename per call; an existing file is refused before the action runs.
37
+ If writing fails after execution, the full response is printed with
38
+ `response_file_error`: preserve it and check what completed before retrying.
39
+ Packaged dependencies are bundled, pinned and installed offline into a temporary runtime
40
+ cache, not into the researcher's project. Release bundles support standard CPython
41
+ 3.11–3.14 on macOS (Intel/Apple Silicon) and glibc Linux (x86-64/ARM64), with pip or
42
+ uv provided by the host. Do not change network settings or fetch replacement
43
+ packages when setup fails; report the error. For cloud accounts use [native memory](native-memory.md):
44
+ `native.run` restores a validated native document into a fresh temporary directory
45
+ for each call and returns a candidate to save through the host's native tools.
46
+ For local desktop storage the private journal defaults to `~/.local/share/benchside`;
47
+ `storage.configure` remembers a chosen durable directory outside Git in
48
+ `$XDG_CONFIG_HOME/benchside/storage.json` (default `~/.config/benchside/storage.json`).
49
+ An explicit `BENCHSIDE_HOME` overrides that preference; otherwise XDG/default
50
+ locations are used when no preference exists. Choosing a directory does not migrate data.
51
+
52
+ Do not use cloud `/tmp`, `/mnt/data`, or a disposable VM home as durable storage
53
+ without verification. Native document readback, including a new conversation,
54
+ is required before claiming cloud continuity. Building a package is not a host
55
+ integration test. The project source and researcher journals are separate.
56
+
57
+ ## Setup and continuity
58
+
59
+ - `{"action":"roles"}` lists the eight roles.
60
+ - `{"action":"participation.status"}` returns `response`: `unasked`, `declined`,
61
+ `deferred` or `configured`. After an explicit answer use `participation.set`
62
+ with `response:declined`, `deferred`, or `configured`. This remembers whether
63
+ setup already asked; it grants no permission and sends nothing. Save the
64
+ independent consent choices first. Decline/defer requires all participation
65
+ choices off; changing the marker never silently revokes existing consent.
66
+ - `{"action":"profile.status"}` returns optional demographic selections and
67
+ their separate inclusion preference. `profile.set` takes `demographics` and
68
+ boolean `include_in_usage`; see [sharing](sharing.md) for valid categories.
69
+ Both actions work through `native.run` as well as local storage.
70
+ - `{"action":"storage.location"}` returns the chosen local root as `storage`,
71
+ internal state as `agent`, and readable-copy root as `researcher`, without writing.
72
+ - `{"action":"storage.configure","directory":"/absolute/chosen/folder"}` verifies
73
+ a write and remembers the local choice. Use only after the researcher chooses it.
74
+ New configured stores use `agent/` for state and `researcher/projects/` for
75
+ human-readable ODT/Markdown files. Selecting an existing flat store does not
76
+ silently move its records. Not applicable inside `native.run`.
77
+ - `{"action":"storage.organise","confirm_idle":true}` explicitly upgrades an
78
+ existing local store. First update **every** agent that shares it to 0.4.0 or
79
+ newer and stop their active use; obtain the researcher's confirmation if that
80
+ cannot be established. Do not supply `confirm_idle:true` just to get past an error.
81
+ This copies and verifies existing state, switches to `agent/`, retains the
82
+ original in `agent/legacy-backup/`, and exports all saved projects. It never
83
+ changes project IDs, choices or receipts. Reopen the runtime afterward.
84
+ Old clients cannot understand the new layout; do not restart them against it.
85
+ Do not delete the backup automatically. Failed migrations retain the original
86
+ or verified active data; report the error without trying a manual file shuffle.
87
+ - `{"action":"records.preferences"}` reads this local store's document `format`
88
+ and whether it has been `configured`. An unset preference defaults to `odt`.
89
+ - `{"action":"records.configure","format":"both"}` saves the researcher's
90
+ choice of `odt`, `markdown` or `both` for every project in this local store.
91
+ It changes no journal or sharing choice. It applies to subsequent saves/exports;
92
+ refresh the current project after changing it. These actions are local-only;
93
+ native cloud documents retain the host's supported format.
94
+ - `{"action":"records.export","project_id":"<ID>"}` refreshes the complete private
95
+ reading copies in the selected format. Returns `odt` and/or `markdown` paths
96
+ only for files just refreshed. Each includes all saved events, not just recent recall.
97
+ Old unselected files are preserved and listed in `previous_copies_not_refreshed`;
98
+ do not present them as current or delete them automatically.
99
+ A refresh also occurs after each journal append and during local project setup.
100
+ If `readable_records_warning` is returned alongside a successful save, the
101
+ scientific record is already saved: retry only `records.export`, never the
102
+ recording action. Copies are generated views; edits do not change the journal.
103
+ Local CLI users can run `bench journal export`. This action needs durable local
104
+ storage; native cloud documents keep their existing human-readable pages and
105
+ use the host's own document-download tools if available.
106
+ - `{"action":"projects"}` lists existing local app project IDs/titles.
107
+ - `{"action":"setup","project_id":"<selected existing ID>","host":"unknown","surface":"unknown"}`
108
+ starts a new session in an existing project, including one created by another app.
109
+ Session app metadata is isolated; creation identity never changes.
110
+ For new projects supply `project_key` instead and a friendly `title` based on
111
+ the researcher's project description. When no useful name is known, ask once.
112
+ Supplying `title` with an existing project updates its display name and readable
113
+ folder, preserving its stable ID, scientific history and other files in that folder.
114
+ - `{"action":"storage.probe"}` writes a random marker and returns its token.
115
+ - `{"action":"storage.check","token":"<returned token>"}` checks the same store.
116
+ Run this after moving to a fresh conversation and resetting its execution
117
+ environment. The host must retain the storage path without ongoing user setup.
118
+ - `{"action":"setup","host":"unknown","surface":"unknown","project_key":"<actual stable project ID or folder>"}` returns `project_id` and `session_id`.
119
+ `host` is `claude`, `chatgpt`, or `unknown`; use `unknown` for Codex/other apps
120
+ under the current reporting schema rather than inventing a wire value. Surface is `web`, `desktop`, `cli`, or `unknown`.
121
+ Replace these neutral examples only with the actual known host/surface.
122
+ A Claude-named skill ZIP loaded in OpenCode is still `host:unknown`; a package
123
+ filename or model provider does not establish the host application.
124
+ Optionally supply `app_version` only when the host exposes a release version
125
+ (for example `1.2.3`); otherwise leave it `unknown`. Never use a user agent,
126
+ account identifier, model name or guessed version. It is included only in usage
127
+ reports if the researcher opts in and approves the preview.
128
+ - `{"action":"recall","project_id":"<returned ID>"}` returns private records,
129
+ unresolved critiques, recent decisions and open sittings. The default `history:recent`
130
+ includes the latest five decisions/records plus `total_decisions` and `total_records`.
131
+ Add `"history":"all"` to retrieve every saved decision and research record for
132
+ that project. The existing `recent_decisions`/`recent_records` field names are
133
+ retained in both modes. This is read-only and does not change sharing choices.
134
+ Terminal installations also support `bench recall --all`.
135
+ - `{"action":"start","project_id":"...","session_id":"...","role":"methods-clinic"}` returns the sitting and recall.
136
+ The sitting ID is `result.sitting.id`, not `result.sitting_id`. `setup` creates
137
+ a conversation session; `start` resumes an unambiguous existing open sitting
138
+ for the role rather than creating another discussion.
139
+ If multiple matching sittings exist, choose one from recall using `sitting_id`.
140
+ Explicit `new_sitting:true` opens a separate sitting, leaving existing ones intact;
141
+ do not combine it with `sitting_id`. Existing sittings keep their original rules.
142
+ `role_update_available:true` means its saved role version differs from the installed
143
+ definition. Use a new sitting for the changed rules when the researcher wants that.
144
+
145
+ ## Recording
146
+
147
+ Every recording request includes the returned `project_id`, `session_id` and
148
+ `sitting_id`. IDs for new records are generated by the runtime; quote returned IDs.
149
+
150
+ | Action | Additional fields |
151
+ |---|---|
152
+ | `question` | `question`: nonempty text; returns its new ID |
153
+ | `answer` | `question_id`, `answer`: nonempty text; answers an open question in this project |
154
+ | `hypothesis` | `statement`; optional `supersedes` |
155
+ | `record` | `record: {kind, summary, details: [...], sources: [...]}` |
156
+ | `critique` | `target: {kind: "claim", claim, ground}`, `{kind: "method", step, flaw}`, or `{kind: "interpretation", result, alternative}` |
157
+ | `resolve` | `critique_id`, `resolution`: `design_revised`, `rebutted`, or `accepted_as_limitation` |
158
+ | `decide` | `decision`, `rationale`; optional `supersedes` |
159
+ | `gap` | `gap` object described below |
160
+ | `close` | `converged`: true/false, `detail`: agreed outcome or explicit abandonment reason |
161
+
162
+ Record kinds: study-design → `study-design`; methods-clinic → `methods`;
163
+ results-meeting → `results`; repro-check → `reproducibility`;
164
+ journal-club → `literature`; peer-review → `review`.
165
+ These roles need a research record and decision before concluding. A literature
166
+ record also needs a real inspected source locator. `/pi` needs a decision to close
167
+ converged, not a hypothesis. `/pi-hypothesis` retains the focused hypothesis
168
+ requirement. All roles can save questions and answers. Open research questions do
169
+ not prevent a converged close; unresolved critiques do. Do not manufacture a
170
+ hypothesis, critique or decision to satisfy a rule.
171
+
172
+ `recall` includes `open_research_questions` with IDs and `recent_questions` with
173
+ answers (latest five, or all with `history:all`), plus `total_questions`.
174
+ `open_questions` is a readable list of unresolved research questions and critiques.
175
+ An answer is append-only: an already answered question cannot be overwritten.
176
+ Record a new question if new evidence reopens it. Questions and answers are private;
177
+ optional usage only counts these events in `records.record`. Legacy CLI supports
178
+ `bench question "..."` and `bench answer <question-id> "..."`.
179
+ Update all clients sharing a store before recording questions; older runtimes
180
+ cannot read the new question events.
181
+
182
+ ### Corrections and faithful recall
183
+
184
+ `record` entries are append-only, with no automatic supersession field. To correct
185
+ one, read the earlier entry and append another of the same kind, using actual
186
+ returned IDs. For example, after finding that the source omitted allocation:
187
+
188
+ ```json
189
+ {
190
+ "action": "record",
191
+ "project_id": "<returned project ID>",
192
+ "session_id": "<returned session ID>",
193
+ "sitting_id": "<returned sitting ID>",
194
+ "record": {
195
+ "kind": "literature",
196
+ "summary": "Correction: allocation method is unknown",
197
+ "details": [
198
+ "Corrects record <earlier record ID>: the description of allocation as nonrandomized was unsupported.",
199
+ "Replacement: recruitment used convenience samples; allocation is not reported in the supplied excerpt.",
200
+ "Reason: recruitment and treatment assignment are different; the excerpt cannot establish the allocation method."
201
+ ],
202
+ "sources": ["<actual inspected source locator>"]
203
+ }
204
+ }
205
+ ```
206
+
207
+ Verify the save, retaining the old entry. Check corrections on recall, using
208
+ `history:all` if needed; explain the current interpretation and identify the old
209
+ one as corrected. Never silently rewrite journal files or rely on a chat-only
210
+ apology. For changed decisions or hypotheses, use their documented `supersedes`
211
+ field instead. Quote a recalled decision exactly, with rationale and new advice
212
+ separate. A pending or unknown answer stays an open question, not an `answer`.
213
+
214
+ Method flaws: `missing_control`, `confound`, `under_powered`, `pseudoreplication`,
215
+ `selection_bias`, `unvalidated_instrument`. For concerns outside these categories,
216
+ use a grounded claim or interpretation target rather than misclassifying it.
217
+
218
+ Gap objects:
219
+
220
+ - `{kind:"missing_tool", task, reached_for, why_failed}`
221
+ - `{kind:"unfindable_data", sought, where_searched:[...]}`
222
+ - `{kind:"manual_toil", task, frequency}`
223
+ - `{kind:"dead_end", approach, cost}`
224
+ - `{kind:"missing_index", question}`
225
+
226
+ Describe workflow needs, not unpublished findings, names, project identifiers,
227
+ source documents or data. Scientific records remain private even if sharing is on.
228
+
229
+ ## Minimal example
230
+
231
+ After setup/start, record the observed methods problem using the actual returned IDs:
232
+
233
+ ```json
234
+ {
235
+ "action": "record",
236
+ "project_id": "<returned project ID>",
237
+ "session_id": "<returned session ID>",
238
+ "sitting_id": "<returned sitting ID>",
239
+ "record": {
240
+ "kind": "methods",
241
+ "summary": "Low recovery after extraction",
242
+ "details": ["Expected recovery is 80%; observed 20%.", "Proposed check: compare matched pre- and post-extraction spikes; localisation remains uncertain until the controls' coverage is established."],
243
+ "sources": []
244
+ }
245
+ }
246
+ ```
247
+
248
+ The example's content is illustrative. Record the researcher's actual evidence.
249
+
250
+ ## Optional metascience
251
+
252
+ The independent `metascience.*` actions require no role or consultation. See
253
+ [metascience](metascience.md) for consent, study invitations, scope selection,
254
+ random or researcher-chosen selection, private candidate gaps, supporting activity
255
+ categories, review and delivery. `metascience.gap` adds a sanitised candidate to
256
+ the normal gap-sharing flow. `metascience.join_study` saves agreement to a specific
257
+ survey before questions; supplied answers then authorise sending without a second
258
+ approval prompt. Other submission types still need exact review and approval.
259
+ Native document transport preserves this state alongside the other records.
260
+ The host retrieves only explicitly selected, sampled conversations using its
261
+ existing tools; the Python adapter neither reads chat logs nor runs a model API.
@@ -0,0 +1,69 @@
1
+ # Use the same Benchside runtime with another agent
2
+
3
+ Benchside does not choose or call an LLM. The surrounding agent supplies the
4
+ model, instruction loading, process execution and filesystem/document tools.
5
+ The same journal and consent rules apply to hosted and locally hosted models.
6
+ A bare chat completion endpoint or model server is not an agent with those tools.
7
+
8
+ ## Agent-led local setup
9
+
10
+ 1. Inspect the host's supported skill/instruction mechanism and process tool.
11
+ Use Python 3.11–3.14 on macOS or Linux. If Python, package installation or
12
+ execution is unavailable, explain that specific blocker instead of inventing
13
+ an HTTP/MCP service. A standard Windows install has not been validated.
14
+ 2. Follow the repository's `SETUP.md`. Install into a dedicated environment;
15
+ do not replace the host's dependencies. In a source checkout the agent can
16
+ run `uv sync --frozen`, then `uv run bench setup --agent generic --skills-dir
17
+ <observed-skill-directory>`. The launcher remembers that environment, which
18
+ must remain accessible. Do not clone code into the private records directory.
19
+ 3. Load the installed `benchside/SKILL.md`. Discoverable `.agents/skills` is the
20
+ generic default, but use the host's actual documented location. If the host
21
+ lacks skill discovery, use its supported instruction loader to load this
22
+ file; explain the one-time reference the researcher may need in a new chat.
23
+ 4. Run the installed `scripts/benchside_app.py` with JSON on stdin and read the
24
+ JSON response. Use the execution tool's stdin or a quoted file-writing API;
25
+ never interpolate researcher text into shell code. This is the same API in
26
+ every host, described in [app-api](app-api.md). No model API key goes into
27
+ Benchside. The agent's provider authentication is configured separately.
28
+ After an error, correct the documented request; do not switch to legacy CLI
29
+ journals or edit JSON/JSONL records directly. For example, the app action is
30
+ `decide`, not `decision`; the full request fields are in the app guide.
31
+ 5. Follow [onboarding](onboarding.md): chosen private store outside Git, project,
32
+ a labelled synthetic save/readback after the storage choice, independent
33
+ participation choices and fresh-chat restore.
34
+ Use `host:unknown` for other agents and the actual supported `surface` value;
35
+ do not invent a provider value in the reporting schema.
36
+
37
+ The agent runs installation and repair commands. Ask the researcher only for
38
+ missing access, host approval, a storage/project choice or participation choices.
39
+ If the host requires manual interaction, name the exact blocker and smallest
40
+ necessary action; do not turn setup into a terminal tutorial by default.
41
+
42
+ ## Host qualification: isolated synthetic testing
43
+
44
+ This section is for maintainers qualifying a host, not ordinary researcher setup.
45
+ Use a separate synthetic store and projects, never an existing researcher's
46
+ records or participation preferences. Do not change real consent to test a decline.
47
+ Any live submission test requires a separately reviewed synthetic payload and
48
+ approval; ordinary onboarding must not send test records.
49
+
50
+ Check one role's scientific reasoning as well as its tool calls. Verify a saved
51
+ decision in a fresh session, isolation of a second project, and that declining
52
+ sharing leaves all choices off. Failed sends must keep the reviewed draft pending.
53
+ Do not claim every model is supported because the Python launcher works: smaller
54
+ models may miss instructions, misuse tools or fail to verify a result.
55
+
56
+ When offering local storage with a remotely hosted model, tell the researcher
57
+ briefly that local record storage does not keep the conversation local: the
58
+ host still sends prompts to its model provider. Do not imply local-only processing.
59
+ For entirely local processing, both the model and execution/storage must be local;
60
+ optional approved contributions still go to Science Works.
61
+
62
+ ## Browser-hosted developer environments
63
+
64
+ Codespaces can supply Python, a filesystem and network access, but a separate
65
+ ChatGPT conversation does not automatically control it. A tool-enabled agent
66
+ inside that environment would still be needed for agent-led setup. Treat this
67
+ as an optional developer route, not a workaround that fixes free web Chat.
68
+ Records must remain outside Git and need an agreed backup: deleting the remote
69
+ environment can delete its local journal. Do not create one without a request.