diff --git a/src/story-mode.ts b/src/story-mode.ts index 228a6629..aac6f421 100644 --- a/src/story-mode.ts +++ b/src/story-mode.ts @@ -304,7 +304,7 @@ const KEY_KINDS: Array<[StoryKeyKind, RegExp]> = [ [ 'pending', // "Left out" is open work, unless Claude chose it ("left out on purpose", "rather than guessed"). - /(? (NOT_FIXED.test(s) || !PROBLEM_CLOSED.test(s)) && !NO_PROBLEM.test(s); /** A sentence's kind: the first that matches, where a problem must still be open. */ +/** A sentence about how things were before the change ("Before, an early idle could end a wait"). */ +const HISTORY = /^(before|previously|until now|in the past|originally)\b,?|\bused to\b/i; const sentenceKind = (s: string): StoryKeyKind | undefined => - KEY_KINDS.find(([kind, re]) => re.test(s) && (kind !== 'problem' || openProblem(s)))?.[0]; + KEY_KINDS.find( + ([kind, re]) => + re.test(s) && + (kind !== 'problem' || openProblem(s)) && + ((kind !== 'problem' && kind !== 'pending') || !HISTORY.test(s)) + )?.[0]; /** A sentence that only points elsewhere ("described below"): nothing a balloon can show. */ const POINTS_ELSEWHERE = /\b(described|listed|shown|details?) below\b|\bsee below\b|\bas follows\b/i; /** The fix that follows a problem sentence: then the problem is not open. */ diff --git a/test/story-mode.test.ts b/test/story-mode.test.ts index 70884e06..1b6ea4cc 100644 --- a/test/story-mode.test.ts +++ b/test/story-mode.test.ts @@ -1041,6 +1041,11 @@ describe('buildStoryPage', () => { 'The memory warning now fires at 90 percent.', ]) expect(['problem'], closed).not.toContain(keyKindOf(closed)); + // How things were before, and "still open" as a verb, are no open work. + expect(keyKindOf('Before, that early idle could end a wait while the turn was still running.')).toBeUndefined(); + expect(keyKindOf('The old menu used to break when the list was empty.')).toBeUndefined(); + expect(keyKindOf('JSON files still open the live log viewer, as intended.')).toBeUndefined(); + expect(keyKindOf('Two reviews are still open.')).toBe('pending'); // "Left out" is open work, unless Claude chose it. expect(keyKindOf('The README update is left out for now.')).toBe('pending'); expect(