Port Phase 0: portable core and engine seam - #5
Merged
Conversation
Introduce a standard-library-only package that owns the operating-system boundary: host detection, per-OS default paths, private-file and lock primitives, process probes, desktop notification/clipboard/open helpers, and friday.env parsing. Every Linux branch reproduces the expression the code used before, so this commit changes no Linux behaviour. friday_core.runtime_paths now re-exports from friday_host.paths. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
Replace direct fcntl locks, uid and mode-bit checks, O_CLOEXEC/O_NOFOLLOW flag expressions, directory fsyncs, procfs reads, and the notify-send, wl-copy, wl-paste, and xdg-open commands with the friday_host helpers. Each helper's Linux branch is the expression that was inlined before, so the Linux behaviour and the existing test expectations are unchanged; the modules now import on macOS and Windows. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
Certificate generation, chain verification, SAN parsing, expiry checks, P-256 signature verification, and the AES-256-CTR payload ciphers now use the cryptography package. On-disk formats are unchanged: PKCS8 PEM keys, the same X.509 extensions, and the same authenticated envelope, proven by fixtures captured from the previous openssl path and by openssl interoperability tests where the binary exists. The corrected-audio key now comes from friday_host.secret_store, which keeps the exact Secret Service attributes on Linux and adds the macOS keychain and the Windows Credential Manager. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
Silero VAD now loads the pinned ONNX model from the upstream v6.2.1 tag through onnxruntime, and the multilingual-e5-small embedder runs the official ONNX export through onnxruntime and the tokenizers library. server.py no longer imports torch; the OmniVoice paths reach torch lazily through speech helpers that degrade to no-ops when it is absent. Parity fixtures recorded from the TorchScript and transformers paths prove the outputs match, and the installers pin the new assets by size and SHA-256. The keyring module is renamed host_keyring so the release tree check does not mistake it for a tracked secret. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
Detect the host at startup, compute which action classes it supports, drop unsupported tools from the model's catalog, report them with reason codes in the capability inventory and under /api/status.platform, and build the managed-process, desktop, and Omarchy brokers only where they can run. A FRIDAY_DESKTOP_MODE=required setting fails closed on non-Linux hosts. The gating helpers live in a new platform_gate boundary that the architecture check now requires. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
Runtime profiles gain engine, backend, model-asset, and launch fields that enter fingerprints only for the portable engines, so every proven Linux/NVIDIA vLLM profile keeps its exact fingerprint (guarded by golden values). Hardware detection now describes macOS (sysctl, unified memory) and Windows (nvidia-smi or Win32_VideoController) hosts, and profile selection picks mlx-lm on Apple Silicon or llama-server elsewhere from a pinned tier table of official Qwen3 checkpoints sized to the memory budget. Every llama.cpp binary and checkpoint file is pinned by size and SHA-256 in engine_assets.json. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
The supervisor now resolves process identity through engine-bound accessors whose defaults are the original vLLM values, so the Linux path is unchanged. For llama-server and mlx-lm profiles it prepares the launch from friday_core.runtime_engines (pinned binary or MLX venv, pinned model directory, credential file instead of argv), proves the served context through the engine's own probe, tolerates unobservable VRAM, honours a planned-stop marker where signals are unavailable, and falls back to psutil-based termination without process groups. A Friday-owned wrapper adds bearer authentication, a served-model listing, and a vLLM-shaped tokenize endpoint to mlx_lm.server. Boot ladders halve the context for portable engines, and prompt token counting renders through llama-server's apply-template endpoint. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
Add platform markers with classified skip reasons, a per-host expectation file, and a test runner that fails on unlisted or stale platform skips and requires zero of them on Linux. Modules bound to Linux (process and desktop brokers, the vLLM provisioner) or to POSIX shells (installer, rehearsal, bootstrap, SIGKILL drill) declare that at import. The architecture check and a boundary test now reject POSIX-only imports outside friday_host. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
The application requirements now describe the portable core; the CUDA speech stack (OmniVoice, torch, transformers) moves to cuda.in and the Linux/NVIDIA superset lock, which is byte-compatible with the previous application lock apart from the removed torch-only VAD and host-audio packages. Hash locks exist for Linux x86_64 and arm64, macOS arm64, and Windows x86_64, plus the separate MLX runtime lock, all compiled by scripts/compile-locks.sh with shared packages constrained to the CUDA lock. The compliance ledger moves to review version 2 with one entry per lock, the llama-server binary digests, and the Qwen3 checkpoint pins; the review probes installed environments and checks the others by digest and gathered license evidence. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
Move the checks into a reusable verify workflow that CI and the release workflow both call. The release-tree job keeps the shell, PowerShell, and installer checks; a tests job syncs the portable lock for each platform and runs the accounted test runner on ubuntu, macos-15, and windows-2025, with Linux required to skip nothing for platform reasons. Document the platform boundary, the additive manifest fields, and the new required checks. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
Tests that need the bubblewrap image and document tools, a local voice clip, or the CUDA environments now declare environment skips; suites whose semantics are systemd, procfs, or pidfd bound declare Linux; macOS temp directories are resolved through their symlink; hardware detection tests describe a Linux host explicitly; reminder delivery asserts the host's notification command; the skip runner recognises module-level skips; and newly written model assets use owner-only modes. The Linux CI column installs bubblewrap, poppler, tesseract, and libsecret and lifts the user-namespace restriction so the sandboxed paths run. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
Guard sandbox-dependent tests with a real bubblewrap probe, resolve macOS temp directories through their symlink, require genuine OpenSSL for the interoperability checks, keep socket inspection semantics Linux-only, build the mode-bit test from a synthetic stat result, and review the MLX lock against its own environment. The Windows column reports without blocking until Phase 2 ports the file and data paths. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
…o skip on macOS Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c
debpalash
force-pushed
the
port/phase-0-platform-layer
branch
from
September 4, 2026 09:09
9742df9 to
4a7a993
Compare
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.
Phase 0 of the cross-platform port, per the approved plan. Zero behavior change on Linux/NVIDIA: proven vLLM profile fingerprints are guarded by golden values, and the full suite passes with zero platform skips.
friday_host/platform layer (host detection, paths, locks, process probes, desktop shims, keyring, capability gate)cryptographyand native keyrings, with fixtures captured from the old codeserver.pyno longer imports torchThe macOS and Windows columns are expected to surface platform issues; they are not yet required checks.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kz3qQeARQrqpAaCAHcy96c