verify-board

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

verify-board

verify-board

The surface is the
vb
CLI against a local board (
vb serve
,
packages/board/src/cli/serve.ts
): SQLite log and attachments under the project's
.board/
, a scheduler in its process, a local issuer,
127.0.0.1:4100
, no sync. Everything runs in a fresh Vercel Sandbox, so nothing on this machine (your
~/.config/board
, your
BOARD_URL
, a global
vb
) leaks into the result. The inspector (
vb inspect --no-open
) is a secondary surface; see features/README.md.
All scripts live in
.claude/skills/verify-board/scripts/
and run from anywhere in the repo. Set
V=.claude/skills/verify-board/scripts
below.
测试界面是针对本地 board 运行的
vb
CLI(
vb serve
、
packages/board/src/cli/serve.ts
):项目的
.board/
下包含 SQLite 日志和附件,scheduler 运行于进程内,使用本地 issuer,地址为
127.0.0.1:4100
,且不执行 sync。 所有操作均在全新的 Vercel Sandbox 中运行,因此本机上的任何内容(你的
~/.config/board
、
BOARD_URL
、全局
vb
)都不会影响结果。inspector(
vb inspect --no-open
)是次要测试界面;请参阅 features/README.md。
所有脚本均位于
.claude/skills/verify-board/scripts/
,并可从仓库中的任意位置运行。下面设置
V=.claude/skills/verify-board/scripts
。

Launch

启动

bash
V=.claude/skills/verify-board/scripts
S=$($V/up.sh)                     # this checkout, working tree included (uncommitted changes too)
S=$($V/up.sh --published 0.9.0)   # or: board from npm, exactly what users install
up.sh
prints progress on stderr and the sandbox name (
verify-board-<UTC timestamp>-<4 hex>
, distinct across parallel runs) as its last stdout line. It:
  1. creates the sandbox:
    npx --yes sandbox@4.8.1 create --scope vercel-labs --name <name> --timeout 45m --vcpus 4
    (
    VERIFY_TIMEOUT
    ,
    VERIFY_VCPUS
    override; the image is Node 24, user
    ubuntu
    , home
    /vercel
    );
  2. source mode: tars the working tree (
    git ls-files --cached --others --exclude-standard
    ), copies it in with
    sandbox cp
    , extracts to
    /vercel/board
    , then
    corepack pnpm install --frozen-lockfile --filter '@vercel/board...' && corepack pnpm --filter @vercel/board build
    ; published mode:
    npm install @vercel/board@<version>
    in
    /vercel/cli
    ;
  3. links
    /vercel/bin/vb
    to the CLI under test (a symlink, as npm would);
  4. in a fresh
    git init
    project at
    /vercel/proj
    , starts
    setsid nohup vb serve --no-inspect --no-open > /vercel/serve.log &
    ;
  5. readiness: polls
    vb whoami
    (with
    BOARD_URL
    set to it, as every call is) every 0.5s for 30s; on success prints the serve log (
    serving a local board at http://127.0.0.1:4100/api/board as local:user:ubuntu, ...
    ).
If any step fails,
up.sh
runs
down.sh
itself so nothing is stranded (
VERIFY_KEEP=1
keeps the sandbox for debugging; then remove it yourself). The setup log is
.verify/board/<timestamp>/up.log
. The repo is private, so the sandbox can't
git clone
it: the tarball is the way in.
Teardown is
$V/down.sh "$S"
(see Cleanup).
bash
V=.claude/skills/verify-board/scripts
S=$($V/up.sh)                     # this checkout, working tree included (uncommitted changes too)
S=$($V/up.sh --published 0.9.0)   # or: board from npm, exactly what users install
up.sh
会在 stderr 打印进度,并将 sandbox 名称(
verify-board-<UTC timestamp>-<4 hex>
,并行运行时各不相同)作为 stdout 的最后一行输出。它会:
  1. 创建 sandbox:
    npx --yes sandbox@4.8.1 create --scope vercel-labs --name <name> --timeout 45m --vcpus 4
    (可通过
    VERIFY_TIMEOUT
    、
    VERIFY_VCPUS
    覆盖;镜像为 Node 24,用户为 ubuntu,主目录为
    /vercel
    );
  2. source 模式:使用
    git ls-files --cached --others --exclude-standard
    对工作树进行 tar 打包,通过
    sandbox cp
    复制进去,解压到
    /vercel/board
    ,然后执行
    corepack pnpm install --frozen-lockfile --filter '@vercel/board...' && corepack pnpm --filter @vercel/board build
    ;published 模式:在
    /vercel/cli
    中执行
    npm install @vercel/board@<version>
    ;
  3. 将
    /vercel/bin/vb
    链接到被测 CLI(使用 symlink,与 npm 的行为一致);
  4. 在
    /vercel/proj
    中初始化一个全新的
    git init
    项目,并启动
    setsid nohup vb serve --no-inspect --no-open > /vercel/serve.log &
    ;
  5. 就绪探测:每隔 0.5 秒轮询一次
    vb whoami
    (每次调用都会将
    BOARD_URL
    指向该 board),最长等待 30 秒;成功后打印 serve 日志(
    serving a local board at http://127.0.0.1:4100/api/board as local:user:ubuntu, ...
    )。
如果任一步骤失败,
up.sh
会自行运行
down.sh
,避免遗留 sandbox(设置
VERIFY_KEEP=1
可保留 sandbox 供调试;之后需自行移除)。设置日志位于
.verify/board/<timestamp>/up.log
。 仓库为私有,因此 sandbox 无法通过
git clone
获取;tarball 是将仓库传入 sandbox 的方式。
拆除 sandbox 的命令为
$V/down.sh "$S"
(请参阅“清理”)。

Doctor

诊断

Read-only; changes nothing. Run it after
up.sh
and whenever a drive misbehaves.
bash
$V/doctor.sh "$S"
sandbox   verify-board-20261014-205253-3f2a running
vb        0.9.0
board     http://127.0.0.1:4100/api/board as ubuntu (local:user:ubuntu)
It checks that
sandbox ls --all
shows the sandbox
running
, that the sandbox's
vb --version
equals the version under test (
packages/board/package.json
of this checkout, or the
--published
version), and that the board answers
vb whoami
. Exit 1 on any miss. A
stopped
sandbox hit its timeout: tear it down and launch again.
此操作是只读的,不会进行任何更改。运行
up.sh
后,以及每次驱动测试行为异常时,都应执行它。
bash
$V/doctor.sh "$S"
sandbox   verify-board-20261014-205253-3f2a running
vb        0.9.0
board     http://127.0.0.1:4100/api/board as ubuntu (local:user:ubuntu)
它会检查
sandbox ls --all
是否显示 sandbox 处于
running
状态、sandbox 中的
vb --version
是否等于被测版本(当前 checkout 的
packages/board/package.json
,或
--published
指定的版本),以及 board 是否能响应
vb whoami
。任一检查不通过,均以 1 退出。处于
stopped
状态的 sandbox 说明已超时:将其拆除并重新启动。

Drive

驱动测试

Two wrappers. Both run in
/vercel/proj
(the served project) with
BOARD_URL
set to the board, pass stdout, stderr, and the exit code through, and append each call to the transcript.
bash
$V/vb.sh "$S" post dev "hello from a sandbox" --label kind=bug   # argv, no shell; prints the id
$V/vb.sh "$S" read dev --json
$V/sh.sh "$S" 'echo "from stdin" | vb reply 2 -'                  # a bash line, vb on PATH
$V/sh.sh "$S" '(sleep 3; vb post dev late) & vb wait dev --timeout 30s'
A worked drive, posting and threads end to end with checks that fail loudly:
bash
$V/drive-posting.sh "$S"     # posting and threads: ok (thread #2)
Real commands to reach for (see
vb help
and
features/
for the rest):
WhatCommand
post, reply, edit, delete
vb post dev "text" --label k=v
,
vb reply <id> "text"
,
vb edit <id> "text"
,
vb delete <id>
idempotent post
vb post dev "text" --idempotency-key <key>
(same id twice)
attach
sh.sh 'printf x > f.txt && vb reply <id> "file" --attach f.txt'
, then
vb download <attachment> -
read
vb read dev
,
vb read <id>
, filters
--label k[=v]
,
--by
,
--text
,
--re
,
--mentions
,
--json
react, label
vb react <id> eyes [--remove]
,
vb label <id> k=v --unset k
live
vb wait dev --timeout 30s
(exit 1,
reason: "timeout"
, on timeout),
timeout 6 vb tail dev
who, where
vb whoami --json
,
vb channels
,
vb actors
Any other command in the sandbox:
$V/sb.sh exec "$S" -- <cmd...>
(not logged). Copy a file out:
$V/sb.sh cp "$S:/vercel/proj/<path>" <local path>
.
Never point the sandbox's
vb
at a remote board. Its board is the local one; the production factory board syncs to Slack and GitHub.
有两个 wrapper。两者均在
/vercel/proj
(被服务的项目)中运行,并将
BOARD_URL
设为该 board;它们会透传 stdout、stderr 和退出码,并将每次调用追加到 transcript。
bash
$V/vb.sh "$S" post dev "hello from a sandbox" --label kind=bug   # argv, no shell; prints the id
$V/vb.sh "$S" read dev --json
$V/sh.sh "$S" 'echo "from stdin" | vb reply 2 -'                  # a bash line, vb on PATH
$V/sh.sh "$S" '(sleep 3; vb post dev late) & vb wait dev --timeout 30s'
下面是一个完整示例,端到端执行发帖和 thread 操作,并包含遇到问题即明确报错的检查:
bash
$V/drive-posting.sh "$S"     # posting and threads: ok (thread #2)
常用实际命令如下(其余命令参见
vb help
和
features/
):
用途命令
发布、回复、编辑、删除
vb post dev "text" --label k=v
、
vb reply <id> "text"
、
vb edit <id> "text"
、
vb delete <id>
幂等发帖
vb post dev "text" --idempotency-key <key>
(两次使用同一 ID)
附件
sh.sh 'printf x > f.txt && vb reply <id> "file" --attach f.txt'
,然后执行
vb download <attachment> -
读取
vb read dev
、
vb read <id>
,过滤器包括
--label k[=v]
、
--by
、
--text
、
--re
、
--mentions
、
--json
reaction、label
vb react <id> eyes [--remove]
、
vb label <id> k=v --unset k
实时功能
vb wait dev --timeout 30s
(超时时退出 1,并显示
reason: "timeout"
)、
timeout 6 vb tail dev
身份与位置
vb whoami --json
、
vb channels
、
vb actors
如需在 sandbox 中执行其他命令:
$V/sb.sh exec "$S" -- <cmd...>
(不会记录到 transcript)。复制文件:
$V/sb.sh cp "$S:/vercel/proj/<path>" <local path>
。
绝不要将 sandbox 中的
vb
指向远程 board。它必须使用本地 board;生产环境的 factory board 会同步到 Slack 和 GitHub。

Evidence

证据

Everything lands in
.verify/board/<timestamp>/
in the repo (gitignored), which survives teardown:
FileWhat
meta
sandbox name, mode (source/published), version, commit, count of dirty files
up.log
setup output: create, install, build, serve
doctor.txt
each doctor run
transcript.txt
every
vb.sh
/
sh.sh
call:
$ command
, output,
[exit N]
when nonzero
files/
from
collect.sh
(run by
down.sh
):
.board/
(
local.db
+ WAL and
local/
for its files, or
board.db
and
attachments/
on an older board),
serve.log
,
read.json
(
vb read <id> --json
of every thread),
files.txt
down.txt
the removal
Proof standards:
  • The real user path. Drive
    vb
    as a person or agent would, against the served board. No calls into source, no test harness, no hand-written HTTP.
  • Action, then resulting state. Every write is followed by a read that shows it (
    vb post
    then
    vb read <id>
    ;
    vb label
    then
    vb read dev --label k=v
    ). An exit code alone proves little;
    vb edit
    and
    vb delete
    print nothing on success.
  • Side effects. Show the files the action leaves: the attachment under
    .board/local/
    (an older board's
    .board/attachments/
    ), the WAL growing,
    ~/.claude/settings.json
    in a throwaway
    HOME
    .
  • Errors too. A misuse exits 2 (
    error: Unknown command …
    ,
    error: Missing …
    ); a missing thread exits 1 with
    error: Couldn't find message #N.
    With
    --json
    , stderr is one JSON document with its
    reason
    . Capture both when behavior at the edges is the claim.
  • Quote the transcript lines that prove the claim, and give the evidence path.
所有内容都会落到仓库中的
.verify/board/<timestamp>/
(已加入 gitignore),并在拆除 sandbox 后继续保留:
文件内容
meta
sandbox 名称、模式(source/published)、版本、commit、脏文件数量
up.log
设置输出:创建、安装、构建、serve
doctor.txt
每次 doctor 运行结果
transcript.txt
每次
vb.sh
/
sh.sh
调用:
$ command
、输出,以及非零退出时的
[exit N]
files/
由
collect.sh
收集:
.board/
(新版包含
local.db
、WAL 和用于存放文件的
local/
;旧版 board 包含
board.db
和
attachments/
)、
serve.log
、
read.json
(每个 thread 的
vb read <id> --json
结果)、
files.txt
down.txt
sandbox 的移除结果
验证标准:
  • 真实用户路径。 像用户或 Agent 一样,针对已启动的 board 操作
    vb
    。不直接调用源代码,不使用测试 harness,也不手写 HTTP 请求。
  • 先执行操作,再展示结果状态。 每次写操作后都要执行一次读取来展示结果(
    vb post
    后执行
    vb read <id>
    ;
    vb label
    后执行
    vb read dev --label k=v
    )。仅凭退出码几乎无法证明任何事情;
    vb edit
    和
    vb delete
    成功时不会打印任何内容。
  • 副作用。 展示操作留下的文件:位于
    .board/local/
    下的附件(较旧 board 中为
    .board/attachments/
    )、增长中的 WAL,以及一次性
    HOME
    中的
    ~/.claude/settings.json
    。
  • 错误场景也要验证。 错误用法会退出 2(
    error: Unknown command …
    、
    error: Missing …
    );找不到 thread 时退出 1,并显示
    error: Couldn't find message #N.
    。使用
    --json
    时,stderr 是一个包含
    reason
    的 JSON 文档。在验证边界行为时,两种错误形式都要捕获。
  • 引用 transcript 中能够证明结论的行,并给出证据路径。

Cleanup

清理

bash
$V/down.sh "$S"              # collect evidence, rm the sandbox, confirm `sandbox ls --all` no longer lists it
$V/down.sh "$S" --no-collect # when the sandbox is already broken
Remove only the sandbox you created, by its exact name.
down.sh
refuses anything that isn't
verify-board-<YYYYMMDD-HHMMSS>-<hex>
, and never removes by pattern: other agents may be running their own sandboxes in the same scope. After a failed attempt, run
down.sh
before trying again, then check
$V/sb.sh ls --all --name-prefix "$S"
for your name. Never commit
.verify/
.
bash
$V/down.sh "$S"              # collect evidence, rm the sandbox, confirm `sandbox ls --all` no longer lists it
$V/down.sh "$S" --no-collect # when the sandbox is already broken
仅按精确名称移除你创建的 sandbox。
down.sh
会拒绝任何名称不符合
verify-board-<YYYYMMDD-HHMMSS>-<hex>
的对象,并且绝不按模式批量移除:同一 scope 中可能还有其他 Agent 正在运行各自的 sandbox。失败尝试后,在重试前运行
down.sh
,然后通过
$V/sb.sh ls --all --name-prefix "$S"
检查你的名称。切勿提交
.verify/
。

Helpers

辅助脚本

ScriptUse
sb.sh <cmd> [args]
npx --yes sandbox@4.8.1 <cmd> --scope vercel-labs
(
SANDBOX_SCOPE
overrides)
up.sh [--published <v>]
create, upload or install, serve; prints the name
doctor.sh <name>
read-only health check
vb.sh <name> <args…>
vb
in the sandbox, logged
sh.sh <name> '<line>'
a bash line in the sandbox,
vb
on PATH, logged
drive-posting.sh <name>
the worked posting-and-threads drive
collect.sh <name>
copy
.board/
, the serve log, and
read.json
out
down.sh <name> [--no-collect]
collect, remove, confirm
common.sh
sourced: paths, name check,
sbx
,
sbx_script
,
run_logged
Each sandbox command costs a few seconds of round trip; batch related steps into one
sh.sh
line when timing doesn't matter. Pass multi-line text through stdin (
sh.sh 'printf "a\nb" | vb post dev -'
), not as a
vb.sh
argument.
脚本用途
sb.sh <cmd> [args]
执行
npx --yes sandbox@4.8.1 <cmd> --scope vercel-labs
(可通过
SANDBOX_SCOPE
覆盖)
up.sh [--published <v>]
创建、上传或安装、启动服务;打印名称
doctor.sh <name>
只读健康检查
vb.sh <name> <args…>
在 sandbox 中运行
vb
,并记录日志
sh.sh <name> '<line>'
在 sandbox 中运行一行 bash,确保
vb
位于 PATH 中,并记录日志
drive-posting.sh <name>
完整的发帖与 thread 驱动测试
collect.sh <name>
复制
.board/
、serve 日志和
read.json
down.sh <name> [--no-collect]
收集、移除并确认
common.sh
供 source 使用:路径、名称检查、
sbx
、
sbx_script
、
run_logged
每条 sandbox 命令的往返都会耗费数秒;如果不涉及时序问题,可将相关步骤合并到一行
sh.sh
中执行。多行文本应通过 stdin 传入(
sh.sh 'printf "a\nb" | vb post dev -'
),不要作为
vb.sh
参数。