neurastream 0.2.85 → 0.2.86
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 +1 -1
- package/src/core/queue/lib.ts +12 -3
package/package.json
CHANGED
package/src/core/queue/lib.ts
CHANGED
|
@@ -1159,8 +1159,11 @@ export function openWaits(p: Plan, plans: Plan[], rank: Map<string, number>): nu
|
|
|
1159
1159
|
// result, or queue-check fails the plan; entries without a date or dated before it are grandfathered.
|
|
1160
1160
|
export const DONE_CLAIM_SINCE = "2026-11-01";
|
|
1161
1161
|
|
|
1162
|
-
|
|
1162
|
+
// "Done check" is a plan section name, not a claim.
|
|
1163
|
+
const DONE_WORD_SRC = String.raw`(?:done(?!\s+check)|completed?|nothing left|finished)`;
|
|
1163
1164
|
const NOT_DONE = /\b(?:not|never)\s+(?:done|completed?|finished)\b/i;
|
|
1165
|
+
// A reviewer's PLAN/CODE REVIEW entry critiques a plan; it claims no phase done.
|
|
1166
|
+
const REVIEW_ENTRY = /\b(?:PLAN|CODE) REVIEW:/;
|
|
1164
1167
|
const RESULT_MARK = /\bexit(?: code|ed)?\s*\d|\b\d+ pass|\b\d+ fail|\bpass(?:ed|ing)?\b|\bfail(?:ed|ing)?\b|\bresult\b/i;
|
|
1165
1168
|
|
|
1166
1169
|
/** Progress entries: the "- " line plus the lines up to the next entry start (trimProgressBody's rule). */
|
|
@@ -1177,6 +1180,12 @@ function progressEntryBlocks(text: string): string[] {
|
|
|
1177
1180
|
return blocks;
|
|
1178
1181
|
}
|
|
1179
1182
|
|
|
1183
|
+
/** Phase ids the entry says are done: a done word within 40 characters of the id, in the same sentence. */
|
|
1184
|
+
function claimedPhases(entry: string): string[] {
|
|
1185
|
+
const ids = new Set([...entry.matchAll(/\b(P\d+[a-z]?)\b/g)].map(m => m[1]!));
|
|
1186
|
+
return [...ids].filter(id => new RegExp(String.raw`\b${id}\b[^.;\n]{0,40}\b${DONE_WORD_SRC}\b|\b${DONE_WORD_SRC}\b[^.;\n]{0,40}\b${id}\b`, "i").test(entry)).map(id => id.toUpperCase());
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1180
1189
|
/** A dated done claim about phase Pn must quote Pn's verify (or the Done check) with its result; else one problem per entry. */
|
|
1181
1190
|
function doneClaimProblems(p: Plan): QueueProblem[] {
|
|
1182
1191
|
const probs: QueueProblem[] = [];
|
|
@@ -1188,8 +1197,8 @@ function doneClaimProblems(p: Plan): QueueProblem[] {
|
|
|
1188
1197
|
}
|
|
1189
1198
|
for (const entry of progressEntryBlocks(p.text)) {
|
|
1190
1199
|
const date = /^- (\d{4}-\d{2}-\d{2})/.exec(entry)?.[1];
|
|
1191
|
-
if (!date || date < DONE_CLAIM_SINCE ||
|
|
1192
|
-
const ids =
|
|
1200
|
+
if (!date || date < DONE_CLAIM_SINCE || REVIEW_ENTRY.test(entry.split("\n")[0]!) || NOT_DONE.test(entry)) continue;
|
|
1201
|
+
const ids = claimedPhases(entry);
|
|
1193
1202
|
if (!ids.length) continue;
|
|
1194
1203
|
const backings = [...new Set(ids.flatMap(id => verifies.get(id) ?? []))];
|
|
1195
1204
|
if (p.doneCheck) backings.push(p.doneCheck);
|