Skip to content

Add repo guidance: delegate other tools' rules, and don't defend improbable environments - #4137

Merged
max-sixty merged 4 commits into
mainfrom
daily/review-runs-35070490294
Sep 16, 2026
Merged

max-sixty merged 4 commits into
mainfrom
daily/review-runs-35070490294

Conversation

@worktrunk-bot

@worktrunk-bot worktrunk-bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Four times in the last 24 hours, max-sixty asked a bot PR for less code, and
each time the ask was the same one in a different costume: stop encoding
another tool's rules in wt, and stop defending environments that are already
broken. Nothing in CLAUDE.md said either, so each PR re-learned it in review.
The first extends Code Quality → Use Existing Dependencies, which already
tells you to reach for a dependency before hand-rolling a utility; the second
gets its own heading beside it, since defending an environment has nothing to
do with dependencies.

Both cases the delegation rule came from resolved into its exception rather
than out of it — #4085 established that zsh has no "where should the config
file go" to ask, and #4124 that MiniJinja exposes no binding list without
unstable_machinery. The guidance names neither: cited as examples, they read
as debt still to pay off, and the zsh decision already lives in
zsh_config_dir's docstring, which is where the rule says that reasoning
belongs.

The generalisation is the maintainer's, not an inference from the diffs —
on #4085: "can we try to remove as much as possible from our code that
attempts to interpret the internals of other libraries?"
, prefaced with
"we hit this on some of the sibling issues". #4106 is the standing backlog
that same instinct produced.

Second half, the anxiety one. On #4104: "this is totally fine; we're an
order of magnitude too anxious here. if someone doesn't have a resolvable home
dir, then honoring the xdg config in worktrunk is the least of their
problems"
— the wording here is close to his deliberately. The earlier
instance is #4107, where a bot self-review invented a scan of a stranded fish
config directory and he cut it: "if someone moves the config dir, then we'll
miss the uninstall, that's fine"
. The Data Safety carve-out is explicit
because that section rules the opposite way on purpose, and this paragraph
must not be read as licensing a silent loss.

Why now rather than at the next instance. The behaviour is stochastic, so
it carries a 5-occurrence floor; the window took it to six (#4085, #4104,
#4123, #4124 here, plus #4104's nu-config round and #4107 recorded on
2026-09-15 in #3980). The bot also has seven PRs open, over the self-initiated
budget — this one is filed anyway because the cost class is a wrong outward
action, not compute: #4124 shipped a hand-rolled MiniJinja binding scanner
whose correctness gap the maintainer had to find himself.

The four corrections, and what each one cost
PR Correction Outcome
#4085 "can we just ask zsh for whether the config file should go?" Bot showed the zsh -f -c probe relocates the rule rather than removing it, deleted the zsh-source docstring, and gave zsh_config_dir the absolute-only guard the module already applied to $XDG_DATA_HOME. The rule itself stays in wt. Merged.
#4104 "we're an order of magnitude too anxious here" Taken as a precondition in c4089e3c; read_tea_config's two home-directory resolutions collapsed into one candidate list. Merged.
#4123 "can't we just delegate all toml parsing to serde?" Bot tested serde_ignored in a scratch crate and reported where #[serde(flatten)] blinds it, rather than answering from reasoning. Open.
#4124 "the new binding scanner still misses parenthesized tuple targets that MiniJinja 2.24 accepts" Fixed in 5fe64767 across for/set/with; deriving bindings from MiniJinja's parse needs unstable_machinery. Open.

Only the last is a correctness defect — the other three are complexity the
maintainer declined to carry. The bot absorbed all four within hours, so the
gap is not in how it responds but in it not knowing beforehand.

Evidence for this run is appended to the review-runs-tracking issue
#3980; the prior two
occurrences are under Run 34943713746.

CLAUDE.md is hand-edited, not generated, so no mirror regenerates from it and
test_docs_are_in_sync is unaffected.

@worktrunk-bot worktrunk-bot added the review-runs Findings from the daily review-runs workflow label Sep 16, 2026

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Both PRs the delegation paragraph cites as failures to ask the library are cases where delegation was evaluated and deliberately declined, so as written the rule points a future agent at two sites the maintainer already settled. Reframe and a placement/wording fix for the second paragraph are inline.

No verdict — self-authored, so this is a self-review rather than an approval.

Comment thread CLAUDE.md Resolved
Comment thread CLAUDE.md Resolved
The delegation rule cited #4085 and #4124 as failures to ask the library, but
both evaluated delegation and kept the re-derived rule: zsh has no "where
should the config file go" to ask, and MiniJinja exposes no binding list
without unstable_machinery. As written an agent would read zsh_config_dir's
absolute-only guard - which keeps the whole-file uninstall rewrite out of the
invocation directory - as outstanding debt.

Also gives "don't defend improbable environments" its own heading, since it
has nothing to do with using existing dependencies, and pins that dropping a
fallback still means returning an error rather than .expect().

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The zsh half of the delegation paragraph restates what zsh_config_dir's docstring in src/shell/paths.rs already carries: that a non-absolute $ZDOTDIR resolves against wt's invocation directory rather than zsh's startup directory, and that honouring one would send install — and the whole-file rewrite wt config shell uninstall performs — to a .zshrc neither side meant. That leaves two copies of one rationale, and the paragraph's own rule names the code as where the explanation belongs, so the CLAUDE.md copy is the one that drifts if the guard ever changes.

Pushing a trim that keeps the site named and the decision marked settled, but defers the reasoning to the docstring. What the clause exists to prevent — an agent reading zsh_config_dir as debt to delegate away and dropping the guard with it — still holds, since the docstring it now points at is where the full argument lives.

No verdict: self-authored, so this is a self-review rather than an approval.

The delegation paragraph restated what zsh_config_dir's docstring in
src/shell/paths.rs already explains about the absolute-only guard. Name
the site and mark it settled; let the docstring carry the argument.
Guidance states the rule; the PRs that produced it belong in the PR
body, and the settled zsh decision already lives in zsh_config_dir's
docstring.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
max-sixty added a commit to max-sixty/tend that referenced this pull request Sep 16, 2026
…nly skill PRs (#1262)

worktrunk-bot's `review-runs` wrote PR citations into worktrunk's
`CLAUDE.md` in max-sixty/worktrunk#4137, and two
self-review rounds then suggested more case history. A rule against that
already exists, "state the rule, not the incident". It lived only in
step 3 of the skill-PR mechanics in `skill-pr-workflow.md`, and the
References row reached that file only when a maintainer's correction
should become guidance.

None of the three sessions read the rule before writing. `review-runs`
edited `CLAUDE.md`, and its only pointer to the file is for the
`.claude/skills/` read-only-mount workaround. Both self-reviews opened
the file after posting their suggestions, to follow its `$TMPDIR` commit
recipe.

The rule is now its own section, "What the text carries". It covers
skills, overlays, and project instruction files, for text committed or
suggested in a review, and adds that a decision settled for one site
belongs in a comment at that site. The References row now also fires
before writing or suggesting that text.

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

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit c20f920 into main Sep 16, 2026
37 checks passed
@max-sixty
max-sixty deleted the daily/review-runs-35070490294 branch September 16, 2026 18:33
max-sixty added a commit that referenced this pull request Sep 16, 2026
Brings in #4141 (template variables migrate through MiniJinja's parser),
#4140 (refuse to write a config rewrite that is not valid TOML), #4145
(report ignored project-config keys from every worktree), #4139, #4137.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-runs Findings from the daily review-runs workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants