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.
- package/AGENT_INTEGRATION.md +94 -0
- package/INSTALL.md +159 -0
- package/LICENSE +22 -0
- package/PROTOCOL.md +140 -0
- package/README.md +312 -0
- package/bin/orp.js +38 -0
- package/cli/orp.py +3595 -0
- package/cone/CONTEXT_LOG.md +33 -0
- package/docs/AGENT_LOOP.md +63 -0
- package/docs/CHOOSING_OR_IGNORING_INSTRUMENTS.md +128 -0
- package/docs/CODA_ORP_CONTRACT.md +222 -0
- package/docs/CORE_ABILITY_REFOCUS_CHECKLIST.md +62 -0
- package/docs/DISCOVER.md +69 -0
- package/docs/EXTERNAL_CONTRIBUTION_GOVERNANCE.md +275 -0
- package/docs/MATHLIB_COLLABORATION_FLOW_PROMPT.md +112 -0
- package/docs/NPM_RELEASE_CHECKLIST.md +55 -0
- package/docs/ORP_V1_ATOMIC_DISCOVERY_EVOLUTION.md +186 -0
- package/docs/OSS_CONTRIBUTION_AGENT_LOOP.md +69 -0
- package/docs/PRESENTATION_BOW.md +100 -0
- package/docs/PROFILE_PACKS.md +227 -0
- package/docs/SUNFLOWER_CODA_PR_GOVERNANCE_MAPPING.md +77 -0
- package/docs/WHY_INSTRUMENTS.md +118 -0
- package/examples/README.md +21 -0
- package/examples/example_claim.md +33 -0
- package/examples/example_failed.md +24 -0
- package/examples/example_verification.md +36 -0
- package/examples/orp.erdos-problems.catalog.yml +88 -0
- package/examples/orp.external-pr-governance.yml +223 -0
- package/examples/orp.sunflower-coda.atomic.yml +144 -0
- package/examples/orp.sunflower-coda.live-compare.yml +181 -0
- package/examples/orp.sunflower-coda.pr-governance.yml +253 -0
- package/examples/packet.problem_scope.example.json +123 -0
- package/examples/reports/README.md +16 -0
- package/examples/reports/sunflower_live_compare_20.RUN_SUMMARY.md +37 -0
- package/examples/reports/sunflower_live_compare_367.RUN_SUMMARY.md +37 -0
- package/examples/reports/sunflower_live_compare_857.RUN_SUMMARY.md +37 -0
- package/llms.txt +58 -0
- package/modules/instruments/ADVERSARIAL/README.md +109 -0
- package/modules/instruments/ADVERSARIAL/TEMPLATE.md +27 -0
- package/modules/instruments/COMPRESSION/README.md +112 -0
- package/modules/instruments/COMPRESSION/TEMPLATE.md +27 -0
- package/modules/instruments/INSTRUMENT_TEMPLATE.md +30 -0
- package/modules/instruments/ORBIT/README.md +124 -0
- package/modules/instruments/ORBIT/TEMPLATE.md +28 -0
- package/modules/instruments/README.md +179 -0
- package/package.json +54 -0
- package/packs/README.md +16 -0
- package/packs/erdos-open-problems/README.md +287 -0
- package/packs/erdos-open-problems/data/README.md +43 -0
- package/packs/erdos-open-problems/data/erdos_open_problems.md +697 -0
- package/packs/erdos-open-problems/data/erdos_problems.active.json +15561 -0
- package/packs/erdos-open-problems/data/erdos_problems.all.json +26289 -0
- package/packs/erdos-open-problems/data/erdos_problems.closed.json +10760 -0
- package/packs/erdos-open-problems/data/erdos_problems.open.json +15561 -0
- package/packs/erdos-open-problems/docs/SUNFLOWER_ADAPTER_DEPENDENCIES.md +63 -0
- package/packs/erdos-open-problems/pack.yml +131 -0
- package/packs/erdos-open-problems/profiles/erdos-problems-catalog-sync.yml.tmpl +99 -0
- package/packs/erdos-open-problems/profiles/sunflower-live-compare.yml.tmpl +188 -0
- package/packs/erdos-open-problems/profiles/sunflower-mathlib-pr-governance.yml.tmpl +253 -0
- package/packs/erdos-open-problems/profiles/sunflower-problem857-discovery-public-repo.yml.tmpl +152 -0
- package/packs/erdos-open-problems/profiles/sunflower-problem857-discovery.yml.tmpl +154 -0
- package/packs/external-pr-governance/README.md +116 -0
- package/packs/external-pr-governance/adapters/formal-conjectures/README.md +35 -0
- package/packs/external-pr-governance/adapters/mathlib/README.md +37 -0
- package/packs/external-pr-governance/pack.yml +146 -0
- package/packs/external-pr-governance/profiles/oss-feedback-hardening.yml.tmpl +92 -0
- package/packs/external-pr-governance/profiles/oss-pr-governance.yml.tmpl +233 -0
- package/packs/issue-smashers/README.md +92 -0
- package/packs/issue-smashers/adapters/formal-conjectures/README.md +17 -0
- package/packs/issue-smashers/adapters/generic-github/README.md +16 -0
- package/packs/issue-smashers/adapters/mathlib/README.md +32 -0
- package/packs/issue-smashers/bootstrap/README.md +19 -0
- package/packs/issue-smashers/bootstrap/setup-issue-smashers.sh +18 -0
- package/packs/issue-smashers/examples/issue-smashers.workspace.yml +24 -0
- package/packs/issue-smashers/pack.yml +178 -0
- package/packs/issue-smashers/profiles/issue-smashers-feedback-hardening.yml.tmpl +102 -0
- package/packs/issue-smashers/profiles/issue-smashers.yml.tmpl +258 -0
- package/scripts/npm-postinstall-check.js +31 -0
- package/scripts/orp +11 -0
- package/scripts/orp-agent-integrate.sh +197 -0
- package/scripts/orp-checkpoint.sh +184 -0
- package/scripts/orp-erdos-problems-sync.py +580 -0
- package/scripts/orp-init.sh +50 -0
- package/scripts/orp-pack-fetch.py +155 -0
- package/scripts/orp-pack-install.py +2273 -0
- package/scripts/orp-pack-render.py +188 -0
- package/spec/v1/LIFECYCLE_MAPPING.md +40 -0
- package/spec/v1/orp.config.schema.json +385 -0
- package/spec/v1/packet.schema.json +552 -0
- package/spec/v1/profile-pack.schema.json +95 -0
- package/templates/CLAIM.md +33 -0
- package/templates/FAILED_TOPIC.md +19 -0
- package/templates/ISSUE_TEMPLATE.md +22 -0
- package/templates/VERIFICATION_RECORD.md +34 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Fetch ORP profile packs from git sources into a local cache."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
import re
|
|
9
|
+
import subprocess
|
|
10
|
+
import sys
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
import yaml
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _run(cmd: list[str], *, cwd: Path | None = None) -> None:
|
|
17
|
+
proc = subprocess.run(
|
|
18
|
+
cmd,
|
|
19
|
+
cwd=str(cwd) if cwd is not None else None,
|
|
20
|
+
capture_output=True,
|
|
21
|
+
text=True,
|
|
22
|
+
)
|
|
23
|
+
if proc.returncode != 0:
|
|
24
|
+
msg = (proc.stderr or proc.stdout or "command failed").strip()
|
|
25
|
+
raise RuntimeError(f"{' '.join(cmd)}: {msg}")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _safe_slug(source: str) -> str:
|
|
29
|
+
s = source.strip().rstrip("/")
|
|
30
|
+
s = s.split("/")[-1]
|
|
31
|
+
if s.endswith(".git"):
|
|
32
|
+
s = s[:-4]
|
|
33
|
+
s = re.sub(r"[^A-Za-z0-9._-]+", "-", s)
|
|
34
|
+
s = s.strip("-._")
|
|
35
|
+
return s or "pack-source"
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _load_yaml(path: Path) -> dict[str, Any]:
|
|
39
|
+
payload = yaml.safe_load(path.read_text(encoding="utf-8"))
|
|
40
|
+
if not isinstance(payload, dict):
|
|
41
|
+
raise RuntimeError(f"yaml root must be object: {path}")
|
|
42
|
+
return payload
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _discover_pack_root(repo_path: Path, pack_id: str) -> tuple[Path, str]:
|
|
46
|
+
candidates: list[tuple[Path, str]] = []
|
|
47
|
+
|
|
48
|
+
root_pack = repo_path / "pack.yml"
|
|
49
|
+
if root_pack.exists():
|
|
50
|
+
meta = _load_yaml(root_pack)
|
|
51
|
+
pid = str(meta.get("pack_id", repo_path.name))
|
|
52
|
+
candidates.append((repo_path, pid))
|
|
53
|
+
|
|
54
|
+
packs_dir = repo_path / "packs"
|
|
55
|
+
if packs_dir.exists():
|
|
56
|
+
for child in sorted(packs_dir.iterdir()):
|
|
57
|
+
if not child.is_dir():
|
|
58
|
+
continue
|
|
59
|
+
yml = child / "pack.yml"
|
|
60
|
+
if not yml.exists():
|
|
61
|
+
continue
|
|
62
|
+
meta = _load_yaml(yml)
|
|
63
|
+
pid = str(meta.get("pack_id", child.name))
|
|
64
|
+
candidates.append((child, pid))
|
|
65
|
+
|
|
66
|
+
if not candidates:
|
|
67
|
+
raise RuntimeError(f"no pack.yml found in repo: {repo_path}")
|
|
68
|
+
|
|
69
|
+
if pack_id:
|
|
70
|
+
for root, pid in candidates:
|
|
71
|
+
if pid == pack_id or root.name == pack_id:
|
|
72
|
+
return root, pid
|
|
73
|
+
ids = ", ".join(sorted({pid for _, pid in candidates}))
|
|
74
|
+
raise RuntimeError(f"pack_id not found: {pack_id} (available: {ids})")
|
|
75
|
+
|
|
76
|
+
unique = {(str(root), pid) for root, pid in candidates}
|
|
77
|
+
if len(unique) == 1:
|
|
78
|
+
root, pid = candidates[0]
|
|
79
|
+
return root, pid
|
|
80
|
+
|
|
81
|
+
ids = ", ".join(sorted({pid for _, pid in candidates}))
|
|
82
|
+
raise RuntimeError(f"multiple packs found; pass --pack-id ({ids})")
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _build_parser() -> argparse.ArgumentParser:
|
|
86
|
+
p = argparse.ArgumentParser(description="Fetch ORP profile packs from git")
|
|
87
|
+
p.add_argument("--source", required=True, help="Git URL or local git repo path")
|
|
88
|
+
p.add_argument("--pack-id", default="", help="Pack id to select (required when repo has multiple packs)")
|
|
89
|
+
p.add_argument("--ref", default="", help="Optional branch/tag/commit to checkout")
|
|
90
|
+
p.add_argument(
|
|
91
|
+
"--cache-root",
|
|
92
|
+
default="",
|
|
93
|
+
help="Cache root directory (default: ~/.orp/packs)",
|
|
94
|
+
)
|
|
95
|
+
p.add_argument(
|
|
96
|
+
"--name",
|
|
97
|
+
default="",
|
|
98
|
+
help="Optional cache directory name (default: derived from --source)",
|
|
99
|
+
)
|
|
100
|
+
return p
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def main() -> int:
|
|
104
|
+
args = _build_parser().parse_args()
|
|
105
|
+
|
|
106
|
+
source = args.source.strip()
|
|
107
|
+
if not source:
|
|
108
|
+
raise RuntimeError("--source cannot be empty")
|
|
109
|
+
|
|
110
|
+
if args.cache_root.strip():
|
|
111
|
+
cache_root = Path(args.cache_root).expanduser().resolve()
|
|
112
|
+
else:
|
|
113
|
+
cache_root = (Path.home() / ".orp" / "packs").resolve()
|
|
114
|
+
cache_root.mkdir(parents=True, exist_ok=True)
|
|
115
|
+
|
|
116
|
+
repo_name = args.name.strip() or _safe_slug(source)
|
|
117
|
+
repo_path = (cache_root / repo_name).resolve()
|
|
118
|
+
|
|
119
|
+
if not repo_path.exists():
|
|
120
|
+
_run(["git", "clone", source, str(repo_path)])
|
|
121
|
+
else:
|
|
122
|
+
_run(["git", "-C", str(repo_path), "fetch", "--all", "--tags", "--prune"])
|
|
123
|
+
# best-effort fast-forward; repo may be detached by design
|
|
124
|
+
subprocess.run(
|
|
125
|
+
["git", "-C", str(repo_path), "pull", "--ff-only"],
|
|
126
|
+
capture_output=True,
|
|
127
|
+
text=True,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
if args.ref.strip():
|
|
131
|
+
_run(["git", "-C", str(repo_path), "checkout", args.ref.strip()])
|
|
132
|
+
|
|
133
|
+
head = subprocess.check_output(
|
|
134
|
+
["git", "-C", str(repo_path), "rev-parse", "--short", "HEAD"],
|
|
135
|
+
text=True,
|
|
136
|
+
).strip()
|
|
137
|
+
|
|
138
|
+
pack_root, discovered_pack_id = _discover_pack_root(repo_path, args.pack_id.strip())
|
|
139
|
+
|
|
140
|
+
print(f"source={source}")
|
|
141
|
+
print(f"cache_root={cache_root}")
|
|
142
|
+
print(f"repo_path={repo_path}")
|
|
143
|
+
print(f"repo_head={head}")
|
|
144
|
+
print(f"pack_id={discovered_pack_id}")
|
|
145
|
+
print(f"pack_path={pack_root}")
|
|
146
|
+
return 0
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
if __name__ == "__main__":
|
|
150
|
+
try:
|
|
151
|
+
raise SystemExit(main())
|
|
152
|
+
except RuntimeError as exc:
|
|
153
|
+
print(f"error: {exc}", file=sys.stderr)
|
|
154
|
+
raise SystemExit(2)
|
|
155
|
+
|