Skip to content

test: resolve lua via command -p to avoid shim loops - #12928

Open
chessing234 wants to merge 4 commits into
omacom:quattrofrom
chessing234:fix/copy-url-test-python-shim-loop
Open

chessing234 wants to merge 4 commits into
omacom:quattrofrom
chessing234:fix/copy-url-test-python-shim-loop

Conversation

@chessing234

@chessing234 chessing234 commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #8742

Test plan

  • bash test/shell.d/hyprland-default-config-test.sh on an Omarchy host (system lua on POSIX PATH)

@llstrk

llstrk commented Sep 22, 2026

Copy link
Copy Markdown

Verified: No actionable defect found in the tested scope at d4fcb21aab0ba3a7d482b4fc608cb77b1bcf8d2c. The default-path lookup bypasses the synthetic Lua shim in the restricted-PATH case, and the targeted configuration test passes on head with both normal PATH and a shim first on PATH.

For the missing-Voxtype invocation, using guarded synthetic shims:

Revision Lua selected Binding output
Base User-PATH shim; bounded guard stops it Empty
PR System Lua via command -p -v Ordinary bindings present; dictation bindings absent

The baseline test still reports success when its guarded shim fails, so the comparison checks actual Lua output rather than relying on its exit status alone. This is a pre-existing test limitation, not a regression introduced here.


Review information

Test scope: The targeted hyprland-default-config-test.sh on base and head, Bash 5.3.15 and system Lua 5.5.1, with normal PATH and guarded synthetic shims. Existing binding and migration checks pass on head. Real mise/asdf recursion, shim-only installations without system Lua, desktop behavior and the full test suite were not exercised.

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Automated AI review: Astra Medium initial inspection, independent Opus 5.5 High and Astra Xhigh technical reviews, followed by Astra Medium synthesis and verification against the saved source and targeted test evidence.

@chessing234

Copy link
Copy Markdown
Contributor Author

thanks — nothing further on my side

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Sep 27, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at d4fcb21 and reproduced on an Omarchy worker VM. The bug is real and this fixes it.

To reproduce it I put a mise/asdf-style lua shim first on PATH. The shim falls back to a PATH lookup that skips its own directory, and it has a depth guard so it cannot fork-bomb. On current quattro, test/shell.d/hyprland-default-config-test.sh symlinks that shim into missing_bin and then runs it with PATH="$missing_bin" alone. The shim finds itself again and recurses until the guard stops it. The test still reports success because the missing-Voxtype assertion passes on empty output. With this PR, both at its head and merged into quattro, command -p -v resolves /usr/bin/lua and the shim is never re-entered. The changed test passes 14 of 14 on the worker. test/cli stops at vscode generated theme references current theme file, which fails the same way on quattro without this change and is unrelated.

The change follows the same pattern as #8268. One note: the stub-first assertion can never fail, because command -p ignores PATH entirely. It is harmless and matches what #8268 merged, so I left it.

On "Closes #8742": the fork bomb that issue reports was fixed by #8268, and that test was retired in #12739. Closing it with this change, which fixes the last copy of the pattern, seems right.

This was reviewed by Claude Opus 5.5 only. The second-opinion reviewer (Codex) did not run because its daily review budget was spent, so this has not had the independent review it needs before it can be marked ready. Nothing is needed from you; it is waiting on that second review and then on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 8, 2026
Resolves the conflict with omacom#14552, which replaced the Voxtype binding tests with backend-neutral dictation tests and reused the same missing_bin symlinks. The command -p resolution now feeds the dictation and Lazydocker cases that share that directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 8, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This branch had started conflicting with quattro after #14552 rewrote the dictation tests around the same missing_bin symlinks, and the same three command -v lines were still on quattro. I pushed 8e29ad9, a merge of quattro into this branch. It keeps every test from #14552 and the Lazydocker shortcut test, and it resolves all three symlinks through command -p -v as this PR does. No rebase was needed and nothing was force-pushed.

Re-verified at 8e29ad9 on an Omarchy worker VM, with the same mise/asdf-style lua shim first on PATH. On quattro the shim recursed and hyprland-default-config-test.sh failed (7 passed, 1 failed). This head passes 14 of 14. The head with your change reverted fails again the same way. test/cli is green on this head and on quattro. The vscode failure from the last review is gone on both.

Second opinion: Codex at medium effort reviewed the merged head this time and found nothing wrong with the change or the merge. It agreed that the command -p -v lines alone are the minimal fix. It also noted that the stub assertion would catch a regression to plain command -v, so it is worth keeping. That agreement came after my own review, and its independence is not guaranteed. Its other notes were about checks that were already loose on quattro before this PR, and they are not part of this change.

Nothing is needed from you. This now waits on CI finishing on the new head, and then on the maintainer.

@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no blocking issues were found.

Summary

Updates test/shell.d/hyprland-default-config-test.sh to resolve lua, lspci, and sort with command -p -v.

  • The dictation test uses standard command paths for its temporary links.

Reviews (2) · Last reviewed commit: "Drop the stub check that only tests comm..." · Reviewed by Greptile

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
quattro now fails the dictation test when the restricted-PATH lua run exits non-zero; keep that alongside this branch's command -p -v resolution.
The decoy lua stub could never be selected, because command -p ignores PATH, so the assertion restated bash rather than testing the fix and ran against AGENTS.md's "Don't test your own stub". The three command -p -v links are the fix; the test already goes red without them when a shim is first on PATH.
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Nov 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This had started conflicting with quattro again. quattro now fails the test when the restricted-PATH dictation run exits non-zero, in the same lines this PR changes. I pushed two commits to your branch, with no rebase and no force push:

  • b0c4edd merges quattro in. It keeps the new || fail on the dictation run and your three command -p -v links.
  • 336b8cf removes the decoy-stub check. command -p ignores PATH, so that check could never fail. It tested bash, not this fix, and it stays green even if the links go back to command -v. Omarchy's AGENTS.md asks tests not to restate the implementation. The fix is now just the three links plus a two-line comment. The PR description still mentions the stub assertion, so you may want to drop that line.

I re-verified 336b8cf on an Omarchy worker VM with a guarded mise/asdf-style lua shim first on PATH:

  • On quattro, hyprland-default-config-test.sh recursed through the shim and failed "unconfigured dictation leaves application shortcuts available".
  • On this head it passes 9 of 9 and never touches the shim.
  • With only the three links reverted to command -v, it fails the same way as quattro.
  • test/cli is green on this head and on quattro.
  • The full shell suite fails in the same 5 unrelated files on both. CI is green.

Reviewed by Claude Opus 5.5, with Codex at medium effort and muse-wonder at high effort as the second opinion. Neither found a defect in the change or the merge, and both agreed that removing the stub check is right. That agreement came after my own review, and its independence is not guaranteed.

Both reviewers also pointed out that "Closes #8742" is broader than the fix. The fork bomb #8742 reports came from a test that was retired, and this PR fixes the lua copy of the same pattern. Two other tests still link command -v results into a restricted PATH: test/shell.d/agent-usage-partition-test.sh:48 and test/shell.d/agent-usage-helpers.sh:70. I confirmed those lines in the source but did not reproduce a loop through them, and they are outside this PR. Whether this PR should close #8742 is the maintainer's call.

Nothing more is needed from you. This is waiting on the maintainer.

@chessing234

Copy link
Copy Markdown
Contributor Author

dropped the stub assertion from the description. the fix is the three command -p -v links.

@chessing234

Copy link
Copy Markdown
Contributor Author

@dhh ci is green and this is still mergeable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test/shell fork-bombs the user session: the copy-url migration test's python3 stub and the mise python3 shim invoke each other unboundedly

3 participants