feat(omarchy): the herd on the Omarchy bar (PRD 0017) - #529
Merged
Merged
Conversation
`moshcode omarchy` — status, validate, install, doctor — plus the QML bar widget and panel the snapshot feeds. status is the one command the plugin runs: agents, counts, burn windows, fleets and alerts in a single process, read-only, with the cost half cached (5s, or a minute when a reading was slow) and a partial snapshot rather than a failure when cost throws. The herd and cost module graphs load lazily, so validate/doctor/install never pay for them. The plugin is deliberately small: one Process at a time, no shell, guarded parses, theme-driven colours, and no writes at all. It runs unsandboxed in Omarchy's shared Quickshell process, where a leak or a throw is everyone's bar, not just ours. Measured during implementation and fed back into the PRD: a moshcode process costs 0.66-4.2s on a loaded box, almost all of it node and CLI start-up, so the poll is 10s closed / 3s open rather than the 5s/1s the PRD first claimed, and the success metric now bounds the snapshot's own work instead of wall clock. PRD 0017 moves Draft -> Accepted. Not verified: anything QML. This box is Ubuntu with no omarchy, omarchy-shell or qmllint, so R13 (qmllint, omarchy plugin validate, a real bar) and the marketplace submission are still open. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan7 finding(s) in the 14 file(s) this pull request changes. MEDIUM: 7
94 pre-existing finding(s) elsewhere in the repository — **HIGH/CRITICAL**: 8 | **MEDIUM**: 75 | **LOW**: 11Not introduced by this pull request. The full set is in the Security tab.
…and 74 more. Full results in the Security tab. Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements PRD 0017. Two halves: the command the bar polls, and the plugin that polls it.
moshcode omarchystatusvalidateinstall~/.config/omarchy/pluginsand rescan (backs up what it replaces)doctorstatusis read-only and never exits non-zero for something the bar should render — "no herd", "no rates", "cost was slow" are answers, not failures. The cost half is cached for 5s under~/.moshcode/herd/omarchy-status.json(0600); a reading that took over 2s marks itself slow and is held for a minute; a reading that throws serves the last good one and marks the snapshotpartial. The herd and cost module graphs load lazily, so the three cheap verbs never pay for them.Real output on this box:
4 agents · $85.56/h, with the fleet and blocked counts from the live herd.The plugin
omarchy/—manifest.json(sh.moshcode.herd, schemaVersion 1,bar-widget+panel),BarWidget.qml,Panel.qml,Model.js, README, LICENSE. OneProcessat a time, no shell, guarded parses, theme-driven colours, zero writes. Blocked agents are the one thing that changes colour and pulses, because that is the state this exists for.What measurement changed
The PRD said 5s/1s polling on the strength of a 210ms reading of
moshcode ps --json. Measured properly, amoshcodeprocess costs 0.66s to 4.2s on a box busy running the agents it reports on, and nearly all of it is node's start-up plus the CLI's —omarchy validate, which reads one manifest, costs the same. So the cadence is now 10s closed / 3s open, and the success metric bounds the snapshot's own work (roster 215ms, fleets 1ms, cost 5ms cached) instead of wall clock. Both corrections are written into the PRD with the reason, and 0017 moves Draft to Accepted.Not verified
Anything QML. This box is Ubuntu 26.04 with no
omarchy,omarchy-shellorqmllint, whichmoshcode omarchy doctorsays plainly. R13 (qmllint clean,omarchy plugin validate, the widget in a real bar, an hour with no leaked processes) and R14 (the marketplace listing) stay open until there is an Omarchy box. R3's separatemoshcoder/omarchy-moshcoderepo is not created either — the source ships here andmoshcode omarchy installplaces it, so nothing is blocked on that decision.Tests
test/omarchy.test.mjs, 28 new tests: snapshot shape and vocabulary, counts for states nobody is in, blocked-only alerts, a roster that throws, unpriced engines counting as unpriced rather than free, the cache's ttl / slow-ttl / error paths and its 0600 mode, and every validator rule including the symlink and path-escape rejections. Full repo suite: 2533 pass, 0 fail, 4 skipped.🤖 Generated with Claude Code