Shahi is one managed product. Apps speak only Shahi routes; the computer service adapts herdr. The plugin installs and supervises approved releases. Relay service is operated by Shahi and SSH libraries travel inside the phone binary.
- Keep the current and previous Shahi API generation, with at least 90 days after the successor reaches Stable before retiring the previous generation. A security retirement may be immediate and must have an explicit release note.
- The initial safe floor is API 5. API 4 and earlier are not restored. Current and baseline clients both use API 5; additive features do not bump it.
- Advertise additive capabilities in the authenticated control handshake. Missing attachments disable attachment controls; missing managed updates leave ordinary supported app features available.
- Recovery protocol 1 is independent of the ordinary API. Keep it available through the same authentication, origin checks and encrypted transport when herdr is offline or unsupported. It cannot bypass a revoked device grant.
- The encrypted transport floor is 2. There is no insecure relay fallback. Supporting infrastructure must be deployed before clients need a new transport.
- herdr is accepted by protocol, not version: any herdr on protocol 22 or newer
is used (
herdrCompatibility), and the update manager chooses releases by the same rule (supportsHerdr). Until 0.3.30 both matched exact versions, and herdr 0.9.4 and 0.9.5, on the same protocol, were refused on every computer that installed them (October 2026). A newer protocol is tried; only a session the adapter cannot read asks for a Shahi update. An older protocol leaves recovery and pairing available, but refuses commands. HERDR_SUPPORTandrelease.jsonlist the versions a release was tested with, each with a pinned live job in CI. Add herdr's current stable to both before every computer release: managers up to 0.3.29 install only a release that names the computer's exact herdr.
shared/src/compatibility.ts defines app support. The adapter profiles live in
server/lib/backend.ts; release requirements live in
plugin/releases/release.json. CI checks their agreement and exercises the pinned
pre-managed service (3cd378c555e4119c450b09f83e01956678d75ac8) and the packaged
current service using an isolated recording socket. No real agent is used by
the upgrade suite. The independent live-herdr matrix uses a named test session.
Releases are made only when the owner asks to tag one (October 2026); pushing
to master publishes nothing and starts no CI.
gh workflow run release.yml --ref master -f channel=beta|stable publishes the
version on master's HEAD after the releases environment approves it. A Stable
release first runs the whole of CI on that commit; a Beta release only builds
the package and runs its tests and upgrade smoke checks (owner's policy,
October 2026). Promoting a Beta version to Stable rebuilds a candidate under
full CI and publishes the immutable bytes approved by the signed Beta catalog.
published.ts verifies the published archive's own digest/size and signed
manifest approval; it does not compare the rebuilt archive's contents. Before
environment approval, compare the approved Beta and exact-source CI candidates'
release contracts, complete extracted paths and file contents. Compressed hashes
alone cannot establish equality because TAR metadata changes between builds.
Any runtime or compatibility change after Beta requires a new release version.
Before an App Store production submission, run gh workflow run ci.yml --ref master on the exact commit of the build and submit only when it is green.
The plugin selects the signed Stable catalog on first install. Reinstallation restarts the supervisor and requests the latest compatible approved release. Running code comes from the verified package, never the mutable plugin checkout. The package contains the service, manager and computer-hosted web app. Its manifest pins the source commit, build identifier, archive digest and size, supported platforms, Bun minimum, herdr profiles, API range, encrypted transport, recovery and manager contracts, and data format. EAS separately records immutable native builds and update groups; they are compatible by API and native runtime rather than having to share the computer's release number.
On 24 September 2026 the repository's history was rewritten to remove private
screenshots and identifiers, which changed every commit hash. Releases 0.3.0 to
0.3.6 keep the old hash in their build identifier and in their signed manifest's
source commit (0.3.6-fa24618fde1f, for example); their packages, signatures
and digests are unchanged and still verify, since nothing checks that commit
against the repository. Each release's tag now points at the rewritten commit,
whose files are identical to the ones that were built.
Stable and Beta catalogs are signed with Ed25519. Public keys are pinned in
plugin/releases/trust.ts; private keys belong outside the repository and in
the GitHub releases environment. Channel catalogs are the only mutable release
assets (shahi-stable/catalog.json, shahi-beta/catalog.json). Versioned service
assets are never overwritten. Catalogs expire after 120 days. Network errors,
expiry or invalid signatures leave the running release alone and explain why
update checking failed. Per-channel sequence numbers prevent replay after a
newer catalog has been seen.
Renewal re-signs the same approved releases with a later expiry and a higher sequence, and needs no version bump or test run:
bun plugin/releases/sign.ts renew stable|beta <key.pem> <out.json> <previous.json> [--retire v1,v2]
bun plugin/releases/sign.ts due stable|beta <catalog.json> <days> # prints true when it expires within <days>.github/workflows/catalog-expiry.yml runs it every Monday at 05:23 UTC for
any channel with fewer than 30 days left, and files a "Release catalog renewal
failed" issue when it cannot. Dispatch it by hand to renew now, or to withdraw
versions with retire (each must be in every channel chosen), which re-signs
at once. GitHub pauses scheduled workflows after 60 days without repository
activity, so keep it enabled. Nothing watched the date before the
pre-public-release review, and the first catalogs would have lapsed on
2027-01-18, stopping every fresh install in bootstrap.
Signing keeps every release some computer could still select and drops entries
a newer release supersedes: same data schema, all of its platforms and herdr
profiles, no newer bun required and no higher api.min. --retire withdraws a
version explicitly. More than 50 selectable releases fails signing with its own
message rather than producing a catalog every computer would refuse.
The messages a computer shows for a bad catalog name the problem: "Release catalog is invalid.", "Release catalog is older than one this computer already accepted.", "Release catalog is dated in the future. Check this computer's clock.", "Shahi's signed release catalog expired on and has to be renewed by Shahi. An installed release keeps running.", and "Release catalog lists N releases, more than the 50 a computer accepts." A release that does not fit the machine is refused with a reason naming the platform, bun or herdr versions on both sides.
To release: bump plugin/releases/release.json, herdr-plugin.toml and
server/package.json to the same version and write
plugin/releases/notes/<version>.md with user-facing changes under ### headings
(the workflow publishes it, and a test requires it). A test enforces version
agreement; /api/meta's
serverVersion and shahi.status report it. Run local type and canonical unit
checks, commit directly to master under the owner's current policy, then run
Approve Shahi release there. Stable runs its required release matrix.
The release environment permits only the master branch; signing jobs also
check that ref. Third-party build actions are pinned to full commit hashes, and
every checkout in every workflow sets persist-credentials: false. Publish to
Beta first, which stays a GitHub prerelease. After observing successful
upgrades and reconnects, promote the same immutable package to Stable (commits that
landed on master after the Beta don't block it: the run signs the published
bytes Beta approved, never a rebuild); a Stable
approval also marks the GitHub release Latest (--prerelease=false --latest).
Stable approvals before that change left GitHub's Latest on v0.3.1; the next
one corrects it, or gh release edit <tag> --latest does by hand. Never
replace an existing version with a rebuilt archive.
The OS supervises a small manager in the plugin's state directory. It owns the
active release pointer and a durable activation journal. The server can request
only check or install, optionally selecting Stable or Beta; it cannot provide
a download URL or shell command. A signed catalog chooses the target.
Unknown request fields are rejected, and device authorization is checked again
after the request body arrives, immediately before publishing the update action.
The manager downloads with a byte limit, verifies the complete archive, checks every path, stages it separately, and then restarts the service. Readiness checks the running build, authenticated recovery, web assets, preserved server identity, and the backend snapshot when supported herdr is available. Offline herdr still permits recovery-only readiness. Pairing secrets and databases stay outside release directories. A failed activation restores the previous release; an interrupted activation resumes from its journal at the next manager start. An approved manager update is installed atomically after service readiness and the OS restarts it; the status stays "restarting" until the new manager's service is ready, because the one the old manager started stops with it. The same cleanup follows an activation finished at the next manager start, so a stopped manager cannot leave the old manager or a failed release behind, and a rollback restores the release that was previous before the update. Only the active and immediately previous artifacts are kept. A service that exits by itself is started again after 3 s, doubling to five minutes while it keeps failing, and the status says why in the meantime.
Data schema 1 currently permits same-format rollback. Different schemas are refused until a separately tested migration and recovery path is introduced. Rollback never copies an old database over newly created pairings or messages. herdr itself is never updated or restarted by this manager: doing so may disrupt running sessions. The app explicitly directs that separate update when needed.
Phones installed before recovery protocol 1 require one bootstrap reinstall of the computer plugin. This cannot be done remotely through an endpoint that those older services never shipped. Existing pairing is preserved through that install.
The phone uses Expo runtime fingerprints and a pinned RSA signing certificate.
Compatible JavaScript fixes can ship to 10%, then 25%, 50% and 100% of a channel.
Native changes require a new binary and a matching fingerprint. Updates apply
on the next launch; never reload someone in the middle of composing a message.
Use EAS update:edit to expand a rollout and update:revert-update-rollout to
stop a bad one. Certificate rotation requires a new trusted binary.
The Signed Shahi phone update workflow requires protected Expo authentication, the private
signing key, and Expo Production or Enterprise. The account is on Free, and
EAS refuses a signed publish there only at its last step, after CI and the
release approval: "EAS Update code signing requires a subscription to the EAS
Production or Enterprise plan" (the workflow's first run, 13 October 2026).
Until that account change, a JavaScript fix reaches phones only in a new binary.
While it holds the key, the workflow runs eas-cli 23.2.0 from
.github/eas/bun.lock, a lockfile frozen with integrity hashes and installed
in $RUNNER_TEMP, and unsets the key from the environment once it has written
it to a 0600 file, so the build eas-cli spawns does not inherit it. The lockfile
is not a workspace dependency: in the app's tree eas-cli's older
@expo/config would be hoisted over SDK 57's and change what the phone is
built from, and inside the checkout Metro would crawl it. To move eas-cli, edit
.github/eas/package.json and regenerate its lockfile with the CI bun (1.3.13)
in a directory outside the checkout, or merge the Dependabot pull request for
/.github/eas.
The certificate is configured in new binaries; unsigned OTA is never accepted.
The App Store and signed-update workflows use the protected EXPO_EAS_SESSION
credential and create a private, temporary runner session. Cleanup removes
only the session that the job created; an existing session is never replaced.
The production App Store workflow accepts only a manual CI run on its exact
master commit and waits for success before uploading the finished archive.
See Expo runtime versions,
code signing and
rollouts.
The hosted web build deploys after supporting computer changes. Clients keep their saved computers during update/reconnect and can switch to another live computer. An absent capability disables its optional control, rather than forcing an unrelated component update. In Settings, users choose a channel or check for an update; the main screen shows update availability and recovery progress.
The official macOS arm64 binary was checked against the release asset’s SHA-256
digest and exercised in an isolated named session. The live adapter suite passed
21 checks; the optional test that starts a paid AI agent was not run. An initial
shell-submit timeout passed on rerun with the same binary and configuration.
Protocol 22 is unchanged. The schema adds only pane.link.resolve and its
response; existing calls retain their shapes. Generated types include the new
schema. CI pins both 0.9.0 and 0.9.1, by tag and by the SHA-256 digest of
their herdr-linux-x86_64 asset, and also tests the current stable release,
checked against herdr.dev/latest.json and GitHub's digest.
These source changes need a new approved Shahi service release before managed installations accept herdr 0.9.1. Publishing the landing page alone does not update the computer service.
The stable CI job caught the new 0.9.3 release: its protocol still matched, but the adapter correctly refused an unapproved version. Both official Linux x86-64 binaries were checked against GitHub's asset digest and herdr's release manifest, then run in separate named sessions with fresh configuration roots on the preserved Ubuntu x86-64 QA machine. Each passed 23 live adapter checks; the two skips were the optional paid-agent check and the preview-only check. No user session or managed herdr installation was updated.
The two release schemas are identical and retain protocol 22. New fields are
optional; the removed pane.graphics API has no Shahi callers. Generated types
now reflect this schema. CI retains 0.9.0 and 0.9.1 and permanently pins 0.9.2
and 0.9.3 as well as following stable. Its policy test requires a pinned job for
every approved release profile. A new approved computer release is still needed
before installed services accept these versions; a phone update alone cannot
change the computer adapter.