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
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { getProblem } from '../atlas/catalog.js';
|
|
2
|
+
import { getPaperBundleOverview, initPaperBundle } from '../runtime/paper.js';
|
|
3
|
+
import { getWorkspaceRoot } from '../runtime/paths.js';
|
|
4
|
+
import { readCurrentProblem } from '../runtime/workspace.js';
|
|
5
|
+
|
|
6
|
+
function parsePaperArgs(args) {
|
|
7
|
+
const parsed = {
|
|
8
|
+
problemId: null,
|
|
9
|
+
destination: null,
|
|
10
|
+
asJson: false,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
14
|
+
const token = args[index];
|
|
15
|
+
if (token === '--dest') {
|
|
16
|
+
parsed.destination = args[index + 1];
|
|
17
|
+
if (!parsed.destination) {
|
|
18
|
+
return { error: 'Missing destination path after --dest.' };
|
|
19
|
+
}
|
|
20
|
+
index += 1;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (token === '--json') {
|
|
24
|
+
parsed.asJson = true;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (!parsed.problemId) {
|
|
28
|
+
parsed.problemId = token;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
return { error: `Unknown paper option: ${token}` };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return parsed;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function printPaperOverview(overview) {
|
|
38
|
+
console.log(`Paper bundle for Erdos Problem #${overview.problemId}`);
|
|
39
|
+
console.log(`Title: ${overview.title}`);
|
|
40
|
+
console.log(`Paper mode: ${overview.paperMode}`);
|
|
41
|
+
console.log(`Bundle dir: ${overview.bundleDir}`);
|
|
42
|
+
if (overview.bundlePublicPath) {
|
|
43
|
+
console.log(`Repo bundle path: ${overview.bundlePublicPath}`);
|
|
44
|
+
}
|
|
45
|
+
console.log(`Created at: ${overview.createdAt}`);
|
|
46
|
+
console.log(`Last initialized: ${overview.lastInitializedAt}`);
|
|
47
|
+
console.log(`Public evidence: canonical=${overview.publicEvidenceSummary.canonicalArtifacts}, pack=${overview.publicEvidenceSummary.packProblemArtifacts}, compute=${overview.publicEvidenceSummary.computePackets}`);
|
|
48
|
+
console.log('Core files:');
|
|
49
|
+
console.log(`- manifest: ${overview.paths.manifest}`);
|
|
50
|
+
console.log(`- writer brief: ${overview.paths.writerBrief}`);
|
|
51
|
+
console.log(`- evidence index: ${overview.paths.evidenceIndex}`);
|
|
52
|
+
console.log(`- section status: ${overview.paths.sectionStatus}`);
|
|
53
|
+
console.log(`- privacy review: ${overview.paths.privacyReview}`);
|
|
54
|
+
console.log(`- citation ledger: ${overview.paths.citationLedger}`);
|
|
55
|
+
console.log('Sections:');
|
|
56
|
+
for (const section of overview.sections) {
|
|
57
|
+
console.log(`- ${section.fileName}: ${section.exists ? 'present' : 'missing'} (${section.title})`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function runPaperCommand(args) {
|
|
62
|
+
const [subcommand, ...rest] = args;
|
|
63
|
+
|
|
64
|
+
if (!subcommand || subcommand === 'help' || subcommand === '--help') {
|
|
65
|
+
console.log('Usage:');
|
|
66
|
+
console.log(' erdos paper init [<id>] [--dest <path>] [--json]');
|
|
67
|
+
console.log(' erdos paper show [<id>] [--dest <path>] [--json]');
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const workspaceRoot = getWorkspaceRoot();
|
|
72
|
+
|
|
73
|
+
if (subcommand === 'init') {
|
|
74
|
+
const parsed = parsePaperArgs(rest);
|
|
75
|
+
if (parsed.error) {
|
|
76
|
+
console.error(parsed.error);
|
|
77
|
+
return 1;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const problemId = parsed.problemId ?? readCurrentProblem();
|
|
81
|
+
if (!problemId) {
|
|
82
|
+
console.error('Missing problem id and no active problem is selected.');
|
|
83
|
+
return 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const problem = getProblem(problemId, workspaceRoot);
|
|
87
|
+
if (!problem) {
|
|
88
|
+
console.error(`Unknown problem: ${problemId}`);
|
|
89
|
+
return 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const result = initPaperBundle(problem.problemId, {
|
|
93
|
+
destination: parsed.destination,
|
|
94
|
+
workspaceRoot,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
if (parsed.asJson) {
|
|
98
|
+
console.log(JSON.stringify(result, null, 2));
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
console.log(`Paper bundle ${result.mode}: ${result.bundleDir}`);
|
|
103
|
+
console.log(`Problem: ${problem.displayName} (${problem.title})`);
|
|
104
|
+
console.log(`Paper mode: ${result.manifest.paperMode}`);
|
|
105
|
+
console.log(`Created files: ${result.createdFiles.length}`);
|
|
106
|
+
console.log(`Preserved files: ${result.preservedFiles.length}`);
|
|
107
|
+
console.log(`Updated indexes: ${result.updatedFiles.join(', ')}`);
|
|
108
|
+
console.log('Start here: WRITER_BRIEF.md, PUBLIC_EVIDENCE_INDEX.json, SECTION_STATUS.md');
|
|
109
|
+
return 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (subcommand === 'show') {
|
|
113
|
+
const parsed = parsePaperArgs(rest);
|
|
114
|
+
if (parsed.error) {
|
|
115
|
+
console.error(parsed.error);
|
|
116
|
+
return 1;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const problemId = parsed.problemId ?? readCurrentProblem();
|
|
120
|
+
if (!problemId) {
|
|
121
|
+
console.error('Missing problem id and no active problem is selected.');
|
|
122
|
+
return 1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
let overview;
|
|
126
|
+
try {
|
|
127
|
+
overview = getPaperBundleOverview(problemId, {
|
|
128
|
+
destination: parsed.destination,
|
|
129
|
+
workspaceRoot,
|
|
130
|
+
});
|
|
131
|
+
} catch (error) {
|
|
132
|
+
console.error(error.message);
|
|
133
|
+
return 1;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (parsed.asJson) {
|
|
137
|
+
console.log(JSON.stringify(overview, null, 2));
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
printPaperOverview(overview);
|
|
142
|
+
return 0;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
console.error(`Unknown paper subcommand: ${subcommand}`);
|
|
146
|
+
return 1;
|
|
147
|
+
}
|
package/src/commands/problem.js
CHANGED
|
@@ -99,8 +99,8 @@ function printProblem(problem) {
|
|
|
99
99
|
}
|
|
100
100
|
console.log(`Prize: ${problem.prize ?? '(none)'}`);
|
|
101
101
|
console.log(`Formalization: ${problem.formalizationStatus}`);
|
|
102
|
-
console.log(`
|
|
103
|
-
console.log(`
|
|
102
|
+
console.log(`Imported formalized: ${problem.importedFormalizedState ?? '(unknown)'}`);
|
|
103
|
+
console.log(`Imported last update: ${problem.importedLastUpdate ?? '(unknown)'}`);
|
|
104
104
|
console.log(`Related: ${problem.relatedProblems.join(', ') || '(none)'}`);
|
|
105
105
|
console.log(`Tags: ${problem.familyTags.join(', ') || '(none)'}`);
|
|
106
106
|
console.log(`Statement: ${problem.shortStatement}`);
|
|
@@ -111,11 +111,11 @@ function printProblem(problem) {
|
|
|
111
111
|
console.log(` route breakthrough: ${problem.researchState.route_breakthrough ? 'yes' : 'no'}`);
|
|
112
112
|
console.log(` problem solved: ${problem.researchState.problem_solved ? 'yes' : 'no'}`);
|
|
113
113
|
}
|
|
114
|
-
if (problem.
|
|
115
|
-
console.log('
|
|
116
|
-
console.log(` repo: ${problem.
|
|
117
|
-
console.log(` data file: ${problem.
|
|
118
|
-
console.log(` number: ${problem.
|
|
114
|
+
if (problem.externalSource) {
|
|
115
|
+
console.log('External import provenance:');
|
|
116
|
+
console.log(` repo: ${problem.externalSource.repo}`);
|
|
117
|
+
console.log(` data file: ${problem.externalSource.data_file}`);
|
|
118
|
+
console.log(` number: ${problem.externalSource.number}`);
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -154,13 +154,13 @@ function printArtifactInventory(problem, inventory, asJson) {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
if (inventory.upstreamSnapshot) {
|
|
157
|
-
console.log('
|
|
157
|
+
console.log('External import snapshot:');
|
|
158
158
|
console.log(`- kind: ${inventory.upstreamSnapshot.kind}`);
|
|
159
159
|
console.log(`- manifest: ${inventory.upstreamSnapshot.manifestPath}`);
|
|
160
160
|
console.log(`- index: ${inventory.upstreamSnapshot.indexPath}`);
|
|
161
161
|
console.log(`- commit: ${inventory.upstreamSnapshot.upstreamCommit ?? '(unknown)'}`);
|
|
162
162
|
}
|
|
163
|
-
console.log(`
|
|
163
|
+
console.log(`Imported record available: ${inventory.upstreamRecordIncluded ? 'yes' : 'no'}`);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
export function runProblemCommand(args) {
|
package/src/commands/pull.js
CHANGED
|
@@ -142,7 +142,7 @@ function writeUpstreamOnlyBundle(problemId, destination, upstreamRecord, snapsho
|
|
|
142
142
|
manifestPath: snapshot.manifestPath,
|
|
143
143
|
indexPath: snapshot.indexPath,
|
|
144
144
|
yamlPath: snapshot.yamlPath,
|
|
145
|
-
upstreamCommit: snapshot.manifest.upstream_commit ?? null,
|
|
145
|
+
upstreamCommit: snapshot.manifest.imported_commit ?? snapshot.manifest.upstream_commit ?? null,
|
|
146
146
|
fetchedAt: snapshot.manifest.fetched_at,
|
|
147
147
|
}
|
|
148
148
|
: null,
|
|
@@ -156,7 +156,7 @@ function writeUpstreamOnlyBundle(problemId, destination, upstreamRecord, snapsho
|
|
|
156
156
|
'This bundle was generated from upstream public metadata.',
|
|
157
157
|
'',
|
|
158
158
|
`- Source: https://www.erdosproblems.com/${problemId}`,
|
|
159
|
-
`-
|
|
159
|
+
`- Imported record included: ${upstreamRecord ? 'yes' : 'no'}`,
|
|
160
160
|
'',
|
|
161
161
|
'This problem is not yet seeded locally as a canonical dossier in this package.',
|
|
162
162
|
'',
|
|
@@ -476,7 +476,7 @@ async function writeLiteratureLane(
|
|
|
476
476
|
'This literature lane was generated by the erdos CLI.',
|
|
477
477
|
'',
|
|
478
478
|
`- Local dossier included: ${localProblem ? 'yes' : 'no'}`,
|
|
479
|
-
`-
|
|
479
|
+
`- Imported record included: ${upstreamRecord ? 'yes' : 'no'}`,
|
|
480
480
|
`- Live site snapshot included: ${siteStatus.included ? 'yes' : 'no'}`,
|
|
481
481
|
`- Public search review included: ${publicSearch.included ? 'yes' : 'no'}`,
|
|
482
482
|
`- Crossref adapter included: ${crossref.included ? 'yes' : 'no'}`,
|
|
@@ -511,7 +511,7 @@ function writeRootProblemBundle(rootDir, problemId, localProblem, upstreamRecord
|
|
|
511
511
|
artifactsDir,
|
|
512
512
|
literatureDir,
|
|
513
513
|
snapshotKind: snapshot?.kind ?? null,
|
|
514
|
-
upstreamCommit: snapshot?.manifest.upstream_commit ?? null,
|
|
514
|
+
upstreamCommit: snapshot?.manifest.imported_commit ?? snapshot?.manifest.upstream_commit ?? null,
|
|
515
515
|
});
|
|
516
516
|
writeText(
|
|
517
517
|
path.join(rootDir, 'README.md'),
|
|
@@ -523,7 +523,7 @@ function writeRootProblemBundle(rootDir, problemId, localProblem, upstreamRecord
|
|
|
523
523
|
`- Artifacts lane: ${artifactsDir}`,
|
|
524
524
|
`- Literature lane: ${literatureDir}`,
|
|
525
525
|
`- Local canonical dossier available: ${localProblem ? 'yes' : 'no'}`,
|
|
526
|
-
`-
|
|
526
|
+
`- Imported record included: ${upstreamRecord ? 'yes' : 'no'}`,
|
|
527
527
|
'',
|
|
528
528
|
].join('\n'),
|
|
529
529
|
);
|
|
@@ -591,7 +591,7 @@ export async function runPullCommand(args, options = {}) {
|
|
|
591
591
|
if (!silent) {
|
|
592
592
|
console.log(`Artifact bundle created: ${destination}`);
|
|
593
593
|
console.log(`Local canonical dossier included: ${localProblem ? 'yes' : 'no'}`);
|
|
594
|
-
console.log(`
|
|
594
|
+
console.log(`Imported record included: ${upstreamRecord ? 'yes' : 'no'}`);
|
|
595
595
|
console.log(`Artifacts copied: ${result.copiedArtifacts?.length ?? result.artifactsCopied ?? 0}`);
|
|
596
596
|
}
|
|
597
597
|
return 0;
|
|
@@ -632,7 +632,7 @@ export async function runPullCommand(args, options = {}) {
|
|
|
632
632
|
if (!silent) {
|
|
633
633
|
console.log(`Literature bundle created: ${destination}`);
|
|
634
634
|
console.log(`Local dossier context included: ${localProblem ? 'yes' : 'no'}`);
|
|
635
|
-
console.log(`
|
|
635
|
+
console.log(`Imported record included: ${upstreamRecord ? 'yes' : 'no'}`);
|
|
636
636
|
console.log(`Live site snapshot included: ${result.siteStatus.included ? 'yes' : 'no'}`);
|
|
637
637
|
console.log(`Public search review included: ${result.publicSearch.included ? 'yes' : 'no'}`);
|
|
638
638
|
console.log(`Crossref adapter included: ${result.crossref.included ? 'yes' : 'no'}`);
|
|
@@ -719,7 +719,7 @@ export async function runPullCommand(args, options = {}) {
|
|
|
719
719
|
console.log(`Artifact lane: ${artifactDestination}`);
|
|
720
720
|
console.log(`Literature lane: ${literatureDestination}`);
|
|
721
721
|
console.log(`Local canonical dossier included: ${localProblem ? 'yes' : 'no'}`);
|
|
722
|
-
console.log(`
|
|
722
|
+
console.log(`Imported record included: ${upstreamRecord ? 'yes' : 'no'}`);
|
|
723
723
|
console.log(`Live site snapshot included: ${literatureResult.siteStatus.included ? 'yes' : 'no'}`);
|
|
724
724
|
console.log(`Public search review included: ${literatureResult.publicSearch.included ? 'yes' : 'no'}`);
|
|
725
725
|
console.log(`Crossref adapter included: ${literatureResult.crossref.included ? 'yes' : 'no'}`);
|
package/src/commands/scaffold.js
CHANGED
|
@@ -55,6 +55,6 @@ export function runScaffoldCommand(args) {
|
|
|
55
55
|
const result = scaffoldProblem(problem, destination);
|
|
56
56
|
console.log(`Scaffold created: ${result.destination}`);
|
|
57
57
|
console.log(`Artifacts copied: ${result.copiedArtifacts.length}`);
|
|
58
|
-
console.log(`
|
|
58
|
+
console.log(`Imported record included: ${result.inventory.upstreamRecordIncluded ? 'yes' : 'no'}`);
|
|
59
59
|
return 0;
|
|
60
60
|
}
|
package/src/commands/seed.js
CHANGED
|
@@ -271,7 +271,7 @@ export async function runSeedCommand(args) {
|
|
|
271
271
|
console.log(`Title: ${result.record.title}`);
|
|
272
272
|
console.log(`Cluster: ${result.record.cluster}`);
|
|
273
273
|
console.log(`Harness depth: ${result.record.harness.depth}`);
|
|
274
|
-
console.log(`
|
|
274
|
+
console.log(`Imported record used: ${result.usedUpstreamRecord ? 'yes' : 'no'}`);
|
|
275
275
|
console.log(`Site snapshot used: ${result.usedSiteSnapshot ? 'yes' : 'no'}`);
|
|
276
276
|
console.log(`Public status review used: ${result.usedPublicStatusReview ? 'yes' : 'no'}`);
|
|
277
277
|
console.log(`ORP protocol: ${orp.protocolPath}`);
|
package/src/commands/upstream.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getProblem } from '../atlas/catalog.js';
|
|
2
|
+
import { getBundledUpstreamDir, getWorkspaceUpstreamDir } from '../runtime/paths.js';
|
|
2
3
|
import { fetchProblemSiteSnapshot } from '../upstream/site.js';
|
|
3
4
|
import { buildUpstreamDiff, loadActiveUpstreamSnapshot, syncUpstream, writeDiffArtifacts } from '../upstream/sync.js';
|
|
4
5
|
|
|
@@ -23,7 +24,7 @@ function parseDriftArgs(args) {
|
|
|
23
24
|
parsed.problemId = token;
|
|
24
25
|
continue;
|
|
25
26
|
}
|
|
26
|
-
return { error: `Unknown
|
|
27
|
+
return { error: `Unknown import drift option: ${token}` };
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
return parsed;
|
|
@@ -34,31 +35,42 @@ export async function runUpstreamCommand(args) {
|
|
|
34
35
|
|
|
35
36
|
if (!subcommand || subcommand === 'help' || subcommand === '--help') {
|
|
36
37
|
console.log('Usage:');
|
|
37
|
-
console.log(' erdos
|
|
38
|
-
console.log(' erdos
|
|
39
|
-
console.log(' erdos
|
|
40
|
-
console.log(' erdos
|
|
38
|
+
console.log(' erdos import show');
|
|
39
|
+
console.log(' erdos import sync [--write-package-snapshot]');
|
|
40
|
+
console.log(' erdos import diff [--write-package-report]');
|
|
41
|
+
console.log(' erdos import drift [<id>] [--include-site] [--json]');
|
|
41
42
|
return 0;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
if (subcommand === 'show') {
|
|
45
46
|
const snapshot = loadActiveUpstreamSnapshot();
|
|
46
47
|
if (!snapshot) {
|
|
47
|
-
console.log('No
|
|
48
|
+
console.log('No import snapshot available yet. Run `erdos import sync`.');
|
|
48
49
|
return 0;
|
|
49
50
|
}
|
|
51
|
+
const manifest = snapshot.manifest;
|
|
52
|
+
const externalRepo = manifest.external_repo ?? manifest.upstream_repo;
|
|
53
|
+
const importedCommit = manifest.imported_commit ?? manifest.upstream_commit;
|
|
50
54
|
console.log(`Snapshot kind: ${snapshot.kind}`);
|
|
51
|
-
console.log(`
|
|
52
|
-
console.log(`
|
|
53
|
-
console.log(`
|
|
54
|
-
console.log(`
|
|
55
|
+
console.log(`Active source: ${snapshot.kind === 'workspace' ? 'workspace import override' : 'bundled import snapshot'}`);
|
|
56
|
+
console.log(`External import repo: ${externalRepo}`);
|
|
57
|
+
console.log(`Imported commit: ${importedCommit ?? '(unknown)'}`);
|
|
58
|
+
console.log(`Fetched at: ${manifest.fetched_at}`);
|
|
59
|
+
console.log(`Entries: ${manifest.entry_count}`);
|
|
60
|
+
console.log(`Active manifest: ${snapshot.manifestPath}`);
|
|
61
|
+
console.log(`Active index: ${snapshot.indexPath}`);
|
|
62
|
+
console.log(`Active yaml: ${snapshot.yamlPath}`);
|
|
63
|
+
console.log(`Bundled snapshot dir: ${getBundledUpstreamDir()}`);
|
|
64
|
+
console.log(`Workspace snapshot dir: ${getWorkspaceUpstreamDir()}`);
|
|
65
|
+
console.log('Refresh workspace import snapshot: erdos import sync');
|
|
66
|
+
console.log('Refresh bundled import snapshot (maintainers): erdos import sync --write-package-snapshot');
|
|
55
67
|
return 0;
|
|
56
68
|
}
|
|
57
69
|
|
|
58
70
|
if (subcommand === 'sync') {
|
|
59
71
|
const writePackageSnapshot = rest.includes('--write-package-snapshot');
|
|
60
72
|
const result = await syncUpstream({ writePackageSnapshot });
|
|
61
|
-
console.log(`Fetched
|
|
73
|
+
console.log(`Fetched import commit: ${result.snapshot.manifest.imported_commit ?? '(unknown)'}`);
|
|
62
74
|
console.log(`Workspace snapshot: ${result.workspacePaths.manifestPath}`);
|
|
63
75
|
if (result.bundledPaths) {
|
|
64
76
|
console.log(`Bundled snapshot: ${result.bundledPaths.manifestPath}`);
|
|
@@ -76,8 +88,8 @@ export async function runUpstreamCommand(args) {
|
|
|
76
88
|
const diffArtifacts = writeDiffArtifacts({ writePackageReport });
|
|
77
89
|
const diff = buildUpstreamDiff();
|
|
78
90
|
console.log(`Local seeded problems: ${diff.localProblemCount}`);
|
|
79
|
-
console.log(`
|
|
80
|
-
console.log(`
|
|
91
|
+
console.log(`External atlas total problems: ${diff.upstreamProblemCount}`);
|
|
92
|
+
console.log(`External-only count: ${diff.upstreamOnlyCount}`);
|
|
81
93
|
console.log(`Workspace diff report: ${diffArtifacts.workspaceDiffPath}`);
|
|
82
94
|
if (diffArtifacts.repoDiffPath) {
|
|
83
95
|
console.log(`Repo diff report: ${diffArtifacts.repoDiffPath}`);
|
|
@@ -113,9 +125,9 @@ export async function runUpstreamCommand(args) {
|
|
|
113
125
|
return 0;
|
|
114
126
|
}
|
|
115
127
|
|
|
116
|
-
console.log('
|
|
128
|
+
console.log('External atlas drift dashboard');
|
|
117
129
|
console.log(`Local seeded problems: ${payload.localProblemCount}`);
|
|
118
|
-
console.log(`
|
|
130
|
+
console.log(`External atlas total problems: ${payload.upstreamProblemCount}`);
|
|
119
131
|
console.log(`Site-status drifts: ${payload.statusDriftCount}`);
|
|
120
132
|
console.log(`Formalization drifts: ${payload.formalizationDriftCount}`);
|
|
121
133
|
console.log(`Tag drifts: ${payload.tagDriftCount}`);
|
|
@@ -149,7 +161,7 @@ export async function runUpstreamCommand(args) {
|
|
|
149
161
|
title: problem.title,
|
|
150
162
|
}
|
|
151
163
|
: null,
|
|
152
|
-
|
|
164
|
+
external: upstreamRecord
|
|
153
165
|
? {
|
|
154
166
|
siteStatus: upstreamRecord.status?.state ?? null,
|
|
155
167
|
formalizedState: upstreamRecord.formalized?.state ?? null,
|
|
@@ -171,19 +183,19 @@ export async function runUpstreamCommand(args) {
|
|
|
171
183
|
return 0;
|
|
172
184
|
}
|
|
173
185
|
|
|
174
|
-
console.log(`
|
|
186
|
+
console.log(`External atlas drift for problem ${parsed.problemId}`);
|
|
175
187
|
console.log(`Local site status: ${payload.local?.siteStatus ?? '(none)'}`);
|
|
176
|
-
console.log(`
|
|
188
|
+
console.log(`External atlas site status: ${payload.external?.siteStatus ?? '(none)'}`);
|
|
177
189
|
console.log(`Site snapshot status: ${payload.site?.siteStatus ?? '(not fetched)'}`);
|
|
178
190
|
console.log(`Local repo status: ${payload.local?.repoStatus ?? '(none)'}`);
|
|
179
|
-
console.log(`
|
|
180
|
-
console.log(`
|
|
191
|
+
console.log(`Imported formalized state: ${payload.external?.formalizedState ?? '(none)'}`);
|
|
192
|
+
console.log(`External tags: ${payload.external?.tags?.join(', ') || '(none)'}`);
|
|
181
193
|
if (siteError) {
|
|
182
194
|
console.log(`Site fetch note: ${siteError}`);
|
|
183
195
|
}
|
|
184
196
|
return 0;
|
|
185
197
|
}
|
|
186
198
|
|
|
187
|
-
console.error(`Unknown
|
|
199
|
+
console.error(`Unknown import subcommand: ${subcommand}`);
|
|
188
200
|
return 1;
|
|
189
201
|
}
|
|
@@ -221,7 +221,7 @@ function buildProblemRecord(problemId, bundle, options) {
|
|
|
221
221
|
url: `https://www.erdosproblems.com/${problemId}`,
|
|
222
222
|
external_id: String(problemId),
|
|
223
223
|
},
|
|
224
|
-
|
|
224
|
+
external_source: {
|
|
225
225
|
repo: 'https://github.com/teorth/erdosproblems',
|
|
226
226
|
data_file: 'data/problems.yaml',
|
|
227
227
|
number: String(problemId),
|
|
@@ -230,7 +230,7 @@ function buildProblemRecord(problemId, bundle, options) {
|
|
|
230
230
|
seeded_at: new Date().toISOString(),
|
|
231
231
|
seeded_from: {
|
|
232
232
|
kind: 'pull_bundle',
|
|
233
|
-
|
|
233
|
+
imported_record_included: Boolean(bundle.upstreamRecord),
|
|
234
234
|
site_snapshot_included: Boolean(bundle.siteExtract || bundle.siteSummary),
|
|
235
235
|
public_search_review_included: Boolean(bundle.publicStatusReview || bundle.publicStatusReviewMarkdown),
|
|
236
236
|
},
|
|
@@ -239,8 +239,8 @@ function buildProblemRecord(problemId, bundle, options) {
|
|
|
239
239
|
site_status: siteStatus,
|
|
240
240
|
site_badge: uppercaseBadge(siteStatus),
|
|
241
241
|
repo_status: options.repoStatus,
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
imported_status: upstreamRecord.status?.state ?? null,
|
|
243
|
+
imported_last_update: upstreamRecord.status?.last_update ?? null,
|
|
244
244
|
},
|
|
245
245
|
cluster: options.cluster ?? inferClusterFromTags(upstreamRecord.tags),
|
|
246
246
|
prize: {
|
|
@@ -260,8 +260,8 @@ function buildProblemRecord(problemId, bundle, options) {
|
|
|
260
260
|
formalization_path: 'FORMALIZATION.md',
|
|
261
261
|
formalization: {
|
|
262
262
|
status: options.formalizationStatus,
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
imported_state: upstreamRecord.formalized?.state ?? 'unknown',
|
|
264
|
+
imported_last_update: upstreamRecord.formalized?.last_update ?? null,
|
|
265
265
|
},
|
|
266
266
|
};
|
|
267
267
|
|
|
@@ -337,7 +337,7 @@ function renderReferencesMarkdown(record, bundle) {
|
|
|
337
337
|
'',
|
|
338
338
|
'- Public problem page:',
|
|
339
339
|
` - <${record.source.url}>`,
|
|
340
|
-
'-
|
|
340
|
+
'- External imported atlas data:',
|
|
341
341
|
' - <https://github.com/teorth/erdosproblems>',
|
|
342
342
|
' - `data/problems.yaml`',
|
|
343
343
|
bundle.siteSummary ? '- Site summary snapshot was present in the pull bundle at seed time.' : '- No site summary snapshot was bundled at seed time.',
|
|
@@ -351,7 +351,7 @@ function renderEvidenceMarkdown(problemId, record, bundle) {
|
|
|
351
351
|
'# Evidence',
|
|
352
352
|
'',
|
|
353
353
|
`- This dossier was seeded for Erdos Problem #${problemId} from a pull bundle.`,
|
|
354
|
-
`-
|
|
354
|
+
`- Imported record included: ${bundle.upstreamRecord ? 'yes' : 'no'}`,
|
|
355
355
|
`- Site snapshot included: ${bundle.siteExtract || bundle.siteSummary ? 'yes' : 'no'}`,
|
|
356
356
|
`- Public status review included: ${bundle.publicStatusReview || bundle.publicStatusReviewMarkdown ? 'yes' : 'no'}`,
|
|
357
357
|
`- Repo status at seed time: ${record.status.repo_status}`,
|
|
@@ -368,8 +368,8 @@ function renderFormalizationMarkdown(record) {
|
|
|
368
368
|
'# Formalization',
|
|
369
369
|
'',
|
|
370
370
|
`- Local status: ${record.formalization.status}`,
|
|
371
|
-
`-
|
|
372
|
-
`-
|
|
371
|
+
`- Imported formalized state: ${record.formalization.imported_state}`,
|
|
372
|
+
`- Imported formalized last update: ${record.formalization.imported_last_update ?? '(unknown)'}`,
|
|
373
373
|
'',
|
|
374
374
|
'Seed note:',
|
|
375
375
|
'- this file was created automatically from a pull bundle and should be upgraded as local formal work begins.',
|
|
@@ -406,7 +406,7 @@ function renderAgentStartMarkdown(problemId, record) {
|
|
|
406
406
|
'- `AGENT_WEBSEARCH_BRIEF.md`',
|
|
407
407
|
'',
|
|
408
408
|
'First honest move:',
|
|
409
|
-
`- tighten the local dossier for problem ${problemId} against its pull bundle, references, and
|
|
409
|
+
`- tighten the local dossier for problem ${problemId} against its pull bundle, references, and import provenance before widening claims.`,
|
|
410
410
|
'- read `PUBLIC_STATUS_REVIEW.md` and run the suggested queries in `AGENT_WEBSEARCH_BRIEF.md` before trusting a single public status surface.',
|
|
411
411
|
'- write down the smallest route hypothesis that would make the next session cleaner, even if it remains provisional.',
|
|
412
412
|
'',
|
|
@@ -532,7 +532,7 @@ function renderReviewChecklist(problemId, bundle, destinationDir) {
|
|
|
532
532
|
'',
|
|
533
533
|
'## Provenance',
|
|
534
534
|
'',
|
|
535
|
-
`-
|
|
535
|
+
`- Imported record included: ${bundle.upstreamRecord ? 'yes' : 'no'}`,
|
|
536
536
|
`- Site snapshot included: ${bundle.siteExtract || bundle.siteSummary ? 'yes' : 'no'}`,
|
|
537
537
|
`- Public search review included: ${bundle.publicStatusReview || bundle.publicStatusReviewMarkdown ? 'yes' : 'no'}`,
|
|
538
538
|
'',
|