Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

3.9 KB
Raw Blame
{
  "schemaVersion": 1,
  "featureId": "feat_custom_network_boundary",
  "title": "Local-first network-access boundary",
  "summary": "Worktrunk is local-first: the network is touched only when the user asked for it. The audit keys on the calling command, not a fixed blocklist — an egress (`git fetch`, `git ls-remote`, `gh`, `glab`, `az`, HTTP) is a violation when it sits in a fast command or a synchronous hot path (a shell prompt) that cannot absorb the latency, or in a background TTL-cache refresh. A foreground command the user runs and waits on may reach the wire for the activity it was asked to perform, and must still paint its first frame from local data — network-derived detail streams in behind it. Sanctioned activities: CI status (`wt list --full`, `wt list statusline`, and plain `wt list` when `[list] columns` names `ci`); the interactive `wt switch` picker, the most forgiving home for forge data because its lifetime is bounded by the user rather than the job — per-row CI status, the per-row `gh pr view --json comments` / `glab api …/notes` that fills a row's `comments` tab, and the `gh pr list` / `glab mr list` plus per-row previews behind `wt switch --prs`; branch-summary and commit-message generation (`commit.generation` commands); PR/MR resolution (`wt switch pr:`/`mr:`); and the `wt config show --full` version check; plus the one detection-helper exception — the first `Repository::default_branch()` per repo may fall through to `git ls-remote`, caching into `worktrunk.default-branch`. Silent lookup fallthroughs (alias dispatch, hook context build, recovery) must stay local. See AGENTS.md > Network Access.",
  "kind": "library",
  "source": "manual",
  "confidence": "high",
  "entrypoints": [
    {
      "path": "src/git/repository/config.rs",
      "symbol": "default_branch",
      "route": null,
      "command": null
    }
  ],
  "ownedFiles": [
    {
      "path": "src/git/repository/config.rs",
      "reason": "default_branch(): the one sanctioned ls-remote fallback and its worktrunk.default-branch cache"
    },
    {
      "path": "src/commands/statusline.rs",
      "reason": "`wt list statusline`: runs on every prompt but is not a fast command — Claude Code consumes its output asynchronously — so its CI-status egress is sanctioned; audit only that it adds no other unrequested network work"
    }
  ],
  "contextFiles": [
    {
      "path": "src/git/remote_ref/mod.rs",
      "reason": "PR/MR fetch: the legitimate user-invoked egress, must not run on background paths"
    },
    {
      "path": "src/commands/picker/prs.rs",
      "reason": "picker forge fetches (`spawn_pr_previews`, `spawn_comments_fetch`): sanctioned because the picker paints before they start and its exit cancels whatever is unfinished"
    },
    {
      "path": "src/commands/list/ci_status/mod.rs",
      "reason": "CI-status egress: where `gh`/`glab` spawn for `wt list --full`, `wt list statusline`, a `ci` column, and the picker's per-row status — the sanctioned calls `statusline.rs` and the picker reach the wire through"
    },
    {
      "path": "src/shell_exec.rs",
      "reason": "Cmd: where external commands (git, gh, glab) spawn"
    },
    {
      "path": "src/commands/alias.rs",
      "reason": "alias dispatch must resolve locally, no fallthrough to the wire"
    },
    {
      "path": "AGENTS.md",
      "reason": "Network Access policy and the default_branch detection-helper exception"
    }
  ],
  "tests": [
    {
      "path": "tests/integration_tests/switch.rs",
      "command": "cargo test --test integration switch"
    }
  ],
  "tags": [
    "rust",
    "network-policy",
    "performance",
    "audit"
  ],
  "trustBoundaries": [
    "network",
    "process-exec"
  ],
  "status": "pending",
  "lock": null,
  "findingIds": [],
  "patchAttemptIds": [],
  "analysisHistory": [],
  "createdAt": "2026-05-19T00:00:00.000Z",
  "updatedAt": "2026-09-20T00:00:00.000Z"
}