Skip to content

Confirm secure session acquisition before reporting a lock - #14911

Closed
thebytorsnowdog wants to merge 1 commit into
omacom:quattrofrom
thebytorsnowdog:codex/os-audit-lock
Closed

thebytorsnowdog wants to merge 1 commit into
omacom:quattrofrom
thebytorsnowdog:codex/os-audit-lock

Conversation

@thebytorsnowdog

Copy link
Copy Markdown
Contributor

Manual locking can currently report success when the shell refuses the request or has not acquired the compositor lock. Require both an accepted request and a subsequent status response with boolean secure: true before succeeding.

Request/status calls share a five-second deadline. Refusal, unavailable IPC, invalid status or timeout returns nonzero, explains the failure on stderr and attempts a bounded critical notification. Keyboard reset, 1Password locking and ordered screensaver cleanup follow confirmed acquisition.

Validation: all 15 cases in test/shell.d/system-lock-test.sh pass, including delayed acquisition, missing PAM, unavailable shell, malformed status, stalled IPC/notifications and successful post-lock behavior. Bash syntax, command metadata and style checks pass.

Release still needs a running Omarchy desktop to verify actual lock acquisition and failure presentation. These tests use stubs; this change reports acquisition failures and does not change suspend's separate locking policy.

@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Critical impact] The PR appears safe to merge; no actionable issue was established.

Summary

omarchy-system-lock now requires an accepted request and a status reply with boolean secure: true before returning success.

  • Manual locking waits until the shell confirms the session is secure.

Intentional behavior: thebytorsnowdog states that keyboard reset, 1Password locking, and screensaver cleanup follow confirmed acquisition. Skipping these actions on failure was therefore not reported.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["Request lock"] --> B{"Reply is ok?"}
  B -- No --> F["Explain failure, attempt warning, exit nonzero"]
  B -- Yes --> C["Poll lock status within shared deadline"]
  C --> D{"Single JSON reply with secure true?"}
  D -- Yes --> E["Reset keyboard, lock 1Password, stop screensaver"]
  D -- No --> G{"Time remains and IPC works?"}
  G -- Yes --> C
  G -- No --> F
Loading

Reviews (1) · Last reviewed commit: "Confirm secure session acquisition befor..." · Reviewed by Greptile

@jandrusk

Copy link
Copy Markdown

Confirming secure acquisition before reporting success is the right behavior for omarchy-system-lock (accepted IPC ≠ compositor lock).

Heads-up: #14900 also touches bin/omarchy-system-lock + test/shell.d/system-lock-test.sh (UID-scoping the screensaver pkills). Please rebase against whichever merges first so both the confirmation loop and the UID-scoped cleanup land together.

@omarchybot

Copy link
Copy Markdown
Collaborator

Not verified yet: I read the change but did not run it, because the classification is not settled. I (Claude Opus 5.5) read this as a bug fix — today omarchy-system-lock exits 0 even when the shell answers missing-pam or failed, so a lock that never happened passes silently. The second classification, by Codex Medium, did not run: omabot had used up its daily limit of second-opinion reviews. A pull request gets tested on a worker only after two models agree on what it is, so this one has no labels and was not run on a worker.

One thing from reading it against quattro, untested: since this branch was cut, quattro has moved notification text into the language catalogs (bin/omarchy-system-sleep-lock now uses omarchy-i18n lock.didNotLock, with the strings in default/i18n/en/cli.json). The new report_unsecured here sends English literals through omarchy-notification-send, and docs/i18n.md on quattro says notification strings go in cli.json and are printed with omarchy-i18n. This pull request also touches the same two files as #14900, #15183 and #15394, so whichever lands later will need a merge.

Next: once the classification is agreed, omabot will run it on a worker against quattro and review it in full. Until then it waits on that, not on you.

@theswampdawg

Copy link
Copy Markdown

Sharing native-VM evidence from a now-retired switching experiment, tested on 2026-10-24 with this PR at 6583276.

Stack: Omarchy 4.0.6-1, Hyprland 0.56.2-4, Quickshell 0.3.2.r7.g2b4501a-1, Qt 6.12, UWSM 0.27.1-1, SDDM 0.21.0-7, QEMU/KVM. This was a local integration with the logind work in #14299/#15566 and an experimental SDDM switch command.

The compositor-confirmed acquisition check worked in real sessions. The integration also refused handoff when the shell was stopped and LockedHint was forged. Keeping compositor confirmation separate from logind's writable hint is useful.

One additional regression belongs in any fast-switching consumer: a PAM attempt started before handoff can complete after handoff. In the initial prototype:

  1. Start a real password authentication on A's native Quickshell lock, with an additional required delay before otherwise unchanged password verification.
  2. While authentication is pending, confirm the compositor lock and switch to SDDM.
  3. When that earlier authentication completes, inactive A becomes unlocked. Returning directly to A's VT exposes the desktop without another authentication.

Both applications survived, and A was confirmed secure at the greeter before the late completion. Acquisition confirmation therefore needs a separate authentication-lifecycle guard for switching. This finding concerns the composed switching prototype; this PR's acquisition-reporting change alone does not introduce that handoff.

A later local prototype paused/aborted outstanding authentication and invalidated old completion/authorization replies. Its real delayed-PAM regression passed: inactive A stayed compositor-locked, direct VT return stayed locked, and a fresh native PAM attempt was required. Persisting the pause across locker restart was covered by offscreen Quickshell controller tests; real crash-during-handoff coverage remained unfinished. The original PAM file was restored exactly after each fixture. Fingerprint hardware was not tested; its pending-attempt path also deserves coverage.

These are archived integration observations, not a full-suite or production-readiness signoff. The separate session/greeter findings are relevant to #16100.

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.

4 participants