diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4570d6e..bc2c16d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: workflow_dispatch: inputs: tag: - description: Version tag to publish (e.g. v0.1.0-alpha.0) + description: Version tag to publish (e.g. v0.2.0) required: true type: string @@ -42,7 +42,7 @@ jobs: - name: Verify package versions match tag run: | EXPECTED="${TAG#v}" - for pkg in packages/protocol/package.json packages/ota-nativescript/package.json packages/ota-cli/package.json; do + for pkg in packages/otto-protocol/package.json packages/otto-nativescript/package.json packages/otto-cli/package.json packages/otto-docs/package.json; do ACTUAL="$(node -p "require('./$pkg').version")" if [ "$ACTUAL" != "$EXPECTED" ]; then echo "Version mismatch in $pkg: expected $EXPECTED, got $ACTUAL" @@ -62,7 +62,7 @@ jobs: *-rc.*) CHANNEL="rc" ;; esac - for ws in @getcortexlabs/ota-protocol @getcortexlabs/ota-nativescript @getcortexlabs/ota-cli; do + for ws in @getcortexlabs/otto-protocol @getcortexlabs/otto-nativescript @getcortexlabs/otto-cli @getcortexlabs/otto-docs; do if npm view "${ws}@${EXPECTED}" version >/dev/null 2>&1; then echo "Skipping ${ws}@${EXPECTED} (already published)" else @@ -78,3 +78,11 @@ jobs: fi fi done + + - name: Point previous package names to Otto + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + npm deprecate @getcortexlabs/ota-protocol "Renamed to @getcortexlabs/otto-protocol. See https://github.com/getcortexlabs/otto-sdk/blob/main/MIGRATING.md" + npm deprecate @getcortexlabs/ota-nativescript "Renamed to @getcortexlabs/otto-nativescript. See https://github.com/getcortexlabs/otto-sdk/blob/main/MIGRATING.md" + npm deprecate @getcortexlabs/ota-cli "Renamed to @getcortexlabs/otto-cli; the command is now otto. See https://github.com/getcortexlabs/otto-sdk/blob/main/MIGRATING.md" diff --git a/.gitignore b/.gitignore index 029d1aa..6dab915 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ coverage/ *.tsbuildinfo # NativeScript build artifacts -packages/ota-nativescript/platforms/android/ota_nativescript.aar +packages/otto-nativescript/platforms/android/ota_nativescript.aar fixtures/*/node_modules/ fixtures/*/package-lock.json fixtures/*/platforms/ diff --git a/.prettierignore b/.prettierignore index 2bc591e..02ef445 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,6 +2,6 @@ dist/ coverage/ package-lock.json fixtures/ -packages/ota-nativescript/platforms/ +packages/otto-nativescript/platforms/ docs/.vitepress/cache/ docs/.vitepress/dist/ diff --git a/MIGRATING.md b/MIGRATING.md new file mode 100644 index 0000000..06fa384 --- /dev/null +++ b/MIGRATING.md @@ -0,0 +1,22 @@ +# Moving to Otto 0.2 + +The public project is now [Otto SDK](https://github.com/getcortexlabs/otto-sdk). The hosted console and documentation are at [otto.getcortexlabs.com](https://otto.getcortexlabs.com). + +| Previous name | Otto 0.2 | +| -------------------------------------------- | ---------------------------------------------- | +| `@getcortexlabs/ota-nativescript` | `@getcortexlabs/otto-nativescript` | +| `@getcortexlabs/ota-cli` | `@getcortexlabs/otto-cli` | +| `@getcortexlabs/ota-protocol` | `@getcortexlabs/otto-protocol` | +| `ota-ns` | `otto` | +| `ota.config.json` | `otto.config.json` | +| `createOtaUpdates` | `createOttoUpdates` | +| `Ota*` public types and `OTA_ERROR_CODES` | `Otto*` public types and `OTTO_ERROR_CODES` | +| `packOtaBundle`, `validateEmbeddedOtaConfig` | `packOttoBundle`, `validateEmbeddedOttoConfig` | + +Remove the old packages before installing their replacements. Update imports, CI commands and the project configuration filename. Remove the generated `hooks/after-prepare/ota-nativescript-config.mjs` shim if it remains after uninstall, then install the new SDK's hook with `node node_modules/@getcortexlabs/otto-nativescript/hooks/postinstall.mjs .`. Its generated shim is `otto-nativescript-config.mjs`. + +Rebuild the native application and generate a fresh per-platform fingerprint baseline before publishing new updates. The package identity participates in the runtime fingerprint, so a package rename is not a JavaScript-only update for an already installed binary. Existing signing keys and Otto workspaces can be reused. + +Protocol version 1, its signature domains, error-code values, native bridge identifiers and on-device state layout are unchanged. Existing signed manifests and server directives remain cryptographically valid. Older published packages remain available with deprecation notices pointing to Otto. + +Documentation is maintained only in this public repository. `@getcortexlabs/otto-docs` contains the built `/docs/` site and records its source commit in `build-info.json`. The private service pins an exact version; it has no separately maintained documentation source tree. diff --git a/README.md b/README.md index 375dbf3..a163fa9 100644 --- a/README.md +++ b/README.md @@ -1,24 +1,24 @@

- ota-nativescript + Otto

-

ota-nativescript

+

Otto SDK

Signed over-the-air updates for NativeScript: native boot selection, runtime compatibility checks and offline crash rollback.

- CI - MIT license + CI + MIT license

- Documentation · Roadmap (#1) · Support matrix · Milestones + Documentation · Roadmap (#1) · Support matrix · Milestones

```ts -import { updates } from '@getcortexlabs/ota-nativescript'; +import { updates } from '@getcortexlabs/otto-nativescript'; // Call once the first usable screen has mounted (never gate on network reachability). export function onAppUsable() { @@ -36,11 +36,11 @@ Shipping JavaScript over the air in NativeScript breaks in three specific ways w 2. **Asset paths and runtime extraction collide.** On Android, `@nativescript/core`'s `knownFolders.currentApp()` resolves to `files/app`, while `RuntimeHelper` wipes `files/app` when the APK changes. Overwriting `files/app` in place destroys the embedded fallback; loading JS from another folder without aligning `files/app` serves stale `~/...` assets alongside new code. 3. **"I only edited TypeScript" is not a compatibility guarantee.** NativeScript generates platform metadata and native bindings during the binary build. A new JS bundle that calls a native API or registers a native subclass absent from the installed binary fails at runtime. -`ota-nativescript` addresses those directly. Minimal native bootstrappers on iOS and Android select the active bundle before V8 starts, without forking `@nativescript/ios` or `@nativescript/android` and without hand-editing generated `platforms/` folders. Bundles are staged atomically as complete, Ed25519-signed packages verified against a per-platform runtime contract, activated on the next full process launch, and rolled back offline if startup fails before `markReady()`. +Otto addresses those directly. Minimal native bootstrappers on iOS and Android select the active bundle before V8 starts, without forking `@nativescript/ios` or `@nativescript/android` and without hand-editing generated `platforms/` folders. Bundles are staged atomically as complete, Ed25519-signed packages verified against a per-platform runtime contract, activated on the next full process launch, and rolled back offline if startup fails before `markReady()`. The SDK stays independent of any specific UI library or hosting backend. It speaks a server-agnostic HTTP contract tested locally via a fixture server; [Otto](https://otto.getcortexlabs.com) provides the hosted console, app-scoped publishing, channels and delivery telemetry. The SDK also works with self-hosted Otto or any compatible server. -**Current status (M0–M3 + `#15`, `#16`, `#17` verified).** All v0.1 milestones plus NativeScript 9.1 `@nativescript/vite` production support ([#15](https://github.com/getcortexlabs/ota-nativescript/issues/15)), Android V8 snapshot compatibility rules & `codeCache` verification ([#16](https://github.com/getcortexlabs/ota-nativescript/issues/16)), and content-addressed file reuse across releases ([#17](https://github.com/getcortexlabs/ota-nativescript/issues/17)) are delivered and verified 8/8 on both **Webpack 5** (`fixtures/vue-mavis-app`, NativeScript-Vue 3 + Mavis + Jolt) and **Vite 8 / Rolldown** (`fixtures/vite-app`, native ESM + `require(esm)` + `ns:util` + Web Worker) running on iOS 26.2 Simulator (`@nativescript/ios` `9.1.1`) and a physical Xiaomi `M2103K19PG` Android 16 / API 36 device (`@nativescript/android` `9.1.3`, signed R8 `minifyEnabled true` APK). Full operational docs and interactive Jolt Web labs live at [otto.getcortexlabs.com/docs](https://otto.getcortexlabs.com/docs/guide/). Follow roadmap & ecosystem integrations in [#1](https://github.com/getcortexlabs/ota-nativescript/issues/1). +**Current status (M0–M3 + `#15`, `#16`, `#17` verified).** All v0.1 milestones plus NativeScript 9.1 `@nativescript/vite` production support ([#15](https://github.com/getcortexlabs/otto-sdk/issues/15)), Android V8 snapshot compatibility rules & `codeCache` verification ([#16](https://github.com/getcortexlabs/otto-sdk/issues/16)), and content-addressed file reuse across releases ([#17](https://github.com/getcortexlabs/otto-sdk/issues/17)) are delivered and verified 8/8 on both **Webpack 5** (`fixtures/vue-mavis-app`, NativeScript-Vue 3 + Mavis + Jolt) and **Vite 8 / Rolldown** (`fixtures/vite-app`, native ESM + `require(esm)` + `ns:util` + Web Worker) running on iOS 26.2 Simulator (`@nativescript/ios` `9.1.1`) and a physical Xiaomi `M2103K19PG` Android 16 / API 36 device (`@nativescript/android` `9.1.3`, signed R8 `minifyEnabled true` APK). Full operational docs and interactive Jolt Web labs live at [otto.getcortexlabs.com/docs](https://otto.getcortexlabs.com/docs/guide/). Follow roadmap & ecosystem integrations in [#1](https://github.com/getcortexlabs/otto-sdk/issues/1). ## How it works @@ -80,7 +80,7 @@ Calling `markReady()` after the first usable screen mounts promotes a pending ca ### Three-part verification -Before a downloaded bundle can be staged ([#7](https://github.com/getcortexlabs/ota-nativescript/issues/7)), the client checks three separate properties: +Before a downloaded bundle can be staged ([#7](https://github.com/getcortexlabs/otto-sdk/issues/7)), the client checks three separate properties: 1. **Integrity:** every file in the manifest inventory is present, matches its exact byte size and SHA-256 digest, and contains no path traversal, symlinks or extra files. 2. **Authenticity:** the canonical manifest and server directive signatures verify under Ed25519 against public keys embedded in the binary (indexed by `keyId` for key rotation). Private keys never enter the app. @@ -88,13 +88,13 @@ Before a downloaded bundle can be staged ([#7](https://github.com/getcortexlabs/ ## Protocol -The wire protocol in [`packages/protocol`](./packages/protocol) separates three concepts: +The wire protocol in [`packages/otto-protocol`](./packages/otto-protocol) separates three concepts: - **Release manifest** — an immutable, signed description of every file in a bundle (`protocolVersion`, `appId`, `platform`, `targetBuild`, `runtimeContract`, `releaseId`, `entry`, `createdAt`, `files`). - **Update directive** — a signed server decision (`update` or `rollback_to_embedded`) carrying a monotonic `directiveSeq`. Rolling back from `ota-105` (`directiveSeq: 12`) to `ota-104` issues a newer directive (`directiveSeq: 13`) pointing at `ota-104`, so rollbacks never require accepting replayed directives. - **Local activation** — the on-device `BootState` persisted in `state.json`. -Signatures cover domain-separated canonical JSON (`ota-nativescript:manifest:v1\n` and `ota-nativescript:directive:v1\n`) with RFC 8785 lexicographical key sorting. Cross-platform golden Ed25519 vectors live in [`packages/protocol/test/vectors.json`](./packages/protocol/test/vectors.json). +Signatures cover domain-separated canonical JSON (`ota-nativescript:manifest:v1\n` and `ota-nativescript:directive:v1\n`) with RFC 8785 lexicographical key sorting. Cross-platform golden Ed25519 vectors live in [`packages/otto-protocol/test/vectors.json`](./packages/otto-protocol/test/vectors.json). ```ts import { @@ -103,7 +103,7 @@ import { encodeManifestSigningPayload, validateSignedDirective, validateSignedManifest, -} from '@getcortexlabs/ota-protocol'; +} from '@getcortexlabs/otto-protocol'; const { directive } = validateSignedDirective(rawDirective); assertDirectiveFreshness(directive, lastAppliedSeq); @@ -123,63 +123,67 @@ assertManifestCompatible(manifest, { Technical eligibility is separate from App Store and Google Play review rules. Interpreted JavaScript and updatable assets stay within the capabilities already compiled into the installed binary; native changes go through normal store releases. -| Change | OTA eligible? | -| -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -| Bug fixes in TypeScript/JavaScript logic or state handling | Yes, if compatible with existing native metadata and bindings | -| Layout, style, copy and updatable asset changes (`~/...`) | Yes | -| Adding or updating a native iOS/Android SDK, Pod, Gradle dependency or permission | No — requires a new store binary | -| Upgrading `@nativescript/ios`, `@nativescript/android` or native bootstrapper code | No — requires a new store binary | -| Calling a native API or registering a native subclass missing from build-time metadata | No — requires a new store binary (checked by `ota-ns fingerprint` / `pack`, [#11](https://github.com/getcortexlabs/ota-nativescript/issues/11)) | +| Change | OTA eligible? | +| -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| Bug fixes in TypeScript/JavaScript logic or state handling | Yes, if compatible with existing native metadata and bindings | +| Layout, style, copy and updatable asset changes (`~/...`) | Yes | +| Adding or updating a native iOS/Android SDK, Pod, Gradle dependency or permission | No — requires a new store binary | +| Upgrading `@nativescript/ios`, `@nativescript/android` or native bootstrapper code | No — requires a new store binary | +| Calling a native API or registering a native subclass missing from build-time metadata | No — requires a new store binary (checked by `otto fingerprint` / `pack`, [#11](https://github.com/getcortexlabs/otto-sdk/issues/11)) | -## CLI workflow (`@getcortexlabs/ota-cli`) +## CLI workflow (`@getcortexlabs/otto-cli`) -`@getcortexlabs/ota-cli` ships the `ota-ns` binary for key management, per-platform runtime compatibility fingerprinting, release packaging, offline verification and local fault-injection testing: +`@getcortexlabs/otto-cli` ships the `otto` binary for key management, per-platform runtime compatibility fingerprinting, release packaging, offline verification and local fault-injection testing: ```sh # 1. Generate an Ed25519 signing keypair outside the app source tree -ota-ns keygen --key-id prod-2026 --out-dir ~/.ota-keys +otto keygen --key-id prod-2026 --out-dir ~/.otto-keys # 2. Record a store-binary compatibility baseline after building a release binary -ota-ns fingerprint --platform ios --project . \ - --write-baseline ./ota.baseline.ios.json --write-config +otto fingerprint --platform ios --project . \ + --write-baseline ./otto.baseline.ios.json --write-config # 3. Pack and sign a prepared Webpack 5 bundle (refuses automatically if native drift is detected) -ota-ns pack --platform ios --project . --baseline ./ota.baseline.ios.json \ - --release-id ota-105 --private-key ~/.ota-keys/prod-2026.private.pem \ - --key-id prod-2026 --out ./dist-ota/ota-105 +otto pack --platform ios --project . --baseline ./otto.baseline.ios.json \ + --release-id ota-105 --private-key ~/.otto-keys/prod-2026.private.pem \ + --key-id prod-2026 --out ./dist-otto/ota-105 # 4. Verify signature, inventory hashes and baseline compatibility offline in CI -ota-ns verify --bundle ./dist-ota/ota-105 --config ./ota.config.json \ - --baseline ./ota.baseline.ios.json +otto verify --bundle ./dist-otto/ota-105 --config ./otto.config.json \ + --baseline ./otto.baseline.ios.json # 5. Serve locally for device/simulator testing (supports fault modes via --mode) -ota-ns serve --bundle ./dist-ota/ota-105 \ - --private-key ~/.ota-keys/prod-2026.private.pem --key-id prod-2026 --port 18787 +otto serve --bundle ./dist-otto/ota-105 \ + --private-key ~/.otto-keys/prod-2026.private.pem --key-id prod-2026 --port 18787 ``` -`ota-ns fingerprint` hashes five separate sections per platform: NativeScript runtime + native OTA bootstrapper code, resolved native plugins, normalized `App_Resources` config/permissions, generated platform metadata (`metadata-*.bin` on iOS, `assets/metadata/*.dat` on Android) and normalized static bindings (`sbg-bindings.txt` on Android plus JS-to-native class/protocol registrations). Pure JavaScript, CSS and asset edits keep the contract unchanged; adding a native plugin, permission, runtime bump or new native subclass exits with code `2` and prints the exact section diff. +`otto fingerprint` hashes five separate sections per platform: NativeScript runtime + native OTA bootstrapper code, resolved native plugins, normalized `App_Resources` config/permissions, generated platform metadata (`metadata-*.bin` on iOS, `assets/metadata/*.dat` on Android) and normalized static bindings (`sbg-bindings.txt` on Android plus JS-to-native class/protocol registrations). Pure JavaScript, CSS and asset edits keep the contract unchanged; adding a native plugin, permission, runtime bump or new native subclass exits with code `2` and prints the exact section diff. ## Packages -| Package | Role | Status | -| ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| [`@getcortexlabs/ota-protocol`](./packages/protocol) | Schemas, JCS canonical serialization, path safety, validators, `BootState`, lifecycle events and error codes | Delivered (M0, [#3](https://github.com/getcortexlabs/ota-nativescript/issues/3)) | -| [`@getcortexlabs/ota-nativescript`](./packages/ota-nativescript) | Native iOS/Android boot selectors, `CryptoKit` / Tink Ed25519 + SHA-256 verification, streaming downloader with content-addressed local reuse (#17), atomic staging + GC, `updates` SDK API and `after-prepare` config hook | Delivered (M0–M1 + #15–#17) | -| [`@getcortexlabs/ota-cli`](./packages/ota-cli) | `keygen`, per-platform `fingerprint` (incl. Android V8 snapshot/codeCache checks), Webpack 5 & Vite `pack`, offline `verify` and local fixture `serve` with 9 fault modes | Delivered (M2 + #15–#16) | -| [`fixtures/vue-mavis-app`](./fixtures/vue-mavis-app) | Reference Webpack 5 NativeScript-Vue 3 + Mavis + Jolt release app proving all 8 OTA scenarios | Passing 8/8 on iOS 26.2 & physical Android 16 R8 | -| [`fixtures/vite-app`](./fixtures/vite-app) | Reference `@nativescript/vite` 8.0.24 production ESM app proving all 8 OTA scenarios (`import(...)`, `require(esm)`, `ns:util`, Web Worker, Android `codeCache: true`, >99% asset reuse) | Passing 8/8 on iOS 26.2 & physical Android 16 R8 | -| [`fixtures/boot-spike`](./fixtures/boot-spike) | Minimal NativeScript 9.1 Webpack 5 release boot spike | Passing on iOS 26.2 & Android 16 R8 | -| [`docs/`](./docs) | Bilingual (EN / `pt-BR`) VitePress + Jolt Web documentation with interactive lifecycle, security and recovery labs | Delivered (M3, [#14](https://github.com/getcortexlabs/ota-nativescript/issues/14)) | +| Package | Role | Status | +| ------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| [`@getcortexlabs/otto-protocol`](./packages/otto-protocol) | Schemas, JCS canonical serialization, path safety, validators, `BootState`, lifecycle events and error codes | Delivered (M0, [#3](https://github.com/getcortexlabs/otto-sdk/issues/3)) | +| [`@getcortexlabs/otto-nativescript`](./packages/otto-nativescript) | Native iOS/Android boot selectors, `CryptoKit` / Tink Ed25519 + SHA-256 verification, streaming downloader with content-addressed local reuse (#17), atomic staging + GC, `updates` SDK API and `after-prepare` config hook | Delivered (M0–M1 + #15–#17) | +| [`@getcortexlabs/otto-cli`](./packages/otto-cli) | `keygen`, per-platform `fingerprint` (incl. Android V8 snapshot/codeCache checks), Webpack 5 & Vite `pack`, offline `verify` and local fixture `serve` with 9 fault modes | Delivered (M2 + #15–#16) | +| [`fixtures/vue-mavis-app`](./fixtures/vue-mavis-app) | Reference Webpack 5 NativeScript-Vue 3 + Mavis + Jolt release app proving all 8 OTA scenarios | Passing 8/8 on iOS 26.2 & physical Android 16 R8 | +| [`fixtures/vite-app`](./fixtures/vite-app) | Reference `@nativescript/vite` 8.0.24 production ESM app proving all 8 OTA scenarios (`import(...)`, `require(esm)`, `ns:util`, Web Worker, Android `codeCache: true`, >99% asset reuse) | Passing 8/8 on iOS 26.2 & physical Android 16 R8 | +| [`fixtures/boot-spike`](./fixtures/boot-spike) | Minimal NativeScript 9.1 Webpack 5 release boot spike | Passing on iOS 26.2 & Android 16 R8 | +| [`docs/`](./docs) | Bilingual (EN / `pt-BR`) VitePress + Jolt Web documentation with interactive lifecycle, security and recovery labs | Delivered (M3, [#14](https://github.com/getcortexlabs/otto-sdk/issues/14)) | ## Platform support -`ota-nativescript` only claims support for runtime and bundler combinations verified on release builds. See [SUPPORT_MATRIX.md](./SUPPORT_MATRIX.md) for the exact pinned versions and verified native hook points. +`otto-nativescript` only claims support for runtime and bundler combinations verified on release builds. See [SUPPORT_MATRIX.md](./SUPPORT_MATRIX.md) for the exact pinned versions and verified native hook points. - **Verified release targets:** `@nativescript/core` 9.1.4, `@nativescript/ios` 9.1.1, `@nativescript/android` 9.1.3 (with `android.codeCache: true` and R8 `minifyEnabled true`), Webpack 5 (`@nativescript/webpack` 5.0.43) and Vite 8 (`@nativescript/vite` 8.0.24) production `.mjs` outputs. -- **Explicitly unsupported:** Legacy Android V8 heap snapshots (`libsnapshot.so` / `TNSSnapshot.blob`, removed in NativeScript 7 and rejected by `ota-ns pack` unless `--allow-snapshot` is passed), mid-session hot swaps without process restart, and automatic rollback of local SQLite schemas or persisted preferences. +- **Explicitly unsupported:** Legacy Android V8 heap snapshots (`libsnapshot.so` / `TNSSnapshot.blob`, removed in NativeScript 7 and rejected by `otto pack` unless `--allow-snapshot` is passed), mid-session hot swaps without process restart, and automatic rollback of local SQLite schemas or persisted preferences. ## Development +The public repository owns the SDK, CLI, protocol and documentation source. `npm run docs:build` also prepares `@getcortexlabs/otto-docs`, which is released at the same version as the libraries. The private Otto service pins that package and serves it at `https://otto.getcortexlabs.com/docs/`; changes here reach the site when it updates the package and redeploys. The generated `/docs/build-info.json` identifies the version and source commit. + +Version 0.2 adopts the Otto package names, the `otto` command and `otto.config.json`. See [MIGRATING.md](./MIGRATING.md) when moving an existing installation. + Requires Node.js >= 22. ```sh diff --git a/SUPPORT_MATRIX.md b/SUPPORT_MATRIX.md index d2d0018..3015784 100644 --- a/SUPPORT_MATRIX.md +++ b/SUPPORT_MATRIX.md @@ -1,6 +1,6 @@ # Support Matrix -`ota-nativescript` only claims support for runtime and bundler combinations that are verified on release builds. +`otto-nativescript` only claims support for runtime and bundler combinations that are verified on release builds. ## v0.1 target baseline @@ -11,23 +11,23 @@ | iOS Runtime | `@nativescript/ios` 9.1.1 (Xcode 27.2, iOS 26.2 Simulator release) | Proven 8/8 in #13 | | Android Runtime | `@nativescript/android` 9.1.3 (Physical Xiaomi `M2103K19PG`, Android 16 / API 36, R8 release) | Proven 8/8 in #13 | | Bundlers | Webpack 5 (`@nativescript/webpack` 5.0.43) and Vite (`@nativescript/vite` 8.0.24 / Vite 8.4.1 Rolldown native ESM) production `.mjs` output | Proven 8/8 on iOS & Android (#13, #15) | -| Android V8 caching | `android.codeCache: true` (isolated per-release `.cache` files via `files/app` symlink); legacy V8 heap snapshots (`libsnapshot.so`) blocked by `ota-ns pack` | Proven on physical Android 16 (#16) | +| Android V8 caching | `android.codeCache: true` (isolated per-release `.cache` files via `files/app` symlink); legacy V8 heap snapshots (`libsnapshot.so`) blocked by `otto pack` | Proven on physical Android 16 (#16) | | Asset deduplication | Content-addressed (`sha256` + `size`) local file reuse across releases (APFS CoW on iOS; byte copy on Android) with full inventory re-verification & HTTP fallback | Proven on iOS (99.45%) & Android (99.41%) (#17) | | Cryptography | Ed25519 + streaming SHA-256 (`CryptoKit` on iOS; Google Tink `1.15.0` on Android API 24+) | Proven against RFC 8032 vectors in #7 | | Activation model | Background streaming download with local reuse, verification, atomic staging, activation on next cold launch | Proven over HTTP in #8, #10, #13, #15, #17 | | Local recovery | Last confirmed OTA release and original embedded bundle, offline | Proven in #4, #5, #6, #13, #15 | | Store binary upgrades | Higher build code or changed runtime contract resets OTA baseline and cleans up prior releases | Proven in-place in #9, #13, #15 | | Compatibility gate | Per-platform runtime contract fingerprinting across runtime (incl. V8 snapshot/codeCache), plugins, config, metadata and SBG | Proven on iOS & Android builds in #11, #16 | -| Release CLI | `ota-ns` (`keygen`, `fingerprint`, `pack`, `verify`, `serve` with 9 fault-injection modes) | Proven end-to-end in #12, #13, #15, #16 | +| Release CLI | `otto` (`keygen`, `fingerprint`, `pack`, `verify`, `serve` with 9 fault-injection modes) | Proven end-to-end in #12, #13, #15, #16 | | Reference consumers | Webpack 5: `fixtures/vue-mavis-app` (Vue 3 + Mavis + Jolt); Vite 8: `fixtures/vite-app` (Vue 3 + ESM + `require(esm)` + `ns:util` + Worker) | Proven 8/8 on iOS & physical Android (#13, #15) | ## Native integration hooks verified in M0–M1 -- **iOS (`@nativescript/ios` 9.1.1):** Plugin sets `NS_SWIFTUI_BOOT = 1` in `platforms/ios/build.xcconfig`, suppressing `internal/main.m` so `CortexOtaMain.m` selects `config.BaseDir` via `CortexOtaBootstrapper` before V8 starts. `CortexOtaCrypto.swift` provides `CryptoKit` Ed25519 + streaming SHA-256 and `URLSession` disk downloads. `CortexOtaBootstrapper.copyFile:to:` reuses verified local files via APFS copy-on-write cloning. The `after-prepare` hook embeds validated `ota.config.json` into `Info.plist` (`CortexOtaConfigBase64` + `CortexOtaRuntimeContract`). +- **iOS (`@nativescript/ios` 9.1.1):** Plugin sets `NS_SWIFTUI_BOOT = 1` in `platforms/ios/build.xcconfig`, suppressing `internal/main.m` so `CortexOtaMain.m` selects `config.BaseDir` via `CortexOtaBootstrapper` before V8 starts. `CortexOtaCrypto.swift` provides `CryptoKit` Ed25519 + streaming SHA-256 and `URLSession` disk downloads. `CortexOtaBootstrapper.copyFile:to:` reuses verified local files via APFS copy-on-write cloning. The `after-prepare` hook embeds validated `otto.config.json` into `Info.plist` (`CortexOtaConfigBase64` + `CortexOtaRuntimeContract`). - **Android (`@nativescript/android` 9.1.3):** Plugin registers `com.getcortexlabs.ota.OtaAndroidPlugin` via `` in `platforms/android/AndroidManifest.xml` and compiles `native-src/java` (`OtaBootstrapper`, `OtaCrypto` using Google Tink `Ed25519Verify`, `OtaDownloader`) + `proguard-rules.pro` into `:app` via `include.gradle`. Embedded assets extract to `files/ota/embedded/app`, OTA releases live in `files/ota/releases//app`, `files/app` switches via an atomic POSIX symlink (`Os.symlink` + `Os.rename`) which also isolates V8 `codeCache` `.cache` files per release, and the `after-prepare` hook writes validated config to APK `assets/cortex_ota_config.json`. ## Explicitly out of scope -- Legacy Android V8 heap snapshots (`libsnapshot.so` / `TNSSnapshot.blob`) — removed upstream in NativeScript 7 (`NativeScript/android#8926`) and explicitly refused by `ota-ns pack` on Android unless overridden with `--allow-snapshot` ([#16](https://github.com/getcortexlabs/ota-nativescript/issues/16)) +- Legacy Android V8 heap snapshots (`libsnapshot.so` / `TNSSnapshot.blob`) — removed upstream in NativeScript 7 (`NativeScript/android#8926`) and explicitly refused by `otto pack` on Android unless overridden with `--allow-snapshot` ([#16](https://github.com/getcortexlabs/otto-sdk/issues/16)) - Mid-session hot code swap without process restart - Automatic rollback of local persisted data or SQLite schema changes diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 8e51fb2..642f43f 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -2,16 +2,17 @@ import { defineConfig } from 'vitepress'; import { buildSidebar } from './sidebar'; export default defineConfig({ - title: 'ota-nativescript', + title: 'Otto Docs', description: 'Signed over-the-air updates for NativeScript: native pre-boot selection, runtime compatibility checks and offline crash rollback.', + base: '/docs/', cleanUrls: true, lastUpdated: true, head: [ - ['link', { rel: 'icon', href: '/favicon.ico', sizes: 'any' }], - ['link', { rel: 'icon', type: 'image/png', sizes: '32x32', href: '/favicon-32.png' }], - ['link', { rel: 'icon', type: 'image/png', sizes: '192x192', href: '/favicon-192.png' }], - ['link', { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }], + ['link', { rel: 'icon', href: '/docs/favicon.ico', sizes: 'any' }], + ['link', { rel: 'icon', type: 'image/png', sizes: '32x32', href: '/docs/favicon-32.png' }], + ['link', { rel: 'icon', type: 'image/png', sizes: '192x192', href: '/docs/favicon-192.png' }], + ['link', { rel: 'apple-touch-icon', sizes: '180x180', href: '/docs/apple-touch-icon.png' }], ['meta', { name: 'theme-color', content: '#0c100f' }], ['meta', { property: 'og:image', content: 'https://otto.getcortexlabs.com/docs/logo.png' }], ['meta', { name: 'twitter:image', content: 'https://otto.getcortexlabs.com/docs/logo.png' }], @@ -19,13 +20,13 @@ export default defineConfig({ themeConfig: { logo: { src: '/logo.png', - alt: 'ota-nativescript', + alt: 'Otto Docs', }, - siteTitle: 'ota-nativescript', + siteTitle: 'Otto Docs', search: { provider: 'local', }, - socialLinks: [{ icon: 'github', link: 'https://github.com/getcortexlabs/ota-nativescript' }], + socialLinks: [{ icon: 'github', link: 'https://github.com/getcortexlabs/otto-sdk' }], outline: { level: [2, 3], }, @@ -46,7 +47,7 @@ export default defineConfig({ '/guide/': buildSidebar(''), }, editLink: { - pattern: 'https://github.com/getcortexlabs/ota-nativescript/edit/main/docs/:path', + pattern: 'https://github.com/getcortexlabs/otto-sdk/edit/main/docs/:path', text: 'Edit this page on GitHub', }, docFooter: { @@ -59,7 +60,7 @@ export default defineConfig({ label: 'Português', lang: 'pt-BR', link: '/pt-BR/', - title: 'ota-nativescript', + title: 'Otto Docs', description: 'Atualizações OTA assinadas para NativeScript: seleção nativa antes do V8, fingerprint de compatibilidade e rollback offline.', themeConfig: { @@ -74,7 +75,7 @@ export default defineConfig({ '/pt-BR/guide/': buildSidebar('/pt-BR'), }, editLink: { - pattern: 'https://github.com/getcortexlabs/ota-nativescript/edit/main/docs/:path', + pattern: 'https://github.com/getcortexlabs/otto-sdk/edit/main/docs/:path', text: 'Editar esta página no GitHub', }, docFooter: { diff --git a/docs/.vitepress/sidebar.ts b/docs/.vitepress/sidebar.ts index 18178f3..5e38fc1 100644 --- a/docs/.vitepress/sidebar.ts +++ b/docs/.vitepress/sidebar.ts @@ -46,7 +46,7 @@ const pageTitles: Record = { security: ['Security model', 'Modelo de segurança'], rollback: ['Rollback & data limits', 'Rollback e dados locais'], fingerprinting: ['Runtime fingerprinting', 'Fingerprint de compatibilidade'], - cli: ['CLI reference (ota-ns)', 'Referência da CLI (ota-ns)'], + cli: ['CLI reference (otto)', 'Referência da CLI (otto)'], 'fixture-server': ['Fault-injection server', 'Servidor local de falhas'], otto: ['Operating Otto', 'Operando o Otto'], 'store-policy': ['Store policy boundaries', 'Regras das lojas'], diff --git a/docs/.vitepress/theme/DocsExperience.vue b/docs/.vitepress/theme/DocsExperience.vue index b661bde..c530c4c 100644 --- a/docs/.vitepress/theme/DocsExperience.vue +++ b/docs/.vitepress/theme/DocsExperience.vue @@ -1,6 +1,6 @@ @@ -37,26 +38,29 @@ function switchLocale(event: Event) {
- + - + - ota-nativescript + Otto v{{ DOCS_VERSION }}