You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bin/gstack-diff-scope categorizes changed files into scope signals (SCOPE_FRONTEND, SCOPE_BACKEND, etc.) that the Review Army uses to decide which specialist reviewers to spin up (scripts/resolvers/review-army.ts, review.ts). Backend detection only matches *.ts and *.js:
*.ts|*.js) BACKEND=true ;;# Non-component TS/JS is backend
Modern Node projects ship backend code as ESM .mjs / CommonJS .cjs, and explicit-module TypeScript as .mts / .cts. None of these match *.ts or *.js (the glob requires the string to end in .ts/.js, and server.mjs does not). They also match no other category, so a PR touching only those files produces all-false scope flags.
$ printf 'y' > server.mjs # in a feature branch
$ gstack-diff-scope main
SCOPE_FRONTEND=false
SCOPE_BACKEND=false # <-- backend code, but no scope detected
...
Same for server.cjs, mod.mts, legacy.cts. With no scope flag set, the review army skips the backend (and security) reviewers for these changes.
Expected behavior
.mjs, .cjs, .mts, .cts are non-component code and should set SCOPE_BACKEND=true, exactly like .ts/.js.
Observed problem
bin/gstack-diff-scopecategorizes changed files into scope signals (SCOPE_FRONTEND,SCOPE_BACKEND, etc.) that the Review Army uses to decide which specialist reviewers to spin up (scripts/resolvers/review-army.ts,review.ts). Backend detection only matches*.tsand*.js:Modern Node projects ship backend code as ESM
.mjs/ CommonJS.cjs, and explicit-module TypeScript as.mts/.cts. None of these match*.tsor*.js(the glob requires the string to end in.ts/.js, andserver.mjsdoes not). They also match no other category, so a PR touching only those files produces all-false scope flags.Current behavior on upstream
main(3bef43b)Same for
server.cjs,mod.mts,legacy.cts. With no scope flag set, the review army skips the backend (and security) reviewers for these changes.Expected behavior
.mjs,.cjs,.mts,.ctsare non-component code and should setSCOPE_BACKEND=true, exactly like.ts/.js.Duplicate searches performed
diff-scope,mjs,SCOPE_BACKEND— only match touching this file is unrelated (fix: use three-dot diff for scope drift detection in /review #221, three-dot diff). No PR adds these extensions.diff-scope,mjs,scope— no match for this gap.git log -- bin/gstack-diff-scope— last touched by the v1.44.1.0 fix wave and the Review Army feature; extensions never added.Candidate fix shape
Add the four extensions to the existing backend case (purely additive — no file currently classified is reclassified):
Plus a regression test in
test/diff-scope.test.ts.