Repository navigation
Discover shell plugins through XDG data directories - #12872
spencerbull wants to merge 10 commits into
Conversation
|
Two issues were reproduced at Unset
|
| Shell environment | Argument received by Bash | Discovery |
|---|---|---|
| Explicit absolute directory | That directory | Scans the configured root |
| Empty string | Empty string | Scans default roots |
| Unset | "null" |
Skips default roots as a nonabsolute entry |
Impact: A dev-linked shell with the variable unset cannot discover otherwise eligible packaged plugins in the default roots, although the CLI catalog applies the default correctly. Rescanning with the same environment repeats the mismatch. Live-session prevalence was not measured.
Suggested change: Normalize the QML value before constructing the command, for example Quickshell.env("XDG_DATA_DIRS") || "". Add an actually unset environment case to the native registry test; the existing unset/default comparison exercises only the CLI.
A retained facade exposes the trusted replacement manifest to old personal code
The new provenance check replaces the old service object, but syncPluginApis() runs first and assigns the selected trusted manifest to the existing untrusted registry facade. publicPluginManifest() returns that trusted manifest by reference.
A synthetic enabled personal omacom.demo service used keepLoaded: true and listened to its real registry facade's manifestChanged signal. Removing only its manifest, leaving its QML available, selected the packaged counterpart:
Personal manifest removed -> packaged manifest selected as trusted
-> old facade receives live packaged manifest
-> old callback rewrites __sourceDir to the personal directory
-> provenance check destroys the old object
-> NEW object loads PERSONAL QML with the trusted host shell
| Native minimal-host case | Replacement code | Trusted host access |
|---|---|---|
| Passive personal service | Packaged | Yes |
| Personal callback rewrites received manifest | Personal | Yes |
| Same callback, diagnostically detached manifest | Packaged | Yes |
Impact: Personal code can receive the packaged replacement's trusted host APIs despite object recreation. This violates the intended source/trust-transition protection. It is a within-process API-boundary issue, not an OS sandbox escape; no credential access or OS privilege escalation was tested.
Suggested change: Keep manifests supplied to existing third-party facades detached from canonical registry state, and revoke or rebind facade ownership on source/trust changes before notifying old code. Provenance decisions should use host-owned state that those callbacks cannot mutate. The detached-manifest control prevents this demonstrated redirection, but is not proof of complete stale-reference revocation. Include this callback-driven transition in the regression case; the current service-only mock omits facade synchronization.
Verified: With explicit XDG roots, the CLI and native registry selected personal copies before checkout copies before ordered data roots, rejected external omarchy.* IDs, and assigned omacom.* trust by origin rather than manifest claims. Passive retained services were replaced correctly when their selected source/trust changed.
Review information
Test scope: Pinned-source CLI tests, native offscreen Quickshell registry runs, and native registry/facade QML with extracted production lifecycle functions and synthetic services in a minimal host. Passive and detached-manifest controls distinguish the second failure. Service/authentication contract tests also used JavaScript mocks. No full desktop, live authentication service, or hardware testing.
Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.
Automated AI review: Astra initial source inspection, independent Fable 5.1 High and separate Astra Xhigh technical assessments, followed by cross-checking the claims against saved targeted evidence and coordinator synthesis.
|
Reviewed rebased In a credential-free Arch VM, seven focused checks passed on the final patch: native Quickshell discovery, registry and service provenance, the auth boundary, plugin add and clone, and the full shell runtime smoke test. Deliberate reversions of the new lifecycle guards made their regression assertions fail. Earlier in this review, real Rebased all nine commits onto 🤖 Generated by GPT-6 in Codex. Reviewed by GPT-6 XHigh. |
d496a55 to
5393fe1
Compare
|
Verified by source inspection: both findings in the earlier review are resolved at
Verified by source inspection: the clone filter now requires an Review informationTest scope: Source-only reassessment of the fixes and directly affected behavior. The original native QML callback reproduction was not rerun, so native signal/destruction timing and comprehensive stale-reference revocation remain unverified. The author's VM, marketplace and smoke-test results were not independently reproduced. This is scoped resolution, not a whole-PR or desktop validation. 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 GPT 6 Sol Xhigh source assessments, then Astra Medium evidence cross-checking and synthesis. |
5393fe1 to
46f5388
Compare
Resolve external plugin IDs from the user directory, the active Omarchy checkout, then XDG data directories in order. Track discovery origin separately from the manifest path so external directories cannot claim the reserved built-in namespace. Co-Authored-By: GPT-6 XHigh <noreply@openai.com>
Preserve search precedence while granting first-party APIs to omacom.* plugins from the active checkout and XDG roots. Recreate retained services when their source or trust changes so old personal code cannot inherit a packaged replacement’s access. Co-Authored-By: GPT-6 XHigh <noreply@openai.com>
Normalize an unset XDG_DATA_DIRS before passing it to Bash so the runtime uses the same default roots as the CLI catalog. Exercise the native Quickshell argument and resulting scan with the variable truly unset.
Bind scoped callbacks and registry facade caches to the source and trust that created them. Revoke old facades before synchronization can hand them a trusted replacement manifest, and decide ownership from host cache keys so a writable facade ID cannot abort reconciliation. Keep the asynchronous provenance guard observable with both loads pending. Co-Authored-By: GPT-6 XHigh <noreply@openai.com>
Packaged omacom.* plugins are trusted by the registry, but the clone command derives its local ID from an omarchy.* built-in. Require that namespace explicitly and make the fixture valid so the test reaches the catalog selection.
The first valid manifest is already the authority for an ID. Stamp its capabilities directly so a personal override cannot inherit those of a packaged copy, while clones still inherit from the selected trusted source. Co-Authored-By: GPT-6 XHigh <noreply@openai.com>
Bind widget registry, built-in bar and replacement-bar entry facades to the selected plugin source. A replacement gets fresh callbacks and presentation bindings; unchanged selections keep their existing instances. Co-Authored-By: GPT-6 XHigh <noreply@openai.com>
A delayed widget load can finish after discovery selects a different source and restore the displaced component or clear the new load claim. Bind completion to its claim and selected manifest, and clear pending claims when widgets disappear. Co-Authored-By: GPT-6 XHigh <noreply@openai.com>
A pending service could publish after disablement, and an asynchronous widget replacement could leave its displaced registration behind if the new component failed. Check the enabled state before service publication and remove the previous widget registration when replacement starts. Co-Authored-By: GPT-6 XHigh <noreply@openai.com>
The catalog comment should retain its purpose and state the HOME, checkout, and ordered XDG root precedence now used by the shell and CLI. Co-Authored-By: GPT-6 XHigh <noreply@openai.com>
46f5388 to
033a149
Compare
spencerbull
left a comment
There was a problem hiding this comment.
Reviewed exact head 033a1496b26ba20b2c19882b34d825d71aaa848f against quattro c3e67f5d405047765d47a9336a3df115a7beecfb: ready for the maintainer's merge decision. The two latest inline comments were valid; the catalog header now states the actual HOME → active checkout → ordered XDG data-root load order. I replied to both threads. The earlier community findings about unset XDG roots and an outgoing personal facade reaching its trusted replacement remain fixed. GPT-6 Astra XHigh reviewed the final source and found no actionable defect; review independence is not guaranteed.
Three credential-free Omabot Proxmox workers linked this exact head and exercised the published, signed omarchy/elsewhen 1.0.0-2 package. VM 9001 installed it through the real package flow. With the HOME link absent, the catalog selected /usr/share/omarchy/shell/plugins/omacom.elsewhen as firstParty:true; live IPC showed it enabled. Disabling removed its bar registration and re-enabling restored the 27 px widget immediately before the clock. I independently viewed the worker screenshot (SHA256 ded113444514b8b7af0586dd626b740b1203e522aab704c129dadb325ccb9b04).
VM 9002 proved HOME overrides checkout and package while remaining untrusted; removing HOME selected the trusted checkout, and removing checkout restored the trusted package. With process XDG_DATA_DIRS=A:B:/usr/share and then B:A:/usr/share, live IPC and catalog selected A then B, and the bar glyph changed in independently inspected screenshots (SHA256 A 22b347513004fcb6e7e76b51da75f6a07b4e5664dbbc89ec6773d320198ba32d, B f2b943d6ef779e5c8b60dafec680905f8d1dc3c1aa3f4a344125ce472681dd0a). Invalid B fell through to A; invalidating A too selected the unmodified signed package and its native times IPC returned five clocks. HOME then beat the XDG roots; invalid HOME schema and unsafe ../Panel.qml each fell back to B. Catalog paths, live IPC trust flags, component file-open events, and a VM-only source probe corroborated these transitions. Fallback screenshots were obscured by worker display sleep, so the fallback claim rests on IPC and file-open evidence.
VM 9003 exercised two separately labeled synthetic Elsewhen-derived fixtures, an ordinary service and a service declaring authentication capability. For both, package → HOME → package changed live firstParty true → false → true, replaced instances in destroy-before-create order, and changed host ShellRoot access to an ID-scoped PluginShellApi under HOME. A newly invalid HOME entry point left no live service or privileged fallback; repair and package restoration recovered, and removal left no catalog/runtime/IPC entry. Real Elsewhen is a bar widget; these fixtures test the new service and capability branches. The hostile-facade callback and delayed widget-load cases also remain covered by focused regressions and earlier mutation checks, not by a live authentication service.
The VM 9001 focused run passed 157 assertions in eight files, zero failures; VM 9002 passed 115 focused assertions and VM 9003 passed 94. Full ./test/all completed with 3,482 passing assertions but failed on six explicit assertions plus two silent file exits (seven shell files and the CLI suite). A fresh base-commit worker, with the same signed Elsewhen package and test wrapper, reproduced every one of those eight failing targets with the same assertions and exit codes; they are existing base failures in theme, ASCII/branding, kernel, omasnap, and package ownership checks. GitHub reports no PR checks. VMs 9001–9003 and the base-control VM were destroyed after evidence readback; unrelated VMs were untouched. The PR remains open and unmerged.
🤖 Generated by GPT-6 in Codex. Reviewed by GPT-6 Astra XHigh.
Automated AI review
Verified at
Verified, new commits:
Default install logs a reserved-ID rejection for every built-inA standard install has
Impact: Plugin selection is unaffected, but every startup and rescan logs that each built-in was "rejected" although it loaded, which can mislead anyone debugging plugin discovery. Suggested change: Skip a data root whose Existing Elsewhen links keep the packaged plugin untrustedOn dev-linked installs, Impact: Dev-linked systems that already ran the migration do not get the trusted packaged Elsewhen that XDG discovery now provides until the link is removed by hand. Suggested change: Add a migration that removes the link only when it still points at Documentation note: Personal plugin directories now also accept adjacent Related open PRs: #13340 (JSONL scan records) and #12981 (external scan script) both rewrite the same scanner in Review informationTest scope: Fresh follow-up at AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
A dev-linked Omarchy shell only discovers plugins in its checkout and the user plugin directory, so packages installed under
/usr/share/omarchy/shell/pluginsare missed without a user symlink.Make the shell and CLI resolve external plugin IDs from
$HOME/.config/omarchy/plugins, then$OMARCHY_PATH/shell/plugins, thenomarchy/shell/pluginsunder each$XDG_DATA_DIRSdirectory in order. The first valid manifest wins; unset or empty$XDG_DATA_DIRSuses/usr/local/share:/usr/sharein both the CLI and shell.Keep
omarchy.*reserved for built-ins from the active Omarchy tree. Trustomacom.*plugins from the active tree or XDG data directories; a user-directory copy still wins by precedence and remains untrusted. Discovery origin determines trust rather than manifest claims or pathname prefixes. Trusted plugins receive the existing first-party host APIs and declared capabilities, and trusted non-bar plugins are enabled by default unless explicitly disabled.Recreate retained services and cached bar or widget facades when their selected source or trust changes. Revoke cached third-party facades before publishing a replacement manifest, and bind scoped callbacks to the source and trust that created them so outgoing personal code cannot reach its trusted successor. Reject pending service loads after disablement, and bind asynchronous widget loads to the current selection so an old or failed replacement cannot leave a stale registration. Unchanged
keepLoadedservices retain their instances. The CLI clone command remains limited toomarchy.*built-ins even when a packagedomacom.*plugin is trusted at runtime.The Elsewhen migration is simplified separately in #12871.
🤖 Generated by GPT-6 in Codex. Reviewed by GPT-6 XHigh.