Skip to content

Provide a local system view for native Sessions - #616

Merged
SaladDay merged 1 commit into
aos/cutoverfrom
aos/provide-local-session-system-view
Oct 9, 2026
Merged

SaladDay merged 1 commit into
aos/cutoverfrom
aos/provide-local-session-system-view

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Native processes read their local /proc/self/cgroup but previously looked up the corresponding /sys paths in the sandbox filesystem. Give each Session view fresh read-only sysfs and cgroup2 mounts in its own cgroup namespace, so native kernel introspection stays consistent and cannot see ancestor or sibling cgroups. Reserve /sys in the Runtime–Harness contract and workspace admission; forwarded Process commands and public Files retain sandbox filesystem semantics.

This adds two mounts and one namespace through the existing view builder, with no cache, transport change, setting or dependency. The root-owned cgroup leaf is readable but not writable by the view UID. The protocol guide and Chinese translation describe the ownership boundary.

Validation:

  • Complete privileged sessionview suite, including namespace identity, read-only enforcement, hidden sibling cgroups, local network devices, empty-root behavior, workspace rejection and teardown; the three changed concurrent tests also pass 50 race repetitions (550 cases).
  • Complete privileged agenthost suite against a newly compiled SandboxIO from the final source; focused Go tests/vet, Darwin amd64/Windows amd64/Linux arm64 builds, documentation/naming/CI-plan checks and translations.
  • Real Node 22 kernel introspection in the actual FUSE-backed view, with identical CPU data: 1045 remote sys-path lookups become zero. At a controlled 2 ms per world lookup, three interleaved pairs take 2.70–4.47 s before and 2.23–2.29 s after. View Start remains 9–12 ms. Zero-delay results have large hardware-query variance and do not establish a universal speedup; no end-to-end model gain is claimed.
  • Coordinator full-diff review and fresh independent review completed without substantiated findings. Rebase from the reviewed commit is patch-identical.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@SaladDay
SaladDay merged commit 075ea3c into aos/cutover Oct 9, 2026
20 checks passed
@SaladDay
SaladDay deleted the aos/provide-local-session-system-view branch October 9, 2026 09:08
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