Skip to content

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

fix(list): keep `[list] columns` out of the `--format json` plan (#3812)

Worktrunk Bot246c6bd9191d
diff --git a/CLAUDE.md b/CLAUDE.md
index 94656e51f..7485d0900 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -117,7 +117,7 @@ Why: silent "lookup" paths that walk to the wire (alias dispatch, hook context b
What currently reaches the wire:
-- `wt list --full`, `wt list statusline` — CI status; also plain `wt list` (any format) when `[list] columns` names `ci`, which forces the column (and its fetch) on without `--full`
+- `wt list --full`, `wt list statusline` — CI status; also plain `wt list` (table) when `[list] columns` names `ci`, which forces the column (and its fetch) on without `--full`. `--format json` plans off `--full` alone, so a display setting can't send a machine-readable call to a forge
- `wt switch` (interactive picker, no target) — per-row CI status, primed from the local cache then fetched live and streamed into the rows; once a row's CI fetch surfaces an open PR/MR, a per-row background `gh pr view <n> --json comments` (`glab api …/notes` on GitLab) fills that row's `comments` preview tab — the same fetch a `--prs` row makes, spawned once per row from `progressive_handler` (see `picker::prs::spawn_comments_fetch`). The `comments` tab is the only PR data fetched lazily here; `pr` rides the CI call and `log` is the local `git log`
- generating a branch summary with a `commit.generation` command
- generating a commit message with a `commit.generation` command
diff --git a/dev/config.example.toml b/dev/config.example.toml
index 5cb65a855..c7cf95132 100644
--- a/dev/config.example.toml
+++ b/dev/config.example.toml
@@ -106,11 +106,13 @@
#
# timeout-ms = 0 # Wall-clock budget for the entire collect phase; 0 disables
#
-# `columns` selects and orders the columns to render; omit it for the default set.
-# It is meant to drive a per-invocation alias (https://worktrunk.dev/extending/#aliases)
-# (`wt --config-set 'list.columns=[…]' list`), giving a named view without
-# disturbing the default `wt list`. A static setting works but pins one layout
-# over a table that otherwise adapts to `--full` and terminal width.
+# `columns` selects and orders the columns the `wt list` table and the `wt switch`
+# picker render; `--format json` ignores it and always emits every field. Omit it
+# for the default set. It is meant to drive a per-invocation
+# alias (https://worktrunk.dev/extending/#aliases) (`wt --config-set 'list.columns=[…]' list`),
+# giving a named view without disturbing the default `wt list`. A static setting
+# works but pins one layout over a table that otherwise adapts to `--full` and
+# terminal width.
#
# Valid built-in names:
#
@@ -140,11 +142,6 @@
# needs an LLM command (`[commit.generation]`), `url` needs a `[list] url`
# template — since listing can't supply the data.
#
-# The selection drives the table and the `wt switch` picker. `wt list --format
-# json` always emits every field, but a listed gated column (`ci`, `summary`)
-# still forces its data collection on, so the JSON carries the same data the
-# table shows.
-#
# #### Custom columns [experimental]
#
# Custom columns add per-branch context to the `wt list` table. Each
diff --git a/docs/content/config.md b/docs/content/config.md
index 1db49d161..2946339e1 100644
--- a/docs/content/config.md
+++ b/docs/content/config.md
@@ -194,11 +194,13 @@ columns = ["branch", "status", "ci", "path"] # Columns to show, in order — b
timeout-ms = 0 # Wall-clock budget for the entire collect phase; 0 disables
```
-`columns` selects and orders the columns to render; omit it for the default set.
-It is meant to drive a per-invocation [alias](@/extending.md#aliases)
-(`wt --config-set 'list.columns=[…]' list`), giving a named view without
-disturbing the default `wt list`. A static setting works but pins one layout
-over a table that otherwise adapts to `--full` and terminal width.
+`columns` selects and orders the columns the `wt list` table and the `wt switch`
+picker render; `--format json` ignores it and always emits every field. Omit it
+for the default set. It is meant to drive a per-invocation
+[alias](@/extending.md#aliases) (`wt --config-set 'list.columns=[…]' list`),
+giving a named view without disturbing the default `wt list`. A static setting
+works but pins one layout over a table that otherwise adapts to `--full` and
+terminal width.
Valid built-in names:
@@ -228,11 +230,6 @@ named one. A column whose data source is missing still stays hidden — `summary
needs an LLM command (`[commit.generation]`), `url` needs a `[list] url`
template — since listing can't supply the data.
-The selection drives the table and the `wt switch` picker. `wt list --format
-json` always emits every field, but a listed gated column (`ci`, `summary`)
-still forces its data collection on, so the JSON carries the same data the
-table shows.
-
#### Custom columns
<span class="badge-experimental"></span>
diff --git a/docs/content/list.md b/docs/content/list.md
index e89abb534..d3948f098 100644
--- a/docs/content/list.md
+++ b/docs/content/list.md
@@ -279,10 +279,10 @@ Item fields:
| `worktree` | `{path, main, current, previous, detached, locked, prunable, branch_mismatch, duplicate_branch, operation, changes}`; absent on branch-only rows. `locked`/`prunable` are `{reason}` objects and can co-occur; `operation` is `"rebase"` or `"merge"`; `changes` holds the five working-tree flags plus `conflicted` and `diff {added, deleted}` |
| `default_branch` | Relation to the default branch: `{ahead, behind, diff, orphan, integration, merge_conflicts}`; absent on the default branch itself. `integration.reason` is one of `same_commit`, `ancestor`, `no_added_changes`, `trees_match`, `merge_adds_nothing`, `patch_id_match`; a dirty tree skips the checks, leaving `integration` null |
| `upstream` | Tracking branch: `{remote, branch, ahead, behind}`; absent when none is configured |
-| `pr` | Open PR/MR: `{number, url, review, mergeable, repo}`; collected with `--full` or a listed `ci` column. `review` uses the schema 1 `ci.review_state` vocabulary; `mergeable` is false when the forge reports conflicts, null otherwise |
-| `checks` | CI pipeline: `{status, source, stale}`; `status` is `passed`, `running`, or `failed` — null when a conflicts report masks it |
+| `pr` | Open PR/MR: `{number, url, review, mergeable, repo}`; collected with `--full`. `review` uses the schema 1 `ci.review_state` vocabulary; `mergeable` is false when the forge reports conflicts, null otherwise |
+| `checks` | CI pipeline: `{status, source, stale}`; collected with `--full`. `status` is `passed`, `running`, or `failed` — null when a conflicts report masks it |
| `dev_server` | `{url, listening}` from the project's `list.url` template |
-| `summary` | LLM branch summary (requires `[list] summary = true`) |
+| `summary` | LLM branch summary; needs `--full`, `[list] summary = true`, and a `[commit.generation]` command |
| `vars` | Per-branch variables from [`wt config state vars`](@/config.md#wt-config-state-vars) |
| `display` | Rendered strings: `state` (schema 1's `main_state` vocabulary), `symbols`, `statusline` (with ANSI colors and OSC 8 hyperlinks), `columns` (custom-column cells keyed by header) |
diff --git a/docs/static/schema/list-v2.json b/docs/static/schema/list-v2.json
index 4003140b6..51bf15bdb 100644
--- a/docs/static/schema/list-v2.json
+++ b/docs/static/schema/list-v2.json
@@ -16,7 +16,7 @@
]
},
"Collected": {
- "description": "Fact families whose collection is gated (`--full`, `[list] summary`,\na listed `ci`/`summary` column). Ungated families (working tree, counts,\ndiffs) are always requested. Serialized as-is into the schema-2 JSON\nenvelope's `collected` field, disambiguating \"absent because not\nrequested\".",
+ "description": "Fact families whose collection is gated (`--full`, `[list] summary`).\nUngated families (working tree, counts, diffs) are always requested.\nSerialized as-is into the schema-2 JSON envelope's `collected` field,\ndisambiguating \"absent because not requested\".",
"properties": {
"ci": {
"description": "Forge CI/PR data was fetched.",
diff --git a/plugins/worktrunk/skills/worktrunk/reference/config.md b/plugins/worktrunk/skills/worktrunk/reference/config.md
index 5a4468283..b2f585769 100644
--- a/plugins/worktrunk/skills/worktrunk/reference/config.md
+++ b/plugins/worktrunk/skills/worktrunk/reference/config.md
@@ -193,11 +193,13 @@ columns = ["branch", "status", "ci", "path"] # Columns to show, in order — b
timeout-ms = 0 # Wall-clock budget for the entire collect phase; 0 disables
```
-`columns` selects and orders the columns to render; omit it for the default set.
-It is meant to drive a per-invocation [alias](https://worktrunk.dev/extending/#aliases)
-(`wt --config-set 'list.columns=[…]' list`), giving a named view without
-disturbing the default `wt list`. A static setting works but pins one layout
-over a table that otherwise adapts to `--full` and terminal width.
+`columns` selects and orders the columns the `wt list` table and the `wt switch`
+picker render; `--format json` ignores it and always emits every field. Omit it
+for the default set. It is meant to drive a per-invocation
+[alias](https://worktrunk.dev/extending/#aliases) (`wt --config-set 'list.columns=[…]' list`),
+giving a named view without disturbing the default `wt list`. A static setting
+works but pins one layout over a table that otherwise adapts to `--full` and
+terminal width.
Valid built-in names:
@@ -227,11 +229,6 @@ named one. A column whose data source is missing still stays hidden — `summary
needs an LLM command (`[commit.generation]`), `url` needs a `[list] url`
template — since listing can't supply the data.
-The selection drives the table and the `wt switch` picker. `wt list --format
-json` always emits every field, but a listed gated column (`ci`, `summary`)
-still forces its data collection on, so the JSON carries the same data the
-table shows.
-
#### Custom columns [experimental]
Custom columns add per-branch context to the `wt list` table. Each
diff --git a/plugins/worktrunk/skills/worktrunk/reference/list.md b/plugins/worktrunk/skills/worktrunk/reference/list.md
index a9fb36ce1..643e89720 100644
--- a/plugins/worktrunk/skills/worktrunk/reference/list.md
+++ b/plugins/worktrunk/skills/worktrunk/reference/list.md
@@ -264,10 +264,10 @@ Item fields:
| `worktree` | `{path, main, current, previous, detached, locked, prunable, branch_mismatch, duplicate_branch, operation, changes}`; absent on branch-only rows. `locked`/`prunable` are `{reason}` objects and can co-occur; `operation` is `"rebase"` or `"merge"`; `changes` holds the five working-tree flags plus `conflicted` and `diff {added, deleted}` |
| `default_branch` | Relation to the default branch: `{ahead, behind, diff, orphan, integration, merge_conflicts}`; absent on the default branch itself. `integration.reason` is one of `same_commit`, `ancestor`, `no_added_changes`, `trees_match`, `merge_adds_nothing`, `patch_id_match`; a dirty tree skips the checks, leaving `integration` null |
| `upstream` | Tracking branch: `{remote, branch, ahead, behind}`; absent when none is configured |
-| `pr` | Open PR/MR: `{number, url, review, mergeable, repo}`; collected with `--full` or a listed `ci` column. `review` uses the schema 1 `ci.review_state` vocabulary; `mergeable` is false when the forge reports conflicts, null otherwise |
-| `checks` | CI pipeline: `{status, source, stale}`; `status` is `passed`, `running`, or `failed` — null when a conflicts report masks it |
+| `pr` | Open PR/MR: `{number, url, review, mergeable, repo}`; collected with `--full`. `review` uses the schema 1 `ci.review_state` vocabulary; `mergeable` is false when the forge reports conflicts, null otherwise |
+| `checks` | CI pipeline: `{status, source, stale}`; collected with `--full`. `status` is `passed`, `running`, or `failed` — null when a conflicts report masks it |
| `dev_server` | `{url, listening}` from the project's `list.url` template |
-| `summary` | LLM branch summary (requires `[list] summary = true`) |
+| `summary` | LLM branch summary; needs `--full`, `[list] summary = true`, and a `[commit.generation]` command |
| `vars` | Per-branch variables from [`wt config state vars`](https://worktrunk.dev/config/#wt-config-state-vars) |
| `display` | Rendered strings: `state` (schema 1's `main_state` vocabulary), `symbols`, `statusline` (with ANSI colors and OSC 8 hyperlinks), `columns` (custom-column cells keyed by header) |
diff --git a/skills/worktrunk/reference/config.md b/skills/worktrunk/reference/config.md
index 5a4468283..b2f585769 100644
--- a/skills/worktrunk/reference/config.md
+++ b/skills/worktrunk/reference/config.md
@@ -193,11 +193,13 @@ columns = ["branch", "status", "ci", "path"] # Columns to show, in order — b
timeout-ms = 0 # Wall-clock budget for the entire collect phase; 0 disables
```
-`columns` selects and orders the columns to render; omit it for the default set.
-It is meant to drive a per-invocation [alias](https://worktrunk.dev/extending/#aliases)
-(`wt --config-set 'list.columns=[…]' list`), giving a named view without
-disturbing the default `wt list`. A static setting works but pins one layout
-over a table that otherwise adapts to `--full` and terminal width.
+`columns` selects and orders the columns the `wt list` table and the `wt switch`
+picker render; `--format json` ignores it and always emits every field. Omit it
+for the default set. It is meant to drive a per-invocation
+[alias](https://worktrunk.dev/extending/#aliases) (`wt --config-set 'list.columns=[…]' list`),
+giving a named view without disturbing the default `wt list`. A static setting
+works but pins one layout over a table that otherwise adapts to `--full` and
+terminal width.
Valid built-in names:
@@ -227,11 +229,6 @@ named one. A column whose data source is missing still stays hidden — `summary
needs an LLM command (`[commit.generation]`), `url` needs a `[list] url`
template — since listing can't supply the data.
-The selection drives the table and the `wt switch` picker. `wt list --format
-json` always emits every field, but a listed gated column (`ci`, `summary`)
-still forces its data collection on, so the JSON carries the same data the
-table shows.
-
#### Custom columns [experimental]
Custom columns add per-branch context to the `wt list` table. Each
diff --git a/skills/worktrunk/reference/list.md b/skills/worktrunk/reference/list.md
index a9fb36ce1..643e89720 100644
--- a/skills/worktrunk/reference/list.md
+++ b/skills/worktrunk/reference/list.md
@@ -264,10 +264,10 @@ Item fields:
| `worktree` | `{path, main, current, previous, detached, locked, prunable, branch_mismatch, duplicate_branch, operation, changes}`; absent on branch-only rows. `locked`/`prunable` are `{reason}` objects and can co-occur; `operation` is `"rebase"` or `"merge"`; `changes` holds the five working-tree flags plus `conflicted` and `diff {added, deleted}` |
| `default_branch` | Relation to the default branch: `{ahead, behind, diff, orphan, integration, merge_conflicts}`; absent on the default branch itself. `integration.reason` is one of `same_commit`, `ancestor`, `no_added_changes`, `trees_match`, `merge_adds_nothing`, `patch_id_match`; a dirty tree skips the checks, leaving `integration` null |
| `upstream` | Tracking branch: `{remote, branch, ahead, behind}`; absent when none is configured |
-| `pr` | Open PR/MR: `{number, url, review, mergeable, repo}`; collected with `--full` or a listed `ci` column. `review` uses the schema 1 `ci.review_state` vocabulary; `mergeable` is false when the forge reports conflicts, null otherwise |
-| `checks` | CI pipeline: `{status, source, stale}`; `status` is `passed`, `running`, or `failed` — null when a conflicts report masks it |
+| `pr` | Open PR/MR: `{number, url, review, mergeable, repo}`; collected with `--full`. `review` uses the schema 1 `ci.review_state` vocabulary; `mergeable` is false when the forge reports conflicts, null otherwise |
+| `checks` | CI pipeline: `{status, source, stale}`; collected with `--full`. `status` is `passed`, `running`, or `failed` — null when a conflicts report masks it |
| `dev_server` | `{url, listening}` from the project's `list.url` template |
-| `summary` | LLM branch summary (requires `[list] summary = true`) |
+| `summary` | LLM branch summary; needs `--full`, `[list] summary = true`, and a `[commit.generation]` command |
| `vars` | Per-branch variables from [`wt config state vars`](https://worktrunk.dev/config/#wt-config-state-vars) |
| `display` | Rendered strings: `state` (schema 1's `main_state` vocabulary), `symbols`, `statusline` (with ANSI colors and OSC 8 hyperlinks), `columns` (custom-column cells keyed by header) |
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 29c174ee6..587cbae6f 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -1026,10 +1026,10 @@ Item fields:
| `worktree` | `{path, main, current, previous, detached, locked, prunable, branch_mismatch, duplicate_branch, operation, changes}`; absent on branch-only rows. `locked`/`prunable` are `{reason}` objects and can co-occur; `operation` is `"rebase"` or `"merge"`; `changes` holds the five working-tree flags plus `conflicted` and `diff {added, deleted}` |
| `default_branch` | Relation to the default branch: `{ahead, behind, diff, orphan, integration, merge_conflicts}`; absent on the default branch itself. `integration.reason` is one of `same_commit`, `ancestor`, `no_added_changes`, `trees_match`, `merge_adds_nothing`, `patch_id_match`; a dirty tree skips the checks, leaving `integration` null |
| `upstream` | Tracking branch: `{remote, branch, ahead, behind}`; absent when none is configured |
-| `pr` | Open PR/MR: `{number, url, review, mergeable, repo}`; collected with `--full` or a listed `ci` column. `review` uses the schema 1 `ci.review_state` vocabulary; `mergeable` is false when the forge reports conflicts, null otherwise |
-| `checks` | CI pipeline: `{status, source, stale}`; `status` is `passed`, `running`, or `failed` — null when a conflicts report masks it |
+| `pr` | Open PR/MR: `{number, url, review, mergeable, repo}`; collected with `--full`. `review` uses the schema 1 `ci.review_state` vocabulary; `mergeable` is false when the forge reports conflicts, null otherwise |
+| `checks` | CI pipeline: `{status, source, stale}`; collected with `--full`. `status` is `passed`, `running`, or `failed` — null when a conflicts report masks it |
| `dev_server` | `{url, listening}` from the project's `list.url` template |
-| `summary` | LLM branch summary (requires `[list] summary = true`) |
+| `summary` | LLM branch summary; needs `--full`, `[list] summary = true`, and a `[commit.generation]` command |
| `vars` | Per-branch variables from [`wt config state vars`](@/config.md#wt-config-state-vars) |
| `display` | Rendered strings: `state` (schema 1's `main_state` vocabulary), `symbols`, `statusline` (with ANSI colors and OSC 8 hyperlinks), `columns` (custom-column cells keyed by header) |
@@ -2085,11 +2085,13 @@ columns = ["branch", "status", "ci", "path"] # Columns to show, in order — b
timeout-ms = 0 # Wall-clock budget for the entire collect phase; 0 disables
```
-`columns` selects and orders the columns to render; omit it for the default set.
-It is meant to drive a per-invocation [alias](@/extending.md#aliases)
-(`wt --config-set 'list.columns=[…]' list`), giving a named view without
-disturbing the default `wt list`. A static setting works but pins one layout
-over a table that otherwise adapts to `--full` and terminal width.
+`columns` selects and orders the columns the `wt list` table and the `wt switch`
+picker render; `--format json` ignores it and always emits every field. Omit it
+for the default set. It is meant to drive a per-invocation
+[alias](@/extending.md#aliases) (`wt --config-set 'list.columns=[…]' list`),
+giving a named view without disturbing the default `wt list`. A static setting
+works but pins one layout over a table that otherwise adapts to `--full` and
+terminal width.
Valid built-in names:
@@ -2119,11 +2121,6 @@ named one. A column whose data source is missing still stays hidden — `summary
needs an LLM command (`[commit.generation]`), `url` needs a `[list] url`
template — since listing can't supply the data.
-The selection drives the table and the `wt switch` picker. `wt list --format
-json` always emits every field, but a listed gated column (`ci`, `summary`)
-still forces its data collection on, so the JSON carries the same data the
-table shows.
-
#### Custom columns [experimental]
Custom columns add per-branch context to the `wt list` table. Each
diff --git a/src/commands/list/collect/mod.rs b/src/commands/list/collect/mod.rs
index 353aff5f6..1e732452c 100644
--- a/src/commands/list/collect/mod.rs
+++ b/src/commands/list/collect/mod.rs
@@ -1286,11 +1286,11 @@ pub fn collect(
// a listed `summary` that `Default` alone wouldn't plan (LLM command set,
// `[list] summary` off): without it the picker would hide a column `wt list`
// shows. CI is already covered — the picker is always `show_full`.
- // - `--format json` → `all_columns` unioned with the selection's forced-on
- // columns: the every-field contract (`src/cli/mod.rs`) needs the full
- // set, never a narrowing — but a listed `ci` forces the fetch on, so
- // JSON reports the same data the table shows (and `collected.ci` says
- // so).
+ // - `--format json` → `all_columns` alone (source `Default`), so the
+ // selection reaches it in neither direction: the every-field contract
+ // (`src/cli/mod.rs`) rules out narrowing, and a display setting must not
+ // decide whether a machine-readable call reaches a forge — `--full` is
+ // the switch for that (#3787).
//
// So a branch/path `ls` alias over many dirty worktrees runs no `git status`
// / diffs / ahead-behind walks (#3133), while a default column gated off by
@@ -1315,16 +1315,19 @@ pub fn collect(
&gates,
)
};
- let prune_to_selection =
- render_table && progressive_handler.is_none() && !selected_columns.is_empty();
- let tasks = if prune_to_selection {
- listed_plan()
- } else {
- // Picker and JSON: the full set plus the selection's forced-on
- // columns (a no-op when nothing is selected).
+ // The picker runs `collect` with a handler and no table render; JSON is the
+ // remaining handler-less non-table shape.
+ let tasks = if progressive_handler.is_some() {
+ // Picker: the full set plus the selection's forced-on columns (a no-op
+ // when nothing is selected).
let mut tasks = full_plan();
tasks.extend(listed_plan());
tasks
+ } else if render_table && !selected_columns.is_empty() {
+ listed_plan()
+ } else {
+ // `wt list` with no selection, and every `--format json` run.
+ full_plan()
};
// The picker primes its CI cells from the local cache so the column paints
diff --git a/src/commands/list/mod.rs b/src/commands/list/mod.rs
index d8592c2cf..c00f8d617 100644
--- a/src/commands/list/mod.rs
+++ b/src/commands/list/mod.rs
@@ -46,8 +46,9 @@
//! First run in a repo without cached default branch adds ~100-300ms for network lookup.
//!
//! After the skeleton appears, cells fill in progressively as git operations complete.
-//! The slowest operation (CI status) runs with `--full`, or when `[list] columns`
-//! names `ci` (which forces the column and its fetch on without `--full`).
+//! The slowest operation (CI status) runs with `--full`, or — for the table and
+//! the picker only — when `[list] columns` names `ci`, which forces the column
+//! and its fetch on without `--full`.
//!
//! ## Git Commands Per Worktree
//!
diff --git a/src/commands/list/model/item.rs b/src/commands/list/model/item.rs
index d6d73fef5..183f61225 100644
--- a/src/commands/list/model/item.rs
+++ b/src/commands/list/model/item.rs
@@ -359,11 +359,10 @@ pub struct ListData {
pub collected: Collected,
}
-/// Fact families whose collection is gated (`--full`, `[list] summary`,
-/// a listed `ci`/`summary` column). Ungated families (working tree, counts,
-/// diffs) are always requested. Serialized as-is into the schema-2 JSON
-/// envelope's `collected` field, disambiguating "absent because not
-/// requested".
+/// Fact families whose collection is gated (`--full`, `[list] summary`).
+/// Ungated families (working tree, counts, diffs) are always requested.
+/// Serialized as-is into the schema-2 JSON envelope's `collected` field,
+/// disambiguating "absent because not requested".
#[derive(Debug, Clone, Copy, Default, serde::Serialize, schemars::JsonSchema)]
pub struct Collected {
/// Forge CI/PR data was fetched.
diff --git a/tests/integration_tests/list_config.rs b/tests/integration_tests/list_config.rs
index 325e05abf..f5cac7d2b 100644
--- a/tests/integration_tests/list_config.rs
+++ b/tests/integration_tests/list_config.rs
@@ -1108,6 +1108,63 @@ columns = ["branch", "age"]
);
}
+/// A listed `ci` renders the CI column in the table without `--full` (asserted
+/// in `test_list_config_listed_column_overrides_full_gate`), but `--format
+/// json` plans off `--full` alone (#3787). Asserted on schema 2's
+/// `collected.ci`, which records what the plan requested rather than what a
+/// fetch returned — so this needs no forge and no `gh` on PATH.
+#[rstest]
+fn test_list_json_columns_selection_does_not_force_ci(repo: TestRepo) {
+ let collected = |config: &str, full: bool| -> serde_json::Value {
+ fs::write(repo.test_config_path(), config).unwrap();
+ let mut cmd = wt_command();
+ repo.configure_wt_cmd(&mut cmd);
+ cmd.args(["list", "--format=json"]);
+ if full {
+ cmd.arg("--full");
+ }
+ cmd.current_dir(repo.root_path());
+ let output = cmd.output().unwrap();
+ assert!(
+ output.status.success(),
+ "exit code should be 0 for config {config:?} (full={full}): {}",
+ String::from_utf8_lossy(&output.stderr)
+ );
+ let json: serde_json::Value = serde_json::from_slice(&output.stdout).unwrap();
+ json["collected"].clone()
+ };
+
+ // Control: no selection, no `--full` — nothing gated was requested.
+ assert_eq!(
+ collected(SCHEMA_2_ONLY, false)["ci"],
+ serde_json::Value::Bool(false),
+ "plain `--format json` should not request CI data"
+ );
+
+ // Listing `ci` shows the column in the table, but leaves JSON's plan alone.
+ assert_eq!(
+ collected(SCHEMA_2_WITH_CI_COLUMN, false)["ci"],
+ serde_json::Value::Bool(false),
+ "a listed `ci` column must not force the forge fetch on for `--format json`"
+ );
+
+ // `--full` is the switch that does turn it on, listed or not.
+ assert_eq!(
+ collected(SCHEMA_2_WITH_CI_COLUMN, true)["ci"],
+ serde_json::Value::Bool(true),
+ "`--full` should still request CI data for `--format json`"
+ );
+}
+
+const SCHEMA_2_ONLY: &str = r#"[list]
+json-schema = 2
+"#;
+
+const SCHEMA_2_WITH_CI_COLUMN: &str = r#"[list]
+json-schema = 2
+columns = ["branch", "ci"]
+"#;
+
/// TODO(list-columns-env): `WORKTRUNK__LIST__COLUMNS` is not wired up yet. The
/// env overlay can only deliver a scalar, which the `Vec<String>` field rejects,
/// so the override is dropped — but with a warning naming the var, not silently
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_create.snap b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
index b71977dd1..a77487b59 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_create.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_create.snap
@@ -182,11 +182,13 @@ Creates ~/.config/worktrunk/config.toml with the following content:
  #
  # timeout-ms = 0 # Wall-clock budget for the entire collect phase; 0 disables
  #
-  # `columns` selects and orders the columns to render; omit it for the default set.
-  # It is meant to drive a per-invocation alias (https://worktrunk.dev/extending/#aliases)
-  # (`wt --config-set 'list.columns=[…]' list`), giving a named view without
-  # disturbing the default `wt list`. A static setting works but pins one layout
-  # over a table that otherwise adapts to `--full` and terminal width.
+  # `columns` selects and orders the columns the `wt list` table and the `wt switch`
+  # picker render; `--format json` ignores it and always emits every field. Omit it
+  # for the default set. It is meant to drive a per-invocation
+  # alias (https://worktrunk.dev/extending/#aliases) (`wt --config-set 'list.columns=[…]' list`),
+  # giving a named view without disturbing the default `wt list`. A static setting
+  # works but pins one layout over a table that otherwise adapts to `--full` and
+  # terminal width.
  #
  # Valid built-in names:
  #
@@ -216,11 +218,6 @@ Creates ~/.config/worktrunk/config.toml with the following content:
  # needs an LLM command (`[commit.generation]`), `url` needs a `[list] url`
  # template — since listing can't supply the data.
  #
-  # The selection drives the table and the `wt switch` picker. `wt list --format
-  # json` always emits every field, but a listed gated column (`ci`, `summary`)
-  # still forces its data collection on, so the JSON carries the same data the
-  # table shows.
-  #
  # #### Custom columns [experimental]
  #
  # Custom columns add per-branch context to the `wt list` table. Each
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_long.snap b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
index 012a2dd79..1e251879f 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_long.snap
@@ -230,11 +230,13 @@ Persistent flag values for wt list. Override on command line as needed.
 
  timeout-ms = 0 # Wall-clock budget for the entire collect phase; 0 disables
-columns selects and orders the columns to render; omit it for the default set.
-It is meant to drive a per-invocation alias
-(wt --config-set 'list.columns=[…]' list), giving a named view without
-disturbing the default wt list. A static setting works but pins one layout
-over a table that otherwise adapts to --full and terminal width.
+columns selects and orders the columns the wt list table and the wt switch
+picker render; --format json ignores it and always emits every field. Omit it
+for the default set. It is meant to drive a per-invocation
+alias (wt --config-set 'list.columns=[…]' list),
+giving a named view without disturbing the default wt list. A static setting
+works but pins one layout over a table that otherwise adapts to --full and
+terminal width.
Valid built-in names:
@@ -264,11 +266,6 @@ named one. A column whose data source is missing still stays hidden — summ
needs an LLM command ([commit.generation]), url needs a [list] url
template — since listing can't supply the data.
-The selection drives the table and the wt switch picker. wt list --format
-json always emits every field, but a listed gated column (ci, summary)
-still forces its data collection on, so the JSON carries the same data the
-table shows.
-
Custom columns [experimental]
Custom columns add per-branch context to the wt list table. Each
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_long.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
index c136ef943..ec7162c17 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
@@ -35,6 +35,7 @@ info:
WORKTRUNK_TEST_PARENT_SHELL: ""
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
WORKTRUNK_TEST_ZSH_INSTALLED: "0"
---
@@ -340,10 +341,10 @@ Item fields:
worktree {path, main, current, previous, detached, locked, prunable, branch_mismatch, duplicate_branch, operation, changes}; absent on branch-only rows. locked/prunable are {reason} objects and can co-occur; operation is "rebase" or "merge"; changes holds the five working-tree flags plus conflicted and diff {added, deleted}
default_branch Relation to the default branch: {ahead, behind, diff, orphan, integration, merge_conflicts}; absent on the default branch itself. integration.reason is one of same_commit, ancestor, no_added_changes, trees_match, merge_adds_nothing, patch_id_match; a dirty tree skips the checks, leaving integration null
upstream Tracking branch: {remote, branch, ahead, behind}; absent when none is configured
- pr Open PR/MR: {number, url, review, mergeable, repo}; collected with --full or a listed ci column. review uses the schema 1 ci.review_state vocabulary; mergeable is false when the forge reports conflicts, null otherwise
- checks CI pipeline: {status, source, stale}; status is passed, running, or failed — null when a conflicts report masks it
+ pr Open PR/MR: {number, url, review, mergeable, repo}; collected with --full. review uses the schema 1 ci.review_state vocabulary; mergeable is false when the forge reports conflicts, null otherwise
+ checks CI pipeline: {status, source, stale}; collected with --full. status is passed, running, or failed — null when a conflicts report masks it
dev_server {url, listening} from the project's list.url template
- summary LLM branch summary (requires [list] summary = true)
+ summary LLM branch summary; needs --full, [list] summary = true, and a [commit.generation] command
vars Per-branch variables from wt config state vars
display Rendered strings: state (schema 1's main_state vocabulary), symbols, statusline (with ANSI colors and OSC 8 hyperlinks), columns (custom-column cells keyed by header)
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
index 7499e2ad4..aa3965489 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
@@ -35,6 +35,7 @@ info:
WORKTRUNK_TEST_PARENT_SHELL: ""
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
WORKTRUNK_TEST_ZSH_INSTALLED: "0"
---
@@ -428,14 +429,14 @@ Item fields:
upstrea Tracking branch: {remote, branch, ahead, behind}; absent when none is
m configured
pr Open PR/MR: {number, url, review, mergeable, repo}; collected with
- --full or a listed ci column. review uses the schema 1 ci.review_state
- vocabulary; mergeable is false when the forge reports conflicts, null
- otherwise
- checks CI pipeline: {status, source, stale}; status is passed, running, or
- failed — null when a conflicts report masks it
+ --full. review uses the schema 1 ci.review_state vocabulary; mergeable
+ is false when the forge reports conflicts, null otherwise
+ checks CI pipeline: {status, source, stale}; collected with --full. status is
+ passed, running, or failed — null when a conflicts report masks it
dev_ser {url, listening} from the project's list.url template
ver
- summary LLM branch summary (requires [list] summary = true)
+ summary LLM branch summary; needs --full, [list] summary = true, and a
+ [commit.generation] command
vars Per-branch variables from wt config state vars
display Rendered strings: state (schema 1's main_state vocabulary), symbols,
statusline (with ANSI colors and OSC 8 hyperlinks), columns