SURGICAL UPSTREAM SYNC - 23 OCTOBER 2026

Git bases
Original local main: 34ed57ae97ef46759e5b23aa8d7a1e7ec89f3f56.
Reviewed upstream: d94b05ff2ab0d8f7e239cd45a29a9fc95c62c72a.
Six commits, 21 first-party files, PRs 66-69. All upstream changes are merged
without rewriting them. The existing 212 game patch files are checkpointed
separately. Unrelated library-workflow work and .wrangler cache stay untouched
and are not swept into the game commit. No push/publication is performed.

Pipeline scope
The new layer composes after lobby-restoration. It stages three final C++
translation units and three includes outside the repository. It copies only
reviewed upstream regions; it does not replace entire accepted source bodies.

PR 69
The DKRCustomTracksCore input comes from the frozen Mod Store source, not the
updated checkout. Copy upstream's ID predicate, the install-time guard and the
copy/swap/restore region into that final input. Preserve the accepted ZIP
locator, wrapper/HD-pack handling, artwork, adapter and all unrelated code.

PR 68
Replace only the Performance presets card in the final all-detail graphics
include. Add upstream's matching_preset/preset_anisotropy helpers to the frozen
header; retain apply_preset and the other budget helpers. Pin these two includes
in the final UI translation unit. Every online/lobby and unrelated UI include
and body remains unchanged, including Maximum Vehicle Detail help and controls.

PR 66
Carry the Darwin TLS declaration/definition regions into the frozen runtime
code-mod source/header. Include the matching declaration first so the old
transitive include guard cannot claim it. Windows/Linux keep thread_local as
before. No dispatcher policy, callback body, hook table or guest code is edited.
The remaining build/test/platform improvements arrive through the Git merge.

PR 67
Preserve the upstream macOS packaging/notarization changes without invoking
them, adding credentials or producing an Apple package.

Frozen reconstruction
The frozen 1.0.7 capsule manifest and existing capsules are not rewritten.
Their deltas are pinned to historical checked-in source. After an upstream
change, reconstruct with restore_capsule.py: it obtains only mismatching bases
from the pinned pre-sync Git commit and verifies each against the original
manifest before applying the unchanged delta. Missing history fails closed.
No network fetch, checked-out source rewrite or hash rebaseline is performed.

Validation
The original backup manifest remains the baseline. The audit accounts for the
21 upstream paths against both pinned Git trees and the verified recovery ZIP;
every other pre-existing file must retain its exact bytes. The original lobby,
Store Vehicles, Rollback, invitation, spectator and all-player detail audits
remain enabled. Playtest 6 source contracts must match. Final source composition
is reproduced exactly and linked feature markers/package contents checked.
Compilation and static inspection only; no game/mod/test/AppImage execution.

Build
Use configure.py --build <existing-compatible-build> --capsule <verified-capsule>
--log <new-log> [--cmake <cmake>], then build target DKRPortGame. Qualifications
are explicitly off. package.py uses the retained allowlist and creates fresh
Windows ZIP/Linux AppImage directories with receipts and checksums.

Fresh capsule reconstruction command (one command):
python -B patches/upstream-sync/restore_capsule.py --output <NEW-capsule>
  --camera-kernel-v77 <prepared-camera-v77>
  --camera-kernel-v80 <prepared-camera-v80>
  --shadow-kernel-v77 <prepared-shadow-v77>
  --shadow-kernel-v80 <prepared-shadow-v80>

All checked-out dependencies, RecompiledFuncs, RecompiledPatches, existing
authored patch layers and the accepted frozen capsule remain untouched by the
new pipeline. No unrelated cleanups or feature changes belong in this layer.
