mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-14 02:29:33 +01:00
fix(story-mode): "Done, with a note" not for how things were before, nor "still open" as a verb
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) <noreply@anthropic.com>
This commit is contained in:
1 parent
1dd167ebe0
commit
9ffe57709e
2 files changed
+14
-2
No files matched your search
+9
-2
@@ -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").
|
||||
/(?<!(deliberately|intentionally|purposely) )\bleft (out|open)\b(?! (on purpose|deliberately|intentionally|rather))|\b(not yet|haven't|have not|can't tell|isn't (confirmed|committed|pushed|tested|done|checked)|not (checked|tested|verified|confirmed|committed|pushed|opened|run)|still (running|working|open|missing)|didn't (open|try|check|test|run|verify) it)\b/i,
|
||||
/(?<!(deliberately|intentionally|purposely) )\bleft (out|open)\b(?! (on purpose|deliberately|intentionally|rather))|\b(not yet|haven't|have not|can't tell|isn't (confirmed|committed|pushed|tested|done|checked)|not (checked|tested|verified|confirmed|committed|pushed|opened|run)|still (running|working|open(?!\s+(the|a|an|in|on|it|them)\b)|missing)|didn't (open|try|check|test|run|verify) it)\b/i,
|
||||
],
|
||||
// A step that failed, not a description of failure ("1 for a failed operation").
|
||||
['failed', /(?<!\b(a|the|any|on) )\b(failed|fails)\b/i],
|
||||
@@ -329,8 +329,15 @@ const NO_PROBLEM =
|
||||
/\b(?:no|not an?|(?:isn't|is not|wasn't|was not|aren't) an?|without (?:any|an?)|found no|(?:couldn't|could not|didn't|did not) find (?:any|an?)|none of the)\s+(?:\S+\s+){0,2}?(?:problems?|bugs?|issues?|quirks?|caveats?|limitations?|broken)\b|\b(?:never|not|n't)\s+(?:been\s+)?broken\b/i;
|
||||
const openProblem = (s: string): boolean => (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. */
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user