Skip to content

docs(agents): let other tools own their conventions - #4435

Merged
max-sixty merged 2 commits into
mainfrom
nightly/clean-xdg-config-dirs-absolute
Oct 12, 2026
Merged

max-sixty merged 2 commits into
mainfrom
nightly/clean-xdg-config-dirs-absolute

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Adds Other Tools Own Their Conventions under Code Quality in AGENTS.md, and folds "Use Existing Dependencies"' closing sentence ("Let dependencies own their own rules") into it:

Where another tool owns a convention, such as its config location, file format, URL syntax, or error reporting, ask that tool or a library that implements its rules instead of encoding them in Worktrunk: nu reports its own directories, and gh auth token --hostname reports whether a host is authenticated. Worktrunk's role is the standard uses of those conventions. Where neither the tool nor a library answers, support the standard case and remove rather than refine: an input that only misbehaves outside standard use is a reason to stop reading it, and a tool that isn't installed has nothing to integrate with, so needs no fallback table.

#4169 is the case it comes from: filtering relative XDG_CONFIG_DIRS entries became, on review, no longer reading XDG_CONFIG_DIRS at all.

Code the rule implies removing, to be done in a follow-up rather than found piecemeal: nushell_data_dir_fallback in src/shell/paths.rs, which re-encodes Nushell's data-dir rule for when nu can't be queried, and the PowerShell ~/.config/powershell fallback for when pwsh can't answer.

This was written by Claude Code on behalf of max-sixty

Adds a Code Quality rule: where another tool owns a convention, ask the tool
or a library implementing its rules; where neither answers, support the
standard case and remove the input rather than refine its handling. A tool
that isn't installed needs no fallback table.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The closing clause, "a tool that isn't installed has nothing to integrate with, so needs no fallback table", conflicts with code that sits next to the nu example. nushell_data_dir_fallback in src/shell/paths.rs re-encodes Nushell's resolve_xdg_base rule for the case where nu can't be queried, and its docstring calls it "The one XDG read worktrunk still spells out". As written, the rule says to delete that function, so the next agent working in src/shell/paths.rs will either remove it or decide the rule doesn't apply. If the fallback should stay, the rule needs to say when a fallback is warranted. If it should go, that's a code change this rule implies, and it should be named so it isn't found piecemeal.

A smaller point: "Use Existing Dependencies", just above, already ends with "Let dependencies own their own rules." The new section covers the same idea for external tools. Folding the two together would leave one place to keep current.

Comment thread AGENTS.md Resolved
… token accurately

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 40cee1e into main Oct 12, 2026
38 checks passed
@max-sixty
max-sixty deleted the nightly/clean-xdg-config-dirs-absolute branch October 12, 2026 05:49
max-sixty added a commit that referenced this pull request Oct 12, 2026
Applies `AGENTS.md`'s **Other Tools Own Their Conventions** (#4435) to
what #4106 left: where worktrunk refined how it handles a case outside
standard use, stop handling the case.

**CI status: a failed forge call shows the error indicator.** The
classifier that searched `gh`/`glab`/`az`/`tea` output for English
phrases ("rate limit", "403", "connection", …) to choose between ⚠ and a
blank "no CI" cell is deleted. Any failed call now shows ⚠. Gitea reads
only whether the HTTP status is an error, not which one. The two lookups
by commit SHA (GitHub check runs, Gitea combined status) now run only
when some remote-tracking ref contains the head, since the forge answers
a commit it doesn't have with an error and ordinary unpushed work would
otherwise show ⚠. GitLab and Azure look pipelines up by branch and are
unchanged.

**PowerShell on Unix.** When `pwsh` can't be queried there is no
PowerShell profile, rather than a guessed `~/.config/powershell` one
(left by #4422).

**Nushell.** When `nu` can't be queried there are no autoload
candidates, rather than a reconstruction of Nushell's data-dir rule.
Install can't write into a legacy directory, since the candidate list is
empty.

Behavior changes:

- `gh`/`glab`/`az` installed but not logged in now shows ⚠ under `wt
list --full` instead of a blank cell. Detection checks that the tool is
installed, and `wt config show` reports that it isn't logged in. The ⚠
legend now names "not logged in".
- A Gitea 404 shows ⚠.
- `wt config shell install powershell` (or `nu`) without the tool fails
with "No shell config files found", and uninstall no longer finds a
wrapper left behind after `nu` was removed.

**Fish's completion path.** `Shell::completion_path` answered for every
shell, but only fish installs a completion file; its other arms,
including the Nushell one this change touched, were dead.
`shell::fish_completion_path` replaces it.

Tests: the retriable-classifier unit tests are gone, and the Gitea test
that only distinguished a blanked 500 body. Mocks now answer for
branches other than the one under test, since those would otherwise show
⚠. New tests: a failed `gh pr list` / `glab mr list` shows ⚠; an
unpushed head skips the GitHub and Gitea lookups by SHA, each with a
pushed control. Shell unit tests and the PowerShell integration tests no
longer depend on a real `nu` or `pwsh`; they pass with only
`/usr/bin:/bin` on `PATH`. Full integration and unit suites pass
locally.

Ref #4106.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
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.

2 participants