@oss-autopilot/core 3.20.4 → 3.21.0
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/dist/cli-registry.js +1 -1
- package/dist/cli.bundle.cjs +98 -98
- package/dist/commands/parse-list.js +82 -33
- package/dist/commands/scout-bridge.js +1 -0
- package/dist/commands/search.js +1 -1
- package/package.json +2 -2
|
@@ -43,8 +43,9 @@ function isCompleted(line) {
|
|
|
43
43
|
// Checked checkbox: [x] or [X]
|
|
44
44
|
if (/\[x\]/i.test(line))
|
|
45
45
|
return true;
|
|
46
|
-
// "Done" marker (standalone word, case insensitive)
|
|
47
|
-
|
|
46
|
+
// "Done" marker (standalone word, case insensitive). Hyphenated
|
|
47
|
+
// continuations ("Done-ish", "well-done") are prose, not markers.
|
|
48
|
+
if (/(?<!-)\bdone\b(?!-)/i.test(line))
|
|
48
49
|
return true;
|
|
49
50
|
return false;
|
|
50
51
|
}
|
|
@@ -64,6 +65,32 @@ function firstBoldSpan(line) {
|
|
|
64
65
|
const m = line.match(/\*\*([^*]+)\*\*/);
|
|
65
66
|
return m ? m[1].trim() : null;
|
|
66
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* First bold span with leading decoration (emoji, checkmarks, punctuation)
|
|
70
|
+
* stripped, so `**✅ MERGED — re-vet...**` normalizes to `MERGED — re-vet...`.
|
|
71
|
+
*/
|
|
72
|
+
function normalizedBoldSpan(line) {
|
|
73
|
+
const span = firstBoldSpan(line);
|
|
74
|
+
if (!span)
|
|
75
|
+
return null;
|
|
76
|
+
return span.replace(/^[^\p{L}\p{N}]+/u, '');
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Match a status keyword as a PREFIX of the normalized bold span, ending at a
|
|
80
|
+
* word boundary (end of span, whitespace, or punctuation). Real curator spans
|
|
81
|
+
* look like `✅ MERGED — re-vet 2026-08-07: ...`, not a bare keyword.
|
|
82
|
+
*
|
|
83
|
+
* Curators also commonly lead with the score
|
|
84
|
+
* (`**Score 8/10 — ✅ MERGED (confirmed ...).**`), so a `Score N/10` +
|
|
85
|
+
* separator prefix is stripped before testing keywords.
|
|
86
|
+
*/
|
|
87
|
+
function spanStartsWithKeyword(line, keywords) {
|
|
88
|
+
const kw = normalizedBoldSpan(line);
|
|
89
|
+
if (!kw)
|
|
90
|
+
return false;
|
|
91
|
+
const stripped = kw.replace(/^Score\s+\d+(?:\.\d+)?\/10\s*[—–\-:.,;]?\s*/iu, '').replace(/^[^\p{L}\p{N}]+/u, '');
|
|
92
|
+
return keywords.test(stripped);
|
|
93
|
+
}
|
|
67
94
|
/**
|
|
68
95
|
* Check if a sub-bullet's first bold span is a terminal status — completed,
|
|
69
96
|
* abandoned, or being held back from pursuit (#1179). Used by
|
|
@@ -80,22 +107,27 @@ function firstBoldSpan(line) {
|
|
|
80
107
|
* explicitly parked.
|
|
81
108
|
*/
|
|
82
109
|
function isSubBulletTerminal(line) {
|
|
83
|
-
|
|
84
|
-
if (!kw)
|
|
85
|
-
return false;
|
|
86
|
-
return /^(?:Skip|Done|Dropped|Merged|Closed|Hold|Continue watch|Downgrade)$/i.test(kw);
|
|
110
|
+
return spanStartsWithKeyword(line, /^(?:Skipped|Skip|Done|Dropped|Merged|Closed|Hold|Continue watch|Downgrade)(?![\p{L}\p{N}])/iu);
|
|
87
111
|
}
|
|
88
112
|
/**
|
|
89
113
|
* Check if a sub-bullet's first bold span is a "delete-from-disk" status.
|
|
90
114
|
* Strictly the original five keywords — `pruneIssueList` mutates the
|
|
91
115
|
* markdown file in place, and a curator's `**Hold**` annotation means
|
|
92
116
|
* "park", not "delete" (#1179).
|
|
117
|
+
*
|
|
118
|
+
* Stricter than the in-memory matchers: the keyword must be followed by
|
|
119
|
+
* end-of-span or a separator character, never whitespace + another word.
|
|
120
|
+
* `**Merged upstream fix doesn't cover our case — still pursue.**` is a
|
|
121
|
+
* sentence, not a status tag; deleting on it destroys curator entries.
|
|
122
|
+
* Under-counting availability is acceptable, disk deletion is not.
|
|
93
123
|
*/
|
|
94
124
|
function isSubBulletDeletable(line) {
|
|
95
|
-
const kw =
|
|
125
|
+
const kw = normalizedBoldSpan(line);
|
|
96
126
|
if (!kw)
|
|
97
127
|
return false;
|
|
98
|
-
|
|
128
|
+
// Negative lookahead: the keyword must not continue as a hyphenated word
|
|
129
|
+
// ("Done-ish", "Merged-in-part" are hedged prose, not status tags).
|
|
130
|
+
return /^(?:Skip|Done|Dropped|Merged|Closed)(?![\p{L}\p{N}-])\s*(?:$|[—–\-:.,;()!])/iu.test(kw);
|
|
99
131
|
}
|
|
100
132
|
/**
|
|
101
133
|
* Check if a sub-bullet's first bold span is in-progress (not available,
|
|
@@ -104,10 +136,11 @@ function isSubBulletDeletable(line) {
|
|
|
104
136
|
* (#1179).
|
|
105
137
|
*/
|
|
106
138
|
function isSubBulletInProgress(line) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
139
|
+
return spanStartsWithKeyword(line, /^(?:In Progress|Waiting|Wait|Post findings first|Ship now|Viable not urgent|PR OPEN|IMPLEMENTED)(?![\p{L}\p{N}])/iu);
|
|
140
|
+
}
|
|
141
|
+
/** Leading-whitespace width with tabs expanded to two columns. */
|
|
142
|
+
function indentWidth(line) {
|
|
143
|
+
return line.match(/^\s*/)[0].replace(/\t/g, ' ').length;
|
|
111
144
|
}
|
|
112
145
|
/** Parse a markdown string into structured issue items */
|
|
113
146
|
export function parseIssueList(content) {
|
|
@@ -118,6 +151,10 @@ export function parseIssueList(content) {
|
|
|
118
151
|
let lastItem = null;
|
|
119
152
|
// Track which array the last item was placed in so sub-bullets can move it
|
|
120
153
|
let lastItemInAvailable = false;
|
|
154
|
+
// Indentation of the line that created lastItem — a line is a sub-bullet
|
|
155
|
+
// only when indented deeper than its parent (handles wholly-indented lists
|
|
156
|
+
// whose sibling items share the same indent).
|
|
157
|
+
let lastItemIndent = 0;
|
|
121
158
|
for (const line of lines) {
|
|
122
159
|
// Check for section headings (# or ##)
|
|
123
160
|
const headingMatch = line.match(/^#{1,3}\s+(.+)/);
|
|
@@ -126,32 +163,43 @@ export function parseIssueList(content) {
|
|
|
126
163
|
lastItem = null;
|
|
127
164
|
continue;
|
|
128
165
|
}
|
|
129
|
-
// Skip empty lines and non-list items
|
|
130
|
-
|
|
166
|
+
// Skip empty lines and non-list items. Bullet markers need trailing
|
|
167
|
+
// whitespace so a `**bold**`-opening paragraph isn't mistaken for a
|
|
168
|
+
// `*` bullet; each alternative is anchored to line start.
|
|
169
|
+
if (!line.trim() || !/^\s*(?:[-*+]\s|\d+\.\s|\[[ x]\])/i.test(line)) {
|
|
131
170
|
continue;
|
|
132
171
|
}
|
|
133
|
-
//
|
|
172
|
+
// Indented lines are sub-bullets and NEVER create a new item. For
|
|
173
|
+
// URL-bearing lines (merged-PR links, competitor PRs, cross-references)
|
|
174
|
+
// the line must be indented DEEPER than its parent — lines at the
|
|
175
|
+
// parent's own indent are siblings in wholly-indented lists and fall
|
|
176
|
+
// through to create items. URL-less lines can't create items anyway, so
|
|
177
|
+
// any >=2-space indent makes them sub-bullets, even at the parent's own
|
|
178
|
+
// indent (a ` - **Done**` status line beside an equally-indented item).
|
|
179
|
+
// Tabs count as two columns so `\t- ...` sub-bullets nest correctly.
|
|
180
|
+
const indent = indentWidth(line);
|
|
134
181
|
const ghUrl = extractGitHubUrl(line);
|
|
135
|
-
if (
|
|
136
|
-
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
//
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
completed.push(lastItem);
|
|
149
|
-
lastItemInAvailable = false;
|
|
150
|
-
}
|
|
182
|
+
if (lastItem && indent >= 2 && (ghUrl ? indent > lastItemIndent : true)) {
|
|
183
|
+
const score = extractScore(line);
|
|
184
|
+
if (score !== undefined) {
|
|
185
|
+
lastItem.score = score;
|
|
186
|
+
}
|
|
187
|
+
// Check if sub-bullet marks item as terminal or in-progress
|
|
188
|
+
if (lastItemInAvailable && (isSubBulletTerminal(line) || isSubBulletInProgress(line))) {
|
|
189
|
+
// Move from available to completed
|
|
190
|
+
const idx = available.indexOf(lastItem);
|
|
191
|
+
if (idx !== -1) {
|
|
192
|
+
available.splice(idx, 1);
|
|
193
|
+
completed.push(lastItem);
|
|
194
|
+
lastItemInAvailable = false;
|
|
151
195
|
}
|
|
152
196
|
}
|
|
153
197
|
continue;
|
|
154
198
|
}
|
|
199
|
+
// Skip top-level lines without a GitHub URL
|
|
200
|
+
if (!ghUrl) {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
155
203
|
const title = extractTitle(line);
|
|
156
204
|
const item = {
|
|
157
205
|
repo: ghUrl.repo,
|
|
@@ -169,6 +217,7 @@ export function parseIssueList(content) {
|
|
|
169
217
|
lastItemInAvailable = true;
|
|
170
218
|
}
|
|
171
219
|
lastItem = item;
|
|
220
|
+
lastItemIndent = indent;
|
|
172
221
|
}
|
|
173
222
|
// Dedupe by URL across both buckets (#1179). Curated lists routinely
|
|
174
223
|
// mention the same issue in multiple sections (e.g. an item under
|
|
@@ -230,7 +279,7 @@ export function pruneIssueList(content, minScore = 6) {
|
|
|
230
279
|
continue;
|
|
231
280
|
}
|
|
232
281
|
// Sub-bullet of a removed item — skip it
|
|
233
|
-
if (skipSubBullets &&
|
|
282
|
+
if (skipSubBullets && indentWidth(line) >= 2) {
|
|
234
283
|
continue;
|
|
235
284
|
}
|
|
236
285
|
skipSubBullets = false;
|
|
@@ -247,7 +296,7 @@ export function pruneIssueList(content, minScore = 6) {
|
|
|
247
296
|
// Look ahead at sub-bullets for terminal status or low score
|
|
248
297
|
let shouldRemove = false;
|
|
249
298
|
let j = i + 1;
|
|
250
|
-
while (j < lines.length &&
|
|
299
|
+
while (j < lines.length && indentWidth(lines[j]) >= 2) {
|
|
251
300
|
if (isSubBulletDeletable(lines[j])) {
|
|
252
301
|
shouldRemove = true;
|
|
253
302
|
}
|
|
@@ -105,6 +105,7 @@ export function buildScoutState(diagnostics) {
|
|
|
105
105
|
scope: config.scope,
|
|
106
106
|
excludeRepos: config.excludeRepos,
|
|
107
107
|
excludeOrgs: config.excludeOrgs ?? [],
|
|
108
|
+
preferredOrgs: config.preferredOrgs ?? [],
|
|
108
109
|
aiPolicyBlocklist: config.aiPolicyBlocklist,
|
|
109
110
|
projectCategories: config.projectCategories ?? [],
|
|
110
111
|
minStars: config.minStars,
|
package/dist/commands/search.js
CHANGED
|
@@ -52,7 +52,7 @@ export function parseSearchStrategies(raw) {
|
|
|
52
52
|
for (const token of tokens) {
|
|
53
53
|
const parsed = SearchStrategySchema.safeParse(token);
|
|
54
54
|
if (!parsed.success) {
|
|
55
|
-
throw new Error(`Unknown search strategy "${token}". Valid strategies: merged, starred, broad, maintained, all`);
|
|
55
|
+
throw new Error(`Unknown search strategy "${token}". Valid strategies: merged, orgs, starred, broad, maintained, all`);
|
|
56
56
|
}
|
|
57
57
|
strategies.push(parsed.data);
|
|
58
58
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oss-autopilot/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"description": "CLI and core library for managing open source contributions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@octokit/plugin-retry": "^8.1.1",
|
|
56
56
|
"@octokit/plugin-throttling": "^11.0.5",
|
|
57
57
|
"@octokit/rest": "^22.0.1",
|
|
58
|
-
"@oss-scout/core": "^1.
|
|
58
|
+
"@oss-scout/core": "^1.6.0",
|
|
59
59
|
"commander": "^15.0.0",
|
|
60
60
|
"zod": "^4.4.3"
|
|
61
61
|
},
|