@davmash/bygone 0.8.16 → 0.9.2

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.
@@ -1,10 +1,52 @@
1
- version: 1
1
+ version: 3
2
2
  title: How Bygone learned to review a branch
3
3
  sourceUrl: https://github.com/davidmashburn/bygone/commit/75b6d7c0303124ec314aa790d6b808c4a9d9ea0e
4
4
  range:
5
5
  base: 292fe9248c5c49f762489dc688296fc100d120bc
6
6
  head: 75b6d7c0303124ec314aa790d6b808c4a9d9ea0e
7
7
 
8
+ review:
9
+ baseOid: 292fe9248c5c49f762489dc688296fc100d120bc
10
+ headOid: 75b6d7c0303124ec314aa790d6b808c4a9d9ea0e
11
+ items:
12
+ - id: merge-base-contract
13
+ kind: concept
14
+ title: Merge-base defines the reviewed history
15
+ body: "resolveBranchReviewRange selects one merge base, then derives changed paths and commits from that boundary. The review is the merge-base-to-head story."
16
+ evidence:
17
+ - sceneId: review-pipeline
18
+ stepId: establish-boundary
19
+ - sceneId: review-pipeline
20
+ stepId: lock-the-semantics
21
+ - id: git-directory-boundary
22
+ kind: boundary
23
+ title: Git-specific work ends at two trees
24
+ body: "The Git layer discovers the range and materializes snapshots; FileComparator then hands those temporary roots to the ordinary directory comparison. A reader needs the range model before the reusable directory surface is meaningful."
25
+ evidence:
26
+ - sceneId: review-pipeline
27
+ stepId: make-range-portable
28
+ - sceneId: review-pipeline
29
+ stepId: turn-history-into-files
30
+ - sceneId: review-pipeline
31
+ stepId: reuse-the-diff-surface
32
+ - id: setup-owns-complexity
33
+ kind: tradeoff
34
+ title: Review support moves complexity into range and snapshot setup
35
+ body: "Reusing directory comparison avoids a branch-only renderer, while range resolution and temporary snapshot creation add complexity before that renderer."
36
+ evidence:
37
+ - sceneId: review-pipeline
38
+ stepId: establish-boundary
39
+ - sceneId: review-pipeline
40
+ stepId: turn-history-into-files
41
+ - sceneId: review-pipeline
42
+ stepId: reuse-the-diff-surface
43
+ - id: partial-materialization-cleanup
44
+ kind: question
45
+ title: Does a failed materialization clean up both temporary roots?
46
+ body: "The focused walkthrough follows the successful handoff, but it does not prove cleanup when git show fails after one root has been partially populated."
47
+ evidence: []
48
+ nextCheck: "Inspect the preparation-error path and add a fault-injection fixture only if a failed materialization leaves either temporary root behind."
49
+
8
50
  anchors:
9
51
  choose-merge-base:
10
52
  file: src/gitComparison.ts
@@ -47,34 +89,34 @@ chapters:
47
89
  scenes:
48
90
  - id: review-pipeline
49
91
  title: From Git history to a visual workspace
50
- summary: Follow the branch-review feature through its historical boundary, portable model, presentation seam, and proof.
92
+ summary: Follow the branch-review feature from its historical boundary to the reusable comparison surface and the test that fixes its semantics.
51
93
  bullets:
52
- - The comparison starts at merge-base rather than whichever ref happens to be named as the base.
53
- - Git-specific work ends once two temporary trees have been materialized.
54
- - Existing directory comparison then provides navigation and drill-down without a second renderer.
94
+ - Resolve the range before materializing files for the comparison.
95
+ - Keep Git-specific preparation at the temporary-tree handoff.
96
+ - Read the fixture as a proof of range semantics, separate from the renderer.
55
97
  tags: [git, architecture, dogfood]
56
98
  takeaway: Bygone reviews its own history using the same boundary it introduced in this commit.
57
99
  steps:
58
100
  - id: establish-boundary
59
101
  title: Establish the historical boundary
60
- body: The review represents everything introduced since the branch diverged, including changes made around merges.
102
+ body: Using the unique merge base makes the review start at branch divergence; the resolver rejects multiple merge bases instead of silently choosing one.
61
103
  focus: choose-merge-base
62
104
  - id: make-range-portable
63
105
  title: Describe the review as data
64
- body: Changed paths and commits are collected into a range that neither renderer needs to rediscover.
106
+ body: BranchReviewRange carries changed paths and commits once, so the renderer can consume prepared history rather than rediscovering Git state.
65
107
  focus: describe-range
66
108
  - id: turn-history-into-files
67
109
  title: Materialize two review trees
68
- body: The Git-specific layer creates base and head snapshots for only the changed paths.
110
+ body: Materializing only changed paths creates the two snapshots the diff can read; the temporary roots add setup and cleanup around the read-only comparison.
69
111
  focus: materialize-boundary
70
112
  connection: range-to-snapshot
71
113
  - id: reuse-the-diff-surface
72
114
  title: Reuse directory comparison
73
- body: VS Code hands those snapshots to Bygone's existing directory workflow instead of introducing a branch-only view.
115
+ body: Passing the roots to compareDirectories keeps branch review on the established directory workflow, so navigation and drill-down are reused instead of implemented in a branch-specific renderer.
74
116
  focus: open-review-surface
75
117
  connection: snapshot-to-surface
76
118
  - id: lock-the-semantics
77
119
  title: Prove the range starts at divergence
78
- body: The test creates a real repository and asserts the selected merge base, changed paths, and commits.
120
+ body: The fixture asserts the merge base, changed paths, and commit count; renderer behavior needs separate checks.
79
121
  focus: prove-merge-base
80
122
  connection: semantics-to-proof
@@ -0,0 +1,420 @@
1
+ version: 3
2
+ title: Navigation lab
3
+ windowTitle: Bygone navigation lab
4
+ range:
5
+ base: 1f8fdc07d56fc7a0e50dcab0383a63159c77178c
6
+ head: 901a193203e4840dbf6e06c6a273fac7f2d713bd
7
+ anchors:
8
+ path-host:
9
+ file: web/index.html
10
+ revision: head
11
+ contains: <nav id="tour-reading-path" class="tour-reading-path" aria-label="Reading hierarchy"></nav>
12
+ path-levels:
13
+ file: web/host.js
14
+ revision: head
15
+ contains: " if (tour.scenes.length > 1) levels.push(['tour', tour.title]);\n if (tour.chapters.length\
16
+ \ > 1 && chapter && (chapter.sceneIds.length > 1 || state.narrativeParent === 'chapter')) levels.push(['chapter',\
17
+ \ chapter.title]);\n levels.push(['scene', scene.title]);\n if (hasStep) levels.push(['step',\
18
+ \ `Step ${state.activeStepIndex + 1}`]);"
19
+ path-children:
20
+ file: web/host.js
21
+ revision: head
22
+ contains: " children.append(readingButton(item.title, `Read chapter: ${item.title}`,\
23
+ \ () => {\n if (!item.sceneIds.includes(scene.id)) showTourScene(first, 0,\
24
+ \ { userNavigation: true, showIntro: true });\n setNarrativeView(item.sceneIds.length\
25
+ \ > 1 ? 'chapter' : 'scene');\n }));"
26
+ remember-step:
27
+ file: web/host.js
28
+ revision: head
29
+ contains: " if (step) parameters.set('step', step.id);\n else parameters.delete('step');\n\
30
+ \ if (state.narrativeParent) parameters.set('view', state.narrativeParent);\n else\
31
+ \ if (step && state.sceneIntroVisible) parameters.set('view', 'overview');\n else parameters.delete('view');"
32
+ resume-parent:
33
+ file: web/host.js
34
+ revision: head
35
+ contains: " if (direction === 1 && state.narrativeParent) {\n showTourScene(state.activeSceneIndex,\
36
+ \ state.activeStepIndex, { userNavigation: true, showIntro: false });\n return true;\n\
37
+ \ }"
38
+ restore-parent:
39
+ file: web/host.js
40
+ revision: head
41
+ contains: ' if ([''tour'', ''chapter''].includes(parameters.get(''view''))) setNarrativeView(parameters.get(''view''));'
42
+ ignore-layout:
43
+ file: media/script.js
44
+ revision: head
45
+ contains: " if (suppressEditorEvents || (!event.scrollTopChanged && !event.scrollLeftChanged))\
46
+ \ {\n connectorController.scheduleDrawConnections();\n return;\n }"
47
+ keep-sync:
48
+ file: media/script.js
49
+ revision: head
50
+ contains: " if (editorMode === MODE_MULTI_WAY) {\n synchronizeMultiScroll(editor);\n\
51
+ \ } else {\n synchronizeEditorScroll(editor);\n }"
52
+ width-test:
53
+ file: test/runTests.js
54
+ revision: head
55
+ contains: " assert.deepEqual(\n invokeScrollHandler({ scrollTopChanged: false, scrollLeftChanged:\
56
+ \ false, scrollWidthChanged: true }),\n ['draw']\n );"
57
+ vertical-test:
58
+ file: test/runTests.js
59
+ revision: head
60
+ contains: " assert.deepEqual(\n invokeScrollHandler({ scrollTopChanged: true, scrollLeftChanged:\
61
+ \ false }),\n ['two-way-scroll', 'draw']\n );"
62
+ horizontal-test:
63
+ file: test/runTests.js
64
+ revision: head
65
+ contains: " assert.deepEqual(\n invokeScrollHandler({ scrollTopChanged: false, scrollLeftChanged:\
66
+ \ true }, 'multi-way'),\n ['multi-scroll', 'draw']\n );"
67
+ connections: []
68
+ chapters:
69
+ - id: reading
70
+ title: Reading levels
71
+ scenes:
72
+ - id: reading-path
73
+ overview:
74
+ kind: directory-diff
75
+ title: Explore the reading path
76
+ summary: The directory comparison shows the combined changes across this scene’s constructed stages. Open a file to inspect it, then select Overview above the diff to return; Start steps follows the explanation. Use the breadcrumb above this text to move through Tour, Chapter, Scene, and Step. The sidebar
77
+ provides a second route to the same content.
78
+ bullets: []
79
+ tags:
80
+ - navigation-demo
81
+ takeaway: Mode chooses the representation of the change; the breadcrumb chooses your reading depth
82
+ within it.
83
+ steps:
84
+ - id: path-host
85
+ title: Keep navigation beside narration
86
+ body: The reading path occupies the same toolbar as narration, so moving up a level does not require
87
+ opening another panel. Try hiding narration to give the path more room.
88
+ focus: path-host
89
+ - id: path-levels
90
+ title: Show levels with useful choices
91
+ body: This tour has two chapters with two scenes each, so every parent level appears. A smaller
92
+ tour omits levels that add no navigation choice.
93
+ focus: path-levels
94
+ - id: path-children
95
+ title: Let a parent show its children
96
+ body: Select the chapter title above to see its scenes, or select the tour title to see both chapters.
97
+ These buttons enter the selected chapter while keeping the current scene when it already belongs
98
+ there.
99
+ focus: path-children
100
+ kind: deconstructed-diff
101
+ base: 1f8fdc07d56fc7a0e50dcab0383a63159c77178c
102
+ target: 901a193203e4840dbf6e06c6a273fac7f2d713bd
103
+ stack:
104
+ - id: before
105
+ ref: 1f8fdc07d56fc7a0e50dcab0383a63159c77178c
106
+ label: Before hierarchy
107
+ - id: hierarchy
108
+ ref: a50c2a6f58a2dfd7f85039105a27e4b92b98a3f7
109
+ label: Hierarchy added
110
+ - id: marker
111
+ ref: 901a193203e4840dbf6e06c6a273fac7f2d713bd
112
+ label: Marker fix added
113
+ stages:
114
+ - id: surface
115
+ title: Place the reading controls
116
+ narration: Add the breadcrumb, parent container, child list, and their styling. These are synthetic
117
+ cumulative panels, not historical commits.
118
+ changes:
119
+ - file: web/index.html
120
+ hunks:
121
+ - hunk-2828c9627055
122
+ - hunk-68a3bdc9f262
123
+ - hunk-ad7073e10ed7
124
+ - file: web/presenter.css
125
+ hunks:
126
+ - hunk-3d4093808d4b
127
+ - id: navigation
128
+ title: Connect parents and return positions
129
+ narration: Wire the hierarchy to the selected scene and step, then document the reading behavior.
130
+ changes:
131
+ - file: docs/present.md
132
+ hunks:
133
+ - hunk-5b7f86aadb64
134
+ - hunk-635769fc5c13
135
+ - hunk-d3f94ec64c1f
136
+ - file: web/host.js
137
+ hunks:
138
+ - hunk-3bd48ca387ae
139
+ - hunk-069a2fee2f36
140
+ - hunk-e7def68037d5
141
+ - hunk-755dbc1b8067
142
+ - hunk-82249952520f
143
+ - hunk-db24a55e418e
144
+ - hunk-87209fb2e340
145
+ - hunk-5ebccafb6522
146
+ - hunk-b62a3aedf12b
147
+ - hunk-50d651bf7762
148
+ - hunk-3a1c863cc48a
149
+ - hunk-1d2fb5f32ab9
150
+ - hunk-df6ed3ebba70
151
+ - hunk-5106426d3c27
152
+ - hunk-8d0ffe62e5b7
153
+ - hunk-fc04b2890333
154
+ - id: focus
155
+ title: Protect the code marker
156
+ narration: Ignore layout-only scroll events so revealing a marker is not undone by panel resizing.
157
+ changes:
158
+ - file: media/script.js
159
+ hunks:
160
+ - hunk-636df0304da5
161
+ - id: proof
162
+ title: Check scrolling behavior
163
+ narration: Test that width-only changes redraw connectors while actual scrolling still synchronizes
164
+ editors.
165
+ changes:
166
+ - file: test/runTests.js
167
+ hunks:
168
+ - hunk-acbf72ffb0da
169
+ - hunk-c6c53c72b8b1
170
+ - id: return-position
171
+ title: Return without losing your place
172
+ summary: Move to a later step, select its scene or chapter in the breadcrumb, then use Resume. Refresh
173
+ the parent view to exercise the saved URL position.
174
+ bullets: []
175
+ tags:
176
+ - navigation-demo
177
+ takeaway: The reading level and the return step are separate pieces of state.
178
+ steps:
179
+ - id: remember-step
180
+ title: Keep your step ready to resume
181
+ body: Selecting a parent keeps your current step ready to resume. The URL preserves the step and
182
+ selected reading level, so refreshing restores both.
183
+ focus: remember-step
184
+ - id: resume-parent
185
+ title: Resume from a parent
186
+ body: Next from a parent returns to the remembered step instead of advancing past it. The button
187
+ label becomes Resume to make that behavior explicit.
188
+ focus: resume-parent
189
+ - id: restore-parent
190
+ title: Restore the parent after refresh
191
+ body: Loading the URL restores the selected tour or chapter view after establishing the saved scene
192
+ and step. Try refreshing while viewing this chapter.
193
+ focus: restore-parent
194
+ - id: evidence
195
+ title: Code focus
196
+ scenes:
197
+ - id: marker-focus
198
+ title: Keep the marker in view
199
+ summary: Panel layout changes can emit scroll events without a scroll-position change. The renderer
200
+ must not treat those events as reader navigation.
201
+ bullets: []
202
+ tags:
203
+ - navigation-demo
204
+ takeaway: The fix filters layout noise without disabling synchronized scrolling.
205
+ steps:
206
+ - id: ignore-layout
207
+ title: Ignore extent-only scroll events
208
+ body: The guard exits when neither vertical nor horizontal position changed. A panel-width change
209
+ therefore cannot synchronize an old position back into the focused editor.
210
+ focus: ignore-layout
211
+ - id: keep-sync
212
+ title: Continue synchronizing real scrolling
213
+ body: After the guard, actual scroll events still dispatch to the appropriate two-panel or multi-panel
214
+ synchronization path.
215
+ focus: keep-sync
216
+ - id: scroll-proof
217
+ title: Inspect the regression checks
218
+ summary: These tests invoke the renderer scroll callback with different event shapes. Use the Files
219
+ section to explore the complete change set, then return to the tour.
220
+ bullets: []
221
+ tags:
222
+ - navigation-demo
223
+ takeaway: Use the mode buttons to open either tour or live History. To inspect the final result without narration,
224
+ open Compare and choose Final diff.
225
+ steps:
226
+ - id: width-test
227
+ title: A width change only redraws
228
+ body: A width-only event must draw connectors without requesting either kind of synchronized scroll.
229
+ focus: width-test
230
+ - id: vertical-test
231
+ title: Vertical scrolling still synchronizes
232
+ body: A real vertical movement in a two-panel comparison still synchronizes and redraws.
233
+ focus: vertical-test
234
+ - id: horizontal-test
235
+ title: Multi-panel scrolling still synchronizes
236
+ body: A horizontal movement in multi-panel mode reaches the multi-panel synchronizer. This is callback
237
+ coverage; the panel-switch landing was also checked manually in the browser.
238
+ focus: horizontal-test
239
+
240
+ tours:
241
+ historical:
242
+ chapters:
243
+ - id: historical-reading
244
+ title: The hierarchy commit
245
+ scenes:
246
+ - id: hierarchy-revision
247
+ overview:
248
+ kind: directory-diff
249
+ path: web
250
+ comparison:
251
+ from: before
252
+ to: hierarchy
253
+ kind: stacked-diff
254
+ title: Add reading levels in a real commit
255
+ summary: >-
256
+ This overview compares the web directory before and after the hierarchy commit. Open a file without leaving the overview, or start the steps to see the real revision panels. Its changes to markup, styling, and
257
+ navigation landed together; they are split into conceptual stages only in
258
+ Deconstructed tour.
259
+ bullets: []
260
+ tags:
261
+ - real-revisions
262
+ - navigation-demo
263
+ takeaway: >-
264
+ Historical tour keeps the real commit boundaries, even when one commit contains
265
+ several concepts.
266
+ stack:
267
+ - id: before
268
+ ref: 1f8fdc07d56fc7a0e50dcab0383a63159c77178c
269
+ label: Before hierarchy
270
+ - id: hierarchy
271
+ ref: a50c2a6f58a2dfd7f85039105a27e4b92b98a3f7
272
+ label: Hierarchy added
273
+ - id: marker
274
+ ref: 901a193203e4840dbf6e06c6a273fac7f2d713bd
275
+ label: Marker fix added
276
+ files:
277
+ - web/index.html
278
+ - web/host.js
279
+ - web/presenter.css
280
+ steps:
281
+ - id: historical-markup
282
+ title: Give the hierarchy a home
283
+ body: >-
284
+ The hierarchy commit adds the reading path and parent-view containers to the
285
+ presenter. This is the same committed markup shown in the synthetic surface stage,
286
+ now in its original revision context.
287
+ file: web/index.html
288
+ pair:
289
+ - before
290
+ - hierarchy
291
+ side: right
292
+ - id: historical-behavior
293
+ title: Connect the reading levels
294
+ body: >-
295
+ The same commit wires parent navigation and return positions in the host. The
296
+ hierarchy was introduced as a coherent UI change, rather than as separate Git
297
+ commits for each explanation stage.
298
+ file: web/host.js
299
+ pair:
300
+ - before
301
+ - hierarchy
302
+ side: right
303
+ - id: historical-style
304
+ title: Style the parent choices
305
+ body: >-
306
+ The reading controls and child choices receive their layout in this commit as
307
+ well. Change modes to Deconstructed to inspect those changes in a different
308
+ teaching order.
309
+ file: web/presenter.css
310
+ pair:
311
+ - before
312
+ - hierarchy
313
+ side: right
314
+ - id: historical-return
315
+ title: Return without losing your place
316
+ summary: >-
317
+ Move to a later step, select its scene or chapter in the breadcrumb, then use Resume.
318
+ Refresh the parent view to exercise the saved URL position.
319
+ bullets: []
320
+ tags:
321
+ - navigation-demo
322
+ takeaway: The reading level and the return step are separate pieces of state.
323
+ steps:
324
+ - id: remember-step
325
+ title: Keep your step ready to resume
326
+ body: >-
327
+ Selecting a parent keeps your current step ready to resume. The URL preserves the step and
328
+ selected reading level, so refreshing restores both.
329
+ focus: remember-step
330
+ - id: resume-parent
331
+ title: Resume from a parent
332
+ body: >-
333
+ Next from a parent returns to the remembered step instead of advancing past it.
334
+ The button label becomes Resume to make that behavior explicit.
335
+ focus: resume-parent
336
+ - id: restore-parent
337
+ title: Restore the parent after refresh
338
+ body: >-
339
+ Loading the URL restores the selected tour or chapter view after establishing the
340
+ saved scene and step. Try refreshing while viewing this chapter.
341
+ focus: restore-parent
342
+ - id: historical-correction
343
+ title: The follow-up correction
344
+ scenes:
345
+ - id: marker-revision
346
+ kind: stacked-diff
347
+ title: Fix marker focus after the hierarchy change
348
+ summary: >-
349
+ The last panel is a separate follow-up commit. It changes scroll-event handling and
350
+ adds regression assertions; it does not rewrite the earlier hierarchy implementation.
351
+ bullets: []
352
+ tags:
353
+ - real-revisions
354
+ - navigation-demo
355
+ takeaway: The later commit repairs code focus while retaining the new reading hierarchy.
356
+ stack:
357
+ - id: before
358
+ ref: 1f8fdc07d56fc7a0e50dcab0383a63159c77178c
359
+ label: Before hierarchy
360
+ - id: hierarchy
361
+ ref: a50c2a6f58a2dfd7f85039105a27e4b92b98a3f7
362
+ label: Hierarchy added
363
+ - id: marker
364
+ ref: 901a193203e4840dbf6e06c6a273fac7f2d713bd
365
+ label: Marker fix added
366
+ files:
367
+ - media/script.js
368
+ - test/runTests.js
369
+ steps:
370
+ - id: historical-marker
371
+ title: Ignore layout-only scroll events
372
+ body: >-
373
+ Panel resizing can emit scroll events without moving either scroll position. This
374
+ revision redraws connections and returns early for those events, preserving the
375
+ tour marker focus.
376
+ file: media/script.js
377
+ pair:
378
+ - hierarchy
379
+ - marker
380
+ side: right
381
+ - id: historical-proof
382
+ title: Keep actual scrolling synchronized
383
+ body: >-
384
+ The follow-up includes assertions for width-only events and real vertical or
385
+ horizontal scrolling. These checks distinguish a layout update from a user scroll
386
+ that must still synchronize editors.
387
+ file: test/runTests.js
388
+ pair:
389
+ - hierarchy
390
+ - marker
391
+ side: right
392
+ - id: historical-checks
393
+ title: Inspect the regression checks
394
+ summary: >-
395
+ These tests invoke the renderer scroll callback with different event shapes. Use the
396
+ Files section to explore the complete change set, then return to the tour.
397
+ bullets: []
398
+ tags:
399
+ - navigation-demo
400
+ takeaway: >-
401
+ Use the mode buttons to open either tour or live History. To inspect the final result without
402
+ narration, open Compare and choose Final diff.
403
+ steps:
404
+ - id: width-test
405
+ title: A width change only redraws
406
+ body: >-
407
+ A width-only event must draw connectors without requesting either kind of
408
+ synchronized scroll.
409
+ focus: width-test
410
+ - id: vertical-test
411
+ title: Vertical scrolling still synchronizes
412
+ body: A real vertical movement in a two-panel comparison still synchronizes and redraws.
413
+ focus: vertical-test
414
+ - id: horizontal-test
415
+ title: Multi-panel scrolling still synchronizes
416
+ body: >-
417
+ A horizontal movement in multi-panel mode reaches the multi-panel synchronizer.
418
+ This is callback coverage; the panel-switch landing was also checked manually in
419
+ the browser.
420
+ focus: horizontal-test