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
@@ -0,0 +1,313 @@
1
+ # Set up Benchside in any capable agent
2
+
3
+ Use this flow on first use and when the researcher asks to change storage. Do not
4
+ infer a storage preference from the model or app name. Setup has two independent
5
+ choices: where private research records live, and optional contributions to Science Works.
6
+
7
+ ## Inspect capabilities, then verify the researcher's choices
8
+
9
+ Inspect the current host's actual tools and installed connectors. Check code
10
+ execution (Python 3.11+, POSIX), durable local filesystem access, and native or
11
+ connected document storage. Do not install a cloud connector or create an account
12
+ without the researcher's request. A connector being installed does not prove it
13
+ can write or safely update records. Ordinary chat memory is not a journal.
14
+ Run the execution check and inspect storage tools without writing first. Offer
15
+ candidate stores as available but not yet verified. Only after the researcher
16
+ chooses a store may setup create its labelled synthetic test project and perform
17
+ the write/readback probe. Keep existing records and participation choices intact.
18
+
19
+ Use the following checks separately. Report what actually passed, what failed
20
+ and what has not been tested; do not infer capabilities from a plan name.
21
+
22
+ | Check | Evidence required | If unavailable |
23
+ |---|---|---|
24
+ | Execution | Invoke the installed launcher with `{"action":"version"}` and read its successful response. | Say the package may be installed but this chat cannot run it. Do not claim a running journal or ask storage/consent questions that cannot be saved. |
25
+ | Private memory | Access a chosen durable store, save a synthetic Benchside decision, read it back, then restore it in a fresh chat/process. | Offer another actually available store, or continue an explicitly unsaved research discussion. Same-chat readback is provisional until fresh-chat restore passes. |
26
+ | Optional sending | Only after the researcher requests a connection check or opts into a network feature, invoke `{"action":"connection.check"}` directly through the launcher. | Private work still works. Leave reviewed submissions pending; explain the missing HTTP capability or failed reachability check. |
27
+
28
+ `connection.check` performs only a bounded GET of the public Science Works study
29
+ catalog. It sends no contributor ID or research content, opens no private store,
30
+ changes no consent and submits no record.
31
+ The request contacts `ingest.benchside.science.works`; normal request metadata
32
+ includes the connection's source address, request time and Benchside version.
33
+ Do not describe it as sending no information at all. A successful check proves reachability,
34
+ not POST permission or delivery. Only an approved submission with a matching
35
+ receipt proves delivery. Do not enable surveys or send dummy records as part of
36
+ ordinary setup. Do not run this check repeatedly in research conversations.
37
+
38
+ If a tool is missing, check the host's documented tool-discovery mechanism once.
39
+ If it remains unavailable, explain the limit and the simplest supported route.
40
+ Do not propose Work mode when the account has no such option, ask for unavailable
41
+ connectors repeatedly, or promise that upgrading alone guarantees the tools.
42
+ The current supported ChatGPT route is a paid account with working execution
43
+ and private document tools; free web Chat has not passed these checks. Claude
44
+ and local agents must pass the same checks with their own tools.
45
+
46
+ Never substitute an invented Markdown directory, the chat transcript, a Library
47
+ upload, or a disposable sandbox for Benchside's private journal. Exporting notes
48
+ for the researcher is possible when requested, but is not installed persistence.
49
+ The collector receives optional metascience contributions, never private notebooks.
50
+
51
+ For an installed skill, invoke `scripts/benchside_app.py`. A packaged skill uses
52
+ `runtime/manifest.json`; source setup saves `runtime/source.json` with the original
53
+ Python environment and source location, so later conversations can run it outside
54
+ the checkout without `bench` on PATH. If that saved environment or source was moved
55
+ or removed, restore/reinstall it and rerun `bench setup` for the same skill location.
56
+ Do this through the agent; the researcher need not run repair commands. All routes accept the same JSON on stdin
57
+ and return the same JSON result. Pass input through the execution tool, not shell
58
+ interpolation. The researcher should not have to type commands.
59
+
60
+ If starting from a Git checkout, the agent can install the project using its
61
+ available Python package manager (for example `uv sync --frozen`) and invoke
62
+ `uv run bench app`. For discovery and runtime access in later conversations,
63
+ `uv run bench setup --agent codex` installs the shared skill in `~/.agents/skills`;
64
+ `--agent claude` installs
65
+ it in `~/.claude/skills` with the legacy `/bench-init` helper. For another host,
66
+ use `--agent generic --skills-dir <its observed skill directory>`. If it cannot
67
+ automatically discover skills, tell the researcher to reference the installed
68
+ `benchside/SKILL.md` in a new conversation. Do not claim automatic discovery until tested.
69
+ For non-OpenAI/non-Anthropic hosts, follow [generic agents](generic-agents.md).
70
+
71
+ When changing installation method or replacing a release, use the host's complete
72
+ plugin update flow or stage the replacement in a clean directory. Do not unzip a
73
+ packaged release over a source-installed skill: its retained `runtime/source.json`
74
+ would still select the earlier source environment. Copying over an existing folder
75
+ also retains files removed or renamed by the new release. Preserve custom files
76
+ separately and replace only the managed installation after checking the new copy;
77
+ do not delete unknown files. Keep private record storage in place and reopen the
78
+ same project after the update.
79
+
80
+ ## Ask where records should live
81
+
82
+ Offer only locations the host can actually access, and explain which still need
83
+ verification. Ask a short question, for example:
84
+
85
+ > Where would you like Benchside to keep your research records: this computer,
86
+ > your app's private Benchside folder/Space, or a connected storage service?
87
+
88
+ Respect a location already chosen by the researcher; confirm it by reading it,
89
+ not by asking the same question again. Native cloud storage can be used by a
90
+ local agent too if its tools support it. An existing preference is a candidate
91
+ on a new host, not permission to copy or relocate research records.
92
+
93
+ - **This computer:** ask for or suggest a durable folder outside Git. Inspect
94
+ `storage.location` first so the current location is visible. Call
95
+ `storage.configure` with the agreed absolute directory. It verifies a local
96
+ write and remembers the folder in the OS account's Benchside configuration.
97
+ `BENCHSIDE_HOME`, if set, takes precedence. Configure does not copy, move or
98
+ delete earlier records. A new location starts a separate notebook unless it
99
+ already contains one. Never silently switch an established project.
100
+ - **App-native storage:** use a private Benchside Space/collection and notebook
101
+ through [native memory](native-memory.md). Offer this only with complete reads,
102
+ conditional writes, readback and an exact data-transfer route to/from the
103
+ execution environment. Inline tool text that the model must retype is an
104
+ experimental route, even if a small test passes; explain that limitation
105
+ before selection. ChatGPT Pages and Claude Docs are examples;
106
+ account capabilities decide availability. A Library upload alone is insufficient.
107
+ - **Connected storage:** ask which actual service/location. Google Drive and
108
+ Google Cloud Storage are different services. Inspect the installed connector
109
+ and offer a private document/object only if it supports the same native-memory
110
+ protocol. Require a revision/hash/generation precondition on updates, complete
111
+ reads, discoverable stable IDs, readback and exact transfer to/from execution.
112
+ Do not invent a Google API or ask
113
+ for an API key when the installed connector can provide access. If the connector
114
+ is read-only or has only blind overwrites, explain the missing capability and
115
+ offer a working local/native option. No Google connector is bundled here.
116
+
117
+ For native/connected storage, save the notebook locator and workspace ID in a
118
+ private host-discoverable index. Always restore the complete notebook before
119
+ continuing. The local path preference does not redirect native requests.
120
+
121
+ For local storage, include one optional question with the storage choice:
122
+ “Which format would you like for your readable records: ODT (default), Markdown,
123
+ or both?” First read `records.preferences`; preserve a configured choice rather
124
+ than asking on each visit. Save the answer with `records.configure` (`format` is
125
+ `odt`, `markdown` or `both`). If the researcher skips the choice, explain that ODT
126
+ will be used and save that default so it is not asked again. This applies to all
127
+ projects in this store and can be changed later. It does not alter the agent's
128
+ journal format or sharing consent. For cloud documents, explain the host's native
129
+ format; only offer downloadable formats its tools actually support.
130
+
131
+ ## Choose the project and prove continuity
132
+
133
+ For local storage, call `projects`. For document storage, call `native.inspect`.
134
+ Show existing titles/IDs and let the researcher select one or create a new project.
135
+ A project is a separate scientific notebook: existing restores its decisions,
136
+ open questions and discussions; new starts an empty, separate record. This does
137
+ not change available roles or reporting consent, which belongs to the chosen
138
+ Benchside store. If the current project is already clear, reuse it without asking.
139
+ Never merge by title. When returning, pass the selected `project_id` to `setup`;
140
+ this reuses the same journal regardless of the app. For new local projects pass a
141
+ stable `project_key` (an actual project ID or absolute research folder) and a
142
+ human-readable `title`. Native setup registers the actual journal document ID.
143
+
144
+ Legacy CLI journals are separate from app projects. If the researcher is returning
145
+ to earlier CLI work, continue that journal explicitly or agree a migration first;
146
+ do not create an empty app project and call it restored. Shared setup preserves
147
+ existing journals and custom role skills. Recognized generated legacy skills
148
+ become explicit-invocation-only, so automatic role selection uses this shared flow.
149
+
150
+ Keep the returned session ID for this conversation. Record the selected notebook
151
+ locator in the host's durable setup context, not just in the execution sandbox.
152
+ Run the appropriate save/readback probe and test discovery in a fresh conversation.
153
+ A same-process test is useful but does not establish fresh-chat continuity. Report
154
+ what was verified and what still needs the researcher to reopen a chat.
155
+ Keep any synthetic decision in a clearly labelled test project, separate from
156
+ real scientific work. Check the returned record, not merely whether a file exists.
157
+
158
+ Two agents with access to the **same local directory** can select the same project
159
+ and continue its records. Local transactions use filesystem locks. Two agents
160
+ with access to the **same cloud notebook** can do the same using conditional writes
161
+ and conflict retries. Different Claude/OpenAI private accounts are not automatically
162
+ connected. A synced local folder on two computers is not safe concurrent storage:
163
+ filesystem locks do not coordinate across sync clients; use a conditional-write
164
+ cloud connector or one local machine instead.
165
+
166
+ ## Ask about contributing to metascience research
167
+
168
+ Ask these questions only after working execution and a writable private store
169
+ are established, so choices can actually be recorded. A fresh-chat restore test
170
+ may still be pending; say so. Use the host's question UI if it has one, otherwise
171
+ use concise questions in chat. Missing pop-up controls do not block setup.
172
+
173
+ During first setup, explicitly ask about optional participation; do not defer this
174
+ question until the end of the first scientific discussion. Read `participation.status`,
175
+ `sharing.status` and `metascience.status` first so existing choices are preserved when another app
176
+ opens the same store. Returning to a project or changing storage settings is not
177
+ an invitation to ask for consent again. Let the researcher reopen these choices
178
+ at any time.
179
+
180
+ Use a short invitation, for example:
181
+
182
+ > Would you like to contribute to Science Works' research on how AI is used in
183
+ > science? You can choose what to contribute, keep everything private, or decide later.
184
+
185
+ A general expression of interest is not consent to every category. If interested,
186
+ show the following choices together, with nothing preselected. Use multi-select
187
+ when available, or accept a list in chat. “Decline all” is mutually exclusive
188
+ with enabling categories; ask only if the response is contradictory:
189
+
190
+ | Choice | What participation means |
191
+ |---|---|
192
+ | Workflow observations | Review descriptions of missing tools/data, repeated manual work, dead ends and missing indexes before sharing them. |
193
+ | Usability feedback | Optionally give a rating and comment after using Benchside; do not ask for an experience rating during setup. |
194
+ | Usage counts | Share reviewed counts of consultations, roles, app/version information and failures. A random installation ID helps estimate repeat use; no research text is included. |
195
+ | Optional surveys | Receive occasional study invitations, at most one per seven days; each survey explains its purpose, data use and retention before participation. |
196
+ | Selected-conversation analysis | Privately analyse up to 20 relevant conversations from the previous complete week, randomly selected or researcher-chosen. Find workflow problems for reviewed gap sharing; activity categories provide optional supporting context. |
197
+
198
+ Explain that model-derived problem reports exclude private findings, hypotheses,
199
+ measurements, sample identifiers, detailed protocols and source passages. Public
200
+ software/dataset names and versions can remain when they explain a workflow
201
+ problem. Raw transcripts never go to Science Works. Researcher-written survey
202
+ answers are sent as written under the agreement for that study; do not copy or
203
+ infer extra scientific details into them.
204
+
205
+ New contributions share a random pseudonymous ID, allowing Science Works to group
206
+ problems and optional feedback, usage, surveys and activity over time. Explain
207
+ this before saving choices. Older unlinked grants need a renewed choice. The ID
208
+ identifies a private store, not an exact person or account. These preferences
209
+ apply to that store, including its projects and apps sharing it; they are not
210
+ account-wide permission to read conversations.
211
+
212
+ Follow [sharing](sharing.md) for the first three choices and
213
+ [metascience](metascience.md) for invitations, analysis and sharing workflow categories.
214
+
215
+ Sending needs network access to `ingest.benchside.science.works`. If the
216
+ researcher turns on any choice that sends data and your commands run in
217
+ Anthropic's cloud (claude.ai or Claude Desktop chat), tell them once how to allow
218
+ that domain (steps in [sharing](sharing.md)); until then, reviewed items stay
219
+ saved and unsent. This never blocks setup. In Claude Code the commands run on
220
+ their own computer, so say nothing. Elsewhere, mention it only if a send is blocked.
221
+ Record only explicit choices with the existing consent actions and persist them
222
+ before enabling the corresponding work. Do not grant every category from a vague
223
+ "yes". Declining or deferring leaves unchosen options off and never blocks setup
224
+ or scientific assistance. Do not re-offer declined/deferred choices in every chat.
225
+ Persist `participation.set` with `response:declined` or `deferred` after those
226
+ answers, or `configured` after saving the individually chosen permissions. This
227
+ marker is private setup history, not consent. Legacy notebooks may lack it: do
228
+ not interpret a returning project's `unasked` marker as permission to repeat the
229
+ pitch. Preserve existing choices and let the researcher reopen them.
230
+
231
+ If conversation analysis is selected, save that preference and finish setup.
232
+ Do not ask for source scopes or supporting activity-category sharing yet. Leave
233
+ new scopes empty and activity sharing off. At the first actual analysis request,
234
+ explain which conversations the host can access, let the researcher select them,
235
+ and save the scope before reading their contents. Preserve existing scoped
236
+ choices when returning; never broaden them from a general opt-in.
237
+
238
+ At that first analysis, offer the optional supporting context in plain language:
239
+ “For example, we can count literature review or data analysis, whether a tool
240
+ failed, and whether you checked its output. Would you like to review those labels
241
+ alongside the workflow problems?” They describe how AI was used, not scientific
242
+ results. Nothing is sent without review. Shared batches include the same random
243
+ contributor ID, but no project or conversation identifiers. Keep this secondary
244
+ to finding workflow gaps, and do not present internal field names as a setup quiz.
245
+ No background monitoring or scheduled runs are implied.
246
+
247
+ Consent during setup enables the selected workflow, not automatic transmission.
248
+ Gap, feedback, usage and activity submissions require exact preview and approval.
249
+ For surveys, agree to the study before questions; supplying answers then authorises
250
+ submission without a second prompt. Explain that
251
+ choices can be changed later; stopping participation blocks future activity/sends
252
+ but does not erase data already received. Do not claim an unavailable receiving
253
+ route or connector is working. A saved preference can remain pending deployment.
254
+
255
+ ## Keep the remaining setup short
256
+
257
+ The essential questions are where records live, which existing/new project to use,
258
+ and whether to contribute to metascience. Ask one optional scientific-context
259
+ question if the conversation has not already answered it:
260
+
261
+ > What are you working on, and what would you like help with first?
262
+
263
+ Use that answer to suggest a role; all eight remain available. Do not require a
264
+ fixed role, institution, email address or demographic profile. Ask for source
265
+ documents or more scientific detail when the actual task needs them.
266
+
267
+ Offer one optional demographic question, following [sharing](sharing.md):
268
+
269
+ > Would you like to add your broad research discipline and career stage? You can
270
+ > skip either. If you choose to include them in reviewed usage reports, they help
271
+ > Science Works understand which groups are trying Benchside.
272
+
273
+ Let the researcher select multiple broad disciplines if applicable and one career stage; never infer them from papers, names,
274
+ institution or conversation content. Then ask whether to include those choices
275
+ in usage reports or keep them private. This does not turn on usage reporting.
276
+ Use `profile.status` to preserve existing choices; do not ask again on every visit.
277
+ When an unset profile is skipped, run
278
+ `{"action":"profile.set","demographics":{},"include_in_usage":false}` so the
279
+ nonzero profile revision records that setup already offered the question.
280
+ Use an empty object, not `[]` or an empty discipline list. Do not clear an
281
+ existing profile because the researcher skipped a repeat question. A changed
282
+ profile requires a fresh usage preview. These categories do not gate any role or
283
+ change scientific advice; adapt advice to the actual task and stated preferences.
284
+
285
+ Finish with one brief confirmation of the project, storage/readable-record link,
286
+ saved participation choices and any unverified capability. Then move to the
287
+ research question and a relevant role; do not recite the role menu, internal IDs,
288
+ state names or the same continuity caveat repeatedly. Keep those details for
289
+ troubleshooting when needed. Translate internal critique states into ordinary
290
+ language and map the researcher's answer to the appropriate action yourself.
291
+ Do not suggest that any private journal must be uploaded to Science Works.
292
+
293
+ ## Readable records in local storage
294
+
295
+ Use the chosen root, not a source checkout. New configured stores separate
296
+ `agent/` (runtime-managed state) from `researcher/projects/<friendly name>/`.
297
+ ODT is the default reading document; Markdown or both can be chosen. They contain
298
+ all saved project events and refresh after recording. Return the actual file
299
+ links from setup or `records.export`; do not ask the scientist to read JSON or
300
+ navigate hashed internal project IDs. Give each project a friendly title.
301
+
302
+ Existing flat stores remain readable until explicitly upgraded through
303
+ `storage.organise`. Update every sharing agent first, stop their active use,
304
+ then follow the app guide's confirmed upgrade. The runtime verifies copies and
305
+ retains a private legacy backup. Do not move a store while someone is testing
306
+ in another agent. File exports stay outside Git, remain private, and do not
307
+ change consent. They are reading copies; ask Benchside to save corrections.
308
+ After a format change, refresh the current project with `records.export` and
309
+ link only the returned current files. `previous_copies_not_refreshed` lists old
310
+ formats left untouched; explain that they are no longer refreshed. Do not delete
311
+ them, as the researcher may have edited them.
312
+ Native cloud notebooks keep the existing private notebook and readable pages;
313
+ do not promise ODT download when that host lacks a document-export tool.
@@ -0,0 +1,159 @@
1
+ # One optional sharing flow
2
+
3
+ Offer these choices together in plain language during first setup, alongside the
4
+ optional studies described in `onboarding.md`. Existing preferences persist. A
5
+ broad "yes" to contributing needs a choice of categories before consent is saved.
6
+ Declining or deciding later leaves unchosen options off; do not repeatedly prompt
7
+ on return. At natural stopping points, offer reviews for enabled choices.
8
+
9
+ 1. Workflow observations: edited descriptions of missing tools, hard-to-find data,
10
+ repeated manual work, dead ends and missing indexes. No project or conversation IDs.
11
+ 2. Feedback: the researcher's ease-of-use rating (1–5), whether they would use
12
+ Benchside again (`yes`, `no`, `unsure`), and an optional comment. Never infer a
13
+ rating from their conversation. No sitting or gap identifiers.
14
+ 3. Usage: weekly consultation counts, role/app/version information and standardised
15
+ failure counts. A random persistent installation ID estimates returning use.
16
+ No research text, project titles, conversation IDs or exact activity times.
17
+ Optional, self-reported discipline and career-stage categories are included
18
+ only with the separate profile choice below.
19
+
20
+ New sharing includes one random contributor ID per private Benchside store,
21
+ reused from the usage installation ID. Explain before consent that Science Works
22
+ can group this store's contributions across channels and over time, including
23
+ previous usage reports with that ID. It is pseudonymous, not anonymous or a
24
+ verified person. No account email/name is requested. Existing unlinked grants
25
+ need a renewed explicit choice (`sharing.status.needs_policy_renewal`); do not
26
+ silently upgrade them. Multiple apps using the same store share the ID; separate
27
+ stores have separate IDs. Legacy received observations are not retroactively linked.
28
+
29
+ Before preparing any model-derived free-text observation or feedback comment, remove scientific
30
+ results, hypotheses, measurements, identifying sample/data details, detailed
31
+ protocols or analyses, source passages and project-specific names. Describe the
32
+ general workflow need instead, or omit the item if generalising it would change
33
+ its meaning. Public software/dataset names, versions and general failure details
34
+ may remain: “Fiji 2.16 loses channel names on export” is useful workflow information.
35
+ Private findings and identifying research details remain excluded. Researcher-written
36
+ survey answers follow their accepted study agreement and are preserved as written.
37
+ The format permits free text, so automatic identifier scrubbing cannot enforce
38
+ this boundary by itself; the assistant must check the content before preview.
39
+
40
+ Ground each proposed gap in an observed difficulty or an explicit researcher
41
+ report. A suggested future task is not evidence that the researcher experienced
42
+ manual toil. Say a tool was tried or failed only when a tool result or researcher
43
+ report supports that claim. An assistant lacking access to a tool does not show
44
+ that the tool cannot do the task or that no suitable tool exists. Preserve that
45
+ distinction in the wording; if the problem itself is uncertain, ask one useful
46
+ clarification at a natural pause or omit the candidate. Approval to send does not
47
+ turn an unsupported inference into an observed fact.
48
+
49
+ Data goes to Science Works' collector. These choices are separate from private
50
+ scientific records. An installation is not necessarily a person. Revoking consent
51
+ stops future submissions; it does not delete previously received data.
52
+
53
+ ## Calls
54
+
55
+ Workflow gaps can include an optional `context` object. Supported text fields are
56
+ `tool_name`, `tool_version`, `dataset_name`, `dataset_version`, `workflow_area`,
57
+ `frequency`, `impact`, `workaround` and `desired_improvement` (each at most 2000
58
+ characters). Use only the relevant fields; omit unknown values and the entire
59
+ object when there is nothing to add. The existing kind-specific fields remain.
60
+ Record the version actually used, never guess it or substitute the newest release.
61
+ Use public tool/dataset names only; private dataset identifiers and scientific
62
+ details stay private. Context is included in the same reviewed payload and
63
+ subject to the same redaction and approval checks.
64
+
65
+ Capture useful context already given in the conversation. At a natural pause,
66
+ ask at most one short follow-up if it would materially clarify the problem, such
67
+ as what workaround they use. Do not ask a checklist, repeatedly fill missing
68
+ fields, or interrupt the research to complete a report. Missing context is fine.
69
+ Context-bearing submissions use `benchside.gaps.v3`; the adapter chooses this
70
+ automatically. Older submissions and gaps without context keep their format.
71
+
72
+ - `sharing.status` returns current choices.
73
+ - `sharing.consent` takes `channel` (`gaps`, `feedback`, `usage`) and boolean
74
+ `enabled`. For gaps also supply `kinds`, selected from the five supported kinds.
75
+ Only call after the researcher makes that choice.
76
+ - `sharing.feedback` takes `feedback: {role, host, surface, ease, would_use_again, comment}`.
77
+ Unknown role/app/surface values use `unknown`. Returns an independently generated
78
+ feedback ID. This saves locally and sends nothing.
79
+ - `sharing.preview` takes `channel`. Gaps optionally take `only: [observation IDs]`
80
+ and `edits: {observation ID: reviewed gap object}`; feedback takes `feedback_id`
81
+ and optionally an edited `comment`; usage optionally takes `week` (Monday date).
82
+ - The preview returns one or more drafts, each containing its exact `payload`,
83
+ `destination`, `payload_sha256` and draft `id`. Display the complete content of
84
+ each draft in readable form, including every text field and usage count, plus the
85
+ recipient. Explain that redaction cannot catch all identifying research details.
86
+ If the researcher edits anything, prepare and show a new draft.
87
+ - After explicit approval, call `sharing.send` with that `draft_id` and its
88
+ `approved_sha256`. Do not replace the payload, infer approval, or send subsequent
89
+ batches that were not reviewed. A rejected or uncertain submission stays pending.
90
+ Retry the same draft after a network failure; do not regenerate it to retry.
91
+ - If `sharing.send` specifically says a proxy blocked the HTTPS tunnel, nothing
92
+ was sent and the draft stays pending. An ordinary HTTP 403 response proves only
93
+ that no valid receipt was received, not that the destination saw no data.
94
+ In Claude chat (web, desktop), a tunnel refusal usually means code
95
+ network access is off. The researcher can open Settings → Capabilities, switch on
96
+ Allow network egress, keep "Package managers only", and add
97
+ `ingest.benchside.science.works` under Additional allowed domains (verified on
98
+ an individual plan). Team/Enterprise owners control this for everyone. In
99
+ Claude Code, approve the domain when asked. Elsewhere it is usually an
100
+ institutional firewall. Never change settings yourself.
101
+ - `sharing.history` returns receipts. Give the researcher the channel, digest and
102
+ received date for an operator-assisted removal request. New contributions can additionally
103
+ be located with their random contributor ID. Do not send a removal request yourself
104
+ unless the researcher explicitly asks.
105
+
106
+ Usage reports are cumulative weekly snapshots. Repeated reporting replaces older
107
+ revisions in analysis; it does not add another session. End of a chat is not
108
+ abandonment. Offer a refreshed usage preview when the researcher next returns,
109
+ without interrupting their work or creating an unsolicited automation.
110
+
111
+ ## Optional demographic categories
112
+
113
+ `profile.status` returns the private profile and its revision (zero means no
114
+ choice has been saved). `profile.set` replaces it:
115
+
116
+ ```json
117
+ {"action":"profile.set","demographics":{"discipline":["computer_information_sciences","life_sciences"],"career_stage":"doctoral_researcher"},"include_in_usage":true}
118
+ ```
119
+
120
+ Only save the researcher's actual selections. `demographics:{}` skips both;
121
+ either field may be omitted or null. `include_in_usage` defaults to false in a
122
+ new store and must be explicitly supplied when changing the profile. It is
123
+ independent of usage consent and never sends data by itself. The host uses normal
124
+ native save/readback for this state when cloud storage is selected.
125
+
126
+ Allow multiple disciplines; a researcher working across computer science and
127
+ life sciences can select both. Use a multi-select control or accept a list in
128
+ chat. Never require a single umbrella “interdisciplinary” answer. Legacy single
129
+ string values remain supported; new multiple selections use a nonempty array
130
+ of distinct category values. “Prefer not to say” cannot be combined with other
131
+ disciplines. Career stage remains a single choice. No need to expose schema
132
+ constraints or ask repeatedly for skipped answers.
133
+
134
+ Present these values with readable labels, not code identifiers:
135
+
136
+ - Discipline: life sciences, medical/health sciences, physical sciences,
137
+ mathematics/statistics, computer/information sciences, engineering/technology,
138
+ earth/environmental sciences, social sciences, humanities/arts,
139
+ interdisciplinary, other, prefer not to say.
140
+ - Career stage: undergraduate student, master's student, doctoral researcher,
141
+ postdoctoral researcher, research staff, independent researcher or group
142
+ leader, other, prefer not to say.
143
+
144
+ Wire values use underscores (`medical_health_sciences`, `masters_student`,
145
+ `independent_researcher_or_group_leader`, `prefer_not_to_say`, etc.). Do not
146
+ request free-text details for “other”, an institution, age, name or email.
147
+ Do not infer answers. An omitted answer differs from an explicit “prefer not
148
+ to say”. The profile belongs to this chosen store; for a store shared by several
149
+ people, skip demographic reporting rather than assign one person's categories
150
+ to everyone.
151
+
152
+ If opted in, the exact usage preview shows the selected categories alongside the
153
+ random installation ID. They never enter gap observations, feedback, survey or
154
+ activity payloads. Changing or disabling the profile invalidates pending usage
155
+ drafts; make a new preview and obtain approval. It does not erase reports already
156
+ received. Aggregate reports count the latest accepted profile per participating
157
+ store; each selected discipline counts once, so discipline totals can exceed
158
+ the number of installations. New pseudonymous contributions can be grouped with it internally; published
159
+ reports should contain aggregate counts, not identifiers or raw responses.