Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/dependency-audit.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
Expand All @@ -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
Expand Down
43 changes: 43 additions & 0 deletions UPSTREAM_SYNC.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,49 @@ git grep "VERBOO-BRAND" src/
Antes de cada sync, rode esse comando e mantenha um inventário mental dos
pontos que devem ser preservados.

## Pontos adicionados na 0.15.42

Hunks `VERBOO-BRAND` em arquivos upstream. Depois de um merge do upstream, confira
se cada um continua lá.

#### Confiança de pasta
- `src/interactiveHelpers.tsx` — mostra o `TrustDialog` no modo Verboo, usando
`getRequiredSetupScreens` de `src/utils/setupScreenGates.ts` (vindo do upstream).

#### Troca de modelo quando o limite acaba
- `src/screens/REPL.tsx` — efeito que abre `LimitSwitchDialog`, reenvio no render
seguinte (`limitResendPrompt`) e fila parada enquanto a escolha está pendente
(`isLimitSwitchPending`).
- `src/services/api/withRetry.ts` — `insufficient_quota` e limite do plano não têm
retry. `src/services/api/errors.ts` — `PROVIDER_LIMIT_MESSAGE_PREFIX` conta como
erro de API, o que protege o `/compact`.
- `src/utils/config.ts` e `src/utils/model/model.ts` — `lastRouterModel`.

#### Esc e chaves digitadas
- `src/utils/QueryGuard.ts` — `isRunning`. `src/screens/REPL.tsx` — `canCancelWork`
ignora a trava enquanto um diálogo de comando espera resposta, então Esc e Ctrl+C
ficam com o diálogo.
- `src/screens/REPL.tsx` — `onSubmit` passa por `redactProviderKeyInCommand`: chave
digitada depois de `/claude` ou `/openai` não vai para tela, histórico nem
transcrição.

#### Conta própria (chave Anthropic, chave OpenAI, Codex)
- `src/utils/betas.ts` — `claude-code-20250219` nunca é enviado, inclusive em
chamadas agênticas.
- `src/utils/permissions/yoloClassifier.ts` (`getClassifierModel`) — em sessão com
conta própria, o classificador usa o modelo da conversa, e nada vai para o
roteador.

#### Auto mode: o que a pessoa vê
- `src/utils/messages.ts` — `getClassifierDenialReason`.
`src/components/messages/UserToolResultMessage/UserToolErrorMessage.tsx` — mostra
o motivo do bloqueio.

#### Dependências
- `src/services/mcp/client.ts` — `maxBufferSize` do transporte stdio.
- `src/services/api/codexShim.ts` — `enforceStrictSchema` troca `oneOf` por `anyOf`
(zod 4).

## Política sobre identifiers Anthropic

Os bundle IDs e endpoints de telemetria com prefixo `com.anthropic.claude_code.*`
Expand Down
2 changes: 1 addition & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"bin/verboo",
"bin/import-specifier.mjs",
"dist/cli.mjs",
"dist/vendor/ripgrep/**",
"scripts/postinstall.mjs",
"README.md"
],
Expand Down Expand Up @@ -94,7 +93,6 @@
"@modelcontextprotocol/sdk": "1.29.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",
Expand Down Expand Up @@ -161,7 +159,7 @@
"typescript": "5.9.3"
},
"optionalDependencies": {
"@vscode/ripgrep": "^1.15.14"
"@vscode/ripgrep": "^1.17.1"
},
"engines": {
"node": ">=22.0.0"
Expand Down
3 changes: 3 additions & 0 deletions scripts/check-cli-quality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
15 changes: 15 additions & 0 deletions scripts/cli-quality-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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([])
})
37 changes: 37 additions & 0 deletions scripts/e2e/cli.e2e.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,40 @@ test('an agent hitting max_turns reports its limit and confirmed usage', { timeo
for (const record of records) assert.equal(record.tokenUsage.confirmed, 144)
} finally { await cli.stop() }
})

// Workspace trust: a freshly cloned repository must not run project hooks
// before the user accepts the trust prompt (regression: Verboo mode used to
// mark every folder as trusted without asking).
const hookProject = {
'.verboo/settings.json': JSON.stringify({ hooks: { SessionStart: [{ hooks: [{ type: 'command', command: 'echo ran > hook-ran.txt' }] }] } }),
}
const hookRan = async cli => readdir(cli.project).then(files => files.includes('hook-ran.txt'))

test('untrusted project: declining the trust prompt exits before project hooks run', { timeout: 60_000 }, async () => {
const cli = await startCli({ columns: 120, rows: 40, trusted: false, settingSources: 'user,project', projectFiles: hookProject })
try {
await cli.waitFor(() => cli.screen().includes('Yes, I trust this folder'))
assert.equal(await hookRan(cli), false)
cli.write('\x1b[B')
await cli.waitFor(() => /❯ 2\. No, exit/.test(cli.screen()))
cli.write('\r')
const { exitCode } = await cli.exit
assert.equal(exitCode, 1)
assert.equal(await hookRan(cli), false)
assert.deepEqual(cli.router.requests, [])
} finally { await cli.stop() }
})

test('untrusted project: accepting the trust prompt runs hooks and remembers the folder', { timeout: 60_000 }, async () => {
const cli = await startCli({ columns: 120, rows: 40, trusted: false, settingSources: 'user,project', projectFiles: hookProject })
try {
await cli.waitFor(() => cli.screen().includes('Yes, I trust this folder'))
assert.equal(await hookRan(cli), false)
cli.write('\r')
await cli.waitFor(() => cli.screen().includes('❯') && !cli.screen().includes('Yes, I trust this folder'))
await cli.waitFor(() => hookRan(cli))
const config = JSON.parse(await readFile(join(cli.config, '.config.json'), 'utf8'))
const key = cli.project.replaceAll('\\', '/')
assert.equal(config.projects?.[key]?.hasTrustDialogAccepted, true)
} finally { await cli.stop() }
})
10 changes: 5 additions & 5 deletions scripts/e2e/codex-router.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function findUnsupportedSchemaKeywords(schema, path = '$') {
return errors
}

function validateCodexRequest(req, body, headers) {
function validateCodexRequest(req, body, headers, { anyEffort = false } = {}) {
const problems = []
const isStructuredTask = body.text?.format?.type === 'json_schema'
if (req.method !== 'POST' || new URL(req.url, 'http://fixture').pathname !== '/backend-api/codex/responses') problems.push('request must be POST /backend-api/codex/responses')
Expand All @@ -62,8 +62,8 @@ function validateCodexRequest(req, body, headers) {
if (body.stream !== true) problems.push('Codex requests must stream')
if (body.store !== false) problems.push('Codex requests must set store=false')
if (!Number.isSafeInteger(body.max_output_tokens) || body.max_output_tokens < 1024) problems.push('max_output_tokens must be an integer >= 1024')
if (!isStructuredTask && body.reasoning?.effort !== 'high') problems.push('user inference must preserve the explicitly selected high reasoning effort')
if (body.reasoning?.effort && body.reasoning.effort !== 'high') problems.push('Codex fixture must not downgrade reasoning below high')
if (!anyEffort && !isStructuredTask && body.reasoning?.effort !== 'high') problems.push('user inference must preserve the explicitly selected high reasoning effort')
if (!anyEffort && body.reasoning?.effort && body.reasoning.effort !== 'high') problems.push('Codex fixture must not downgrade reasoning below high')
if (!Array.isArray(body.input) || body.input.length === 0) problems.push('input must contain the user conversation')
if (!isStructuredTask && (!Array.isArray(body.tools) || body.tools.length < 5)) problems.push('expected the CLI toolset to be present in the Codex inference request')
if (isStructuredTask && Array.isArray(body.tools) && body.tools.length > 0) problems.push('structured session-title requests must remain tool-free')
Expand Down Expand Up @@ -136,7 +136,7 @@ export function createCodexFixtureCredentialRecord() {
}
}

export async function createCodexRouter({ projectRoot, onChunkDelayMs = 15 } = {}) {
export async function createCodexRouter({ projectRoot, onChunkDelayMs = 15, anyEffort = false } = {}) {
const requests = []
const catalogRequests = []
const violations = []
Expand Down Expand Up @@ -199,7 +199,7 @@ export async function createCodexRouter({ projectRoot, onChunkDelayMs = 15 } = {
return
}
const id = `codex-fixture-${++sequence}`
const problems = validateCodexRequest(req, body, req.headers)
const problems = validateCodexRequest(req, body, req.headers, { anyEffort })
const record = { id, path: new URL(req.url, 'http://fixture').pathname, at: Date.now(), currentUserPrompt: latestUserText(body.input), headers: { authorizationPresent: Boolean(req.headers.authorization), accountId: req.headers['chatgpt-account-id'], originator: req.headers.originator }, body }
requests.push(record)
if (problems.length) {
Expand Down
41 changes: 33 additions & 8 deletions scripts/e2e/fake-router.mjs
Original file line number Diff line number Diff line change
@@ -1,28 +1,53 @@
import { createServer } from 'node:http'
import { setTimeout as delay } from 'node:timers/promises'

export async function createFakeRouter({ agents = 2, omitUsage = false, zeroUsage = false, partialUsage = false, stall = false, background = false, childFailure = false, childToolLoop = false, routedCompletion = false, model: configuredModel } = {}) {
// Optional for human-session scenarios:
// models ids or model objects served by GET .../models (default [model])
// agentModelRoles merged over the default agent_model_roles (e.g. { classifier: 'fixture-classifier' })
// routerHandler async (req, body, res) => true | undefined. Runs before the
// default behavior for every endpoint (req.pathname/req.query
// are set, body is parsed JSON, raw text or undefined). Return
// true or write the response to replace the default.
export async function createFakeRouter({ agents = 2, omitUsage = false, zeroUsage = false, partialUsage = false, stall = false, background = false, childFailure = false, childToolLoop = false, routedCompletion = false, model: configuredModel, models: modelList, agentModelRoles, routerHandler } = {}) {
const requests = []
// Every request (any endpoint) with headers; `requests` keeps only chat bodies.
const allRequests = []
const unexpected = []
let sequence = 0
const activeAgents = new Set()
const activeRequests = new Set()
const model = routedCompletion ? 'jev-router' : configuredModel ?? 'fixture-model'
async function handleRequest(req, res) {
const path = new URL(req.url, 'http://fixture').pathname
const url = new URL(req.url, 'http://fixture')
const path = url.pathname
const json = value => { res.setHeader('Content-Type', 'application/json'); res.end(JSON.stringify(value)) }
const chunks = []
for await (const chunk of req) chunks.push(chunk)
const raw = Buffer.concat(chunks).toString()
const record = { index: allRequests.length, at: Date.now(), method: req.method, path, query: Object.fromEntries(url.searchParams), headers: { ...req.headers }, body: undefined }
allRequests.push(record)
let body
if (path === '/router/v1/chat/completions') {
body = JSON.parse(raw)
requests.push(body)
} else if (raw) {
try { body = JSON.parse(raw) } catch { body = raw }
}
record.body = body
if (routerHandler) {
req.pathname = path
req.query = record.query
const handled = await routerHandler(req, body, res)
if (handled === true || res.headersSent || res.writableEnded) return
}
if (path === '/') return json({ ok: true })
if (path === '/api/claude_code/settings') return json({ settings: {} })
if (path === '/api/plugins/marketplace.json') return json({ name: 'fixture', owner: { name: 'Fixture' }, plugins: [] })
if (path.endsWith('/models')) return json({ data: [{ id: model, object: 'model' }], agent_model_roles: { explore: model, balanced: model, powerful: model } })
if (path.endsWith('/models')) return json({ data: (modelList ?? [model]).map(entry => typeof entry === 'string' ? { id: entry, object: 'model' } : entry), agent_model_roles: { explore: model, balanced: model, powerful: model, ...agentModelRoles } })
if (path === '/api/me') return json({ data: { id: '11111111-1111-4111-8111-111111111111', email: 'fixture@example.test', name: 'Fixture', confirmed: true } })
if (path === '/api/me/subscriptions') return json({ data: [{ id: '11111111-1111-4111-8111-111111111111', groupId: '22222222-2222-4222-8222-222222222222', status: 'active', currentPeriodEnd: '2099-01-01T00:00:00Z' }] })
if (path === '/api/me/terms/status') return json({ data: { configured: false, mustAccept: false, pendingReacceptance: false } })
if (path !== '/router/v1/chat/completions') { unexpected.push(path); res.statusCode = 404; return json({ error: { message: `Unknown fixture endpoint: ${path}` } }) }
const chunks = []
for await (const chunk of req) chunks.push(chunk)
const body = JSON.parse(Buffer.concat(chunks).toString())
requests.push(body)
const id = `fixture-${++sequence}`
const prompt = body.messages.filter(message => message.role === 'user').map(message => JSON.stringify(message.content)).join('\n')
const isChild = prompt.includes('AGENT_FIXTURE_')
Expand Down Expand Up @@ -75,7 +100,7 @@ export async function createFakeRouter({ agents = 2, omitUsage = false, zeroUsag
})
await new Promise(resolve => server.listen(0, '127.0.0.1', resolve))
return {
origin: `http://127.0.0.1:${server.address().port}`, requests, unexpected, activeAgents, activeRequests,
origin: `http://127.0.0.1:${server.address().port}`, requests, allRequests, unexpected, activeAgents, activeRequests,
async close() {
const closed = new Promise(resolve => server.close(resolve))
server.closeAllConnections()
Expand Down
Loading
Loading