summaryrefslogtreecommitdiff
path: root/skills/vercel-optimize/scripts
diff options
context:
space:
mode:
authorJohn Pham <john.pham@vercel.com>2026-05-21 10:17:47 -0700
committerJohn Pham <john.pham@vercel.com>2026-05-21 10:17:47 -0700
commit9e50dda5bd410bf77915c630b2b8e2a44697c5b2 (patch)
treeda74e4fbb1e333f22c15b52c0164a8bce684d370 /skills/vercel-optimize/scripts
parent3296353bb7fff11269fff02e717350f05b721331 (diff)
fix: support user-owned vercel optimize scope checksjohnphamous/vercel-optimize-data-gap-reporting
Diffstat (limited to 'skills/vercel-optimize/scripts')
-rwxr-xr-xskills/vercel-optimize/scripts/collect-signals.mjs2
-rwxr-xr-xskills/vercel-optimize/scripts/deep-dive.mjs6
2 files changed, 7 insertions, 1 deletions
diff --git a/skills/vercel-optimize/scripts/collect-signals.mjs b/skills/vercel-optimize/scripts/collect-signals.mjs
index 433b1b6..f5ae245 100755
--- a/skills/vercel-optimize/scripts/collect-signals.mjs
+++ b/skills/vercel-optimize/scripts/collect-signals.mjs
@@ -76,7 +76,7 @@ async function main() {
log(`project link resolved (source=${project.source}; teamScope=${project.orgId ? 'yes' : 'no'})`);
if (!project.orgId) {
- throw new Error('PROJECT_SCOPE_UNRESOLVED: the project was resolved without an org/team owner. Ask the user which Vercel team or personal scope owns the project, then rerun from a linked app directory or set VERCEL_PROJECT_ID with VERCEL_ORG_ID for that scope.');
+ throw new Error('PROJECT_SCOPE_UNRESOLVED: the project was resolved without an owner account. Ask the user which Vercel team or personal scope owns the project, then rerun from a linked app directory or set VERCEL_PROJECT_ID with VERCEL_ORG_ID for that scope.');
}
log('checking framework support…');
diff --git a/skills/vercel-optimize/scripts/deep-dive.mjs b/skills/vercel-optimize/scripts/deep-dive.mjs
index 6363fc3..497d32a 100755
--- a/skills/vercel-optimize/scripts/deep-dive.mjs
+++ b/skills/vercel-optimize/scripts/deep-dive.mjs
@@ -73,6 +73,12 @@ async function main() {
console.error(' Re-run collect-signals.mjs with the current skill so deep-dive queries use the same team as the broad pass.');
process.exit(2);
}
+ const commandAccountId = commandScope.teamId ?? commandScope.userId ?? null;
+ if (commandAccountId && link.orgId && link.orgId !== commandAccountId) {
+ console.error('[deep-dive] FATAL: cwd .vercel/ links the project to a different Vercel scope than commandScope.');
+ console.error(' Re-run with --cwd <dir-linked-to-the-collected-project>, or rerun collect-signals.mjs from the intended app directory.');
+ process.exit(2);
+ }
const scope = commandScope.cliScope || undefined;
log(`command scope resolved (source=${commandScope.source}; scoped=${scope ? 'yes' : 'no'})`);