Skip to content

docs(clave): document the PATH leak that broke v0.1.1 daily driving (#43, #44) - #46

Merged
olliegilbey merged 1 commit into
mainfrom
docs/path-leak-footgun
Jul 22, 2026
Merged

docs(clave): document the PATH leak that broke v0.1.1 daily driving (#43, #44)#46
olliegilbey merged 1 commit into
mainfrom
docs/path-leak-footgun

Conversation

@olliegilbey

@olliegilbey olliegilbey commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Refs #43, #44

The justfile asserted "Stable sessions never run this binary — they bake the versioned copy". The code does not enforce that: clave-bar shells out to bare clave (PATH-resolved) for snapshot/open/bind/focus/touch/prune-tabs/add. So a working-tree cargo install can drive a live stable fleet — which is exactly what broke daily driving after an otherwise-correct v0.1.1 release: a stale 0.1.0 binary served clave open, composed tab layouts pointing at the old wasm, and since zellij keys plugin identity on file location, each opened tab loaded a second bar. Two populations, no shared beacon state → duplicate sidebar, dead navigation.

Docs only; no code paths touched. just --list still parses. The structural fix is tracked on #44 (pass the absolute binary path into the plugin at config-generation time + a version-skew refusal), with a proposed KDL guardrail test asserting the generated config's plugin binary equals the versioned artifact.

https://claude.ai/code/session_019MM6DirpYLjscK1jUFbwkR

Summary by CodeRabbit

  • Documentation
    • Added guidance about preventing active stable sessions from using an incorrect development CLI version.
    • Documented safe installation practices, recovery steps, and log-based troubleshooting.
    • Updated setup and build-from-source notes with clearer warnings about PATH and version conflicts.

, #44)

The justfile asserted "Stable sessions never run this binary" — an
invariant the code does not enforce. clave-bar shells out to bare
`clave` (PATH-resolved) for snapshot/open/bind/focus/touch/prune-tabs,
so a working-tree `cargo install` hijacks a live fleet: a version-skewed
`clave open` composes tab layouts pointing at the wrong wasm, zellij
keys plugin identity on location, and the tab loads a SECOND bar with no
shared beacon state — duplicate sidebar, dead navigation. Hit in prod
today after an otherwise-correct v0.1.1 release.

CONTRIBUTING gains the mechanism, the hard rule until #44 lands, the
restore one-liner, and the one-grep diagnosis (every 'clave-bar: loaded'
line must report the same version). README notes it for source builders.
The dev-install recipe carries a DANGER block instead of the false claim.

Also tracks this session's status handoff (#22 ruling), including the
incident write-up.

Claude-Session: https://claude.ai/code/session_019MM6DirpYLjscK1jUFbwkR
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The changes add documentation about clave PATH shadowing during live stable sessions, including warnings, diagnosis, restoration guidance, and a reference to the absolute-path fix. README shortcut text is also reflowed.

Changes

PATH resolution guidance

Layer / File(s) Summary
PATH mismatch warnings and remediation
CONTRIBUTING.md, README.md, justfile
Contributor and build guidance describe PATH-based version skew, live-session warnings, diagnosis and restoration commands, and the absolute-path fix; README shortcut text is reflowed without changing behavior.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related issues

  • #44 — Documents the clave-bar PATH shell-out problem and references its absolute-path fix.
  • #43 — Documents the PATH-shadowing bug, its diagnosis, and remediation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the documentation update about the PATH leak and its v0.1.1 impact.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/path-leak-footgun

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@olliegilbey
olliegilbey merged commit 80348e2 into main Jul 22, 2026
4 of 5 checks passed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CONTRIBUTING.md`:
- Around line 76-82: Update the diagnosis command in the “Diagnosis is one grep”
section to use ${TMPDIR:-/tmp} when resolving the temporary directory, and
restrict the log search to the current Zellij session/log rather than globbing
across all historical zellij-* directories. Preserve the existing
version-filtering and tail behavior after selecting that session-specific log.
- Around line 67-74: The stable-binary restoration guidance must identify which
version to restore instead of using the literal vX.Y.Z placeholder. In
CONTRIBUTING.md lines 67-74, explain how to determine the active stable
session’s version and require substituting it in the cp command; mirror the same
actionable lookup and substitution guidance in justfile lines 37-43.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 07f41ca5-1b4f-4051-a270-af5d3a84c380

📥 Commits

Reviewing files that changed from the base of the PR and between ccd67fb and 4bffe8a.

⛔ Files ignored due to path filters (1)
  • docs/status/2026-07-22-1606-clave-orchestrator.md is excluded by !docs/status/**
📒 Files selected for processing (3)
  • CONTRIBUTING.md
  • README.md
  • justfile

Comment thread CONTRIBUTING.md
Comment on lines +67 to +74
**Until #44 lands, treat this as a hard rule: never `cargo install` or
`just dev-install` while a stable session is running** — including from a
worktree, and including agent-driven builds. When a dev round ends, restore the
stable binary before daily driving:

```sh
cp ~/.local/share/clave/bin/clave-vX.Y.Z ~/.cargo/bin/clave
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the stable-binary restoration command directly actionable.

Both locations present vX.Y.Z as though the command were exact, but users must know which version the active stable session uses. Require substitution with that version or provide a deterministic lookup command.

  • CONTRIBUTING.md#L67-L74: update the primary restoration instructions and clarify how to select the active stable binary.
  • justfile#L37-L43: mirror the same executable remediation guidance in the danger warning.
📍 Affects 2 files
  • CONTRIBUTING.md#L67-L74 (this comment)
  • justfile#L37-L43
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CONTRIBUTING.md` around lines 67 - 74, The stable-binary restoration guidance
must identify which version to restore instead of using the literal vX.Y.Z
placeholder. In CONTRIBUTING.md lines 67-74, explain how to determine the active
stable session’s version and require substituting it in the cp command; mirror
the same actionable lookup and substitution guidance in justfile lines 37-43.

Comment thread CONTRIBUTING.md
Comment on lines +76 to +82
**Diagnosis is one grep**, because the bar logs its version at every load
(zellij's log lives under the OS temp dir, e.g.
`$TMPDIR/zellij-$UID/zellij-log/zellij.log` on macOS):

```sh
grep 'clave-bar: loaded' "$TMPDIR"/zellij-*/zellij-log/zellij.log | tail
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the log diagnosis portable and session-specific.

If TMPDIR is unset, this expands to /zellij-*; the broad glob can also combine historical logs from multiple Zellij directories. Use a ${TMPDIR:-/tmp} fallback and target the current session/log before declaring versions mixed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CONTRIBUTING.md` around lines 76 - 82, Update the diagnosis command in the
“Diagnosis is one grep” section to use ${TMPDIR:-/tmp} when resolving the
temporary directory, and restrict the log search to the current Zellij
session/log rather than globbing across all historical zellij-* directories.
Preserve the existing version-filtering and tail behavior after selecting that
session-specific log.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4bffe8a383

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CONTRIBUTING.md
Comment on lines +55 to +56
`clave-bar` also shells out to the CLI on its own (`snapshot`, `open`, `bind`,
`focus`, `touch`, `prune-tabs`, `add`), and today it invokes plain **`clave`**,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include collapse in the PATH-leak command list

The plugin shellout inventory is inaccurate: clave-bar currently also invokes run_command(&["clave", "collapse", ...]) for Effect::PersistCollapse in crates/clave-bar/src/main.rs:205, while add is generated as the Alt+a keybind Run "{binary}" "add" in crates/clave/src/setup.rs:81 rather than a plugin-internal PATH lookup. If #44 is implemented from this runbook/list, the Alt+c collapse persistence path can remain PATH-resolved and still be served by a skewed ~/.cargo/bin/clave, leaving one of the documented production leaks unfixed.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant