From 9ffe57709ecb8eb2a0dde9982725777eb8e33eab Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Sun, 18 Oct 2026 16:50:55 +0200 Subject: [PATCH] fix(story-mode): "Done, with a note" not for how things were before, nor "still open" as a verb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A sample of the 308 real pages titled "Done, with a note" read as open work in about nine of ten. The rest were history ("Before, that early idle could end a wait…", "used to") or "still open" as a verb ("JSON files still open the live log viewer, as intended"). Neither counts as something not done any more, and a history sentence is no open problem either. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/story-mode.ts | 11 +++++++++-- test/story-mode.test.ts | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) 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(