mirror of
https://github.com/max-sixty/worktrunk.git
synced 2026-11-24 03:55:51 +08:00
codex/vars-read-errors
16
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
13d4d5b4e2 |
docs: release 0.81 documentation review fixes (#4531)
Applies the documentation review of the 0.81.0 candidate (v0.80.0..15b1ed10c: CLI help, generated and authored site pages, skill and plugin copies). Each claim was checked against the code, and the behavioral ones against a build of this branch on scratch repos. Generated pages, skill mirrors, `list-v2.json` and help snapshots are regenerated from their sources. - `wt hook` "Interactive hooks": says which hooks inherit stdin (a command running alone in the foreground) and which get empty stdin (concurrent commands, background `post-*` hooks, prune's fanned-out hooks). The pass-values-as-arguments example moves to the end of "Template variables". - Extending: the hooks/aliases stdin row states the rule in the same words for both. - Shell integration: "Why shell integration exists" and "Checking status" state their content instead of only linking away. "Files created" again distinguishes appended lines (bash, zsh, PowerShell) from whole files (fish, Nushell), and notes that the PowerShell profiles are created if missing. - `wt step prune` min-age guard: says what the guard prevents, where a branch-only candidate's age comes from, and when a branch with no reflog looks new again. - `wt step squash` backup: covers everything staged (by hand or by `--stage`), not only changes staged beforehand. - `wt merge`: the long help defines the source before using it; `--branch` help says "defaults to the current branch". - `wt remove` JSON: `detached_worktree` is the detached worktree at the branch's expected location, which the removal leaves in place. - `wt switch`: shorter "Custom path" sentence; "Starting list-only" becomes "Hiding the preview". - `list-v2.json`: "probe" becomes "check", as in the list help. - Agent integration page: drops the incomplete Codex hooks sentence; OpenCode's `worktree.directory` "is ignored", and new branches start from the default branch. - Claude Code `WorktreeCreate` (site page and plugin README): the hook runs plain `wt switch` when the branch already exists, which returns its worktree. - Plugin README: the activity-tracking example no longer repeats the hook list above it. No finding was skipped. Three were adapted: the squash text names hand-staged changes as well as `--stage`; the `wt merge` text keeps the word "source", which later paragraphs use; the plugin README keeps the example's `wt list` sentence and drops only the repeated mechanism. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
ca0563dc8d |
feat(plugin): route OpenCode 2 worktrees through wt switch and wt remove (#4489)
Under OpenCode 2, the plugin that `wt config plugins opencode install` writes now registers a `worktrunk` worktree strategy. Worktrees that OpenCode creates and removes then go through `wt switch --create` and `wt remove`, the same way the Claude Code plugin's `WorktreeCreate`/`WorktreeRemove` hooks already route them. This was requested in #4488. I ran the strategy locally against a scratch repo with this branch's `wt` and a fake OpenCode context. I haven't run it inside a real OpenCode 2 session, which CI can't drive. How each callback maps ([`dev/opencode-plugin.ts`](https://github.com/max-sixty/worktrunk/blob/1c906f5599d7a16df832c56c51aa82d13c82bbd3/dev/opencode-plugin.ts)): - **create**: runs `wt switch [--create] <name> [--base <ref>] --no-cd --format=json` in the source checkout and returns `.path`. OpenCode's `branch` input is a [starting ref, not a branch name](https://github.com/anomalyco/opencode/blob/dev/packages/plugin/src/worktree.ts), so `<name>` is the basename of the directory OpenCode suggests (the name the user typed, or a generated slug). The path comes from `worktree-path`, since OpenCode accepts a different directory than the one it suggested. An existing branch is reopened, as in #4487. Passing a starting ref for an existing branch is refused rather than ignored. - **remove**: runs `wt remove --foreground [--force] <dir>`. It does nothing if the checkout is already gone. - **list**: reads `git worktree list --porcelain -z` and reports the first record as `root`. Bare and prunable entries are skipped. Things a maintainer may want to weigh: - **On by default.** OpenCode selects a strategy as soon as a plugin adds one. Every OpenCode 2 user with the plugin installed switches to worktrunk-managed worktrees, and OpenCode's `worktree.directory` setting stops applying. This matches the Claude Code plugin. The docs page says so. - **No force prompt on a dirty worktree.** OpenCode only offers to force when the error is an instance of its own `Worktree.OperationError` ([`operationError`](https://github.com/anomalyco/opencode/blob/dev/packages/core/src/worktree.ts) uses `instanceof`). A standalone plugin file can't import that class: the CLI's runtime shim for `@opencode/plugin` doesn't export `Worktree`. A dirty removal fails with worktrunk's own message instead (`Cannot remove worktree: … has uncommitted changes`), and nothing is deleted. - **Default base.** With no starting ref, the new branch starts from worktrunk's default (the default branch). OpenCode's `git` strategy uses the source checkout's HEAD instead. <details><summary>Local check</summary> A Node harness imported the plugin, called `setup` with a stub `ctx.worktree.transform`, and ran each callback against a fresh repo with `target/debug/wt` on PATH: - create → `ocrepo.brave-tiger` (the `worktree-path` default), and `list` returned root + that worktree - create with `branch: "brave-tiger"` → a second worktree based on it - create for an existing branch with a starting ref → refused. Without a ref → reopened the existing worktree - remove of a dirty worktree → wt's error. With `force` → removed. A repeat remove → no-op - final `list` → root only `test_docs_are_in_sync` and the 14 `opencode` integration tests pass. </details> Closes #4488 Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com> |
||
|
|
5b0930f09b | Add branch-addressed merge with --branch (#4360) | ||
|
|
64ead5388a |
docs(list): drop the stale-branch and dirty-tree skips from JSON help (#4359)
`wt list --help` (and the generated `list.md` pages, skill mirrors, and `list-v2.json` schema) explains `·`, JSON `null`, and `default_branch.integration` in ways the collector no longer matches. This corrects three claims. No behavior changes. - **"branch too stale" for `·` and `null`.** #2098 removed the stale-branch skip (`stale_branches`), and nothing in `src/commands/list/collect/` skips tasks by branch age now. The remaining sources of `null` are a timeout, a skipped probe (column plan or unborn branch), or a failed forge fetch. - **`integration` "null when a dirty tree skipped the checks".** Dirty trees don't skip the probes. They run on the committed HEAD either way, as `json_default_branch` says and `test_integration_positive_match_ignores_cleanliness` pins with a dirty `trees_match` result. A dirty integrated branch reports its reason, not `null`. - **"every reason renders as the same `⊂`".** `"same_commit"` renders as `_` (or `–` with uncommitted changes), per `IntegrationReason::SameCommit` and the Default-branch symbol table in the same help page. `⊂` also needs a clean tree. The same commit updates the `JsonDefaultBranch::integration` docstring, which generates the published schema description, and four internal comments in `collect/execution.rs` that still listed the stale-branch skip. No test is added because this changes only prose. Help snapshots and doc mirrors are regenerated, and `test_docs_are_in_sync` passes. --------- Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com> |
||
|
|
1d46bfca79 | skills(worktrunk): drop --no-hooks from the sub-Agent example (#4219) | ||
|
|
56a4bccd04 |
docs: join the lede's feature examples with & (#4213)
Follow-up to #4212: the lede's two examples read more tightly joined with `&`, which the feature list already uses ("Aliases & per-branch variables"). > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
6521a82188 |
docs: mention copy-on-write build caches in the lede (#4212)
The lede named hooks as its one example of the quality-of-life features. Cold, heavy checkouts are the other standard objection to worktrees, so it now also names the feature that answers it: `wt step copy-ignored` reflinking build caches into new worktrees. The edit is in `docs/src/content/docs/worktrunk.md` and the hand-written README lede; the skill mirrors and `llms.txt` are regenerated by the docs sync test. > _This was written by Claude Code on behalf of max-sixty_ Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
af9276d4d3 |
docs: name the file every config sample belongs in (#4173)
Every config sample on the site now names the file it belongs in. Expressive Code lifts a leading `# <path>` comment out of a code block and renders it as a file-name tab — a convention some blocks already used, now applied to all 56 TOML samples across `extending`, `hook`, `config`, `step`, `switch`, `list`, `llm-commits`, and `tips-patterns`, plus the `.envrc`, `mise.toml`, and `scripts/pre-start-setup.py` samples. The two that can't carry a comment, a `settings.json` and a `CLAUDE.md` fragment, use the `title=` fence attribute. Each assignment was checked rather than eyeballed: a script writes every titled block into the file it names and runs `wt config show`, failing on any unknown-field or "belongs in user config" warning. All 56 pass, and the check was confirmed non-vacuous against a misplaced `commit.generation.command` and a bogus section. The generated `# User Configuration` and `# Project Configuration` regions keep bare blocks. Those sections state their file once at the top, and every line in them is `# `-prefixed into `dev/config.example.toml`, where a path comment would double-comment and name the file it already is. ## Extending page prose "Deferring expansion to a nested `wt` command" becomes "Nesting templates", opening with the case — an alias passing a template to the `wt` command it calls — and showing both aliases in one block. Probing the old text against a scratch repo showed its `sh -c '…'` wrapper, described as a `for-each` catch, was never needed: quoting is what keeps the deferred template one shell token, and that is the same rule `wt switch --execute` follows. Four inbound links move to `#nesting-templates`. The `wt up` recipe's three closing paragraphs collapse to the one trap worth stating, `--no-autostash` overriding a global `rebase.autostash`. Naming a file on each sample made `[aliases]` visible under both config files, so the Aliases section now says it takes either. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|
|
a869299624 | feat(config)!: split the Pi and oh-my-pi plugin installers (#4135) | ||
|
|
f194d5a13c |
Age branches by reflog entry in wt step prune; fix four doc claims (#4077)
`wt step prune` could delete a branch created a minute earlier. Its
min-age guard ages a branch that has no worktree by its oldest reflog
entry — the help text and the function's docstring both say so — but the
code read `git reflog show --format=%ct`, which is the committer date of
the commit the entry points at. `git branch foo main` on a default
branch whose last commit is more than a day old therefore looked days
old, and the next `wt step prune` removed it.
From `test_prune_orphan_branch_min_age`, a branch made 30 minutes before
the run, pointing at a month-old commit, with the default
`--min-age=1d`:
```console
$ wt step prune --yes # before
✓ Removed branch orphan-integrated (same commit as main, _)
✓ Pruned 1 branch
$ wt step prune --yes # after
○ Skipped orphan-integrated (younger than 1d)
```
The age now comes from the entry's own timestamp: `git reflog show
--date=unix --format=%gd` renders each selector as `<name>@{<epoch>}`.
`test_prune_orphan_branch_min_age` couldn't tell the two apart, because
the test harness gives the commit and the branch creation the same date;
its commit is now a month older than the branch, and the old code fails
it.
A branch with no reflog at all still counts as old enough, as before.
That includes a branch created only from a bare repository's own
directory, since a bare repository defaults `core.logAllRefUpdates` to
false; the docstring now says so. A branch created from inside a linked
worktree has a reflog.
Found while reviewing #4000, along with four doc claims corrected in a
separate commit:
- The hook page said `{{ vars.thing | upper }}` previews as `{{
VARS.THING }}`; `wt hook show --expanded` prints `'{{ VARS.THING }}'`,
shell-quoted like any other value.
- The agent-integration table checked `/wt-switch-create` for Codex and
Gemini while its footnote said it does nothing there; the mark moves to
the row label.
- The skill's agent-handoff instruction, followed literally for
OpenCode, dropped `run`; it now points at the tips section's note on
where a subcommand goes.
- `take_global_options`' docstring counted 11 Global Options blocks on
`wt config`; there were 12.
Reviewable files: `src/commands/step/prune.rs`,
`tests/integration_tests/step_prune.rs`, `src/cli/mod.rs` (one
sentence), `docs/src/content/docs/claude-code.md`,
`skills/worktrunk/SKILL.md`, `src/help.rs`, `CHANGELOG.md`. The skill
and plugin mirrors and the agent-skills digest are regenerated.
> _This was written by Claude Code on behalf of max-sixty_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01HUmx2Jd5mTK5TznqGDmLGp
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
||
|
|
89326f14af |
Publish shell integration, add a footer, dedupe global options (#4000)
Guides and site presentation: one home per topic, a shell-integration
page, a footer, and three rendering fixes.
**Global options were emitted once per command reference**
clap repeats the same ~20-line `Global Options:` block in every
reference it renders, so a page assembled from subdocs stacked 11 copies
on `/config/` and 13 on `/step/`. That padded the pages and gave site
search that many near-identical hits — "squash" returned both
`#command-reference` and `#command-reference-2`. `take_global_options`
cuts each reference at the heading as it is built, keeping only the
first; one `kept` flag threads through the subdoc expansion and the page
streams out rather than accumulating. Terminal `--help` renders through
clap directly and is unchanged.
The config page also carried colliding anchors — two "Hooks" (`#hooks`,
`#hooks-1`), two "Aliases", and seven "Examples" (`#examples` …
`#examples-6`) — now qualified at their source in `src/cli/config.rs`:
User/Project hooks, User/Project aliases, and
Approval/Alias/State/Cache/Log/Variable examples.
`/step/` still has its own set (eight "Examples", two "Options", two
"Arguments", plus "Staging" and "Dry run" pairs). Qualifying those moves
existing `/step/#examples-N` anchors, so it wants a pass of its own with
the inbound links audited; the deduplication above already removes 13
Global Options blocks from that page.
**Shell integration has a page**
Shell-integration debugging was skill-only: five named warning messages,
a PowerShell checklist, and the wrapper mechanism, with no site page —
while the FAQ's answer to "`wt switch` didn't cd" was to install the
Claude Code plugin. It is now `/shell-integration/`, offered first, with
the plugin as the second route. The `llms.txt` listing serves every page
as `/<slug>.md` from a hand-created symlink, so a new page was a 404 the
listing still advertised; the symlink is added and the sync now fails
when a listed page has none.
**Presentation**
- A site footer carries the version (read from `Cargo.toml` at build
time), releases, changelog and license. No page named any of them, and
`/code-signing/` was reachable only from inside a collapsed block on the
homepage. Starlight's `Footer` is wrapped rather than replaced.
- `wt list --full` renders 1157px inside an 800px content column, so 40%
of it sat behind a horizontal scrollbar with the pane beside the column
empty. A terminal frame now takes the whole pane where there is slack,
measured with a query container rather than recomputed from Starlight's
layout formula.
- The `wt-command-reference` frames offered a copy button for 3,877
characters of generated help text; they now expose no copy control. A
console block listing several commands is as often a menu of
alternatives as a recipe, and nothing in the markup tells them apart, so
every command line in such a block carries its own copy control
alongside the block's.
- The four command demos and the two hand-written figures get captions;
the 2.33 MB homepage GIF below the fold loads lazily.
**Sidebar order is pinned**
`site-navigation.mjs` told readers a
`test_sidebar_matches_frontmatter_order` would fail when the authored
sidebar and the pages' `sidebar.order` disagreed. No such test existed,
and the disagreement it describes is exactly what the survey found:
`remove` listed before `merge`, Agent integration ahead of
lower-numbered pages. The test is written, so the sidebar and the
`llms.txt` ordering derived from the frontmatter can't drift apart
again.
<details>
<summary>Guide corrections</summary>
- Tips & patterns was 26 flat H2 recipes in no order, all 26 in the
sidebar. They group under five H2s — setup and layout, aliases and
hooks, per-worktree services, working with agents, status/commits/logs —
with each recipe demoted to H3. Anchors are level-independent, so
existing `/tips-patterns/#…` fragments still resolve.
- `-x 'opencode run'` has been broken since 0.75.0 made `-x` a literal
program: it is `-x opencode -- run '<task>'`.
- The branch-summary preview moved from tab 5 to 6 when the unified-diff
tab landed; the recipe names the `summary` tab instead of a number.
- The Caddy recipe claimed `feature-auth` hashes to port 16460 — that is
`fix-auth`'s port. It is 18283.
- `_` in `wt list` is same-commit *and clean*; the
same-commit-with-changes glyph is `–`, which is not safe to delete.
- `wt step prune` removes branches with no worktree too, and the min-age
guard ages a worktree by its creation time and a bare branch by its
oldest reflog entry.
- `wt step eval -v` prints fifteen variables; the example showed two
under a lead calling them "the available template variables".
- A filter applied to `{{ vars.<key> }}` acts on the placeholder the
preview substitutes, so `{{ vars.port | default('8080') }}` previews as
`{{ vars.port }}`, filter gone.
- The `.git/wt/cache/` table was missing `picker-preview`, and `wt
config state clear` prompts unless `--yes`.
- `skills/worktrunk/reference/README.md` was a symlink to the repo
README that `SKILL.md` never referenced, and the plugin mirror
dereferenced it into a 262-line copy carrying the star-history token,
share links, and a logo path resolving nowhere. Nothing generated it, so
deleting the symlink is the whole fix.
- One home per topic: agent handoffs stay in tips-patterns, activity
markers in `claude-code.md`, alias-template deferral in `extending.md`,
and the `codename` filter's two `worktree-path` recipes give way to the
config page that owns path templates. The FAQ's "Running tests" and "How
can I contribute?" duplicated the README's Contributing block down to
the share URLs.
- The FAQ linked `/worktrunk/#install`, the `noindex` compatibility
route; the plugin hook shim's Windows Terminal hint pointed there too.
Both use `/#install`, where the new sidebar Install entry goes.
- Example names settle on `myproject` / `feature-auth`; "sibling to main
repo" becomes "sibling to the main worktree", and `wt remove`'s "target
worktree" becomes "the worktree being removed" per the project's own
terminology rule.
</details>
UX survey items: `#36`, `#37`, `#38`, `#39`, `#45`, `#47`, `#48`, `#49`,
`#50`, `#51`, `#52`, `#61`, `#94`, `#95`, `#96`, `#97`, `#99`, `#100`.
Reviewable files: the hand-written pages under `docs/src/content/docs/`
(notably the new `shell-integration.md`, `tips-patterns.md`, `faq.md`),
`docs/src/components/Footer.astro`,
`docs/src/plugins/worktrunk-terminal.mjs`,
`docs/src/site-navigation.mjs`, `docs/tests/*.mjs`, `src/help.rs`,
`plugins/worktrunk/hooks/wt.sh`. Generated mirrors and snapshots are
regenerated.
> _This was written by Claude Code on behalf of max-sixty_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01XAUYWFN9d9oh6jyoQiouHb
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
|
||
|
|
981a207e26 |
Fix wt list column sizing, alignment, and headers (#3998)
Seven fixes to `wt list` — three to how the table lays out, one to what
detached and prunable worktrees show, and three to the page that
documents it.
**The table**
A single 58-character branch name sized the Branch column for every row:
at 60 columns the table degenerated into a branch list with nine columns
hidden, and at 200 it still lost Message. Branch now sizes to
`min(longest, 32)` and elides with `…`, the way Message already does.
`--format=json` still carries the whole name.
`Remote⇅` in a repo with no remote held its blank seven columns open
while Message, Commit, Age and Path — each with something to say on
every row — were dropped for want of them. The empty-column penalty now
exceeds every base priority, and the allocation loop stops admitting
empty columns once a populated one has failed to fit. `Remote⇅` also
learns it is empty before any task reports: a repo with no remote has no
branch that can track one, read O(1) off the bulk config map.
Alignment now follows the value type consistently: text and reference
columns align left; the scalar `Age` column and its header align right;
split diff fields use two right-aligned halves with centered headers and
centered whole-field states such as loading or in-sync markers. Rows no
longer carry trailing padding, and the hidden-column footer wraps at the
terminal width. The progressive renderer documents and asserts the
corresponding terminal invariant: ordinary rows and the loading footer
occupy one physical row, while only the final summary may wrap.
The familiar `main↕` and `main…±` labels remain fixed across
repositories. This avoids adding default-branch-name plumbing or a `^`
fallback without changing the meaning of either column.
**Detached and prunable rows**
A detached worktree rendered as a bare hash under Branch, wearing `⚑` on
loan from `branch_worktree_mismatch` — which it was only flagged with
because a worktree with no branch has no branch-implied path to sit at.
It gets `⊘`, and stops claiming to be off-template, so `⚑` again means
only what it says. A prunable worktree showed four `·` loading glyphs
that never resolved: its directory is gone, so no task is ever spawned
for it and no cell is coming. Those cells render blank, leaving `⊟` in
Status as the row's whole story.
**The page**
<details>
<summary>Documentation corrections</summary>
- The summary footer counted hidden columns ("3 columns hidden") without
saying which, and the page never explained that the table drops columns
to fit. The footer now names them ("hidden: Path, Commit, Message"), and
a paragraph under `## Columns` covers the drop order, `[list] columns`,
and that `--format=json` shows everything.
- The JSON section documented deprecated schema 1 at 159 lines and nine
sub-tables while schema 2 — what a future release makes the default —
got 88 lines and one table. Schema 2 now carries the full reference
(envelope, item fields, a sub-table per object, the three value
vocabularies) and the worked `jq` recipes. Schema 1 keeps a paragraph,
the deprecation pointer, and a schema-1 → schema-2 mapping table
covering every field it documented.
- The CI-cache line pointed at `wt config state`, a group with no
default action; it names `wt config state cache`.
- `wt list statusline --format=json` was documented as "a one-entry
array in the `wt list --format=json` schema", which holds only under
schema 1. It emits the current schema — an array under 1, the envelope
under 2 — and the line now records why that surface stays silent about
an unset `[list] json-schema` while plain `wt list` nags: a prompt
consumer can't act on a warning drawn over its own line.
- The Status-symbols section documented every subcolumn except the
branch marker. Both JSON schemas gain an additive `marker` field, so the
value is readable without parsing it back out of `symbols`.
</details>
UX survey items: `#24`, `#34`, `#58`, `#89`, `#90`, `#92`, `#93`.
Reviewable files: `src/commands/list/**` (`layout.rs`, `columns.rs`,
`render.rs`, `progressive_table.rs`, `model/item.rs`, `mod.rs`,
`json_v2.rs`), the list section of `src/cli/mod.rs`,
`src/styling/line.rs`, and
`.claude/skills/writing-user-outputs/SKILL.md`. Generated mirrors and
snapshots are regenerated.
Original analysis:
https://claude.ai/code/session_01XAUYWFN9d9oh6jyoQiouHb
> _This was written by Codex on behalf of max-sixty_
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
|
||
|
|
7d08f6775f |
Add Pi activity tracking plugin (#3594)
## Summary - add `wt config plugins pi install|uninstall` - install a profile-aware Pi / oh-my-pi hook with atomic writes - map Pi lifecycle events to Worktrunk working, waiting, and cleared activity markers - honor Pi's agent-directory, config-directory, and profile environment variables - cover profile paths, explicit directory overrides, uninstall behavior, and CLI output snapshots ## Validation - `cargo fmt --check` — passed - `cargo test --test integration test_pi_ -- --nocapture` — 3 passed - the same snapshot tests passed again without `INSTA_UPDATE` - `cargo clippy --bin wt -- -D warnings` — passed Closes #3571 --------- Signed-off-by: Aditya Datta <crazyme07071996@gmail.com> |
||
|
|
a0cea6072d |
docs(skill): say which worktree a command acts on (#3890)
## Problem `wt` finds the repository from the working directory and the worktree from the command's own arguments, but the `worktrunk` skill never says so — so agents treat the global `-C <path>` as the worktree selector and layer it on top of a branch argument that already names the target. #3889 measured 144 same-repo `wt -C` calls across 87 transcripts, most of them redundant. ## Solution Three changes, matching the fix the issue proposes: - **New "Which worktree a command acts on" section** in `skills/worktrunk/SKILL.md`, placed before the config material so it reads early. Two rules: a command that names a branch already names its worktree, and `-C` moves the working directory (a different repository, a command with no branch argument, or a caller pinned outside a repo) rather than the worktree selection. Two ✓/✗ pairs from the issue make it concrete. - **Skill `description:` extended** so it fires while an agent is composing a command — "working out which worktree a `wt` command will act on, or reaching for the global `-C <path>` to target one" — not only when editing config or debugging hooks. - **`claude-code.md` sentence scoped.** The `-C` endorsement is now explicitly about the marker commands, which "take no worktree argument of their own", with a closing clause pointing at the general case. Verified against the CLI rather than assumed: | Command | Worktree selector | `-C` warranted? | |---|---|---| | `wt switch [BRANCH]`, `wt remove [BRANCHES]...` | branch argument | no | | `wt step diff --branch`, `wt step commit --branch` | `--branch` | no | | `wt config state marker set --branch` | `--branch`, but cwd must be in the repo | yes, when the host pins cwd outside | | `wt merge`, `wt step rebase\|squash\|push` | none — `[TARGET]` is the merge target | yes | Also confirms the issue's second example: `wt switch --create`'s `--base` already defaults to the default branch, so `-C /path/to/repo` "so it bases off main" changes nothing. ## Not included The issue's second suggestion — a paragraph on the `-C` doc comment in `src/cli/mod.rs` — is left out deliberately, as the issue itself flags it as "worth weighing separately": it regenerates the Global Options block on every command page and a large number of `test_help` snapshots. Happy to follow up if you want it. ## Testing `cargo test --test integration test_docs_are_in_sync` regenerated the four mirrors (`skills/worktrunk/reference/claude-code.md`, both plugin-skill copies, and the `.well-known` digest + description) and passes on a second run. `cargo test --test integration readme_sync` (16 tests) and `test_plugin_layout_is_consolidated` are green. The root-relative `/switch/` and `/remove/` links expand to `https://worktrunk.dev/...` in the skill copy as expected. --- Closes #3889 — automated triage --------- Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com> |
||
|
|
7e5d5ded19 |
fix(list): ignore untracked files in conflict probes (#3906)
Fixes #3883. This replaces #3884. Thanks @srobroek for the report, reproduction, and original fix; the commit retains co-author credit. ## Problem `wt list` and `wt list statusline` synthesize trees for their advisory conflict checks. Git writes the blobs, trees, and commits used by those checks into the real object database even though nothing references them. A changing large untracked artifact can therefore add another full copy on every invocation. Redirecting all probe objects solves the growth, but including untracked content still spends time hashing and compressing artifacts that are outside the useful scope of a best-effort conflict estimate. ## Approach - Treat untracked porcelain entries as status-only. They remain visible as `?` changes but do not enter the synthetic conflict tree. - Preserve staged-only tracked changes with `write-tree` against a copied index. When unstaged tracked changes must be included, run pathspec-free `git add -u --sparse` against the copy before Git's existing `merge-tree` simulation. - Fall back to the committed-HEAD conflict probe for clean and untracked-only worktrees, so an untracked artifact cannot suppress a committed conflict. - Redirect every object-producing `list` and `statusline` probe to one invocation-scoped temporary object database. Temporary probe storage prefers the system temp directory and falls back to Git metadata: the common directory for objects and the worktree's Git directory for indexes. If neither location is writable, the command fails instead of writing probe objects into the real database. - Keep the effective real object database and inherited alternates readable through Git's C-style quoted `GIT_ALTERNATE_OBJECT_DIRECTORIES` format. - Hide the exact Worktrunk-owned temporary directory from status and preview tasks when `TMPDIR` is inside a worktree, and unregister it when the final redirected clone drops. The temporary store has no persistent cache, reuse, pruning, or lifecycle policy. The estimate deliberately ignores the case where the target adds a path currently occupied by an untracked file. The real merge still retains Git's overwrite protection and refuses to destroy that file. ## Validation - Current-head focused matrix: 14 passed, covering tracked conflicts, staged deletion of every file, sparse and missing indexes, untracked fallback, both list entry points, invalid `TMPDIR` fallback, read-only stores, relative and absolute inherited object directories, unusual paths, temporary-directory lifetime, and object neutrality. - Documentation sync and formatting pass on the current head; the earlier full pre-merge run also passed help snapshots, doctests, rustdoc, and repository checks. - On the real CLI repro, three changing 1 MiB untracked states grew `main` from 3 loose objects / 12 KiB to 12 objects / 3.05 MiB. This branch remained at 3 objects / 12 KiB. The local pre-merge wrapper still reports the unchanged Rust 1.98 `chunks_exact_to_as_chunks` Clippy lint in `src/git/repository/diff.rs`; the project toolchain contract and CI use Rust 1.97. > _This was written by Codex on behalf of @max-sixty_ --------- Co-authored-by: Sjors Robroek <s.robroek@vxsan.com> |
||
|
|
8e405bced9 |
docs: rebuild the site with Astro and Starlight (#3866)
The docs now build with Astro and Starlight instead of Zola. This removes the Tera 2 migration blocker from #3827 while keeping the published routes, anchors, generated references, metadata, and crawler URLs stable. It replaces the approach closed in #3840. ## What changed - Move the site into Starlight, with a custom Worktrunk homepage and a shared copper, gold, paper, and ink design system. - Keep generated docs as portable Markdown. The Rust sync pipeline no longer needs Zola shortcodes, template escaping, ANSI-to-HTML conversion, or reverse transforms for skill and README output. - Preserve terminal semantics and command-only copying, add responsive handling for short wide tables, retain stable heading IDs, and give repeated command-reference headings useful search labels. - Move docs CI and publishing to Node, Astro, and built-site contract tests. The tests cover public routes, links, assets, metadata, navigation, tables, terminal frames, and compatibility aliases. - Record demo themes from isolated environments, add a mobile core demo, and test the recording contract. The matching mobile assets are published in `max-sixty/worktrunk-assets`. Closes #3827. ## Verification - `cargo run -- hook pre-merge --yes` (4,660 tests) - `npm --prefix docs run check` - `npm --prefix docs test` (9 tests) - `npm --prefix docs run build` (16 pages) - `npm --prefix docs run test:site` (12 tests) - `pytest docs/demos/tests/test_recording.py` (4 tests) > _This was written by Codex on behalf of max-sixty_ |