Werkzeug-Updates
Katalog, Prüfung und Aktivierung verwalteter Werkzeuge.
Technical reference synchronized with Yard’s source. File names and development commands refer to the native app repository.
Keep coding tools up to date now checks and updates Yard-owned Codex, Claude Code and OpenCode, including
Codex's matching companion. The approved catalog is embedded in the running Yard release and shared with
NativeRuntimeSetup; “current” means current against that catalog, not the vendor's unrestricted latest release.
New versions require reviewed URLs, SHA-256 pins and compatibility approval in a Yard release. No global
self-updater, floating install script, remote unsigned “latest” lookup or invented release feed is used.
The app schedules a check on startup and hourly while enabled; a verified pending update is retried every 30 seconds until consumers are idle. Settings → AI shows current, pending, installed, failed and user-managed states, and can check the approved catalog explicitly. Switching the preference off starts no checks or installs. A check already downloading may finish its private transfer, but rechecks the persisted preference before activation and final validation; disabling prevents publication or restores the prior aliases. Unreadable/malformed settings and read errors cannot opt into the fallback default: automatic work stays off, the original settings bytes and custom CLIs are preserved, and no update status/cache is created by that check.
Ownership and compatibility
The shared installation is YARD_HOME/agents, normally ~/Library/Application Support/Yard/agents.
Studio detection, terminal PATH and the engine resolve its bin/ aliases consistently. Per-project runtime
environment overrides retain their own priority when applied to a project command. Yard updates only aliases
which point into packages/<tool>/<version>-<architecture>/ and have a matching yard-install.json receipt.
Regular files, external symlinks, user configured executables and user account directories are never replaced.
Legacy tools under bin/tools without ownership receipts remain usable and are not silently adopted.
The scope is the three coding tools and required companions. PHP, Node versions, Git, Python, browser dependencies and project package-manager pins retain their existing installers. Coding tool versions do not select Studio web resources. OpenCode's actual installed version still chooses its v1/v2 launch and account commands; the updater does not infer a protocol from a tool name.
Activity, publication and recovery
ManagedRuntimeLease uses a close-on-exec shared/exclusive filesystem lock across processes. Studio holds a
shared lease before model/account preparation and until its child group settles; terminals hold theirs for
their owned process group. Model discovery also holds a lease. NativeProcess and direct OwnedRuntimeProcess
consumers protect engine worker/benchmark commands. Activation takes an exclusive lease: an existing consumer
defers the update, and a racing new operation fails with an actionable busy message rather than starting
halfway through replacement. Consumers with no managed runtime do not create an installation just to run.
The shared setup install.lock serializes initial installation and update staging. Transfers use the existing
verified artifact stager: SHA-256 is checked before extraction, executable paths are confined to the payload,
and a cached pending archive is reverified before reuse. Candidate and activated --version health checks
must report the approved exact version; they never invoke authentication or a model. Rejected partial/corrupt
downloads are discarded so a later check can fetch again. The app does long work on a background task.
Activation copies a complete version into a new immutable package directory, records a recovery journal and
atomically renames aliases while holding the exclusive lease. Companion and main aliases form one recoverable
transaction. A failed final health check restores every previous alias. After interruption, the next managed
consumer recovers the journal under the exclusive lease before starting, even if automatic updates are now
off. Invalid/manual edits in that journal are rejected, never interpreted as arbitrary writable paths.
Pending/installed/failed results are persisted privately in agents/updates/status.json.
Old packages are retained, including a failed candidate which may be safely reused only if its entire
tree still matches the verified staged artifact. This protects external sessions and makes rollback possible.
Checks also inspect running executable paths to defer while an external managed CLI/auth process is visible.
Copilot account actions reserve a shared lease before checking their arguments and opening Terminal. The
opencode-auth-session wrapper then retains its own lease through actual CLI exit and owned-group cleanup.
Its private nonce-bound request/result/cancel protocol records process IDs and real exit status; OAuth output
stays on the inherited interactive terminal and is never written to the receipt. Cancellation before a late
Terminal launch prevents execution, and active cancellation/expiry stops only the owned child group. A real
PTY fixture verifies input, output and foreground process-group handling with a fake CLI and no credentials.
Third-party processes launching binaries
directly do not participate in Yard's leases; their old package is retained, not overwritten or deleted.
No automatic package garbage collection is implemented. Account logins, chats and provider credentials are
outside this transaction and remain untouched.
Evidence
NativeRuntimeUpdatesTests uses an isolated home with spaces and local fixture artifacts. It exercises toggle
off, an idle upgrade and idempotent check, busy-to-idle scheduling/cache reuse, a real engine child and a
separate process holding the activity lock, checksum and candidate/final-health failures, rollback, blocked
racing consumers, preference changes during download, user-owned files and interrupted-publication recovery.
RuntimeSetupTests continues to verify the shared initial installation path. NativeRuntimeTimeoutTests and
RuntimeComparisonTests cover the process ownership paths affected by the lifetime hook.
ManagedToolConsumerTests launches fixture-only terminals and a Studio preparation (no real model) to prove
their lifetime leases, exclusion during activation, clean shutdown and shared app/engine executable resolution.
All fixture homes and ports are private; no user's CLI, app, resolver, Keychain or service is updated.
There is no production signed tool feed yet. If future independent delivery is desired, reuse
VerifiedUpdateManifest for publisher-authenticated metadata and add reviewed compatibility/rollback policy;
do not turn a vendor release-list response into automatic installation authority.