Skip to content

Make portable Copse development and local inference reproducible - #2662

Draft
jonathanKingston wants to merge 10 commits into
mainfrom
codex/portable-dev-kit
Draft

Make portable Copse development and local inference reproducible#2662
jonathanKingston wants to merge 10 commits into
mainfrom
codex/portable-dev-kit

Conversation

@jonathanKingston

@jonathanKingston jonathanKingston commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

A Copse checkout currently depends on host-installed runtimes and caches to develop itself. This adds a reproducible Apple Silicon environment inside an ignored .portable/ directory, including development tools, offline reconstruction, isolated CLI profiles, model downloads, and standalone local inference that starts with Copse.

make portable-setup pins and verifies Node and Claude Code, installs Corepack/Codex/ACP adapters from a separate npm lockfile, and places package caches, native build inputs and app/agent profiles on the drive. Launchers derive paths at runtime and reconcile dependency metadata after relocation. Git, lint and gortex exclude the environment and nested projects; scratch directories form a Git discovery ceiling. Portable entry points discard inherited work credentials, provider routing, proxies and runtime injection before applying drive configuration. Intentional configuration inside the portable shell remains supported.

make portable-setup-offline reconstructs from populated caches with networking denied for the process tree, including lifecycle scripts. Electron headers use the locked node-gyp checksum verifier and drive cache; changes to the native-install recipe invalidate dependency fingerprints. make portable-verify-offline checks an independent clean clone with only copied caches, blocking networking and common host caches. Missing or corrupt cached downloads fail explicitly.

Optional model/runtime targets pin immutable publisher revisions and SHA-256 hashes for three starter GGUF models, an expanded 16-repository collection including complete MLX folders and projectors, and official llama.cpp/MLX/Harmony/Python archives. The full public collection plus starter models is about 269 GB before filesystem sharing. Offline runtime reconstruction repairs Python paths after relocation. The gated ThinkingCap GGUF variant remains a separate optional manifest. make portable-model prints a memory-tier recommendation; it does not load the model.

make portable-local-ai-enable enables standalone engines on future portable-run and Finder launches. The supervisor starts llama.cpp and the MLX text server from the drive, waits for real completions, registers local providers and opens Copse. Relative model configuration lives in .portable/data/local-engines.json; defaults are Qwen3 4B GGUF and Gemma 4 E4B MLX. Existing selections and unrelated settings survive; settings changes are backed up. Engines bind only to loopback. Duplicate launches and occupied ports fail without adopting other servers, and quitting Copse stops the engines owned by that launch. The strict offline setup sandbox also blocks loopback, so local inference uses the normal launcher.

LM Studio is optional. This pinned GUI version rejects external-drive launch paths, so its separate installer copies the verified cached bundle into a versioned /Applications location without replacing the host app. Its GUI profile remains host-scoped. Claude Code and Codex CLI launchers use drive profiles; these targets do not install their desktop apps.

Includes the merged #2656 relative-cache and #2657 launcher-PATH prerequisites. Portable secret encryption remains separate from this implementation; #2652 contributes its design plan. Each Mac still needs macOS and Apple's development tools. OS keychain, managed policy and host/project configuration discovery remain separate from environment-variable isolation. First sign-in and physical second-Mac/64 GiB acceptance remain outstanding. Larger models require explicit configuration and memory headroom for context and other applications.

Validation:

  • Full pnpm run check: passed on the rebased PR head: 9,208 tests passed, 7 skipped, 0 failed, plus all static checks.
  • Fresh offline install/build and repeated drive repair passed with networking and host development caches denied, with Keep development caches with relocated Copse profiles #2656/Preserve launcher-selected tools for portable Copse kits #2657 applied. Native PTY smoke tests and relocated symlink checks passed.
  • All starter weights and 121 public collection files matched pinned checksums offline. Cached LM Studio extraction/signature verification and standalone runtime reconstruction passed offline. Runtime relocation through a path containing spaces passed while denying access to original runtimes and host LM Studio state.
  • Both standalone engines generated real completions and passed streamed structured tool calls plus tool-result round trips through Copse's production provider code. The normal drive launcher started both engines and Electron; duplicate launch preserved the session.
  • Seven Python cases, included in the portable-development suite, cover configuration/path validation, profile preservation/backups, active-profile refusal, failed-enable rollback, readiness failure and cleanup ownership. Existing launcher tests cover clean authentication environment, relocation, arguments and offline behavior.
  • Real Claude/Codex CLI checks with synthetic inherited work credentials selected fresh drive profiles and reported not signed in, with networking denied.
  • The Mac was locked and automatic unlock failed. Native Electron chat validation could not complete, so a full interaction in the rendered drive window remains unverified pending an unlocked GUI session. The tested MLX serving path supports text and tools, not vision/audio. Final boot of the optional host-installed LM Studio GUI remains unverified because an existing instance was running.

No renderer or DOM code changed; this PR changes development/bootstrap scripts, native build inputs and test isolation.

github-actions Bot added a commit that referenced this pull request Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🖥️ PR preview

@jonathanKingston jonathanKingston changed the title Add reproducible portable development setup Add portable development setup and verified offline rebuilds Sep 11, 2026
@jonathanKingston jonathanKingston changed the title Add portable development setup and verified offline rebuilds Add portable development setup, offline rebuilds and local models Sep 11, 2026
@jonathanKingston jonathanKingston changed the title Add portable development setup, offline rebuilds and local models Make portable Copse development and local inference reproducible Sep 12, 2026
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