@bendyline/gezel-script-stdlib 1.1.13 → 1.1.15
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.
- package/package.json +2 -2
- package/scripts/checkFixReview.ts +30 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bendyline/gezel-script-stdlib",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.15",
|
|
4
4
|
"description": "Gezel's standard script library: trusted, read-only scripts that check and support craftbook steps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"!scripts/**/*.test.ts"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@bendyline/gezel-sdk": "1.1.
|
|
44
|
+
"@bendyline/gezel-sdk": "1.1.15"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^24.13.3",
|
|
@@ -102,6 +102,35 @@ function looksLikeCitedFile(token: string): boolean {
|
|
|
102
102
|
return CITED_FILE_EXTENSIONS.has(ext);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
/** A File cell that names no file: the finding is about the whole change. */
|
|
106
|
+
const NO_FILE_CELL =
|
|
107
|
+
/^(?:n\/?a|none|all|all files|various|multiple|general|overall|global|everywhere|project-wide|repo-wide|-|—|–)$/i;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The files a findings-table File cell cites. Reviewers write "N/A",
|
|
111
|
+
* "All Files", "src/a.js, src/b.js", "`src/a.js` [2]" or "src/a.js (helper)",
|
|
112
|
+
* and reading the whole cell as one path reported each of those as a
|
|
113
|
+
* fabricated file: 6 Gemma stepwise trials in one round (2026-11-01).
|
|
114
|
+
*/
|
|
115
|
+
function fileCellPaths(cell: string): string[] {
|
|
116
|
+
const bare = cell
|
|
117
|
+
.replace(/\[\d{1,3}(?:\s*[-–,]\s*\d{1,3})*\]/g, ' ')
|
|
118
|
+
.replace(/\([^)]*\)/g, ' ')
|
|
119
|
+
.replace(/<br\s*\/?>/gi, ',');
|
|
120
|
+
if (NO_FILE_CELL.test(bare.trim())) return [];
|
|
121
|
+
return bare
|
|
122
|
+
.split(/[,;&]|\band\b/)
|
|
123
|
+
.flatMap((part) => part.trim().split(/\s+/))
|
|
124
|
+
.map((token) => normPath(token).replace(/:\d+(?:-\d+)?$/, ''))
|
|
125
|
+
.filter(
|
|
126
|
+
(p) =>
|
|
127
|
+
p !== '' &&
|
|
128
|
+
!NO_FILE_CELL.test(p) &&
|
|
129
|
+
!/[{}*?]/.test(p) &&
|
|
130
|
+
(p.includes('/') || looksLikeCitedFile(p)),
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
105
134
|
/** Strip citation decoration so `./src/x.ts`, `a/src/x.ts`, `src/x.ts` compare equal. */
|
|
106
135
|
function normPath(p: string): string {
|
|
107
136
|
return p
|
|
@@ -255,8 +284,7 @@ if (!reviewPath) {
|
|
|
255
284
|
// must resolve somewhere real.
|
|
256
285
|
const cited = new Set<string>();
|
|
257
286
|
for (const r of rows) {
|
|
258
|
-
const
|
|
259
|
-
if (cell && cell !== '-' && cell !== '—') cited.add(cell);
|
|
287
|
+
for (const path of fileCellPaths(r.file)) cited.add(path);
|
|
260
288
|
}
|
|
261
289
|
for (const m of report.matchAll(/`([^`\s]+?\.[A-Za-z0-9]{1,8})(?::\d+(?:-\d+)?)?`/g)) {
|
|
262
290
|
const p = m[1];
|