8000 Protect uncommitted work, keep lanes' Warp files apart, and confirm template changes by anvk · Pull Request #6 · anvk/lanes · GitHub
[go: up one dir, main page]

Skip to content

Protect uncommitted work, keep lanes' Warp files apart, and confirm template changes - #6

Merged
anvk merged 1 commit into
mainfrom
lane-safety
Oct 20, 2026
Merged

anvk merged 1 commit into
mainfrom
lane-safety

Conversation

@anvk
@anvk anvk commented Oct 20, 2026
Copy link
Copy Markdown
Owner

Summary

  • purge keeps lanes with uncommitted work (listed) unless --force; remove lists the files it would discard before asking.
  • Lane age comes from git (worktree creation, newest commit, files git reports changed). The old walk followed symlinks (a loop failed with ELOOP) and fell back to the folder's creation time on any error, which made live lanes look old to purge.
  • Warp files are named lanes~<key>~<n>-<title>. Before: removing lane 1 deleted lane 1-fix's tab file, and prune read live lane 7's "Step-2-Debug" tab as a leftover. Old lanes-* files are cleared by prune and rewritten on next open.
  • Stable keys: always <base>-<lane>, so adding a base no longer renames every lane's files.
  • commands update shows each added/removed line and new plugin sources, and applies only after you confirm (or --yes). Installing a plugin a template names now defaults to no.

Testing

  • 46 CLI + 5 Warp tests pass, including a symlink loop, a fresh lane from an old commit, uncommitted/renamed/new files, both Warp collisions, and stable keys
  • End to end: purge kept the lane with an uncommitted edit and removed the other; remove named the file it would discard; a template that gained a curl … | sh line was shown and not applied until --yes
  • Not tested against a running Warp: the new file names go into warp:// links unchanged (~ is not URL-encoded), but please open a lane once to confirm

🤖 Generated with Claude Code

…emplate changes

- purge keeps every lane that holds uncommitted work (and lists it)
  unless --force; remove lists the files it would discard before asking
- lane age comes from git (creation, newest commit, files git reports
  changed) instead of a walk of every file that followed symlinks and
  fell back to the folder's creation time on any error, which made live
  lanes look old to purge
- Warp files are named lanes~<key>~<n>-<title>: removing lane 1 no
  longer deletes lane 1-fix's tabs, and prune no longer reads a live
  lane's tab titled "Step-2-Debug" as a leftover. Files in the old
  lanes-* naming are cleared by prune and rewritten on next open
- a lane's key is always <base>-<lane>, so adding a base no longer
  renames every lane's files
- commands update shows each added and removed line and new plugin
  sources, and applies them only after you confirm (or --yes); installing
  a plugin a template names defaults to no

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anvk
anvk merged commit 52f2f8b into main Oct 20, 2026
@anvk
anvk deleted the lane-safety branch October 20, 2026 15:34
anvk added a commit that referenced this pull request Oct 20, 2026
…agent-specific code (#7)

Stacked on #6; merge that first.

## Summary
- **Placeholders** are quoted to fit their place: bare, inside `"…"` or
inside `'…'`. `echo "{path}"` used to print literal quote characters for
a folder with spaces.
- **Base update:** creating a lane fetches only the branch the base's
`ref` names (not all of origin), and moves the base with `git merge
--ff-only` instead of `git rebase --autostash`. With `--force` and local
commits, the base is left as it is.
- **Layering:** `core/lifecycle.ts` no longer asks questions; the setup
prompt and typed confirmations moved to `cli/flows.ts`.
- **No agent special-casing:** the Warp plugin no longer reads
`~/.claude` to drop `--continue`. The default template uses `claude
--continue || claude`.
- **npm ci** in the installer, self-update, and plugin installs that
have a lockfile, so an install never rewrites a lockfile and blocks
later updates. New test: each `package.json` matches its lockfile.

## Testing
- 50 CLI + 5 Warp tests pass, including placeholders run through a real
`sh` with spaces, quotes and `$` in the path
- End to end: a teammate's commit on `origin/main` was fetched, the base
fast-forwarded to it, and the new lane opened at it
- A fresh clone installs with `npm ci`, builds, and stays clean

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
anvk added a commit that referenced this pull request Oct 20, 2026
…ormats (#8)

Stacked on #7 (which is stacked on #6); merge those first.

## Summary
**Utils**
- `core/paths.ts`: `~/.lanes`, the plugin folder and record, the default
install dir, and `~` expansion (which no longer turns `~other/x` into a
folder in your own home). Used by update, plugins and template loading.
- `lanesInWorkspace()` replaces three copies of "every lane folder with
its path and base".
- The `init` wizard's line editor moved into `ui/tui.ts` with the rest
of the raw-mode code.

**Removed**
- Conversions for config formats lanes never had (`warpTabs`,
`warpTabsSource`, `warpTabGroup`, `setupCommand`/`teardownCommand` tabs,
`baseFolder`), about 100 lines, and with them the core config's
knowledge of the Warp plugin's source.
- The `tabs` alias for `lanes commands`.
- `commandSucceeds` (unused) and needless exports.

## Testing
- 47 CLI tests pass (the removed formats' tests went with them; document
parsing now checks that stray `warpTabs` keys are ignored)
- End to end: `lanes init` with Esc goes back one question;
open/list/remove work, with the stable key `app-1` and `"{path}"` intact

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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

0