@davmash/bygone 0.9.8 → 0.10.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/README.md +74 -1
  3. package/cli/commandSpec.js +2 -0
  4. package/cli/completions.js +3 -3
  5. package/cli/present.js +41 -14
  6. package/cli/tour.js +22 -1
  7. package/cli/tourExport.js +147 -0
  8. package/cli/tourFile.js +109 -4
  9. package/cli/tourHistory.js +31 -1
  10. package/completions/_bygone +1 -1
  11. package/completions/bygone +1 -1
  12. package/completions/bygone.fish +1 -1
  13. package/docs/change-tour-format.md +85 -68
  14. package/docs/explore.md +14 -3
  15. package/docs/generating-change-tours.md +84 -46
  16. package/docs/present.md +103 -14
  17. package/docs/product-surface.md +19 -8
  18. package/docs/sharing-tours.md +95 -0
  19. package/docs/visual-walkthrough/README.md +89 -0
  20. package/docs/visual-walkthrough/build-tour.mjs +54 -0
  21. package/docs/visual-walkthrough/capture-desktop.cjs +42 -0
  22. package/docs/visual-walkthrough/capture-desktop.mjs +21 -0
  23. package/docs/visual-walkthrough/captures.md +49 -0
  24. package/docs/visual-walkthrough/create-demo.mjs +57 -0
  25. package/docs/visual-walkthrough/deconstructed-demo.bygone +100 -0
  26. package/docs/visual-walkthrough/images/01-two-files.png +0 -0
  27. package/docs/visual-walkthrough/images/02-many-panels.png +0 -0
  28. package/docs/visual-walkthrough/images/03-directories.png +0 -0
  29. package/docs/visual-walkthrough/images/04-search.png +0 -0
  30. package/docs/visual-walkthrough/images/05-repository-history.png +0 -0
  31. package/docs/visual-walkthrough/images/06-file-history.png +0 -0
  32. package/docs/visual-walkthrough/images/07-branch-review.png +0 -0
  33. package/docs/visual-walkthrough/images/08-tour-reader.png +0 -0
  34. package/docs/visual-walkthrough/images/09-focused-step.png +0 -0
  35. package/docs/visual-walkthrough/images/10-deconstructed.png +0 -0
  36. package/docs/visual-walkthrough/images/11-exploration.png +0 -0
  37. package/docs/visual-walkthrough/images/12-authoring.png +0 -0
  38. package/docs/visual-walkthrough/images/13-export.png +0 -0
  39. package/docs/visual-walkthrough/images/14-vscode.png +0 -0
  40. package/docs/visual-walkthrough/images/15-cli.png +0 -0
  41. package/docs/visual-walkthrough/narrative.md +134 -0
  42. package/docs/visual-walkthrough/outline.md +52 -0
  43. package/docs/visual-walkthrough/walkthrough.bygone +340 -0
  44. package/docs/walkthrough.md +6 -101
  45. package/examples/bygone-history.bygone +11 -44
  46. package/examples/marker-focus.bygone +116 -0
  47. package/examples/navigation-lab.bygone.yaml +401 -336
  48. package/examples/tour-orientation.bygone +349 -0
  49. package/media/diff.worker.js +13 -3
  50. package/media/webview.css +1 -1
  51. package/media/webview.js +394 -319
  52. package/out/changeTour.js +865 -397
  53. package/out/deepLink.js +167 -0
  54. package/out/historyDirectory.js +66 -0
  55. package/out/standalone-main.js +20532 -16832
  56. package/out/tourCoverage.js +850 -386
  57. package/out/tourDocument.js +97 -0
  58. package/package.json +1 -1
  59. package/schemas/change-tour-source.schema.json +91 -64
  60. package/skills/pr-tour-guide/SKILL.md +144 -128
  61. package/skills/pr-tour-guide/references/expectations-and-feedback.md +57 -0
  62. package/standalone/index.html +10 -25
  63. package/web/export-bootstrap.js +62 -0
  64. package/web/export-licenses.txt +78 -0
  65. package/web/export-runtime.json +12 -0
  66. package/web/index.html +54 -47
  67. package/web/presenter.css +332 -178
  68. package/web/web-host.js +239 -137
@@ -1,11 +1,24 @@
1
1
  ---
2
2
  name: pr-tour-guide
3
- description: Act as a PR Tour Guide by generating, validating, compiling, and presenting evidence-grounded Bygone code-change tours from Git ranges. Use for requests such as "Tour this commit for me," or whenever an AI coding agent should explain a pull request, branch, commit, or code change as a guided walkthrough; create or repair a .bygone file; produce an LLM-ready Bygone change context; connect narrative claims to exact source evidence; or turn a diff into a browser-presentable review or demo. Always print the exact `bygone` CLI command to open the resulting diff, review, tour, or history view.
3
+ description: Create, repair, validate, and present Bygone code-change tours grounded in Git evidence. Use for requested guided walkthroughs of commits, branches, or pull requests, .bygone tour documents, and Bygone tour context extraction. General review preparation or documentation work does not require a tour.
4
4
  ---
5
5
 
6
6
  # PR Tour Guide
7
7
 
8
- Use Bygone as the deterministic evidence and rendering layer. Treat the language model as the narrative planner, never as the authority on Git ranges or source locations.
8
+ Create a guided reading path that connects an explanation of a change to exact
9
+ code evidence. Bygone resolves and displays that evidence; the authoring agent
10
+ is responsible for the explanation and its claims.
11
+
12
+ This skill covers tour authoring, validation, presentation, and synthetic review
13
+ branches for clean comparisons with or without a tour. It works standalone;
14
+ no writing, review, or orchestration skill is required. Existing code, maintained
15
+ docs, requirements, and PR discussion keep their roles. A tour can summarize and
16
+ link to them, but does not replace them or certify a review.
17
+
18
+ Honor an explicit request for a tour. When a broader task leaves the medium open,
19
+ a concise explanation, ordinary code links, or a synthetic branch comparison
20
+ may suffice; no tour is a valid outcome. Do not create a tour to compensate
21
+ for a defect in another artifact.
9
22
 
10
23
  ## Install this skill
11
24
 
@@ -47,7 +60,7 @@ npx skills add ./skills/pr-tour-guide -y
47
60
 
48
61
  ## Install Bygone
49
62
 
50
- This skill requires the `bygone` CLI with `tour context`, `tour schema`, `tour validate`, and `tour compile`. Install only when the user asks or when the task cannot proceed without it.
63
+ This skill uses the `bygone` CLI. Tour authoring requires `tour context`, `tour schema`, `tour validate`, and `tour compile`; a standalone synthetic branch comparison needs only `--git-diff`. Install only when the user asks or when the task cannot proceed without it.
51
64
 
52
65
  **macOS (desktop app + CLI, recommended):**
53
66
 
@@ -90,7 +103,7 @@ Verify tour support before authoring:
90
103
  bygone tour schema >/dev/null
91
104
  ```
92
105
 
93
- If neither `bygone` nor `node ./bin/bygone.js` exposes the `tour` subcommands, stop, share the install commands above, and report that the toolchain is unavailable rather than guessing.
106
+ If neither `bygone` nor `node ./bin/bygone.js` exposes the `tour` subcommands, report that tour authoring is unavailable rather than guessing. A requested standalone comparison can still proceed when `--git-diff` is supported.
94
107
 
95
108
  Do not rebuild, commit, push, publish, or open a browser unless the user requests it or the surrounding task clearly requires it.
96
109
 
@@ -134,80 +147,101 @@ Then read patches only for likely narrative-bearing files. Account explicitly fo
134
147
 
135
148
  Compiled tours and context dossiers are large because they embed source snapshots. Inspect them progressively and do not load every patch unless the narrative really needs it.
136
149
 
137
- ## Gather ticket and PR framing
138
-
139
- When available, read the ticket and PR context supplied by the user or directly
140
- linked from the change, using accessible read-only sources. Follow relevant
141
- parent-project or review links when they explain the change; keep discovery
142
- bounded to this work. Missing metadata should not block a useful code tour.
143
-
144
- Capture the facts that help a reader understand the change:
145
-
146
- - **Ticket:** identifier, title, problem and requested outcome, relevant details
147
- or acceptance criteria, creator/requester and assignee as distinct roles,
148
- creation date or relevant timeline, and its place in a parent project, epic,
149
- or larger initiative.
150
- - **PR:** number, title, URL, author, relevant creation/merge dates, associated
151
- ticket, and actual review history: who reviewed, when, their recorded outcome,
152
- and consequential feedback or resulting changes.
153
-
154
- Be explicit about whose ticket it was, who authored the PR, and who reviewed
155
- it when the sources establish those roles. Credit implementation contributors
156
- when known; PR authorship alone does not establish sole implementation credit.
157
- A requested reviewer is not an actual reviewer; a comment is not an approval. Do not assume an earlier review
158
- covers the current head or an entire multi-PR range. For stacked work, keep
159
- ticket, author, timing, and review provenance attached to the correct PR.
160
-
161
- Link the supporting ticket, PR, and review sources in the tour's narrative.
162
- Distinguish the ticket's requested outcome and the author's stated intent from
163
- behavior established by code and tests. Do not invent ownership, dates, project
164
- relationships, ticket associations, review status, or approval. Briefly disclose
165
- material gaps or conflicting context where they affect the explanation; omit
166
- irrelevant unavailable fields rather than filling the tour with placeholders.
167
-
168
- ## Plan the explanation
169
-
170
- Begin with an opening slide that summarizes the high-level context before the
171
- implementation: the problem, its place in the larger project, the ticket and
172
- PR relationship, and what this change contributes. Include relevant people,
173
- timing, and review status concisely; put detailed provenance beside the later
174
- claims it explains. If separate authored modes have independent entry points,
175
- give each enough opening context to stand on its own.
176
-
177
- Use the first scene's summary/bullets or equivalent supported narrative fields
178
- for this opening; do not invent a slide kind or metadata keys. Keep source
179
- anchors for code claims and source links for external context distinct.
180
-
181
- Identify the smallest set of reviewer questions that makes the change understandable. Organize by conceptual dependency rather than filename order. Usually move through:
182
-
183
- 1. motivation, contract, or invariant;
184
- 2. core implementation;
185
- 3. integration or side effects;
186
- 4. failure behavior and proof.
187
-
188
- Keep secondary, generated, dependency, and mechanical files in Bygone's complete Files rail unless they alter a reviewer conclusion.
150
+ ## Use existing context
151
+
152
+ Read relevant code and the supplied or directly linked docs, requirements, and
153
+ PR explanation. Keep discovery bounded to the change. Bring in only the context
154
+ needed to explain its behavior and evidence; link to the existing account for
155
+ more detail. People, dates, and review history are useful only when they affect
156
+ the explanation, not as a required inventory.
157
+
158
+ Distinguish requested behavior, an author's stated intent, and behavior supported
159
+ by implementation and tests. Label intent inferred from the diff. Do not invent
160
+ requirements, rationale, authorship, or approval; disclose material uncertainty.
161
+ If another artifact is deficient, identify that destination instead of hiding
162
+ the gap in tour prose. Tour authoring alone does not authorize editing it.
163
+
164
+ ## Choose a clean comparison, with or without a tour
165
+
166
+ A synthetic review branch is a first-class option when base-branch merges,
167
+ unrelated commits, or interleaved concerns obscure the change. Use it to keep
168
+ a shared baseline constant across before, author revision, and proposed revision,
169
+ or to decompose a change into cumulative conceptual commits. A standalone
170
+ comparison can complete the task; add a tour when narration would clarify
171
+ relationships the clean diff still leaves difficult to reconstruct.
172
+
173
+ Keep the real source endpoints and history as provenance. Create clearly named
174
+ local refs in an isolated worktree within the task's authorization, preserving
175
+ the development branch and dirty work. These are synthetic review artifacts,
176
+ not a silent substitution for a hosted review's endpoints or permission to push
177
+ or rewrite its branch. Do not invent implementation changes to fill a panel.
178
+
179
+ For a normalized comparison, retain unrelated baseline changes in every panel.
180
+ For decomposition, order cumulative commits by dependency and reviewer question.
181
+ Retain required dependencies and integration changes; label reconstructed states
182
+ and do not present the synthetic sequence as the author's actual history.
183
+
184
+ Verify intended endpoint equivalence with Git tree comparisons, or included-path
185
+ comparisons with explicit exclusions for a scoped view. Record a reconstructed
186
+ baseline's source range and transformation, replay the isolated change, and
187
+ verify that it reproduces the intended endpoint. Inspect conflict resolutions.
188
+ Verify that the final snapshot matches the real head or proposal, and disclose
189
+ intentional differences. Tree equality proves snapshot fidelity, not runtime
190
+ correctness; report untested intermediate states and reuse test results only
191
+ for equivalent code and dependencies.
192
+
193
+ Open the resulting refs with the needed number of panels:
189
194
 
190
- Let the change determine the hierarchy. A chapter is a named conceptual arc containing one or more related scenes; a scene answers one reviewer question or advances one thesis. Do not target a fixed chapter count, and do not create a chapter merely to wrap each scene. Repeated one-scene chapters usually indicate that headings are being generated from a template instead of the change's actual structure.
191
-
192
- Scale the structure proportionally:
193
-
194
- - A small commit may need one chapter and one scene.
195
- - A normal pull request often needs one to three chapters with one or more scenes in each.
196
- - A broad release or long-lived branch may need several chapters, but each boundary must mark a real conceptual transition.
197
- - Prefer merging adjacent chapters when their scenes form one argument; split a chapter only when its scenes answer materially different reviewer questions.
195
+ ```sh
196
+ bygone -C <worktree> --read-only --git-diff <before-ref> <author-ref> <proposed-ref>
197
+ ```
198
198
 
199
- These are pacing heuristics, not quotas. Preserve asymmetry when one capability deserves substantially more explanation than another.
199
+ Print the exact one-line command with real paths and refs. Report provenance
200
+ and whether the artifact is local or pushed. If adding a tour, pin its evidence
201
+ to the synthetic commits and link the real source revisions. These materialized
202
+ Git commits are distinct from the compiler's hunk-based Deconstructed stages;
203
+ do not imply they reproduce historical authorship merely because they have OIDs.
200
204
 
201
- Use these narrative constraints:
205
+ ## Plan the explanation
202
206
 
203
- - State one reviewer question or thesis per scene.
204
- - Give every chapter a coherent multi-scene arc when the material supports one; allow a single-scene chapter only when that scene is independently substantial.
205
- - Decompose scenes by conceptual need, not a fixed template; do not force every scene to use the same step count.
206
- - Prefer three to seven steps per scene.
207
- - Explain why focused code matters instead of paraphrasing syntax.
208
- - Keep summaries, bullets, annotations, and takeaways distinct; bullets that merely restate the summary are a defect.
209
- - Avoid intent, safety, performance, or runtime claims unsupported by the evidence.
210
- - Do not imply that the authored tour exhaustively reviews every changed file.
207
+ Lead with what changes for the user or system and why it matters. Use version 5
208
+ `opening: { title, summary, bullets? }` for a short orientation and
209
+ `conclusion: { title, summary, bullets? }` for what the evidence established and
210
+ what remains unresolved. Give each independently authored mode enough context
211
+ to stand alone: place its `opening` and `conclusion` inside `tours.historical`
212
+ or `tours.deconstructed`; independently authored modes do not inherit root bookends.
213
+ Restate an important expected behavior or boundary from its
214
+ existing source when useful; the opening is an explanation, not a new specification.
215
+ Never silently weaken an expectation to match the implementation.
216
+
217
+ Choose the smallest set of questions that makes the change understandable:
218
+
219
+ - A chapter groups related questions. A scene answers one question; several
220
+ steps can supply its evidence. Split for a new reasoning task, not simply
221
+ a new file or viewport. Use no fixed chapter or step count.
222
+ - Use optional v5 `chapter.summary` for one or two brief sentences that explain
223
+ what comes next and why. Omit it when no useful preview is needed: chapters
224
+ without summaries stay in the contents but are skipped as presentation and
225
+ narration stops. A list of scene titles or links is not a preview.
226
+ - Give each scene a distinct purpose. Its summary should prepare the reader for
227
+ the evidence and say what to notice. Meaningful chapter or scene titles form
228
+ the opening's generated route; do not duplicate that itinerary in prose.
229
+ - A scene boundary need not change revisions. When the comparison changes,
230
+ explain why the new revisions matter; otherwise explain the new question.
231
+ Keep reference numbers in navigation and use descriptive titles in narration.
232
+ - Connect the observable outcome to its mechanism and evidence. Explain why
233
+ focused code matters rather than paraphrasing syntax. Preserve causal links
234
+ when shortening prose and include boundaries that change the conclusion.
235
+ - Keep tests beside the behavior they support. Distinguish a test's existence
236
+ from a passing execution, and synthetic stages from real revision history.
237
+ - Add context, connections, and steps only when they add understanding. Keep
238
+ mechanical files in the complete Files rail unless they affect the argument.
239
+ Do not repeat the same point across summaries, bullets, and takeaways.
240
+
241
+ Support claims about intent, safety, performance, or runtime behavior with
242
+ appropriate evidence. A selected reading path is not an exhaustive code review.
243
+ Do not invent slide kinds or metadata keys; keep code anchors and links to
244
+ external explanations distinct.
211
245
 
212
246
  ## Author the source
213
247
 
@@ -217,14 +251,14 @@ Retrieve the current contract:
217
251
  bygone tour schema > /tmp/change-tour-source.schema.json
218
252
  ```
219
253
 
220
- Write a version 3 `.bygone` file for new tours. The legacy `.bygone.yaml`
254
+ Write a version 5 `.bygone` file for new tours. The legacy `.bygone.yaml`
221
255
  spelling remains valid when generic YAML tooling requires it. Treat the
222
256
  authored source and its compiled `.tour.json` as Git-backed, non-portable
223
257
  artifacts: pin `range.base` and `range.head` to the exact OIDs from the
224
258
  context, and keep them with the corresponding repository so Bygone can resolve
225
- those objects and live history. Versions 1 and 2 remain readable for legacy
226
- inputs; v3 is the format for independent authored modes, directory overviews,
227
- and review notes.
259
+ those objects and live history. Versions 1, 2, and 4 remain readable for legacy
260
+ inputs; v5 adds bookends, optional chapter previews, and requires a purpose for explicit directory overviews.
261
+ Version 3 is retired. The source has no `review` or ad hoc `notes` field.
228
262
 
229
263
  Set optional `windowTitle` when the tour should appear in the native window
230
264
  title — for example a pull request number (`PR-1234`) so multiple open tours
@@ -249,14 +283,14 @@ across modes.
249
283
  walkthrough scenes for context or proof. A mode-specific deconstructed scene
250
284
  may omit `stack` and endpoint `steps`: its stages, not Git history, define the
251
285
  explanation panels.
252
- - If a mode is omitted, v3 derives it from the root chapters by scene identity
286
+ - If a mode is omitted, v4 and v5 derive it from the root chapters by scene identity
253
287
  and order. Root walkthroughs and real stacks supply Historical; root
254
288
  deconstructed scenes supply Deconstructed. A root deconstructed scene enters
255
289
  Historical only when it also has explicit endpoint walkthrough `steps`; a
256
290
  real revision `stack` by itself is not that walkthrough. No cross-mode
257
291
  correspondence is inferred from filenames or narrative text.
258
292
 
259
- For a root v3 `deconstructed-diff` scene, provide both an explicit real
293
+ For a root v4 or v5 `deconstructed-diff` scene, provide both an explicit real
260
294
  revision `stack` and regular endpoint `steps`. The stack is used for the real
261
295
  Historical/Final fallback and must have the same base and final endpoints as
262
296
  the source range; the synthetic stages remain separate. A
@@ -291,11 +325,14 @@ Keep deconstructed-tour coordinates distinct:
291
325
  - When an ordinal is necessary, qualify the coordinate: "stage 2 of 4" versus "tour step 11 of 46."
292
326
  - Treat presenter-generated labels as UI context; do not repeat them in authored prose unless the distinction itself needs explanation.
293
327
 
294
- Version 3 scenes may include a directory Overview:
328
+ Use a directory overview only when its inventory answers the scene’s question.
329
+ Otherwise the viewer previews the first step without an active annotation.
330
+ Version 5 requires an explicit purpose:
295
331
 
296
332
  ```yaml
297
333
  overview:
298
334
  kind: directory-diff
335
+ purpose: See which web layers changed together before tracing their interaction.
299
336
  path: web
300
337
  ```
301
338
 
@@ -305,14 +342,11 @@ distinct stack-entry IDs or to `explanation-baseline` and
305
342
  `explanation-stage-<stage-id>`. Walkthrough overviews always use the review's
306
343
  base-to-head comparison and reject an explicit comparison.
307
344
 
308
- Use the optional v3 top-level `review` block for evidence-linked concepts,
309
- boundaries, tradeoffs, and unresolved questions instead of presenting open
310
- questions as settled scene narration. Pin `review.baseOid` and `review.headOid`
311
- to the resolved range. `concept`, `boundary`, and `tradeoff` items need at
312
- least one link to a root authored walkthrough scene and step; a `question` may
313
- have empty evidence but must provide `nextCheck`. Do not add an ad hoc `notes`
314
- key. See `examples/bygone-history.bygone` for review notes and
315
- `examples/navigation-lab.bygone.yaml` for independently authored v3 modes.
345
+ Put concepts, boundaries, and tradeoffs beside their code evidence in scene or
346
+ step narrative. Label unresolved questions explicitly and state the next check
347
+ that would resolve them. Never present an unknown as a settled conclusion.
348
+ Do not add a `review` block or an ad hoc `notes` key. See
349
+ `examples/navigation-lab.bygone.yaml` for independently authored modes.
316
350
 
317
351
  Never emit generated line numbers or hunk indexes. Verify candidate snippets against the pinned object when uncertain:
318
352
 
@@ -324,38 +358,27 @@ Use `occurrence` only when repetition is intentional and stable. Treat rename id
324
358
 
325
359
  ## Validate and repair
326
360
 
361
+ Use optional v5 `details.audience` when the intended reader and purpose are known.
362
+ Read [Expectations and reader feedback](references/expectations-and-feedback.md)
363
+ for those fields or when handling a captured reader concern.
364
+
327
365
  Always run validation before presenting or handing off:
328
366
 
329
367
  ```sh
330
368
  bygone tour validate review.bygone --json
331
369
  ```
332
370
 
333
- Repair every error. Do not weaken, delete, or redirect an anchor merely to make validation pass. If evidence no longer exists, revise the claim or report the broken premise.
334
-
335
- After structural validation, check that:
336
-
337
- Treat this as a required self-audit, not a claim the validator can prove. For each item, cite concrete evidence you actually opened or mark it not applicable; the hand-off must distinguish verified findings from interpretation.
338
-
339
- - the opening slide establishes the problem, project context, and available
340
- ticket/PR provenance before the first implementation step;
341
- - ticket ownership, dates, and actual review claims are traceable to opened
342
- sources and scoped to the PR/revision they describe;
343
- - chapter boundaries follow conceptual transitions rather than a fixed count or one-scene-per-chapter pattern;
344
- - important production behavior is not hidden in the complete Files rail;
345
- - tests are connected to the behavior they prove;
346
- - connections express causal, contractual, data-flow, ordering, or proof relationships;
347
- - binary files and omitted patches are surfaced explicitly;
348
- - every Historical tour excludes synthetic deconstructed scenes, and every
349
- Deconstructed tour contains at least one deconstructed scene;
350
- - deconstructed stages cover every included change unit exactly once or record
351
- an explicit exclusion, contain no unqualified "Stage N" or "Step N"
352
- references, and keep comparison stages distinct from navigable tour steps;
353
- - root deconstructed scenes have the required real stack and endpoint
354
- walkthrough evidence, while mode-specific synthetic scenes do not claim
355
- that evidence exists;
356
- - v3 review-note OIDs match the resolved range and evidence links resolve to
357
- authored root walkthrough steps;
358
- - the final step supplies proof or a clear reviewer conclusion.
371
+ Repair every error. Do not weaken, delete, or redirect an anchor merely to make
372
+ validation pass. If evidence no longer exists, revise the claim or report the
373
+ broken premise. Validation checks structure and evidence locations, not code
374
+ correctness or comprehension.
375
+
376
+ Read the resulting path against its evidence: does each scene establish a useful
377
+ point, do transitions preserve orientation, and does the conclusion stay within
378
+ what was shown? Check the compiled path where generated focus steps or fallback
379
+ modes could introduce repetition or change the intended sequence. Report material
380
+ omissions and checks actually performed; do not require a scored audit or a
381
+ separate reader-review process for every tour.
359
382
 
360
383
  ## Always print the open command
361
384
 
@@ -397,17 +420,10 @@ Compiled manifests contain source snapshots. Do not publish or upload them witho
397
420
 
398
421
  ## Hand off
399
422
 
400
- Report:
401
-
402
- - the exact base and head OIDs;
403
- - the **open command** for the primary artifact (`bygone present --tour …`, `bygone review …`, `bygone --git-diff …`, etc.);
404
- - the source and compiled artifact paths;
405
- - authored root and Historical/Deconstructed chapter, scene, step, and stage
406
- counts, plus compiled counts when generated complete-change or per-mode
407
- scenes change them;
408
- - omitted or unread evidence;
409
- - ticket/PR context sources used and material unavailable or conflicting context;
410
- - validation and visual verification performed;
411
- - whether generated files are temporary, uncommitted, committed, or pushed.
423
+ Provide the tour document path, compiled path if produced, exact range, and open
424
+ command. Briefly report validation, any visual verification, material omissions
425
+ or unresolved claims, and whether artifacts are temporary, uncommitted, committed,
426
+ or pushed. Do not turn the handoff into an inventory of every scene and step.
412
427
 
413
- Distinguish syntactic grounding from interpretive correctness: Bygone proves that cited evidence exists at the pinned revision, not that the narrative's interpretation is unquestionably correct.
428
+ Bygone establishes that cited evidence exists at the pinned revision, not that
429
+ the narrative interpretation or implementation is correct.
@@ -0,0 +1,57 @@
1
+ # Expectations and reader feedback
2
+
3
+ Read this reference for optional audience fields or when a reader supplies a
4
+ captured Bygone concern. General writing and review workflows can use this
5
+ skill, but are not prerequisites for authoring a tour.
6
+
7
+ ## Handle captured context
8
+
9
+ The capture identifies a passage, mode, pinned range, and authored/displayed
10
+ evidence. It is a snapshot, not proof of the current workspace state. Verify
11
+ which revision the claim concerns before editing. Synthetic panels are teaching
12
+ states, not commits; an excerpt may omit code needed to evaluate the claim.
13
+
14
+ Check the claim against relevant surrounding implementation, tests, and existing
15
+ requirements or explanations. An opening restates an expectation; it does not
16
+ establish that expectation's authority. Label inferred intent and unresolved
17
+ conflicts. Do not change the expectation merely to fit the implementation.
18
+
19
+ Answer the reader's concern and identify any artifact needing repair:
20
+
21
+ - **Implementation code:** incorrect or unnecessarily obscure behavior.
22
+ - **Maintained docs:** missing reusable concepts, usage, or architectural context.
23
+ - **PR explanation:** missing change rationale or tradeoffs.
24
+ - **Tour document:** misleading wording, missing causal links, or a poor evidence path.
25
+ - **Viewer:** navigation, focus, or comparison behavior that prevents inspection.
26
+
27
+ A disputed requirement may need a human decision; missing evidence may need a
28
+ check. A clear answer may need no saved change. Follow existing task authorization
29
+ for repairs; tour feedback alone does not authorize unrelated edits or shared
30
+ communications. Do not use extra tour prose to conceal a defect elsewhere.
31
+
32
+ When repairing a tour, keep the outcome, mechanism, and decisive evidence visible.
33
+ If an authorized implementation repair changes the intended committed range,
34
+ regenerate context, resolve affected anchors, revisit claims, and validate. If
35
+ code remains uncommitted, disclose that the pinned tour does not yet show the fix.
36
+ Historical tours can intentionally retain their original range.
37
+
38
+ Distinguish the agent's answer from edits to the saved tour document. Report the
39
+ actual repair and checks, including unresolved concerns. Validation is evidence
40
+ of structural grounding, not a demonstration of reader understanding.
41
+
42
+ ## Describe the reader
43
+
44
+ Use optional v5 `details.audience` on the root or an independently authored
45
+ `tours.historical` / `tours.deconstructed` object. If present, supply:
46
+
47
+ - `codebase`: `none`, `some`, or `maintainer`.
48
+ - `language`: `none`, `basic`, `fluent`, or `advanced`.
49
+ - `readingDemand`: `general`, `technical`, or `specialist`.
50
+ - `purpose`: `overview`, `explanation`, or `review`.
51
+ - `scope`: what this tour explains and any material limit.
52
+ - Optional `domain`: concrete prerequisites, and `estimatedMinutes`: reading time.
53
+
54
+ Independent modes describe their own readers. These fields set expectations;
55
+ they are not quality grades. Language expertise, codebase familiarity, and prose
56
+ reading demand are distinct. Do not invent an audience or reading-time estimate
57
+ merely to populate Tour details.
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; base-uri 'none'; object-src 'none'; frame-src http://127.0.0.1:*; form-action 'none'; img-src 'self' data:; font-src 'self' data:; style-src 'self' 'unsafe-inline'; script-src 'self'; worker-src 'self' blob:;">
6
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'; base-uri 'none'; object-src 'none'; frame-src http: https:; form-action 'none'; img-src 'self' data:; font-src 'self' data:; style-src 'self' 'unsafe-inline'; script-src 'self'; worker-src 'self' blob:;">
7
7
  <title>Bygone</title>
8
8
  <link href="../media/webview.css" rel="stylesheet">
9
9
  </head>
@@ -13,19 +13,14 @@
13
13
  <div id="file-info" class="header-align-diff">Choose a compare command to render a diff.</div>
14
14
  <div id="status-banner" class="status-banner header-align-diff" role="status" aria-live="polite" aria-atomic="true" hidden></div>
15
15
  <div id="directory-return-toolbar" class="directory-return-toolbar header-align-diff" hidden>
16
- <button id="back-to-directory" class="directory-return-button" type="button" title="Back to directory view (Cmd/Ctrl+[)">
16
+ <button id="back-to-directory" class="directory-return-button" type="button" title="Show directory comparison (Cmd/Ctrl+[)" aria-label="Show directory comparison">
17
17
  <svg viewBox="0 0 24 24" aria-hidden="true">
18
- <path d="M15 18l-6-6 6-6"></path>
19
- <path d="M9 12h10"></path>
18
+ <path d="M4 3v14h4M4 7h4"></path>
19
+ <rect x="8" y="4" width="12" height="6" rx="1"></rect>
20
+ <rect x="8" y="14" width="12" height="6" rx="1"></rect>
20
21
  </svg>
21
- <span>Back</span>
22
+ <span>Directory</span>
22
23
  </button>
23
- <button id="toggle-directory-sidebar" class="directory-return-button" type="button" title="Hide directory files" aria-label="Hide directory files" aria-pressed="true">
24
- <span>Files</span>
25
- </button>
26
- </div>
27
- <div id="edit-mode-toolbar" class="edit-mode-toolbar header-align-diff" hidden>
28
- <button id="toggle-readonly" class="edit-mode-button" type="button" title="Toggle read-only mode">Editing On</button>
29
24
  </div>
30
25
  <div id="change-toolbar" class="change-toolbar header-align-diff" hidden>
31
26
  <div class="change-toolbar-main">
@@ -50,21 +45,7 @@
50
45
  <path d="M6 11l6-6 6 6"></path>
51
46
  </svg>
52
47
  </button>
53
- <button id="copy-left-to-right" class="change-button change-button-primary icon-button" type="button" title="Copy current change from left to right (Cmd/Ctrl+Alt+Right)" aria-label="Copy current change from left to right">
54
- <svg viewBox="0 0 24 24" aria-hidden="true">
55
- <path d="M5 12h10"></path>
56
- <path d="M11 8l4 4-4 4"></path>
57
- <path d="M19 5v14"></path>
58
- </svg>
59
- </button>
60
48
  <div id="change-position" class="change-position" role="status" aria-live="polite" aria-atomic="true"></div>
61
- <button id="copy-right-to-left" class="change-button change-button-primary icon-button" type="button" title="Copy current change from right to left (Cmd/Ctrl+Alt+Left)" aria-label="Copy current change from right to left">
62
- <svg viewBox="0 0 24 24" aria-hidden="true">
63
- <path d="M19 12H9"></path>
64
- <path d="M13 8l-4 4 4 4"></path>
65
- <path d="M5 5v14"></path>
66
- </svg>
67
- </button>
68
49
  <button id="next-change" class="change-button change-button-primary icon-button" type="button" title="Next difference (F7 or Cmd/Ctrl+Shift+Down)" aria-label="Next difference">
69
50
  <svg viewBox="0 0 24 24" aria-hidden="true">
70
51
  <path d="M12 5v14"></path>
@@ -73,6 +54,10 @@
73
54
  </button>
74
55
  </div>
75
56
  <div class="change-toolbar-actions">
57
+ <div id="edit-mode-toolbar" class="edit-mode-toolbar" hidden>
58
+ <button id="toggle-readonly" class="edit-mode-button" type="button" title="Toggle read-only mode">Editing On</button>
59
+ </div>
60
+ <button id="toggle-pair-focus" class="change-button" type="button" title="Show only changes from the selected pair" aria-label="Focus selected pair" aria-pressed="false" hidden>Focus selected pair: Off</button>
76
61
  <button id="toggle-word-wrap" class="change-button icon-button" type="button" title="Enable line wrapping (Alt+Z)" aria-label="Enable line wrapping" aria-pressed="false" hidden>
77
62
  <svg class="word-wrap-icon-off" viewBox="0 0 24 24" aria-hidden="true">
78
63
  <path d="M4 6h13a3 3 0 0 1 0 6H9"></path>
@@ -0,0 +1,62 @@
1
+ (async function bootstrapExport() {
2
+ const status = document.getElementById('export-loading');
3
+ const urls = [];
4
+ const timer = setTimeout(() => {
5
+ if (!window.__BYGONE_EXPORT_READY__) status.textContent = 'The viewer could not finish loading. Check internet access for CDN exports, then reopen this file. An embedded export works without internet.';
6
+ }, 20000);
7
+ try {
8
+ const data = JSON.parse(document.getElementById('bygone-export-data').textContent);
9
+ if (data.version !== 1 || !['minimal', 'full'].includes(data.profile)) throw new Error('Unsupported export format.');
10
+ const hash = async value => [...new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(value)))].map(byte => byte.toString(16).padStart(2, '0')).join('');
11
+ for (const [id, text] of Object.entries(data.texts)) {
12
+ if (typeof text !== 'string' || await hash(text) !== id) throw new Error('Exported evidence integrity check failed.');
13
+ }
14
+ const identity = { profile: data.profile, manifest: { ...data.manifest, generatedAt: undefined }, texts: data.texts, history: data.history };
15
+ if (await hash(JSON.stringify(identity)) !== data.contentId) throw new Error('Exported snapshot integrity check failed.');
16
+ document.body.classList.add('export-host');
17
+ const blobUrls = new Map();
18
+ for (const asset of data.assets) {
19
+ let bytes;
20
+ if (asset.base64) bytes = Uint8Array.from(atob(asset.base64), char => char.charCodeAt(0));
21
+ else {
22
+ const response = await fetch(asset.url, { credentials: 'omit', integrity: asset.integrity, mode: 'cors' });
23
+ if (!response.ok) throw new Error(`Viewer asset unavailable (${response.status}).`);
24
+ bytes = new Uint8Array(await response.arrayBuffer());
25
+ }
26
+ const actual = btoa(String.fromCharCode(...new Uint8Array(await crypto.subtle.digest('SHA-256', bytes))));
27
+ if (`sha256-${actual}` !== asset.integrity) throw new Error('Viewer asset integrity check failed.');
28
+ const url = URL.createObjectURL(new Blob([bytes], { type: asset.name.endsWith('.css') ? 'text/css' : 'application/javascript' }));
29
+ urls.push(url); blobUrls.set(asset.name, url);
30
+ }
31
+ function hydrate(value) {
32
+ if (Array.isArray(value)) return value.map(hydrate);
33
+ if (!value || typeof value !== 'object') return value;
34
+ if (Object.keys(value).length === 1 && typeof value.$text === 'string') {
35
+ if (typeof data.texts[value.$text] !== 'string') throw new Error('Missing exported evidence.');
36
+ return data.texts[value.$text];
37
+ }
38
+ return Object.fromEntries(Object.entries(value).map(([key, child]) => [key, hydrate(child)]));
39
+ }
40
+ data.manifest = hydrate(data.manifest);
41
+ data.workers = { editor: blobUrls.get('media/editor.worker.js'), diff: blobUrls.get('media/diff.worker.js') };
42
+ window.__BYGONE_EXPORT__ = data;
43
+ for (const name of ['media/webview.css', 'web/presenter.css']) {
44
+ await new Promise((resolve, reject) => {
45
+ const link = document.createElement('link'); link.rel = 'stylesheet'; link.href = blobUrls.get(name);
46
+ link.onload = resolve; link.onerror = () => reject(new Error('Viewer styles could not load.')); document.head.append(link);
47
+ });
48
+ }
49
+ for (const name of ['web/web-host.js', 'media/webview.js']) {
50
+ await new Promise((resolve, reject) => {
51
+ const script = document.createElement('script'); script.src = blobUrls.get(name);
52
+ script.onload = resolve; script.onerror = () => reject(new Error('Viewer script could not load.')); document.body.append(script);
53
+ });
54
+ }
55
+ } catch (error) {
56
+ clearTimeout(timer);
57
+ status.textContent = `Unable to open this export: ${error.message} Reopen to retry, or request an embedded export if the network is unavailable.`;
58
+ }
59
+ window.addEventListener('pagehide', event => {
60
+ if (!event.persisted) { clearTimeout(timer); urls.forEach(url => URL.revokeObjectURL(url)); }
61
+ });
62
+ })();