Commit Graph
23 Commits
Author SHA1 Message Date
abkslm f51f5b41e5 Merge nucleic/warm-ancient-lemur-kprc into dev 2026-07-14 01:32:30 -07:00
abkslmandClaude Opus 4.8 b81d12553c Build the custom vminit image locally via make vminit-image; drop the CI workflow
The GitHub-hosted macos runners can't build the host framework (needs the
macOS 26+ Virtualization SDK), so publish the custom vminit guest image from a
local macOS 26/27 machine instead. Adds root-Makefile targets:
  - vminit-image-prep : one-time swiftly + musl static SDK install
  - vminit-image      : build cctl + cross-build vminitd, package the image
  - vminit-image-push : push to GHCR (REGISTRY_* env creds)
Forces WARNINGS_AS_ERRORS=false (Xcode Swift 6.4 rejects -warnings-as-errors
alongside SwiftPM's -suppress-warnings). Removes .github/workflows/vminit-image.yml
and repoints vminitReference + PATCHES.md docs at the Makefile.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-13 19:31:56 -07:00
abkslmandClaude Opus 4.8 64d11eb0e2 vminit-image CI: run on macOS 26 (needs macOS 26 SDK for vmnet_network_* symbols)
The macos-15 runner's SDK lacks vmnet_network_ref / VZVmnetNetworkDeviceAttachment
(macOS 26 APIs used by Containerization's VmnetNetwork/NATNetworkInterface), so
`make containerization` failed to build cctl before reaching the init packaging.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-13 19:01:32 -07:00
abkslmandClaude Opus 4.8 6fbc308fa4 Container isolation: fix stdio stall + per-exec connection leak; add guest image pipeline
Host-side (ships with a normal swift build):
- LinuxProcess: non-blocking stdio relay (O_NONBLOCK + nucleicDrainNonBlocking)
  so a wedged stream can't head-of-line-block sibling execs' relays; atomic
  stdio-or-abort start (patches #5, #6).
- Vminitd: bounded deleteProcess timeout so teardown can't hang a wedged
  channel (patch #7).
- ContainerizedProcessHandle: call LinuxProcess.delete() after exit and on
  force-close — fixes a per-turn leak (per-exec vsock/gRPC connection +
  runConnections() task) in the long-lived shared control container. Likely
  the "degrades until app restart" root cause.
- ClaudeCodeBackend: map the atomic-start abort to a recoverable AgentError so
  a failed launch settles as retryable instead of locking the composer.

Guest-side (rides the custom vminitd initfs; inert until the image is built):
- ManagedProcess: offload the blocking start off the gRPC event loop (patch #8).
- Per-exec cgroups (patch #9) recorded as design only — cross-cutting.

Pipeline:
- .github/workflows/vminit-image.yml builds vminitd from the vendored source
  and pushes ghcr.io/abkslm/vminit; ContainerEngine.vminitReference repointed
  at the custom image.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-13 18:46:48 -07:00
abkslm ab0a880dfc Merge nucleic/ivory-harbor-lynx-vuwe into dev 2026-07-13 01:53:35 -07:00
abkslm 24e68ccf19 Merge nucleic/lucid-quartz-otter into dev 2026-07-12 23:01:22 -07:00
abkslm 517b908816 Merge nucleic/calm-glass-toad into dev 2026-07-11 22:08:10 -07:00
abkslm 02995b6622 Merge nucleic/amber-harbor-egret into dev 2026-07-11 03:23:21 -07:00
abkslm 41bef61853 Merge nucleic/warm-river-lynx into dev 2026-07-10 20:16:09 -07:00
abkslm 469d7b0f62 Merge nucleic/warm-river-lynx into dev 2026-07-10 20:13:36 -07:00
abkslm bc3779c4c5 Merge nucleic/frosty-dewy-quail into dev 2026-07-10 20:09:55 -07:00
abkslm ded6d0a637 Merge nucleic/zesty-glass-heron into dev 2026-07-10 19:47:50 -07:00
abkslmandClaude Opus 4.8 cb1d0f1ab5 Runner smoke: probe relay with a valid key + classify reachability
The egress probe sent a deliberately-invalid staticKey, so a now-reachable
relay returns 422 'staticKey not base64' — which reads like a failure but
actually proves the Cloudflare challenge is gone (the Worker, not the edge,
answered). Send a well-formed 32-byte key (healthy relay -> 200) and print an
explicit verdict: Cloudflare-blocked vs unreachable vs reachable.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-11 02:24:46 +00:00
abkslmandClaude Opus 4.8 d9c43b25bc Runner smoke: don't gate image on Cloudflare bot-challenge of the relay
Root cause of the boot smoke failure is a Cloudflare edge bot-challenge (HTTP
403 'Just a moment') served for relay.nucleic.blakeslee.xyz from the runner's
datacenter IP — the identical curl probe gets the same 403, so it's an infra
policy, not a nucleicd defect. Treat that specific signature as a loud
non-fatal skip so the image still publishes, while still hard-failing on any
other early-boot error. The real fix is a Cloudflare WAF Skip rule exempting
the relay host from Super Bot Fight Mode / Managed Challenge; the enroll
endpoint is already X25519 proof-of-possession protected.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-11 01:34:32 +00:00
abkslmandClaude Opus 4.8 0c2fb86de9 Runner smoke: surface relay-enroll failure cause + curl egress probe
The runner image smoke test only reported an opaque "challenge request"
when nucleicd failed to enroll with the relay on boot. RelayAccess.postJSON
collapsed transport errors, non-200 statuses, and malformed bodies into one
string, hiding whether the fully-static musl binary's URLSession/libcurl leg
is failing vs the relay rejecting vs no egress. Surface the specific cause,
and add an independent curl probe to the smoke step so one build tells us
which layer is at fault.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-11 01:13:51 +00:00
abkslm 3e9abb1388 Nucleic: I’m Getting This Issue With The 2026-07-10 17:30:52 -07:00
abkslm b651dce028 Merge nucleic/plucky-umber-viper into dev 2026-07-10 16:35:39 -07:00
abkslm 85c17e48d1 Merge nucleic/hazy-fern-koala into dev 2026-07-10 02:39:03 -07:00
abkslmandnucleic 31f0a23d17 Linux VM Semantic Agent Documentation
Nucleic-Session: 8D2E51A9-B964-4E65-AD93-6B400001530D
Co-authored-by: Nucleic <[email protected]>
2026-07-08 21:30:47 -07:00
abkslmandnucleic 68d2e9d7ab nvrsion: promote trunk to dev
Nucleic-Promote: 1
Co-authored-by: Nucleic <[email protected]>
2026-06-27 19:52:55 -07:00
NucleicandClaude Opus 4.8 01a989f062 Nucleic Control: vsock control plane on by default + sandbox image v4
Promote the vsock control plane from opt-in to default, so a Nucleic Control container's approval +
interceptor channel runs over the vsock-relayed socket (no host IP listener, no macOS local-network
prompts) instead of TCP on the VM gateway. Only the agent's own internet egress + DNS stay on the
gateway NAT — the minimum that can't ride vsock.

- vsockControlPlaneEnabled defaults true when unset (an explicit stored false still wins); Settings
  toggle default + caption updated.
- Sandbox image bumped v3 -> v4 (ProjectSandbox.defaultImage + sandbox-image.yml IMAGE_TAG). v4
  ships control-bridge.js (required by the default-on vsock path) plus the Codex/Grok CLIs. The
  client refresh is automatic: the launch-time rootfs prune drops the stale v3 cache and pulls v4.
- Fix the Grok install in the Dockerfile: the x.ai installer already symlinks
  /usr/local/bin/grok -> /root/.grok/bin/grok, so the old `ln -sf /usr/local/bin/grok ...` made a
  self-referential symlink ("Too many levels of symbolic links"), and /root is 0700 so the non-root
  agent couldn't reach it anyway — this is why CI silently failed and the registry image was stuck
  at the pre-bridge build (Jun 21). Relocate the install to a world-traversable /opt/grok and relink.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-25 17:38:15 -07:00
NucleicandClaude Opus 4.8 2f9252e430 Sandbox kernel: distribute as a GHCR package, not a release asset
Publish the VM's Linux kernel as an OCI artifact (ghcr.io/<owner>/nucleic-kernel)
via a new manual workflow, and pull it through the registry distribution API —
anonymously when the package is public, else with the user's GitHub token
(read:packages). This lets the kernel be made public independently of repo
visibility, matching how the nucleic-sandbox image already works.

- .github/workflows/kernel-image.yml: oras push the kernel as a one-blob artifact
- ContainerEngine.downloadKernel: registry token -> manifest -> blob; token optional
- Project.swift: kernelReleaseRepo/Tag/AssetName -> kernelImage registry ref
- scripts/fetch-kernel.sh: follow the vmlinux.container symlink (extract whole dir)
- BUILD.md: document the package model + publish flow

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-21 19:07:30 -07:00
NucleicandClaude Opus 4.8 c4e41ec52e Rework container sandbox onto the containerization framework
Replace the Apple `container` CLI wrapper with Apple's `containerization`
Swift framework, driven in-process — no external CLI or daemon.

- ContainerEngine: in-process runtime (shared VZVirtualMachineManager from a
  bundled kernel + runtime-pulled vminitd initfs, ImageStore, VmnetNetwork,
  live-container registry, typed statistics for CPU/mem + OOM diagnosis).
  Daemonless ⇒ ephemeral VMs; reconcile is on-disk GC.
- ContainerizedProcessHandle: bridges a guest LinuxProcess onto the existing
  ProcessHandle contract (reusing LineSplitter), so backends stream NDJSON
  identically in-container and on-host. Closes the stdio writers after wait()
  to finish the line streams (the framework never calls Writer.close()).
- Sandbox image is built in CI (containers/nucleic-sandbox/Dockerfile +
  .github/workflows/sandbox-image.yml) and pushed to GHCR; the app pulls +
  unpacks it on first use (no on-device build, no user-installed tools). The
  GHCR package may stay private — pulls authenticate with the user's GitHub
  token via ContainerEngine.registryAuth (Settings → Sandbox, or
  NUCLEIC_REGISTRY_USER/NUCLEIC_REGISTRY_TOKEN). vminitd is pulled from Apple's
  public GHCR; only the kernel is bundled (scripts/fetch-kernel.sh, curl-only).
- ContainerManager rewired to the engine (policy preserved); ClaudeCodeBackend
  execs in-container via the engine; Settings/ProviderAvailability use a static
  capability check. Platform floor raised to macOS 26 (Apple silicon) + the
  com.apple.security.virtualization entitlement (swift-tools 6.2).
- Verified end-to-end on macOS 27 / Apple silicon via Sources/container-spike:
  pull vminitd + image, boot VM, exec, stream stdout. Builds clean; 21 tests pass.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-21 00:46:04 -07:00