Signed worker updates

The hub never executes a downloaded installer or restarts a privileged service.
An operator installs the publisher public-key policy independently of the
downloaded release. Keep this policy in /etc/iphub-updates/trust.json, owned by
root and mode 0600, in a root-owned directory with mode 0700. It contains:
{"minimum_sequence":1,"keys":{"PUBLISHER_KEY_FINGERPRINT":{"public_key_b64":"PUBLISHER_PUBLIC_KEY","role":"release"}}}
Public keys and fingerprints are obtained through an authenticated separate
channel. Do not trust a key embedded in a release or accept a synthetic key.

Verify the complete application package before extracting or running its code:
  python tools/verify_release.py --source RELEASE_DIRECTORY --trust TRUST_FILE
Run verification tooling from a previously trusted checkout. Pin its version.
Unsigned development packages require an explicit --allow-unsigned-development;
this flag does not establish release authenticity or certify production.

Install the first verified updater itself using your trusted package channel.
For later installations, stage the signed manifest, detached signature and
architecture-specific artifact in a private directory. Run the existing trusted
updater (absolute paths below are examples; replace RELEASE_DIRECTORY):
  /usr/local/libexec/iphub-update -manifest RELEASE_DIRECTORY/agent-update-manifest.json -signature RELEASE_DIRECTORY/agent-update-manifest.sig -trust /etc/iphub-updates/trust.json -artifact RELEASE_DIRECTORY/hub-agent-linux-amd64 -component hub-agent -target /usr/local/libexec/hub-agent -state /var/lib/iphub-updates/hub-agent.json -initialize

Create /var/lib/iphub-updates mode 0700 and keep it outside application-writable
directories. Use -initialize only for first enrollment; retain the journal and
its lock across upgrades and backups. Repeat with component iphub-net or
iphub-update and separate journals/targets. Never share a journal between hosts,
components, or installation paths. Never delete a journal to allow a downgrade.
Signatures expire; obtain a newly signed release if installation was delayed.

Drain the worker in the admin panel, wait for active attempts and durable result
delivery, stop the relevant service, run the updater, then start it. Check its
health, egress verification, spool and rollback metrics before activation. The
updater performs atomic replacement with a durable intent journal. Repeating the
same signed update recovers an interruption before or after binary replacement.
An already executed process continues using its old image until restarted.

The publisher increments the release sequence for every release. A normal key
cannot downgrade the version or change a binary at the same version. Emergency
rollback requires a separately provisioned recovery-role key, rollback:true and
a sequence greater than all previously accepted releases. Revoke compromised
keys through the independently managed trust policy; raise minimum_sequence.
The publisher private key stays offline and is never sent to a hub or worker.
Archive signed manifests, artifact hashes, journals and operator audit evidence.

The November 24 local release build can use the owner's newly generated private
Ed25519 signing key under %LOCALAPPDATA%/IpLookupHub/release-signing/, outside the
workspace and every application/fixture bind mount. Windows inheritance is
disabled there and access is limited to the current user and SYSTEM. The
private key is never packaged or mounted into a hub or worker. Its trust.json
contains only public verification material. Back up the private key securely
and provision that public policy on
each deployment through an authenticated channel independent of the download.
Local signature verification does not mean a remote host trusts the key or that
the production security/load/hosting release gates have passed.
