Skip to content

Latest commit

 

History

History
301 lines (255 loc) · 17.9 KB

development-packages.md

File metadata and controls

301 lines (255 loc) · 17.9 KB

Local Desktop Development Candidate Packages

This document explains how to prepare local development candidates for macOS Apple Silicon and Windows x64. The macOS evidence is tied to the historical Companion candidate source 3661791aaad4065918b440f6c560da0e18db1742 and includes a fix to the Electron Builder launch path. A current candidate must select and verify its own reviewed full source SHA; the historical evidence must not be applied to a moving main branch or another commit. Always build from the reviewed commit selected for the candidate. This document does not claim that Windows has been executed or accepted. Candidate packages are for local engineering verification only; they are not uploaded automatically, do not create a Release, and do not advance to an official distribution.

When comparing an independent plugin's thin package, use the same reviewed source and the corresponding platform tools to build both the compatibility package and a LING_PLUGIN_EXTERNAL_ONLY=1 candidate. Keep both installers, unpacked file inventories, and signing evidence. The macOS local review and native-plugin system-signing requirements still apply. The GitHub Actions Desktop candidate workflow exposes a plugin_mode option and retains the thin package as a workflow candidate. See thin-package build parameters and acceptance.

Release naming

When a maintainer separately authorizes a GitHub prerelease, follow Release Naming: use v<product-version> for the tag (for example, v0.1.2-alpha.2) and Ling Stack <tag> for the page title. Put the Mac and Windows packages for one product version in the same Release and pin them to the same reviewed source SHA. Put platform and architecture in filenames; record the date, SHA, development-candidate status, and incomplete acceptance in the notes and evidence. Do not retarget an existing tag to new source or label a candidate as an official release merely because its name is concise. Preserve historical long tags and immutable assets exactly as they are.

Short checklist for Windows operators

  1. On a Windows x64 test machine or VM, prepare Git, x64 Node 22.22.1, Corepack/pnpm 10.0.0, Rust 1.97.1 MSVC, the Visual Studio Build Tools C++ workload and Windows SDK, and the .NET 8 SDK.
  2. The maintainer supplies a reviewed tag or full SHA. Create a clean checkout and pin it to that ref; do not use a moving main branch.
  3. In an x64 Developer PowerShell, run corepack pnpm install --frozen-lockfile, then corepack pnpm build, then corepack pnpm --filter @ling-stack/desktop package:win. Use the full template below and check every exit code. Stop on failure and return the first error with redacted logs.
  4. Inspect Ling-Stack-<version>-windows-x64-setup.exe and record the source SHA and file SHA-256. With a test account, perform install → start → real model task → exit/restart → system restart → uninstall, and save the results and redacted screenshots.
  5. Return the installer, SHA-256, tool versions, and each PASS / FAIL / BLOCKED result. This is a local unsigned development candidate; Wine is not required. It does not bundle the Cua Driver by default and must not be described as an official release or as Computer Use acceptance.

Signing and account boundaries

  • Local macOS development may use the ad-hoc identity -; an Apple Developer account is not required. The repository's unsigned_dev Mac channel performs ad-hoc signing. “Unsigned” means that no distribution certificate is present, not that the code has no signature structure.
  • Passing ad-hoc signing and codesign --verify proves only the local code-signing structure. It does not provide a Developer ID publisher identity and does not replace notarization or Gatekeeper acceptance.
  • A Developer ID package distributed to other users requires the Apple Developer Program, a Developer ID certificate, and notarization. See Developer ID and Safely open apps on Mac.
  • A Windows unsigned_dev + development candidate requires no code-signing certificate. It cannot claim an Authenticode publisher identity or SmartScreen release acceptance. This document does not require Wine and does not require disabling Gatekeeper, SmartScreen, Defender, or other system security settings.

For official distribution and signing acceptance, see the Desktop release acceptance manual and the third-party distribution boundary.

macOS Apple Silicon

Use a native arm64 Mac with Node.js 22.22.1 or later, Corepack-managed pnpm 10.0.0, Xcode Command Line Tools, and Rust 1.97.1. Office native packaging also requires an independently reviewed local compiler, macOS SDK, Node headers, and source inputs. The source build does not require a Developer ID account.

Machine-bound independent review prerequisite

The standard package:mac command invokes package-macos-with-office.mjs, accepts only darwin + arm64 + unsigned_dev, uses the default ad-hoc signer, and refuses to bundle a Cua Driver provider. It requires native/office-local/reviewed-packaged-source-v1.json. The historical baseline did not contain that file, so a standard package from that clean checkout would stop with packaged_office_native_source_review_missing.

The independent native prerequisite review on 2026-11-17 used the machine's real Apple-signed Xcode 27.2 / macOS SDK 27.2 configuration and rebound the runtime record to Electron 45.3.1 and Node 24.22.2. See the review record. That record is bound to the actual Darwin arm64 host, toolchain, and fixed source inputs; it is not a general approval for another machine or later source. Nineteen sandbox sources and fifteen Office sources were unchanged, and the original Host runtime fingerprint must also match. Ad-hoc signing does not waive this requirement. Packaged acceptance and PR #527 were not included.

The record binds the reviewed compiler, SDK, headers, Office sources, and packaging-source digest. A successful build, test result, or generated digest cannot substitute for independent review, and the record must not be generated or approved merely to make packaging pass. The Mac packaging hooks also require in-process Office publication; invoking Electron Builder directly is not a supported bypass. Before signing, prepare the actual third-party notices, source index, and SBOM under apps/desktop/dist/distribution, then inspect resources in the final App, ZIP, and DMG. Builder missing-resource warnings do not replace distribution-material acceptance.

Standard commands

Select a reviewed tag or full commit SHA and work in a separate clean checkout. Enter the packaging step only after the maintainer has completed the Office review for the current source and local toolchain:

set -e
corepack pnpm install --frozen-lockfile
corepack pnpm build

if [ ! -f native/office-local/reviewed-packaged-source-v1.json ]; then
  echo "Blocked: packaged_office_native_source_review_missing"
  exit 1
fi

LING_CUA_SIGNING_TIER=unsigned_dev \
LING_CUA_DISTRIBUTION_CHANNEL=development \
LING_CUA_DRIVER_PACKAGE_PROVIDER=0 \
corepack pnpm --filter @ling-stack/desktop package:mac

Use a separate build shell with no leftover provider source-build or release-signing environment variables. Record the source SHA, Node/pnpm/Rust/CLT versions, and the complete build log; the dependency cache required for an offline Rust build must already be present. The scripts may download Electron or packaging tools, so “no signing account required” does not mean “no network or build dependencies required”.

After a successful build, inspect the arm64 .app, DMG, and ZIP generated under apps/desktop/release/. Record each SHA-256, verify DMG/ZIP integrity, and run codesign --verify --deep --strict on the unpacked application. In an isolated test account, also verify startup, a real model task, exit/restart, window lifecycle, and uninstall. The local evidence for 3661791a completed App/ZIP/DMG content comparison, distribution-material review, embedded-runtime startup, a real Companion conversation, wide/narrow layouts, independent-window close/reopen, and owner cleanup. Its SHA-256 values are:

Ling-Stack-0.4.0-macos-arm64.dmg  49b01074a070745b52181248bd87d1b4296bf87b762c115c91361c41e5adea16
Ling-Stack-0.4.0-macos-arm64.zip  01c81d65a0b55cd878c78a8408a46dbd67a5715db5cde087f4e2aeaf33a5c53f

These results remain local ad-hoc candidate evidence. They do not establish notarization, Gatekeeper, or complete clean-machine release acceptance.

For source development only, run after building the workspace:

corepack pnpm --filter @ling-stack/desktop dev

Development mode does not run the Office package-review flow above and cannot replace DMG/ZIP acceptance.

Windows x64: operator checklist

Complete Windows build and validation on a real Windows x64 host or Windows x64 VM. The repository's package:win builds Browser Host and OfficeDriver for the host platform; invoking it on a Mac first produces Mac-native resources and does not prove that a complete runnable Windows candidate exists.

1. Prepare tools and the test environment

  • Git; x64 Node.js 22.22.1 or newer (pin 22.22.1 for the first candidate and record the actual version).
  • Corepack and the repository-pinned pnpm 10.0.0.
  • The Rust MSVC toolchain; pin 1.97.1-x86_64-pc-windows-msvc for the first candidate. Browser Host scripts run cargo build --release --locked with the active toolchain, and the template fixes this build with RUSTUP_TOOLCHAIN.
  • Visual Studio Build Tools with Desktop development with C++, MSVC x64/x86 tools, and the Windows SDK. Build from an x64 Developer PowerShell where cl.exe is available.
  • .NET 8 SDK; OfficeDriver targets net8.0-windows, and the packaging script runs dotnet publish --runtime win-x64 --self-contained true to produce the native driver.
  • Access to npm, the Rust registry, NuGet, and Electron/packaging-tool download endpoints.
  • A separate test user or Windows VM and a test model configuration; never use an existing production workspace.

Install the tools before starting. Repository commands do not install the Visual C++/SDK or .NET components. A code-signing account and Wine are not required. The current packaging wrapper starts the installed Electron Builder CLI directly with Node instead of executing a Windows .cmd shim in a child process. This fixes the launch path, but a Windows operator must still build and accept the candidate on Windows.

2. Pin source, install dependencies, build, and package

The following is a template to execute. This document does not name a created release tag; the maintainer must provide a reviewed tag or full commit SHA and replace $ReleaseRef. Do not use a moving main branch as the acceptance input. Every native command checks its exit code; stop on failure, do not alter the lockfile or version, and do not bypass a protection check to continue.

$ErrorActionPreference = 'Stop'

function Invoke-Checked {
    param([string]$Program, [string[]]$ArgumentList)
    & $Program @ArgumentList
    if ($LASTEXITCODE -ne 0) {
        throw "$Program failed with exit code $LASTEXITCODE"
    }
}

$RepositoryUrl = 'https://github.com/ling-stack-org/ling-stack.git'
$ReleaseRef = 'REPLACE_WITH_REVIEWED_TAG_OR_FULL_COMMIT_SHA'
if ($ReleaseRef.StartsWith('REPLACE_')) {
    throw 'Replace ReleaseRef with the maintainer-reviewed tag or full commit SHA.'
}
$CheckoutRoot = Join-Path $PWD 'ling-stack-candidate'
Invoke-Checked 'git' @('clone', $RepositoryUrl, $CheckoutRoot)
Set-Location $CheckoutRoot
Invoke-Checked 'git' @('fetch', '--tags', 'origin')
Invoke-Checked 'git' @('checkout', '--detach', $ReleaseRef)
$CandidateCommit = (& git rev-parse HEAD).Trim()
if ($LASTEXITCODE -ne 0) { throw 'Cannot resolve candidate commit.' }
if ($CandidateCommit -notmatch '^[0-9a-f]{40}$') { throw 'Invalid candidate commit.' }
$SourceStatus = @(& git status --porcelain)
if ($LASTEXITCODE -ne 0) { throw 'Cannot inspect checkout.' }
if ($SourceStatus.Count -ne 0) { throw 'Candidate checkout must be clean.' }

Invoke-Checked 'node' @('--version')
$NodePlatform = (& node -p 'process.platform + ":" + process.arch').Trim()
if ($LASTEXITCODE -ne 0) { throw 'Cannot inspect Node platform.' }
if ($NodePlatform -ne 'win32:x64') { throw 'Use x64 Node on Windows for this candidate.' }
$NodeVersion = (& node -p 'process.versions.node').Trim()
if ($LASTEXITCODE -ne 0) { throw 'Cannot inspect Node version.' }
if ([version]$NodeVersion -lt [version]'22.22.1') { throw 'Node 22.22.1 or newer is required.' }
Invoke-Checked 'corepack.cmd' @('pnpm', '--version')
$PnpmVersion = (& corepack.cmd pnpm --version).Trim()
if ($LASTEXITCODE -ne 0) { throw 'Cannot inspect pnpm version.' }
if ($PnpmVersion -ne '10.0.0') { throw 'Use the repository-pinned pnpm 10.0.0.' }
if (-not (Get-Command cl.exe -ErrorAction SilentlyContinue)) {
    throw 'Use x64 Developer PowerShell with MSVC and Windows SDK installed.'
}
$env:RUSTUP_TOOLCHAIN = '1.97.1-x86_64-pc-windows-msvc'
Invoke-Checked 'rustup' @('run', $env:RUSTUP_TOOLCHAIN, 'rustc', '-vV')
Invoke-Checked 'dotnet' @('--list-sdks')
$DotnetSdks = @(& dotnet --list-sdks)
if ($LASTEXITCODE -ne 0) { throw 'Cannot inspect .NET SDKs.' }
if (-not ($DotnetSdks -match '^8\.')) { throw '.NET 8 SDK is required.' }

# Use a fresh shell without provider source-build or signing credential variables.
$env:LING_CUA_SIGNING_TIER = 'unsigned_dev'
$env:LING_CUA_DISTRIBUTION_CHANNEL = 'development'
$env:LING_CUA_DRIVER_PACKAGE_PROVIDER = '0'
$env:CSC_IDENTITY_AUTO_DISCOVERY = 'false'
Invoke-Checked 'corepack.cmd' @('pnpm', 'install', '--frozen-lockfile')
Invoke-Checked 'corepack.cmd' @('pnpm', 'build')
Invoke-Checked 'corepack.cmd' @('pnpm', '--filter', '@ling-stack/desktop', 'package:win')

$ReleaseRoot = Join-Path $CheckoutRoot 'apps/desktop/release'
$Installers = @(Get-ChildItem $ReleaseRoot -File -Filter 'Ling-Stack-*-windows-x64-setup.exe')
if ($Installers.Count -ne 1) { throw 'Expected exactly one fresh Windows x64 installer.' }
$MainExe = Join-Path $ReleaseRoot 'win-unpacked/Ling Stack.exe'
$BrowserHost = Join-Path $ReleaseRoot 'win-unpacked/resources/browser-host/ling-browser-host.exe'
$OfficeDriver = Join-Path $ReleaseRoot 'win-unpacked/resources/office-driver/win32-x64/ling-office-driver.exe'
foreach ($CandidateFile in @($Installers[0].FullName, $MainExe, $BrowserHost, $OfficeDriver)) {
    if (-not (Test-Path -LiteralPath $CandidateFile -PathType Leaf)) {
        throw "Missing candidate file: $CandidateFile"
    }
}
foreach ($CandidateFile in @($Installers[0].FullName, $MainExe)) {
    if ((Get-AuthenticodeSignature -LiteralPath $CandidateFile).Status -ne 'NotSigned') {
        throw 'This checklist expects an unsigned development candidate; inspect unexpected signing separately.'
    }
}
Get-FileHash -Algorithm SHA256 -LiteralPath $Installers[0].FullName, $MainExe, $BrowserHost, $OfficeDriver
Write-Output "Candidate source commit: $CandidateCommit"

Keep the command output and build log. Return the candidate source SHA, tool versions, filenames, and SHA-256 values to the maintainer. If installation, compilation, or packaging fails, provide the first failing command, exit code, and redacted log, then stop. The presence of an installer or a successful NSIS exit code alone does not prove that the application runs.

3. Manual acceptance on the real machine

  1. In a separate test account or VM, record the Windows version, x64 architecture, source SHA, and SHA-256 of the file to install.
  2. Install for the current user. Verify the program directory, icon, Start-menu entry, and normal startup without disabling system security. If policy blocks installation, record the message and stop; the maintainer decides what to do next.
  3. Use a test project and your own model configuration to complete a real model task. Check the response, task status, and actual result. If file tools are being validated, run one supported file task in a temporary workspace; screenshots and logs must contain no secrets or private data.
  4. Exit normally, restart the application, and confirm that the project, session, and configuration return. Then test startup after a system restart.
  5. If the Chrome extension is in scope, verify the Windows Browser Host/extension connection and recovery after an application restart separately. Office document interoperability must use the corresponding native application; the presence of driver files is not operational acceptance.
  6. Uninstall and confirm process exit plus cleanup of Ling's own Chrome/Chromium Native Messaging registry entries and manifest. Record which user data remains; do not delete existing workspaces or other Hosts manually.
  7. Return PASS / FAIL / BLOCKED with installation, startup, model-task, restart, and uninstall results plus redacted screenshots/logs. Record any step that did not run. Do not describe a Mac static check as a Windows measurement.

The default candidate has no bundled Cua Driver provider. Computer Use, lock-screen control, Windows multi-monitor/DPI behavior, accessibility, production signing, and SmartScreen must be validated separately within their real acceptance boundaries; basic startup and a model task do not establish those capabilities.

Scope boundary for this round

CI quota, main-branch protection, and the security-reporting entry point are paused under the current maintenance plan; this document does not configure or modify those online settings. Candidate files remain local, are not uploaded automatically, do not create tags or GitHub Releases, and are not described as formally signed. Before publishing an installer, complete third-party notices/SBOM for the actual package contents and the corresponding platform distribution acceptance.