open-research-protocol 0.4.2 → 0.4.4

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.
@@ -43,8 +43,10 @@ Use this loop when an AI agent is the primary operator of an ORP-enabled repo.
43
43
 
44
44
  ## 6. Checkpoint
45
45
 
46
- - Before handoff, compaction, `git commit`, or `git push`, write a checkpoint:
47
- - `scripts/orp-checkpoint.sh --sync --agent-file /path/to/agent/instructions.md "checkpoint note"`
46
+ - Before handoff, compaction, or any meaningful git transition, write a checkpoint:
47
+ - `orp checkpoint create -m "checkpoint note" --json`
48
+ - If the current state should exist off-machine before you stop, hand off, or compact:
49
+ - `orp backup -m "backup current work" --json`
48
50
 
49
51
  ## 7. Respect the Boundary
50
52
 
@@ -0,0 +1,337 @@
1
+ # Canonical CLI Boundary
2
+
3
+ Use this document as the canonical boundary for ORP system ownership.
4
+
5
+ The npm/CLI package is the source of truth for ORP runtime state and contract
6
+ semantics. The Rust desktop app and the web app should reflect that truth, not
7
+ replace it.
8
+
9
+ ## Goal
10
+
11
+ Keep one authoritative ORP contract for:
12
+
13
+ - local repo governance
14
+ - local project/session/runner state
15
+ - hosted auth and hosted workspace operations
16
+ - runner delivery, lease, and retry semantics
17
+ - machine-readable JSON surfaces for agents and UI layers
18
+
19
+ This lets ORP work in three modes without changing the underlying model:
20
+
21
+ - CLI-only
22
+ - CLI + Rust desktop UX
23
+ - CLI + hosted web UX
24
+
25
+ ## Non-Negotiable Rule
26
+
27
+ If Rust or web needs a new ORP capability, the canonical behavior should first
28
+ exist in the CLI contract.
29
+
30
+ UI surfaces may:
31
+
32
+ - rename concepts for clarity
33
+ - hide advanced controls
34
+ - present minimal or full modes
35
+ - automate CLI actions behind the scenes
36
+
37
+ UI surfaces must not:
38
+
39
+ - invent a second project/session/runner state model
40
+ - redefine lease or routing behavior
41
+ - store conflicting link truth outside CLI-owned artifacts
42
+ - make "minimal mode" mean a different ORP protocol
43
+
44
+ ## CLI-Owned Domains
45
+
46
+ The CLI permanently owns these domains.
47
+
48
+ ### 1. Repo Governance
49
+
50
+ Commands:
51
+
52
+ - `orp init`
53
+ - `orp status`
54
+ - `orp branch start`
55
+ - `orp checkpoint create`
56
+ - `orp backup`
57
+ - `orp ready`
58
+ - `orp doctor`
59
+ - `orp cleanup`
60
+
61
+ Canonical tracked artifact paths:
62
+
63
+ - `orp/governance.json`
64
+ - `orp/agent-policy.json`
65
+ - `orp/HANDOFF.md`
66
+ - `orp/checkpoints/CHECKPOINT_LOG.md`
67
+ - `orp/state.json`
68
+ - `orp/artifacts/<run_id>/RUN.json`
69
+
70
+ Canonical machine-local runtime path:
71
+
72
+ - `.git/orp/runtime.json`
73
+
74
+ ### 2. Local Link And Session Registry
75
+
76
+ Commands:
77
+
78
+ - `orp link project bind`
79
+ - `orp link project show`
80
+ - `orp link project status`
81
+ - `orp link project unbind`
82
+ - `orp link session register`
83
+ - `orp link session list`
84
+ - `orp link session show`
85
+ - `orp link session set-primary`
86
+ - `orp link session archive`
87
+ - `orp link session unarchive`
88
+ - `orp link session remove`
89
+ - `orp link status`
90
+ - `orp link doctor`
91
+
92
+ Canonical machine-local artifact paths:
93
+
94
+ - `.git/orp/link/project.json`
95
+ - `.git/orp/link/sessions/*.json`
96
+
97
+ This registry defines:
98
+
99
+ - which local repo is linked
100
+ - which hosted idea/world it maps to
101
+ - which ORP sessions exist locally
102
+ - which Codex session id is routable
103
+ - which linked session is primary
104
+
105
+ ### 3. Runner Identity And Runtime
106
+
107
+ Commands:
108
+
109
+ - `orp runner status`
110
+ - `orp runner enable`
111
+ - `orp runner disable`
112
+ - `orp runner heartbeat`
113
+ - `orp runner sync`
114
+ - `orp runner work`
115
+ - `orp runner cancel`
116
+ - `orp runner retry`
117
+
118
+ Canonical machine-local artifact paths:
119
+
120
+ - `~/.config/orp/machine.json`
121
+ - `.git/orp/link/runner.json`
122
+ - `.git/orp/link/runtime.json`
123
+
124
+ This runtime defines:
125
+
126
+ - machine identity
127
+ - enabled/disabled state
128
+ - last heartbeat and sync
129
+ - active lease/job state
130
+ - retry/cancel bookkeeping
131
+
132
+ ### 4. Hosted Workspace Contract
133
+
134
+ Commands:
135
+
136
+ - `orp auth ...`
137
+ - `orp ideas ...`
138
+ - `orp feature ...`
139
+ - `orp world ...`
140
+ - `orp checkpoint ...`
141
+ - `orp runner ...`
142
+ - `orp agent ...`
143
+
144
+ This is the canonical client for:
145
+
146
+ - hosted auth/session state
147
+ - idea and world binding
148
+ - checkpoint queueing
149
+ - runner polling/SSE wake-up
150
+ - lease/claim/start/complete/cancel/retry behavior
151
+
152
+ ### 5. Machine-Readable ORP Contract
153
+
154
+ Preferred discovery surfaces:
155
+
156
+ - `orp`
157
+ - `orp home --json`
158
+ - `orp about --json`
159
+ - all core stateful surfaces that already support `--json`
160
+
161
+ If Rust or web needs new structured data, add it to a CLI JSON surface first
162
+ instead of scraping human-readable output or inventing a UI-only schema.
163
+
164
+ ## Preferred Product Language
165
+
166
+ The CLI may keep some lower-level historical names for compatibility, but the
167
+ preferred product model should be:
168
+
169
+ - `Linked Project`
170
+ - `Linked Session`
171
+ - `Runner`
172
+ - `Checkpoint`
173
+ - `Project Workspace`
174
+
175
+ Compatibility surfaces that may remain but should not become the main product
176
+ story:
177
+
178
+ - `orp world bind`
179
+ - `orp agent work`
180
+
181
+ Preferred higher-level story:
182
+
183
+ - `orp link ...`
184
+ - `orp runner ...`
185
+ - `orp checkpoint ...`
186
+
187
+ ## Reflection Rules
188
+
189
+ ### Rust Desktop App
190
+
191
+ Rust should own:
192
+
193
+ - session discovery
194
+ - terminal/window/tab management
195
+ - resume/reopen UX
196
+ - local operator experience
197
+ - background automation of CLI commands
198
+
199
+ Rust should call into CLI-owned truth for:
200
+
201
+ - project linking
202
+ - session registration
203
+ - primary session changes
204
+ - runner enable/heartbeat/sync/work
205
+
206
+ Rust may store desktop-only state such as:
207
+
208
+ - window placement
209
+ - UI preferences
210
+ - recent local navigation
211
+ - transient discovery caches
212
+
213
+ Rust should not become canonical for:
214
+
215
+ - linked project truth
216
+ - linked session truth
217
+ - runner identity or lease semantics
218
+ - hosted sync payload semantics
219
+
220
+ ### Web App
221
+
222
+ Web should own:
223
+
224
+ - hosted presentation
225
+ - project/session/chat UX
226
+ - idea/pensieve browsing UX
227
+ - admin/operator visibility
228
+
229
+ Web should reflect:
230
+
231
+ - hosted state created or synced through CLI contracts
232
+ - linked projects as synced worlds
233
+ - linked sessions as hosted-session availability
234
+ - runner lifecycle as hosted lease/job state
235
+
236
+ Web should not invent:
237
+
238
+ - a second local linking model
239
+ - browser-only runner routing rules
240
+ - UI-only checkpoint/lease semantics
241
+
242
+ ### Headless / Agent-Only Mode
243
+
244
+ The system should remain operable without Rust.
245
+
246
+ Minimum CLI-only flow:
247
+
248
+ ```bash
249
+ orp auth login
250
+ orp link project bind --idea-id <idea-id> --project-root /abs/path --json
251
+ orp link session register --orp-session-id <session-id> --label <label> --codex-session-id <codex-session-id> --primary --json
252
+ orp runner enable --json
253
+ orp runner sync --json
254
+ orp runner work --continuous --transport auto --json
255
+ ```
256
+
257
+ That means Rust is an operator UX layer, not a protocol dependency.
258
+
259
+ ## One-To-One Reflection Standard
260
+
261
+ The best-case stack is:
262
+
263
+ - CLI defines the truth
264
+ - Rust reflects the truth locally
265
+ - web reflects the truth remotely
266
+
267
+ Both Rust and web may expose:
268
+
269
+ - minimal mode
270
+ - full mode
271
+ - guided workflows
272
+ - hidden advanced controls
273
+
274
+ Those are presentation choices only. They should all map back to the same CLI
275
+ contract.
276
+
277
+ ## Conformance Checklist
278
+
279
+ Use this checklist whenever Rust or web adds a new ORP capability.
280
+
281
+ ### Before Shipping A New UX Capability
282
+
283
+ - [ ] The capability exists as a CLI command or JSON surface first.
284
+ - [ ] The canonical state path is CLI-owned.
285
+ - [ ] The Rust or web implementation can be described as "calling ORP" rather
286
+ than redefining ORP.
287
+ - [ ] Any renamed UX language still maps cleanly to existing CLI concepts.
288
+
289
+ ### Rust Conformance
290
+
291
+ - [ ] Rust does not persist conflicting project/session/runner truth.
292
+ - [ ] Rust session discovery ends in `orp link session ...`.
293
+ - [ ] Rust project linking ends in `orp link project ...` or approved CLI
294
+ compatibility plumbing.
295
+ - [ ] Rust runner background work ends in `orp runner ...`.
296
+ - [ ] Rust can be simplified, restyled, or minimized without changing ORP
297
+ semantics.
298
+
299
+ ### Web Conformance
300
+
301
+ - [ ] Web linked-project pages reflect hosted synced state.
302
+ - [ ] Web session/chat views reflect exact linked session identity where
303
+ available.
304
+ - [ ] Web does not create a second local-binding protocol.
305
+ - [ ] Web operator/admin tooling reflects hosted runner state rather than
306
+ inventing browser-local runner truth.
307
+ - [ ] Web can be redesigned completely without requiring a protocol rewrite.
308
+
309
+ ### Protocol Stability
310
+
311
+ - [ ] CLI-only operation still works.
312
+ - [ ] Rust remains optional for correctness.
313
+ - [ ] Web remains optional for correctness.
314
+ - [ ] Minimal mode and full mode share the same underlying ORP contract.
315
+
316
+ ## Decision Rule For Future Work
317
+
318
+ When a feature request touches project linking, session identity, runner state,
319
+ hosted job delivery, or repo governance:
320
+
321
+ 1. Add or refine the CLI contract first.
322
+ 2. Expose it through JSON.
323
+ 3. Let Rust and web reflect it.
324
+
325
+ If a proposal cannot be expressed cleanly through the CLI first, it is probably
326
+ trying to put source-of-truth logic in the wrong layer.
327
+
328
+ ## Short Version
329
+
330
+ The CLI is ORP.
331
+
332
+ Rust is the local operator shell.
333
+
334
+ Web is the hosted operator shell.
335
+
336
+ Both should be able to become more minimal, more opinionated, or more polished
337
+ without changing the underlying ORP truth.
@@ -13,19 +13,51 @@ Use this checklist to publish professional, versioned ORP CLI releases.
13
13
  ## Per-release flow
14
14
 
15
15
  1. Ensure `main` is green and local tests pass:
16
+ - shortcut: `bash scripts/orp-release-smoke.sh`
16
17
  - `python3 -m unittest discover -s tests -v`
18
+ - `git status --short`
19
+ - `git rev-list --left-right --count origin/main...HEAD`
20
+ - `npm view open-research-protocol version dist-tags --json`
17
21
  - `npm pack --dry-run --cache /tmp/orp-npm-cache`
18
- 2. Bump version in `package.json` (for example `0.4.0`).
19
- 3. Commit and push the version bump to `main`.
20
- 4. Create and push a matching tag:
21
- - `git tag v0.4.0`
22
- - `git push origin v0.4.0`
23
- 5. Watch workflow:
22
+ - `npm publish --dry-run`
23
+ 2. Run the fresh-install governance smoke test from a clean temp prefix and clean repo:
24
+ - scripted path:
25
+ - `bash scripts/orp-release-smoke.sh`
26
+ - `bash scripts/orp-release-smoke.sh --hosted --codex-session-id <session-id>`
27
+ - `bash scripts/orp-release-smoke.sh --hosted --worker --codex-session-id <session-id>`
28
+ - `npm pack`
29
+ - `npm install -g --prefix /tmp/orp-global ./open-research-protocol-X.Y.Z.tgz`
30
+ - `env PATH=/tmp/orp-global/bin:$PATH orp -h`
31
+ - `mkdir /tmp/orp-fresh && cd /tmp/orp-fresh`
32
+ - `env PATH=/tmp/orp-global/bin:$PATH orp init --json`
33
+ - `git config user.name "ORP Release Smoke"`
34
+ - `git config user.email "orp-release@example.com"`
35
+ - `env PATH=/tmp/orp-global/bin:$PATH orp branch start work/bootstrap --allow-dirty --json`
36
+ - `env PATH=/tmp/orp-global/bin:$PATH orp checkpoint create -m "bootstrap governance" --json`
37
+ - `env PATH=/tmp/orp-global/bin:$PATH orp backup -m "backup bootstrap governance" --json`
38
+ - `env PATH=/tmp/orp-global/bin:$PATH orp gate run --profile default --json`
39
+ - `env PATH=/tmp/orp-global/bin:$PATH orp checkpoint create -m "capture passing validation" --json`
40
+ - `env PATH=/tmp/orp-global/bin:$PATH orp ready --json`
41
+ - optional follow-through:
42
+ - `env PATH=/tmp/orp-global/bin:$PATH orp packet emit --profile default --json`
43
+ - `env PATH=/tmp/orp-global/bin:$PATH orp report summary --json`
44
+ 3. Confirm the version you intend to publish is not already live.
45
+ - local `package.json` version must be newer than the currently published `latest`
46
+ - `npm publish` is guarded and will fail if the worktree is dirty or the current commit is not already on a remote branch
47
+ 4. Bump version in `package.json` (for example `0.4.4` -> `0.4.5`).
48
+ 5. Commit and push the version bump to `main`.
49
+ 6. Create and push a matching tag:
50
+ - `git tag v0.4.5`
51
+ - `git push origin v0.4.5`
52
+ 7. Watch workflow:
24
53
  - `.github/workflows/npm-publish.yml`
25
54
  - tag push is the normal publish trigger
26
- 6. Verify npm install:
55
+ 8. Verify npm install after publish:
27
56
  - `npm i -g open-research-protocol`
28
57
  - `orp -h`
58
+ - `orp init`
59
+ - `orp status --json`
60
+ - `orp about --json`
29
61
 
30
62
  ## Important guardrail
31
63
 
@@ -44,12 +76,12 @@ Manual workflow dispatch is available as a recovery path, but it still requires
44
76
  If automation is temporarily unavailable:
45
77
 
46
78
  1. Checkout intended commit locally.
47
- 2. Run release validations above.
79
+ 2. Run release validations above, including `npm publish --dry-run`.
48
80
  3. Publish:
49
81
  - `npm publish --access public`
50
82
  4. Create and push the matching tag:
51
- - `git tag v0.4.0`
52
- - `git push origin v0.4.0`
83
+ - `git tag vX.Y.Z`
84
+ - `git push origin vX.Y.Z`
53
85
  5. Add release notes.
54
86
 
55
87
  The tag-triggered workflow will still validate the version and will skip `npm publish` if that exact npm version already exists.