visualproof 0.2.0 → 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 +40 -26
- package/dist/assets/webfonts/LICENSE-Noto.txt +95 -0
- package/dist/assets/webfonts/metrics.json +1 -0
- package/dist/assets/webfonts/ttf/jost-400-normal.ttf +0 -0
- package/dist/assets/webfonts/ttf/jost-500-normal.ttf +0 -0
- package/dist/assets/webfonts/ttf/noto-sans-math.ttf +0 -0
- package/dist/assets/webfonts/ttf/noto-sans.ttf +0 -0
- package/dist/assets/webfonts/ttf/source-sans-3-400-italic.ttf +0 -0
- package/dist/assets/webfonts/ttf/source-sans-3-400-normal.ttf +0 -0
- package/dist/assets/webfonts/ttf/source-sans-3-500-normal.ttf +0 -0
- package/dist/assets/webfonts/ttf/source-sans-3-600-normal.ttf +0 -0
- package/dist/assets/webfonts/ttf/source-sans-3-700-normal.ttf +0 -0
- package/dist/assets/webfonts/ttf/source-serif-4-400-italic.ttf +0 -0
- package/dist/assets/webfonts/ttf/source-serif-4-600-italic.ttf +0 -0
- package/dist/server/agent.js +84 -86
- package/dist/server/agentdocs.js +1 -1
- package/dist/server/artcmd.js +335 -0
- package/dist/server/live.js +6 -0
- package/dist/server/main.js +136 -8
- package/dist/server/mcptools.js +4 -1
- package/dist/server/pipeline.js +15 -9
- package/dist/server/readonlygate.js +1 -1
- package/dist/server/review.js +4 -1
- package/dist/server/reviewapi.js +35 -1
- package/dist/server/snapshot.js +10 -1
- package/dist/server/view.js +0 -7
- package/dist/server/views.js +24 -0
- package/dist/shared/artfonts.js +81 -0
- package/dist/shared/artrecipe.js +316 -0
- package/dist/shared/collab.js +7 -2
- package/dist/shared/declfind.js +95 -0
- package/dist/shared/lostfound.js +1 -0
- package/dist/shared/pastgraph.js +6 -6
- package/dist/shared/review.js +62 -5
- package/dist/web/bundle/app.js +713 -164
- package/dist/web/bundle/edges.js +1 -1
- package/dist/web/src/agentmark.js +14 -0
- package/dist/web/src/artwork.js +1000 -0
- package/dist/web/src/bundles.js +151 -0
- package/dist/web/src/canvas.js +3694 -0
- package/dist/web/src/drag.js +61 -0
- package/dist/web/src/edgequeue.js +204 -0
- package/dist/web/src/gl/gl.js +123 -0
- package/dist/web/src/gl/renderer.js +451 -0
- package/dist/web/src/halo.js +95 -0
- package/dist/web/src/highlight.js +108 -0
- package/dist/web/src/overview.js +393 -0
- package/dist/web/src/reviewqueue.js +250 -0
- package/dist/web/src/selection.js +272 -0
- package/dist/web/src/status.js +80 -0
- package/dist/web/src/visitors.js +318 -0
- package/dist/web/src/visits.js +174 -0
- package/dist/web/style.css +7 -0
- package/docs/agent-api/README.md +1 -1
- package/docs/agent-api/export.md +41 -2
- package/docs/agent-api/history.md +2 -1
- package/docs/agent-api/mcp.md +1 -1
- package/docs/agent-api/reading.md +2 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -1,13 +1,45 @@
|
|
|
1
1
|
# VisualProof
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://github.com/math-inc/Sphere-Packing-Lean"><img src="docs/images/artwork-sphere-packing.webp" width="19%" alt="Sphere Packing"></a>
|
|
5
|
+
<a href="https://github.com/leanprover-community/flt-regular"><img src="docs/images/artwork-flt-regular.webp" width="19%" alt="FLT Regular"></a>
|
|
6
|
+
<a href="https://github.com/AlexKontorovich/PrimeNumberTheoremAnd"><img src="docs/images/artwork-prime-numbers.webp" width="19%" alt="Prime Numbers"></a>
|
|
7
|
+
<a href="https://github.com/openai/NavierStokesAndEuler"><img src="docs/images/artwork-navier-stokes.webp" width="19%" alt="Navier–Stokes"></a>
|
|
8
|
+
<a href="https://github.com/cedar-policy/cedar-spec"><img src="docs/images/artwork-cedar.webp" width="19%" alt="Cedar"></a>
|
|
9
|
+
</p>
|
|
10
|
+
<p align="center"><sub>Five Lean codebases, drawn by <code>visualproof artwork</code>.</sub></p>
|
|
11
|
+
|
|
12
|
+
[](https://visualproof-demo.yingte.io)
|
|
13
|
+
|
|
14
|
+
<p align="center"><b>Live demo: <a href="https://visualproof-demo.yingte.io">https://visualproof-demo.yingte.io</a></b><br><sub>flt-regular in the middle of a review by three people and an AI assistant, read-only</sub></p>
|
|
15
|
+
|
|
16
|
+
## Try it
|
|
17
|
+
|
|
18
|
+
Set up in your Lean codebase with agent prompt:
|
|
19
|
+
```text
|
|
20
|
+
Set up VisualProof (https://github.com/LucianoXu/VisualProof) for my Lean project, and give me the address to open.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Set up manually:
|
|
24
|
+
```bash
|
|
25
|
+
npm install --global visualproof
|
|
26
|
+
cd my-lean-project && lake build
|
|
27
|
+
visualproof serve .
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
It needs Node, elan and Poppler ([Requirements](#requirements)).
|
|
31
|
+
|
|
32
|
+
## See what a Lean theorem actually rests on
|
|
4
33
|
|
|
5
34
|
Lean checks that a proof is correct. It cannot check that the theorem says what you mean: that the
|
|
6
35
|
definitions in its statement mean what their names suggest. VisualProof shows exactly which
|
|
7
36
|
definitions those are, so that people, and AI agents, can read them, review them together, and
|
|
8
37
|
keep a record of the review.
|
|
9
38
|
|
|
10
|
-
|
|
39
|
+
On [flt-regular](https://github.com/leanprover-community/flt-regular), Fermat's Last Theorem for
|
|
40
|
+
regular primes. Of the project's
|
|
41
|
+
273 declarations, two light up besides the theorem, `IsRegularPrime` and `IsRegularNumber`: with
|
|
42
|
+
the Mathlib definitions they use, they are what you need to read to believe what it says.
|
|
11
43
|
|
|
12
44
|
## What it does
|
|
13
45
|
|
|
@@ -24,6 +56,8 @@ keep a record of the review.
|
|
|
24
56
|
- **History**: every build is kept, and a past board can be browsed.
|
|
25
57
|
- **A printed document** of what a view holds: definitions in full, proofs left out, typeset with
|
|
26
58
|
XeLaTeX.
|
|
59
|
+
- **A picture of the board**, PNG or SVG up to poster size: from the page, from an agent's link, or
|
|
60
|
+
without a browser (`visualproof artwork <project> --recipe recipe.json`).
|
|
27
61
|
|
|
28
62
|
## Requirements
|
|
29
63
|
|
|
@@ -36,28 +70,6 @@ keep a record of the review.
|
|
|
36
70
|
The project must have been built with `lake build`: VisualProof only reads what the build left,
|
|
37
71
|
and never builds it.
|
|
38
72
|
|
|
39
|
-
## Try it
|
|
40
|
-
|
|
41
|
-
VisualProof is not on npm yet: install its `visualproof` command from a checkout, which packs it
|
|
42
|
-
as npm would. Here it is on [flt-regular](https://github.com/leanprover-community/flt-regular),
|
|
43
|
-
Fermat's Last Theorem for regular primes, built on Mathlib:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
git clone https://github.com/LucianoXu/VisualProof
|
|
47
|
-
(cd VisualProof && npm install && npm pack && npm install --global ./visualproof-*.tgz)
|
|
48
|
-
|
|
49
|
-
git clone https://github.com/leanprover-community/flt-regular
|
|
50
|
-
(cd flt-regular && git checkout bd81b78ba6 && lake exe cache get && lake build)
|
|
51
|
-
|
|
52
|
-
visualproof doctor flt-regular # what is missing, if anything, and what to do
|
|
53
|
-
visualproof serve flt-regular
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Open http://127.0.0.1:4173/. Choose the *Rests on* tool (`2`), find `flt_regular` with the search
|
|
57
|
-
(`/`), and click it on the board. Of the project's 297 declarations, two light up besides the
|
|
58
|
-
theorem: `IsRegularPrime` and `IsRegularNumber`. With the Mathlib definitions they use, they are
|
|
59
|
-
what you need to read to believe what the theorem says.
|
|
60
|
-
|
|
61
73
|
## Where it keeps things
|
|
62
74
|
|
|
63
75
|
It writes nothing into the project, and nothing into its own checkout. It keeps everything in two
|
|
@@ -96,5 +108,7 @@ speaks plain HTTP: beyond a trusted network, put a TLS proxy in front. [SECURITY
|
|
|
96
108
|
## License and citation
|
|
97
109
|
|
|
98
110
|
VisualProof is licensed under Apache-2.0 ([LICENSE](LICENSE)). The fonts in `src/assets/fonts/`
|
|
99
|
-
are JuliaMono
|
|
100
|
-
|
|
111
|
+
are JuliaMono; those in `src/assets/webfonts/`, which artworks are drawn in, are Source Sans 3,
|
|
112
|
+
Source Serif 4, Jost, Noto Sans and Noto Sans Math. All are under the SIL Open Font License, whose
|
|
113
|
+
text is beside them. If you use VisualProof in your work, please cite it
|
|
114
|
+
([CITATION.cff](CITATION.cff)).
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Noto Sans: Copyright 2015 Google LLC. All Rights Reserved.
|
|
2
|
+
Noto Sans Math: Copyright 2018 Google LLC. All Rights Reserved.
|
|
3
|
+
(The files ttf/noto-sans.ttf and ttf/noto-sans-math.ttf hold a subset of each.)
|
|
4
|
+
|
|
5
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
6
|
+
This license is copied below, and is also available with a FAQ at:
|
|
7
|
+
http://scripts.sil.org/OFL
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
12
|
+
-----------------------------------------------------------
|
|
13
|
+
|
|
14
|
+
PREAMBLE
|
|
15
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
16
|
+
development of collaborative font projects, to support the font creation
|
|
17
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
18
|
+
open framework in which fonts may be shared and improved in partnership
|
|
19
|
+
with others.
|
|
20
|
+
|
|
21
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
22
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
23
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
24
|
+
redistributed and/or sold with any software provided that any reserved
|
|
25
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
26
|
+
however, cannot be released under any other type of license. The
|
|
27
|
+
requirement for fonts to remain under this license does not apply
|
|
28
|
+
to any document created using the fonts or their derivatives.
|
|
29
|
+
|
|
30
|
+
DEFINITIONS
|
|
31
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
32
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
33
|
+
include source files, build scripts and documentation.
|
|
34
|
+
|
|
35
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
36
|
+
copyright statement(s).
|
|
37
|
+
|
|
38
|
+
"Original Version" refers to the collection of Font Software components as
|
|
39
|
+
distributed by the Copyright Holder(s).
|
|
40
|
+
|
|
41
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
42
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
43
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
44
|
+
new environment.
|
|
45
|
+
|
|
46
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
47
|
+
writer or other person who contributed to the Font Software.
|
|
48
|
+
|
|
49
|
+
PERMISSION & CONDITIONS
|
|
50
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
51
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
52
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
53
|
+
Software, subject to the following conditions:
|
|
54
|
+
|
|
55
|
+
1) Neither the Font Software nor any of its individual components,
|
|
56
|
+
in Original or Modified Versions, may be sold by itself.
|
|
57
|
+
|
|
58
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
59
|
+
redistributed and/or sold with any software, provided that each copy
|
|
60
|
+
contains the above copyright notice and this license. These can be
|
|
61
|
+
included either as stand-alone text files, human-readable headers or
|
|
62
|
+
in the appropriate machine-readable metadata fields within text or
|
|
63
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
64
|
+
|
|
65
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
66
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
67
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
68
|
+
presented to the users.
|
|
69
|
+
|
|
70
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
71
|
+
Software shall not be used to promote, endorse or advertise any
|
|
72
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
73
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
74
|
+
permission.
|
|
75
|
+
|
|
76
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
77
|
+
must be distributed entirely under this license, and must not be
|
|
78
|
+
distributed under any other license. The requirement for fonts to
|
|
79
|
+
remain under this license does not apply to any document created
|
|
80
|
+
using the Font Software.
|
|
81
|
+
|
|
82
|
+
TERMINATION
|
|
83
|
+
This license becomes null and void if any of the above conditions are
|
|
84
|
+
not met.
|
|
85
|
+
|
|
86
|
+
DISCLAIMER
|
|
87
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
88
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
89
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
90
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
91
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
92
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
93
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
94
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
95
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|