Skip to content

Review mirror: Linux-hosted build, authoring tools, and server workflow#1

Open
LAP87 wants to merge 5 commits into
mainfrom
codex/linux-port
Open

Review mirror: Linux-hosted build, authoring tools, and server workflow#1
LAP87 wants to merge 5 commits into
mainfrom
codex/linux-port

Conversation

@LAP87

@LAP87 LAP87 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Purpose

This is the Codex-review mirror for the Linux port submitted upstream as Okaetsu/PalSchema#126. Both PRs point at current head 8f6fdefed7117e34c46d65216540fe8ec0e02172 and are ready for maintainer review.

Delivered scope

  • Linux-hosted clang-cl/xwin Win64 Dev and Shipping builds
  • structural PE/ABI/VERSIONINFO/security verification before deploy or package
  • durable, interruption-recoverable Proton/Wine deployment and rollback using atomic directory exchange
  • Wine runtime fallbacks for signature scanning and file watching
  • repeatable isolated Win64 Dedicated Server smoke and hot-reload harness
  • cross-platform JSON/JSONC CLI, schema registry, LSP and VS Code extension
  • multi-root editor support, incremental watch validation and bounded/debounced diagnostics
  • Debian, Ubuntu, Fedora, openSUSE and Arch/CachyOS source-check matrix
  • explicit UE4SS, UEPseudo and generated-game-data non-bundling boundaries

Review hardening

Two adversarial Codex rounds produced 44 review threads in total. All threads are resolved, each actionable finding has regression coverage where practical, and the final review of 8f6fdef reported: “Didn't find any major issues. Nice work!”

Hardening includes fail-closed /proc scanning, atomic live-mod exchange, fsynced transaction/cache publication, recursive symlink containment, staged schema-pack replacement, static schema checksums, decoded PE resources and fixed version identity, output-alias protection, pinned xwin and MSVC action versions, credential-free PR checkout, serialized/isolated VS Code lifecycle, stale-diagnostic suppression, diagnostic bounds, canonical schema IDs and destructive copy-overlap guards.

Verification

  • final public release gate passed: syntax/integrity checks, npm audit, typechecks, all tests, CLI/LSP validation, VSIX build and npm package build
  • authoring tools: 13 TypeScript unit tests plus 14 CLI/LSP/integration tests
  • VS Code extension: 3 lifecycle/multi-root tests
  • PE verifier: 5 tests with 11 contract-field mutation subtests, plus verification of both built DLLs
  • deployment/bootstrap/process guards include interruption, race, symlink, cache and relative-command-line regressions
  • clean-container matrix passed on Debian stable, Ubuntu 24.04, Fedora latest, openSUSE Tumbleweed and Arch latest
  • full clean 552-step Dev cross-build passed; Shipping cross-build and packaging passed
  • Dev and Shipping packages contain no UE4SS, UEPseudo or runtime-generated Palworld schemas
  • isolated Win64 Dedicated Server under Wine passed 5 startup/shutdown cycles plus 3 hot-reload cycles with 22/22 signatures and 13/13 loaders
  • the same DLL was smoke-tested in the installed Palworld client under Proton
  • GitHub public checks are green; private Windows/xwin dependency jobs intentionally run only from trusted main pushes

Runtime boundary

UE4SS remains a separate user-managed runtime installation. This repository does not bundle UE4SS, UEPseudo, Microsoft SDK payloads or generated Palworld game data.

The verified Linux-host path still produces a Win64 DLL for Palworld under Wine/Proton. Downstream native Linux UE4SS experiments may accept CppUserModBase/main.so at the loader boundary, but PalSchema's native Linux signatures, layouts, hooks, threading and teardown have not been pinned and verified; native PalServer-Linux-Shipping parity is therefore not claimed here.

LAP87 commented Jul 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please perform a deep, adversarial, whole-PR review of this Linux port. Treat this as release-critical mod-development infrastructure, not a style pass. Inspect both commits and follow data/control flow across C++, CMake/shell, GitHub Actions, the schema registry/validator, LSP, and VS Code extension.

Primary acceptance goal: a Linux host must be able to build and package the same Win64 PalSchema UE4SS C++ mod used on Windows, safely deploy/rollback it for the Palworld client or Win64 Dedicated Server under Proton/Wine, and use the new authoring tools across major Linux distributions. UE4SS, UEPseudo, Palworld-derived data, and proxy DLLs must never be bundled.

Please try hard to find concrete correctness, security, portability, ABI, lifecycle, race, and false-confidence issues. In particular:

  1. Wine scanner workaround

    • Verify that detecting ntdll!wine_get_version is safe and portable for this Win64 target.
    • Analyze the temporary mutation of SinglePassScanner::m_multithreading_module_size_threshold for races, reentrancy, integer width, restoration on every exit path, exception safety, and effects on native Windows.
    • Check whether synchronous scanning preserves signature results and whether another scanner invocation could observe the temporary global value.
    • Look for a smaller or safer mechanism already exposed by RE-UE4SS.
  2. C++ initialization and teardown

    • Trace every callback from constructor failure through on_ui_init, on_unreal_init, destructor, file watcher, hooks, registries, and static objects.
    • Check use-after-free, callback-after-destruction, partially initialized state, double teardown, thread shutdown ordering, and unload behavior.
    • Flag Windows ABI/import/export, runtime-library, PDB, or exception-model mismatches between MSVC upstream assumptions and clang-cl/lld-link.
  3. Build reproducibility and PE contract

    • Audit bootstrap/build/verify/package scripts for unsafe downloads, checksum gaps, quoting, whitespace paths, symlink traversal, TOCTOU, partial caches, concurrent runs, stale artifacts, tool-version selection, missing commands, and non-Bash assumptions.
    • Check xwin SDK/UCRT selection, linker flags, delay imports, subsystem, architecture, security mitigations, exported symbols, debug/shipping separation, and whether verification could pass the wrong DLL.
    • Validate behavior on Arch/CachyOS, Debian/Ubuntu (including version-suffixed LLVM binaries), Fedora/RHEL-family, and openSUSE.
  4. Deployment and rollback

    • Adversarially test target auto-detection and explicit client/server modes.
    • Review /proc/*/cmdline traversal for races, permission failures, descriptor leaks, argument matching bypasses, false positives/negatives, and Wine/Proton command-line variants.
    • Check atomicity, backup identity, rollback target binding, interrupted deployment, path containment, malicious symlinks, spaces/newlines, stale backups, concurrent deploys, and protection of UE4SS/other mods.
    • Confirm the scripts cannot accidentally modify a native Linux server or deploy while the selected Win64 process is active.
  5. JSON/JSONC schemas and CLI

    • Validate JSON Schema draft semantics, $id/$ref resolution, integer vs number behavior, additionalProperties, diagnostic locations, JSONC comments/trailing commas, malformed inputs, and duplicate/ambiguous schema selection.
    • Audit config discovery and precedence: --schema-dir > environment > nearest project config > bundled schemas.
    • Test absolute/relative paths, nested workspaces, symlinks, home/root traversal, watch-mode churn, deleted/renamed files, ignored support files, strict-generated behavior, stable exit codes, and machine-readable output.
    • Ensure missing generated Palworld schemas are never silently treated as complete validation and that index checksum handling cannot weaken static schema integrity.
  6. LSP and VS Code extension

    • Exercise real stdio framing, incremental edits, document lifecycle, cancellation, concurrent requests, shutdown/exit, invalid initialization options, workspace changes, multi-root behavior, Windows paths, URI decoding, and diagnostic clearing.
    • Confirm the client activates only for intended PalSchema loader paths and does not lint every JSON file in a user's editor.
    • Compare completion, hover, symbols, and formatting results with the CLI's schema/config selection so editor and command line cannot disagree.
    • Audit bundling for missing runtime files, accidental dev dependencies, dynamic path assumptions, executable bits, and offline operation.
  7. CI, secrets, and supply chain

    • Verify that pull requests from forks cannot access private submodule credentials or cause secret-bearing checkout/build execution.
    • Check action pin/version validity, npm lifecycle-script exposure, dependency/audit policy, artifact path injection, generated artifact provenance, retention, and whether public CI actually tests the source that is packaged.
    • Ensure no UE4SS binaries, dwmapi.dll, private UEPseudo content, generated Palworld data, credentials, local paths, or test-server files can enter ZIP/VSIX/npm artifacts or git history.
  8. Claims and documentation

    • Cross-check every support claim against implemented behavior and tests.
    • Be especially strict about the boundary between the verified Win64 server under Wine/Proton and native PalServer-Linux-Shipping.
    • The current documentation says the experimental downstream does not provide the full CppUserModBase ABI. Verify this claim against NullPrism/RE-UE4SS-Linux v0.1.0, which now reports native CppUserModBase/main.so acceptance, and flag the documentation if it is stale or overly broad.
    • Flag commands that are distro-specific, destructive, unsafe for an existing server, incomplete for SteamCMD/Wine, or likely to go stale.

For each finding, provide severity, exact file/line, a realistic failure scenario, and the smallest robust fix. Distinguish blockers from follow-ups. Do not report speculative style preferences. If an issue depends on RE-UE4SS or Palworld behavior, inspect the pinned code/config in this PR and state the assumption precisely. Also identify missing tests that would have caught each issue. End with a clear merge recommendation and a list of claims you were able to independently substantiate.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e7cece557

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/deploy-proton.sh
Comment thread scripts/deploy-proton.sh Outdated
Comment thread scripts/deploy-proton.sh Outdated
Comment thread scripts/package-linux.sh
Comment thread tools/palschema-tools/src/validator.ts
Comment thread tools/palschema-tools/src/jsonc-document.ts Outdated
Comment thread tools/palschema-tools/src/validator.ts
Comment thread tools/palschema-tools/src/lsp-server.ts Outdated
Comment thread tools/vscode-palschema/scripts/build.mjs Outdated
Comment thread .github/workflows/build.yml
@LAP87

LAP87 commented Jul 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please perform a fresh, adversarial re-review of current HEAD d2436fd4fa9852373bd8f1217e84721cb104b138. Do not reuse or summarize the review of old HEAD 0e7cece; inspect the complete diff against main plus the entire remediation commit.

The first pass reported 23 findings. Explicitly verify, with file-and-line evidence, that the new code closes every category: fail-closed /proc visibility; interruption journal recovery; rollback staging; PE verification during packaging; checksummed public static schemas; per-target config resolution; symlink-cycle handling; stale LSP diagnostics; VS Code multi-root isolation; activation gating; accurate native-Linux support claims; schema-index traversal; PalSchema-specific PE identity/version; non-persisted checkout credentials; runtime validation of LSP options; serialized watch runs; NDJSON watch output; atomic xwin cache publication; identical JSON/JSONC syntax policy; generated raw support schemas; offline resolution of HTTPS schema IDs; packaging allowlists; and Linux xwin CI coverage.

Then try to break the remediations themselves. Treat these as trust boundaries and attack them:

  1. palschema init --force, schema copying and schema lookup with malicious symlinks, .., absolute paths, support patterns, malformed indexes, overlapping source/destination trees and symlinked ancestors.
  2. deploy-proton.sh with process-start races, unreadable /proc, concurrent deploys, SIGTERM/power loss at every rename, malformed/missing/symlinked transaction backups, rollback failure, no previous install, and paths escaping UE4SS.
  3. bootstrap-linux.sh with concurrent processes, partial/legacy xwin caches, interrupted directory swaps, offline reuse, version-suffixed LLVM tools and license gating.
  4. verify-win64-artifact.py with a wrong architecture, non-DLL PE, wrong exports/imports, spoofed strings outside VERSIONINFO, wrong ProductName/ProductVersion, missing mitigations and version drift.
  5. CLI watch, LSP and VS Code extension under rapid edits/restarts, multi-root settings, failed client start, document close races, large error sets, generated raw schemas and hostile schema IDs.
  6. GitHub Actions and distro containers for credential exposure, fork safety, mutable host-cache poisoning, unpinned/untrusted execution, artifact path errors and jobs that silently skip required public checks.
  7. Package contents for accidental UE4SS, UEPseudo, Microsoft SDK, private submodules or runtime-generated Palworld schema leakage. Those components must stay external.

Important context to avoid false positives: private-submodule Windows and Linux-xwin jobs are intentionally restricted to trusted pushes to main, so fork PRs must show them skipped. The public source gate is the required PR check. UE4SS is deliberately not bundled and users install it separately. The supported Linux route builds a Windows DLL and runs it under Proton/Wine; it does not claim a stable native Linux UE4SS C++ ABI.

Report only concrete P0/P1/P2 defects that remain on this exact HEAD. For every finding, include a reproducible failure path and explain why existing tests do not catch it. If a previous finding is fully fixed, do not repeat it. If no actionable defects remain, say that plainly and state whether the 23-finding remediation is complete.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2436fd4fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/palschema-tools/src/cli.ts Outdated
Comment thread tools/palschema-tools/src/cli.ts Outdated
Comment thread scripts/verify-win64-artifact.py
Comment thread scripts/verify-win64-artifact.py Outdated
Comment thread scripts/deploy-proton.sh Outdated
Comment thread tools/vscode-palschema/src/extension.ts Outdated
Comment thread scripts/deploy-proton.sh
Comment thread scripts/bootstrap-linux.sh
Comment thread scripts/verify-win64-artifact.py Outdated
Comment thread scripts/test-win64-server.sh Outdated
@LAP87

LAP87 commented Jul 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please perform a fresh, adversarial review of current HEAD 8f6fdef. Do not review or repeat findings from d2436fd; every one of that round's 21 comments has been remediated in this commit.

First verify the actual fixes for all prior findings:

  1. palschema init --force replaces the complete schema directory via a staged atomic directory swap, so absent generated schemas/support files cannot remain stale.
  2. Generated top-level schema sources must be regular, non-symlink files canonically contained in the source pack.
  3. PE file and DLL characteristics are parsed only from ImageFileHeader/Characteristics and ImageOptionalHeader/Characteristics; decoy imports must not satisfy them.
  4. VERSIONINFO is structurally decoded, including exact StringFileInfo keys and VS_FIXEDFILEINFO product version; nearby decoy strings must not pass.
  5. Live mod replacement uses Linux renameat2(RENAME_EXCHANGE) plus a post-swap /proc scan and restores the previous complete tree if a target starts during the swap.
  6. Markerless legacy xwin caches are never certified from representative files.
  7. --install-rust-toolchain selects the PalSchema-local rustup/cargo/rustc even when system Rust exists.
  8. xwin install is pinned and verified as 0.9.0.
  9. ilammy/msvc-dev-cmd is pinned to reviewed commit 0b201ec74fa43914dc39ae48a89fd1d8cb592756.
  10. CI lists Dev and Shipping ZIP archives separately.
  11. watch-mode internal failures survive shutdown as exit code 2.
  12. current-version LSP diagnostics are cleared when validation throws.
  13. LSP publication is capped at 500 diagnostics.
  14. schema-index requires version/base metadata and canonical per-file IDs.
  15. rollback/recovery recursively rejects every nested symlink.
  16. JSONC trailing-comma documentation now matches runtime rejection.
  17. a broken multi-root workspace no longer tears down successfully started clients.
  18. deployment marker files and parent directories are fsynced before destructive state changes and before marker removal.
  19. xwin stage data and parent-directory rename ordering are flushed/fsynced before deletion of the prior cache.
  20. verifier JSON output rejects artifact aliases/hardlinks/symlinks and uses atomic replacement.
  21. the server smoke harness now uses the basename-aware, fail-closed /proc scanner and detects relative Wine executable arguments.

Regression coverage was added for stale generated-schema refresh, source symlink exfiltration, malformed/canonical index metadata, watch failure exit status, stale and bounded LSP diagnostics, independent multi-root startup, relocated PE flag decoys, decoded/fixed VERSIONINFO drift, verifier output aliases, markerless xwin caches, isolated Rust selection, nested backup symlinks, the process-start deployment race, and relative server command lines.

Attack the new implementation rather than trusting this summary. In particular try to find:

  • a state where init leaves a mixed old/new schema pack;
  • a symlink, hardlink, traversal, or rename alias that escapes a declared root;
  • a malformed PE/resource tree or llvm-readobj block layout that is incorrectly certified;
  • a crash ordering that leaves no complete live mod or no recoverable xwin cache;
  • a process-start interleaving that mutates a live mod non-atomically;
  • a watch/LSP race that publishes stale state or an unbounded JSON-RPC payload;
  • a supply-chain input in trusted CI that remains mutable or unverified;
  • a multi-root failure that still disables healthy folders.

Only report concrete P0/P1/P2 defects in the current diff. For every finding, provide the exact reachable path/reproduction and explain why existing tests miss it. If no actionable issue remains, say so clearly and react with 👍.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 8f6fdefed7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f6fdefed7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +7 to +10
if(DEFINED ENV{XDG_CACHE_HOME} AND NOT "$ENV{XDG_CACHE_HOME}" STREQUAL "")
set(_palschema_xwin_dir "$ENV{XDG_CACHE_HOME}/palschema/xwin")
elseif(DEFINED ENV{HOME} AND NOT "$ENV{HOME}" STREQUAL "")
set(_palschema_xwin_dir "$ENV{HOME}/.cache/palschema/xwin")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor the configured cache root in the xwin toolchain

When PALSCHEMA_CACHE_ROOT is overridden without also setting XWIN_DIR, palschema_configure_build_environment and bootstrap-linux.sh validate the SDK under $PALSCHEMA_CACHE_ROOT/xwin, but this toolchain independently selects $XDG_CACHE_HOME/palschema/xwin or $HOME/.cache/palschema/xwin. Consequently, scripts/build-linux.sh can pass its bootstrap check and then configure against a different, missing SDK directory. Derive the toolchain default from PALSCHEMA_CACHE_ROOT as well, or export the bootstrap-selected XWIN_DIR before invoking CMake.

Useful? React with 👍 / 👎.

Comment thread CMakePresets.json
@@ -0,0 +1,73 @@
{
"version": 6,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Lower the preset schema or raise the CMake minimum

The project and build documentation advertise CMake 3.22, but the CMake presets manual lists preset schema version 6 as added in CMake 3.25. On a supported 3.22–3.24 installation, every documented cmake --preset ... command therefore fails while reading this file, before cmakeMinimumRequired or the project can be evaluated. Use a preset schema supported by 3.22 or consistently require CMake 3.25 or newer.

Useful? React with 👍 / 👎.

Comment thread scripts/build-linux.sh
Comment on lines +13 to +18
configure_only=false

if (($# > 0)); then
shift
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse options before consuming the optional build flavor

Because the first argument is always assigned to build_flavor and shifted, the advertised default flavor cannot be used together with an option: scripts/build-linux.sh --configure-only treats the flag as an unknown flavor. The same parsing pattern in package-linux.sh makes scripts/package-linux.sh --output-dir dist fail even though its usage declares the flavor optional and initializes a Shipping default. Only consume the first token when it is dev or shipping, or parse flavor and options in one loop.

Useful? React with 👍 / 👎.

Comment on lines +43 to +48

if [[ "$incomplete" == true ]]; then
return 2
fi
return 1
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject hidden-process mounts before declaring the target stopped

On a host where /proc is mounted with hidepid=2, processes owned by other users are omitted from the glob entirely rather than producing an unreadable cmdline, so this function returns 1 and deploy-proton.sh interprets the scan as complete. If a dedicated server runs under a service account while deployment is performed by another account with write access to UE4SS, the script can therefore replace the live mod despite its stopped-process guard. Detect a /proc configuration that hides PIDs and fail closed, or otherwise establish that the scan has complete process visibility.

Useful? React with 👍 / 👎.

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