erdos-problems 0.2.9 → 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/README.md +47 -13
- package/data/upstream/erdosproblems/SYNC_MANIFEST.json +4 -4
- package/docs/CANONICAL_REPO_MIGRATION_PLAN.md +279 -0
- package/docs/DEEP_RESEARCH_BUNDLE_SPEC.md +129 -0
- package/docs/ERDOS_PROBLEMS_PROBLEM_SCHEMA.md +27 -20
- package/docs/ERDOS_PROBLEMS_REPO_SPEC.md +35 -11
- package/docs/PAPER_WRITER_MODE.md +118 -0
- package/package.json +1 -1
- package/packs/sunflower/compute/20/u3_uniform_transfer_window_v0.yaml +2 -1
- package/problems/1/AGENT_START.md +1 -1
- package/problems/1/EVIDENCE.md +1 -1
- package/problems/1/FORMALIZATION.md +2 -2
- package/problems/1/problem.yaml +6 -6
- package/problems/1008/problem.yaml +5 -5
- package/problems/18/problem.yaml +5 -5
- package/problems/19/AGENT_START.md +1 -1
- package/problems/19/EVIDENCE.md +1 -1
- package/problems/19/FORMALIZATION.md +2 -2
- package/problems/19/problem.yaml +6 -6
- package/problems/2/AGENT_START.md +1 -1
- package/problems/2/EVIDENCE.md +1 -1
- package/problems/2/FORMALIZATION.md +2 -2
- package/problems/2/problem.yaml +6 -6
- package/problems/20/problem.yaml +5 -5
- package/problems/21/AGENT_START.md +1 -1
- package/problems/21/EVIDENCE.md +1 -1
- package/problems/21/FORMALIZATION.md +2 -2
- package/problems/21/problem.yaml +6 -6
- package/problems/22/AGENT_START.md +1 -1
- package/problems/22/EVIDENCE.md +1 -1
- package/problems/22/FORMALIZATION.md +2 -2
- package/problems/22/problem.yaml +6 -6
- package/problems/3/AGENT_START.md +1 -1
- package/problems/3/EVIDENCE.md +1 -1
- package/problems/3/FORMALIZATION.md +2 -2
- package/problems/3/problem.yaml +6 -6
- package/problems/4/AGENT_START.md +1 -1
- package/problems/4/EVIDENCE.md +1 -1
- package/problems/4/FORMALIZATION.md +2 -2
- package/problems/4/problem.yaml +6 -6
- package/problems/5/AGENT_START.md +1 -1
- package/problems/5/EVIDENCE.md +1 -1
- package/problems/5/FORMALIZATION.md +2 -2
- package/problems/5/problem.yaml +6 -6
- package/problems/536/problem.yaml +5 -5
- package/problems/542/problem.yaml +5 -5
- package/problems/6/AGENT_START.md +1 -1
- package/problems/6/EVIDENCE.md +1 -1
- package/problems/6/FORMALIZATION.md +2 -2
- package/problems/6/problem.yaml +6 -6
- package/problems/7/AGENT_START.md +1 -1
- package/problems/7/EVIDENCE.md +1 -1
- package/problems/7/FORMALIZATION.md +2 -2
- package/problems/7/problem.yaml +6 -6
- package/problems/856/problem.yaml +5 -5
- package/problems/857/problem.yaml +5 -5
- package/problems/89/problem.yaml +5 -5
- package/src/atlas/catalog.js +6 -5
- package/src/cli/index.js +10 -5
- package/src/commands/bootstrap.js +1 -1
- package/src/commands/dossier.js +1 -1
- package/src/commands/maintainer.js +2 -2
- package/src/commands/paper.js +147 -0
- package/src/commands/problem.js +9 -9
- package/src/commands/pull.js +8 -8
- package/src/commands/scaffold.js +1 -1
- package/src/commands/seed.js +1 -1
- package/src/commands/upstream.js +33 -21
- package/src/runtime/maintainer-seed.js +12 -12
- package/src/runtime/paper.js +720 -0
- package/src/runtime/paths.js +16 -0
- package/src/runtime/problem-artifacts.js +2 -2
- package/src/runtime/state.js +1 -1
- package/src/upstream/sync.js +18 -18
package/src/runtime/paths.js
CHANGED
|
@@ -136,6 +136,14 @@ export function getWorkspaceArchiveDir(problemId, workspaceRoot = getWorkspaceRo
|
|
|
136
136
|
return path.join(getWorkspaceArchivesDir(workspaceRoot), String(problemId));
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
export function getWorkspacePapersDir(workspaceRoot = getWorkspaceRoot()) {
|
|
140
|
+
return path.join(getWorkspaceDir(workspaceRoot), 'papers');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function getWorkspaceProblemPaperDir(problemId, workspaceRoot = getWorkspaceRoot()) {
|
|
144
|
+
return path.join(getWorkspacePapersDir(workspaceRoot), String(problemId));
|
|
145
|
+
}
|
|
146
|
+
|
|
139
147
|
export function getWorkspaceProblemCheckpointsDir(workspaceRoot = getWorkspaceRoot()) {
|
|
140
148
|
return path.join(getWorkspaceCheckpointsDir(workspaceRoot), 'problem-checkpoints');
|
|
141
149
|
}
|
|
@@ -196,6 +204,14 @@ export function getRepoUpstreamDiffPath() {
|
|
|
196
204
|
return path.join(getRepoAnalysisDir(), 'UPSTREAM_DIFF.md');
|
|
197
205
|
}
|
|
198
206
|
|
|
207
|
+
export function getRepoPaperDir() {
|
|
208
|
+
return path.join(repoRoot, 'paper');
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function getRepoProblemPaperDir(problemId) {
|
|
212
|
+
return path.join(getRepoPaperDir(), 'problems', String(problemId));
|
|
213
|
+
}
|
|
214
|
+
|
|
199
215
|
export function getPackDir(packName) {
|
|
200
216
|
return path.join(repoRoot, 'packs', String(packName));
|
|
201
217
|
}
|
|
@@ -134,7 +134,7 @@ export function getProblemArtifactInventory(problem) {
|
|
|
134
134
|
manifestPath: snapshot.manifestPath,
|
|
135
135
|
indexPath: snapshot.indexPath,
|
|
136
136
|
yamlPath: snapshot.yamlPath,
|
|
137
|
-
upstreamCommit: snapshot.manifest.upstream_commit ?? null,
|
|
137
|
+
upstreamCommit: snapshot.manifest.imported_commit ?? snapshot.manifest.upstream_commit ?? null,
|
|
138
138
|
fetchedAt: snapshot.manifest.fetched_at,
|
|
139
139
|
}
|
|
140
140
|
: null,
|
|
@@ -263,7 +263,7 @@ export function scaffoldProblem(problem, destination) {
|
|
|
263
263
|
`- Source: ${problem.sourceUrl}`,
|
|
264
264
|
`- Repo status: ${problem.repoStatus}`,
|
|
265
265
|
`- Harness depth: ${problem.harnessDepth}`,
|
|
266
|
-
`-
|
|
266
|
+
`- Imported record included: ${inventory.upstreamRecordIncluded ? 'yes' : 'no'}`,
|
|
267
267
|
`- Starter loop artifacts copied: ${copiedStarterArtifacts.length}`,
|
|
268
268
|
`- Pack problem artifacts copied: ${packProblemArtifacts.length}`,
|
|
269
269
|
`- Compute packets copied: ${computeArtifacts.length}`,
|
package/src/runtime/state.js
CHANGED
|
@@ -156,7 +156,7 @@ function deriveGenericProblemSummary(problem) {
|
|
|
156
156
|
routeStory: activeRoute
|
|
157
157
|
? `Advance ${activeRoute} without blurring local route state into global problem status.`
|
|
158
158
|
: 'No active route is recorded for this dossier yet.',
|
|
159
|
-
checkpointFocus: 'Keep dossier truth,
|
|
159
|
+
checkpointFocus: 'Keep dossier truth, import provenance, and local route state sharply separated.',
|
|
160
160
|
nextHonestMove,
|
|
161
161
|
packArtifacts: null,
|
|
162
162
|
activeTicketId: null,
|
package/src/upstream/sync.js
CHANGED
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
getWorkspaceUpstreamYamlPath,
|
|
18
18
|
} from '../runtime/paths.js';
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
20
|
+
const EXTERNAL_REPO_URL = 'https://github.com/teorth/erdosproblems';
|
|
21
|
+
const EXTERNAL_RAW_PROBLEMS_URL = 'https://raw.githubusercontent.com/teorth/erdosproblems/master/data/problems.yaml';
|
|
22
|
+
const EXTERNAL_COMMIT_API_URL = 'https://api.github.com/repos/teorth/erdosproblems/commits?path=data/problems.yaml&per_page=1';
|
|
23
23
|
|
|
24
24
|
function sha256(text) {
|
|
25
25
|
return crypto.createHash('sha256').update(text).digest('hex');
|
|
@@ -51,7 +51,7 @@ function normalizeUpstreamRecord(entry) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
async function fetchUpstreamCommit() {
|
|
54
|
-
const response = await fetch(
|
|
54
|
+
const response = await fetch(EXTERNAL_COMMIT_API_URL, {
|
|
55
55
|
headers: {
|
|
56
56
|
'User-Agent': 'erdos-problems-cli',
|
|
57
57
|
Accept: 'application/vnd.github+json',
|
|
@@ -65,7 +65,7 @@ async function fetchUpstreamCommit() {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
export async function fetchUpstreamSnapshot() {
|
|
68
|
-
const response = await fetch(
|
|
68
|
+
const response = await fetch(EXTERNAL_RAW_PROBLEMS_URL, {
|
|
69
69
|
headers: {
|
|
70
70
|
'User-Agent': 'erdos-problems-cli',
|
|
71
71
|
Accept: 'text/plain',
|
|
@@ -79,11 +79,11 @@ export async function fetchUpstreamSnapshot() {
|
|
|
79
79
|
const records = parsed.map(normalizeUpstreamRecord);
|
|
80
80
|
const commit = await fetchUpstreamCommit();
|
|
81
81
|
const manifest = {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
external_repo: EXTERNAL_REPO_URL,
|
|
83
|
+
external_source_url: EXTERNAL_RAW_PROBLEMS_URL,
|
|
84
|
+
external_source_file: 'data/problems.yaml',
|
|
85
85
|
fetched_at: new Date().toISOString(),
|
|
86
|
-
|
|
86
|
+
imported_commit: commit,
|
|
87
87
|
raw_sha256: sha256(rawYaml),
|
|
88
88
|
entry_count: records.length,
|
|
89
89
|
};
|
|
@@ -154,7 +154,7 @@ function compareTagSets(localProblem, upstreamRecord) {
|
|
|
154
154
|
export function buildUpstreamDiff() {
|
|
155
155
|
const snapshot = loadActiveUpstreamSnapshot();
|
|
156
156
|
if (!snapshot) {
|
|
157
|
-
throw new Error('No
|
|
157
|
+
throw new Error('No import snapshot available. Run `erdos import sync` first.');
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
const localProblems = loadLocalProblems();
|
|
@@ -170,7 +170,7 @@ export function buildUpstreamDiff() {
|
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
const statusMatches = normalizeStatus(problem.siteStatus) === normalizeStatus(upstream.status.state);
|
|
173
|
-
const formalizedMatches = normalizeStatus(problem.
|
|
173
|
+
const formalizedMatches = normalizeStatus(problem.importedFormalizedState) === normalizeStatus(upstream.formalized.state);
|
|
174
174
|
const tagDiff = compareTagSets(problem, upstream);
|
|
175
175
|
|
|
176
176
|
overlaps.push({
|
|
@@ -180,7 +180,7 @@ export function buildUpstreamDiff() {
|
|
|
180
180
|
localSiteStatus: problem.siteStatus,
|
|
181
181
|
upstreamSiteStatus: upstream.status.state,
|
|
182
182
|
statusMatches,
|
|
183
|
-
localFormalized: problem.
|
|
183
|
+
localFormalized: problem.importedFormalizedState,
|
|
184
184
|
upstreamFormalized: upstream.formalized.state,
|
|
185
185
|
formalizedMatches,
|
|
186
186
|
localPrize: problem.prize,
|
|
@@ -207,20 +207,20 @@ export function buildUpstreamDiff() {
|
|
|
207
207
|
|
|
208
208
|
export function renderUpstreamDiffMarkdown(diff) {
|
|
209
209
|
const lines = [];
|
|
210
|
-
lines.push('#
|
|
210
|
+
lines.push('# External Atlas Diff');
|
|
211
211
|
lines.push('');
|
|
212
212
|
lines.push(`Snapshot kind: \
|
|
213
213
|
${diff.snapshot.kind}`.replace('\
|
|
214
214
|
', ''));
|
|
215
|
-
lines.push(`
|
|
215
|
+
lines.push(`Imported commit: ${diff.snapshot.manifest.imported_commit ?? '(unknown)'}`);
|
|
216
216
|
lines.push(`Fetched at: ${diff.snapshot.manifest.fetched_at}`);
|
|
217
217
|
lines.push(`Local seeded problems: ${diff.localProblemCount}`);
|
|
218
|
-
lines.push(`
|
|
219
|
-
lines.push(`
|
|
218
|
+
lines.push(`External atlas total problems: ${diff.upstreamProblemCount}`);
|
|
219
|
+
lines.push(`External-only problems not yet locally seeded: ${diff.upstreamOnlyCount}`);
|
|
220
220
|
lines.push('');
|
|
221
221
|
lines.push('## Overlap');
|
|
222
222
|
lines.push('');
|
|
223
|
-
lines.push('| ID | Cluster | Local site |
|
|
223
|
+
lines.push('| ID | Cluster | Local site | External site | Status | Local formalized | Imported formalized | Tags |');
|
|
224
224
|
lines.push('| --- | --- | --- | --- | --- | --- | --- | --- |');
|
|
225
225
|
for (const row of diff.overlaps) {
|
|
226
226
|
const status = row.statusMatches ? 'match' : 'DIFF';
|
|
@@ -235,7 +235,7 @@ ${diff.snapshot.kind}`.replace('\
|
|
|
235
235
|
lines.push(`| ${row.problemId} | ${row.cluster} | ${row.localSiteStatus} | ${row.upstreamSiteStatus} | ${status} | ${row.localFormalized ?? '(unset)'} | ${row.upstreamFormalized ?? '(unset)'} | ${tagNotes.join('; ') || 'match'} |`);
|
|
236
236
|
}
|
|
237
237
|
lines.push('');
|
|
238
|
-
lines.push('##
|
|
238
|
+
lines.push('## External-Only Preview');
|
|
239
239
|
lines.push('');
|
|
240
240
|
lines.push(diff.upstreamOnlyPreview.join(', ') || '(none)');
|
|
241
241
|
lines.push('');
|