Skip to content

Correct the sudo authorization timing described for update hooks - #14135

Open
Ashwinhegde19 wants to merge 6 commits into
omacom:quattrofrom
Ashwinhegde19:fix/hooks-doc-sudo-timing
Open

Ashwinhegde19 wants to merge 6 commits into
omacom:quattrofrom
Ashwinhegde19:fix/hooks-doc-sudo-timing

Conversation

@Ashwinhegde19

@Ashwinhegde19 Ashwinhegde19 commented Oct 3, 2026 •

Copy link
Copy Markdown

Closes #14134.

What

Two lines about update hooks still describe a sudo boundary that no longer exists:

  • default/agents/skills/omarchy/hooks.md: the hook tree said post-update.d/ runs "after privileged work". Mise, AUR packages and the boot check all follow it, and all can use sudo. It now says the hook runs near the end of omarchy update, before those three.
  • manual/31-dotfiles.md: said both update hooks run after Omarchy clears its sudo authorization and may ask for a password. It now says they run right after Omarchy has used sudo itself, so a sudo in a hook reuses that authorization and doesn't ask again.

Why

On quattro, bin/omarchy-update authorizes once after confirmation and keeps the timestamp fresh through the boot check (#16568 brought AUR and the boot check inside; #17000 replaced the revoke-and-wrap boundary with ordinary sudo and a 10-minute timestamp that no Omarchy command clears). bin/omarchy-refresh-pacman runs its sudo cp calls immediately before the pre-refresh-pacman hook. Neither hook runs cold. docs/update-process.md already says this; these two lines didn't.

The old wording is wrong in the direction that matters: someone who reads it and hardens a hook on the assumption that sudo will prompt gets a hook that runs privileged commands without one.

Scope

Markdown only, no code or behaviour change. Checked by reading against bin/omarchy-update, bin/omarchy-refresh-pacman, etc/sudoers.d/omarchy-sudo-timeout and docs/update-process.md on quattro at 5fa15f2.

Out of scope, noted for a separate change: line 35 of the manual says every executable file in a hook directory runs, but bin/omarchy-hook runs every regular file except .sample through Bash regardless of the executable bit.

History

Opened against the earlier boundary (pre-refresh-pacman cold behind the no-update wrapper, AUR outside the authorization). The branch has since been merged with quattro twice and reduced to the two lines above. #14655 and #15805 address the same issue and currently conflict with quattro.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The documentation changes appear safe to merge.

Summary

Updates hook documentation to match the current update flow.

  • The hook guides place post-update before later steps and explain sudo reuse.

Reviews (6) · Last reviewed commit: "Merge quattro: describe hook sudo under ..." · Reviewed by Greptile

Comment thread manual/31-dotfiles.md Resolved
Comment thread default/agents/skills/omarchy/hooks.md Resolved
Comment thread manual/31-dotfiles.md Resolved

@chessing234 chessing234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

everything seems fine, ready to merge.

@omarchybot omarchybot added the documentation Improvements or additions to documentation label Oct 15, 2026
quattro now runs omarchy-update-boot after AUR, cold behind the no-update wrapper, so AUR is no longer the only stage outside the update's authorization, and post-update runs before mise rather than after every sudo-capable stage. A post-update hook that runs omarchy refresh pacman (or another command that revokes) loses the shared authorization, so "does not prompt" needs that exception. Packaged installs do not ship docs/, so the skill points at the Omarchy repo as theming.md does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 15, 2026
Comment thread default/agents/skills/omarchy/hooks.md Resolved
Comment thread manual/31-dotfiles.md Resolved
@omarchybot omarchybot added the ready Good to merge label Oct 15, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this. I checked both paragraphs against the code on quattro, not just the branch: bin/omarchy-update and bin/omarchy-refresh-pacman behave as you describe. post-update and mise run inside the update's single authorization, and pre-refresh-pacman runs cold between two revocations, behind the no-update wrapper. This is documentation only, so nothing was run; it was checked by reading.

I pushed one commit to your branch, 02477d9, because quattro moved after you branched:

  • omarchy-update-boot (Converge omarchy-mac and omarchy-mx-mac into upstream Omarchy #14431) now runs after the AUR phase, cold, behind the same wrapper, so AUR is no longer the only stage outside the authorization. Both paragraphs now name it.
  • In hooks.md, "post-update runs after every sudo-capable update stage" is now the actual order: after package updates, migrations and service restarts, and before mise, AUR packages and boot verification.
  • "Does not prompt" now has its one exception: a hook that first runs a command that revokes the timestamp, such as omarchy refresh pacman, loses the shared authorization for the rest of the hook.
  • The skill now points at docs/update-process.md "in the Omarchy repo", as theming.md does, since packaged installs don't ship docs/.

Codex Medium reviewed it as a second opinion. Its first round found the mise ordering and the refresh-pacman exception above, and its second round found nothing left. Independence isn't guaranteed, since it can read this session's notes. Greptile passes on the new head. This now waits on the maintainer.

… refresh guarantee to the refresh

The hook tree said post-update runs "after privileged work", but mise, the AUR builds and the boot check all follow it. And the promise that a detached child left by pre-refresh-pacman has nothing to wait for holds only during the refresh: a channel switch goes on to run omarchy update, which opens a reusable authorization.

Co-Authored-By: Omarchybot <317366263+omarchybot@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot removed the ready Good to merge label Oct 18, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

I pushed 7494e90 to this branch. It folds in two corrections to default/agents/skills/omarchy/hooks.md from #15805, a newer pull request for the same issue, and credits it as co-author:

  • The hook tree said post-update.d/ runs "after privileged work", but mise, the AUR builds and the boot check all follow it. It now says the hook runs near the end of omarchy update, inside its sudo authorization, before mise and AUR.
  • "a detached child left behind by the hook has nothing to wait for" holds only during the refresh. bin/omarchy-channel-set goes on to run omarchy update -y, which opens a reusable authorization, and the paragraph now says that guarantee ends where the update begins.

Nothing runs in this change, so no worker was used. Every statement in both files was checked against bin/omarchy-update, bin/omarchy-refresh-pacman, bin/omarchy-channel-set, bin/omarchy-security-functions, docs/update-process.md and test/shell.d/channel-sudo-boundary-test.sh on quattro at da2db1a. None of those files has changed since the previous check. Codex Medium reviewed the result as a second opinion and found no defects. That agreement does not prove independence, since the reviewer can read this session's notes.

#14655 corrects the same two files for the same problem and also carries ready. This pull request is older, and it covers a case #14655 does not: a post-update hook that runs omarchy refresh pacman loses the shared authorization from that point on. Codex Medium, asked separately, also judged that this one should win. #14655 also fixes the orphan-cleanup note in docs/update-process.md, which is a separate correction. So that two competing fixes are not both marked mergeable, I have removed ready from this one. It stays verified at 7494e90, and it is waiting on the maintainer to choose between the two.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 31, 2026
omacom#17000 replaced the update's revoke-and-wrap sudo boundary with ordinary sudo and a ten-minute timestamp that no Omarchy command clears, and omacom#16568 moved AUR and the boot check inside the update's authorization. The cold-boundary wording this branch added is now wrong, so hooks.md takes quattro's paragraph, which already says hooks run inside the update's authorization. Two stale lines remain on quattro and are fixed here: the hook tree's "after privileged work" for post-update, which mise, AUR and the boot check all follow, and the manual's claim that update hooks run after Omarchy clears its sudo authorization and may prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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

I pushed 737ddab to this branch. It merges current quattro, because the code this pull request described has changed under it: #16568 brought AUR packages and the boot check inside the update's sudo authorization, and #17000 replaced the revoke-and-wrap boundary with ordinary sudo, a 10-minute timestamp that no Omarchy command clears. On quattro now, bin/omarchy-refresh-pacman runs four sudo cp calls right before the pre-refresh-pacman hook, and bin/omarchy-update keeps one authorization alive from confirmation through the boot check, so neither hook runs cold and nothing is kept outside the authorization.

So the merge resolves the conflict in default/agents/skills/omarchy/hooks.md by taking quattro's paragraph, which already says this. Two lines are still stale on quattro, and this pull request now fixes just those:

  • The hook tree in hooks.md said post-update.d/ runs "after privileged work". Mise, AUR packages and the boot check all follow it, and all can use sudo, so it now says it runs near the end of omarchy update, before those three.
  • manual/31-dotfiles.md said both update hooks run after Omarchy clears its sudo authorization and may ask for a password. It now says they run right after Omarchy has used sudo itself, so a sudo in a hook reuses that authorization and doesn't ask again.

The pull request description still describes the old boundary (pre-refresh-pacman running cold, AUR kept outside); @Ashwinhegde19, you may want to update it to match the diff.

This is Markdown only, so nothing was run; I checked both lines by reading them against bin/omarchy-update, bin/omarchy-refresh-pacman, etc/sudoers.d/omarchy-sudo-timeout and docs/update-process.md on quattro at 5fa15f2. Codex Medium reviewed the change as a second opinion and found no defects in it. It also noticed something outside this pull request: line 35 of the manual says every executable file in a hook directory runs, but bin/omarchy-hook runs every regular file except .sample files through Bash, executable or not. That is unrelated to sudo, so it is left out of this change. Its agreement does not prove independence, since it can read this session's notes.

#14655 and #15805 fix the same issue and now conflict with quattro; both still describe the removed boundary. This pull request is the oldest and the only one that matches the code as it is now, and Codex Medium, asked separately which should win, chose this one for the same reason. It now waits on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update hooks doc gives the wrong sudo authorization timing for post-update

3 participants