Skip to content

fix(runtime): warn when --bare skips worktree subsystem bootstrap - #6291

Merged
bug-ops merged 2 commits into
mainfrom
fix/6256-worktree-bare-mode-warning
Jul 14, 2026
Merged

fix(runtime): warn when --bare skips worktree subsystem bootstrap#6291
bug-ops merged 2 commits into
mainfrom
fix/6256-worktree-bare-mode-warning

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • src/runner.rs's worktree subsystem bootstrap gate (agents_config.worktree.enabled && !exec_mode.bare) had no else branch for the enabled && bare combination — WorktreeManager was never constructed and no warning was logged either, so a config with worktree.enabled = true was silently ignored under --bare.
  • This is the 6th confirmed instance of the --bare-mode-silently-skips-a-subsystem defect class (prior instance: MagicDocs registration never fires in --bare mode despite [magic_docs] enabled=true #6127 for MagicDocs).
  • Practical impact: a sub-agent with permissions.worktree = true running under --bare lost its worktree isolation guarantee (INV-1/INV-3, specs/063-worktree-subsystem/spec.md) with nothing surfaced to the operator — notable because --bare is the documented/recommended flag for CI/scripted sessions, exactly where this matters.

Changes

  • src/runner.rs: added an else if agents_config.worktree.enabled && exec_mode.bare branch emitting a tracing::warn! describing the skipped isolation guarantee. WorktreeManager is still never constructed under --bare by design — that would defeat the point of --bare as a fast, dependency-light path for CI/scripting.
  • src/runner.rs: added bare_flag_skips_worktree_guard unit test alongside the existing sibling guard tests (bare_flag_skips_{code_indexer,scheduler,mcp_connect,gateway_spawn}_guard).
  • crates/zeph-core/src/agent/builder.rs: updated Agent::with_bare_mode's doc comment to list the worktree subsystem among those --bare skips.
  • CHANGELOG.md: added a Fixed entry under [Unreleased].
  • .local/testing/playbooks/worktree.md (main repo): added Scenario 17 with reproduction steps and a negative control.
  • .local/testing/coverage-status.md (main repo): added a row for this behavior (status Untested, pending live-session confirmation).

Review notes

Went through the reduced bug-fix chain (root cause and fix were already scoped on the issue via a prior CI recommendation, so the debugger step was skipped):

  • Adversarial critique (impl-critic): approved, no blocking findings. Verified the warning's factual claim against crates/zeph-subagent/src/manager/spawn.rs (subagents do run unisolated under --bare exactly as the message states).
  • Test coverage validation (tester): 9/9 bare_flag tests pass independently, no regressions. Two advisory (non-blocking) gaps noted — pre-existing test debt unrelated to this change, and an optional negative-control test — both left as follow-up suggestions, not blockers.
  • Code review: approved, no changes requested.

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo nextest run --config-file .github/nextest.toml -p zeph --bins -E 'test(bare_flag)' — 9/9 passed, including the new bare_flag_skips_worktree_guard
  • Live-session confirmation of the warning firing (playbook Scenario 17) — tracked as Untested in coverage-status.md pending the next CI cycle

Closes #6256

`--bare` silently skipped WorktreeManager construction and capability
probing even when worktree.enabled = true, with no operator-visible
signal — background sub-agents with permissions.worktree = true lost
their isolation guarantee unnoticed. Emit a tracing::warn! for the
enabled + bare combination and document the skip in
Agent::with_bare_mode's doc comment.

Closes #6256
@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate bug Something isn't working size/M Medium PR (51-200 lines) labels Jul 14, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 14, 2026 18:48
@bug-ops
bug-ops merged commit dbd6404 into main Jul 14, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/6256-worktree-bare-mode-warning branch July 14, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

worktree subsystem silently skipped in --bare mode with no warning

1 participant