visualproof 0.6.0 → 0.8.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.
Files changed (96) hide show
  1. package/README.md +2 -2
  2. package/dist/assets/tips/phone-fingers.light.mp4 +0 -0
  3. package/dist/assets/tips/phone-fingers.light.webp +0 -0
  4. package/dist/assets/tips/tour-agent.webp +0 -0
  5. package/dist/assets/tips/tour-arrange.webp +0 -0
  6. package/dist/assets/tips/tour-artwork.webp +0 -0
  7. package/dist/assets/tips/tour-checks.webp +0 -0
  8. package/dist/assets/tips/tour-export.webp +0 -0
  9. package/dist/assets/tips/tour-keys.webp +0 -0
  10. package/dist/assets/tips/tour-library.webp +0 -0
  11. package/dist/assets/tips/tour-project.webp +0 -0
  12. package/dist/assets/tips/tour-review.webp +0 -0
  13. package/dist/assets/tips/tour-share.webp +0 -0
  14. package/dist/assets/tips/tour-source.webp +0 -0
  15. package/dist/assets/tips/tour-target.webp +0 -0
  16. package/dist/assets/tips/tour-view.webp +0 -0
  17. package/dist/assets/tips/tour.json +90 -90
  18. package/dist/assets/tips/tour.webp +0 -0
  19. package/dist/extractor/Extract.lean +13 -3
  20. package/dist/server/agent.js +104 -2881
  21. package/dist/server/agentactivity.js +72 -0
  22. package/dist/server/agentadvice.js +128 -0
  23. package/dist/server/agentdocs.js +1 -1
  24. package/dist/server/agententry.js +180 -0
  25. package/dist/server/agentexport.js +469 -0
  26. package/dist/server/agentfollow.js +412 -0
  27. package/dist/server/agentgraph.js +128 -0
  28. package/dist/server/agentlean.js +144 -0
  29. package/dist/server/agentlibrary.js +1 -1
  30. package/dist/server/agentplaces.js +242 -0
  31. package/dist/server/agentread.js +569 -0
  32. package/dist/server/agenttalk.js +282 -0
  33. package/dist/server/agenttcb.js +378 -0
  34. package/dist/server/agentviews.js +3 -3
  35. package/dist/server/app.js +379 -0
  36. package/dist/server/appaccess.js +127 -0
  37. package/dist/server/appagent.js +110 -0
  38. package/dist/server/appgraph.js +176 -0
  39. package/dist/server/appshare.js +179 -0
  40. package/dist/server/appsite.js +120 -0
  41. package/dist/server/apptalk.js +195 -0
  42. package/dist/server/artcmd.js +1 -1
  43. package/dist/server/events.js +1 -1
  44. package/dist/server/history.js +51 -3
  45. package/dist/server/historyapi.js +34 -2
  46. package/dist/server/hover.js +11 -7
  47. package/dist/server/identity.js +1 -1
  48. package/dist/server/libraryroute.js +3 -3
  49. package/dist/server/live.js +162 -12
  50. package/dist/server/main.js +17 -1746
  51. package/dist/server/mcptools.js +1 -1
  52. package/dist/server/options.js +350 -0
  53. package/dist/server/outside.js +311 -0
  54. package/dist/server/pastdoc.js +22 -3
  55. package/dist/server/presence.js +25 -8
  56. package/dist/server/project.js +28 -4
  57. package/dist/server/readonlygate.js +4 -0
  58. package/dist/server/reviewapi.js +10 -3
  59. package/dist/server/send.js +259 -0
  60. package/dist/server/talk.js +13 -7
  61. package/dist/server/tokens.js +3 -3
  62. package/dist/server/view.js +3 -1
  63. package/dist/server/views.js +1 -1
  64. package/dist/shared/artrecipe.js +3 -3
  65. package/dist/shared/board.js +9 -8
  66. package/dist/shared/collab.js +54 -7
  67. package/dist/shared/comment.js +1 -1
  68. package/dist/shared/doc/build.js +30 -14
  69. package/dist/shared/doc/latex.js +7 -2
  70. package/dist/shared/doc/model.js +4 -2
  71. package/dist/shared/doc/sections.js +21 -4
  72. package/dist/shared/outside.js +16 -0
  73. package/dist/shared/pastgraph.js +11 -2
  74. package/dist/shared/pointer.js +152 -0
  75. package/dist/shared/query.js +36 -5
  76. package/dist/shared/review.js +34 -2
  77. package/dist/shared/scope.js +1 -1
  78. package/dist/shared/sharesnap.js +15 -0
  79. package/dist/shared/titles.js +4 -0
  80. package/dist/web/bundle/app.js +51061 -49518
  81. package/dist/web/index.html +4 -0
  82. package/dist/web/src/canvas.js +16 -14
  83. package/dist/web/src/highlight.js +8 -3
  84. package/dist/web/src/reviewqueue.js +52 -10
  85. package/dist/web/src/selection.js +1 -1
  86. package/dist/web/src/status.js +65 -1
  87. package/dist/web/src/theme.js +1 -1
  88. package/dist/web/src/visitors.js +1 -1
  89. package/dist/web/style.css +121 -7
  90. package/docs/agent-api/advice.md +4 -1
  91. package/docs/agent-api/export.md +8 -5
  92. package/docs/agent-api/following.md +9 -3
  93. package/docs/agent-api/history.md +3 -1
  94. package/docs/agent-api/reading.md +8 -2
  95. package/docs/agent-api/views.md +3 -1
  96. package/package.json +1 -1
package/README.md CHANGED
@@ -9,9 +9,9 @@
9
9
  </p>
10
10
  <p align="center"><sub>Five Lean codebases, drawn by <code>visualproof artwork</code>.</sub></p>
11
11
 
12
- https://github.com/user-attachments/assets/98e435d6-f493-437d-b342-1833819c0b77
12
+ https://github.com/user-attachments/assets/941b6599-5b4d-4364-aa81-fc25b8991eeb
13
13
 
14
- <p align="center"><sub>A review of Sphere-Packing-Lean in 74 seconds. The whole tour — four minutes in thirteen chapters, with captions — is in the page under <b>?</b> → Tips, and <a href="https://visualproof-demo.yingte.io/#tips">on the live demo</a>.</sub></p>
14
+ <p align="center"><sub>A review of Sphere-Packing-Lean in 71 seconds. The whole tour — three and a half minutes in thirteen chapters, with captions — is in the page under <b>?</b> → Tips, and <a href="https://visualproof-demo.yingte.io/#tips">on the live demo</a>.</sub></p>
15
15
 
16
16
  [![VisualProof on flt-regular, from the live demo: the TCB of flt_regular, its key declarations approved, an approval recorded at a meeting, the review plan pinned beside it](docs/images/board.webp)](https://visualproof-demo.yingte.io)
17
17
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "film": {
3
- "file": "tour-65d0dbe881c2.mp4",
4
- "sha256": "65d0dbe881c2e2d64932865976c177bf31e5685cf7fffe98089eae245eafa60a",
5
- "size": 48323737,
3
+ "file": "tour-5a226b0d2c08.mp4",
4
+ "sha256": "5a226b0d2c080edebf0cbd49ad326bbf13a0b0e1b69df7d6516032ced7638b13",
5
+ "size": 48114397,
6
6
  "width": 2560,
7
7
  "height": 1600,
8
- "duration": 208.83333333333334
8
+ "duration": 209
9
9
  },
10
10
  "chapters": [
11
11
  {
@@ -26,52 +26,52 @@
26
26
  {
27
27
  "id": "source",
28
28
  "start": 45.666666666666664,
29
- "end": 55.766666666666666
29
+ "end": 55.8
30
30
  },
31
31
  {
32
32
  "id": "keys",
33
- "start": 55.766666666666666,
34
- "end": 76.7
33
+ "start": 55.8,
34
+ "end": 76.9
35
35
  },
36
36
  {
37
37
  "id": "checks",
38
- "start": 76.7,
39
- "end": 94.46666666666667
38
+ "start": 76.9,
39
+ "end": 94.66666666666667
40
40
  },
41
41
  {
42
42
  "id": "review",
43
- "start": 94.46666666666667,
44
- "end": 110.33333333333333
43
+ "start": 94.66666666666667,
44
+ "end": 110.53333333333333
45
45
  },
46
46
  {
47
47
  "id": "project",
48
- "start": 110.33333333333333,
49
- "end": 117.06666666666666
48
+ "start": 110.53333333333333,
49
+ "end": 117.26666666666667
50
50
  },
51
51
  {
52
52
  "id": "share",
53
- "start": 117.06666666666666,
54
- "end": 128.9
53
+ "start": 117.26666666666667,
54
+ "end": 129.1
55
55
  },
56
56
  {
57
57
  "id": "agent",
58
- "start": 128.9,
59
- "end": 145.6
58
+ "start": 129.1,
59
+ "end": 145.8
60
60
  },
61
61
  {
62
62
  "id": "library",
63
- "start": 145.6,
64
- "end": 173.33333333333334
63
+ "start": 145.8,
64
+ "end": 173.53333333333333
65
65
  },
66
66
  {
67
67
  "id": "export",
68
- "start": 173.33333333333334,
69
- "end": 191.6
68
+ "start": 173.53333333333333,
69
+ "end": 191.8
70
70
  },
71
71
  {
72
72
  "id": "artwork",
73
- "start": 191.6,
74
- "end": 208.83333333333334
73
+ "start": 191.8,
74
+ "end": 209
75
75
  }
76
76
  ],
77
77
  "captions": [
@@ -132,172 +132,172 @@
132
132
  },
133
133
  {
134
134
  "start": 49.7,
135
- "end": 52.833333333333336,
135
+ "end": 52.86666666666667,
136
136
  "text": "Rest on a name: Lean says what it is."
137
137
  },
138
138
  {
139
- "start": 52.833333333333336,
140
- "end": 55.766666666666666,
139
+ "start": 52.86666666666667,
140
+ "end": 55.8,
141
141
  "text": "Click it to go there: its source, its panel."
142
142
  },
143
143
  {
144
- "start": 55.766666666666666,
145
- "end": 58.833333333333336,
144
+ "start": 55.8,
145
+ "end": 58.86666666666667,
146
146
  "text": "Keys: the definitions that carry what it says."
147
147
  },
148
148
  {
149
- "start": 58.833333333333336,
150
- "end": 70,
149
+ "start": 58.86666666666667,
150
+ "end": 70.19999999999999,
151
151
  "text": "Mark each as a key, in its source or its panel."
152
152
  },
153
153
  {
154
- "start": 70,
155
- "end": 76.7,
154
+ "start": 70.19999999999999,
155
+ "end": 76.9,
156
156
  "text": "Rests on · Keys lights them, joined to the target."
157
157
  },
158
158
  {
159
- "start": 77.1,
160
- "end": 79.46666666666667,
159
+ "start": 77.30000000000001,
160
+ "end": 79.66666666666667,
161
161
  "text": "Selection: the statement alone."
162
162
  },
163
163
  {
164
- "start": 79.46666666666667,
165
- "end": 82.26666666666667,
164
+ "start": 79.66666666666667,
165
+ "end": 82.46666666666667,
166
166
  "text": "Least effort — you trust every name in it."
167
167
  },
168
168
  {
169
- "start": 82.26666666666667,
170
- "end": 84.73333333333333,
169
+ "start": 82.46666666666667,
170
+ "end": 84.93333333333334,
171
171
  "text": "Keys: the few that carry the meaning."
172
172
  },
173
173
  {
174
- "start": 84.73333333333333,
175
- "end": 86.8,
174
+ "start": 84.93333333333334,
175
+ "end": 87.00000000000001,
176
176
  "text": "Little effort, good confidence."
177
177
  },
178
178
  {
179
- "start": 86.8,
180
- "end": 88.8,
179
+ "start": 87.00000000000001,
180
+ "end": 89.00000000000001,
181
181
  "text": "TCB: everything it rests on."
182
182
  },
183
183
  {
184
- "start": 88.8,
185
- "end": 90.8,
184
+ "start": 89.00000000000001,
185
+ "end": 91.00000000000001,
186
186
  "text": "Most effort, most confidence."
187
187
  },
188
188
  {
189
- "start": 90.8,
190
- "end": 94.46666666666667,
189
+ "start": 91.00000000000001,
190
+ "end": 94.66666666666667,
191
191
  "text": "Choose how far to read: the counts say what each costs."
192
192
  },
193
193
  {
194
- "start": 94.46666666666667,
195
- "end": 98.03333333333333,
194
+ "start": 94.66666666666667,
195
+ "end": 98.23333333333333,
196
196
  "text": "Read a definition, then say what you think of it."
197
197
  },
198
198
  {
199
- "start": 98.03333333333333,
200
- "end": 104.06666666666666,
199
+ "start": 98.23333333333333,
200
+ "end": 104.26666666666668,
201
201
  "text": "Approve it, with why: the comment stays with it."
202
202
  },
203
203
  {
204
- "start": 104.06666666666666,
205
- "end": 106.86666666666666,
204
+ "start": 104.26666666666668,
205
+ "end": 107.06666666666668,
206
206
  "text": "Changed your mind? Withdraw takes it back."
207
207
  },
208
208
  {
209
- "start": 106.86666666666666,
210
- "end": 110.33333333333333,
209
+ "start": 107.06666666666668,
210
+ "end": 110.53333333333335,
211
211
  "text": "The target's progress counts your approval."
212
212
  },
213
213
  {
214
- "start": 110.33333333333333,
215
- "end": 114.43333333333334,
214
+ "start": 110.53333333333333,
215
+ "end": 114.63333333333333,
216
216
  "text": "The Project tab: the whole codebase."
217
217
  },
218
218
  {
219
- "start": 114.43333333333334,
220
- "end": 117.06666666666666,
219
+ "start": 114.63333333333333,
220
+ "end": 117.26666666666667,
221
221
  "text": "Every board shows the same review."
222
222
  },
223
223
  {
224
- "start": 117.06666666666666,
225
- "end": 122.7,
224
+ "start": 117.26666666666667,
225
+ "end": 122.89999999999999,
226
226
  "text": "Share → AI agent: a token, and a prompt for it."
227
227
  },
228
228
  {
229
- "start": 122.7,
230
- "end": 125.9,
229
+ "start": 122.89999999999999,
230
+ "end": 126.1,
231
231
  "text": "Paste the prompt into your agent: it joins here."
232
232
  },
233
233
  {
234
- "start": 125.9,
235
- "end": 128.9,
234
+ "start": 126.1,
235
+ "end": 129.09999999999997,
236
236
  "text": "The token is the agent's own: revoke it here."
237
237
  },
238
238
  {
239
- "start": 129.4,
240
- "end": 136.43333333333334,
239
+ "start": 129.6,
240
+ "end": 136.63333333333335,
241
241
  "text": "Its menu → Talk: your private channel with it."
242
242
  },
243
243
  {
244
- "start": 136.43333333333334,
245
- "end": 140.03333333333333,
244
+ "start": 136.63333333333335,
245
+ "end": 140.23333333333335,
246
246
  "text": "It reads the code; its state says what it does."
247
247
  },
248
248
  {
249
- "start": 140.03333333333333,
250
- "end": 142.5,
249
+ "start": 140.23333333333335,
250
+ "end": 142.70000000000002,
251
251
  "text": "Its answer links to what it explains."
252
252
  },
253
253
  {
254
- "start": 142.5,
255
- "end": 145.6,
254
+ "start": 142.70000000000002,
255
+ "end": 145.8,
256
256
  "text": "Click the link: your board goes there."
257
257
  },
258
258
  {
259
- "start": 146.73333333333332,
260
- "end": 151.36666666666667,
259
+ "start": 146.93333333333334,
260
+ "end": 151.56666666666666,
261
261
  "text": "Library: add a paper about the code."
262
262
  },
263
263
  {
264
- "start": 151.36666666666667,
265
- "end": 162.6,
264
+ "start": 151.56666666666666,
265
+ "end": 162.8,
266
266
  "text": "Link it to the theorem, at its page."
267
267
  },
268
268
  {
269
- "start": 162.6,
270
- "end": 167,
269
+ "start": 162.8,
270
+ "end": 167.20000000000002,
271
271
  "text": "Space: its source, and the paper beside it at its page."
272
272
  },
273
273
  {
274
- "start": 167,
275
- "end": 173.33333333333334,
274
+ "start": 167.20000000000002,
275
+ "end": 173.53333333333333,
276
276
  "text": "Pin a note on the target: where to start."
277
277
  },
278
278
  {
279
- "start": 173.33333333333334,
280
- "end": 180.76666666666668,
279
+ "start": 173.53333333333333,
280
+ "end": 180.96666666666667,
281
281
  "text": "Export prints a view: here, the target's TCB."
282
282
  },
283
283
  {
284
- "start": 180.76666666666668,
285
- "end": 184.66666666666666,
284
+ "start": 180.96666666666667,
285
+ "end": 184.86666666666667,
286
286
  "text": "Drag a section to change the document's order."
287
287
  },
288
288
  {
289
- "start": 184.66666666666666,
290
- "end": 191.6,
289
+ "start": 184.86666666666667,
290
+ "end": 191.8,
291
291
  "text": "Typeset: the PDF follows the order you set."
292
292
  },
293
293
  {
294
- "start": 191.6,
295
- "end": 195.66666666666666,
294
+ "start": 191.8,
295
+ "end": 195.86666666666667,
296
296
  "text": "Artwork: the board as a picture to keep."
297
297
  },
298
298
  {
299
- "start": 195.66666666666666,
300
- "end": 205.63333333333333,
299
+ "start": 195.86666666666667,
300
+ "end": 205.8,
301
301
  "text": "Frame it, then save it as PNG or SVG."
302
302
  }
303
303
  ]
Binary file
@@ -23,7 +23,9 @@ Output, schema 1:
23
23
  the parser and `_aux_` declarations it generates (decision 2), under a name of its
24
24
  own: the syntax kind it declares, or `<kind>.macro_rules` and the like for a rule
25
25
  (`leanName` is the Lean constant, `display` what a card calls it).
26
- externals constants outside the project that a node refers to directly, folded the same way.
26
+ externals constants outside the project that a node refers to directly, folded the same way,
27
+ each with its doc and its range in its own package's or Lean's source, as the
28
+ `.olean` records them.
27
29
  edges [src, dst, sites], `sites` a bit set: 1 = statement, 2 = definition body,
28
30
  4 = inside a proof, 8 = on grammar: into a notation unit that only declares syntax
29
31
  (flagged `grammar`), which no TCB follows. A macro or elaborator depends on the
@@ -1123,8 +1125,16 @@ def run (out : System.FilePath) (projectDir : String) (roots : Array Name)
1123
1125
  let kind := match env.find? c with
1124
1126
  | some ci => kindOf env ci
1125
1127
  | none => "unknown"
1126
- extJs := extJs.push (Json.mkObj [("name", c.toString), ("kind", kind),
1127
- ("module", modName c), ("ax", nodeAx[nodes.size + j]!)])
1128
+ let mut fields : List (String × Json) := [("name", c.toString), ("kind", kind),
1129
+ ("module", modName c), ("ax", nodeAx[nodes.size + j]!)]
1130
+ -- where it is written in its package or in Lean's core, as the `.olean` records it, and its
1131
+ -- doc: the source window shows an outside declaration's source too (ReviewSpec, "The source
1132
+ -- window", the owner's decision of 2026-10-20), which the server finds by its module
1133
+ if let some d ← findDocString? env c then fields := fields ++ [("doc", Json.str d)]
1134
+ if let some r ← findDeclarationRanges? c then
1135
+ fields := fields ++ [("range", Json.arr #[r.range.pos.line, r.range.pos.column,
1136
+ r.range.endPos.line, r.range.endPos.column])]
1137
+ extJs := extJs.push (Json.mkObj fields)
1128
1138
  let metaUnits : Nat := nodes.foldl (init := 0) fun k c =>
1129
1139
  if !notationUnits.contains c && ((env.find? c).map isMetaDecl).getD false then k + 1 else k
1130
1140
  let axioms := (← get).axioms