open-research-protocol 0.4.32 → 0.4.34
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/CHANGELOG.md +46 -0
- package/cli/orp.py +1381 -12
- package/package.json +1 -1
- package/packages/orp-workspace-launcher/src/core-plan.js +30 -0
- package/packages/orp-workspace-launcher/src/hosted-state.js +294 -2
- package/packages/orp-workspace-launcher/src/index.js +5 -1
- package/packages/orp-workspace-launcher/src/sync.js +14 -4
- package/packages/orp-workspace-launcher/test/core-plan.test.js +48 -0
- package/packages/orp-workspace-launcher/test/hosted-state.test.js +134 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import fs from "node:fs/promises";
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
|
|
7
|
+
import { buildHostedWorkspaceState } from "../src/index.js";
|
|
8
|
+
|
|
9
|
+
async function makeFrontierProject() {
|
|
10
|
+
const root = await fs.mkdtemp(path.join(os.tmpdir(), "orp-hosted-state-frontier-"));
|
|
11
|
+
const frontierRoot = path.join(root, "orp", "frontier");
|
|
12
|
+
const linkRoot = path.join(root, ".git", "orp", "link");
|
|
13
|
+
await fs.mkdir(frontierRoot, { recursive: true });
|
|
14
|
+
await fs.mkdir(linkRoot, { recursive: true });
|
|
15
|
+
await fs.writeFile(
|
|
16
|
+
path.join(frontierRoot, "TAS.md"),
|
|
17
|
+
[
|
|
18
|
+
"# ORP TAS: Evidence-Backed Conditional Strategy Controls",
|
|
19
|
+
"",
|
|
20
|
+
"## Active Task Order",
|
|
21
|
+
"",
|
|
22
|
+
"1. Define a small replay metadata taxonomy for semantic regimes.",
|
|
23
|
+
"2. Add a metadata-quality gate.",
|
|
24
|
+
].join("\n"),
|
|
25
|
+
"utf8",
|
|
26
|
+
);
|
|
27
|
+
await fs.writeFile(
|
|
28
|
+
path.join(frontierRoot, "state.json"),
|
|
29
|
+
JSON.stringify(
|
|
30
|
+
{
|
|
31
|
+
active_version: "v0",
|
|
32
|
+
active_milestone: "v0.2",
|
|
33
|
+
active_phase: "regime-metadata-quality",
|
|
34
|
+
next_action: "Implement replay metadata taxonomy and metadata-quality gates.",
|
|
35
|
+
},
|
|
36
|
+
null,
|
|
37
|
+
2,
|
|
38
|
+
),
|
|
39
|
+
"utf8",
|
|
40
|
+
);
|
|
41
|
+
await fs.writeFile(
|
|
42
|
+
path.join(frontierRoot, "version-stack.json"),
|
|
43
|
+
JSON.stringify(
|
|
44
|
+
{
|
|
45
|
+
versions: [
|
|
46
|
+
{
|
|
47
|
+
id: "v0",
|
|
48
|
+
label: "Dry-run Topstep 50K lab",
|
|
49
|
+
milestones: [
|
|
50
|
+
{
|
|
51
|
+
id: "v0.2",
|
|
52
|
+
label: "Evidence-backed conditional strategy controls",
|
|
53
|
+
phases: [
|
|
54
|
+
{
|
|
55
|
+
id: "signal-quality-and-control-provenance",
|
|
56
|
+
label: "Signal quality and control provenance",
|
|
57
|
+
status: "completed",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "regime-metadata-quality",
|
|
61
|
+
label: "Regime metadata quality",
|
|
62
|
+
status: "active",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "first-regime-sample-capture",
|
|
66
|
+
label: "First regime sample capture",
|
|
67
|
+
status: "planned",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
null,
|
|
76
|
+
2,
|
|
77
|
+
),
|
|
78
|
+
"utf8",
|
|
79
|
+
);
|
|
80
|
+
await fs.writeFile(
|
|
81
|
+
path.join(linkRoot, "project.json"),
|
|
82
|
+
JSON.stringify(
|
|
83
|
+
{
|
|
84
|
+
idea_id: "idea-123",
|
|
85
|
+
idea_title: "Canonical futures idea",
|
|
86
|
+
active_feature_id: "feature-regime-metadata-quality",
|
|
87
|
+
frontier_feature_ids: {
|
|
88
|
+
"regime-metadata-quality": "feature-regime-metadata-quality",
|
|
89
|
+
},
|
|
90
|
+
project_root: root,
|
|
91
|
+
},
|
|
92
|
+
null,
|
|
93
|
+
2,
|
|
94
|
+
),
|
|
95
|
+
"utf8",
|
|
96
|
+
);
|
|
97
|
+
return root;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
test("buildHostedWorkspaceState compiles local ORP frontier plan and tasks", async () => {
|
|
101
|
+
const projectRoot = await makeFrontierProject();
|
|
102
|
+
const state = buildHostedWorkspaceState({
|
|
103
|
+
version: "1",
|
|
104
|
+
workspaceId: "main-cody-1",
|
|
105
|
+
title: "main-cody-1",
|
|
106
|
+
tabs: [
|
|
107
|
+
{
|
|
108
|
+
title: "futures-prop-trading-lab",
|
|
109
|
+
path: projectRoot,
|
|
110
|
+
resumeTool: "codex",
|
|
111
|
+
resumeSessionId: "019d4f24-c8ba-78b2-a726-48b1ce9f0fe9",
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
assert.equal(state.tabs.length, 1);
|
|
117
|
+
assert.equal(state.tabs[0].plan.summary, "ORP TAS: Evidence-Backed Conditional Strategy Controls");
|
|
118
|
+
assert.equal(state.tabs[0].plan.source, "orp/frontier/TAS.md");
|
|
119
|
+
assert.equal(state.tabs[0].linked_idea_id, "idea-123");
|
|
120
|
+
assert.equal(state.tabs[0].linked_feature_id, "feature-regime-metadata-quality");
|
|
121
|
+
assert.match(state.tabs[0].plan.body, /Current next action: Implement replay metadata taxonomy/);
|
|
122
|
+
assert.deepEqual(
|
|
123
|
+
state.tabs[0].tasks.map((task) => [task.id, task.status]),
|
|
124
|
+
[
|
|
125
|
+
["signal-quality-and-control-provenance", "done"],
|
|
126
|
+
["regime-metadata-quality", "in_progress"],
|
|
127
|
+
["first-regime-sample-capture", "todo"],
|
|
128
|
+
],
|
|
129
|
+
);
|
|
130
|
+
assert.equal(state.projects[0].plan.summary, "ORP TAS: Evidence-Backed Conditional Strategy Controls");
|
|
131
|
+
assert.equal(state.projects[0].tasks.length, 3);
|
|
132
|
+
assert.equal(state.projects[0].linked_idea_id, "idea-123");
|
|
133
|
+
assert.equal(state.projects[0].linked_feature_id, "feature-regime-metadata-quality");
|
|
134
|
+
});
|