Repository navigation
feat(plugins): rogue-hook release 1 - install the native bridge once at its fixed path (FIRE-3016) - #76
Draft
yuval-qf wants to merge 11 commits into
Draft
feat(plugins): rogue-hook release 1 - install the native bridge once at its fixed path (FIRE-3016)#76yuval-qf wants to merge 11 commits into
yuval-qf wants to merge 11 commits into
Conversation
…lled (FIRE-2882) Every plugin's hook, heartbeat, log-shipping and auto-update scripts hand their job to rogue-hook, the native bridge, when it is installed, and keep it themselves when it is not. Squash of rogue-plugins PR #65 and the FIRE-3016 conformance test commits, rebased onto main. Auto-update has no opt-out: ROGUE_AUTO_UPDATE=0 and the ROGUE_PLUGIN_VERSION pin are gone. Compiled customer bundles, which carry their own env, are still left to their admin. Model: Claude Opus 5.5. Agent harness: Claude Code in T3 Code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r its own update lock (FIRE-3016) The binary now updates itself in place at ~/.rogue/bin/rogue-hook (the rogue-hook.exe launcher on Windows). The hand-off installed it into a directory per pinned version, which blocked that update and would never run a binary that updated itself. - The scripts exec the binary at the fixed path whenever it is installed, with or without a pin. - rogue-hook.json is the trust root for the first download only. - The download step takes the binary's own lock (~/.rogue/.self-update.lock) without waiting, checks the path again, and installs only while it is empty: flock(1) or perl on macOS and Linux, a byte-range lock over the binary's LockFileEx on Windows; Node runs again under the same lock. Per-version directories, pruning, stale-lock breaking and per-version locks are gone. - Downloads stage in ~/.rogue/updates, on the same volume, and move into place with one rename. - install.sh and install.ps1 install the binary from the pin of a plugin they installed. - PowerShell on macOS or Linux hands the download to the sh installer. - conformance --native installs the binary at the fixed path; unselected families get their kill switch. Model: Claude Opus 5.5. Agent harness: Claude Code in T3 Code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
2 of 3 tasks
…s the lock held (FIRE-3016) flock -n exits 1 on a held lock, and exec passed that on, which stopped install.sh-style callers under set -e. The lock test now waits for its holder: flock(1) hands the lock to its command, which outlives a killed flock. Model: Claude Opus 5.5. Agent harness: Claude Code in T3 Code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… under x64 Git Bash (FIRE-3016) Claude Code runs Windows hooks through Git Bash, whose bash.exe is an x64 build. A PowerShell or Node started from it runs under x64 emulation, so the process environment and .NET both report AMD64 and the first download asked for windows-amd64 on an ARM64 machine. Seen on an ARM64 Windows 11 VM. The download step now reads the machine's own arch from the registry and keeps the environment as the fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…log (FIRE-3016)
auto-update.sh hands its update check to the installed binary, which prints the hook answer `{}`.
Its stdout is the log, so every session appended a stray `{}` to ~/.rogue/auto-update.log.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bridge (FIRE-3016) The native bridge is a major release, so Claude, Codex, Cursor, Copilot, Gemini, Antigravity, Kiro and Muse all move to 2.0.0, in each plugin manifest and its marketplace entry. Cortex Code stays at 0.2.0: it has no binary adapter yet (FIRE-3398) and this change does not touch it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…vents to the binary (FIRE-3431)
Cortex Code was the only plugin that stayed on its scripts in release 1, so
release 2, which deletes the scripts, would leave it without hooks.
hook.sh and hook.ps1 now hand each event to rogue-hook when it is installed,
behind ROGUE_NATIVE_BRIDGE_CORTEX. The plugin carries the shared hand-off and
installer scripts, its installers keep the rogue-hook.json pin, and the
top-level installers find a pin in the Cortex plugin folder. The conformance
suite runs the Cortex suite in both modes, and that suite now checks the exact
log line for each outcome and the request it posts.
Needs a rogue-hook release with the cortex adapter (qualifire FIRE-3431): an
older binary answers {} to an unknown family and logs nothing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…idge (FIRE-3431) Release 1 moved every plugin with a binary adapter to 2.0.0 and left Cortex Code at 0.2.0 because it had none. It hands off to the binary now, so it moves to 2.0.0 too. Plugin files reach installs only after a version bump. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tive bridge (FIRE-3016) The plugins shipped the native bridge with no pin, so no machine downloaded the binary. rogue-hook 0.1.0 is now published (rogue-security tag rogue-hook-v0.1.0, run 45794754101). Each of the 9 served plugins gets the release manifest verbatim as rogue-hook.json. The first hook event, or install.sh / install.ps1, installs the binary at ~/.rogue/bin/rogue-hook from it; after that the binary updates itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…plugins ship a pin (FIRE-3016) With the rogue-hook.json pin and no binary, each hook event starts the first download in the background. In the hook-log suite it wrote ~/.rogue/.self-update.lock or hook-binary.log into the test home, so 4 "writes only its log" checks failed in CI. The suite tests the script logs, so it now runs with ROGUE_NATIVE_BRIDGE=0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… rogue-hook (FIRE-3016) On a Mac with the hardened endpoint, the first native bridge install always failed: the system extension denies every rename into ~/.rogue/bin and installs the binary itself only when <source>.sig holds the release's signature. The installers never wrote that file, and they treated the EPERM that follows the extension's own install as a failure. native-bridge-install.sh and the Gemini native-bridge-install.mjs now write the download route's signature beside the staged binary, as self_update.rs does, and accept a failed rename when ~/.rogue/bin/rogue-hook then has the pinned sha256. Model: Claude Opus 5.5, Claude Code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
PR #65 installed
rogue-hookinto a directory per pinned version (~/.rogue/bin/rogue-hook/<version>/rogue-hook). The binary on main now updates itself in place at one fixed path (~/.rogue/bin/rogue-hook, or therogue-hook.exelauncher on Windows), as FIRE-3008 asks. The two did not fit: the versioned directory blocks the binary's own update, and a binary that updated itself would never run.Fix
This PR replaces #65. It carries #65's hand-off (squashed and rebased onto main) and reworks it for the fixed path:
Fixed path. The scripts exec
~/.rogue/bin/rogue-hook(%USERPROFILE%\.rogue\bin\rogue-hook.exe) whenever it is installed. The binary no longer needs a pin to get events.The pin is for the first download only. When the binary is missing and the plugin ships
rogue-hook.json, the scripts start the download in the background and handle the event themselves. After that, the binary updates itself from the Rogue API and checks each release's signature.One OS file lock, shared with the binary. The download step takes the binary's own update lock (
~/.rogue/.self-update.lock) without waiting, then checks the path again. It installs only while the path is empty, so it never replaces a binary that updated itself. On macOS and Linux it usesflock(1)orperl. On Windows it uses a byte-range lock that overlaps the binary'sLockFileEx. Node runs itself again under the same lock. The per-version directories, pruning, stale-lock breaking and per-version locks are gone.Staging on the same volume. Downloads go to
~/.rogue/updates/and move into place with one rename.Installers.
install.shandinstall.ps1install the binary at the end of a run, from the pin of a plugin they installed. A failure only warns; the hooks retry on their own.mdm-provision-actor.shis unchanged: it only writes/etc/rogue/envas root, and the binary belongs in each user's home.One installer per OS.
native-bridge-install.ps1hands off to the sh installer when PowerShell runs on macOS or Linux (.NET cannot lock a file on macOS).Conformance.
tests/conformance.sh --nativeinstalls the binary at the fixed path. Unselected families get their kill switch (ROGUE_NATIVE_BRIDGE_<FAMILY>=0) instead of "no pin".Docs.
docs/deployment.mdgets a short "The native bridge" section.Kept from feat(plugins): hand hook events to a pinned native bridge (FIRE-2882) #65: auto-update has no opt-out.
Cortex Code (feat(cortex): rogue-hook native bridge - Cortex Code hands its hook events to the binary (FIRE-3431) #77, FIRE-3431, merged into this branch): Cortex Code hands its events to the binary too, like Muse. Its adapter is in the monorepo (rogue-security#3631), so the first
rogue-hookrelease must come from a main that has it.Version 2.0.0. Claude, Codex, Cursor, Copilot, Gemini, Antigravity, Kiro, Muse and Cortex Code move to 2.0.0 in their manifests and marketplace entries.
Pin. All 9 plugins ship
rogue-hook.jsonforrogue-hook0.1.0, the first published release (monorepo tagrogue-hook-v0.1.0). It is the release manifest, copied verbatim.Macs with endpoint anti-tamper (
c95d861). The system extension denies every rename into~/.rogue/bin. It installs the binary itself only when the release signature lies beside the source as<source>.sig, and the rename still fails with EPERM.native-bridge-install.shand the Gemininative-bridge-install.mjsnow save the download route'ssignaturethere, as the binary's self-update does, and accept a failed rename when~/.rogue/bin/rogue-hookthen has the pinned sha256.A binary that is already at the fixed path gets events at once.
Out of scope, with tickets:
Issue
https://linear.app/qualifire/issue/FIRE-3016 (epic FIRE-3008). Replaces #65 (FIRE-2882).
Verification
1. First install with the real binary, end to end (macOS). A Claude plugin copy on the scripts, a pin for a
rogue-hookbuilt from monorepo main, and a mock of/api/v1/hooks/download. Event 1 is answered by the script and installs the binary at the fixed path. Event 2 is handled by the binary, which then asks/api/v1/hooks/update-manifestitself, withmachine_id. That shows it runs from the path where it updates itself. (Script:proof-first-install.sh, run outside the repo.)2. Conformance against the real binary (macOS), through the real hand-off.
3. Hand-off and download suites (macOS). New cases: a binary with no pin still gets events; an installed binary (one that updated itself) is never replaced; a held update lock stops the installer until it is free;
install.shinstalls from a plugin's pin.4. The validate workflow's
manifestsjob, run locally (macOS).All 17 steps pass, among them the shell and PowerShell unit tests, the hook-log, log-shipper and beacon contracts, the Kiro end-to-end run and the shared-script sync check.
5. CI on
09243d3(with #77 and the 0.1.0 pins):manifests(ubuntu, so theflock(1)lock path) andwindows(the Windows lock, ACL and install cases) pass.6. Upgrade test on VMs, against a local Rogue env (2026-11-25). macOS 26.6 (arm64) and Windows 11 (ARM64) UTM guests with real Claude Code 2.1.332.
rogue-hook0.1.0 and 0.1.1 were debug builds of monorepo main (0086c8dc), signed with a throwaway key. A lab proxy served/hooks/downloadand/hooks/update-manifestfrom those builds. It sent every other request to a local env on monorepo main, so each event was checked in its database. The lab copy of this branch had a pin for 0.1.0 and bumped plugin versions, as the pin release does. AHOOKBIN_BLOCKmarker made the proxy return a block answer, to check that the agent stops.claude -psession storedd2b9d28rogue-hook/0.1.0; stored the same as the script's (same raw entries, same payload keys)UserPromptSubmit) through the binary stops Claude{}, deny relayed, all storedinstall.sh/install.ps1install the binary; a second run leaves it unchangedrogue-hook.exemoves to the launcher layout (versions\0.1.1,current, launcher replaced on the next run)~/.rogue/logs,hook-binary.log,auto-update.log(only ShipLogs, which the local env answers 500: no Axiom there)5b9a2d5Found and fixed here:
d2b9d28: on ARM64 Windows the first download asked forwindows-amd64. The process environment and .NET both say AMD64 under x64 emulation; the registry keeps the machine's arch.5b9a2d5: every session wrote a stray{}into~/.rogue/auto-update.log(the binary's hook answer).Found, not in this PR:
--versionof the new unsigned debug build took 48 s, over the binary's 10 s probe limit. With cloud lookup off it took 346 ms and the update passed. Signed release builds on a connected machine should not see this; slow endpoint AV is a risk for the binary's probe limit (monorepo).install.ps1registers the install without a version (unknownuntil the next heartbeat).7. The published release 0.1.0 (2026-11-26). Tag run 45794754101: every job passes, notarization
Accepted, all 6 Windows filesValid(Authenticode,Qualifire inc.), and the publish job checks each.sigwith the shipped Linux binary's updater key. S3 has all 19 objects. The pin is the run's manifest; each built binary matches its sha256. Native conformance passes against the released macOS binary.8. Macs with endpoint anti-tamper (
c95d861). A teammate's managed Mac (macOS 27.0.1 arm64, endpoint 1.0.43-rc.2, plugin at09243d3) loggedrogue-hook 0.1.0: cannot install …/.rogue/bin/rogue-hook; the script bridge handles eventson the first install. They staged the route's signature as.sigby hand: the rename failed with EPERM, and the extension installed the binary (rogue-hook 0.1.0). Codex and Cursor then loggedbridge=nativefor every event. New cases intests/test_native_bridge_sh.shandtests/test_native_bridge_mjs.mjsstand in for the extension: they fail on09243d3with the same log line and pass onc95d861. All 17 steps of the manifests job pass locally.Before this fix, the extension also reported each failed attempt as tamper (
decide_hook_install(false)), about once each 15 minutes. Not checked in prod data.Not verified yet:
/hooks/downloadroute on a real machine. That is the org test.Merge danger
Do not merge yet. The plan is to test this branch on the Rogue org first.
Model: Claude Opus 5.5. Agent harness: Claude Code in T3 Code.
🤖 Generated with Claude Code