English | 简体中文
Like a craftsperson's trestle holding blueprints, workboards, and verification gauges—supporting task lineage, handoff briefs, and confirmation receipts without intruding on external source repositories.
Trestle (wb) is a local-first, domain-agnostic personal task, handoff, and delivery-verification workbench written in Rust (edition = "2024").
- Single static binary: Compiles to
wb(target/release/wbortarget/debug/wb) with zero Python or Node.js runtime dependencies (Gitis optional; task tracking and the dashboard work even whengitis unavailable). - Strict workspace separation: The workbench directory stores task metadata, chronological progress, delivery declarations, verification receipts, and design/analysis docs—never copies of external business source trees (
repos_root). - Declarations vs. observations:
tasks/<task-id>/delivery.yamlholds explicit delivery targets (repo,worktree,source_branch,target_branch,compare_base,allowed_paths,depends_on) and required verificationactions, protected by optimisticrevisionlocking and immutable snapshots intasks/<task-id>/delivery-history/..wb-runtime/observations/<task-id>.jsonholds read-only Git facts collected bywb sync(actual branch, fullHEADcommit, dirty file count, file SHA-256 digests, branch mismatches, out-of-scope paths).wb syncnever overwritesdelivery.yamlor mutatestask.yaml'supdated_at.
- Append-only progress & receipt-driven confirmation:
tasks/<task-id>/progress.mdis strictly append-only. Action sign-off requires an explicit receipt (tasks/<task-id>/evidence/confirm-<action-id>.json) matching--by,--source, and--digest <scope_sha256>. Completion is never inferred from prose inprogress.md; any scope change or missing receipt automatically invalidates confirmation. - Generated index:
tasks/INDEX.mdis automatically regenerated on task mutations and workspace upgrades.
cargo build --offline
cargo build --release --offline
cargo test --offlineFrontend assets for the embedded dashboard (web/src/{index.html,app.js,styles.css}) are pre-copied into src/static/ and compiled into wb via include_str!. If you edit files under web/src/, refresh src/static/ with:
cd web && npm run build./target/release/wb init ~/my-workbench --yes --example --agent-guide
cd ~/my-workbenchKey wb init flags:
--dry-run: Preview directories and files to be created without writing to disk.--name <name>: Set workbench display name in.wb.yml.--repos-root <path>: External repositories root directory (default../repos).--timezone <tz>: Workbench timezone (e.g.,Asia/Shanghai).--port <port>: Default dashboard port in.wb.yml(default8791).--example: Generate sample taskTASK-EXAMPLE-001.--agent-guide: Create anAGENTS.mdpointer toWORKBENCH.mdif absent.
Every wb invocation resolves the workbench root (containing .wb.yml) in strict order:
- Global flag
--workspace <path> - Environment variable
WB_ROOT - Upward directory walk from the current working directory
# Create a task and register its originating session
wb new TASK-101 \
--title "Implement cache invalidation strategy" \
--goal "Prevent stale reads under concurrent writes" \
--priority P1 --category requirement --owner alice \
--session-id sess-1 --host devbox --session-title "[FD] Cache design discussion"
# Advance status, append chronological progress, maintain next steps & blockers
wb status TASK-101 in_progress --note "Started core implementation"
wb progress TASK-101 "Completed initial double-delete cache draft"
wb next TASK-101 add "Add concurrent race unit tests"
wb blocker TASK-101 add "Waiting on staging configuration confirmation"
# Generate <= 80-line plain handoff brief for a fresh agent or human session
wb context TASK-101 --plainAdditional task management commands:
wb context <id> [--plain | --full | --json] [--max-lines 80]wb next <id> add|done|remove|clear ...andwb blocker <id> add|resolve|remove|clear ...wb milestone <id> add|complete|done|reopen|undone|remove <title> [--done]wb component|doc|material <id> add|remove ...andwb link <id> <url>wb task list [--status ...] [--category ...] [--priority ...] [--owner ...] [--component ...] [--json]wb task stats [--json]wb task record [--task <id>] --session-id <sid> --title "<title>" [--host localhost] [--category ...] [--role associated]
Single-prefix session convention: Session titles may carry at most one bracketed category prefix—[FD] (requirement), [CR] (code review), [OC] (oncall), or [DA] (data analysis). Stacked or unknown prefixes are rejected with exit code 2.
# Apply or update delivery.yaml (pass --expected-revision on updates for optimistic concurrency)
wb delivery apply TASK-101 --file /path/to/delivery-draft.yaml
# Inspect current delivery declaration
wb delivery show TASK-101
# Read-only scan of external Git worktrees (gracefully degrades if Git is absent)
wb sync TASK-101 # or: wb sync --all
# Pin compare_base to the latest observed commit
wb delivery pin TASK-101
# List actions and inspect current scope_sha256 digests
wb action list TASK-101
# Issue explicit confirmation receipt
wb action confirm TASK-101 act-test --by alice --source "local-cargo-test" --digest <scope_sha256>
# Import and export verification artifacts
wb evidence import TASK-101 ./test-report.log
wb evidence export TASK-101 --out ./exported-evidence# Generate an 8-dimension engineering review prompt and register 3 aligned output paths
wb review prepare TASK-101 --url https://example.local/pr/42 --report analysis/cr-42.md
# Read-only health check (config, schema, doc refs, branch consistency, invalidated/missing receipts)
wb doctor --json
# Safe workspace template/index upgrade (creates backup before applying)
wb workspace upgrade --dry-run
wb workspace upgrade --applyThe 8 built-in review dimensions in wb review prepare cover: Scope & Functionality, Root-Cause Effectiveness, Backward Compatibility, Stability & Concurrency, Performance & Cost, Exception Defense, Responsibility Boundaries, and Verification Adequacy.
# Start read-only dashboard bound strictly to 127.0.0.1 (default port 8791 from .wb.yml)
wb dashboard serve --port 8791
# Check running instance status and stop safely (verifies instance_id before shutdown)
wb dashboard status --json
wb dashboard stop
# Inspect discovered extensions and gating/probe states
wb extensions list --jsonThe embedded single-page dashboard renders five read-only views (Overview, Task Board, Sessions, Repos & Reviews, Timeline) using safe textContent DOM rendering, plus a slide-over task drawer, Markdown preview modal, and CSV export (/api/export.csv).
- Loopback & origin protection: Binds exclusively to
127.0.0.1, validatesHost(127.0.0.1/localhost), enforces CSP (default-src 'self'),X-Frame-Options: DENY,X-Content-Type-Options: nosniff,Referrer-Policy: no-referrer, and requires matchingOrigin/RefererplusX-Wb-Csrf-TokenonPOST /api/refreshandPOST /api/shutdown. - Path & formula guards:
/api/doconly reads registered relative.mdfiles inside the workspace (blocking.., backslashes, symlink escapes, and files> 2 MiB) and runs credential redaction (src/dashboard/redaction.rs)./api/export.csvescapes spreadsheet formula prefixes (=,+,-,@,\t,\r). - Bounded collection:
2 MiBper file,10 MiBper task,100 MiBworkspace scan cap, and25 MiBsnapshot JSON cap, retaining the prior snapshot if watched files mutate mid-scan.
Extension manifests (.json) discovered under WB_EXTENSION_MANIFESTS or <workspace>/extensions/ remain disabled unless explicitly enabled in .wb.yml (extensions: [...]), then undergo offline local checks (requires_bins, requires_paths, probe_cmd) with per-extension error isolation.
| Exit Code | Meaning |
|---|---|
0 |
Success |
1 |
Dashboard runtime error (port conflict, instance_id mismatch, etc.) |
2 |
Validation, schema, dependency-cycle, path-escape, or wb doctor failure |
3 |
Target workspace, task, action, or file not found |
4 |
Optimistic revision conflict or scope_sha256 digest mismatch |
5 |
Local filesystem I/O failure |
<workspace>/
├── .wb.yml # Workbench config (schema, name, repos_root, timezone, dashboard_port, extensions)
├── WORKBENCH.md # Collaboration rules written by wb init
├── tasks/
│ ├── INDEX.md # Auto-generated task index (do not edit manually)
│ ├── session-types.json # Deduplicated session category ledger
│ └── <task-id>/
│ ├── task.yaml # Task metadata, status, milestones, blockers, next_steps, sessions
│ ├── progress.md # Append-only chronological progress log
│ ├── delivery.yaml # Optional delivery declaration & action scopes
│ ├── delivery-history/ # Immutable rev-XXXX.yaml snapshots
│ └── evidence/ # confirm-<action-id>.json receipts & imported evidence
├── docs/ # Long-lived specs & design notes
├── analysis/ # Investigation & CR review artifacts
├── extensions/ # Optional extension manifests (*.json)
└── .wb-runtime/ # Locks, sync observations, upgrade backups, dashboard.json (gitignored)
MIT (as declared in Cargo.toml)