@paradigma-inc/flywheel 0.1.16 → 0.1.25
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 +8 -0
- package/package.json +1 -1
- package/skills/flywheel/SKILL.md +1 -0
- package/skills/flywheel/compute/managed-compute.md +111 -2
- package/skills/flywheel/references/experiment-design-protocol.md +1 -1
- package/skills/flywheel/references/flywheel-mcp-tool-map.md +130 -142
- package/skills/flywheel/setting-up-flywheel/updating-flywheel-mcp.md +8 -0
- package/skills/flywheel-auto/SKILL.md +14 -6
- package/skills/flywheel-auto/evals/evals.json +6 -0
- package/skills/flywheel-auto/references/ARTIFACTS.md +46 -216
- package/skills/flywheel-auto/references/INTERFACES.md +196 -195
- package/skills/flywheel-auto/references/experiment-design-protocol-autonomous.md +62 -0
- package/skills/flywheel-auto/references/experiment-design-protocol.md +1 -1
- package/skills/flywheel-auto/references/flywheel-mcp-tool-map.md +130 -142
- package/skills/flywheel-lookahead/SKILL.md +23 -15
- package/skills/flywheel-lookahead/agents/openai.yaml +3 -3
- package/skills/flywheel-lookahead/evals/evals.json +13 -1
- package/skills/flywheel-lookahead/references/ARTIFACTS.md +46 -216
- package/skills/flywheel-lookahead/references/INTERFACES.md +196 -195
- package/skills/flywheel-lookahead/references/flywheel-mcp-tool-map.md +130 -142
- package/skills/flywheel-prove/SKILL.md +163 -0
- package/skills/flywheel-prove/agents/interface.yaml +4 -0
- package/skills/flywheel-prove/assets/pipeline_template/bin/tproof +3 -0
- package/skills/flywheel-prove/assets/pipeline_template/bin/tproof.cmd +2 -0
- package/skills/flywheel-prove/assets/pipeline_template/logs/.gitkeep +1 -0
- package/skills/flywheel-prove/assets/pipeline_template/pyproject.toml +23 -0
- package/skills/flywheel-prove/assets/pipeline_template/scripts/smoke_test.cmd +2 -0
- package/skills/flywheel-prove/assets/pipeline_template/scripts/smoke_test.sh +3 -0
- package/skills/flywheel-prove/assets/pipeline_template/src/tproof/__init__.py +1 -0
- package/skills/flywheel-prove/assets/pipeline_template/src/tproof/cli.py +298 -0
- package/skills/flywheel-prove/assets/pipeline_template/src/tproof/constants.py +10 -0
- package/skills/flywheel-prove/assets/pipeline_template/src/tproof/layout.py +51 -0
- package/skills/flywheel-prove/assets/pipeline_template/src/tproof/leanops.py +116 -0
- package/skills/flywheel-prove/assets/pipeline_template/src/tproof/runstore.py +58 -0
- package/skills/flywheel-prove/assets/pipeline_template/src/tproof/tasking.py +94 -0
- package/skills/flywheel-prove/assets/pipeline_template/workspace/prompts/fill_sorries.txt +3 -0
- package/skills/flywheel-prove/references/workflow.md +193 -0
- package/skills/flywheel-prove/scripts/scaffold_pipeline.py +111 -0
- package/skills/flywheel-reproduce/SKILL.md +31 -23
- package/skills/flywheel-reproduce/evals/evals.json +7 -1
- package/skills/flywheel-reproduce/references/ARTIFACTS.md +46 -216
- package/skills/flywheel-reproduce/references/INTERFACES.md +196 -195
- package/skills/flywheel-reproduce/references/experiment-design-protocol.md +1 -1
- package/skills/flywheel-reproduce/references/flywheel-mcp-tool-map.md +130 -142
- package/skills/flywheel-reproduce/references/source-blog.md +35 -0
- package/skills/flywheel-reproduce/references/source-generic.md +30 -0
- package/skills/flywheel-reproduce/references/source-notes.md +35 -0
- package/skills/flywheel-reproduce/references/source-paper.md +89 -0
- package/skills/flywheel-reproduce/references/source-wiki.md +36 -0
- package/skills/flywheel-to-graph/SKILL.md +27 -21
- package/skills/flywheel-to-graph/evals/evals.json +7 -1
- package/skills/flywheel-to-graph/references/ARTIFACTS.md +46 -216
- package/skills/flywheel-to-graph/references/INTERFACES.md +196 -195
- package/skills/flywheel-to-graph/references/flywheel-mcp-tool-map.md +130 -142
- package/skills/flywheel-to-graph/references/source-blog.md +34 -0
- package/skills/flywheel-to-graph/references/source-generic.md +29 -0
- package/skills/flywheel-to-graph/references/source-notes.md +34 -0
- package/skills/flywheel-to-graph/references/source-paper.md +85 -0
- package/skills/flywheel-to-graph/references/source-wiki.md +35 -0
- package/src/cli.mjs +69 -3
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Workflow
|
|
2
|
+
|
|
3
|
+
## 0. Prerequisite: Local Toolchain Bootstrap
|
|
4
|
+
|
|
5
|
+
Ensure the host has:
|
|
6
|
+
- `uv`
|
|
7
|
+
- `elan` (Lean toolchain manager)
|
|
8
|
+
|
|
9
|
+
If `uv` is missing, install it by OS:
|
|
10
|
+
- macOS/Linux:
|
|
11
|
+
```bash
|
|
12
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
13
|
+
```
|
|
14
|
+
- Windows (PowerShell):
|
|
15
|
+
```powershell
|
|
16
|
+
irm https://astral.sh/uv/install.ps1 | iex
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
If `elan` is missing, install it by OS:
|
|
20
|
+
- macOS/Linux:
|
|
21
|
+
```bash
|
|
22
|
+
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y
|
|
23
|
+
```
|
|
24
|
+
- Windows (PowerShell):
|
|
25
|
+
```powershell
|
|
26
|
+
Invoke-WebRequest -Uri https://raw.githubusercontent.com/leanprover/elan/master/elan-init.ps1 -OutFile elan-init.ps1
|
|
27
|
+
powershell -ExecutionPolicy Bypass -File .\elan-init.ps1
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Verify bootstrap before running pipeline commands:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
uv --version
|
|
34
|
+
elan --version
|
|
35
|
+
lean --version
|
|
36
|
+
lake --version
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 1. Scaffold Pipeline Into Repo
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
python <skill-root>/scripts/scaffold_pipeline.py --repo-root <repo-root> --setup-env
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`<skill-root>` is the directory that contains this skill.
|
|
46
|
+
|
|
47
|
+
Creates `<repo-root>/theorem_pipeline` with:
|
|
48
|
+
- `workspace/lean_project/` canonical cumulative Lean project
|
|
49
|
+
- `data/runs/` run metadata and proof briefs
|
|
50
|
+
- `logs/` local Lean verification logs
|
|
51
|
+
- `src/tproof/` local CLI orchestration
|
|
52
|
+
|
|
53
|
+
## 2. Initialize Lean Toolchain
|
|
54
|
+
|
|
55
|
+
From `theorem_pipeline/`:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uv run -m tproof.cli doctor
|
|
59
|
+
uv run -m tproof.cli init --build
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Warning: `init --build` can take several minutes the first time (toolchain/dependency download and initial compilation). Subsequent proving runs in the same workspace are usually much faster because those artifacts are cached.
|
|
63
|
+
Operator requirement: Before running `uv run -m tproof.cli init --build`, explicitly notify the human user in-chat about this first-run delay.
|
|
64
|
+
|
|
65
|
+
Pinned versions:
|
|
66
|
+
- Lean toolchain: `leanprover/lean4:v4.28.0`
|
|
67
|
+
- Mathlib hash: `8f9d9cff6bd728b17a24e163c9402775d9e6a365`
|
|
68
|
+
|
|
69
|
+
## 2.1 Source Context Normalization (Conditional)
|
|
70
|
+
|
|
71
|
+
Handle source ingestion based on user-provided input type.
|
|
72
|
+
|
|
73
|
+
If input is a PDF:
|
|
74
|
+
- Use `pypdf` (not `pdftotext`) and sanitize mojibake with UTF-8-safe output before theorem formalization.
|
|
75
|
+
- Required output A (full cached extraction):
|
|
76
|
+
- `theorem_pipeline/workspace/contexts/<pdf_stem>.txt`
|
|
77
|
+
- Example: `paper.pdf -> theorem_pipeline/workspace/contexts/paper.txt`
|
|
78
|
+
- Required output B (theorem-focused excerpt):
|
|
79
|
+
- `theorem_pipeline/workspace/contexts/<theorem_slug>_source_excerpt.txt`
|
|
80
|
+
- Example: `proposition2_source_excerpt.txt`
|
|
81
|
+
- Keep both outputs:
|
|
82
|
+
- full extraction = reusable cache across multiple theorem proofs from the same paper;
|
|
83
|
+
- excerpt = focused context for the current theorem.
|
|
84
|
+
- Reuse policy:
|
|
85
|
+
- if the full extraction file already exists and is still valid for the current PDF, reuse it instead of converting the PDF again.
|
|
86
|
+
|
|
87
|
+
If input is not a PDF (prompt text, local `.txt`/`.md`/`.tex`, or fetched online source):
|
|
88
|
+
- Skip PDF conversion.
|
|
89
|
+
- Use the source as requested by the user.
|
|
90
|
+
- Store a normalized local source artifact under `theorem_pipeline/workspace/contexts/` (for example, `<theorem_slug>_source.txt`).
|
|
91
|
+
- Optionally store a focused excerpt as `<theorem_slug>_source_excerpt.txt` when useful for theorem-specific context.
|
|
92
|
+
|
|
93
|
+
ASCII rewrites of common symbols are allowed when needed for robust editing/parsing.
|
|
94
|
+
|
|
95
|
+
## 3. Create a Proof Run
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
uv run -m tproof.cli start-run --prompt-file ./workspace/prompts/fill_sorries.txt
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
This writes:
|
|
102
|
+
- `data/runs/<run_id>/run.json`
|
|
103
|
+
- `data/runs/<run_id>/run_brief.md`
|
|
104
|
+
- snapshot of the Lean project for traceability
|
|
105
|
+
|
|
106
|
+
## 4. Required Agent Routing
|
|
107
|
+
|
|
108
|
+
Use two workers:
|
|
109
|
+
|
|
110
|
+
1. Proof worker (math-heavy):
|
|
111
|
+
- profile: deep-thinking reasoning model for complex mathematics
|
|
112
|
+
- responsibility: theorem proving, decomposition, and difficult Lean proof terms.
|
|
113
|
+
|
|
114
|
+
2. Ops worker (programming/reporting):
|
|
115
|
+
- profile: smaller coding-oriented model for implementation and reporting
|
|
116
|
+
- responsibility: scripts, logs, verification loops, metadata updates, concise run reports.
|
|
117
|
+
|
|
118
|
+
## 5. Iterate Until Clean Verification
|
|
119
|
+
|
|
120
|
+
After proof edits:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
uv run -m tproof.cli reindex
|
|
124
|
+
uv run -m tproof.cli verify
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`verify` fails on:
|
|
128
|
+
- `lake build` failures
|
|
129
|
+
- any unresolved `sorry`
|
|
130
|
+
- any `.lean`/`.md` final artifacts found under `workspace/staging/` (forbidden; move to `ProofWorkspace/Final/`)
|
|
131
|
+
|
|
132
|
+
When done, set run status:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
uv run -m tproof.cli set-status <run_id> COMPLETE --note "all goals proven and verified"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## 6. Final Artifact Placement and Sidecar Sketch Files (`.md`)
|
|
139
|
+
|
|
140
|
+
Final theorem artifacts must be written only under:
|
|
141
|
+
- `theorem_pipeline/workspace/lean_project/ProofWorkspace/Final/`
|
|
142
|
+
|
|
143
|
+
Forbidden output location:
|
|
144
|
+
- `workspace/staging/` for any final proof or sketch artifact.
|
|
145
|
+
|
|
146
|
+
For every finalized Lean proof file, create a sibling Markdown sketch file:
|
|
147
|
+
- Naming convention:
|
|
148
|
+
- full proof (Lean-safe filename): `ProofWorkspace/Final/<Name>Full.lean`
|
|
149
|
+
- sketch: `ProofWorkspace/Final/<Name>Sketch.md`
|
|
150
|
+
- example pair: `ProofWorkspace/Final/Proposition1Full.lean` and `ProofWorkspace/Final/Proposition1Sketch.md`
|
|
151
|
+
- Keep sidecars in the same module directory so paper authors can trace them easily.
|
|
152
|
+
- In sketch files, all mathematics must be written with LaTeX dollar syntax (`$...$` / `$$...$$`).
|
|
153
|
+
- The `Proof Sketch` section must be fluent mathematical prose (paper style), not a numbered recipe.
|
|
154
|
+
|
|
155
|
+
Recommended sidecar template:
|
|
156
|
+
|
|
157
|
+
```md
|
|
158
|
+
# <Theorem Name>
|
|
159
|
+
|
|
160
|
+
## Statement
|
|
161
|
+
Plain-language statement mapped to the Lean theorem name(s).
|
|
162
|
+
|
|
163
|
+
## Assumptions
|
|
164
|
+
- A1
|
|
165
|
+
- A2
|
|
166
|
+
- ...
|
|
167
|
+
|
|
168
|
+
## Proof Sketch
|
|
169
|
+
Write a concise, fluent paragraph (or short sequence of paragraphs) as a mathematician would explain the proof to another mathematician in a paper. Emphasize the key reductions and ideas, but avoid low-level proof script details.
|
|
170
|
+
|
|
171
|
+
Use inline/display LaTeX where needed, for example:
|
|
172
|
+
`By reducing the claim to $X$, applying $Y$, and combining with $Z$, we obtain the target bound $f(x) \le g(x)$ for all $x \in D$.`
|
|
173
|
+
|
|
174
|
+
## Corollaries (if required)
|
|
175
|
+
- help
|
|
176
|
+
- match
|
|
177
|
+
- upper-bound
|
|
178
|
+
|
|
179
|
+
## Lean Artifacts
|
|
180
|
+
- File: <path/to/ProofWorkspace/Final/NameFull.lean>
|
|
181
|
+
- Theorems:
|
|
182
|
+
- <theorem_name_1>
|
|
183
|
+
- <theorem_name_2>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Compatibility note:
|
|
187
|
+
- The pipeline indexes/checks only `*.lean` files (`reindex`, module discovery, and `sorry` scan), so `.md` sidecars do not affect Lean verification.
|
|
188
|
+
|
|
189
|
+
## 7. Final Report Status Line
|
|
190
|
+
|
|
191
|
+
Keep the existing report format, and append one additional final line:
|
|
192
|
+
- `SUCCESS`
|
|
193
|
+
- or `FAIL: <reason>`
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Scaffold a local Lean theorem proving pipeline into a target repository.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import argparse
|
|
9
|
+
import shutil
|
|
10
|
+
import subprocess
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def run(command: list[str], cwd: Path) -> None:
|
|
15
|
+
proc = subprocess.run(command, cwd=cwd, text=True, check=False)
|
|
16
|
+
if proc.returncode != 0:
|
|
17
|
+
raise RuntimeError(f"Command failed ({proc.returncode}): {' '.join(command)}")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def scaffold(repo_root: Path, subdir: str, force: bool) -> Path:
|
|
21
|
+
skill_root = Path(__file__).resolve().parents[1]
|
|
22
|
+
template_dir = skill_root / "assets" / "pipeline_template"
|
|
23
|
+
if not template_dir.is_dir():
|
|
24
|
+
raise FileNotFoundError(f"Missing template directory: {template_dir}")
|
|
25
|
+
|
|
26
|
+
target = (repo_root / subdir).resolve()
|
|
27
|
+
if target.exists():
|
|
28
|
+
if not force:
|
|
29
|
+
raise FileExistsError(
|
|
30
|
+
f"Target already exists: {target}. Pass --force to replace it."
|
|
31
|
+
)
|
|
32
|
+
if target == repo_root.resolve():
|
|
33
|
+
raise RuntimeError("Refusing to delete repo root.")
|
|
34
|
+
shutil.rmtree(target)
|
|
35
|
+
|
|
36
|
+
shutil.copytree(template_dir, target)
|
|
37
|
+
return target
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def ensure_uv_available() -> None:
|
|
41
|
+
proc = subprocess.run(
|
|
42
|
+
["uv", "--version"], capture_output=True, text=True, check=False
|
|
43
|
+
)
|
|
44
|
+
if proc.returncode != 0:
|
|
45
|
+
raise RuntimeError(
|
|
46
|
+
"Missing `uv` on PATH. Install uv first: https://docs.astral.sh/uv/getting-started/installation/"
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def setup_env_with_uv(pipeline_dir: Path) -> None:
|
|
51
|
+
ensure_uv_available()
|
|
52
|
+
run(["uv", "sync"], cwd=pipeline_dir)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def parse_args() -> argparse.Namespace:
|
|
56
|
+
parser = argparse.ArgumentParser(
|
|
57
|
+
description="Scaffold local Lean theorem proving pipeline."
|
|
58
|
+
)
|
|
59
|
+
parser.add_argument(
|
|
60
|
+
"--repo-root",
|
|
61
|
+
type=Path,
|
|
62
|
+
default=Path.cwd(),
|
|
63
|
+
help="Repository root where the pipeline folder will be created.",
|
|
64
|
+
)
|
|
65
|
+
parser.add_argument(
|
|
66
|
+
"--subdir",
|
|
67
|
+
type=str,
|
|
68
|
+
default="theorem_pipeline",
|
|
69
|
+
help="Subdirectory name for the pipeline workspace.",
|
|
70
|
+
)
|
|
71
|
+
parser.add_argument(
|
|
72
|
+
"--force",
|
|
73
|
+
action="store_true",
|
|
74
|
+
help="Replace target directory if it already exists.",
|
|
75
|
+
)
|
|
76
|
+
parser.add_argument(
|
|
77
|
+
"--setup-env",
|
|
78
|
+
action="store_true",
|
|
79
|
+
help="Run `uv sync` in the scaffolded pipeline directory.",
|
|
80
|
+
)
|
|
81
|
+
return parser.parse_args()
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def main() -> int:
|
|
85
|
+
args = parse_args()
|
|
86
|
+
repo_root = args.repo_root.resolve()
|
|
87
|
+
repo_root.mkdir(parents=True, exist_ok=True)
|
|
88
|
+
|
|
89
|
+
pipeline_dir = scaffold(repo_root=repo_root, subdir=args.subdir, force=args.force)
|
|
90
|
+
if args.setup_env:
|
|
91
|
+
setup_env_with_uv(pipeline_dir)
|
|
92
|
+
|
|
93
|
+
print(f"[OK] Scaffolded pipeline at: {pipeline_dir}")
|
|
94
|
+
print("Next commands:")
|
|
95
|
+
print(f" cd {pipeline_dir}")
|
|
96
|
+
if not args.setup_env:
|
|
97
|
+
print(" uv sync")
|
|
98
|
+
print(" uv run -m tproof.cli doctor")
|
|
99
|
+
print(" uv run -m tproof.cli init --build")
|
|
100
|
+
print(
|
|
101
|
+
" uv run -m tproof.cli start-run --prompt-file ./workspace/prompts/fill_sorries.txt"
|
|
102
|
+
)
|
|
103
|
+
print(" uv run -m tproof.cli verify")
|
|
104
|
+
print("Optional wrappers:")
|
|
105
|
+
print(" macOS/Linux: ./bin/tproof doctor")
|
|
106
|
+
print(" Windows cmd: .\\bin\\tproof.cmd doctor")
|
|
107
|
+
return 0
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
if __name__ == "__main__":
|
|
111
|
+
raise SystemExit(main())
|
|
@@ -57,8 +57,10 @@ Before execution, recover or establish these inputs:
|
|
|
57
57
|
- Later reproduce passes must read the control node `content` first and continue from that persisted contract rather than from chat memory.
|
|
58
58
|
3. Classify the source.
|
|
59
59
|
- If the input is already a normalized Flywheel graph export, `flywheel_import_subgraph` may be appropriate.
|
|
60
|
-
-
|
|
61
|
-
|
|
60
|
+
- Otherwise, route to one source reference in `references/` using the
|
|
61
|
+
`Source Type Routing` section below.
|
|
62
|
+
- Complete source decomposition from the selected reference before step 8
|
|
63
|
+
branch planning or execution.
|
|
62
64
|
4. Map each stable page, claim, or concept to a node.
|
|
63
65
|
- For exact node-mutation shapes, load [references/flywheel-mcp-tool-map.md](references/flywheel-mcp-tool-map.md).
|
|
64
66
|
- Create a new node with `flywheel_stage_node_create` when needed.
|
|
@@ -79,11 +81,13 @@ Before execution, recover or establish these inputs:
|
|
|
79
81
|
- Prioritize the cheapest branches that most reduce uncertainty first.
|
|
80
82
|
- Prefer explicit validation branches such as baseline checks, mechanism or intermediate-signal checks, ablations, efficiency checks, robustness checks, failure analysis, and follow-up analysis branches after results land.
|
|
81
83
|
- If the branch can run through Flywheel execution directly, use `flywheel_launch_execution` and inspect terminal status before commit.
|
|
82
|
-
|
|
84
|
+
|
|
85
|
+
- If the branch needs managed compute, use `flywheel_request_compute_grant_approval`, resolve the approved `compute_grant_id` with `flywheel_list_compute_grants(status=active, approval_session_id=<session_id>)`, call `flywheel_compute_list_options`, recommend one offer deterministically and present up to two alternatives, wait for explicit user confirmation (or explicit user override offer id), then `flywheel_compute_acquire`, poll `flywheel_compute_status`, and use `flywheel_compute_connection` when the lease is ready.
|
|
83
86
|
- Release managed compute when a branch is done. Default to releasing only
|
|
84
87
|
known leases. Use `flywheel_compute_release_all` only when the user
|
|
85
88
|
explicitly requests account-wide cleanup.
|
|
86
89
|
- Stop when the core claim is resolved or the budget ceiling is reached.
|
|
90
|
+
|
|
87
91
|
9. Commit after the node snapshot is coherent with `flywheel_commit_node`.
|
|
88
92
|
- Commit resolved insight nodes only when they have non-empty `insights`.
|
|
89
93
|
- Commit resolved empirical nodes only when outcome and artifact rules are satisfied.
|
|
@@ -131,35 +135,38 @@ Canonical contract shape:
|
|
|
131
135
|
|
|
132
136
|
The `Source or claim nodes under test` line is the recovery anchor for later validation passes. If multiple claim nodes are in scope, list the governing node ids or slugs explicitly.
|
|
133
137
|
|
|
134
|
-
##
|
|
138
|
+
## Source Type Routing
|
|
139
|
+
|
|
140
|
+
Route every non-normalized source through one reference file before
|
|
141
|
+
graphification and validation planning.
|
|
135
142
|
|
|
136
|
-
|
|
143
|
+
Routing order:
|
|
137
144
|
|
|
138
|
-
|
|
145
|
+
1. Deterministic routing.
|
|
146
|
+
2. Natural-language routing.
|
|
147
|
+
3. Generic fallback.
|
|
139
148
|
|
|
140
|
-
|
|
141
|
-
- The main page markdown -> the node body/readme field (`content`).
|
|
142
|
-
- A short synopsis of the page -> `summary`.
|
|
143
|
-
- Images, PDFs, datasets, notebooks, code snippets, and other supporting files -> node artifacts.
|
|
144
|
-
- Durable structural relationships -> graph edges.
|
|
145
|
-
- Ordinary wiki hyperlinks -> remain markdown links inside the node body.
|
|
149
|
+
Deterministic routing rules:
|
|
146
150
|
|
|
147
|
-
|
|
151
|
+
- Local `.pdf` files -> `references/source-paper.md`
|
|
152
|
+
- `arxiv.org/abs/*`, `arxiv.org/pdf/*`, DOI URLs, direct PDF URLs -> `references/source-paper.md`
|
|
153
|
+
- Markdown files, wiki exports, wiki-like repositories -> `references/source-wiki.md`
|
|
154
|
+
- Blog/article domains and long-form article URLs -> `references/source-blog.md`
|
|
155
|
+
- Local notes trees (Obsidian, Logseq, plain markdown note directories) -> `references/source-notes.md`
|
|
148
156
|
|
|
149
|
-
|
|
157
|
+
Natural-language routing rule:
|
|
150
158
|
|
|
151
|
-
|
|
159
|
+
- If deterministic routing is inconclusive, use user intent from prompt/context
|
|
160
|
+
(for example, "import this paper", "graph this wiki", "convert this blog
|
|
161
|
+
post", "port these research notes") and pick the matching source reference.
|
|
152
162
|
|
|
153
|
-
|
|
163
|
+
Generic fallback rule:
|
|
154
164
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
3. Write the page body into node `content`.
|
|
158
|
-
4. Publish supporting files as artifacts.
|
|
159
|
-
5. Add only the graph edges that materially help reasoning or navigation.
|
|
160
|
-
6. Split the claim-bearing work into explicit validation branches before execution.
|
|
165
|
+
- If deterministic and natural-language routing are both inconclusive, load
|
|
166
|
+
`references/source-generic.md`.
|
|
161
167
|
|
|
162
|
-
|
|
168
|
+
After choosing a source type, load that reference and complete source
|
|
169
|
+
decomposition before entering step 8 validation branch planning.
|
|
163
170
|
|
|
164
171
|
## `flywheel_import_subgraph`
|
|
165
172
|
|
|
@@ -210,5 +217,6 @@ Guidelines:
|
|
|
210
217
|
- Build the graph explicitly with nodes, artifacts, and selected edges.
|
|
211
218
|
- Keep the source material legible in `content`; do not dump everything into artifacts.
|
|
212
219
|
- Keep the flywheel-reproduce skill scoped by cost and decision value, not by exhaustively trying every possible branch.
|
|
220
|
+
- These claim-validation execution rules apply only when $flywheel-reproduce is the active skill.
|
|
213
221
|
|
|
214
222
|
See also: invoke `$flywheel-to-graph` to port source material into Flywheel without implicit execution, invoke `$flywheel-lookahead` to stage next-step frontier nodes from existing graph state without execution, and invoke `$flywheel-auto` to advance a frontier autonomously under an explicit budget and persisted stop condition.
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
{
|
|
3
3
|
"id": "claim-bearing-paper-with-no-budget-yet",
|
|
4
4
|
"prompt": "Use $flywheel-reproduce to validate the central empirical claims from this paper in Flywheel. I have not given you a max budget yet, but I do want the source structured and the validation plan prepared.",
|
|
5
|
-
"expected_output": "
|
|
5
|
+
"expected_output": "Create a parent paper node under the requested root, decompose the paper into section child nodes, keep section narratives in each child `content`, attach the PDF to the parent node, and stage explicit validation branch plans. Ask once for a hard max budget before any compute acquisition, and do not execute branches until the budget is explicit. Do NOT produce a single `insight` node with the PDF as the only artifact.",
|
|
6
|
+
"files": []
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"id": "paper-pdf-decomposes-into-section-children",
|
|
10
|
+
"prompt": "Use $flywheel-reproduce on the paper PDF in the current folder, attach results under an existing root, plan validation branches, and do not launch execution yet.",
|
|
11
|
+
"expected_output": "Create a parent paper node under the root, add one child node per top-level paper section, place section narratives in child `content`, and attach the PDF artifact on the parent. Plan at least one explicit validation branch and keep execution unlaunched until budget gating is satisfied. Do NOT emit a single `insight` node with only a summary and the PDF artifact.",
|
|
6
12
|
"files": []
|
|
7
13
|
},
|
|
8
14
|
{
|