erdos-problems 0.1.12 → 0.2.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 +93 -4
- package/docs/RESEARCH_LOOP.md +16 -2
- package/package.json +1 -1
- package/packs/number-theory/README.md +13 -0
- package/packs/number-theory/problems/1/CONTEXT.md +8 -0
- package/packs/number-theory/problems/1/context.yaml +25 -0
- package/packs/number-theory/problems/2/CONTEXT.md +8 -0
- package/packs/number-theory/problems/2/context.yaml +25 -0
- package/packs/sunflower/README.md +17 -4
- package/packs/sunflower/problems/20/CHECKPOINT_TEMPLATE.md +29 -0
- package/packs/sunflower/problems/20/FRONTIER_NOTE.md +13 -0
- package/packs/sunflower/problems/20/OPS_DETAILS.yaml +44 -0
- package/packs/sunflower/problems/20/REPORT_TEMPLATE.md +23 -0
- package/packs/sunflower/problems/20/ROUTE_HISTORY.md +18 -0
- package/packs/sunflower/problems/536/OPS_DETAILS.yaml +39 -0
- package/packs/sunflower/problems/856/OPS_DETAILS.yaml +39 -0
- package/packs/sunflower/problems/857/CHECKPOINT_TEMPLATE.md +32 -0
- package/packs/sunflower/problems/857/FRONTIER_NOTE.md +18 -0
- package/packs/sunflower/problems/857/OPS_DETAILS.yaml +65 -0
- package/packs/sunflower/problems/857/REPORT_TEMPLATE.md +26 -0
- package/packs/sunflower/problems/857/ROUTE_HISTORY.md +25 -0
- package/src/cli/index.js +16 -2
- package/src/commands/archive.js +46 -0
- package/src/commands/maintainer.js +20 -2
- package/src/commands/problem.js +3 -0
- package/src/commands/pull.js +127 -4
- package/src/commands/sunflower.js +432 -13
- package/src/commands/upstream.js +129 -0
- package/src/commands/workspace.js +4 -0
- package/src/runtime/archive.js +87 -0
- package/src/runtime/checkpoints.js +27 -0
- package/src/runtime/maintainer-seed.js +70 -0
- package/src/runtime/paths.js +16 -0
- package/src/runtime/state.js +32 -3
- package/src/runtime/sunflower.js +329 -2
- package/src/runtime/workspace.js +4 -0
- package/src/upstream/literature.js +83 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
packet_id: weak857_ops_details_v1
|
|
2
|
+
summary: Public drill-down packet for the live weak-sunflower frontier.
|
|
3
|
+
routes:
|
|
4
|
+
- route_id: anchored_selector_linearization
|
|
5
|
+
title: Anchored-Selector Linearization
|
|
6
|
+
status: active
|
|
7
|
+
theorem_module: sunflower-coda/repo/sunflower_lean/SunflowerLean/ObstructionExport.lean
|
|
8
|
+
summary: Export the live anchored-selector helper stack into a route-facing leaf that remains honest about the open-problem boundary.
|
|
9
|
+
why_now: This is the only live public route with a dependency-satisfied ready atom.
|
|
10
|
+
next_move: Promote the helper/theorem stack into `anchored_selector_linearization_realized`.
|
|
11
|
+
ticket_ids: [T10]
|
|
12
|
+
source_paths:
|
|
13
|
+
- packs/sunflower/problems/857/ATOMIC_BOARD.yaml
|
|
14
|
+
- packs/sunflower/problems/857/FRONTIER_NOTE.md
|
|
15
|
+
- route_id: o1a_existential_explicit_export
|
|
16
|
+
title: O1a Existential Explicit Export
|
|
17
|
+
status: strict_closed
|
|
18
|
+
theorem_module: sunflower-coda/repo/sunflower_lean/SunflowerLean/ObstructionGlobalBridge.lean
|
|
19
|
+
summary: Closed public route exporting the O1a obstruction into an explicit remainder package.
|
|
20
|
+
why_now: This is the last fully closed route layer immediately beneath the active anchored-selector frontier.
|
|
21
|
+
next_move: Use it as support context only; do not spend new frontier energy here.
|
|
22
|
+
ticket_ids: [T9]
|
|
23
|
+
tickets:
|
|
24
|
+
- ticket_id: T10
|
|
25
|
+
title: "Route Redesign T10: Anchored-Selector Linearization"
|
|
26
|
+
route_id: anchored_selector_linearization
|
|
27
|
+
route_leaf: anchored_selector_linearization_realized
|
|
28
|
+
status: active
|
|
29
|
+
summary: Turn the packaged helper stack into a stable public route leaf.
|
|
30
|
+
gate_story: The early gates are satisfied; the live public pressure is concentrated inside the G3 seam.
|
|
31
|
+
current_blocker: The helper/theorem stack must be promoted into the named route-facing leaf without blurring historical context into closure.
|
|
32
|
+
next_move: Close `T10.G3.A2`.
|
|
33
|
+
atom_ids: [T10.G3.A2]
|
|
34
|
+
source_paths:
|
|
35
|
+
- packs/sunflower/problems/857/ATOMIC_BOARD.yaml
|
|
36
|
+
- ticket_id: T9
|
|
37
|
+
title: "Route Redesign T9: O1a Existential Explicit Export"
|
|
38
|
+
route_id: o1a_existential_explicit_export
|
|
39
|
+
route_leaf: exists_anchor_with_explicit_M_remainder_export_of_ObstructionO1a
|
|
40
|
+
status: closed
|
|
41
|
+
summary: Closed public ticket exporting the obstruction route into an explicit anchored remainder theorem.
|
|
42
|
+
gate_story: This ticket is historical support, not the live frontier.
|
|
43
|
+
current_blocker: none
|
|
44
|
+
next_move: Keep it as support context for the active route.
|
|
45
|
+
atom_ids: []
|
|
46
|
+
atoms:
|
|
47
|
+
- atom_id: T10.G3.A2
|
|
48
|
+
title: Promote the helper/theorem stack into anchored_selector_linearization_realized
|
|
49
|
+
ticket_id: T10
|
|
50
|
+
route_id: anchored_selector_linearization
|
|
51
|
+
gate_id: T10.G3
|
|
52
|
+
tier: P2-QuantAssembly
|
|
53
|
+
kind: work
|
|
54
|
+
status: ready
|
|
55
|
+
summary: This is the exact public atom where the active route becomes a real named leaf.
|
|
56
|
+
why_now: The board already marks it ready, so this is the smallest honest public move.
|
|
57
|
+
next_move: Prove or package the helper stack cleanly and checkpoint the route if the leaf closes.
|
|
58
|
+
verification_hook:
|
|
59
|
+
- erdos sunflower frontier 857
|
|
60
|
+
- erdos sunflower tickets 857
|
|
61
|
+
dependencies:
|
|
62
|
+
- anchored_selector_linearization helper stack remains verified
|
|
63
|
+
- route/ticket packet wording stays synchronized
|
|
64
|
+
source_paths:
|
|
65
|
+
- packs/sunflower/problems/857/ATOMIC_BOARD.yaml
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Problem 857 Report Template
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
- Route worked:
|
|
6
|
+
- Ticket worked:
|
|
7
|
+
- Atom worked:
|
|
8
|
+
- Claim level achieved:
|
|
9
|
+
|
|
10
|
+
## Artifacts
|
|
11
|
+
|
|
12
|
+
- Lean/module artifacts:
|
|
13
|
+
- Board artifacts:
|
|
14
|
+
- Compute/run artifacts:
|
|
15
|
+
- Checkpoint updates:
|
|
16
|
+
|
|
17
|
+
## Frontier shift
|
|
18
|
+
|
|
19
|
+
- Old frontier:
|
|
20
|
+
- New frontier:
|
|
21
|
+
- Did the route breakthrough state change?
|
|
22
|
+
|
|
23
|
+
## Honesty check
|
|
24
|
+
|
|
25
|
+
- What remains open?
|
|
26
|
+
- What should not be overclaimed?
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Problem 857 Route History
|
|
2
|
+
|
|
3
|
+
## Closed public route layers
|
|
4
|
+
|
|
5
|
+
- `global_family_card_export`
|
|
6
|
+
- `explicit_remainder_export`
|
|
7
|
+
- `explicit_M_remainder_export`
|
|
8
|
+
- `o1a_existential_explicit_export`
|
|
9
|
+
|
|
10
|
+
## Historical context routes
|
|
11
|
+
|
|
12
|
+
- `o1a_foundation`
|
|
13
|
+
- `o1a_certificate_reduction`
|
|
14
|
+
- `o1a_residual_router`
|
|
15
|
+
- `o1a_hard_upgrade`
|
|
16
|
+
- `b2_recurrence_spine`
|
|
17
|
+
- `post_counting_redesign`
|
|
18
|
+
|
|
19
|
+
## Current frontier route
|
|
20
|
+
|
|
21
|
+
- `anchored_selector_linearization`
|
|
22
|
+
|
|
23
|
+
Why it matters:
|
|
24
|
+
- this is the first route that still exposes live public pressure in the pack
|
|
25
|
+
- it links the local theorem stack to a problem-facing public frontier without pretending the open problem is solved
|
package/src/cli/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { runArchiveCommand } from '../commands/archive.js';
|
|
1
2
|
import { runBootstrapCommand } from '../commands/bootstrap.js';
|
|
2
3
|
import { runCheckpointsCommand } from '../commands/checkpoints.js';
|
|
3
4
|
import { runClusterCommand } from '../commands/cluster.js';
|
|
@@ -26,6 +27,8 @@ function printUsage() {
|
|
|
26
27
|
console.log(' erdos problem artifacts [<id>] [--json]');
|
|
27
28
|
console.log(' erdos cluster list');
|
|
28
29
|
console.log(' erdos cluster show <name>');
|
|
30
|
+
console.log(' erdos archive show <id>');
|
|
31
|
+
console.log(' erdos archive scaffold <id>');
|
|
29
32
|
console.log(' erdos workspace show');
|
|
30
33
|
console.log(' erdos orp show [--json]');
|
|
31
34
|
console.log(' erdos orp sync [--json]');
|
|
@@ -39,17 +42,26 @@ function printUsage() {
|
|
|
39
42
|
console.log(' erdos sunflower board [<id>] [--json]');
|
|
40
43
|
console.log(' erdos sunflower ready [<id>] [--json]');
|
|
41
44
|
console.log(' erdos sunflower ladder [<id>] [--json]');
|
|
45
|
+
console.log(' erdos sunflower routes [<id>] [--json]');
|
|
46
|
+
console.log(' erdos sunflower tickets [<id>] [--json]');
|
|
47
|
+
console.log(' erdos sunflower frontier [<id>] [--json]');
|
|
48
|
+
console.log(' erdos sunflower route <problem-id> <route-id> [--json]');
|
|
49
|
+
console.log(' erdos sunflower ticket <problem-id> <ticket-id> [--json]');
|
|
50
|
+
console.log(' erdos sunflower atom <problem-id> <atom-id> [--json]');
|
|
51
|
+
console.log(' erdos sunflower compute run [<id>] [--json]');
|
|
42
52
|
console.log(' erdos dossier show <id>');
|
|
43
53
|
console.log(' erdos upstream show');
|
|
44
54
|
console.log(' erdos upstream sync [--write-package-snapshot]');
|
|
45
55
|
console.log(' erdos upstream diff [--write-package-report]');
|
|
56
|
+
console.log(' erdos upstream drift [<id>] [--include-site] [--json]');
|
|
46
57
|
console.log(' erdos scaffold problem <id> [--dest <path>]');
|
|
47
58
|
console.log(' erdos bootstrap problem <id> [--dest <path>] [--sync-upstream]');
|
|
48
59
|
console.log(' erdos seed problem <id> [--include-site|--no-site] [--include-public-search|--no-public-search] [--refresh-upstream] [--cluster <name>] [--repo-status <status>] [--harness-depth <depth>] [--title <title>] [--family-tag <tag>] [--related <id>] [--formalization-status <status>] [--active-route <route>] [--route-breakthrough] [--problem-solved] [--allow-non-open] [--dest-root <path>] [--no-activate] [--no-loop-sync] [--force] [--json]');
|
|
49
|
-
console.log(' erdos pull problem <id> [--dest <path>] [--include-site] [--include-public-search] [--refresh-upstream]');
|
|
60
|
+
console.log(' erdos pull problem <id> [--dest <path>] [--include-site] [--include-public-search] [--include-crossref] [--include-openalex] [--refresh-upstream]');
|
|
50
61
|
console.log(' erdos pull artifacts <id> [--dest <path>] [--refresh-upstream]');
|
|
51
|
-
console.log(' erdos pull literature <id> [--dest <path>] [--include-site] [--include-public-search] [--refresh-upstream]');
|
|
62
|
+
console.log(' erdos pull literature <id> [--dest <path>] [--include-site] [--include-public-search] [--include-crossref] [--include-openalex] [--refresh-upstream]');
|
|
52
63
|
console.log(' erdos maintainer seed problem <id> [--from-pull <path>] [--dest-root <path>] [--cluster <name>] [--allow-non-open]');
|
|
64
|
+
console.log(' erdos maintainer review problem <id> [--from-pull <path>] [--dest-root <path>] [--title <title>]');
|
|
53
65
|
}
|
|
54
66
|
|
|
55
67
|
const args = process.argv.slice(2);
|
|
@@ -63,6 +75,8 @@ if (!command || command === 'help' || command === '--help') {
|
|
|
63
75
|
exitCode = runProblemCommand(rest);
|
|
64
76
|
} else if (command === 'cluster') {
|
|
65
77
|
exitCode = runClusterCommand(rest);
|
|
78
|
+
} else if (command === 'archive') {
|
|
79
|
+
exitCode = runArchiveCommand(rest);
|
|
66
80
|
} else if (command === 'workspace') {
|
|
67
81
|
exitCode = runWorkspaceCommand(rest);
|
|
68
82
|
} else if (command === 'orp') {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { getArchiveView, scaffoldArchive } from '../runtime/archive.js';
|
|
2
|
+
|
|
3
|
+
export function runArchiveCommand(args) {
|
|
4
|
+
const [subcommand, problemId] = args;
|
|
5
|
+
|
|
6
|
+
if (!subcommand || subcommand === 'help' || subcommand === '--help') {
|
|
7
|
+
console.log('Usage:');
|
|
8
|
+
console.log(' erdos archive show <id>');
|
|
9
|
+
console.log(' erdos archive scaffold <id>');
|
|
10
|
+
return 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (!problemId) {
|
|
14
|
+
console.error('Missing problem id.');
|
|
15
|
+
return 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (subcommand === 'show') {
|
|
19
|
+
const archive = getArchiveView(problemId);
|
|
20
|
+
if (!archive) {
|
|
21
|
+
console.error(`Unknown problem: ${problemId}`);
|
|
22
|
+
return 1;
|
|
23
|
+
}
|
|
24
|
+
console.log(`${archive.displayName} archive view`);
|
|
25
|
+
console.log(`Title: ${archive.title}`);
|
|
26
|
+
console.log(`Solved: ${archive.solved ? 'yes' : 'no'}`);
|
|
27
|
+
console.log(`Archive mode: ${archive.archiveMode}`);
|
|
28
|
+
console.log(`Next move: ${archive.nextMove}`);
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (subcommand === 'scaffold') {
|
|
33
|
+
try {
|
|
34
|
+
const result = scaffoldArchive(problemId);
|
|
35
|
+
console.log(`Archive scaffold created: ${result.archiveDir}`);
|
|
36
|
+
console.log(`Archive mode: ${result.payload.archiveMode}`);
|
|
37
|
+
return 0;
|
|
38
|
+
} catch (error) {
|
|
39
|
+
console.error(String(error.message ?? error));
|
|
40
|
+
return 1;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
console.error(`Unknown archive subcommand: ${subcommand}`);
|
|
45
|
+
return 1;
|
|
46
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { seedProblemFromPullBundle } from '../runtime/maintainer-seed.js';
|
|
2
|
+
import { reviewPullBundleForSeeding, seedProblemFromPullBundle } from '../runtime/maintainer-seed.js';
|
|
3
3
|
|
|
4
4
|
function parseMaintainerSeedArgs(args) {
|
|
5
5
|
const [kind, problemToken, ...rest] = args;
|
|
@@ -137,10 +137,11 @@ export function runMaintainerCommand(args) {
|
|
|
137
137
|
if (!subcommand || subcommand === 'help' || subcommand === '--help') {
|
|
138
138
|
console.log('Usage:');
|
|
139
139
|
console.log(' erdos maintainer seed problem <id> [--from-pull <path>] [--dest-root <path>] [--cluster <name>] [--repo-status <status>] [--harness-depth <depth>] [--title <title>] [--family-tag <tag>] [--related <id>] [--formalization-status <status>] [--active-route <route>] [--route-breakthrough] [--problem-solved] [--allow-non-open] [--force]');
|
|
140
|
+
console.log(' erdos maintainer review problem <id> [--from-pull <path>] [--dest-root <path>] [--title <title>]');
|
|
140
141
|
return 0;
|
|
141
142
|
}
|
|
142
143
|
|
|
143
|
-
if (
|
|
144
|
+
if (!['seed', 'review'].includes(subcommand)) {
|
|
144
145
|
console.error(`Unknown maintainer subcommand: ${subcommand}`);
|
|
145
146
|
return 1;
|
|
146
147
|
}
|
|
@@ -156,6 +157,23 @@ export function runMaintainerCommand(args) {
|
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
try {
|
|
160
|
+
if (subcommand === 'review') {
|
|
161
|
+
const result = reviewPullBundleForSeeding(parsed.problemId, {
|
|
162
|
+
fromPullDir: parsed.fromPullDir ? path.resolve(parsed.fromPullDir) : null,
|
|
163
|
+
destRoot: parsed.destRoot ? path.resolve(parsed.destRoot) : null,
|
|
164
|
+
title: parsed.title,
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
console.log(`Prepared maintainer review for problem ${parsed.problemId}`);
|
|
168
|
+
console.log(`Review checklist: ${result.reviewPath}`);
|
|
169
|
+
console.log(`Proposed destination: ${result.destinationDir}`);
|
|
170
|
+
console.log(`Title: ${result.title}`);
|
|
171
|
+
console.log(`Upstream record used: ${result.usedUpstreamRecord ? 'yes' : 'no'}`);
|
|
172
|
+
console.log(`Site snapshot used: ${result.usedSiteSnapshot ? 'yes' : 'no'}`);
|
|
173
|
+
console.log(`Public status review used: ${result.usedPublicStatusReview ? 'yes' : 'no'}`);
|
|
174
|
+
return 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
159
177
|
const result = seedProblemFromPullBundle(parsed.problemId, {
|
|
160
178
|
fromPullDir: parsed.fromPullDir ? path.resolve(parsed.fromPullDir) : null,
|
|
161
179
|
destRoot: parsed.destRoot ? path.resolve(parsed.destRoot) : null,
|
package/src/commands/problem.js
CHANGED
|
@@ -94,6 +94,9 @@ function printProblem(problem) {
|
|
|
94
94
|
console.log(`Repo status: ${problem.repoStatus}`);
|
|
95
95
|
console.log(`Cluster: ${problem.cluster}`);
|
|
96
96
|
console.log(`Harness depth: ${problem.harnessDepth}`);
|
|
97
|
+
if (String(problem.siteStatus).toLowerCase() === 'solved') {
|
|
98
|
+
console.log('Archive mode: method_exemplar');
|
|
99
|
+
}
|
|
97
100
|
console.log(`Prize: ${problem.prize ?? '(none)'}`);
|
|
98
101
|
console.log(`Formalization: ${problem.formalizationStatus}`);
|
|
99
102
|
console.log(`Upstream formalized: ${problem.upstreamFormalizedState ?? '(unknown)'}`);
|
package/src/commands/pull.js
CHANGED
|
@@ -10,6 +10,7 @@ import { getProblemArtifactInventory, scaffoldProblem } from '../runtime/problem
|
|
|
10
10
|
import { loadActiveUpstreamSnapshot, syncUpstream } from '../upstream/sync.js';
|
|
11
11
|
import { fetchProblemSiteSnapshot } from '../upstream/site.js';
|
|
12
12
|
import { buildProblemSearchQueries, fetchProblemPublicSearchReview } from '../upstream/public-search.js';
|
|
13
|
+
import { fetchCrossrefLiterature, fetchOpenAlexLiterature } from '../upstream/literature.js';
|
|
13
14
|
|
|
14
15
|
function normalizeClusterLabel(rawTag) {
|
|
15
16
|
return String(rawTag ?? '')
|
|
@@ -44,12 +45,14 @@ function inferClusterFromUpstream(upstreamRecord) {
|
|
|
44
45
|
function parsePullArgs(args) {
|
|
45
46
|
const [kind, value, ...rest] = args;
|
|
46
47
|
if (!['problem', 'artifacts', 'literature'].includes(kind)) {
|
|
47
|
-
return { error: 'Usage: erdos pull problem|artifacts|literature <id> [--dest <path>] [--include-site] [--refresh-upstream]' };
|
|
48
|
+
return { error: 'Usage: erdos pull problem|artifacts|literature <id> [--dest <path>] [--include-site] [--include-public-search] [--include-crossref] [--include-openalex] [--refresh-upstream]' };
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
let destination = null;
|
|
51
52
|
let includeSite = false;
|
|
52
53
|
let includePublicSearch = false;
|
|
54
|
+
let includeCrossref = false;
|
|
55
|
+
let includeOpenAlex = false;
|
|
53
56
|
let refreshUpstream = false;
|
|
54
57
|
|
|
55
58
|
for (let index = 0; index < rest.length; index += 1) {
|
|
@@ -70,6 +73,14 @@ function parsePullArgs(args) {
|
|
|
70
73
|
includePublicSearch = true;
|
|
71
74
|
continue;
|
|
72
75
|
}
|
|
76
|
+
if (token === '--include-crossref') {
|
|
77
|
+
includeCrossref = true;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (token === '--include-openalex') {
|
|
81
|
+
includeOpenAlex = true;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
73
84
|
if (token === '--refresh-upstream') {
|
|
74
85
|
refreshUpstream = true;
|
|
75
86
|
continue;
|
|
@@ -83,6 +94,8 @@ function parsePullArgs(args) {
|
|
|
83
94
|
destination,
|
|
84
95
|
includeSite,
|
|
85
96
|
includePublicSearch,
|
|
97
|
+
includeCrossref,
|
|
98
|
+
includeOpenAlex,
|
|
86
99
|
refreshUpstream,
|
|
87
100
|
};
|
|
88
101
|
}
|
|
@@ -318,7 +331,66 @@ async function maybeWritePublicSearchBundle(problemId, title, destination, inclu
|
|
|
318
331
|
}
|
|
319
332
|
}
|
|
320
333
|
|
|
321
|
-
async function
|
|
334
|
+
async function maybeWriteLiteratureAdapter(problemId, title, destination, includeAdapter, label, fetcher) {
|
|
335
|
+
if (!includeAdapter) {
|
|
336
|
+
return {
|
|
337
|
+
attempted: false,
|
|
338
|
+
included: false,
|
|
339
|
+
error: null,
|
|
340
|
+
resultCount: 0,
|
|
341
|
+
filePrefix: label.toUpperCase(),
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const filePrefix = label.toUpperCase();
|
|
346
|
+
|
|
347
|
+
try {
|
|
348
|
+
const payload = await fetcher(problemId, title);
|
|
349
|
+
writeJson(path.join(destination, `${filePrefix}_RESULTS.json`), payload);
|
|
350
|
+
writeText(
|
|
351
|
+
path.join(destination, `${filePrefix}_RESULTS.md`),
|
|
352
|
+
[
|
|
353
|
+
`# ${label} Results`,
|
|
354
|
+
'',
|
|
355
|
+
`Fetched at: ${payload.fetchedAt}`,
|
|
356
|
+
`Query: ${payload.query}`,
|
|
357
|
+
'',
|
|
358
|
+
...(payload.results.length > 0
|
|
359
|
+
? payload.results.map((result) => `- [${result.title || '(untitled)'}](${result.url || '#'})`)
|
|
360
|
+
: ['- *(no results captured)*']),
|
|
361
|
+
'',
|
|
362
|
+
].join('\n'),
|
|
363
|
+
);
|
|
364
|
+
return {
|
|
365
|
+
attempted: true,
|
|
366
|
+
included: true,
|
|
367
|
+
error: null,
|
|
368
|
+
resultCount: payload.results.length,
|
|
369
|
+
filePrefix,
|
|
370
|
+
};
|
|
371
|
+
} catch (error) {
|
|
372
|
+
const message = String(error?.message ?? error);
|
|
373
|
+
writeText(path.join(destination, `${filePrefix}_ERROR.txt`), message);
|
|
374
|
+
return {
|
|
375
|
+
attempted: true,
|
|
376
|
+
included: false,
|
|
377
|
+
error: message,
|
|
378
|
+
resultCount: 0,
|
|
379
|
+
filePrefix,
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
async function writeLiteratureLane(
|
|
385
|
+
problemId,
|
|
386
|
+
destination,
|
|
387
|
+
localProblem,
|
|
388
|
+
upstreamRecord,
|
|
389
|
+
includeSite,
|
|
390
|
+
includePublicSearch,
|
|
391
|
+
includeCrossref,
|
|
392
|
+
includeOpenAlex,
|
|
393
|
+
) {
|
|
322
394
|
ensureDir(destination);
|
|
323
395
|
|
|
324
396
|
const includedFiles = [];
|
|
@@ -355,6 +427,23 @@ async function writeLiteratureLane(problemId, destination, localProblem, upstrea
|
|
|
355
427
|
destination,
|
|
356
428
|
includePublicSearch,
|
|
357
429
|
);
|
|
430
|
+
const literatureTitle = localProblem?.title ?? upstreamRecord?.title ?? `Erdos Problem #${problemId}`;
|
|
431
|
+
const crossref = await maybeWriteLiteratureAdapter(
|
|
432
|
+
problemId,
|
|
433
|
+
literatureTitle,
|
|
434
|
+
destination,
|
|
435
|
+
includeCrossref,
|
|
436
|
+
'Crossref',
|
|
437
|
+
fetchCrossrefLiterature,
|
|
438
|
+
);
|
|
439
|
+
const openalex = await maybeWriteLiteratureAdapter(
|
|
440
|
+
problemId,
|
|
441
|
+
literatureTitle,
|
|
442
|
+
destination,
|
|
443
|
+
includeOpenAlex,
|
|
444
|
+
'OpenAlex',
|
|
445
|
+
fetchOpenAlexLiterature,
|
|
446
|
+
);
|
|
358
447
|
const problemRecord = buildProblemRecord(problemId, localProblem, upstreamRecord);
|
|
359
448
|
writeJson(path.join(destination, 'PROBLEM.json'), problemRecord);
|
|
360
449
|
writeJson(path.join(destination, 'LITERATURE_INDEX.json'), {
|
|
@@ -368,6 +457,10 @@ async function writeLiteratureLane(problemId, destination, localProblem, upstrea
|
|
|
368
457
|
includedPublicSearch: publicSearch.included,
|
|
369
458
|
publicSearchError: publicSearch.error,
|
|
370
459
|
publicSearchQueries: publicSearch.queries,
|
|
460
|
+
includedCrossref: crossref.included,
|
|
461
|
+
crossrefError: crossref.error,
|
|
462
|
+
includedOpenAlex: openalex.included,
|
|
463
|
+
openAlexError: openalex.error,
|
|
371
464
|
});
|
|
372
465
|
writeText(
|
|
373
466
|
path.join(destination, 'README.md'),
|
|
@@ -380,6 +473,8 @@ async function writeLiteratureLane(problemId, destination, localProblem, upstrea
|
|
|
380
473
|
`- Upstream record included: ${upstreamRecord ? 'yes' : 'no'}`,
|
|
381
474
|
`- Live site snapshot included: ${siteStatus.included ? 'yes' : 'no'}`,
|
|
382
475
|
`- Public search review included: ${publicSearch.included ? 'yes' : 'no'}`,
|
|
476
|
+
`- Crossref adapter included: ${crossref.included ? 'yes' : 'no'}`,
|
|
477
|
+
`- OpenAlex adapter included: ${openalex.included ? 'yes' : 'no'}`,
|
|
383
478
|
'',
|
|
384
479
|
].join('\n'),
|
|
385
480
|
);
|
|
@@ -389,6 +484,8 @@ async function writeLiteratureLane(problemId, destination, localProblem, upstrea
|
|
|
389
484
|
includedFiles,
|
|
390
485
|
siteStatus,
|
|
391
486
|
publicSearch,
|
|
487
|
+
crossref,
|
|
488
|
+
openalex,
|
|
392
489
|
};
|
|
393
490
|
}
|
|
394
491
|
|
|
@@ -433,9 +530,9 @@ export async function runPullCommand(args, options = {}) {
|
|
|
433
530
|
if (args.length === 0 || args[0] === 'help' || args[0] === '--help') {
|
|
434
531
|
if (!silent) {
|
|
435
532
|
console.log('Usage:');
|
|
436
|
-
console.log(' erdos pull problem <id> [--dest <path>] [--include-site] [--include-public-search] [--refresh-upstream]');
|
|
533
|
+
console.log(' erdos pull problem <id> [--dest <path>] [--include-site] [--include-public-search] [--include-crossref] [--include-openalex] [--refresh-upstream]');
|
|
437
534
|
console.log(' erdos pull artifacts <id> [--dest <path>] [--refresh-upstream]');
|
|
438
|
-
console.log(' erdos pull literature <id> [--dest <path>] [--include-site] [--include-public-search] [--refresh-upstream]');
|
|
535
|
+
console.log(' erdos pull literature <id> [--dest <path>] [--include-site] [--include-public-search] [--include-crossref] [--include-openalex] [--refresh-upstream]');
|
|
439
536
|
}
|
|
440
537
|
return 0;
|
|
441
538
|
}
|
|
@@ -494,6 +591,8 @@ export async function runPullCommand(args, options = {}) {
|
|
|
494
591
|
upstreamRecord,
|
|
495
592
|
parsed.includeSite,
|
|
496
593
|
parsed.includePublicSearch,
|
|
594
|
+
parsed.includeCrossref,
|
|
595
|
+
parsed.includeOpenAlex,
|
|
497
596
|
);
|
|
498
597
|
if (!silent) {
|
|
499
598
|
console.log(`Literature bundle created: ${destination}`);
|
|
@@ -501,12 +600,20 @@ export async function runPullCommand(args, options = {}) {
|
|
|
501
600
|
console.log(`Upstream record included: ${upstreamRecord ? 'yes' : 'no'}`);
|
|
502
601
|
console.log(`Live site snapshot included: ${result.siteStatus.included ? 'yes' : 'no'}`);
|
|
503
602
|
console.log(`Public search review included: ${result.publicSearch.included ? 'yes' : 'no'}`);
|
|
603
|
+
console.log(`Crossref adapter included: ${result.crossref.included ? 'yes' : 'no'}`);
|
|
604
|
+
console.log(`OpenAlex adapter included: ${result.openalex.included ? 'yes' : 'no'}`);
|
|
504
605
|
if (result.siteStatus.error) {
|
|
505
606
|
console.log(`Live site snapshot note: ${result.siteStatus.error}`);
|
|
506
607
|
}
|
|
507
608
|
if (result.publicSearch.error) {
|
|
508
609
|
console.log(`Public search note: ${result.publicSearch.error}`);
|
|
509
610
|
}
|
|
611
|
+
if (result.crossref.error) {
|
|
612
|
+
console.log(`Crossref note: ${result.crossref.error}`);
|
|
613
|
+
}
|
|
614
|
+
if (result.openalex.error) {
|
|
615
|
+
console.log(`OpenAlex note: ${result.openalex.error}`);
|
|
616
|
+
}
|
|
510
617
|
}
|
|
511
618
|
return 0;
|
|
512
619
|
}
|
|
@@ -526,6 +633,8 @@ export async function runPullCommand(args, options = {}) {
|
|
|
526
633
|
upstreamRecord,
|
|
527
634
|
parsed.includeSite,
|
|
528
635
|
parsed.includePublicSearch,
|
|
636
|
+
parsed.includeCrossref,
|
|
637
|
+
parsed.includeOpenAlex,
|
|
529
638
|
);
|
|
530
639
|
|
|
531
640
|
writeJson(path.join(rootDestination, 'PULL_STATUS.json'), {
|
|
@@ -545,6 +654,12 @@ export async function runPullCommand(args, options = {}) {
|
|
|
545
654
|
publicSearchAttempted: literatureResult.publicSearch.attempted,
|
|
546
655
|
publicSearchIncluded: literatureResult.publicSearch.included,
|
|
547
656
|
publicSearchError: literatureResult.publicSearch.error,
|
|
657
|
+
crossrefAttempted: literatureResult.crossref.attempted,
|
|
658
|
+
crossrefIncluded: literatureResult.crossref.included,
|
|
659
|
+
crossrefError: literatureResult.crossref.error,
|
|
660
|
+
openAlexAttempted: literatureResult.openalex.attempted,
|
|
661
|
+
openAlexIncluded: literatureResult.openalex.included,
|
|
662
|
+
openAlexError: literatureResult.openalex.error,
|
|
548
663
|
});
|
|
549
664
|
|
|
550
665
|
if (!silent) {
|
|
@@ -555,12 +670,20 @@ export async function runPullCommand(args, options = {}) {
|
|
|
555
670
|
console.log(`Upstream record included: ${upstreamRecord ? 'yes' : 'no'}`);
|
|
556
671
|
console.log(`Live site snapshot included: ${literatureResult.siteStatus.included ? 'yes' : 'no'}`);
|
|
557
672
|
console.log(`Public search review included: ${literatureResult.publicSearch.included ? 'yes' : 'no'}`);
|
|
673
|
+
console.log(`Crossref adapter included: ${literatureResult.crossref.included ? 'yes' : 'no'}`);
|
|
674
|
+
console.log(`OpenAlex adapter included: ${literatureResult.openalex.included ? 'yes' : 'no'}`);
|
|
558
675
|
if (literatureResult.siteStatus.error) {
|
|
559
676
|
console.log(`Live site snapshot note: ${literatureResult.siteStatus.error}`);
|
|
560
677
|
}
|
|
561
678
|
if (literatureResult.publicSearch.error) {
|
|
562
679
|
console.log(`Public search note: ${literatureResult.publicSearch.error}`);
|
|
563
680
|
}
|
|
681
|
+
if (literatureResult.crossref.error) {
|
|
682
|
+
console.log(`Crossref note: ${literatureResult.crossref.error}`);
|
|
683
|
+
}
|
|
684
|
+
if (literatureResult.openalex.error) {
|
|
685
|
+
console.log(`OpenAlex note: ${literatureResult.openalex.error}`);
|
|
686
|
+
}
|
|
564
687
|
}
|
|
565
688
|
return 0;
|
|
566
689
|
}
|