fix(opencode): anchor checkGaGraph path check to /src/ so antigravity checkout dirs build

MV
19h ago
+14-3

Fixes #46

Summary

checkGaGraph in packages/opencode/scripts/build-tui.ts tests each audited file path against GA_FORBIDDEN_SOURCE (/\/(?:rpc|plugin|antigravity|hooks)\/|.../). Because graph.files contains absolute paths, cloning the repository into a directory named antigravity causes every file in the package to match /antigravity/ on the checkout folder name and fail bun run build.

Changes

  • Slice audited paths from the last /src/ segment before testing GA_FORBIDDEN_SOURCE, so directory names above src/ do not collide with package-internal forbidden directories.
  • Add regression coverage in packages/opencode/scripts/build-tui.test.ts (graph.ga_policy_refusals).

Verification

  • bun run build inside a checkout directory named antigravity/ (0 errors)
  • bun test --isolate packages/opencode/scripts/build-tui.test.ts -t "graph.ga_policy_refusals"
  • bun x @biomejs/biome check packages/opencode/scripts/build-tui.ts packages/opencode/scripts/build-tui.test.ts