diff --git a/scripts/branding-drift-baseline.json b/scripts/branding-drift-baseline.json index 8af380f9b0..ea0f5f2284 100644 --- a/scripts/branding-drift-baseline.json +++ b/scripts/branding-drift-baseline.json @@ -1,4 +1,8 @@ { + "apps/loopover-ui/src/components/site/api/try-it.tsx": 1, + "apps/loopover-ui/src/routes/app.index.tsx": 1, + "apps/loopover-ui/src/routes/app.runs.tsx": 1, + "apps/loopover-ui/src/routes/app.workbench.tsx": 1, "packages/loopover-engine/src/signals/engine.ts": 2, "packages/loopover-mcp/bin/loopover-mcp.js": 2, "src/api/routes.ts": 2, diff --git a/scripts/check-branding-drift.mjs b/scripts/check-branding-drift.mjs index d31ff96dd9..4ba7177466 100644 --- a/scripts/check-branding-drift.mjs +++ b/scripts/check-branding-drift.mjs @@ -35,6 +35,9 @@ export const BRANDING_DRIFT_PATHSPECS = [ "packages/*/lib/**/*.ts", "packages/*/src/**/*.ts", "packages/*/scripts/**/*.mjs", + "apps/*/src/**/*.ts", + "apps/*/src/**/*.tsx", + "apps/*/scripts/**/*.mjs", ":(exclude)**/*.test.ts", ":(exclude)**/*.test.tsx", ":(exclude)packages/*/test/**", diff --git a/test/unit/check-branding-drift-script.test.ts b/test/unit/check-branding-drift-script.test.ts index b0173c1d8b..fdace9fe1f 100644 --- a/test/unit/check-branding-drift-script.test.ts +++ b/test/unit/check-branding-drift-script.test.ts @@ -37,6 +37,19 @@ describe("scanBrandingHits", () => { expect(capturedArgs).toContain(":(exclude)**/*.test.ts"); }); + it("scans apps/* workspaces the same way it scans packages/* (src .ts/.tsx and scripts .mjs)", () => { + let capturedArgs: string[] = []; + const exec = (_root: string, args: string[]) => { + capturedArgs = args; + return ""; + }; + scanBrandingHits({ root: "/fake", exec }); + + expect(capturedArgs).toContain("apps/*/src/**/*.ts"); + expect(capturedArgs).toContain("apps/*/src/**/*.tsx"); + expect(capturedArgs).toContain("apps/*/scripts/**/*.mjs"); + }); + // Real regression guard, mirroring check-manifest-drift-script.test.ts's own real-repo-state test: proves // the actual defaultExec (real `git grep` subprocess, real exit-1-means-empty handling) works against this // repo's real tracked files, not just the injected fake above. @@ -73,6 +86,14 @@ describe("diffBrandingBaseline", () => { expect(failures[0]).toContain("increased from 0 to 1"); }); + it("detects a new gittensory hit under an apps/*/src path as drift, now that apps/* is in scope", () => { + const failures = diffBrandingBaseline({}, { "apps/loopover-ui/src/routes/app.new.tsx": 1 }); + + expect(failures).toHaveLength(1); + expect(failures[0]).toContain("apps/loopover-ui/src/routes/app.new.tsx"); + expect(failures[0]).toContain("increased from 0 to 1"); + }); + it("flags a file whose count decreased (stale baseline after a cleanup)", () => { const failures = diffBrandingBaseline({ "src/a.ts": 3 }, { "src/a.ts": 1 });