# zera1 CoilShift patches

Personal CoilShift SDK packages, distributed as an external repository.

## Add to CoilShift

Open **Repositories → Add repository** and enter this repository base URL:

```text
https://raw.githubusercontent.com/zera1/coilshift-patches/main/
```

CoilShift fetches `index.json` from that base. This is a package feed, not a
Git clone URL. Registration is separate from selecting and installing packages.

## Packages

- [`cloud.zera.konik`](packages/konik/README.md): an offline chess-knight
  proof-of-concept card inside CoilShift. Panel only: no icon, vehicle access,
  background services, network connections or UI restart.
- [`cloud.zera.zen-updater-off`](packages/zen-updater-off/README.md): inhibits
  Zen's normal service startup and stops it only when idle. It does not erase
  update files or modify firmware banks.
- [`cloud.zera.plaid-software-badge`](packages/plaid-software-badge/README.md):
  selects the native Plaid animation in the compatible Model S Software-page
  badge. Cosmetic only; reviewed against 2026.38.5.1 and user-confirmed working.

Adding the repository alone installs nothing. Select and confirm each package
separately in CoilShift.

### Current live verification

On 2026-11-03, SSP client `2611033c83b2ba` delivered both external packages.
Plaid reports `ok` and the user confirmed its animation works. Zen 0.1.0 reports
a failed apply hook: its guard was extracted onto `/var`, which is `noexec`,
and failed Bash's executable check. Its installed source hashes matched the
repository. The diagnostic reproduced the preflight failure without binding
anything or stopping Zen; Zen remained running.

Zen 0.1.1 fixes that source/executable-location mismatch with immutable runtime
staging and retains the idle, ownership and rollback checks. Forty behavior
tests passed. Live staging, the SDK bind, repeat apply, restoration of the
original service without starting Zen, and reapplication were verified on the
parked car. Reboot delivery remains a separate check. An external row saying
`installed` is only selection metadata; check `car_state`, the hook receipt and
the actual guard.
The older delivery symptom below is no longer the current Zen blocker.

### Earlier delivery investigation (superseded)

On 2026-11-03, the car running SSP client release `2611039ca8b4d1` accepted this
repository and the Zen package install request, but no successful package
staging or execution was observed. The private server revision was not verified.
The repository UI said `installed` while the package directory and execution
receipt were absent. Normal Apply answered `already applied`; the feature
preferences endpoint refused the package ID as `unknown patch ID` (HTTP 409).
No startup guard was mounted, and the updater was not started for a test.

The exact published archive passes the external-index validator and resolves to
one package role and one executable apply step in the public SDK. This points
to a gap after public package compilation, in the private selection/catalog/
delivery path; the exact private condition is not yet known. The live failure
is not proof that the hook itself failed: no execution receipt was observed.

Off-car validation: 28 behavior tests passed, including interrupted-install
recovery, version upgrades, refusal during an active/unknown update, and
reversible removal without requesting an updater start. Live startup blocking
and SDK removal are **not yet verified**. Do not rely on this package for
protection until that integration test succeeds.

The failed test selection was removed through the normal uninstall endpoint;
the repository remains registered. Zen stayed stopped throughout, and both its
original executable and service-script hashes remained unchanged. The client
subsequently showed a generic `rejected` state while Apply still answered
`already applied`; that outstanding SSP status also needs investigation. No
private runtime state was deleted or reset to conceal the failure.

## Build and test

Run the off-car tests from this repository:

```sh
python3 tests/test_zen_updater_off.py
```

Optional kernel-mount checks on a disposable Linux development host:

```sh
ZEN_RUN_LINUX_NOEXEC=1 python3 tests/test_zen_updater_off_linux.py
```

This uses private user/mount namespaces; unavailable environments report SKIP.

The [Plaid badge verifier](packages/plaid-software-badge/README.md#off-car-verification)
also checks external SDK expansion and, with private firmware fixtures, the
exact constructor-local changes and refusal cases. Firmware fixtures stay
outside this repository.

Build using a compatible `cs-ssp-policies` SDK checkout (initially validated
against commit `2177d9d9163d8133df320542372cdfe2a121855d`):

```sh
cd /path/to/cs-ssp-policies
go run /path/to/coilshift-patches/tools/build-package.go \
  /path/to/coilshift-patches \
  /path/to/coilshift-patches/packages/zen-updater-off
```

This builds the immutable pool artifact and updates the local external index;
it does not push or install anything. Existing package versions cannot be
replaced with different bytes. The publisher preserves validated, unversioned
package-ID dependencies in the index. It refuses conflicts, version ranges,
legacy recipe IDs and inconsistent dependency metadata for an existing version.

## Remote configuration guard: live verification, 2026-11-04

[`cloud.zera.remote-config-guard`](packages/remote-config-guard/README.md)
**0.1.1** was installed through the native CoilShift repository interface on the
parked Model S running MCU **2026.38.5.1**, with FSD off and no update installing.
The owner explicitly authorized the normal supervised Odin stop. No forced kill,
configuration-setting request, entitlement change, firmware-bank operation or
cache deletion was used.

| Check | Observed result |
|---|---|
| Normal SSP activation | Package downloaded, early preflight ran, UI restarted, SSP returned idle with no current error |
| Actual gateway guard | New QtCarServer process; entire guarded handler verified in the active file **and process memory**; full file SHA256 `f5bd977fab6870228928e5c95b1708784d90fd1d580ccc8872241f08634ac9eb` |
| Odin | Engine remained down; SDK-owned replacement run file passed its executable self-check |
| APE service paths | Read-only probes to both `.103` and `.105` on 8901/8081 timed out; each destination's matching DROP rule counted four packets / 240 bytes during the probes |
| Reverse-relay paths | Exact four-rule OUTPUT chain and first-position jump verified; synthetic source-port coverage was tested in an isolated MCU network namespace, not by generating a cloud command |
| Existing privacy | Both reviewed MCU stubs and full-APE INPUT/FORWARD rules verified; not inferred from selection labels |
| Local tests | 85 firmware/SDK/catalog checks, 51 lifecycle tests, 37 publisher tests and six worker tests passed |

The immutable archive is
`d0c0015540a40973c997d871585a887bd69eb6db02c7f247a6cd6302f28dce61`.
Version 0.1.0 was rejected before activation because early hooks cannot depend
on late privacy steps. Full catalog tests also exposed an external multi-hook
anchor restriction. Version 0.1.1 preserves early preflight and uses a declared
SDK worker that waits for the real guarded process. Privacy package selection
requirements are in the strict sibling `packages/remote-config-guard.index.json`
publisher metadata, without copying invalid cross-phase edges into the early hook.

These are **point-in-time observations for enumerated MCU IPv4 paths**, not a
universal configuration lock, cold-boot gate proof, continuous health monitor or
claim that every app/navigation/certificate workflow is unaffected. The gateway
setter itself was not invoked as a live probe. Future gate integration and
installed-APE/internal-ECU coverage remain separate work.

## Package publishing

- Use the `cloud.zera.*` namespace, not the reserved `dev.coilshift.*` namespace.
- Validate manifests, archives and the external index with the CoilShift SDK
  before publishing.
- Keep source under `packages/<name>/`; publish archives and separate payloads
  at `pool/<sha256>` and describe them in the root `index.json`.
- Publish payloads before making their index entries available, and never
  replace the bytes at an existing content-hash path.
- Do not commit vehicle identifiers, credentials, private keys, logs, firmware
  images or third-party code without permission to redistribute it.

Packages can execute as root on the car. Review each package before installing
it; repository registration is not proof that a package is safe or compatible.
