Repository navigation
Desktop: find the packaged octos kernel and refuse one of another revision - #256
Merged
Merged
Conversation
This was referenced Oct 1, 2026
ymote
force-pushed
the
feat/desktop-kernel-finder
branch
from
October 2, 2026 03:46
387f8f7 to
fc5f8c9
Compare
This was referenced Oct 2, 2026
…ision The desktop's kernel service needed OCTOS_APP_CORE_BIN. It now also finds a packaged `octos-kernel[.exe]` beside the shell executable (in a macOS .app, Contents/MacOS or Contents/Resources), never in the working directory or on PATH. Options::program and OCTOS_APP_CORE_BIN still win, unchecked, and a broken override is an error rather than a fallback. The packaged kernel runs only when its receipt `octos-kernel.json` names the octos revision this build pins (crates/kernel/build.rs reads it from Cargo.lock) and the binary's SHA-256 matches. A stale target/release/octos-kernel from an earlier pin, a missing receipt or a swapped binary is refused, and the reason reaches the person. OCTOSENSE_KERNEL_ANY_REVISION=1 accepts another revision while developing; the receipt and hash are still required. Resolving reads only the receipt (it also answers status queries on the UI thread); the hash is checked in launch::prepare on the kernel's runtime before each start, cached by size and modification time. tools/kernel-artifact.py --host --stage <dir> builds the pinned kernel and stages it with that receipt, refusing a binary whose --version is not the pinned revision (--kernel stages a prebuilt one). The host build passes --target-dir instead of an `env` wrapper, so it runs on Windows too. Replaces the kernel part of #85. Its Rinx pin and [patch] changes are dropped: main pins Rinx v1.1.0 and the app contract from crates.io. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ymote
force-pushed
the
feat/desktop-kernel-finder
branch
from
October 2, 2026 19:58
fc5f8c9 to
5f2db0c
Compare
Contributor
Author
|
Local CI passed on 5f2db0c ( GitHub would run for this PR: desktop.yml, phone.yml, apps.yml, rom.yml. Merged on this local pass (macOS runner queue); GitHub CI runs on the merge commit on main.
Notes:
|
Contributor
Author
|
The Linux-host steps also passed on this same head, 5f2db0c. Run 1 started 2026-10-02T12:58:12 ( Its only skips were the 8 rom.yml steps, because the Linux host has no JDK, Android SDK or node. Those ran and passed in run 2, the Mac-only |
ymote
added a commit
that referenced
this pull request
Oct 2, 2026
#275 rewrote the intro, the kernel and session text and the worked example, and #256 the desktop kernel row; those stay. On top of them this corrects what still disagrees with main's code: which apps have an agent and their tools, the notice card, toasts and dismissal, the glance panel's L0 taps, where questions show, agents.ask, the approval router and every approval going to it, terminal.run, the toolbox, the process launch, the Linux sandbox and the follow-ups that are now fixed. English and Chinese now say the same; the Chinese page had fallen behind. 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.
The desktop's kernel service needed
OCTOS_APP_CORE_BIN. It now finds a packagedoctos-kernelthat travels with the shell, and refuses one that is not the octos revision this build pins. Replaces the kernel part of #85.What changes
crates/kernel/src/launch.rs,desktop_program). The kernel is chosen in this order:Options::program, thenOCTOS_APP_CORE_BIN, thenoctos-kernel[.exe]beside the canonicalized shell executable (in a macOS.app,Contents/MacOSorContents/Resources). It never looks in the working directory or onPATH. An override still wins and is not checked, and a broken override is an error rather than a fallback.octos-kernel.jsonnames the octos revision this build pins and its SHA-256 matches the binary..app'sContents/Resources, or in a Linux package'susr/lib/octosense.crates/kernel/build.rsreads the pinned revision fromCargo.lock(the sameoctos-clirevisiontools/kernel-artifact.pyreads).target/release/octos-kernelleft from an earlier pin, a kernel without a receipt, or a swapped binary is refused, and the person sees why. For example:refusing the packaged kernel …: it is octos 60cf96e6c871 but this build pins ae230ce04d57 (set OCTOSENSE_KERNEL_ANY_REVISION=1 to run it anyway while developing). Rebuild it with python3 tools/kernel-artifact.py --host --stage <dir> or name a kernel with OCTOS_APP_CORE_BIN.OCTOSENSE_KERNEL_ANY_REVISION=1is the development override. It accepts another revision, but a receipt and a matching hash are still required.Core::launch()also answers status queries on the UI thread at startup. In the first local run, hashing the 117 MB kernel there caused a 669 ms[ui-hang]. The SHA-256 is now checked inlaunch::prepare, on the kernel's runtime before each start, and the result is cached by size and mtime. A mismatch fails closed, like the tool-policy refusal does.tools/kernel-artifact.py, no new script).--host --stage <dir>builds the pinned revision for this machine and stages it asoctos-kernelplus the receipt (source,revision,version,sha256). It refuses a binary whose--versiondoes not name the pinned revision, and leaves any earlier kernel in place.--kernel <path> --stage <dir>stages a prebuilt one. The host build now passes--target-dirinstead of anenvwrapper, so the same plan runs on Windows.desktop/README.md"Build and run" (+ zh-CN) now readspython3 tools/kernel-artifact.py --host --stage target/releasethencargo run --release -p octosense. Also updated: the root README (+ zh-CN), the kernel and ai-host READMEs,docs/ai-services.mdanddocs/architecture.md(+ zh-CN; the "Package the desktop Octos kernel and update hosted Rinx #85 in progress" notes are gone).Compared with #85
tools/build-desktop.pyis not ported;kernel-artifact.py --host --stagecovers it.--versiononly when staging.[patch."…OctoSense.git"]change are dropped. Main pins Rinxv1.1.0and takes the app contract from crates.io. The onlyCargo.lockchange issha2(already in the graph) added tooctosense-kernel.examples/packaged_probe.rsis not committed. I ran it locally (below).Tested (macOS arm64)
cargo test --locked -p octosense-kernel: 36 unit, 13 core and 7 real-kernel tests pass. The real-kernel tests used the pinnedae230cekernel viaOCTOS_CORE_TEST_KERNEL.cargo clippy --locked -p octosense-kernel --all-targets -- -D warningspasses for the host,aarch64-linux-android,x86_64-pc-windows-msvcandx86_64-unknown-linux-gnu..app(MacOS and Resources) and Linuxusr/bin+usr/lib/octosenselayouts, a non-bundleContents/MacOS, a stale revision, a missing or malformed receipt, a hash mismatch caught byprepare(also under the override), a non-executable kernel, andPINNED_REVISIONmatchingCargo.lock.python3 -m unittest discover -s tools -p 'test_*.py'passes (82 tests on this branch). The new stage tests cover the version check, the receipt, nothing being replaced on a wrong revision, and the CLI.kernel-artifact.py --kernel <ae230ce octos> --stagenext to Package the desktop Octos kernel and update hosted Rinx #85's packaged probe (run locally, not committed),OCTOS_APP_CORE_BINunset. Result:PASS: sibling runtime, shared kernel, provider profile and restart; no LLM request. With the receipt's revision changed, the probe got the refusal above;OCTOSENSE_KERNEL_ANY_REVISION=1ran it; with no receipt it was refused.cargo check --locked -p octosense-shell -p octosense,-p octosense --features mobile-apps,tools/check-shell-graph.sh -p octosense,tools/setup.py --check --cargoandtools/test_ci_local.py..appfinding its kernel inContents/MacOSwith the receipt inResources) is in the stacked packaging PR.Not run here: Windows and Linux at run time (compiled and clippy-checked only).
🤖 Generated with Claude Code