diff options
| author | nicdillon <nicholas.dillon@vercel.com> | 2026-10-28 11:26:14 -0400 |
|---|---|---|
| committer | nicdillon <nicholas.dillon@vercel.com> | 2026-10-28 11:26:14 -0400 |
| commit | 097f4c396d4d21ab26fef357a8bb07b3b084529a (patch) | |
| tree | 04d6d4f821c5fc0f45d2bb97fd540b0fc476de21 /skills/vercel-optimize/scripts/scan-codebase.mjs | |
| parent | 1a2c79d4e6c4a2283dc2c614b6538cbe1ed5ca62 (diff) | |
vercel-optimize: add build_machine_oversized gate and build signals collectorvercel-optimize/build-machine-oversized
- lib/build-signals.mjs: collect 14 days of deployments (v7 list) plus, for up
to 40 recent builds (v13 detail), duration.timeForBilling,
duration.cpuTimeForBilling, resourceConfig.buildMachine (purchaseType,
cores, memory, machineSelectionType), buildSkipped, and whether the build
came from a Deploy Hook (meta.deployHookName presence). meta.deployHookId is
the secret end of the hook URL and is never read or stored. Platform data
only; no Observability Plus required.
- lib/gates/build-machine-oversized.mjs: account-scoped gate for projects
pinned to Enhanced or Turbo. Recommends Elastic; reports the break-even
billed duration on the next smaller machine as context, not a savings
figure. Median uses successful builds only; skipped, Elastic-sized, and
other-machine builds are excluded from the build count; CPU minutes come
from cpuTimeForBilling when present; memory-related Elastic resize reasons
suppress the gate.
- Register the kind in gates/index (GATE_VERSION 1.9.0), deep-dive, display
labels, report category, and impact label.
- Citations for Managing Builds and build pricing; build-machine-right-sizing
support topic; signals schema 1.3 with the new builds field.
- SKILL.md and references/observability-plus.md: build-focused requests
continue without Observability Plus, since build gates use no route metrics.
- lib/grade-recommendation.mjs: grade `<account>` candidates on the account
rubric too (keeping the higher of route and account scores), and count
builds, vCPUs, and billed/CPU minutes as evidence. Without this the
build_machine_oversized rec was held back at quality 0.17.
- SKILL.md: the post-blocker rerun now merges with --force; without it the
merge failed and gates ran on the blocked collection (no usage or builds).
- impact-label: when a written build recommendation omits the gate o11ySignal,
re-derive it from signals.json so the report shows the real impact line
instead of a placeholder. A scanner-only build_minutes_fanout no longer claims a
billing threshold was exceeded.
- collect-signals: redact Deploy Hook ids and URLs from the stored project
config (link.deployHooks keeps name, ref, createdAt). They are bearer
secrets and were previously written to signals.json on every run.
- scan-codebase: skip .claude and .agents, where project-installed agent skills
live; scanning them flagged this skill's own source as findings.
- Tests: 36 new fixture tests (gate, collector, grading, impact label, redaction, scan); full
suite 805/805.
Validated on a live test project: moving a pinned-Turbo project to Elastic
cut CPU minutes 54% over five builds, and the gate stopped firing.
Diffstat (limited to 'skills/vercel-optimize/scripts/scan-codebase.mjs')
| -rwxr-xr-x | skills/vercel-optimize/scripts/scan-codebase.mjs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/skills/vercel-optimize/scripts/scan-codebase.mjs b/skills/vercel-optimize/scripts/scan-codebase.mjs index 9d416b5..645e3f7 100755 --- a/skills/vercel-optimize/scripts/scan-codebase.mjs +++ b/skills/vercel-optimize/scripts/scan-codebase.mjs @@ -15,7 +15,8 @@ import { } from '../lib/workspace-resolver.mjs'; const SCHEMA_VERSION = '1.0'; -const SKIP_DIRS = new Set(['node_modules', '.next', '.vercel', 'dist', 'build', '.git', 'coverage', '.turbo', '__tests__', 'cypress']); +// .claude and .agents hold project-installed agent skills (including this one); scanning them flags the skill's own source. +const SKIP_DIRS = new Set(['node_modules', '.next', '.vercel', 'dist', 'build', '.git', 'coverage', '.turbo', '__tests__', 'cypress', '.claude', '.agents']); const SKIP_FILE_PATTERNS = [/\.test\./, /\.spec\./, /\.d\.ts$/]; async function main() { |
