diff --git a/artifacts/governance/status-truth-map.json b/artifacts/governance/status-truth-map.json index 938d7839f7..5be938b355 100644 --- a/artifacts/governance/status-truth-map.json +++ b/artifacts/governance/status-truth-map.json @@ -1,5 +1,5 @@ { - "generatedAt": "2026-05-29T05:04:33.848Z", + "generatedAt": "2026-05-29T05:05:17.186Z", "schemaVersion": "1.0.0", "components": [ { diff --git a/scripts/verify-status-truth.ts b/scripts/verify-status-truth.ts index 68bc263bde..e20f9b79e3 100644 --- a/scripts/verify-status-truth.ts +++ b/scripts/verify-status-truth.ts @@ -23,8 +23,20 @@ const docs = { target: readFileSync("docs/architecture/target-state.md", "utf8"), }; -const rawFiles = execSync('find src test docs .github/workflows scripts -type f').toString('utf8').trim(); -const files = rawFiles ? rawFiles.split('\n') : []; +let rawFiles = ""; +try { + rawFiles = execSync("git ls-files src test docs .github/workflows scripts") + .toString("utf8") + .trim(); +} catch (e) { + // fallback if git is not available or path is wrong + try { + rawFiles = execSync("find src test docs .github/workflows scripts -type f") + .toString("utf8") + .trim(); + } catch (e2) {} +} +const files = rawFiles ? rawFiles.split("\n") : []; const hasFile = (pattern: RegExp) => files.some((f) => pattern.test(f)); const components: Component[] = [ diff --git a/src/lib/adapters/openshell/client.test.ts b/src/lib/adapters/openshell/client.test.ts index 26ed372da1..82284fa440 100644 --- a/src/lib/adapters/openshell/client.test.ts +++ b/src/lib/adapters/openshell/client.test.ts @@ -50,36 +50,30 @@ function exitWithCode(code: number): never { describe("openshell helpers", () => { describe("stripAnsi", () => { - it("strips basic color codes", () => { + it("strips simple ANSI color codes", () => { expect(stripAnsi("\u001b[32mConnected\u001b[0m")).toBe("Connected"); }); - it("handles empty strings", () => { - expect(stripAnsi("")).toBe(""); - }); - - it("handles strings without ANSI codes", () => { - expect(stripAnsi("Plain text")).toBe("Plain text"); + it("strips complex ANSI codes with semicolons", () => { + expect(stripAnsi("\x1b[38;5;206mMagenta text\x1b[0m")).toBe("Magenta text"); + expect(stripAnsi("\u001b[1;31mBold red\u001b[0m")).toBe("Bold red"); }); - it("handles complex ANSI sequences (e.g., bold, background, rgb)", () => { - // Bold red text on yellow background - expect(stripAnsi("\x1b[1;31;43mWarning\x1b[0m")).toBe("Warning"); - // RGB colors - expect(stripAnsi("\x1b[38;2;255;82;197mPink\x1b[0m")).toBe("Pink"); - // Complex multi-sequence text - expect(stripAnsi("\x1b[1mBold\x1b[0m and \x1b[4mUnderline\x1b[0m")).toBe("Bold and Underline"); + it("strips multiple ANSI codes in a single string", () => { + expect(stripAnsi("\u001b[31mRed\u001b[0m and \u001b[32mGreen\u001b[0m")).toBe("Red and Green"); }); - it("handles multiple ANSI sequences sequentially", () => { - expect(stripAnsi("\x1b[31m\x1b[1mRed Bold\x1b[0m\x1b[0m")).toBe("Red Bold"); + it("returns the original string if no ANSI codes are present", () => { + expect(stripAnsi("Plain text")).toBe("Plain text"); }); - it("handles undefined gracefully by falling back to default parameter", () => { + it("handles undefined and empty inputs", () => { expect(stripAnsi()).toBe(""); - expect(stripAnsi(undefined)).toBe(""); + expect(stripAnsi(undefined as any)).toBe(""); + expect(stripAnsi("")).toBe(""); }); + }); it("parses semantic versions from CLI output", () => {