From c90a5f925789983f19fd7a0f1dc8141056d2b183 Mon Sep 17 00:00:00 2001 From: Savas Neto Date: Tue, 3 Nov 2026 16:56:00 -0300 Subject: [PATCH 1/2] ci: run privacy and rebrand checks, pin actions, weekly dependency audit Co-Authored-By: Claude Opus 5.5 --- .github/workflows/dependency-audit.yml | 30 +++++++++++++ .github/workflows/pr-checks.yml | 4 +- .github/workflows/release.yml | 6 +-- bun.lock | 2 +- package.json | 4 +- scripts/check-cli-quality.ts | 3 ++ scripts/cli-quality-workflow.test.ts | 15 +++++++ scripts/rebrand-check.ts | 24 ++++++++++- scripts/verify-no-phone-home.sh | 50 ---------------------- scripts/verify-no-phone-home.test.ts | 16 +++++++ scripts/verify-no-phone-home.ts | 59 +++++++++++++++----------- src/components/ThemePicker.tsx | 2 +- 12 files changed, 129 insertions(+), 86 deletions(-) create mode 100644 .github/workflows/dependency-audit.yml delete mode 100644 scripts/verify-no-phone-home.sh create mode 100644 scripts/verify-no-phone-home.test.ts diff --git a/.github/workflows/dependency-audit.yml b/.github/workflows/dependency-audit.yml new file mode 100644 index 0000000000..e215308cc4 --- /dev/null +++ b/.github/workflows/dependency-audit.yml @@ -0,0 +1,30 @@ +name: Dependency audit + +# Known advisories in the dependency tree (most of it is bundled into +# dist/cli.mjs, so users only get fixes through a new release). Starts as a +# report; flip continue-on-error off once the tree is clean. +on: + pull_request: + push: + branches: + - main + schedule: + - cron: '0 9 * * 1' + +permissions: + contents: read + +jobs: + bun-audit: + name: bun-audit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd + with: + persist-credentials: false + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 + with: + bun-version-file: .bun-version + - name: Audit dependencies (high and critical) + continue-on-error: true + run: bun audit --audit-level=high diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 7fee031731..4a48ff9f31 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -21,12 +21,12 @@ jobs: uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Docker Buildx - uses: useblacksmith/setup-docker-builder@v1 + uses: useblacksmith/setup-docker-builder@e4c1c000c95f9cc255f72940e9c56bcbd1239436 # v1 with: max-cache-size-mb: "20480" - name: Build and load image - uses: useblacksmith/build-push-action@v2 + uses: useblacksmith/build-push-action@9b0579bbec7a6cad2f171596c57e7ac1e7658850 # v2 with: context: . load: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 60bea699a1..c60400681c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -148,7 +148,7 @@ jobs: ref: ${{ needs.verify.outputs.tag }} - name: Set up Docker Buildx - uses: useblacksmith/setup-docker-builder@v1 + uses: useblacksmith/setup-docker-builder@e4c1c000c95f9cc255f72940e9c56bcbd1239436 # v1 with: max-cache-size-mb: "20480" @@ -170,7 +170,7 @@ jobs: type=raw,value=latest,enable=${{ !github.event.release.prerelease }} - name: Build and load locally - uses: useblacksmith/build-push-action@v2 + uses: useblacksmith/build-push-action@9b0579bbec7a6cad2f171596c57e7ac1e7658850 # v2 with: context: . load: true @@ -182,7 +182,7 @@ jobs: docker run --rm verboo:smoke --internal-protocol-self-test - name: Build and push - uses: useblacksmith/build-push-action@v2 + uses: useblacksmith/build-push-action@9b0579bbec7a6cad2f171596c57e7ac1e7658850 # v2 with: context: . push: true diff --git a/bun.lock b/bun.lock index 1f44bc2377..c70daa247a 100644 --- a/bun.lock +++ b/bun.lock @@ -102,7 +102,7 @@ "typescript": "5.9.3", }, "optionalDependencies": { - "@vscode/ripgrep": "^1.15.14", + "@vscode/ripgrep": "^1.17.1", }, }, }, diff --git a/package.json b/package.json index f7ba3228ae..52ef4ce2e8 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "bin/verboo", "bin/import-specifier.mjs", "dist/cli.mjs", - "dist/vendor/ripgrep/**", "scripts/postinstall.mjs", "README.md" ], @@ -108,7 +107,6 @@ "@opentelemetry/semantic-conventions": "1.40.0", "@orama/orama": "^3.1.18", "@orama/plugin-data-persistence": "^3.1.18", - "@vscode/ripgrep": "^1.17.1", "ajv": "8.18.0", "auto-bind": "5.0.1", "axios": "1.15.2", @@ -177,7 +175,7 @@ "typescript": "5.9.3" }, "optionalDependencies": { - "@vscode/ripgrep": "^1.15.14" + "@vscode/ripgrep": "^1.17.1" }, "engines": { "node": ">=22.0.0" diff --git a/scripts/check-cli-quality.ts b/scripts/check-cli-quality.ts index 8662d7e2c9..a3403e7ddf 100644 --- a/scripts/check-cli-quality.ts +++ b/scripts/check-cli-quality.ts @@ -10,6 +10,9 @@ function run(command: string[]) { const terminalOnly = process.argv.includes('--terminal') if (!terminalOnly) { run([process.execPath, 'scripts/build.ts']) + // The bundle must not phone home to Anthropic services or download from its buckets. + run([process.execPath, 'scripts/verify-no-phone-home.ts']) + run([process.execPath, 'scripts/rebrand-check.ts']) run([node, 'node_modules/typescript/bin/tsc', '--project', 'tsconfig.agent-contracts.json']) run([process.execPath, 'scripts/run-tests-isolated.ts']) run([node, 'dist/cli.mjs', '--version']) diff --git a/scripts/cli-quality-workflow.test.ts b/scripts/cli-quality-workflow.test.ts index ef799910f8..1778821eda 100644 --- a/scripts/cli-quality-workflow.test.ts +++ b/scripts/cli-quality-workflow.test.ts @@ -40,3 +40,18 @@ test('the release package is exercised on Linux, macOS and Windows with both sup expect(workflow.jobs.python).toBeDefined() expect(workflow.jobs.web).toBeDefined() }) + +test('every third-party action is pinned to a full commit SHA', () => { + const { readdirSync } = require('node:fs') as typeof import('node:fs') + const unpinned: string[] = [] + for (const name of readdirSync('.github/workflows')) { + if (!/\.ya?ml$/.test(name)) continue + const text = readFileSync(`.github/workflows/${name}`, 'utf8') + for (const match of text.matchAll(/^\s*-?\s*uses:\s*([^\s#]+)/gm)) { + const ref = match[1]! + if (ref.startsWith('./')) continue + if (!/@[0-9a-f]{40}$/.test(ref)) unpinned.push(`${name}: ${ref}`) + } + } + expect(unpinned).toEqual([]) +}) diff --git a/scripts/rebrand-check.ts b/scripts/rebrand-check.ts index 5351a6a35c..e4d713aab0 100644 --- a/scripts/rebrand-check.ts +++ b/scripts/rebrand-check.ts @@ -121,9 +121,12 @@ const COMMON_ALLOWLIST = [ const RULES: Rule[] = [ { name: 'Verboo Code product literal', - pattern: /\b(Verboo Code|Open Claude|OPEN CLAUDE)\b/, + pattern: /\b(OpenClaude|Open Claude|OPEN CLAUDE)\b/, allowlist: [ ...COMMON_ALLOWLIST, + // ~/.openclaude/projects é lido (somente leitura) para o /resume: + 'src/utils/envUtils.ts', + 'src/utils/sessionStorage.ts', // CLI brand fallback gated por VERBOO_CLI_BRAND=verboo (alias deprecated): 'src/main.tsx', ], @@ -158,6 +161,10 @@ const RULES: Rule[] = [ 'src/services/api/filesApi.ts', // StartupScreen mostra base URL (corrigido em separado): 'src/components/StartupScreen.ts', + // Preset do vendor Anthropic (o usuário escolhe explicitamente): + 'src/integrations/vendors/anthropic.ts', + // Chave de API da Anthropic do próprio usuário (/claude login): + 'src/services/api/claudeNativeConfig.ts', ], }, { @@ -172,6 +179,21 @@ const RULES: Rule[] = [ // OAuth flow (deferred): 'src/constants/oauth.ts', 'src/main.tsx', // OAuth getOauthConfig contém refs upstream Anthropic + // A loja de plugins da Anthropic (sob demanda) é nomeada como tal: + 'src/commands/lsp/lsp.ts', + // Nomes de provedor/vendor (Anthropic é o fornecedor, não a marca): + 'src/commands/usage/index.ts', + 'src/integrations/routeMetadata.ts', + 'src/integrations/vendors/anthropic.ts', + // Comentário com aspas, não texto de UI: + 'src/utils/effort.ts', + // Conexão com a chave de API da Anthropic do usuário (nomeia o provedor): + 'src/commands/claude/', + 'src/utils/claudeLoginRetiredNotice.ts', + 'src/utils/claudeNativeCredentials.ts', + 'src/services/api/claudeNativeModels.ts', + 'src/services/api/claudeNativeUsage.ts', + 'src/services/api/client.ts', // SDK error logger uses preserved upstream identifier strings: 'src/services/api/sdk.ts', // Auth/account model functions reference "Anthropic" provider type: diff --git a/scripts/verify-no-phone-home.sh b/scripts/verify-no-phone-home.sh deleted file mode 100644 index 79fa8b4d20..0000000000 --- a/scripts/verify-no-phone-home.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -DIST="dist/cli.mjs" - -if [ ! -f "$DIST" ]; then - echo "ERROR: $DIST not found. Run 'bun run build' first." - exit 1 -fi - -EXIT=0 - -BANNED=( - "datadoghq.com" - "api/event_logging/batch" - "api/claude_code/metrics" - "getKubernetesNamespace" - "/var/run/secrets/kubernetes" - "/proc/self/mountinfo" - "tengu_internal_record_permission_context" - "anthropic-serve" - "infra.ant.dev" - "claude-code-feedback" - "C07VBSHV7EV" -) - -echo "Checking $DIST for banned patterns..." -echo "" - -for pattern in "${BANNED[@]}"; do - COUNT=$(grep -F -c "$pattern" "$DIST" 2>/dev/null || true) - COUNT=${COUNT:-0} - if [ "$COUNT" -gt 0 ]; then - echo " FAIL: '$pattern' found ($COUNT occurrences)" - EXIT=1 - else - echo " PASS: '$pattern' not found" - fi -done - -echo "" - -if [ "$EXIT" -eq 0 ]; then - echo "✓ All checks passed — no banned patterns in build output" -else - echo "✗ FAILED — banned patterns found in build output" -fi - -exit $EXIT diff --git a/scripts/verify-no-phone-home.test.ts b/scripts/verify-no-phone-home.test.ts new file mode 100644 index 0000000000..3091335012 --- /dev/null +++ b/scripts/verify-no-phone-home.test.ts @@ -0,0 +1,16 @@ +import { expect, test } from 'bun:test' + +import { BANNED_PATTERNS, findBannedPatterns } from './verify-no-phone-home.js' + +test('reports every banned pattern with its count', () => { + const contents = `fetch("https://http-intake.logs.datadoghq.com"); x = "datadoghq.com"; infra.ant.dev` + expect(findBannedPatterns(contents)).toEqual([ + { pattern: 'datadoghq.com', count: 2 }, + { pattern: 'infra.ant.dev', count: 1 }, + ]) +}) + +test('a clean bundle passes', () => { + expect(findBannedPatterns('const router = "https://code.verboo.ai/router/v1"')).toEqual([]) + expect(BANNED_PATTERNS.length).toBeGreaterThan(0) +}) diff --git a/scripts/verify-no-phone-home.ts b/scripts/verify-no-phone-home.ts index 843c5f338b..01dc4dfec2 100644 --- a/scripts/verify-no-phone-home.ts +++ b/scripts/verify-no-phone-home.ts @@ -1,7 +1,9 @@ import { existsSync, readFileSync } from 'node:fs' -const DIST = 'dist/cli.mjs' -const BANNED_PATTERNS = [ +// The SDK bundle ships too when present; both must stay free of these. +export const BUNDLES = ['dist/cli.mjs', 'dist/sdk.mjs'] as const + +export const BANNED_PATTERNS = [ 'datadoghq.com', 'api/event_logging/batch', 'api/claude_code/metrics', @@ -15,33 +17,40 @@ const BANNED_PATTERNS = [ 'C07VBSHV7EV', ] as const -if (!existsSync(DIST)) { - console.error(`ERROR: ${DIST} not found. Run 'bun run build' first.`) - process.exit(1) +export function findBannedPatterns( + contents: string, + patterns: readonly string[] = BANNED_PATTERNS, +): Array<{ pattern: string; count: number }> { + return patterns + .map(pattern => ({ pattern, count: contents.split(pattern).length - 1 })) + .filter(result => result.count > 0) } -const contents = readFileSync(DIST, 'utf8') -let exitCode = 0 - -console.log(`Checking ${DIST} for banned patterns...`) -console.log('') - -for (const pattern of BANNED_PATTERNS) { - const count = contents.split(pattern).length - 1 - if (count > 0) { - console.log(` FAIL: '${pattern}' found (${count} occurrences)`) - exitCode = 1 - } else { - console.log(` PASS: '${pattern}' not found`) +function main(): number { + if (!existsSync(BUNDLES[0])) { + console.error(`ERROR: ${BUNDLES[0]} not found. Run 'bun run build' first.`) + return 1 } -} -console.log('') + let exitCode = 0 + for (const bundle of BUNDLES) { + if (!existsSync(bundle)) continue + const found = findBannedPatterns(readFileSync(bundle, 'utf8')) + console.log(`Checking ${bundle} for banned patterns...`) + for (const { pattern, count } of found) { + console.log(` FAIL: '${pattern}' found (${count} occurrences)`) + exitCode = 1 + } + if (found.length === 0) console.log(` PASS: none of ${BANNED_PATTERNS.length} patterns found`) + } -if (exitCode === 0) { - console.log('✓ All checks passed — no banned patterns in build output') -} else { - console.log('✗ FAILED — banned patterns found in build output') + console.log('') + console.log( + exitCode === 0 + ? '✓ All checks passed — no banned patterns in build output' + : '✗ FAILED — banned patterns found in build output', + ) + return exitCode } -process.exit(exitCode) +if (import.meta.main) process.exit(main()) diff --git a/src/components/ThemePicker.tsx b/src/components/ThemePicker.tsx index d63ff2719d..725cc3c74e 100644 --- a/src/components/ThemePicker.tsx +++ b/src/components/ThemePicker.tsx @@ -48,7 +48,7 @@ const DEMO_PATCH: StructuredPatchHunk = { lines: [ ' function greet() {', '- console.log("Hello, World!");', - '+ console.log("Hello, OpenClaude!");', + '+ console.log("Hello, Verboo!");', // VERBOO-BRAND ' }', ], } From c1d0096ae78252d4846de3cfc6d6737d7d1bc88a Mon Sep 17 00:00:00 2001 From: Savas Neto Date: Tue, 3 Nov 2026 20:18:04 -0300 Subject: [PATCH 2/2] ci(rebrand): allow provider naming from the API-key and account-limit PRs Co-Authored-By: Claude Opus 5.5 --- scripts/rebrand-check.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/rebrand-check.ts b/scripts/rebrand-check.ts index e4d713aab0..cdaa187c34 100644 --- a/scripts/rebrand-check.ts +++ b/scripts/rebrand-check.ts @@ -194,6 +194,10 @@ const RULES: Rule[] = [ 'src/services/api/claudeNativeModels.ts', 'src/services/api/claudeNativeUsage.ts', 'src/services/api/client.ts', + // Rótulos "via sua chave Anthropic" no /model e o aviso de saldo esgotado: + 'src/commands/model/model.tsx', + 'src/utils/model/modelOptions.ts', + 'src/services/api/providerLimitErrors.ts', // SDK error logger uses preserved upstream identifier strings: 'src/services/api/sdk.ts', // Auth/account model functions reference "Anthropic" provider type: