Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scripts/branding-drift-baseline.json
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 3 additions & 0 deletions scripts/check-branding-drift.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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/**",
Expand Down
21 changes: 21 additions & 0 deletions test/unit/check-branding-drift-script.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 });

Expand Down