fix: align settings docs and inventory completion matching

This commit is contained in:
Tom Boucher
2026-05-15 11:55:19 -04:00
parent 72bc456662
commit d20d3e88b5
5 changed files with 15 additions and 8 deletions

View File

@@ -231,6 +231,10 @@ describe('isCompletedInventory', () => {
expect(isCompletedInventory('unknown')).toBe(false);
});
it('returns false for "unarchived" (word-boundary guard)', () => {
expect(isCompletedInventory('unarchived')).toBe(false);
});
it('returns false for empty string', () => {
expect(isCompletedInventory('')).toBe(false);
});

View File

@@ -86,11 +86,11 @@ function toPosixPath(p: string): string {
/**
* Pure classifier: returns true if the given status string indicates a
* completed or archived workstream (case-insensitive substring match).
* completed or archived workstream (case-insensitive, boundary-aware match).
*/
export function isCompletedInventory(status: string): boolean {
const s = String(status ?? '').toLowerCase();
return s.includes('milestone complete') || s.includes('archived');
const s = String(status ?? '').trim().toLowerCase();
return /\bmilestone\s+complete\b/.test(s) || /\barchived\b/.test(s);
}
/**