@davmash/bygone 0.5.2 → 0.7.1

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.
@@ -0,0 +1,26 @@
1
+ const { readFileSync } = require('fs');
2
+ const path = require('path');
3
+ const { load: loadYaml } = require('js-yaml');
4
+ const { buildChangeTourManifest, parseChangeTourSource } = require('../out/changeTour.js');
5
+
6
+ function loadTourSource(cwd, sourcePath) {
7
+ const resolvedPath = path.resolve(cwd, sourcePath);
8
+ const source = parseChangeTourSource(loadYaml(readFileSync(resolvedPath, 'utf8')));
9
+ return { resolvedPath, source };
10
+ }
11
+
12
+ function buildManifestForTourSource(cwd, source, options = {}) {
13
+ return buildChangeTourManifest(cwd, {
14
+ headRef: options.headRef || source.range?.head,
15
+ baseRef: options.baseRef || source.range?.base,
16
+ title: options.title,
17
+ sourceUrl: options.sourceUrl,
18
+ generatedAt: options.generatedAt,
19
+ source
20
+ });
21
+ }
22
+
23
+ module.exports = {
24
+ buildManifestForTourSource,
25
+ loadTourSource
26
+ };
@@ -0,0 +1,131 @@
1
+ #compdef bygone
2
+ # Generated from cli/commandSpec.js. Do not edit by hand.
3
+
4
+ _bygone_git_refs() {
5
+ local -a refs
6
+ refs=(${(f)"$(git for-each-ref --format='%(refname:short)' refs/heads refs/remotes refs/tags 2>/dev/null)"})
7
+ _describe 'git source' refs
8
+ compadd -- HEAD INDEX WORKTREE
9
+ }
10
+
11
+ _bygone() {
12
+ local first="${words[2]}"
13
+ local previous="${words[CURRENT-1]}"
14
+ local -a root_items review_options present_options legacy_options history_options shells tour_actions
15
+ root_items=(
16
+ 'review:Review a committed branch against its merge base'
17
+ 'completion:Print shell completion source'
18
+ 'present:Open an app-hosted tour of a committed branch range'
19
+ 'tour:Validate, compile, or inspect authored change tours'
20
+ '--diff:Compare files, or open a blank editable diff'
21
+ '--history:Open Git history for a file or directory'
22
+ '--git-diff:Compare two or more Git sources'
23
+ '--branch-diff:Legacy alias for branch review'
24
+ '--test:Open the built-in test comparison'
25
+ '-h:Show command help'
26
+ '--help:Show command help'
27
+ '-v:Show the installed version'
28
+ '--version:Show the installed version'
29
+ )
30
+ review_options=(
31
+ '--base:Set the branch-review base ref'
32
+ '-m:Set the branch-review base ref'
33
+ '--main:Set the branch-review base ref'
34
+ '-h:Show command help'
35
+ '--help:Show command help'
36
+ )
37
+ present_options=(
38
+ '--base:Set the branch-review base ref'
39
+ '-m:Set the branch-review base ref'
40
+ '--main:Set the branch-review base ref'
41
+ '--tour:Use an authored change-tour YAML file'
42
+ '-h:Show command help'
43
+ '--help:Show command help'
44
+ )
45
+ legacy_options=(
46
+ '-b:Set the branch-review head ref'
47
+ '--branch:Set the branch-review head ref'
48
+ '--base:Set the branch-review base ref'
49
+ '-m:Set the branch-review base ref'
50
+ '--main:Set the branch-review base ref'
51
+ '-h:Show command help'
52
+ '--help:Show command help'
53
+ )
54
+ history_options=(
55
+ '--include-staged:Include staged state in Git history'
56
+ '--staged:Include staged state in Git history'
57
+ '-h:Show command help'
58
+ '--help:Show command help'
59
+ )
60
+ shells=('zsh:Z shell' 'bash:Bash' 'fish:Fish shell')
61
+ tour_actions=('context:Build structured change evidence' 'validate:Validate source and anchors' 'compile:Compile a portable manifest' 'schema:Print the source schema')
62
+
63
+ if (( CURRENT == 2 )); then
64
+ _describe 'bygone command' root_items
65
+ _files
66
+ return
67
+ fi
68
+
69
+ case "$first" in
70
+ completion)
71
+ _describe 'shell' shells
72
+ ;;
73
+ tour)
74
+ if (( CURRENT == 3 )); then
75
+ _describe 'tour action' tour_actions
76
+ elif [[ "$words[3]" == "context" ]]; then
77
+ if [[ "$previous" == (--base|-m|--main) ]]; then
78
+ _bygone_git_refs
79
+ elif [[ "$previous" == "--output" || "$previous" == "-o" ]]; then
80
+ _files
81
+ else
82
+ compadd -- --base --output -o --max-patch-bytes --max-total-patch-bytes
83
+ _bygone_git_refs
84
+ fi
85
+ elif [[ "$words[3]" == "validate" || "$words[3]" == "compile" ]]; then
86
+ _files -g '*.bygone.yaml'
87
+ fi
88
+ ;;
89
+ review)
90
+ if [[ "$previous" == (--base|-m|--main) ]]; then
91
+ _bygone_git_refs
92
+ else
93
+ _describe 'review option' review_options
94
+ _bygone_git_refs
95
+ fi
96
+ ;;
97
+ present)
98
+ if [[ "$previous" == (--tour) ]]; then
99
+ _files -g '*.bygone.yaml'
100
+ elif [[ "$previous" == (--base|-m|--main) ]]; then
101
+ _bygone_git_refs
102
+ else
103
+ _describe 'present option' present_options
104
+ _bygone_git_refs
105
+ fi
106
+ ;;
107
+ --branch-diff)
108
+ if [[ "$previous" == (-b|--branch|--base|-m|--main) ]]; then
109
+ _bygone_git_refs
110
+ else
111
+ _describe 'review option' legacy_options
112
+ _bygone_git_refs
113
+ fi
114
+ ;;
115
+ --git-diff)
116
+ _bygone_git_refs
117
+ ;;
118
+ --history)
119
+ _describe 'history option' history_options
120
+ _files
121
+ ;;
122
+ --diff)
123
+ _files
124
+ ;;
125
+ *)
126
+ _files
127
+ ;;
128
+ esac
129
+ }
130
+
131
+ compdef _bygone bygone
@@ -0,0 +1,83 @@
1
+ # Generated from cli/commandSpec.js. Do not edit by hand.
2
+ _bygone_git_refs() {
3
+ git for-each-ref --format='%(refname:short)' refs/heads refs/remotes refs/tags 2>/dev/null
4
+ printf '%s\n' HEAD INDEX WORKTREE
5
+ }
6
+
7
+ _bygone() {
8
+ local cur prev first refs
9
+ COMPREPLY=()
10
+ cur="${COMP_WORDS[COMP_CWORD]}"
11
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
12
+ first="${COMP_WORDS[1]}"
13
+
14
+ if (( COMP_CWORD == 1 )); then
15
+ COMPREPLY=( $(compgen -W 'review completion present tour --diff --history --git-diff --branch-diff --test -h --help -v --version' -- "$cur") $(compgen -f -- "$cur") )
16
+ compopt -o filenames 2>/dev/null || true
17
+ return
18
+ fi
19
+
20
+ case "$first" in
21
+ completion)
22
+ COMPREPLY=( $(compgen -W 'zsh bash fish' -- "$cur") )
23
+ ;;
24
+ tour)
25
+ if (( COMP_CWORD == 2 )); then
26
+ COMPREPLY=( $(compgen -W 'context validate compile schema' -- "$cur") )
27
+ elif [[ "${COMP_WORDS[2]}" == "context" ]]; then
28
+ refs="$(_bygone_git_refs)"
29
+ if [[ "$prev" =~ ^(--base|-m|--main)$ ]]; then
30
+ COMPREPLY=( $(compgen -W "$refs" -- "$cur") )
31
+ elif [[ "$prev" == "--output" || "$prev" == "-o" ]]; then
32
+ COMPREPLY=( $(compgen -f -- "$cur") )
33
+ compopt -o filenames 2>/dev/null || true
34
+ else
35
+ COMPREPLY=( $(compgen -W '--base --output -o --max-patch-bytes --max-total-patch-bytes '"$refs" -- "$cur") )
36
+ fi
37
+ else
38
+ COMPREPLY=( $(compgen -W '--json --output -o' -- "$cur") $(compgen -f -- "$cur") )
39
+ compopt -o filenames 2>/dev/null || true
40
+ fi
41
+ ;;
42
+ review)
43
+ refs="$(_bygone_git_refs)"
44
+ if [[ "$prev" =~ ^(--base|-m|--main)$ ]]; then
45
+ COMPREPLY=( $(compgen -W "$refs" -- "$cur") )
46
+ else
47
+ COMPREPLY=( $(compgen -W '--base -m --main -h --help '"$refs" -- "$cur") )
48
+ fi
49
+ ;;
50
+ present)
51
+ refs="$(_bygone_git_refs)"
52
+ if [[ "$prev" == "--tour" ]]; then
53
+ COMPREPLY=( $(compgen -f -X '!*.bygone.yaml' -- "$cur") )
54
+ compopt -o filenames 2>/dev/null || true
55
+ elif [[ "$prev" =~ ^(--base|-m|--main)$ ]]; then
56
+ COMPREPLY=( $(compgen -W "$refs" -- "$cur") )
57
+ else
58
+ COMPREPLY=( $(compgen -W '--base -m --main --tour -h --help '"$refs" -- "$cur") )
59
+ fi
60
+ ;;
61
+ --branch-diff)
62
+ refs="$(_bygone_git_refs)"
63
+ if [[ "$prev" =~ ^(-b|--branch|--base|-m|--main)$ ]]; then
64
+ COMPREPLY=( $(compgen -W "$refs" -- "$cur") )
65
+ else
66
+ COMPREPLY=( $(compgen -W '-b --branch --base -m --main -h --help '"$refs" -- "$cur") )
67
+ fi
68
+ ;;
69
+ --git-diff)
70
+ COMPREPLY=( $(compgen -W "$(_bygone_git_refs)" -- "$cur") )
71
+ ;;
72
+ --history)
73
+ COMPREPLY=( $(compgen -W '--include-staged --staged -h --help' -- "$cur") $(compgen -f -- "$cur") )
74
+ compopt -o filenames 2>/dev/null || true
75
+ ;;
76
+ *)
77
+ COMPREPLY=( $(compgen -f -- "$cur") )
78
+ compopt -o filenames 2>/dev/null || true
79
+ ;;
80
+ esac
81
+ }
82
+
83
+ complete -F _bygone bygone
@@ -0,0 +1,34 @@
1
+ # Generated from cli/commandSpec.js. Do not edit by hand.
2
+ function __bygone_git_refs
3
+ git for-each-ref --format='%(refname:short)' refs/heads refs/remotes refs/tags 2>/dev/null
4
+ printf "%s\n" HEAD INDEX WORKTREE
5
+ end
6
+
7
+ complete -c bygone -n '__fish_use_subcommand' -a review -d 'Review a committed branch against its merge base'
8
+ complete -c bygone -n '__fish_use_subcommand' -a completion -d 'Print shell completion source'
9
+ complete -c bygone -n '__fish_use_subcommand' -a present -d 'Open an app-hosted tour of a committed branch range'
10
+ complete -c bygone -n '__fish_use_subcommand' -a tour -d 'Validate, compile, or inspect authored change tours'
11
+ complete -c bygone -n '__fish_use_subcommand' -l diff -r -d 'Compare files, or open a blank editable diff'
12
+ complete -c bygone -n '__fish_use_subcommand' -l history -r -d 'Open Git history for a file or directory'
13
+ complete -c bygone -n '__fish_use_subcommand' -l git-diff -d 'Compare two or more Git sources'
14
+ complete -c bygone -n '__fish_use_subcommand' -l branch-diff -d 'Legacy alias for branch review'
15
+ complete -c bygone -n '__fish_use_subcommand' -l test -d 'Open the built-in test comparison'
16
+ complete -c bygone -n '__fish_use_subcommand' -s h -l help -d 'Show command help'
17
+ complete -c bygone -n '__fish_use_subcommand' -s v -l version -d 'Show the installed version'
18
+ complete -c bygone -n '__fish_seen_subcommand_from completion' -a 'zsh bash fish' -d 'Shell'
19
+ complete -c bygone -n '__fish_seen_subcommand_from tour' -a 'context validate compile schema' -d 'Tour action'
20
+ complete -c bygone -n 'string match -q "*tour context*" -- (commandline -opc)' -l base -r -a '(__bygone_git_refs)' -d 'Set the change-context base ref'
21
+ complete -c bygone -n 'string match -q "*tour context*" -- (commandline -opc)' -l output -s o -r -d 'Write the change context'
22
+ complete -c bygone -n 'string match -q "*tour context*" -- (commandline -opc)' -l max-patch-bytes -r -d 'Maximum included patch size per file'
23
+ complete -c bygone -n 'string match -q "*tour context*" -- (commandline -opc)' -l max-total-patch-bytes -r -d 'Maximum included patch size for the dossier'
24
+ complete -c bygone -n 'string match -q "*tour validate*" -- (commandline -opc)' -l json -d 'Print machine-readable validation output'
25
+ complete -c bygone -n 'string match -q "*tour compile*" -- (commandline -opc)' -l output -s o -r -d 'Write the compiled manifest'
26
+ complete -c bygone -n 'string match -q "*--history*" -- (commandline -opc)' -l include-staged -l staged -d 'Include staged state in Git history'
27
+ complete -c bygone -n '__fish_seen_subcommand_from review' -l base -s m -l main -r -a '(__bygone_git_refs)' -d 'Set the branch-review base ref'
28
+ complete -c bygone -n '__fish_seen_subcommand_from review' -a '(__bygone_git_refs)' -d 'Git ref'
29
+ complete -c bygone -n '__fish_seen_subcommand_from present' -l base -s m -l main -r -a '(__bygone_git_refs)' -d 'Set the branch-review base ref'
30
+ complete -c bygone -n '__fish_seen_subcommand_from present' -l tour -r -d 'Use an authored change-tour YAML file'
31
+ complete -c bygone -n '__fish_seen_subcommand_from present' -a '(__bygone_git_refs)' -d 'Git ref'
32
+ complete -c bygone -n 'string match -q "*--branch-diff*" -- (commandline -opc)' -s b -l branch -r -a '(__bygone_git_refs)' -d 'Set the branch-review head ref'
33
+ complete -c bygone -n 'string match -q "*--branch-diff*" -- (commandline -opc)' -l base -s m -l main -r -a '(__bygone_git_refs)' -d 'Set the branch-review base ref'
34
+ complete -c bygone -n 'string match -q "*--git-diff*" -- (commandline -opc)' -a '(__bygone_git_refs)' -d 'Git source'
@@ -0,0 +1,358 @@
1
+ # Change Explanation and Presentation Plan
2
+
3
+ This is a working design note for riffing on how Bygone can speed up understanding and presenting code changes without sacrificing clarity.
4
+
5
+ ## Reframed Product Question
6
+
7
+ Bygone does not need to reproduce the granular review workflow of a Git hosting site. Its more distinctive opportunity is to make change legible:
8
+
9
+ - **Compare** shows how snapshots differ.
10
+ - **Explore** helps someone find the important parts of a change.
11
+ - **Explain** arranges those parts into a coherent path.
12
+ - **Present** makes that path replayable or embeddable elsewhere.
13
+
14
+ The product could expose all four while sharing one diff renderer and one change model.
15
+
16
+ ## Why the Current Checkmarks Do Not Fit
17
+
18
+ The branch-review directory currently adds a checkmark after a file is opened. It means only “visited during this app session.” It is not explicit approval, persistent progress, or synchronization with a PR provider.
19
+
20
+ That state is too granular to be the center of the product, and the checkmark overstates its meaning. It should be removed or reduced to unobtrusive session navigation. Bygone should optimize the path through a change rather than ask users to maintain another review ledger.
21
+
22
+ ## The Core Idea: A Change Explanation Engine
23
+
24
+ Build one reusable pipeline:
25
+
26
+ ```text
27
+ Git range or supplied snapshots
28
+ ↓
29
+ normalized change manifest
30
+ ↓
31
+ files, commits, hunks, renames, binaries, and evidence
32
+ ↓
33
+ Bygone renderer
34
+ ↓
35
+ standalone explorer | authored tour | embedded component | static artifact
36
+ ```
37
+
38
+ The normalized manifest is the important boundary. Electron, VS Code, a local web server, a generated HTML artifact, or a slideshow should all be hosts around the same content and interactions.
39
+
40
+ The existing web host and message-driven renderer are a useful start, but they are currently a test/demo host rather than a supported embedding API.
41
+
42
+ ## Potential Product Forms
43
+
44
+ ### 1. Standalone Change Explorer
45
+
46
+ Open a branch range and move fluidly among:
47
+
48
+ - the aggregate merge-base-to-tip change;
49
+ - individual commits or selected commit ranges;
50
+ - directory and file views;
51
+ - adjacent hunks;
52
+ - text, binary, and image changes;
53
+ - explicitly attached evidence.
54
+
55
+ The explorer should help users understand a change without imposing a process for declaring every file reviewed.
56
+
57
+ ### 2. Guided Change Tour
58
+
59
+ An ordered sequence of “scenes,” where a scene can focus on:
60
+
61
+ - a file;
62
+ - one or more hunks;
63
+ - an entire commit;
64
+ - a multi-panel evolution;
65
+ - an image or other binary comparison;
66
+ - an overview, annotation, screenshot, test result, or benchmark.
67
+
68
+ A tour is closer to a code-change slideshow, but each scene remains a live, navigable Bygone view rather than a flattened screenshot.
69
+
70
+ ### 3. Embeddable Diff Component
71
+
72
+ Expose the renderer as an iframe or web component with a versioned message API. A host supplies a manifest and controls the active scene; Bygone emits navigation and selection events.
73
+
74
+ Possible hosts include:
75
+
76
+ - a custom HTML slideshow;
77
+ - Reveal.js, Slidev, or another presentation system;
78
+ - generated engineering docs;
79
+ - an internal release or deployment page;
80
+ - a richer PR companion page;
81
+ - a product demo combining code, screenshots, and live application state.
82
+
83
+ The component should work without Git or filesystem access once it receives a self-contained manifest.
84
+
85
+ ### 4. Portable Static Artifact
86
+
87
+ Generate a local HTML bundle pinned to exact object IDs:
88
+
89
+ ```bash
90
+ bygone present HEAD --base origin/main --output change-tour.html
91
+ ```
92
+
93
+ The artifact could open directly in a browser, be hosted as static files, or be inserted into a larger demo. A single-file option would favor portability; a directory bundle would favor large changes and lazy loading.
94
+
95
+ Private-code safety must be explicit because a self-contained artifact contains source snapshots.
96
+
97
+ ## Ideas That Could Materially Speed Up Understanding
98
+
99
+ ### Record Exploration Into a Tour
100
+
101
+ Let the user explore normally, then capture the useful path they took:
102
+
103
+ 1. Start recording.
104
+ 2. Open files and move among hunks or commits.
105
+ 3. Pin the moments worth keeping.
106
+ 4. Reorder or annotate the captured scenes.
107
+ 5. Replay or export the result.
108
+
109
+ This avoids forcing users to author a slideshow before they understand the change. The investigation naturally becomes the first draft of the explanation.
110
+
111
+ ### Deterministic Change Triage
112
+
113
+ Generate a suggested reading order using transparent signals rather than pretending to perform human review:
114
+
115
+ - foundational types and interfaces before consumers;
116
+ - production code before or alongside its tests;
117
+ - schema, migration, permissions, or public API changes early;
118
+ - renames and mechanical changes grouped or collapsed;
119
+ - generated files and lockfiles deferred;
120
+ - unusually large or cross-cutting changes called out;
121
+ - commits used as hints about authorial intent.
122
+
123
+ Every ordering decision should be inspectable and overridable.
124
+
125
+ ### Narrative Grouping
126
+
127
+ Group changes into chapters that do not have to match directories or commits:
128
+
129
+ - data model;
130
+ - core behavior;
131
+ - integration points;
132
+ - tests and evidence;
133
+ - cleanup or mechanical follow-through.
134
+
135
+ Start with manual groups and simple deterministic suggestions. Semantic or AI-assisted grouping can remain optional and must link every claim back to concrete hunks.
136
+
137
+ ### Aggregate and Temporal Views
138
+
139
+ Keep both answers close:
140
+
141
+ - “What will merge?” — aggregate merge-base-to-tip diff.
142
+ - “How did it get here?” — commit or selected-range evolution.
143
+
144
+ For merges, retain all parents. Default temporal inspection to first-parent history and expose an explicit parent chooser instead of flattening ambiguity.
145
+
146
+ ### Progressive Disclosure
147
+
148
+ Offer presentation presets without hiding access to source truth:
149
+
150
+ - overview first;
151
+ - changed regions focused;
152
+ - surrounding context expandable;
153
+ - mechanical groups collapsed;
154
+ - full files always reachable;
155
+ - directory structure available without dominating the scene.
156
+
157
+ ### Evidence Alongside Code
158
+
159
+ A change explanation may need more than source diffs. Scenes or chapters could attach:
160
+
161
+ - screenshots and image diffs;
162
+ - test output;
163
+ - benchmark tables;
164
+ - architecture diagrams;
165
+ - logs or traces;
166
+ - migration previews;
167
+ - links to issues, PRs, and deployed demos.
168
+
169
+ The artifact becomes a change dossier while Bygone remains the code-change lens within it.
170
+
171
+ ### Presenter Mode
172
+
173
+ A focused display mode could add:
174
+
175
+ - large, legible controls;
176
+ - scene and hunk navigation from the keyboard;
177
+ - optional speaker notes visible only in a controller window;
178
+ - a clear breadcrumb showing chapter, file, and commit;
179
+ - stable layout that does not jump as context changes;
180
+ - deep links to individual scenes.
181
+
182
+ ### Headless Capture
183
+
184
+ Support deterministic rendering of scenes to PNG, SVG where practical, or HTML fragments. This would let existing slide workflows use Bygone without adopting its entire presentation shell.
185
+
186
+ ### Live PR Tour Guide Loop
187
+
188
+ Treat the saved `.bygone.yaml` as the shared boundary between an author, an agent, and the open presenter. When the author asks a question, the PR Tour Guide can revise the narrative or its evidence links and save the file; Bygone should validate, compile, and refresh the browser without restarting the presentation.
189
+
190
+ The refresh loop should:
191
+
192
+ - watch the authored tour and debounce partial editor writes;
193
+ - replace the presented manifest only after the new source validates and compiles;
194
+ - keep the last known-good tour visible when an edit is invalid and report the error clearly;
195
+ - preserve the active scene and step by stable IDs when they still exist;
196
+ - update the scene rail and focused code when the narrative changes;
197
+ - distinguish a narrative-only refresh from a changed Git range, which may require rebuilding source evidence;
198
+ - surface broken anchors rather than silently redirecting them.
199
+
200
+ This makes the first interactive workflow deliberately simple: conversation changes the durable tour file, and the presenter reflects it. An embedded chat UI or agent protocol can come later without becoming part of the tour format.
201
+
202
+ ## A Possible Authoring Format
203
+
204
+ Keep the durable format declarative and host-neutral. For example:
205
+
206
+ ```yaml
207
+ version: 1
208
+ range:
209
+ base: origin/main
210
+ head: HEAD
211
+ chapters:
212
+ - title: Introduce the event model
213
+ scenes:
214
+ - file: src/events.ts
215
+ hunk: event-envelope
216
+ note: The stable boundary used by producers and consumers.
217
+ - file: src/consumer.ts
218
+ hunk: handle-event
219
+ - title: Prove the behavior
220
+ scenes:
221
+ - file: test/events.test.ts
222
+ hunk: preserves-order
223
+ ```
224
+
225
+ The exact syntax can wait. The important constraints are:
226
+
227
+ - pin reproducible Git inputs;
228
+ - permit manual ordering and annotation;
229
+ - use resilient anchors where possible;
230
+ - remain renderable without the authoring environment;
231
+ - make included source and external assets obvious.
232
+
233
+ ## Recommended Implementation Sequence
234
+
235
+ ### Phase 0: Remove the False Review Metaphor
236
+
237
+ - Remove or soften automatic checkmarks.
238
+ - Rename the UI from files “reviewed” to files “visited” only where session navigation truly needs it.
239
+ - Keep `review` as a convenient merge-base range command for now, without making its checklist the product thesis.
240
+
241
+ ### Phase 1: Define the Portable Change Manifest
242
+
243
+ - Extract a serializable model for range metadata, commits, changed paths, rename pairs, binary metadata, and file snapshots.
244
+ - Version the manifest.
245
+ - Validate it independently of Electron and VS Code.
246
+ - Add size limits, lazy-asset references, and clear handling for sensitive source content.
247
+ - Teach the web host to render a supplied manifest.
248
+
249
+ This is the architectural foundation for both standalone and component use.
250
+
251
+ ### Phase 2: Build a Minimal Tour
252
+
253
+ - Let a user pin the current file/hunk as a scene.
254
+ - Show a simple ordered scene rail.
255
+ - Support reorder, title, and short annotation.
256
+ - Replay scenes with previous/next controls.
257
+ - Save and reopen the tour locally.
258
+ - Preserve full diff navigation within each scene.
259
+
260
+ Success criterion: a real branch can be turned into a clear five-to-ten-scene walkthrough faster than hand-building an HTML slideshow.
261
+
262
+ ### Phase 3: Export and Embed
263
+
264
+ - Generate a static HTML bundle.
265
+ - Define an iframe/message API before committing to a custom element.
266
+ - Add scene-selection and navigation events.
267
+ - Add a minimal embed example in a plain HTML slideshow.
268
+ - Add deterministic headless captures for workflows that still need images.
269
+
270
+ Success criterion: the same authored tour works in Bygone, a browser artifact, and a larger demo.
271
+
272
+ ### Phase 4: Suggest, Do Not Dictate, a Narrative
273
+
274
+ - Suggest scene candidates from commits and meaningful hunks.
275
+ - Group mechanical, generated, and lockfile changes.
276
+ - Suggest dependency-aware or risk-aware reading order.
277
+ - Allow one-click acceptance followed by manual editing.
278
+ - Keep all heuristics explainable and deterministic first.
279
+
280
+ ### Phase 5: Attach Broader Evidence
281
+
282
+ - Add screenshots, test results, diagrams, and links as first-class scene types.
283
+ - Add presenter notes and export templates.
284
+ - Consider optional AI assistance for summaries or grouping only when every output stays grounded in selected changes.
285
+
286
+ ## Smallest Valuable Experiment
287
+
288
+ Build a read-only prototype of:
289
+
290
+ ```bash
291
+ bygone present HEAD --base origin/main
292
+ ```
293
+
294
+ It should:
295
+
296
+ 1. derive the existing branch range;
297
+ 2. create a portable manifest;
298
+ 3. open a browser-hosted overview;
299
+ 4. let the user pin files or hunks into an ordered scene rail;
300
+ 5. save that scene order and notes as JSON;
301
+ 6. replay it in a clean presenter mode.
302
+
303
+ Do not start with PR APIs, persistent reviewed state, AI summaries, or a polished export pipeline. This experiment tests the central proposition: does a live diff tour make a change faster to explain than the user's current HTML slideshow process?
304
+
305
+ ### Prototype Status
306
+
307
+ The first read-only vertical slice now exists:
308
+
309
+ - `bygone present [<head>] [--base <base>]` derives an exact committed range;
310
+ - a runtime-validated, versioned manifest contains immutable range IDs, commits, text snapshots, and Git-native line counts;
311
+ - deterministic chapters order context, contracts, behavior, tests, and dependency changes;
312
+ - the browser presenter reuses Bygone's real diff renderer;
313
+ - the scene rail, previous/next controls, file navigation, and Page Up/Page Down replay the tour;
314
+ - optional environment variables can set a title, source URL, manifest output path, browser behavior, and port while the interaction model is still experimental.
315
+
316
+ The second prototype slice adds an authored story overlay without sacrificing the complete diff:
317
+
318
+ - story definitions can interleave discussion scenes and narrated file scenes;
319
+ - every scene supports a summary, bullets, tags, and a concise takeaway;
320
+ - file scenes can focus an initial diff hunk;
321
+ - chapter tabs show scene counts and jump directly to the chapter;
322
+ - previous/next chapter controls complement scene-level navigation;
323
+ - files omitted from the authored path remain in an independent complete-change Files rail.
324
+
325
+ Authoring is JSON-first for now through `BYGONE_TOUR_STORY`. The next question is whether recording and pinning scenes in the UI is faster than editing that definition directly.
326
+
327
+ ## Architecture Guardrails
328
+
329
+ - Keep Git extraction separate from rendering.
330
+ - Keep the manifest independent of Electron, VS Code, and hosting providers.
331
+ - Treat the renderer as an input/output component, not a singleton app global.
332
+ - Pin exported content to immutable object IDs.
333
+ - Never imply omitted changes are absent; show scope and filtering clearly.
334
+ - Make static artifacts disclose that they contain source code.
335
+ - Keep hosted-provider integration optional and read-only until there is a compelling workflow.
336
+ - Preserve Bygone's visual clarity; do not solve composition with more connectors and badges.
337
+
338
+ ## Questions to Riff On
339
+
340
+ - Is the primary authored unit a file, a hunk, a commit, or a freeform scene containing any of them?
341
+ - Should recording capture every navigation step or only explicitly pinned moments?
342
+ - Is a Bygone-owned presenter shell useful, or is embedding into existing slide tools the main goal?
343
+ - Would a static HTML artifact replace the current slideshow workflow, or should Bygone primarily emit embeddable scenes and captures?
344
+ - How much annotation belongs inside Bygone versus in the surrounding demo?
345
+ - Should deterministic suggested ordering prioritize dependency flow, risk, commit order, or author-defined chapters?
346
+ - What evidence types recur often enough to deserve first-class support?
347
+ - Does the command remain `review`, or should explanation/presentation become a separate mode such as `present`, `tour`, or `story`?
348
+
349
+ ## Broader Product Work
350
+
351
+ This direction still depends on the existing fundamentals:
352
+
353
+ - diff and inline-highlight correctness;
354
+ - fast rendering on large changes;
355
+ - strong commit and directory navigation;
356
+ - predictable binary and image handling;
357
+ - reusable rendering across standalone, VS Code, and web hosts;
358
+ - clean packaging and local-first operation.