Skip to content

fix(agy): trust the worktrees root, not a glob agy does not read - #2536

Merged
mlorentedev merged 2 commits into
mainfrom
fix/agy-trust-worktrees-root
Oct 15, 2026
Merged

mlorentedev merged 2 commits into
mainfrom
fix/agy-trust-worktrees-root

Conversation

@mlorentedev

@mlorentedev mlorentedev commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Fixes #2533: agy asked "Do you trust the contents of this project?" in every fresh herdr worktree, because it does not read trustedWorkspaces: worktrees/*/* as a glob.

Summary

  • ai/agy/settings.json trusts the plain directory {HOME}/Projects/worktrees instead of the pattern {HOME}/Projects/worktrees/*/*. Merge-union means a machine keeps its old pattern entry; it is inert.
  • tests/herdr-config.bats now asserts the root for agy (and keeps the pattern for Copilot), and tests/antigravity.bats pins the new list.

Measured (2026-10-14, macOS, agy 1.3.5)

A fresh directory ~/Projects/worktrees/dotfiles/<x> with the old list: agy stopped at the trust dialog (also outside git, so not a lane effect). After dotf deploy agy-settings with the plain directory added: no dialog. Copilot, with its current list, showed no dialog in the same kind of directory. Reverting the template to the glob fails the herdr-config bats test.

Owner lands this one

It widens which folders an agent trusts without asking (#2178): everything beneath ~/Projects/worktrees, the same scope #2504 intended and the owner approved. Prepared, not merged by the agent.

SDD skip rationale

Two-line config change plus its guards, cause measured; under the 20-line bug-fix bar.

Knowledge

agy 1.3.5 asked for trust in every fresh herdr worktree although
trustedWorkspaces listed <root>/*/*. A plain directory entry is trusted with
everything beneath it (measured), so agy is given the root; Copilot keeps its
pattern. The herdr-config guard asserts each harness's measured form.
@mlorentedev mlorentedev added the skip-sdd SDD spec-gate escape hatch (requires '## SDD skip rationale' in PR body) label Oct 15, 2026
@mlorentedev
mlorentedev marked this pull request as ready for review October 15, 2026 04:49
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: mlorentedev/dotfiles/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0f8f780c-8ac0-4316-aac9-c3dd3d68372f
📥 Commits

Reviewing files that changed from the base of the PR and between 5b9116e and 3477262.

📒 Files selected for processing: 4
  • ai/agy/settings.json
  • ai/herdr/config.toml
  • tests/antigravity.bats
  • tests/herdr-config.bats
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

2533 - Partially compliant

Compliant requirements:

  • tests/herdr-config.bats now asserts the plain root ${want%/*/*} for agy instead of the */* pattern.
  • The template ai/agy/settings.json carries the plain directory {HOME}/Projects/worktrees.
  • The chosen form (plain directory) is stated as measured on 2026-10-14 with agy 1.3.5 in the PR body.

Non-compliant requirements:

  • (none)

Requires further human verification:

  • The measurement itself (agy 1.3.5 starting without a trust dialog under ~/Projects/worktrees/<repo>/<slug>) cannot be reproduced from the diff; it must be re-run interactively.
  • Whether agy's deployed (merge-union) settings on an existing machine actually receive the new root entry.
  • Copilot's trustedFolders glob behavior in a fresh worktree is claimed measured but its form is unchanged here.

2178 - Partially compliant

Compliant requirements:

  • (none)

Non-compliant requirements:

Requires further human verification:

  • The owner's (a)/(b) decision and the memory-file reconciliation are outside this diff and need human action.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Harness compliance
Definition of Done, item 5 (Evidence): the PR's completion claims — the 2026-10-14 no-dialog measurements and "Reverting the template to the glob fails the herdr-config bats test" — are narrative assertions with no command output pasted into the PR body, and there is no dotf pr triage-queue result either. The rule requires the proving output produced in session; as submitted, the measurement is indistinguishable from a claim, so a reader cannot verify the finding the whole change rests on. Artifact: PR description (start_line/end_line 0).

Possible Issue
THEORETICAL: agy_want="${want%/\*/\*}" silently degrades into a vacuous-looking-but-loudly-failing assertion if the sed extraction ever changes shape. Concretely, if the [worktrees] directory line in ai/herdr/config.toml were reformatted so sed's anchored ^directory\s*=\s*"~..."\s*$ no longer matches, line 47 already fails first; but if a future edit makes sed emit a path whose last segment is not followed by /*/* in the replacement, ${want%/\*/\*} is a no-op, agy_want equals the glob, and the agy assertion then requires the glob entry in ai/agy/settings.json — the exact configuration this PR removes. The test would fail (correctly, loudly), but its failure message ("agy trustedWorkspaces lacks .../worktrees//") would misdirect the next maintainer toward re-adding the inert glob rather than fixing the derivation. A guard that asserts agy_want differs from want (or ends without *) would make the derivation's precondition explicit. Confidence that this misdirection is reachable today is low; the scenario requires a future edit to the sed line.


⚙️ Agent run details
  • Model: openai/mimo-v2.6-flash
  • Tokens: 15,838 in / 8,926 out / 24,764 total
  • Time cost: 191.9s
  • AI calls: 1

@mlorentedev

Copy link
Copy Markdown
Owner Author

Review triage

Reviewer: PR-Agent (github-actions, ticket-compliance guide, no code findings). CodeRabbit reviewed nothing (free limit).

  • agy receives the new root on an existing machine: verified, dotf deploy agy-settings merged it into ~/.gemini/antigravity-cli/settings.json and a fresh directory then opened with no dialog.
  • Copilot: unchanged on purpose; it showed no dialog in the same kind of directory with its current list.
  • The measurement can be re-run by anyone: open agy in a new directory under ~/Projects/worktrees/<repo>/ after the deploy.
  • HARNESS: the standing three-condition merge grant contradicts no-auto-merge's 'that specific PR' #2178 stays the owner's: this PR is prepared for the owner to land.

Fixed during CI: the ## Knowledge Runbook line now carries a reason.

@mlorentedev
mlorentedev merged commit f0deadf into main Oct 15, 2026
28 checks passed
@mlorentedev
mlorentedev deleted the fix/agy-trust-worktrees-root branch October 15, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 2/5 skip-sdd SDD spec-gate escape hatch (requires '## SDD skip rationale' in PR body)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agy ignores the worktrees/*/* trustedWorkspaces entry, so every successor session stops at a trust dialog

1 participant