open-research-protocol 0.3.0

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 (94) hide show
  1. package/AGENT_INTEGRATION.md +94 -0
  2. package/INSTALL.md +159 -0
  3. package/LICENSE +22 -0
  4. package/PROTOCOL.md +140 -0
  5. package/README.md +312 -0
  6. package/bin/orp.js +38 -0
  7. package/cli/orp.py +3595 -0
  8. package/cone/CONTEXT_LOG.md +33 -0
  9. package/docs/AGENT_LOOP.md +63 -0
  10. package/docs/CHOOSING_OR_IGNORING_INSTRUMENTS.md +128 -0
  11. package/docs/CODA_ORP_CONTRACT.md +222 -0
  12. package/docs/CORE_ABILITY_REFOCUS_CHECKLIST.md +62 -0
  13. package/docs/DISCOVER.md +69 -0
  14. package/docs/EXTERNAL_CONTRIBUTION_GOVERNANCE.md +275 -0
  15. package/docs/MATHLIB_COLLABORATION_FLOW_PROMPT.md +112 -0
  16. package/docs/NPM_RELEASE_CHECKLIST.md +55 -0
  17. package/docs/ORP_V1_ATOMIC_DISCOVERY_EVOLUTION.md +186 -0
  18. package/docs/OSS_CONTRIBUTION_AGENT_LOOP.md +69 -0
  19. package/docs/PRESENTATION_BOW.md +100 -0
  20. package/docs/PROFILE_PACKS.md +227 -0
  21. package/docs/SUNFLOWER_CODA_PR_GOVERNANCE_MAPPING.md +77 -0
  22. package/docs/WHY_INSTRUMENTS.md +118 -0
  23. package/examples/README.md +21 -0
  24. package/examples/example_claim.md +33 -0
  25. package/examples/example_failed.md +24 -0
  26. package/examples/example_verification.md +36 -0
  27. package/examples/orp.erdos-problems.catalog.yml +88 -0
  28. package/examples/orp.external-pr-governance.yml +223 -0
  29. package/examples/orp.sunflower-coda.atomic.yml +144 -0
  30. package/examples/orp.sunflower-coda.live-compare.yml +181 -0
  31. package/examples/orp.sunflower-coda.pr-governance.yml +253 -0
  32. package/examples/packet.problem_scope.example.json +123 -0
  33. package/examples/reports/README.md +16 -0
  34. package/examples/reports/sunflower_live_compare_20.RUN_SUMMARY.md +37 -0
  35. package/examples/reports/sunflower_live_compare_367.RUN_SUMMARY.md +37 -0
  36. package/examples/reports/sunflower_live_compare_857.RUN_SUMMARY.md +37 -0
  37. package/llms.txt +58 -0
  38. package/modules/instruments/ADVERSARIAL/README.md +109 -0
  39. package/modules/instruments/ADVERSARIAL/TEMPLATE.md +27 -0
  40. package/modules/instruments/COMPRESSION/README.md +112 -0
  41. package/modules/instruments/COMPRESSION/TEMPLATE.md +27 -0
  42. package/modules/instruments/INSTRUMENT_TEMPLATE.md +30 -0
  43. package/modules/instruments/ORBIT/README.md +124 -0
  44. package/modules/instruments/ORBIT/TEMPLATE.md +28 -0
  45. package/modules/instruments/README.md +179 -0
  46. package/package.json +54 -0
  47. package/packs/README.md +16 -0
  48. package/packs/erdos-open-problems/README.md +287 -0
  49. package/packs/erdos-open-problems/data/README.md +43 -0
  50. package/packs/erdos-open-problems/data/erdos_open_problems.md +697 -0
  51. package/packs/erdos-open-problems/data/erdos_problems.active.json +15561 -0
  52. package/packs/erdos-open-problems/data/erdos_problems.all.json +26289 -0
  53. package/packs/erdos-open-problems/data/erdos_problems.closed.json +10760 -0
  54. package/packs/erdos-open-problems/data/erdos_problems.open.json +15561 -0
  55. package/packs/erdos-open-problems/docs/SUNFLOWER_ADAPTER_DEPENDENCIES.md +63 -0
  56. package/packs/erdos-open-problems/pack.yml +131 -0
  57. package/packs/erdos-open-problems/profiles/erdos-problems-catalog-sync.yml.tmpl +99 -0
  58. package/packs/erdos-open-problems/profiles/sunflower-live-compare.yml.tmpl +188 -0
  59. package/packs/erdos-open-problems/profiles/sunflower-mathlib-pr-governance.yml.tmpl +253 -0
  60. package/packs/erdos-open-problems/profiles/sunflower-problem857-discovery-public-repo.yml.tmpl +152 -0
  61. package/packs/erdos-open-problems/profiles/sunflower-problem857-discovery.yml.tmpl +154 -0
  62. package/packs/external-pr-governance/README.md +116 -0
  63. package/packs/external-pr-governance/adapters/formal-conjectures/README.md +35 -0
  64. package/packs/external-pr-governance/adapters/mathlib/README.md +37 -0
  65. package/packs/external-pr-governance/pack.yml +146 -0
  66. package/packs/external-pr-governance/profiles/oss-feedback-hardening.yml.tmpl +92 -0
  67. package/packs/external-pr-governance/profiles/oss-pr-governance.yml.tmpl +233 -0
  68. package/packs/issue-smashers/README.md +92 -0
  69. package/packs/issue-smashers/adapters/formal-conjectures/README.md +17 -0
  70. package/packs/issue-smashers/adapters/generic-github/README.md +16 -0
  71. package/packs/issue-smashers/adapters/mathlib/README.md +32 -0
  72. package/packs/issue-smashers/bootstrap/README.md +19 -0
  73. package/packs/issue-smashers/bootstrap/setup-issue-smashers.sh +18 -0
  74. package/packs/issue-smashers/examples/issue-smashers.workspace.yml +24 -0
  75. package/packs/issue-smashers/pack.yml +178 -0
  76. package/packs/issue-smashers/profiles/issue-smashers-feedback-hardening.yml.tmpl +102 -0
  77. package/packs/issue-smashers/profiles/issue-smashers.yml.tmpl +258 -0
  78. package/scripts/npm-postinstall-check.js +31 -0
  79. package/scripts/orp +11 -0
  80. package/scripts/orp-agent-integrate.sh +197 -0
  81. package/scripts/orp-checkpoint.sh +184 -0
  82. package/scripts/orp-erdos-problems-sync.py +580 -0
  83. package/scripts/orp-init.sh +50 -0
  84. package/scripts/orp-pack-fetch.py +155 -0
  85. package/scripts/orp-pack-install.py +2273 -0
  86. package/scripts/orp-pack-render.py +188 -0
  87. package/spec/v1/LIFECYCLE_MAPPING.md +40 -0
  88. package/spec/v1/orp.config.schema.json +385 -0
  89. package/spec/v1/packet.schema.json +552 -0
  90. package/spec/v1/profile-pack.schema.json +95 -0
  91. package/templates/CLAIM.md +33 -0
  92. package/templates/FAILED_TOPIC.md +19 -0
  93. package/templates/ISSUE_TEMPLATE.md +22 -0
  94. package/templates/VERIFICATION_RECORD.md +34 -0
package/README.md ADDED
@@ -0,0 +1,312 @@
1
+ # ORP — Open Research Protocol (template pack)
2
+
3
+ ORP is a **project-agnostic, docs-first, agent-friendly protocol** for doing research (or research-like engineering) with:
4
+
5
+ - explicit claim levels,
6
+ - reproducible verification hooks,
7
+ - dispute handling that resolves disagreements by **verification or downgrade** (not argument),
8
+ - first-class “failed paths” (dead ends recorded as assets),
9
+ - and a non-blocking **Alignment/Polish Log** for optional wording/clarity suggestions.
10
+
11
+ **Boundary (non-negotiable):** ORP files are **process-only**. They are **not evidence** and must **not** be cited as proof for
12
+ results. Evidence lives in your project’s **canonical artifact paths** (data, code, paper, proofs, logs, etc.).
13
+
14
+ ORP also supports optional, modular **Instruments** for framing inquiry upstream of claims. Instruments are process-only and
15
+ verification remains independent of framing. See `modules/instruments/README.md` and `docs/WHY_INSTRUMENTS.md`.
16
+
17
+ ## What’s in this folder
18
+
19
+ - `AGENT_INTEGRATION.md` — optional: integrate ORP into an AI agent’s primary instruction file
20
+ - `llms.txt` — concise discovery guide for LLM and agentic systems
21
+ - `PROTOCOL.md` — the protocol to copy into a project
22
+ - `INSTALL.md` — how to adopt ORP in an existing repo or start a new project from it
23
+ - `docs/AGENT_LOOP.md` — canonical operating loop when an agent is the primary ORP user
24
+ - `docs/CODA_ORP_CONTRACT.md` — boundary between Coda app/wrapper concerns and ORP runtime concerns
25
+ - `docs/EXTERNAL_CONTRIBUTION_GOVERNANCE.md` — canonical local-first workflow for external OSS PR work
26
+ - `docs/OSS_CONTRIBUTION_AGENT_LOOP.md` — agent operating rhythm for external contribution workflows
27
+ - `templates/` — claim, verification, failure, and issue templates
28
+ - `examples/` — minimal examples (illustrative, not exhaustive)
29
+ - `scripts/` — optional helper scripts (no dependencies beyond standard shell tools)
30
+ - `modules/` — optional modules (including Instruments)
31
+ - `docs/` — optional docs (including Instruments overview + presentation)
32
+ - includes standardized external PR governance: `docs/EXTERNAL_CONTRIBUTION_GOVERNANCE.md`
33
+ - includes sunflower-coda PR governance mapping: `docs/SUNFLOWER_CODA_PR_GOVERNANCE_MAPPING.md`
34
+ - `cone/` — optional process-only context log (agentic handoff/compaction)
35
+ - `spec/` — optional v1 runtime draft schemas (packets/config/lifecycle mapping)
36
+ - `packs/` — optional downloadable profile packs (domain templates + metadata)
37
+
38
+ ## Product Shape
39
+
40
+ ORP should feel like one CLI with built-in abilities:
41
+
42
+ - `discover` for profile-based GitHub scanning and opportunity selection
43
+ - `collaborate` for repository collaboration setup and workflow execution
44
+ - `erdos` for Erdos-specific data and workflow support
45
+ - `report` and `packet` for ORP artifacts
46
+
47
+ The `pack` layer still exists, but it is now an advanced/internal surface rather
48
+ than the main product story.
49
+
50
+ ## Install CLI (npm)
51
+
52
+ Global install:
53
+
54
+ ```bash
55
+ npm i -g open-research-protocol
56
+ orp
57
+ orp -h
58
+ ```
59
+
60
+ Prerequisites:
61
+
62
+ - Python 3 available on `PATH`
63
+ - `PyYAML` in that Python environment (`python3 -m pip install pyyaml`)
64
+
65
+ Fresh-directory smoke test:
66
+
67
+ ```bash
68
+ mkdir test-orp && cd test-orp
69
+ npm i -g open-research-protocol
70
+ orp init
71
+ orp gate run --profile default
72
+ orp packet emit --profile default
73
+ orp report summary
74
+ find orp -maxdepth 3 -type f | sort
75
+ ```
76
+
77
+ What this proves:
78
+
79
+ - the global `orp` binary resolves,
80
+ - running bare `orp` opens the CLI home screen with packs and quick actions,
81
+ - the runtime can initialize a repo-local ORP workspace,
82
+ - a gate run writes `RUN.json`,
83
+ - packet emit writes process metadata to `orp/packets/`,
84
+ - and report summary renders a one-page digest from the last run.
85
+
86
+ Local repo usage still works:
87
+
88
+ ```bash
89
+ ./scripts/orp -h
90
+ ```
91
+
92
+ Agent-first discovery surfaces:
93
+
94
+ ```bash
95
+ orp
96
+ orp home --json
97
+ orp about --json
98
+ orp discover profile init --json
99
+ orp discover github scan --profile orp.profile.default.json --json
100
+ orp collaborate workflows --json
101
+ orp collaborate gates --workflow full_flow --json
102
+ orp erdos sync --json
103
+ orp pack list --json
104
+ orp pack install --pack-id erdos-open-problems --json
105
+ orp pack fetch --source <git-url> --pack-id <pack-id> --install-target . --json
106
+ orp gate run --profile default --json
107
+ orp packet emit --profile default --json
108
+ orp report summary --json
109
+ ```
110
+
111
+ These surfaces are meant to help automated systems discover ORP quickly:
112
+
113
+ - bare `orp` opens a home screen with repo/runtime status, available packs, and next commands
114
+ - `orp home --json` returns the same landing context in machine-readable form
115
+ - `orp discover ...` exposes profile-based GitHub scanning inside ORP itself instead of forcing discovery into a separate wrapper
116
+ - `orp collaborate ...` exposes built-in collaboration setup and workflow execution without asking users to think in terms of separate governance packs
117
+ - `llms.txt` gives a concise repo/package map for agents that scan documentation.
118
+ - `docs/AGENT_LOOP.md` gives agents one intended operating rhythm instead of leaving them to invent one.
119
+ - `docs/DISCOVER.md` explains the portable discovery profile model and how it relates to Coda.
120
+ - `orp about --json` returns machine-readable capability, artifact, schema, and pack metadata.
121
+ - Core runtime and pack commands can emit JSON so agents do not need to scrape human text.
122
+ - Stable artifact paths make it easy to follow outputs across runs:
123
+ - `orp/state.json`
124
+ - `orp/artifacts/<run_id>/RUN.json`
125
+ - `orp/artifacts/<run_id>/RUN_SUMMARY.md`
126
+ - `orp/packets/<packet_id>.json`
127
+ - `orp/packets/<packet_id>.md`
128
+ - `orp/discovery/github/<scan_id>/SCAN.json`
129
+ - `orp/discovery/github/<scan_id>/SCAN_SUMMARY.md`
130
+
131
+ Release process:
132
+
133
+ - `docs/NPM_RELEASE_CHECKLIST.md`
134
+ - `.github/workflows/npm-publish.yml` (publishes on `v*` tags)
135
+
136
+ ## Quick start (existing repo)
137
+
138
+ 1. Copy this folder into your repo (recommended location: `orp/`).
139
+ 2. Link to `orp/PROTOCOL.md` from your repo `README.md`.
140
+ 3. Customize **Canonical Paths** inside `orp/PROTOCOL.md` to match your repo layout.
141
+ 4. Use the templates for all new claims and verifications.
142
+ 5. Optional (agent users): integrate ORP into your agent’s primary instruction file (see `orp/AGENT_INTEGRATION.md`).
143
+
144
+ ## Quick start (new project)
145
+
146
+ 1. Copy this folder into a new project directory.
147
+ 2. Edit `PROTOCOL.md` to define your canonical paths and claim labels.
148
+ 3. Start by adding one small claim + verification record using the templates.
149
+ 4. Optional (agent users): integrate ORP into your agent’s primary instruction file (see `AGENT_INTEGRATION.md`).
150
+
151
+ **Activation is procedural/social, not runtime:** nothing “turns on” automatically. ORP works only if contributors follow it.
152
+
153
+ ## Optional Runtime Draft (v1)
154
+
155
+ ORP remains docs-first by default. For teams that want local gate execution and machine-readable packets, there is an optional v1 draft:
156
+
157
+ - Overview: `docs/ORP_V1_ATOMIC_DISCOVERY_EVOLUTION.md`
158
+ - Packet schema: `spec/v1/packet.schema.json`
159
+ - Config schema: `spec/v1/orp.config.schema.json`
160
+ - Lifecycle mapping: `spec/v1/LIFECYCLE_MAPPING.md`
161
+ - Sunflower atomic profile example: `examples/orp.sunflower-coda.atomic.yml`
162
+
163
+ Minimal CLI skeleton:
164
+
165
+ ```bash
166
+ orp init
167
+ orp gate run --profile default
168
+ orp packet emit --profile default
169
+ orp report summary --run-id <run_id>
170
+ orp pack list
171
+ orp erdos sync
172
+ ```
173
+
174
+ Equivalent local-repo commands are available via `./scripts/orp ...` when developing ORP itself.
175
+
176
+ Run summaries are one-page markdown reports generated from `RUN.json` and intended for fast teammate review:
177
+
178
+ - what ran,
179
+ - what passed/failed,
180
+ - where evidence logs live,
181
+ - and how reproducible the run is.
182
+
183
+ Sample summaries:
184
+
185
+ - `examples/reports/sunflower_live_compare_857.RUN_SUMMARY.md`
186
+ - `examples/reports/sunflower_live_compare_20.RUN_SUMMARY.md`
187
+ - `examples/reports/sunflower_live_compare_367.RUN_SUMMARY.md`
188
+
189
+ ## Optional Profile Packs
190
+
191
+ ORP supports reusable domain profile packs so core runtime stays general.
192
+
193
+ The main public collaboration story is now the built-in `orp collaborate ...`
194
+ surface. Treat packs as advanced/internal packaging structure unless you are
195
+ working on ORP itself or installing domain-specific workflows like `erdos`.
196
+
197
+ Built-in collaboration quickstart:
198
+
199
+ ```bash
200
+ orp collaborate init
201
+ orp collaborate workflows --json
202
+ orp collaborate gates --workflow full_flow --json
203
+ orp collaborate run --workflow full_flow --json
204
+ ```
205
+
206
+ - Pack docs: `docs/PROFILE_PACKS.md`
207
+ - Pack metadata schema: `spec/v1/profile-pack.schema.json`
208
+ - Included pack: `packs/erdos-open-problems/` (857/20/367 + catalog sync + governance profiles)
209
+ - Included pack: `packs/external-pr-governance/` (generic external OSS contribution workflow pack)
210
+ - Included pack: `packs/issue-smashers/` (opinionated external contribution workspace pack built on the same governance ideas)
211
+
212
+ If you are using ORP normally, prefer:
213
+
214
+ - `orp collaborate ...` for collaboration
215
+ - `orp erdos ...` for Erdos work
216
+
217
+ Reach for `orp pack ...` when you are doing advanced installs, ORP maintenance,
218
+ or direct domain-template work.
219
+
220
+ Install pack configs into a target repo (recommended):
221
+
222
+ ```bash
223
+ orp pack list
224
+
225
+ orp pack install \
226
+ --pack-id erdos-open-problems
227
+ ```
228
+
229
+ Fetch an external pack repo and install through CLI (no manual clone flow required):
230
+
231
+ ```bash
232
+ orp pack fetch \
233
+ --source https://github.com/example/orp-packs.git \
234
+ --pack-id erdos-open-problems \
235
+ --install-target .
236
+ ```
237
+
238
+ This writes rendered configs and a dependency audit report at:
239
+
240
+ - `./orp.erdos-catalog-sync.yml`
241
+ - `./orp.erdos-live-compare.yml`
242
+ - `./orp.erdos-problem857.yml`
243
+ - `./orp.erdos.pack-install-report.md`
244
+
245
+ Advanced/internal direct install of the Issue Smashers workspace pack:
246
+
247
+ ```bash
248
+ orp pack install \
249
+ --pack-id issue-smashers
250
+ ```
251
+
252
+ This writes:
253
+
254
+ - `./orp.issue-smashers.yml`
255
+ - `./orp.issue-smashers-feedback-hardening.yml`
256
+ - `./orp.issue-smashers.pack-install-report.md`
257
+ - `./issue-smashers/` workspace scaffold
258
+
259
+ The pack is intentionally install-and-adapt:
260
+
261
+ - it creates the workspace layout and starter docs
262
+ - it does not auto-clone target repos
263
+ - it keeps governance commands as explicit placeholders until you wire in a repo adapter
264
+
265
+ By default, install includes starter scaffolding for Problems 857/20/367 so `live_compare` runs are install-and-go in a fresh repo.
266
+
267
+ If you want the Problem 857 lane to pull the real public `sunflower-lean` repo into an empty repo instead of writing starter-only 857 files, use:
268
+
269
+ ```bash
270
+ orp pack install \
271
+ --pack-id erdos-open-problems \
272
+ --include problem857 \
273
+ --var PROBLEM857_SOURCE_MODE=public_repo \
274
+ --var PROBLEM857_PUBLIC_REPO_URL=https://github.com/SproutSeeds/sunflower-lean
275
+ ```
276
+
277
+ This syncs the public Lean repo into `sunflower_lean/` and generates the ORP-owned 857 bridge files (`analysis/`, `docs/`, `scripts/`, and `orchestrator/`) on top of it.
278
+
279
+ For public-only adoption (no private sunflower adapters yet):
280
+
281
+ ```bash
282
+ orp pack install \
283
+ --pack-id erdos-open-problems \
284
+ --include catalog
285
+ ```
286
+
287
+ Clean-room public pack cycle:
288
+
289
+ ```bash
290
+ orp pack install \
291
+ --pack-id erdos-open-problems \
292
+ --include catalog
293
+
294
+ orp --config orp.erdos-catalog-sync.yml \
295
+ gate run --profile erdos_catalog_sync_active
296
+
297
+ orp report summary
298
+ ```
299
+
300
+ This is the simplest end-to-end pack workflow currently validated against the published npm package.
301
+
302
+ Manual render path (advanced):
303
+
304
+ ```bash
305
+ python3 scripts/orp-pack-render.py --pack packs/erdos-open-problems --list
306
+ python3 scripts/orp-pack-render.py --pack packs/erdos-open-problems --template sunflower_live_compare_suite \
307
+ --var TARGET_REPO_ROOT=/path/to/repo --out /path/to/repo/orp.erdos-live-compare.yml
308
+ python3 scripts/orp-pack-render.py --pack packs/erdos-open-problems --template sunflower_mathlib_pr_governance \
309
+ --var TARGET_REPO_ROOT=/path/to/repo --out /path/to/repo/orp.erdos-mathlib-pr-governance.yml
310
+ python3 scripts/orp-pack-render.py --pack packs/erdos-open-problems --template erdos_problems_catalog_sync \
311
+ --var TARGET_REPO_ROOT=/path/to/repo --var ORP_REPO_ROOT=/path/to/orp --out /path/to/repo/orp.erdos-catalog-sync.yml
312
+ ```
package/bin/orp.js ADDED
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+
3
+ const path = require("path");
4
+ const { spawnSync } = require("child_process");
5
+
6
+ const cliPath = path.resolve(__dirname, "..", "cli", "orp.py");
7
+ const argv = process.argv.slice(2);
8
+
9
+ const candidates = [];
10
+ if (process.env.ORP_PYTHON && process.env.ORP_PYTHON.trim() !== "") {
11
+ candidates.push(process.env.ORP_PYTHON.trim());
12
+ }
13
+ if (process.platform === "win32") {
14
+ candidates.push("py");
15
+ }
16
+ candidates.push("python3", "python");
17
+
18
+ let lastErr = null;
19
+
20
+ for (const py of candidates) {
21
+ const args = py === "py" ? ["-3", cliPath, ...argv] : [cliPath, ...argv];
22
+ const result = spawnSync(py, args, { stdio: "inherit" });
23
+ if (!result.error) {
24
+ process.exit(result.status == null ? 1 : result.status);
25
+ }
26
+ if (result.error && result.error.code === "ENOENT") {
27
+ continue;
28
+ }
29
+ lastErr = result.error;
30
+ }
31
+
32
+ console.error("ORP CLI requires Python 3 on PATH.");
33
+ console.error("Tried: " + candidates.join(", "));
34
+ if (lastErr) {
35
+ console.error(String(lastErr));
36
+ }
37
+ process.exit(1);
38
+