Skip to content

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

feat(hooks)!: table-form pre-* hooks run concurrently — remove the serial path (#3052)

Maximilian Roos22768d425f6e
diff --git a/docs/content/hook.md b/docs/content/hook.md
index 61710384a..af44c2587 100644
--- a/docs/content/hook.md
+++ b/docs/content/hook.md
@@ -106,8 +106,6 @@ Templates are syntax-checked before the pipeline starts and rendered as each ste
Most hooks don't need `[[hook]]` blocks. Reach for them when there's a dependency chain — typically setup that must complete before later steps, like installing dependencies before running a build and dev server concurrently.
-Table form for pre-* hooks is deprecated and its behavior will change in a future version — use `[[hook]]` blocks instead.
-
## Project vs user hooks
| Aspect | Project hooks | User hooks |
diff --git a/docs/static/.well-known/agent-skills/index.json b/docs/static/.well-known/agent-skills/index.json
index f61a6d761..59f4f0ac0 100644
--- a/docs/static/.well-known/agent-skills/index.json
+++ b/docs/static/.well-known/agent-skills/index.json
@@ -6,7 +6,7 @@
"type": "skill-md",
"description": "Guidance for Worktrunk (the `wt` CLI) — git worktree management, hooks, and config. Load when editing .config/wt.toml or ~/.config/worktrunk/config.toml; adding, modifying, or debugging hooks (post-merge, post-start, pre-commit, pre-merge, post-switch, etc.); configuring commit message generation or command aliases; or troubleshooting wt behavior. Also answers general worktrunk/wt questions.",
"url": "./worktrunk/SKILL.md",
- "digest": "sha256:b98a9406490be008d879cfa4452a373cefafc531e9df11ef1e92c8a5a04fa670"
+ "digest": "sha256:8989343881b190da544109b7d813a3f823aa17b74e0f4b4becec6bb6b5bb5ec9"
}
]
}
diff --git a/skills/worktrunk/SKILL.md b/skills/worktrunk/SKILL.md
index a4ea2e9ac..8fe4efaee 100644
--- a/skills/worktrunk/SKILL.md
+++ b/skills/worktrunk/SKILL.md
@@ -163,17 +163,26 @@ When users want to add automation to an existing project:
3. **Handle format conversion if needed**
- Single command to named table:
+ Single command to a pipeline of dependent steps:
```toml
# Before
pre-start = "npm install"
- # After (adding db:migrate)
- [pre-start]
+ # After (adding db:migrate, which needs install to finish first)
+ [[pre-start]]
install = "npm install"
+
+ [[pre-start]]
migrate = "npm run db:migrate"
```
+ For independent commands, a named table runs them concurrently:
+ ```toml
+ [pre-start]
+ install = "npm install"
+ env = "cp .env.example .env"
+ ```
+
4. **Preserve existing structure and comments**
### Validation Before Adding Commands
diff --git a/skills/worktrunk/reference/hook.md b/skills/worktrunk/reference/hook.md
index 1fa289d31..f37ed069f 100644
--- a/skills/worktrunk/reference/hook.md
+++ b/skills/worktrunk/reference/hook.md
@@ -97,8 +97,6 @@ Templates are syntax-checked before the pipeline starts and rendered as each ste
Most hooks don't need `[[hook]]` blocks. Reach for them when there's a dependency chain — typically setup that must complete before later steps, like installing dependencies before running a build and dev server concurrently.
-Table form for pre-* hooks is deprecated and its behavior will change in a future version — use `[[hook]]` blocks instead.
-
## Project vs user hooks
| Aspect | Project hooks | User hooks |
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 8d004e96b..579136799 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -1339,8 +1339,6 @@ Templates are syntax-checked before the pipeline starts and rendered as each ste
Most hooks don't need `[[hook]]` blocks. Reach for them when there's a dependency chain — typically setup that must complete before later steps, like installing dependencies before running a build and dev server concurrently.
-Table form for pre-* hooks is deprecated and its behavior will change in a future version — use `[[hook]]` blocks instead.
-
## Project vs user hooks
| Aspect | Project hooks | User hooks |
diff --git a/src/commands/alias.rs b/src/commands/alias.rs
index e78433c4b..cc2dcd350 100644
--- a/src/commands/alias.rs
+++ b/src/commands/alias.rs
@@ -648,13 +648,7 @@ fn run_alias(
})
})?;
for step in steps {
- sourced_steps.push(SourcedStep {
- step,
- source,
- // Aliases have no deprecated single-table form, so concurrent
- // commands always run concurrently.
- is_pipeline: true,
- });
+ sourced_steps.push(SourcedStep { step, source });
}
}
sourced_steps_to_foreground(sourced_steps, &PipelineKind::Alias { name: alias_name })
diff --git a/src/commands/command_executor.rs b/src/commands/command_executor.rs
index 06da62e01..73ecf96e8 100644
--- a/src/commands/command_executor.rs
+++ b/src/commands/command_executor.rs
@@ -112,9 +112,6 @@ impl PipelineKind {
/// A pipeline step ready for foreground execution, with rendering / error policy.
pub struct ForegroundStep {
pub step: PreparedStep,
- /// Whether `Concurrent` steps actually run concurrently. When `false`,
- /// concurrent commands execute serially (deprecated pre-* table form).
- pub concurrent: bool,
/// Which pipeline this step belongs to. Drives how each command is
/// announced before execution: hooks render a per-command "Running …"
/// line plus the bash gutter; aliases stay silent (the caller emits one
@@ -457,10 +454,8 @@ pub(crate) fn command_summary_name(name: Option<&str>, source: HookSource) -> St
/// Handles serial/concurrent step execution, per-command announcement,
/// execution-time template rendering, and policy-driven error handling.
///
-/// Each `ForegroundStep` carries a `concurrent` flag. When true, `Concurrent`
-/// steps spawn threads via `thread::scope`. When false (deprecated pre-*
-/// single-table form), `Concurrent` steps execute serially. Pipeline configs
-/// (`[[hook]]` blocks), aliases, and post-* hooks set `concurrent: true`.
+/// `Single` steps run one at a time; `Concurrent` steps run all their
+/// commands in parallel via the prefixed-line executor.
pub fn execute_pipeline_foreground(
steps: &[ForegroundStep],
repo: &Repository,
@@ -473,13 +468,7 @@ pub fn execute_pipeline_foreground(
run_one_command(cmd, fg_step, repo, wt_path, failure_strategy)?;
}
PreparedStep::Concurrent(cmds) => {
- if !fg_step.concurrent {
- for cmd in cmds {
- run_one_command(cmd, fg_step, repo, wt_path, failure_strategy)?;
- }
- } else {
- run_concurrent_group(cmds, fg_step, repo, wt_path, failure_strategy)?;
- }
+ run_concurrent_group(cmds, fg_step, repo, wt_path, failure_strategy)?;
}
}
}
diff --git a/src/commands/hook_announcement.rs b/src/commands/hook_announcement.rs
index e8deb7e62..44aa4d64c 100644
--- a/src/commands/hook_announcement.rs
+++ b/src/commands/hook_announcement.rs
@@ -75,18 +75,12 @@ use super::hook_filter::HookSource;
/// Used by both hook and alias dispatch as the source-tagged shape that feeds
/// `sourced_steps_to_foreground`. Per-pipeline metadata (`hook_type`,
/// `display_path` for hooks; `name` for aliases) lives on `PipelineKind`,
-/// supplied at conversion time so this struct stays neutral. The two fields
-/// here are genuinely per-step: alias flows mix steps from both sources into
-/// one flat vec, and a config using `[[hook.x]]` on one side with `[hook.x]`
-/// on the other can produce mixed `is_pipeline` values within a single hook
-/// run.
+/// supplied at conversion time so this struct stays neutral. `source` is
+/// genuinely per-step: alias flows mix steps from both sources into one flat
+/// vec.
pub struct SourcedStep {
pub step: PreparedStep,
pub source: HookSource,
- /// Whether `Concurrent` steps run concurrently. For hooks: derived from
- /// `is_pipeline()` (deprecated single-table form runs serially). For
- /// aliases: always true — no deprecated form.
- pub is_pipeline: bool,
}
/// Extract the per-step command name lists from a `CommandConfig`.
@@ -221,7 +215,6 @@ mod tests {
SourcedStep {
step,
source: HookSource::User,
- is_pipeline: false,
}
}
diff --git a/src/commands/hook_plan.rs b/src/commands/hook_plan.rs
index e50435bd3..48042d7ef 100644
--- a/src/commands/hook_plan.rs
+++ b/src/commands/hook_plan.rs
@@ -339,12 +339,10 @@ fn render_planned(
) -> anyhow::Result<Vec<SourcedStep>> {
let mut out = Vec::new();
for (source, cfg) in entries {
- let is_pipeline = cfg.is_pipeline();
for step in prepare_steps(cfg, ctx, extra_vars, hook_type, *source)? {
out.push(SourcedStep {
step,
source: *source,
- is_pipeline,
});
}
}
diff --git a/src/commands/hooks.rs b/src/commands/hooks.rs
index d11090b24..45e8ee116 100644
--- a/src/commands/hooks.rs
+++ b/src/commands/hooks.rs
@@ -126,14 +126,12 @@ pub(crate) fn prepare_and_check(
continue;
}
- let is_pipeline = config.is_pipeline();
let steps = prepare_steps(config, ctx, extra_vars, hook_type, source)?;
for step in steps {
if let Some(filtered) = filter_step_by_name(step, source, &parsed_filters) {
result.push(SourcedStep {
step: filtered,
source,
- is_pipeline,
});
}
}
@@ -598,7 +596,6 @@ pub(crate) fn sourced_steps_to_foreground(
};
ForegroundStep {
step: sourced.step,
- concurrent: sourced.is_pipeline,
announce: kind.clone(),
pipe_stdin,
redirect_stdout_to_stderr,
@@ -746,12 +743,4 @@ mod tests {
assert_eq!(f.source, Some(HookSource::Project));
assert_eq!(f.name, "");
}
-
- #[test]
- fn test_is_pipeline() {
- use worktrunk::config::CommandConfig;
-
- let single = CommandConfig::single("npm install");
- assert!(!single.is_pipeline());
- }
}
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index dd3c30e6d..d3086670b 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -186,8 +186,9 @@ pub(crate) fn build_invalid_subcommand_error(
/// `WORKTRUNK_TEST_SERIAL_CONCURRENT=1` to make output ordering deterministic
/// for snapshot tests, mirroring how `RAYON_NUM_THREADS=1` is used elsewhere.
///
-/// Honored by both alias `HookStep::Concurrent` execution and the background
-/// pipeline runner's concurrent groups.
+/// The background pipeline runner reads it through this helper; the
+/// foreground concurrent executor (`output::concurrent`, shared by hook and
+/// alias `HookStep::Concurrent` groups) reads the env var directly.
pub(crate) fn force_serial_concurrent() -> bool {
std::env::var_os("WORKTRUNK_TEST_SERIAL_CONCURRENT").is_some()
}
diff --git a/src/config/commands.rs b/src/config/commands.rs
index 20e575881..b09842a16 100644
--- a/src/config/commands.rs
+++ b/src/config/commands.rs
@@ -14,18 +14,9 @@
//! | Primitive | Example | Resulting `steps` |
//! |---|---|---|
//! | string | `hook = "cmd"` | `[Single(unnamed)]` |
-//! | dict | `[hook]` + keys, or `hook = {a="...", b="..."}` | `[Concurrent(all entries)]` — always `Concurrent`, even for one entry |
+//! | dict | `[hook]` + keys, or `hook = {a="...", b="..."}` | one step: 1-key → `Single(named)`; multi-key → `Concurrent` (see `map_to_step`) |
//! | list | `hook = [{a="..."}, "cmd", ...]` | one step per element: string → `Single(unnamed)`; 1-key dict → `Single(named)`; multi-key dict → `Concurrent` |
//!
-//! ## Dict-at-top vs. dict-in-list is asymmetric
-//!
-//! A top-level dict always becomes `Concurrent`. A one-entry dict inside a
-//! list becomes `Single(named)` instead (see `map_to_step`). So
-//! `{test="..."}` and `[{test="..."}]` have the same command set but
-//! different `HookStep` variants. For pre-* hooks this is invisible
-//! (everything runs serially anyway); for post-* hooks it controls
-//! parallelism.
-//!
//! ## `[[hook]]` header form is not a full alternative to pipeline form
//!
//! TOML array-of-tables headers only produce dict elements. A pipeline that
@@ -61,12 +52,10 @@ impl Command {
/// A step in a hook pipeline.
///
-/// The execution model depends on the hook type and config form:
-/// - **Post-* hooks**: `Single` steps run serially, `Concurrent` steps spawn in parallel.
-/// The entire pipeline runs in the background as one detached process.
-/// - **Pre-* hooks (pipeline form)**: `Single` steps run serially, `Concurrent` steps
-/// run in parallel. The pipeline blocks until complete.
-/// - **Pre-* hooks (deprecated table form)**: All commands run serially.
+/// `Single` steps run serially; a `Concurrent` step runs all its commands in
+/// parallel. The model is uniform across hook types — pre-* pipelines block
+/// in the foreground, post-* pipelines run in the background as one detached
+/// process.
#[derive(Debug, Clone, PartialEq)]
pub enum HookStep {
/// A single command (from a string in a list, or a single-entry map).
@@ -79,17 +68,13 @@ pub enum HookStep {
///
/// Internally stores a pipeline of `HookStep`s. Deserializes from three TOML forms:
/// - Single string: `post-start = "npm install"`
-/// - Named table: `[post-start]` with `name = "command"` entries → one Concurrent step
+/// - Named table: `[post-start]` with `name = "command"` entries → one step
/// - Pipeline: `post-start = ["cmd", { a = "cmd1", b = "cmd2" }]` → serial steps
///
/// **Order preservation:** Named commands preserve TOML insertion order (IndexMap).
#[derive(Debug, Clone, PartialEq)]
pub struct CommandConfig {
steps: Vec<HookStep>,
- /// Whether this config was deserialized from a pipeline form (TOML array:
- /// `[[hook]]` blocks or inline `hook = [...]`). Non-pipeline forms are a
- /// bare string (`hook = "cmd"`) or a single table (`[hook]`).
- pipeline: bool,
}
impl CommandConfig {
@@ -97,7 +82,6 @@ impl CommandConfig {
pub fn single(template: impl Into<String>) -> Self {
Self {
steps: vec![HookStep::Single(Command::new(None, template.into()))],
- pipeline: false,
}
}
@@ -109,12 +93,6 @@ impl CommandConfig {
})
}
- /// Whether this config uses a pipeline form (`[[hook]]` blocks or inline array).
- /// A single `[[hook]]` block counts as a pipeline even though it has one step.
- pub fn is_pipeline(&self) -> bool {
- self.pipeline
- }
-
/// Returns the pipeline steps for execution.
pub fn steps(&self) -> &[HookStep] {
&self.steps
@@ -126,10 +104,7 @@ impl CommandConfig {
pub fn merge_append(&self, other: &Self) -> Self {
let mut steps = self.steps.clone();
steps.extend(other.steps.iter().cloned());
- Self {
- steps,
- pipeline: self.pipeline || other.pipeline,
- }
+ Self { steps }
}
}
@@ -256,7 +231,6 @@ impl<'de> Deserialize<'de> for CommandConfig {
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(CommandConfig {
steps: vec![HookStep::Single(Command::new(None, v.to_string()))],
- pipeline: false,
})
}
@@ -279,10 +253,7 @@ impl<'de> Deserialize<'de> for CommandConfig {
}
}
}
- Ok(CommandConfig {
- steps,
- pipeline: true,
- })
+ Ok(CommandConfig { steps })
}
fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error>
@@ -295,19 +266,12 @@ impl<'de> Deserialize<'de> for CommandConfig {
entries.insert(key, value);
}
validate_no_colons(&entries)?;
- let commands: Vec<Command> = entries
- .into_iter()
- .map(|(name, template)| Command::new(Some(name), template))
- .collect();
- let steps = if commands.is_empty() {
+ let steps = if entries.is_empty() {
Vec::new()
} else {
- vec![HookStep::Concurrent(commands)]
+ vec![map_to_step(entries)]
};
- Ok(CommandConfig {
- steps,
- pipeline: false,
- })
+ Ok(CommandConfig { steps })
}
}
@@ -352,19 +316,20 @@ impl Serialize for CommandConfig {
where
S: serde::Serializer,
{
- // Single unnamed command → string
- if self.steps.len() == 1
- && let HookStep::Single(cmd) = &self.steps[0]
- && cmd.name.is_none()
- {
- return cmd.template.serialize(serializer);
- }
-
- // Single concurrent step (all named) → named table
- if self.steps.len() == 1
- && let HookStep::Concurrent(cmds) = &self.steps[0]
- {
- return serialize_commands_as_map(cmds, serializer);
+ // Single step → string (unnamed) or named table, mirroring the
+ // one-step deserialization forms.
+ if self.steps.len() == 1 {
+ match &self.steps[0] {
+ HookStep::Single(cmd) => match &cmd.name {
+ None => return cmd.template.serialize(serializer),
+ Some(_) => {
+ return serialize_commands_as_map(std::slice::from_ref(cmd), serializer);
+ }
+ },
+ HookStep::Concurrent(cmds) => {
+ return serialize_commands_as_map(cmds, serializer);
+ }
+ }
}
// Pipeline → array of mixed strings and tables
@@ -478,6 +443,34 @@ test = "cargo test"
));
}
+ #[test]
+ fn test_deserialize_named_table_single_entry() {
+ // A one-entry table is a single named command — the same parse as a
+ // one-entry map inside a pipeline list — and round-trips as a table.
+ let toml_str = r#"
+[command]
+build = "cargo build"
+"#;
+
+ #[derive(Serialize, Deserialize)]
+ struct Wrapper {
+ command: CommandConfig,
+ }
+
+ let wrapper: Wrapper = toml::from_str(toml_str).unwrap();
+ assert_eq!(wrapper.command.steps().len(), 1);
+ assert!(matches!(
+ &wrapper.command.steps()[0],
+ HookStep::Single(cmd)
+ if cmd.name.as_deref() == Some("build") && cmd.template == "cargo build"
+ ));
+
+ assert_snapshot!(toml::to_string(&wrapper).unwrap(), @r#"
+ [command]
+ build = "cargo build"
+ "#);
+ }
+
#[test]
fn test_deserialize_preserves_order() {
let toml_str = r#"
@@ -752,7 +745,6 @@ broken = 42
None,
"npm install".to_string(),
))],
- pipeline: false,
},
};
@@ -772,7 +764,6 @@ broken = 42
Command::new(Some("build".to_string()), "cargo build".to_string()),
Command::new(Some("test".to_string()), "cargo test".to_string()),
])],
- pipeline: false,
},
};
@@ -799,7 +790,6 @@ broken = 42
Command::new(Some("lint".to_string()), "npm run lint".to_string()),
]),
],
- pipeline: true,
},
};
@@ -813,7 +803,6 @@ broken = 42
None,
"echo hello".to_string(),
))],
- pipeline: false,
};
#[derive(Serialize, Deserialize)]
@@ -839,7 +828,6 @@ broken = 42
Command::new(Some("a".to_string()), "echo a".to_string()),
Command::new(Some("b".to_string()), "echo b".to_string()),
])],
- pipeline: false,
};
#[derive(Serialize, Deserialize)]
@@ -869,7 +857,6 @@ broken = 42
]),
HookStep::Single(Command::new(None, "cmd4".to_string())),
],
- pipeline: true,
};
let cmds: Vec<_> = config.commands().collect();
@@ -888,14 +875,12 @@ broken = 42
fn test_merge_append_steps() {
let base = CommandConfig {
steps: vec![HookStep::Single(Command::new(None, "step1".to_string()))],
- pipeline: false,
};
let overlay = CommandConfig {
steps: vec![HookStep::Concurrent(vec![
Command::new(Some("a".to_string()), "step2a".to_string()),
Command::new(Some("b".to_string()), "step2b".to_string()),
])],
- pipeline: false,
};
let merged = base.merge_append(&overlay);
@@ -921,14 +906,12 @@ broken = 42
None,
"npm install".to_string(),
))],
- pipeline: false,
};
let per_project = CommandConfig {
- steps: vec![HookStep::Concurrent(vec![Command::new(
+ steps: vec![HookStep::Single(Command::new(
Some("setup".to_string()),
"echo setup".to_string(),
- )])],
- pipeline: false,
+ ))],
};
let merged = global.merge_append(&per_project);
diff --git a/src/config/deprecation.rs b/src/config/deprecation.rs
index e55262c6e..f7199abca 100644
--- a/src/config/deprecation.rs
+++ b/src/config/deprecation.rs
@@ -492,8 +492,6 @@ pub enum DeprecationKind {
NoCd,
/// `timeout-ms` under `[switch.picker]` (removed — picker renders progressively).
SwitchPickerTimeout,
- /// Pre-* hooks using multi-entry table form, by display path.
- PreHookTableForm(Vec<String>),
}
/// All deprecation patterns detected in a config file, in the order their
@@ -550,10 +548,7 @@ struct DeprecationRule {
/// bottom, so a row's position is both its warning-emission position and its
/// migration position.
///
-/// Most rows rewrite disjoint keys, but two orderings are load-bearing:
-/// - The silent `-create` → `-start` rename precedes the pre-hook table-form
-/// rule, so a renamed `[pre-create]` multi-entry table still gets
-/// pipeline-migrated.
+/// Most rows rewrite disjoint keys, but one ordering is load-bearing:
/// - `[select]` → `[switch.picker]` precedes the rules that edit keys under
/// `[switch]`: it moves a `timeout-ms` written under `[select]` to where
/// the strip rule looks, and converts an inline `switch` table to a
@@ -665,16 +660,6 @@ const DEPRECATION_RULES: &[DeprecationRule] = &[
for_each_config_table_mut(doc, |_, table| remove_switch_picker_timeout_in(table))
},
},
- // Multi-entry pre-* hook tables → array-of-tables pipeline form.
- DeprecationRule {
- mode: RuleMode::Structural(|doc, kinds| {
- let pre_hook_table_form = find_pre_hook_table_form_from_doc(doc);
- if !pre_hook_table_form.is_empty() {
- kinds.push(DeprecationKind::PreHookTableForm(pre_hook_table_form));
- }
- }),
- migrate: |doc| for_each_config_table_mut(doc, |_, table| migrate_pre_hook_table_in(table)),
- },
];
/// Detect deprecations in config content. Pure function, no I/O.
@@ -982,57 +967,6 @@ fn migrate_select_table(table: &mut toml_edit::Table) -> bool {
true
}
-/// The 5 canonical pre-* hook keys.
-const PRE_HOOK_KEYS: &[&str] = &[
- "pre-switch",
- "pre-start",
- "pre-commit",
- "pre-merge",
- "pre-remove",
-];
-
-/// Check if a table has a multi-entry pre-* hook (table form with 2+ named commands).
-fn collect_pre_hook_table_form_keys(
- table: &toml_edit::Table,
- prefix: &str,
- found: &mut Vec<String>,
-) {
- for &key in PRE_HOOK_KEYS {
- if let Some(item) = table.get(key)
- && table_like_len(item).is_some_and(|len| len >= 2)
- {
- if prefix.is_empty() {
- found.push(key.to_string());
- } else {
- found.push(format!("{prefix}.{key}"));
- }
- }
- }
-}
-
-/// Find pre-* hooks using multi-entry table form.
-///
-/// Hooks are flattened into the top level of user config, project config, and
-/// each `[projects."id"]` subtree. Returns display paths for each deprecated
-/// hook found.
-fn find_pre_hook_table_form_from_doc(doc: &toml_edit::DocumentMut) -> Vec<String> {
- let mut found = Vec::new();
- any_config_table(doc, |scope, table| {
- let prefix = scope.map_or_else(String::new, |key| format!("projects.\"{key}\""));
- collect_pre_hook_table_form_keys(table, &prefix, &mut found);
- false
- });
- found
-}
-
-fn table_like_len(item: &toml_edit::Item) -> Option<usize> {
- match item {
- toml_edit::Item::Table(t) => Some(t.len()),
- toml_edit::Item::Value(toml_edit::Value::InlineTable(t)) => Some(t.len()),
- _ => None,
- }
-}
-
fn find_ci_section_from_doc(doc: &toml_edit::DocumentMut) -> bool {
// Skip if [forge] already exists
if doc
@@ -1154,62 +1088,6 @@ fn migrate_negated_bool_doc(
})
}
-/// Convert a multi-entry pre-* table section into an array-of-tables pipeline.
-///
-/// Removes `[key]` as a table section and inserts `[[key]]` blocks —
-/// one block per named step, preserving insertion order.
-///
-/// Iterates pre-* keys in document order (not [`PRE_HOOK_KEYS`] order) so
-/// migrated sections land in the same relative position they had in the
-/// source file.
-fn migrate_pre_hook_table_in(table: &mut toml_edit::Table) -> bool {
- let keys_to_migrate: Vec<String> = table
- .iter()
- .filter(|(k, v)| {
- PRE_HOOK_KEYS.contains(k)
- && pre_hook_pipeline_entries(v).is_some_and(|entries| entries.len() >= 2)
- })
- .map(|(k, _)| k.to_string())
- .collect();
-
- let mut modified = false;
- for key in keys_to_migrate {
- let item = table.get_mut(&key).unwrap();
- let entries = pre_hook_pipeline_entries(item).unwrap();
-
- let mut arr = toml_edit::ArrayOfTables::new();
- for (name, value) in entries.iter() {
- let mut block = toml_edit::Table::new();
- block.insert(name, toml_edit::value(value.as_str()));
- arr.push(block);
- }
-
- *item = toml_edit::Item::ArrayOfTables(arr);
- modified = true;
- }
- modified
-}
-
-fn pre_hook_pipeline_entries(item: &toml_edit::Item) -> Option<Vec<(String, String)>> {
- match item {
- toml_edit::Item::Table(t) => {
- let entries = t
- .iter()
- .map(|(name, value)| Some((name.to_string(), value.as_str()?.to_string())))
- .collect::<Option<Vec<_>>>()?;
- Some(entries)
- }
- toml_edit::Item::Value(toml_edit::Value::InlineTable(t)) => {
- let entries = t
- .iter()
- .map(|(name, value)| Some((name.to_string(), value.as_str()?.to_string())))
- .collect::<Option<Vec<_>>>()?;
- Some(entries)
- }
- _ => None,
- }
-}
-
/// Apply the load-path migrations — every [`RuleMode::Structural`] and
/// [`RuleMode::Silent`] rule — to a parsed document, in table order. Returns
/// true if any modifications were made.
@@ -1760,23 +1638,6 @@ pub fn format_deprecation_warnings(info: &DeprecationInfo) -> String {
))
);
}
- DeprecationKind::PreHookTableForm(hooks) => {
- let hook_list = hooks
- .iter()
- .map(|h| cformat!("<bold>{h}</>"))
- .collect::<Vec<_>>()
- .join(", ");
- let _ = writeln!(
- out,
- "{}",
- warning_message(cformat!(
- "{label}: table form for {hook_list} is deprecated in favor of the pipeline form. \
- We're unifying pre-hooks, post-hooks, and aliases so that list form always runs serially \
- and table form always runs in parallel — migrate now to keep the current serial behavior \
- once the table form is repurposed."
- ))
- );
- }
}
}
@@ -4299,208 +4160,6 @@ ff = true
);
}
- // ==================== pre-hook table form tests ====================
-
- fn find_pre_hook_table_form(content: &str) -> Vec<String> {
- detect_deprecations(content)
- .into_iter()
- .find_map(|k| match k {
- DeprecationKind::PreHookTableForm(found) => Some(found),
- _ => None,
- })
- .unwrap_or_default()
- }
-
- #[test]
- fn test_detect_pre_hook_table_form() {
- // Multi-entry table → detected
- let found = find_pre_hook_table_form("[pre-merge]\ntest = \"t\"\nlint = \"l\"\n");
- assert_eq!(found, vec!["pre-merge"]);
-
- // Single-entry table → not detected
- let found = find_pre_hook_table_form("[pre-merge]\ntest = \"t\"\n");
- assert!(found.is_empty());
-
- // String form → not detected
- let found = find_pre_hook_table_form("pre-merge = \"cargo test\"\n");
- assert!(found.is_empty());
-
- // Inline table form → detected like section table form
- let found = find_pre_hook_table_form("pre-merge = { test = \"t\", lint = \"l\" }\n");
- assert_eq!(found, vec!["pre-merge"]);
-
- // Array/pipeline form → not detected
- let found = find_pre_hook_table_form("pre-merge = [{test = \"t\"}, {lint = \"l\"}]\n");
- assert!(found.is_empty());
-
- // Post-* hooks → not detected (table form is canonical for post-*)
- let found = find_pre_hook_table_form("[post-merge]\ntest = \"t\"\nlint = \"l\"\n");
- assert!(found.is_empty());
-
- // All 5 pre-* keys detected
- let content = r#"
-[pre-switch]
-a = "1"
-b = "2"
-
-[pre-start]
-a = "1"
-b = "2"
-
-[pre-commit]
-a = "1"
-b = "2"
-
-[pre-merge]
-a = "1"
-b = "2"
-
-[pre-remove]
-a = "1"
-b = "2"
-"#;
- let found = find_pre_hook_table_form(content);
- assert_eq!(
- found,
- vec![
- "pre-switch",
- "pre-start",
- "pre-commit",
- "pre-merge",
- "pre-remove"
- ]
- );
- }
-
- #[test]
- fn test_detect_pre_hook_table_form_per_project() {
- // Per-project overrides: hooks are flattened under [projects."id"]
- let content = r#"
-[projects."github.com/user/repo".pre-start]
-install = "npm ci"
-build = "npm run build"
-"#;
- let found = find_pre_hook_table_form(content);
- assert_eq!(found, vec!["projects.\"github.com/user/repo\".pre-start"]);
- }
-
- #[test]
- fn test_migrate_pre_hook_table_form_converts_to_pipeline() {
- let content = r#"
-[pre-merge]
-test = "cargo test"
-lint = "cargo clippy"
-"#;
- let result = migrate_content(content);
- // Should produce `[[pre-merge]]` array-of-tables blocks
- assert!(
- result.contains("[[pre-merge]]"),
- "Should emit [[pre-merge]] blocks: {result}"
- );
- // Verify it parses back as valid TOML with the right structure
- let doc: toml_edit::DocumentMut = result.parse().unwrap();
- let arr = doc["pre-merge"]
- .as_array_of_tables()
- .expect("should be array of tables");
- assert_eq!(arr.len(), 2);
- let first = arr.get(0).unwrap();
- assert_eq!(first.get("test").unwrap().as_str().unwrap(), "cargo test");
- let second = arr.get(1).unwrap();
- assert_eq!(
- second.get("lint").unwrap().as_str().unwrap(),
- "cargo clippy"
- );
- }
-
- #[test]
- fn test_migrate_pre_hook_inline_table_form_converts_to_pipeline() {
- let content = r#"pre-merge = { test = "cargo test", lint = "cargo clippy" }
-"#;
- let result = migrate_content(content);
- let doc: toml_edit::DocumentMut = result.parse().unwrap();
- let arr = doc["pre-merge"]
- .as_array_of_tables()
- .expect("should be array of tables");
- assert_eq!(arr.len(), 2);
- assert_eq!(arr.get(0).unwrap()["test"].as_str(), Some("cargo test"));
- assert_eq!(arr.get(1).unwrap()["lint"].as_str(), Some("cargo clippy"));
- }
-
- #[test]
- fn test_migrate_pre_hook_table_form_preserves_order() {
- let content = r#"
-[pre-merge]
-first = "1"
-second = "2"
-third = "3"
-"#;
- let result = migrate_content(content);
- let doc: toml_edit::DocumentMut = result.parse().unwrap();
- let arr = doc["pre-merge"].as_array_of_tables().unwrap();
- let names: Vec<&str> = arr.iter().map(|t| t.iter().next().unwrap().0).collect();
- assert_eq!(names, vec!["first", "second", "third"]);
- }
-
- #[test]
- fn test_migrate_pre_hook_table_form_single_entry_untouched() {
- let content = "[pre-merge]\ntest = \"t\"\n";
- let result = migrate_content(content);
- assert_eq!(result, content, "Single-entry table should not be migrated");
- }
-
- #[test]
- fn test_migrate_pre_hook_table_form_per_project() {
- let content = r#"
-[projects."web".pre-start]
-install = "npm ci"
-build = "npm run build"
-"#;
- let result = migrate_content(content);
- let doc: toml_edit::DocumentMut = result.parse().unwrap();
- let project = doc["projects"]["web"].as_table().unwrap();
- let arr = project["pre-start"]
- .as_array_of_tables()
- .expect("should be array of tables");
- assert_eq!(arr.len(), 2);
- }
-
- #[test]
- fn test_migrate_content_includes_pre_hook_table_form() {
- let content = r#"
-[pre-merge]
-test = "cargo test"
-lint = "cargo clippy"
-
-[merge]
-no-ff = true
-"#;
- let result = migrate_content(content);
- assert!(
- result.contains("[[pre-merge]]"),
- "Table section should become [[pre-merge]] blocks: {result}"
- );
- assert!(
- result.contains("ff = false"),
- "no-ff should also migrate: {result}"
- );
- }
-
- #[test]
- fn snapshot_migrate_pre_hook_table_form() {
- let content = r#"[pre-merge]
-test = "cargo test"
-lint = "cargo clippy"
-
-[post-start]
-server = "npm run dev"
-"#;
- // The pipeline migration only transforms pre-* hooks; post-start is a
- // post-* hook (table form is canonical there) and must pass through
- // untouched.
- let result = migrate_content(content);
- insta::assert_snapshot!(migration_diff(content, &result));
- }
-
/// Every `DEPRECATION_RULES` row's migration fires on one config, pinning
/// cross-rule interactions the per-rule tests can't see — in particular
/// the inserted `[forge]` staying in the mid-file spot where the user
@@ -4512,10 +4171,6 @@ server = "npm run dev"
let content = r#"worktree-path = "../{{ repo_root }}.{{ branch }}"
pre-create = "npm install"
-[pre-merge]
-test = "cargo test"
-lint = "cargo clippy"
-
[commit-generation]
command = "llm"
args = ["-m", "haiku"]
diff --git a/src/config/snapshots/worktrunk__config__deprecation__tests__snapshot_migrate_all_rules_combined.snap b/src/config/snapshots/worktrunk__config__deprecation__tests__snapshot_migrate_all_rules_combined.snap
index f84a3ad57..ed016bd78 100644
--- a/src/config/snapshots/worktrunk__config__deprecation__tests__snapshot_migrate_all_rules_combined.snap
+++ b/src/config/snapshots/worktrunk__config__deprecation__tests__snapshot_migrate_all_rules_combined.snap
@@ -7,13 +7,6 @@ expression: "migration_diff(content, &migrated)"
+worktree-path = "../{{ repo_path }}.{{ branch }}"
+pre-start = "npm install"
--[pre-merge]
-+[[pre-merge]]
- test = "cargo test"
-+
-+[[pre-merge]]
- lint = "cargo clippy"
-
-[commit-generation]
-command = "llm"
-args = ["-m", "haiku"]
diff --git a/src/config/snapshots/worktrunk__config__deprecation__tests__snapshot_migrate_pre_hook_table_form.snap b/src/config/snapshots/worktrunk__config__deprecation__tests__snapshot_migrate_pre_hook_table_form.snap
deleted file mode 100644
index a3342f01e..000000000
--- a/src/config/snapshots/worktrunk__config__deprecation__tests__snapshot_migrate_pre_hook_table_form.snap
+++ /dev/null
@@ -1,13 +0,0 @@
----
-source: src/config/deprecation.rs
-expression: "migration_diff(content, &result)"
----
--[pre-merge]
-+[[pre-merge]]
- test = "cargo test"
-+
-+[[pre-merge]]
- lint = "cargo clippy"
-
- [post-start]
- server = "npm run dev"
diff --git a/tests/integration_tests/config_show.rs b/tests/integration_tests/config_show.rs
index cc394c85a..5c46fa0f9 100644
--- a/tests/integration_tests/config_show.rs
+++ b/tests/integration_tests/config_show.rs
@@ -3384,45 +3384,6 @@ pre-start = "ln -sf {{ repo_root }}/node_modules {{ worktree }}/node_modules"
);
}
-/// `wt config show` displays deprecation details for pre-* hooks in table form.
-/// Uses project config with two multi-entry pre-* tables to cover the
-/// "Project config" label and the multi-hook list form of the warning.
-#[rstest]
-fn test_config_show_displays_pre_hook_table_form_deprecation(
- mut repo: TestRepo,
- temp_home: TempDir,
-) {
- repo.setup_mock_ci_tools_unauthenticated();
-
- let project_config_dir = repo.root_path().join(".config");
- fs::create_dir_all(&project_config_dir).unwrap();
- let project_config_path = project_config_dir.join("wt.toml");
- fs::write(
- &project_config_path,
- r#"[pre-merge]
-test = "cargo test"
-lint = "cargo clippy"
-
-[pre-start]
-install = "npm ci"
-env = "cp .env.example .env"
-"#,
- )
- .unwrap();
-
- let settings = setup_snapshot_settings_with_home(&repo, &temp_home);
- settings.bind(|| {
- let mut cmd = wt_command();
- repo.configure_wt_cmd(&mut cmd);
- repo.configure_mock_commands(&mut cmd);
- cmd.arg("config").arg("show").current_dir(repo.root_path());
- set_temp_home_env(&mut cmd, temp_home.path());
- set_xdg_config_path(&mut cmd, temp_home.path());
-
- assert_cmd_snapshot!(cmd);
- });
-}
-
/// `wt config show` displays deprecation details for `[select]` → `[switch.picker]`.
/// Uses user config so the warning label reads "User config".
#[rstest]
diff --git a/tests/integration_tests/post_start_commands.rs b/tests/integration_tests/post_start_commands.rs
index e764fe197..d93f45e70 100644
--- a/tests/integration_tests/post_start_commands.rs
+++ b/tests/integration_tests/post_start_commands.rs
@@ -124,8 +124,16 @@ approved-commands = [
"#,
);
- // Commands should execute sequentially
- snapshot_switch("post_start_named_commands", &repo, &["--create", "feature"]);
+ // Table-form commands run concurrently with prefixed output;
+ // WORKTRUNK_TEST_SERIAL_CONCURRENT pins the line order for the snapshot.
+ let temp_home = TempDir::new().unwrap();
+ let settings = setup_snapshot_settings(&repo);
+ settings.bind(|| {
+ let mut cmd = make_snapshot_cmd(&repo, "switch", &["--create", "feature"], None);
+ cmd.env("WORKTRUNK_TEST_SERIAL_CONCURRENT", "1");
+ set_temp_home_env(&mut cmd, temp_home.path());
+ assert_cmd_snapshot!("post_start_named_commands", cmd);
+ });
}
#[rstest]
@@ -152,14 +160,16 @@ approved-commands = ["exit 1"]
#[rstest]
fn test_post_start_template_expansion(repo: TestRepo) {
- // Create project config with template variables
+ // Create project config with template variables. Pipeline form: the
+ // steps append to one file, so they must run serially.
repo.write_project_config(
- r#"[pre-start]
-repo = "echo 'Repo: {{ repo }}' > info.txt"
-branch = "echo 'Branch: {{ branch }}' >> info.txt"
-hash_port = "echo 'Port: {{ branch | hash_port }}' >> info.txt"
-worktree = "echo 'Worktree: {{ worktree_path }}' >> info.txt"
-root = "echo 'Root: {{ repo_path }}' >> info.txt"
+ r#"pre-start = [
+ { repo = "echo 'Repo: {{ repo }}' > info.txt" },
+ { branch = "echo 'Branch: {{ branch }}' >> info.txt" },
+ { hash_port = "echo 'Port: {{ branch | hash_port }}' >> info.txt" },
+ { worktree = "echo 'Worktree: {{ worktree_path }}' >> info.txt" },
+ { root = "echo 'Root: {{ repo_path }}' >> info.txt" },
+]
"#,
);
@@ -317,13 +327,15 @@ fn test_post_start_git_variables_template(#[from(repo_with_remote)] repo: TestRe
.run()
.expect("failed to push");
- // Create project config with git-related template variables
+ // Create project config with git-related template variables. Pipeline
+ // form: the steps append to one file, so they must run serially.
repo.write_project_config(
- r#"[pre-start]
-commit = "echo 'Commit: {{ commit }}' > git_vars.txt"
-short = "echo 'Short: {{ short_commit }}' >> git_vars.txt"
-remote = "echo 'Remote: {{ remote }}' >> git_vars.txt"
-worktree_name = "echo 'Worktree Name: {{ worktree_name }}' >> git_vars.txt"
+ r#"pre-start = [
+ { commit = "echo 'Commit: {{ commit }}' > git_vars.txt" },
+ { short = "echo 'Short: {{ short_commit }}' >> git_vars.txt" },
+ { remote = "echo 'Remote: {{ remote }}' >> git_vars.txt" },
+ { worktree_name = "echo 'Worktree Name: {{ worktree_name }}' >> git_vars.txt" },
+]
"#,
);
@@ -465,11 +477,13 @@ approved-commands = ["{% if not upstream %}echo 'no-upstream' > upstream.txt{% e
#[rstest]
fn test_post_start_base_variables(repo: TestRepo) {
- // Create project config with base template variables
+ // Create project config with base template variables. Pipeline form: the
+ // steps append to one file, so they must run serially.
repo.write_project_config(
- r#"[pre-start]
-base = "echo 'Base: {{ base }}' > base_info.txt"
-base_path = "echo 'Base Path: {{ base_worktree_path }}' >> base_info.txt"
+ r#"pre-start = [
+ { base = "echo 'Base: {{ base }}' > base_info.txt" },
+ { base_path = "echo 'Base Path: {{ base_worktree_path }}' >> base_info.txt" },
+]
"#,
);
diff --git a/tests/integration_tests/step_alias.rs b/tests/integration_tests/step_alias.rs
index 73f743ce7..d227910ee 100644
--- a/tests/integration_tests/step_alias.rs
+++ b/tests/integration_tests/step_alias.rs
@@ -309,6 +309,46 @@ emit = "echo hello"
);
}
+/// A one-entry alias table is a single named command, not a concurrent group
+/// of one: its output passes through on stdout without a `name │` prefix,
+/// identical to the string and `[[aliases.x]]` spellings.
+#[rstest]
+fn test_alias_single_entry_table_writes_to_stdout(mut repo: TestRepo) {
+ repo.write_project_config(
+ r#"
+[aliases.emit]
+say = "echo hello"
+"#,
+ );
+ repo.commit("Add alias config");
+ let feature_path = repo.add_worktree("feature");
+
+ let output = repo
+ .wt_command()
+ .args(["-y", "emit"])
+ .current_dir(&feature_path)
+ .output()
+ .unwrap();
+
+ assert!(
+ output.status.success(),
+ "alias failed:\nstdout: {}\nstderr: {}",
+ String::from_utf8_lossy(&output.stdout),
+ String::from_utf8_lossy(&output.stderr)
+ );
+ let stdout = String::from_utf8_lossy(&output.stdout);
+ let stderr = String::from_utf8_lossy(&output.stderr);
+ assert!(
+ stdout.lines().any(|line| line.trim() == "hello"),
+ "expected unprefixed `hello` on stdout, got stdout={stdout:?} stderr={stderr:?}"
+ );
+ assert!(
+ !stdout.contains('│') && !stderr.contains("say │"),
+ "single named command must not use the concurrent `name │` prefix, \
+ got stdout={stdout:?} stderr={stderr:?}"
+ );
+}
+
/// Alias command failure propagates exit code (-y bypasses approval)
#[rstest]
fn test_step_alias_exit_code(mut repo: TestRepo) {
@@ -1519,11 +1559,14 @@ fn test_alias_concurrent_handles_non_utf8(repo: TestRepo) {
// `printf` emits a raw 0xff byte (invalid as a lone UTF-8 sequence), a
// CRLF-terminated line, then `yes` floods 50_000 more valid UTF-8 lines.
// If the reader stopped at the bad byte, the pipe would fill and the
- // child would block — we'd time out.
+ // child would block — we'd time out. The trivial `other` command keeps
+ // the step a multi-command group so it routes through the concurrent
+ // executor (a one-command map parses as a plain `Single` step).
repo.write_test_config(
r#"
[aliases.noisy]
mixed = "sh -c 'printf \"BEFORE\\n\\xff\\nCRLF-LINE\\r\\nAFTER\\n\"; yes PAYLOAD | head -n 50000'"
+other = "true"
"#,
);
repo.commit("initial");
diff --git a/tests/integration_tests/user_hooks.rs b/tests/integration_tests/user_hooks.rs
index f77f936e3..049a4961d 100644
--- a/tests/integration_tests/user_hooks.rs
+++ b/tests/integration_tests/user_hooks.rs
@@ -502,12 +502,14 @@ long = "sh -c 'echo start >> hook.log; sleep 30; echo done >> hook.log'"
fn test_pre_merge_pipeline_aborts_on_signal_exit(repo: TestRepo) {
repo.commit("Initial commit");
- // Two pre-merge hooks: the first writes a marker then self-signals with
- // SIGTERM; the second (which must NOT run) would write its own marker.
+ // Two pre-merge pipeline steps: the first writes a marker then
+ // self-signals with SIGTERM; the second (which must NOT run) would write
+ // its own marker.
repo.write_project_config(
- r#"[pre-merge]
-abort = "sh -c 'echo first >> hook.log; kill -TERM $$'"
-after = "sh -c 'echo second >> hook.log'"
+ r#"pre-merge = [
+ { abort = "sh -c 'echo first >> hook.log; kill -TERM $$'" },
+ { after = "sh -c 'echo second >> hook.log'" },
+]
"#,
);
repo.commit("Add pre-merge hooks");
@@ -2801,6 +2803,9 @@ test = "echo '{{ main_worktree }}' > alias_output.txt"
fn test_user_hooks_preserve_toml_order(repo: TestRepo) {
// Write user config with hooks in specific order (NOT alphabetical: vscode, claude, copy, submodule)
// If order were alphabetical, it would be: claude, copy, submodule, vscode
+ // Table-form commands run concurrently; WORKTRUNK_TEST_SERIAL_CONCURRENT
+ // runs the group one command at a time in declaration order, so the file
+ // appends (and the snapshot) expose the parsed TOML order.
repo.write_test_config(
r#"[pre-start]
vscode = "echo '1' >> hook_order.txt"
@@ -2810,7 +2815,12 @@ submodule = "echo '4' >> hook_order.txt"
"#,
);
- snapshot_switch("user_hooks_preserve_order", &repo, &["--create", "feature"]);
+ let settings = setup_snapshot_settings(&repo);
+ settings.bind(|| {
+ let mut cmd = make_snapshot_cmd(&repo, "switch", &["--create", "feature"], None);
+ cmd.env("WORKTRUNK_TEST_SERIAL_CONCURRENT", "1");
+ assert_cmd_snapshot!("user_hooks_preserve_order", cmd);
+ });
// Verify execution order by reading the output file
let worktree_path = repo.root_path().parent().unwrap().join("repo.feature");
@@ -3768,10 +3778,11 @@ test = "echo TEST"
);
}
-/// Deprecated single-table form (`[pre-merge]`) still runs commands serially,
-/// even though the commands are parsed as a `Concurrent` step.
+/// Table form (`[pre-merge]` with multiple keys) runs commands concurrently,
+/// like every other multi-key step — `[pre-merge]` and a single `[[pre-merge]]`
+/// block parse to the same `Concurrent` step.
#[rstest]
-fn test_pre_merge_deprecated_table_runs_serially(repo: TestRepo) {
+fn test_pre_merge_table_form_runs_concurrently(repo: TestRepo) {
repo.write_project_config(
r#"[pre-merge]
lint = "echo LINT"
@@ -3784,44 +3795,17 @@ test = "echo TEST"
cmd.args(["hook", "pre-merge", "--yes"]);
let output = cmd.output().unwrap();
- let stderr = String::from_utf8_lossy(&output.stderr);
- assert!(
- stderr.contains("LINT") && stderr.contains("TEST"),
- "both commands should run: {stderr}",
- );
- // Serial execution does not use the "│" prefix labels.
- assert!(
- !stderr.contains("│ LINT") && !stderr.contains("│ TEST"),
- "deprecated table form should run serially (no prefix labels): {stderr}",
- );
-}
-
-/// A single `[[pre-merge]]` block (one block, multiple entries) runs
-/// concurrently — the `[[]]` syntax is the pipeline form even with one block.
-#[rstest]
-fn test_pre_merge_single_pipeline_block_runs_concurrently(repo: TestRepo) {
- repo.write_project_config(
- r#"[[pre-merge]]
-lint = "echo LINT"
-test = "echo TEST"
-"#,
- );
- repo.commit("Add single-block pipeline pre-merge hooks");
-
- let mut cmd = repo.wt_command();
- cmd.args(["hook", "pre-merge", "--yes"]);
- let output = cmd.output().unwrap();
-
assert!(
output.status.success(),
- "single-block pipeline should succeed.\nstderr: {}",
+ "pre-merge table form should succeed.\nstderr: {}",
String::from_utf8_lossy(&output.stderr),
);
+ // Concurrent commands get prefixed labels (e.g., "lint │ LINT").
let stderr = String::from_utf8_lossy(&output.stderr);
assert!(
stderr.contains("│ LINT") && stderr.contains("│ TEST"),
- "single [[pre-merge]] block should run concurrently: {stderr}",
+ "table-form commands should run concurrently (prefixed labels): {stderr}",
);
}
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap
index 3b4fb5eae..66b9b90f1 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_mixed_approved_unapproved.snap
@@ -6,8 +6,6 @@ exit_code: 1
----- stdout -----
----- stderr -----
-▲ Project config: table form for pre-start is deprecated in favor of the pipeline form. We're unifying pre-hooks, post-hooks, and aliases so that list form always runs serially and table form always runs in parallel — migrate now to keep the current serial behavior once the table form is repurposed.
-↳ To see details, run wt config show; to apply updates, run wt config update
▲ repo needs approval to execute 2 commands:
○ pre-start first:
  echo 'First command'
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap
index 7531b3d15..a991a9278 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_multiple_commands.snap
@@ -6,8 +6,6 @@ exit_code: 1
----- stdout -----
----- stderr -----
-▲ Project config: table form for pre-start is deprecated in favor of the pipeline form. We're unifying pre-hooks, post-hooks, and aliases so that list form always runs serially and table form always runs in parallel — migrate now to keep the current serial behavior once the table form is repurposed.
-↳ To see details, run wt config show; to apply updates, run wt config update
▲ origin needs approval to execute 4 commands:
○ pre-start branch:
  echo 'Branch: {{ branch }}'
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap b/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap
index 2cd78fd1f..79220b8c2 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__approval_named_commands.snap
@@ -6,8 +6,6 @@ exit_code: 1
----- stdout -----
----- stderr -----
-▲ Project config: table form for pre-start is deprecated in favor of the pipeline form. We're unifying pre-hooks, post-hooks, and aliases so that list form always runs serially and table form always runs in parallel — migrate now to keep the current serial behavior once the table form is repurposed.
-↳ To see details, run wt config show; to apply updates, run wt config update
▲ origin needs approval to execute 3 commands:
○ pre-start install:
  echo 'Installing dependencies...'
diff --git a/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap b/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap
index 3b4fb5eae..66b9b90f1 100644
--- a/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap
+++ b/tests/snapshots/integration__integration_tests__approval_ui__decline_approval_skips_only_unapproved.snap
@@ -6,8 +6,6 @@ exit_code: 1
----- stdout -----
----- stderr -----
-▲ Project config: table form for pre-start is deprecated in favor of the pipeline form. We're unifying pre-hooks, post-hooks, and aliases so that list form always runs serially and table form always runs in parallel — migrate now to keep the current serial behavior once the table form is repurposed.
-↳ To see details, run wt config show; to apply updates, run wt config update
▲ repo needs approval to execute 2 commands:
○ pre-start first:
  echo 'First command'
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_pre_hook_table_form_deprecation.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_displays_pre_hook_table_form_deprecation.snap
deleted file mode 100644
index 3034ed8e6..000000000
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_displays_pre_hook_table_form_deprecation.snap
+++ /dev/null
@@ -1,94 +0,0 @@
----
-source: tests/integration_tests/config_show.rs
-info:
- program: wt
- args:
- - config
- - show
- env:
- APPDATA: "[TEST_CONFIG_HOME]"
- CLICOLOR_FORCE: "1"
- COLUMNS: "500"
- GIT_AUTHOR_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMITTER_DATE: "2025-01-01T00:00:00Z"
- GIT_COMMON_DIR: ""
- GIT_CONFIG_GLOBAL: "[TEST_GIT_CONFIG]"
- GIT_CONFIG_SYSTEM: /dev/null
- GIT_DIR: ""
- GIT_EDITOR: ""
- GIT_INDEX_FILE: ""
- GIT_OBJECT_DIRECTORY: ""
- GIT_TERMINAL_PROMPT: "0"
- GIT_WORK_TREE: ""
- HOME: "[TEST_HOME]"
- LANG: C
- LC_ALL: C
- LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
- MOCK_CONFIG_DIR: "[MOCK_CONFIG_DIR]"
- NO_COLOR: ""
- OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
- PATH: "[PATH]"
- PSModulePath: ""
- RUST_LOG: warn
- SHELL: ""
- TERM: alacritty
- USERPROFILE: "[TEST_HOME]"
- WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
- WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
- WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
- WORKTRUNK_TEST_BASH_INSTALLED: "0"
- WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
- WORKTRUNK_TEST_CODEX_INSTALLED: "0"
- WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
- WORKTRUNK_TEST_EPOCH: "1735776000"
- WORKTRUNK_TEST_FISH_INSTALLED: "0"
- WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
- WORKTRUNK_TEST_NUSHELL_ENV: "0"
- WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
- WORKTRUNK_TEST_POWERSHELL_ENV: "0"
- WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
- WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
- WORKTRUNK_TEST_ZSH_INSTALLED: "0"
- XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
----
-success: true
-exit_code: 0
------ stdout -----
-USER CONFIG @ ~/.config/worktrunk/config.toml
-↳ Not found; to create one, run wt config create
-
-PROJECT CONFIG @ _REPO_/.config/wt.toml
-○ Identifier: ../origin
-▲ Project config: table form for pre-start, pre-merge is deprecated in favor of the pipeline form. We're unifying pre-hooks, post-hooks, and aliases so that list form always runs serially and table form always runs in parallel — migrate now to keep the current serial behavior once the table form is repurposed.
-↳ To apply: wt config update
-○ Proposed diff:
-  diff --git a/wt.toml/current b/wt.toml/migrated
-  index 3a61835..dc2a222 100644
-  --- a/wt.toml/current
-  +++ b/wt.toml/migrated
-  @@ -1,7 +1,11 @@
-  -[pre-merge]
-  +[[pre-merge]]
-  test = "cargo test"
-  +
-  +[[pre-merge]]
-  lint = "cargo clippy"
-  
-  -[pre-start]
-  +[[pre-start]]
-  install = "npm ci"
-  +
-  +[[pre-start]]
-  env = "cp .env.example .env"
-
-SHELL INTEGRATION
-▲ Shell integration not configured
-↳ To configure, run wt config shell install
-  Invoked as: [PROJECT_ROOT]/target/[BUILD_MODE]/wt
-
-OTHER
-○ wt: [VERSION]
-○ git: [VERSION]
-○ Hyperlinks: inactive
-
------ stderr -----
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_base_variables.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_base_variables.snap
index 1b61b0a15..651f2c4b6 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_base_variables.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_base_variables.snap
@@ -32,7 +32,6 @@ info:
OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
PATH: "[PATH]"
PSModulePath: ""
- RUST_LOG: warn
SHELL: ""
TERM: alacritty
USERPROFILE: "[TEST_HOME]"
@@ -59,8 +58,6 @@ exit_code: 0
----- stdout -----
----- stderr -----
-▲ Project config: table form for pre-start is deprecated in favor of the pipeline form. We're unifying pre-hooks, post-hooks, and aliases so that list form always runs serially and table form always runs in parallel — migrate now to keep the current serial behavior once the table form is repurposed.
-↳ To see details, run wt config show; to apply updates, run wt config update
◎ Running pre-start project:base @ _REPO_.feature
  echo 'Base: main' > base_info.txt
◎ Running pre-start project:base_path @ _REPO_.feature
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_git_variables_template.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_git_variables_template.snap
index 2e3e0a285..668fe120e 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_git_variables_template.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_git_variables_template.snap
@@ -31,7 +31,6 @@ info:
OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
PATH: "[PATH]"
PSModulePath: ""
- RUST_LOG: warn
SHELL: ""
TERM: alacritty
USERPROFILE: "[TEST_HOME]"
@@ -58,12 +57,10 @@ exit_code: 0
----- stdout -----
----- stderr -----
-▲ Project config: table form for pre-start is deprecated in favor of the pipeline form. We're unifying pre-hooks, post-hooks, and aliases so that list form always runs serially and table form always runs in parallel — migrate now to keep the current serial behavior once the table form is repurposed.
-↳ To see details, run wt config show; to apply updates, run wt config update
◎ Running pre-start project:commit @ _REPO_.feature
-  echo 'Commit: 72ad3f366b7d9a0fad6f311caa63139e2dc02f0e' > git_vars.txt
+  echo 'Commit: a827424d2adb03bfe18f18dd333a68b364f6c97f' > git_vars.txt
◎ Running pre-start project:short @ _REPO_.feature
-  echo 'Short: 72ad3f3' >> git_vars.txt
+  echo 'Short: a827424' >> git_vars.txt
◎ Running pre-start project:remote @ _REPO_.feature
  echo 'Remote: origin' >> git_vars.txt
◎ Running pre-start project:worktree_name @ _REPO_.feature
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_named_commands.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_named_commands.snap
index 79e2867e1..40f951313 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_named_commands.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_named_commands.snap
@@ -30,7 +30,6 @@ info:
OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
PATH: "[PATH]"
PSModulePath: ""
- RUST_LOG: warn
SHELL: ""
TERM: alacritty
USERPROFILE: "[TEST_HOME]"
@@ -48,6 +47,7 @@ info:
WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_SERIAL_CONCURRENT: "1"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
WORKTRUNK_TEST_ZSH_INSTALLED: "0"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
@@ -57,14 +57,12 @@ exit_code: 0
----- stdout -----
----- stderr -----
-▲ Project config: table form for pre-start is deprecated in favor of the pipeline form. We're unifying pre-hooks, post-hooks, and aliases so that list form always runs serially and table form always runs in parallel — migrate now to keep the current serial behavior once the table form is repurposed.
-↳ To see details, run wt config show; to apply updates, run wt config update
◎ Running pre-start project:install @ _REPO_.feature
  echo 'Installing deps'
-Installing deps
◎ Running pre-start project:setup @ _REPO_.feature
  echo 'Running setup'
-Running setup
+install │ Installing deps
+setup  │ Running setup
✓ Created branch feature from main and worktree @ _REPO_.feature
↳ To customize worktree locations, run wt config create
▲ Cannot change directory — shell integration not installed
diff --git a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_template_expansion.snap b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_template_expansion.snap
index d2dbca33f..a78d4f8d5 100644
--- a/tests/snapshots/integration__integration_tests__post_start_commands__post_start_template_expansion.snap
+++ b/tests/snapshots/integration__integration_tests__post_start_commands__post_start_template_expansion.snap
@@ -30,7 +30,6 @@ info:
OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
PATH: "[PATH]"
PSModulePath: ""
- RUST_LOG: warn
SHELL: ""
TERM: alacritty
USERPROFILE: "[TEST_HOME]"
@@ -57,8 +56,6 @@ exit_code: 0
----- stdout -----
----- stderr -----
-▲ Project config: table form for pre-start is deprecated in favor of the pipeline form. We're unifying pre-hooks, post-hooks, and aliases so that list form always runs serially and table form always runs in parallel — migrate now to keep the current serial behavior once the table form is repurposed.
-↳ To see details, run wt config show; to apply updates, run wt config update
◎ Running pre-start project:repo @ _REPO_.feature-test
  echo 'Repo: repo' > info.txt
◎ Running pre-start project:branch @ _REPO_.feature-test
diff --git a/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_preserve_order.snap b/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_preserve_order.snap
index 8249586ba..326273e26 100644
--- a/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_preserve_order.snap
+++ b/tests/snapshots/integration__integration_tests__user_hooks__user_hooks_preserve_order.snap
@@ -30,7 +30,6 @@ info:
OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
PATH: "[PATH]"
PSModulePath: ""
- RUST_LOG: warn
SHELL: ""
TERM: alacritty
USERPROFILE: "[TEST_HOME]"
@@ -48,6 +47,7 @@ info:
WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
WORKTRUNK_TEST_POWERSHELL_ENV: "0"
WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_SERIAL_CONCURRENT: "1"
WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
WORKTRUNK_TEST_ZSH_INSTALLED: "0"
XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
@@ -57,17 +57,15 @@ exit_code: 0
----- stdout -----
----- stderr -----
-▲ User config: table form for pre-start is deprecated in favor of the pipeline form. We're unifying pre-hooks, post-hooks, and aliases so that list form always runs serially and table form always runs in parallel — migrate now to keep the current serial behavior once the table form is repurposed.
-↳ To see details, run wt config show; to apply updates, run wt config update
◎ Running pre-start user:vscode @ _REPO_.feature
  echo '1' >> hook_order.txt
-◎ Running pre-start user:claude @ _REPO_.feature
+◎ Running pre-start user:claude @ _REPO_.feature
  echo '2' >> hook_order.txt
-◎ Running pre-start user:copy @ _REPO_.feature
+◎ Running pre-start user:copy @ _REPO_.feature
  echo '3' >> hook_order.txt
-◎ Running pre-start user:submodule @ _REPO_.feature
+◎ Running pre-start user:submodule @ _REPO_.feature
  echo '4' >> hook_order.txt
-✓ Created branch feature from main and worktree @ _REPO_.feature
+✓ Created branch feature from main and worktree @ _REPO_.feature
↳ To customize worktree locations, run wt config create
▲ Cannot change directory — shell integration not installed
↳ To enable automatic cd, run wt config shell install