Skip to content

OctosCode as a native app: a kernel port in the coding scope - #341

Merged
ymote merged 2 commits into
mainfrom
feat/octoscode-native
Oct 8, 2026
Merged

ymote merged 2 commits into
mainfrom
feat/octoscode-native

Conversation

@ymote

@ymote ymote commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

OctosCode (octos-org/octoscode-app) becomes a native app on desktop and phone, paired with OctoSense's own kernel automatically. Following the person's decision ("A"), it gets a kernel port held to a coding scope: no listener, no token, no pairing. The alternatives were host authority, or a new octos token class.

Design: ADR 0003, item 9 (in this PR)

  • The port.
  • The router is the whole boundary. Over the pipe octos applies none of its external checks, so crates/kernel/src/router.rs holds a scoped consumer to its Scope:
    • refused requests are answered by the router (and logged);
    • a session's frames wait for its tool list (session/tool_list/set);
    • the consumer hears only its own sessions, and host frames about them go to the shell;
    • results are filtered, and so are the notifications it lets through (Scope::rewrite): octos repeats an opened session as a session/open notification with its whole capability list;
    • it may answer only the kernel requests it was sent.
  • The coding scope (crates/shell/src/coding_scope.rs).
    • Own sessions only: _main:api:code-<id>, no topic, profile _main.
    • Folders: its jail, or under a granted rw root (home on a desktop), never OctoSense or kernel data, hidden top-level folders, or a folder holding them.
    • A coding client's methods, with no provider, key or model edits, shutdown, peers, permission profiles or skill installs. Every advertised method list it gets, in a result or a notification, is trimmed to match.
    • Each session's tool list is octos's external-turn list, so no command runs yet. Commands come next: a shell-run tool approved per command, behind Setup's switch.
  • Theme fix. The module host points the preludes' theme at mod.theme before a module registers. A styled isolate's diverged, so a module's own theme roles never reached its widgets.

Pins (one commit on main, after #349 and #350 merged)

No longer blocked on app-contract 1.3.0. Main already takes octosense-app-contract from App Hub 7bb63ff9 ([patch.crates-io], contract 1.4.0). That revision includes 1.3.0's octoscode reservation, so a_script_app_may_not_take_a_native_apps_id_or_namespace passes without a crates.io release.

Not run: a phone. Android is unverified.

Tests

  • router 11, coding scope 4, module ports 2; tools 115.
  • cargo test -p octosense-kernel: 62.
  • Desktop shell: 857. Phone shell: 946, including the reserved-name test.
  • End to end, hidden desktop, on 296d734 with a host kernel at octos 39e22d45 and OctosCode f8561625 (an earlier run used 8039d44c):
    • the port was granted;
    • 53 methods advertised, in the session/open result and in octos's session/open notification. Before the rewrite, the notification still carried all 102;
    • a code-… session opened in the picked folder, with OctosCode's new logo in its sidebar;
    • read_file and list_dir ran;
    • answers streamed in full (after OctosCode's envelope-ordering fix);
    • the strip returned to Ready;
    • the chrome follows the shell's palette;
    • OctosCode's model picker (octoscode-app deps: converge on the fork's octoscript revision (and fix the earlier diagnosis) #5) lists the providers' models but cannot switch them. profile/llm/select changes the _main profile's model, which the system agent shares, so it stays outside the scope; Setup owns it.

Upstream

🤖 Generated with Claude Code

@ymote
ymote force-pushed the feat/octoscode-native branch from c7c1051 to e2e2f1c Compare October 6, 2026 22:19
@ymote
ymote force-pushed the feat/octoscode-native branch from e2e2f1c to 38961f1 Compare October 7, 2026 00:33
ymote added a commit that referenced this pull request Oct 7, 2026
The org-wide makepad release after makepad #99-#101, through
Octoscript-Makepad aa80f72c (#78):
- #99 and #100 are the Calculator relayout and the Terminal's own agent
  this repository carried as runtime patches. Their patches go: makepad
  main now has them, byte for byte.
- #101 adds ai-services' ui_port, the kernel port an app that is itself
  an octos client opens. Nothing here uses it yet; #341 does.

Octoscript-Makepad main now carries the Mail draft and review
capabilities this repository already pinned by branch (#75, Octoscript
2e37d9e6, OctoScript #58), and OctosCode's measured-design lowering (#77).
#77 gives the L0 node attributes a right inset, so AppCard's evaluator
reads `padright` too.

The remaining stacked patches reapply unchanged; the stack's tree is
07accf83. AppCard's own native-runtime.lock.json, which still named
2cc5ef37, names the same release as the root again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ymote
ymote force-pushed the feat/octoscode-native branch 3 times, most recently from 976eef2 to 16ad0d4 Compare October 8, 2026 03:55
ymote and others added 2 commits October 7, 2026 22:30
OctosCode (octos-org/octoscode-app) is itself an octos client. Inside
OctoSense it gets no listener, no token and no pairing. Instead it opens a
kernel port that the shell's router holds to a coding scope (ADR 0003, item
9; the person chose this over host authority and over a new octos token).

- makepad #101 (in makepad main 68d1f4ec, #349): Makepad's `OctosUiPort`,
  parked for the host the way a peer link is.
- Kernel router: scoped consumers.
  - Each request of a scoped consumer is checked first, and a refused one is
    answered by the router (`scope_denied`) and logged.
  - A session's frames wait for the scope's preparation (its exact tool
    list).
  - The consumer hears only its own sessions; a host-only frame about one of
    them goes to the shell instead.
  - Results pass the scope's filter, and so do the notifications it lets
    through (`Scope::rewrite`): octos repeats an opened session as a
    `session/open` notification with its whole capability list.
  - The consumer may answer only the kernel requests it was sent.
  - `serve_scoped` runs a port on the kernel's runtime, with `Reset` on a
    kernel restart.
- Shell: the module host claims ports per isolate, as it does peer links.
  native-apps.json `kernel: "coding"` grants one; any other port is closed
  with the reason. The coding scope (`coding_scope.rs`):
  - own sessions: `_main:api:code-<id>`, no topic, profile `_main`;
  - folders: its jail, or under a granted read-write root (home on a
    desktop), never OctoSense's or the kernel's data, a hidden top-level
    folder, or a folder holding any of them;
  - a coding client's methods only, and every list of supported methods it
    is told is trimmed to those;
  - each session's tool list is octos's external-turn list, so no command
    runs.
- Module host: point the preludes' `theme` at `mod.theme` before a module
  registers. A styled isolate's diverged, so a module's own theme roles
  never reached its widgets.
- OctosCode's entry: octoscode-app main f8561625 (#4; #7 builds it on
  the same makepad, Octoscript-Makepad, Octoscript and octos as this
  repository), default on desktop and phone, `home:rw`, `kernel: coding`. octoscript-render is patched to `.sources`
  like the rest of Octoscript-Makepad, whose pin #349 moved.
- Docs: ADR 0003 item 9; the architecture guides (App ↔ kernel, the native
  apps table); the README dependency table; AGENTS.md.

Tests:
- router 11, coding scope 4, module ports 2, kernel 62; tools 115;
- desktop shell 857 passed; phone shell 946 passed, including the
  reserved-name test (App Hub 7bb63ff9's contract reserves `octoscode`).

Verified in a hidden desktop shell (octos 39e22d45, OctosCode f8561625):
- the port was granted; both `session/open` frames list 53 methods;
- a `code-…` session in the picked folder ran read_file;
- answers streamed in full and the strip returned to Ready;
- the model picker lists the providers' models but cannot switch them
  (`profile/llm/select` changes the profile's model; Setup owns it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d6415f)

Main moved to octos b0759a57 (#357) and makepad 32d6415f + Octoscript-Makepad
33dea2f1 (#363) after this PR was written, and octoscode-app f8561625 still
pinned octos 39e22d45, so the graph held two octos. octoscode-app#8 moves the
app's runtime to main's, and the module pin follows it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ymote
ymote force-pushed the feat/octoscode-native branch from 16ad0d4 to f942473 Compare October 8, 2026 05:31
@ymote
ymote marked this pull request as ready for review October 8, 2026 05:31
@ymote

ymote commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Local CI passed on f942473 (tools/ci-local.sh --only desktop,phone,apps --linux-host, 23m24s, Darwin arm64; the ubuntu jobs on the Linux build host, Linux x86_64).

GitHub would run for this PR: desktop.yml, phone.yml, apps.yml. Merged on this local pass (macOS runner queue); GitHub CI runs on the merge commit on main.

Job Step Result Time
ci-local / drift The local mapping fits the workflows PASS -
desktop.yml / desktop Prepare the pinned framework sources PASS 1s
desktop.yml / desktop Compile the desktop with the shared runtime PASS 2m03s
desktop.yml / desktop One copy of every shell source PASS -
desktop.yml / desktop Desktop tools and scripts PASS 23s
desktop.yml / desktop One Makepad, App Hub, octos and Rinx in the locked graph PASS 2s
desktop.yml / desktop The native apps' generated places match native-apps.json PASS 0s
desktop.yml / native-host-api Prepare the pinned framework sources PASS 1s
desktop.yml / native-host-api Build the native acceptance host and pinned Hub CLI PASS 36s
desktop.yml / native-host-api Signed app tool calls a real OS permission API PASS 3s
phone.yml / home Prepare pinned sources and the reviewed runtime patch PASS 1s
phone.yml / home Validate launcher icons and Apple asset catalogs PASS 6s
phone.yml / home Compile Home and its bundled modules PASS 2m27s
phone.yml / home Verify the single runtime graph PASS 4s
phone.yml / home The native apps' generated places match native-apps.json PASS 0s
phone.yml / home The pinned octos revision PASS 0s
phone.yml / home Build octos (unless cached) PASS -
phone.yml / home Build Home, App Hub admission and runtime policy tests PASS 2m52s
phone.yml / home Test Home, App Hub admission and runtime policy PASS 11m18s
phone.yml / home Two-lane scenario (real kernel, scripted model) PASS 39s
apps.yml / services (linux) python3 tools/setup.py PASS 0s
apps.yml / services (linux) Shared system app interface PASS 0s
apps.yml / services (linux) Kernel service PASS 11s
apps.yml / services (linux) App peers PASS 24s
apps.yml / services (linux) AI providers config PASS 4s
apps.yml / services (linux) Connected provider protocols and Linux host adapter PASS 38s
apps.yml / services (linux) L0 in-card chat (sys.chat, host side) PASS 8s
apps.yml / services (linux) System toolbox (workflow templates) PASS 1m24s
apps.yml / kernel-security (linux) python3 tools/setup.py PASS 0s
apps.yml / kernel-security (linux) The pinned octos revision PASS 0s
apps.yml / kernel-security (linux) Build octos (unless cached) PASS -
apps.yml / kernel-security (linux) Real-kernel tests PASS 31s
apps.yml / apps python3 tools/setup.py PASS 1s
apps.yml / apps Host services (Mail, AI providers, News) PASS 40s
apps.yml / apps Connected accounts and Rinx editor PASS 13s
apps.yml / apps Shell AI services (crates/ai-host) PASS 59s
apps.yml / apps AppCard runtime setup safeguards PASS 0s
apps.yml / apps AppCard clippy (own crates; shared runtime compiles) PASS 38s
apps.yml / apps AppCard transport and store PASS 16s
apps.yml / apps One Makepad, App Hub, octos and Rinx in the locked graph PASS 3s
linux-host / sandbox (linux) python3 tools/setup.py PASS 0s
linux-host / sandbox (linux) Process sandbox on Linux (Landlock, seccomp) PASS 1m19s

Notes:

  • GitHub runs Python 3.12; this run used Python 3.9.6
  • GitHub runs Python 3.12; the Linux host used Python 3.14.4

@ymote
ymote merged commit 129c2a7 into main Oct 8, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant