@eliya-oss/agent-diff 0.1.0-alpha.161 → 0.1.0-alpha.163

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.
@@ -118,6 +118,17 @@ duration, no dimensions, no file size.
118
118
  After the prose and after `## What changed`, before anything else. A reviewer reads what changed,
119
119
  then watches it.
120
120
 
121
+ ## Check the body before it is posted
122
+
123
+ ```bash
124
+ pnpm check-body body.md
125
+ ```
126
+
127
+ Run it on the file you are about to pass to `gh pr create --body-file` or `gh pr edit --body-file`,
128
+ every time. It refuses a body that says who reported the change, places it with somebody at work,
129
+ carries a private repository or a ticket, or runs past 300 characters of prose. A body says what
130
+ changed and what it does now — never who asked for it.
131
+
121
132
  ## Nothing private, ever
122
133
 
123
134
  This repository is public and so is every attachment. `pnpm record` is safe by construction: it
@@ -209,6 +209,26 @@ The repro. Then what the fix was.
209
209
  "verified twice". CI says whether the tests pass.
210
210
  - **Anything from a private repository.** See below.
211
211
 
212
+ ### The body says what changed, and nothing about who asked
213
+
214
+ A body is the change, not its history. Two rules, and a command that enforces both:
215
+
216
+ - **Never say who reported it.** Not a name, not "a teammate", not "a user", not "somebody on the
217
+ team". Who found a defect is private to the people who found it, and it changes nothing about the
218
+ fix. Write what broke and what it does now. "Guy reported it" is the sentence this rule exists to
219
+ stop, and it reached a public PR once already.
220
+ - **Say it in 300 characters or fewer.** What changed, in the plain case, technical. Not the
221
+ investigation, not the reasoning, not what it felt like to find.
222
+
223
+ ```bash
224
+ pnpm check-body <path-to-body.md> # before every gh pr create and gh pr edit
225
+ ```
226
+
227
+ It refuses a body that names who asked, places the defect with somebody at work, carries a private
228
+ repository or a ticket, or runs past 300 characters of prose, and it proves each refusal on its own
229
+ fixtures before it reads yours. `pnpm lint` runs the same rules over every change intent, the wiki,
230
+ the PRDs, the changelog and the README, so nothing in the repository can carry them either.
231
+
212
232
  ### Nothing private, ever
213
233
 
214
234
  This repository is public, and so is every PR body, screenshot and recording attached to it. Before
@@ -218,6 +238,7 @@ you open or edit a PR, read what you wrote and confirm none of it carries:
218
238
  - a ticket id, an internal URL, a dashboard link, or an internal hostname
219
239
  - a real branch name, file path, or line of source from private work
220
240
  - a colleague's name or address, or any credential, token or key
241
+ - who reported the bug, in any words at all
221
242
 
222
243
  A screenshot leaks all of this faster than prose does, which is why **every capture runs against the
223
244
  synthetic demo repository** — `scripts/simulate.ts` builds a repo of invented invitation code with
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.163
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(repo): `pnpm check-body` refuses a pull request body that says who reported a change, carries a private repository or ticket, or runs past 300 characters of prose, and `pnpm lint` holds every change intent, wiki page, PRD, the changelog and the README to the same rules.
8
+
9
+ ## 0.1.0-alpha.162
10
+
11
+ ### Patch Changes
12
+
13
+ - fix(layers): Marking a file read on one layer no longer marks it read on the others. Where several layers claim one file, `m` records the layer's own runs, and the file counts as read once every layer's runs of it are read.
14
+
3
15
  ## 0.1.0-alpha.161
4
16
 
5
17
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9244,6 +9244,7 @@ var init_model$6 = __esmMin((() => {
9244
9244
  emptyBranchState = {
9245
9245
  taken: {},
9246
9246
  vouches: {},
9247
+ parts: {},
9247
9248
  consumed: 0,
9248
9249
  settled: {},
9249
9250
  removed: {},
@@ -9303,6 +9304,7 @@ var init_schema = __esmMin((() => {
9303
9304
  BranchState = Struct({
9304
9305
  taken: optionalKey(Record(String$1, String$1)),
9305
9306
  vouches: Stamps.pipe(noStamps),
9307
+ parts: Stamps.pipe(noStamps),
9306
9308
  consumed: Int.pipe(withDecodingDefaultKey(succeed$1(0))),
9307
9309
  settled: Stamps.pipe(noStamps),
9308
9310
  removed: Stamps.pipe(noStamps),
@@ -10458,7 +10460,7 @@ var init_git = __esmMin((() => {
10458
10460
  }));
10459
10461
  //#endregion
10460
10462
  //#region src/domain/review/vouch.ts
10461
- var isVouched, vouch;
10463
+ var isVouched, vouch, partOf, isPartVouched, vouchPart;
10462
10464
  var init_vouch = __esmMin((() => {
10463
10465
  isVouched = (vouches, path, blob) => vouches[path] === blob;
10464
10466
  vouch = (vouches, path, blob) => {
@@ -10471,6 +10473,11 @@ var init_vouch = __esmMin((() => {
10471
10473
  [path]: blob
10472
10474
  };
10473
10475
  };
10476
+ partOf = (path, runs) => {
10477
+ return `${path}@${[...runs].toSorted((left, right) => left.start - right.start || left.end - right.end).map((run) => `${run.start}-${run.end}`).join(",")}`;
10478
+ };
10479
+ isPartVouched = (vouches, part, blob) => vouches[part] === blob;
10480
+ vouchPart = (vouches, part, blob) => vouch(vouches, part, blob);
10474
10481
  }));
10475
10482
  //#endregion
10476
10483
  //#region src/domain/review/index.ts
@@ -10570,7 +10577,7 @@ var init_error = __esmMin((() => {
10570
10577
  }));
10571
10578
  //#endregion
10572
10579
  //#region src/cli/commands.ts
10573
- var realOf, CONTEXT, POLL, AUTO, askedFor$1, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, waitingOn, summaryOf, summaryFor, listBranches, blobOf, vouchIn, toggleVouch, readingOf, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, whereItSitsNow$1, sentIn, listSent, anchorIn, commentsIn, commentIn, submitComment, submitComments, without$2, submitReply, listPatches, patchIn, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, readPreferences, readPreference, ON, OFF, preferenceValue, savePreference, listRefs, setBase, clearBase, markRead;
10580
+ var realOf, CONTEXT, POLL, AUTO, askedFor$1, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, waitingOn, summaryOf, summaryFor, listBranches, readParts, blobOf, vouchIn, toggleVouch, readingOf, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, whereItSitsNow$1, sentIn, listSent, anchorIn, commentsIn, commentIn, submitComment, submitComments, without$2, submitReply, listPatches, patchIn, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, readPreferences, readPreference, ON, OFF, preferenceValue, savePreference, listRefs, setBase, clearBase, markRead;
10574
10581
  var init_commands = __esmMin((() => {
10575
10582
  init_dist();
10576
10583
  init_patch();
@@ -10710,6 +10717,10 @@ var init_commands = __esmMin((() => {
10710
10717
  const worktrees = yield* (yield* Git).worktrees(repo);
10711
10718
  return (yield* forEach(worktrees, (found) => summaryOf(repo, found, base), { concurrency: 8 })).filter((summary) => summary.files > 0);
10712
10719
  });
10720
+ readParts = (parts, files) => {
10721
+ const blobs = new Map(files.map((file) => [file.path, file.blob]));
10722
+ return Object.entries(parts).filter(([part, blob]) => blobs.get(part.split("@")[0] ?? "") === blob).map(([part]) => part);
10723
+ };
10713
10724
  blobOf = (patches, file) => map$4(findPatch(patches, file), (patch) => patch.blob);
10714
10725
  vouchIn = fn("Cli.vouchIn")(function* (reading, file) {
10715
10726
  const store = yield* Store;
@@ -10727,11 +10738,13 @@ var init_commands = __esmMin((() => {
10727
10738
  ...was,
10728
10739
  vouches: vouch(was.vouches, file, blob)
10729
10740
  }));
10741
+ const files = patches.map((patch) => ({
10742
+ path: patch.path,
10743
+ blob: patch.blob
10744
+ }));
10730
10745
  return {
10731
- vouched: patches.map((patch) => ({
10732
- path: patch.path,
10733
- blob: patch.blob
10734
- })).filter((one) => isVouched(next, one.path, one.blob)).map((one) => one.path),
10746
+ vouched: files.filter((one) => isVouched(next, one.path, one.blob)).map((one) => one.path),
10747
+ parts: readParts(current.parts, files),
10735
10748
  total: patches.length
10736
10749
  };
10737
10750
  });
@@ -10747,11 +10760,13 @@ var init_commands = __esmMin((() => {
10747
10760
  });
10748
10761
  progressIn = fn("Cli.progressIn")(function* (reading) {
10749
10762
  const current = yield* (yield* Store).state(reading.worktree.path);
10763
+ const files = reading.patches.map((patch) => ({
10764
+ path: patch.path,
10765
+ blob: patch.blob
10766
+ }));
10750
10767
  return {
10751
- vouched: reading.patches.map((patch) => ({
10752
- path: patch.path,
10753
- blob: patch.blob
10754
- })).filter((file) => isVouched(current.vouches, file.path, file.blob)).map((f) => f.path),
10768
+ vouched: files.filter((file) => isVouched(current.vouches, file.path, file.blob)).map((f) => f.path),
10769
+ parts: readParts(current.parts, files),
10755
10770
  total: reading.patches.length
10756
10771
  };
10757
10772
  });
@@ -11328,7 +11343,7 @@ var init_pane = __esmMin((() => {
11328
11343
  //#region package.json
11329
11344
  init_drafts();
11330
11345
  init_pane();
11331
- var version$1 = "0.1.0-alpha.161";
11346
+ var version$1 = "0.1.0-alpha.163";
11332
11347
  //#endregion
11333
11348
  //#region src/cli/upgrade.ts
11334
11349
  var PACKAGE, TAG, RELEASES, REGISTRY, ASK_MS, RUN_MS, CELLAR, COMPILED, INSTALLED, BUN_GLOBAL, routeOf, ROUTES, asRoute, checkoutOf, assetOf, commandFor, NOTES, RUNNABLE, NUMBERS, numbersIn, compare$1, partsOf$1, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, SAY_SKILL_TOO, upgradeReport;
@@ -11888,13 +11903,14 @@ var init_layers$1 = __esmMin((() => {
11888
11903
  }));
11889
11904
  //#endregion
11890
11905
  //#region src/cli/layers.ts
11891
- var STALE_ADVICE, unique, spansOfLayer, tidyPath, spanFault, blockFault, codeBlockOf, tidyBlock, blocksOf, layerFault, layerOf, parsed, readLayers, fromStored, toStored, reportedLayers, reportOf, resolve$1, resolveAll, worktreeAt, storedLayers, setLayers, showLayers, layersIn;
11906
+ var STALE_ADVICE, unique, spansOfLayer, tidyPath, spanFault, blockFault, codeBlockOf, tidyBlock, blocksOf, layerFault, layerOf, parsed, readLayers, fromStored, toStored, reportedLayers, reportOf, resolve$1, resolveAll, worktreeAt, storedLayers, setLayers, showLayers, layersIn, partsOfFile, vouchPartIn;
11892
11907
  var init_layers = __esmMin((() => {
11893
11908
  init_dist();
11894
11909
  init_layers$1();
11895
11910
  init_git();
11896
11911
  init_store();
11897
11912
  init_commands();
11913
+ init_review();
11898
11914
  init_error();
11899
11915
  STALE_ADVICE = "These layers describe an older commit. Read the diff again and write a new revision with layers set.";
11900
11916
  unique = (paths) => [...new Set(paths)];
@@ -12097,6 +12113,30 @@ var init_layers = __esmMin((() => {
12097
12113
  summary: found.value.summary
12098
12114
  };
12099
12115
  });
12116
+ partsOfFile = (layers, file) => layers.map((layer) => layer.spans.filter((span) => span.path === file)).filter((spans) => spans.length > 0).map((spans) => partOf(file, spans));
12117
+ vouchPartIn = fn("Cli.vouchPartIn")(function* (reading, file, part) {
12118
+ const store = yield* Store;
12119
+ const blob = reading.patches.find((one) => one.path === file)?.blob ?? "";
12120
+ const held = yield* layersIn(reading);
12121
+ const wanted = partsOfFile(held.layers, file);
12122
+ const current = yield* store.state(reading.worktree.path);
12123
+ const parts = vouchPart(current.parts, part, blob);
12124
+ const vouches = (wanted.length > 0 && wanted.every((one) => isPartVouched(parts, one, blob))) === isVouched(current.vouches, file, blob) ? current.vouches : vouch(current.vouches, file, blob);
12125
+ yield* store.changeState(reading.worktree.path, (was) => ({
12126
+ ...was,
12127
+ parts,
12128
+ vouches
12129
+ }));
12130
+ const files = reading.patches.map((one) => ({
12131
+ path: one.path,
12132
+ blob: one.blob
12133
+ }));
12134
+ return {
12135
+ vouched: files.filter((one) => isVouched(vouches, one.path, one.blob)).map((one) => one.path),
12136
+ parts: readParts(parts, files),
12137
+ total: reading.patches.length
12138
+ };
12139
+ });
12100
12140
  }));
12101
12141
  //#endregion
12102
12142
  //#region src/cli/threads.ts
@@ -13947,11 +13987,12 @@ var init_tree = __esmMin((() => {
13947
13987
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
13948
13988
  };
13949
13989
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
13950
- })), HOLDS, chosenNow, withChosen, preferenceRows, nothingReviewed, nothingFound, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, kept, layerHolds, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, NOTHING_LEFT, textRows, emptyRows, layerBody, holdsCursor, layerCard, layerRows, nearFirst, layerFitted, restingAt, railTop, PANE_CHROME$1, layerRoomIn, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, MINUTE, HOUR, DAY, sinceThen, threadStand, STAND_WEIGHT, louder, threadsOn, hiddenLines, rowsUnder, markedStands, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, remarkAnswering, answerTarget, replyTarget, threadReplying, VOICES, remarkQuote, threadQuote, pickedText, takenRows, selectedLines, shownMatches, refsShown, picking, refHere, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, needingRowsIn, commentRowsIn, threadsAtRow, remarkShown, remarksAtRow, remarkRowsIn, stopsIn, stopsAtRow, remarkAtStop, remarkAtRow, remarkInPanel, remarkInDiff, remarkUnderCursor, remarkToTakeOn, remarkHere, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, sectionOf, sentEntry, remarkRows, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
13990
+ })), HOLDS, chosenNow, withChosen, preferenceRows, nothingReviewed, nothingFound, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, kept, layerHolds, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, NOTHING_LEFT, textRows, emptyRows, layerBody, holdsCursor, layerCard, layerRows, nearFirst, layerFitted, restingAt, railTop, PANE_CHROME$1, layerRoomIn, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, partHere, layersHolding, readIn, treeStart, treeWindow, MINUTE, HOUR, DAY, sinceThen, threadStand, STAND_WEIGHT, louder, threadsOn, hiddenLines, rowsUnder, markedStands, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, remarkAnswering, answerTarget, replyTarget, threadReplying, VOICES, remarkQuote, threadQuote, pickedText, takenRows, selectedLines, shownMatches, refsShown, picking, refHere, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, needingRowsIn, commentRowsIn, threadsAtRow, remarkShown, remarksAtRow, remarkRowsIn, stopsIn, stopsAtRow, remarkAtStop, remarkAtRow, remarkInPanel, remarkInDiff, remarkUnderCursor, remarkToTakeOn, remarkHere, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, sectionOf, sentEntry, remarkRows, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
13951
13991
  var init_model$1 = __esmMin((() => {
13952
13992
  init_dist();
13953
13993
  init_patch();
13954
13994
  init_preferences();
13995
+ init_review();
13955
13996
  init_gaps();
13956
13997
  init_tree();
13957
13998
  HOLDS = {
@@ -14033,6 +14074,7 @@ var init_model$1 = __esmMin((() => {
14033
14074
  returnTo: "branches",
14034
14075
  closed: [],
14035
14076
  vouched: [],
14077
+ partsRead: [],
14036
14078
  sent: [],
14037
14079
  remarks: [],
14038
14080
  viewport: 20,
@@ -14155,7 +14197,7 @@ var init_model$1 = __esmMin((() => {
14155
14197
  text: clip(name, room),
14156
14198
  lead: false,
14157
14199
  fileIndex: at,
14158
- reviewed: isReviewed(state, at),
14200
+ reviewed: readIn(state, layerIndex, at),
14159
14201
  here: at === state.patchIndex && layerIndex === state.layerIndex
14160
14202
  };
14161
14203
  };
@@ -14182,7 +14224,7 @@ var init_model$1 = __esmMin((() => {
14182
14224
  layerRead = (state, layerIndex) => {
14183
14225
  const files = layerHolds(state, layerIndex);
14184
14226
  return {
14185
- done: files.filter((at) => isReviewed(state, at)).length,
14227
+ done: files.filter((at) => readIn(state, layerIndex, at)).length,
14186
14228
  all: files.length
14187
14229
  };
14188
14230
  };
@@ -14304,6 +14346,19 @@ var init_model$1 = __esmMin((() => {
14304
14346
  const patch = state.patches[fileIndex];
14305
14347
  return patch !== void 0 && state.vouched.includes(patch.path);
14306
14348
  };
14349
+ partHere = (state, layerIndex, fileIndex) => {
14350
+ const path = state.patches[fileIndex]?.path;
14351
+ const layer = state.layers[layerIndex];
14352
+ if (path === void 0 || layer === void 0) return void 0;
14353
+ const spans = layer.spans.filter((span) => span.path === path);
14354
+ return spans.length === 0 ? void 0 : partOf(path, spans);
14355
+ };
14356
+ layersHolding = (state, fileIndex) => state.layers.filter((layer) => layer.spans.some((span) => span.path === state.patches[fileIndex]?.path)).length;
14357
+ readIn = (state, layerIndex, fileIndex) => {
14358
+ if (isReviewed(state, fileIndex)) return true;
14359
+ const part = partHere(state, layerIndex, fileIndex);
14360
+ return part !== void 0 && state.partsRead.includes(part);
14361
+ };
14307
14362
  treeStart = (state, height) => {
14308
14363
  const rows = treeRows(state);
14309
14364
  if (rows.length <= height) return 0;
@@ -16739,9 +16794,10 @@ var init_reduce = __esmMin((() => {
16739
16794
  ...state,
16740
16795
  source
16741
16796
  });
16742
- withVouched = (state, vouched) => ({
16797
+ withVouched = (state, vouched, parts) => ({
16743
16798
  ...state,
16744
- vouched
16799
+ vouched,
16800
+ partsRead: parts ?? state.partsRead
16745
16801
  });
16746
16802
  restoredTo = (state, path, line, offset) => {
16747
16803
  const index = state.patches.findIndex((patch) => patch.path === path);
@@ -21118,25 +21174,31 @@ var init_app = __esmMin((() => {
21118
21174
  const branch = selectedBranch(this.state);
21119
21175
  const patch = selectedPatch(this.state);
21120
21176
  if (branch === void 0 || patch === void 0) return;
21121
- if (advance && isReviewed(this.state, this.state.patchIndex)) {
21177
+ if (advance && this.readHere()) {
21122
21178
  this.commit(alongFrom(this.state));
21123
21179
  return;
21124
21180
  }
21125
21181
  const report = yield* this.vouching(branch.branch, patch.path);
21126
- const marked = report.vouched.includes(patch.path);
21127
- const next = withVouched(this.state, report.vouched);
21182
+ const next = withVouched(this.state, report.vouched, report.parts);
21128
21183
  if (!advance) {
21129
- this.commit(withNotice(next, marked ? `marked ${patch.path}` : `unmarked ${patch.path}`));
21130
- return;
21131
- }
21132
- const target = nextUnreviewed(next, next.patchIndex);
21133
- if (target === void 0) {
21134
- this.commit(withNotice(next, "every file reviewed"));
21184
+ this.commit(withNotice(next, this.markedSaid(report, patch.path)));
21135
21185
  return;
21136
21186
  }
21137
- this.commit(withNotice(atFile(next, target), `marked ${patch.path}`));
21187
+ this.movedOn(next, patch.path);
21138
21188
  });
21139
21189
  }
21190
+ markedSaid(report, path) {
21191
+ const part = this.partHereNow();
21192
+ return (part === void 0 ? report.vouched.includes(path) : report.parts.includes(part)) ? `marked ${path}` : `unmarked ${path}`;
21193
+ }
21194
+ movedOn(next, path) {
21195
+ const target = nextUnreviewed(next, next.patchIndex);
21196
+ if (target === void 0) {
21197
+ this.commit(withNotice(next, "every file reviewed"));
21198
+ return;
21199
+ }
21200
+ this.commit(withNotice(atFile(next, target), `marked ${path}`));
21201
+ }
21140
21202
  forgetLeaving() {
21141
21203
  if (this.leaving === void 0) return;
21142
21204
  this.leaving = void 0;
@@ -21183,13 +21245,22 @@ var init_app = __esmMin((() => {
21183
21245
  const worktree = this.worktreeFor(branch);
21184
21246
  return worktree === void 0 ? removeComment(this.repo, branch, id, at) : removeIn(worktree, id, at);
21185
21247
  }
21248
+ readHere() {
21249
+ return onLayers(this.state) ? readIn(this.state, this.state.layerIndex, this.state.patchIndex) : isReviewed(this.state, this.state.patchIndex);
21250
+ }
21251
+ partHereNow() {
21252
+ if (!onLayers(this.state) || layersHolding(this.state, this.state.patchIndex) < 2) return;
21253
+ return partHere(this.state, this.state.layerIndex, this.state.patchIndex);
21254
+ }
21186
21255
  vouching(branch, file) {
21187
21256
  const held = this.reading;
21188
- return held === void 0 || held.worktree.branch !== branch ? toggleVouch({
21257
+ if (held === void 0 || held.worktree.branch !== branch) return toggleVouch({
21189
21258
  repo: this.repo,
21190
21259
  branch,
21191
21260
  file
21192
- }) : vouchIn(held, file);
21261
+ });
21262
+ const part = this.partHereNow();
21263
+ return part === void 0 ? vouchIn(held, file) : vouchPartIn(held, file, part);
21193
21264
  }
21194
21265
  loadSent(branch) {
21195
21266
  const reading = this.reading;
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "bin": {
24
24
  "adiff": "./bin/adiff.js"
25
25
  },
26
- "version": "0.1.0-alpha.161",
26
+ "version": "0.1.0-alpha.163",
27
27
  "description": "Review the work an agent left you without losing the thread: comments live on the lines, the agent answers them, and each point stays open until you settle it.",
28
28
  "license": "MIT",
29
29
  "repository": {
@@ -43,7 +43,8 @@
43
43
  "check": "pnpm run typecheck && pnpm run lint && pnpm run build && pnpm test",
44
44
  "build": "rolldown -c rolldown.config.ts",
45
45
  "typecheck": "tsc --noEmit",
46
- "lint": "oxlint && node scripts/check-rules.ts && node scripts/check-film.ts",
46
+ "lint": "oxlint && node scripts/check-rules.ts && node scripts/check-film.ts && node scripts/check-public.ts",
47
+ "check-body": "node --experimental-ffi --disable-warning=ExperimentalWarning scripts/check-public.ts",
47
48
  "test": "NODE_OPTIONS=--experimental-ffi vitest run",
48
49
  "test:watch": "NODE_OPTIONS=--experimental-ffi vitest",
49
50
  "dev": "node --experimental-ffi --disable-warning=ExperimentalWarning src/main.ts",