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.mdindex 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 bWhat 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` commanddiff --git a/dev/config.example.toml b/dev/config.example.tomlindex 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. Eachdiff --git a/docs/content/config.md b/docs/content/config.mdindex 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 — btimeout-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 — `summaryneeds 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.mdindex 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.jsonindex 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.mdindex 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 — btimeout-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 — `summaryneeds 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. Eachdiff --git a/plugins/worktrunk/skills/worktrunk/reference/list.md b/plugins/worktrunk/skills/worktrunk/reference/list.mdindex 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.mdindex 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 — btimeout-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 — `summaryneeds 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. Eachdiff --git a/skills/worktrunk/reference/list.md b/skills/worktrunk/reference/list.mdindex 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.rsindex 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 — btimeout-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 — `summaryneeds 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. Eachdiff --git a/src/commands/list/collect/mod.rs b/src/commands/list/collect/mod.rsindex 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 paintsdiff --git a/src/commands/list/mod.rs b/src/commands/list/mod.rsindex 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.rsindex 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.rsindex 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 silentlydiff --git a/tests/snapshots/integration__integration_tests__help__help_config_create.snap b/tests/snapshots/integration__integration_tests__help__help_config_create.snapindex 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 [2m~/.config/worktrunk/config.toml[0m with the following content:[107m [0m [2m#[0m[107m [0m [2m# timeout-ms = 0 # Wall-clock budget for the entire collect phase; 0 disables[0m[107m [0m [2m#[0m-[107m [0m [2m# `columns` selects and orders the columns to render; omit it for the default set.[0m-[107m [0m [2m# It is meant to drive a per-invocation alias (https://worktrunk.dev/extending/#aliases)[0m-[107m [0m [2m# (`wt --config-set 'list.columns=[…]' list`), giving a named view without[0m-[107m [0m [2m# disturbing the default `wt list`. A static setting works but pins one layout[0m-[107m [0m [2m# over a table that otherwise adapts to `--full` and terminal width.[0m+[107m [0m [2m# `columns` selects and orders the columns the `wt list` table and the `wt switch`[0m+[107m [0m [2m# picker render; `--format json` ignores it and always emits every field. Omit it[0m+[107m [0m [2m# for the default set. It is meant to drive a per-invocation[0m+[107m [0m [2m# alias (https://worktrunk.dev/extending/#aliases) (`wt --config-set 'list.columns=[…]' list`),[0m+[107m [0m [2m# giving a named view without disturbing the default `wt list`. A static setting[0m+[107m [0m [2m# works but pins one layout over a table that otherwise adapts to `--full` and[0m+[107m [0m [2m# terminal width.[0m[107m [0m [2m#[0m[107m [0m [2m# Valid built-in names:[0m[107m [0m [2m#[0m@@ -216,11 +218,6 @@ Creates [2m~/.config/worktrunk/config.toml[0m with the following content:[107m [0m [2m# needs an LLM command (`[commit.generation]`), `url` needs a `[list] url`[0m[107m [0m [2m# template — since listing can't supply the data.[0m[107m [0m [2m#[0m-[107m [0m [2m# The selection drives the table and the `wt switch` picker. `wt list --format[0m-[107m [0m [2m# json` always emits every field, but a listed gated column (`ci`, `summary`)[0m-[107m [0m [2m# still forces its data collection on, so the JSON carries the same data the[0m-[107m [0m [2m# table shows.[0m-[107m [0m [2m#[0m[107m [0m [2m# #### Custom columns [experimental][0m[107m [0m [2m#[0m[107m [0m [2m# Custom columns add per-branch context to the `wt list` table. Each[0mdiff --git a/tests/snapshots/integration__integration_tests__help__help_config_long.snap b/tests/snapshots/integration__integration_tests__help__help_config_long.snapindex 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 [2mwt list[0m. Override on command line as needed.[107m [0m[107m [0m [2mtimeout-ms = [0m[2m[33m0[0m[2m [0m[2m# Wall-clock budget for the entire collect phase; 0 disables[0m-[2mcolumns[0m selects and orders the columns to render; omit it for the default set.-It is meant to drive a per-invocation alias-([2mwt --config-set 'list.columns=[…]' list[0m), giving a named view without-disturbing the default [2mwt list[0m. A static setting works but pins one layout-over a table that otherwise adapts to [2m--full[0m and terminal width.+[2mcolumns[0m selects and orders the columns the [2mwt list[0m table and the [2mwt switch[0m+picker render; [2m--format json[0m ignores it and always emits every field. Omit it+for the default set. It is meant to drive a per-invocation+alias ([2mwt --config-set 'list.columns=[…]' list[0m),+giving a named view without disturbing the default [2mwt list[0m. A static setting+works but pins one layout over a table that otherwise adapts to [2m--full[0m and+terminal width.Valid built-in names:@@ -264,11 +266,6 @@ named one. A column whose data source is missing still stays hidden — [2msummneeds an LLM command ([2m[commit.generation][0m), [2murl[0m needs a [2m[list] url[0mtemplate — since listing can't supply the data.-The selection drives the table and the [2mwt switch[0m picker. [2mwt list --format[0m-json[2m always emits every field, but a listed gated column ([0mci[2m, [0msummary[2m)[0m-still forces its data collection on, so the JSON carries the same data the-table shows.-[1mCustom columns [experimental][0mCustom columns add per-branch context to the [2mwt list[0m table. Eachdiff --git a/tests/snapshots/integration__integration_tests__help__help_list_long.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snapindex 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:[2mworktree[0m [2m{path, main, current, previous, detached, locked, prunable, branch_mismatch, duplicate_branch, operation, changes}[0m; absent on branch-only rows. [2mlocked[0m/[2mprunable[0m are [2m{reason}[0m objects and can co-occur; [2moperation[0m is [2m"rebase"[0m or [2m"merge"[0m; [2mchanges[0m holds the five working-tree flags plus [2mconflicted[0m and [2mdiff {added, deleted}[0m[2mdefault_branch[0m Relation to the default branch: [2m{ahead, behind, diff, orphan, integration, merge_conflicts}[0m; absent on the default branch itself. [2mintegration.reason[0m is one of [2msame_commit[0m, [2mancestor[0m, [2mno_added_changes[0m, [2mtrees_match[0m, [2mmerge_adds_nothing[0m, [2mpatch_id_match[0m; a dirty tree skips the checks, leaving [2mintegration[0m null[2mupstream[0m Tracking branch: [2m{remote, branch, ahead, behind}[0m; absent when none is configured- [2mpr[0m Open PR/MR: [2m{number, url, review, mergeable, repo}[0m; collected with [2m--full[0m or a listed [2mci[0m column. [2mreview[0m uses the schema 1 [2mci.review_state[0m vocabulary; [2mmergeable[0m is false when the forge reports conflicts, null otherwise- [2mchecks[0m CI pipeline: [2m{status, source, stale}[0m; [2mstatus[0m is [2mpassed[0m, [2mrunning[0m, or [2mfailed[0m — null when a conflicts report masks it+ [2mpr[0m Open PR/MR: [2m{number, url, review, mergeable, repo}[0m; collected with [2m--full[0m. [2mreview[0m uses the schema 1 [2mci.review_state[0m vocabulary; [2mmergeable[0m is false when the forge reports conflicts, null otherwise+ [2mchecks[0m CI pipeline: [2m{status, source, stale}[0m; collected with [2m--full[0m. [2mstatus[0m is [2mpassed[0m, [2mrunning[0m, or [2mfailed[0m — null when a conflicts report masks it[2mdev_server[0m [2m{url, listening}[0m from the project's [2mlist.url[0m template- [2msummary[0m LLM branch summary (requires [2m[list] summary = true[0m)+ [2msummary[0m LLM branch summary; needs [2m--full[0m, [2m[list] summary = true[0m, and a [2m[commit.generation][0m command[2mvars[0m Per-branch variables from [2mwt config state vars[0m[2mdisplay[0m Rendered strings: [2mstate[0m (schema 1's [2mmain_state[0m vocabulary), [2msymbols[0m, [2mstatusline[0m (with ANSI colors and OSC 8 hyperlinks), [2mcolumns[0m (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.snapindex 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:[2mupstrea[0m Tracking branch: [2m{remote, branch, ahead, behind}[0m; absent when none is[2mm[0m configured[2mpr[0m Open PR/MR: [2m{number, url, review, mergeable, repo}[0m; collected with- [2m--full[0m or a listed [2mci[0m column. [2mreview[0m uses the schema 1 [2mci.review_state[0m- vocabulary; [2mmergeable[0m is false when the forge reports conflicts, null- otherwise- [2mchecks[0m CI pipeline: [2m{status, source, stale}[0m; [2mstatus[0m is [2mpassed[0m, [2mrunning[0m, or- [2mfailed[0m — null when a conflicts report masks it+ [2m--full[0m. [2mreview[0m uses the schema 1 [2mci.review_state[0m vocabulary; [2mmergeable[0m+ is false when the forge reports conflicts, null otherwise+ [2mchecks[0m CI pipeline: [2m{status, source, stale}[0m; collected with [2m--full[0m. [2mstatus[0m is+ [2mpassed[0m, [2mrunning[0m, or [2mfailed[0m — null when a conflicts report masks it[2mdev_ser[0m [2m{url, listening}[0m from the project's [2mlist.url[0m template[2mver[0m- [2msummary[0m LLM branch summary (requires [2m[list] summary = true[0m)+ [2msummary[0m LLM branch summary; needs [2m--full[0m, [2m[list] summary = true[0m, and a+ [2m[commit.generation][0m command[2mvars[0m Per-branch variables from [2mwt config state vars[0m[2mdisplay[0m Rendered strings: [2mstate[0m (schema 1's [2mmain_state[0m vocabulary), [2msymbols[0m,[2mstatusline[0m (with ANSI colors and OSC 8 hyperlinks), [2mcolumns[0m