Skip to content

Refactor patch management and add ownership safeguards - #211

Draft
xXJSONDeruloXx wants to merge 2 commits into
mainfrom
safe-patch-refactor
Draft

Refactor patch management and add ownership safeguards#211
xXJSONDeruloXx wants to merge 2 commits into
mainfrom
safe-patch-refactor

Conversation

@xXJSONDeruloXx

Copy link
Copy Markdown
Owner

Summary

  • Split the Python backend into focused bundle, configuration, Steam discovery, filesystem, and patch-ownership services, leaving main.py as a small Decky façade.
  • Keep those runtime services under the template-supported py_modules/services path so Decky includes them in the installable archive and adds them to Python's import path.
  • Add schema-2 patch markers with relative target paths, managed-file hashes, verified backups, and conservative legacy cleanup.
  • Propagate AppID unpatch cleanup failures instead of reporting success and preserve the marker when cleanup is unsafe.
  • Add an explicit global frame-generation backend setting (auto or Nukem's DLSSG → FSR3) and apply it to new/repatched game INIs.
  • Abort AppID patching when Steam launch-option APIs cannot safely read/write the existing options.
  • Remove the unused commented Installed Games render path and replace the placeholder test command with backend unit tests.

Scope and compatibility

The executable-selection heuristics and existing non-atomic shared-bundle install behavior are intentionally preserved. Top-level bundle uninstall behavior is also unchanged; this PR does not attempt to solve patches remaining after removing ~/fgmod.

Legacy markers and markerless/manual patches are handled conservatively: cleanup removes only files that can be tied to the bundle or an ownership hash, leaves unrelated plugin/D3D12 files in place, and refuses to remove modified managed files.

Validation

  • pnpm test — 4 backend safety/configuration tests pass.
  • pnpm build — frontend bundle succeeds.
  • python3 -m py_compile main.py py_modules/services/*.py tests/test_backend.py.
  • bash -n defaults/assets/fgmod.sh defaults/assets/fgmod-uninstaller.sh.
  • .vscode/build.sh — full Decky package build succeeds.
  • out/Decky-Framegen.zip passes unzip -t, contains the expected root metadata, dist/, bin/, runtime assets/, and py_modules/services/, and has no backend/, node_modules, .git, out, or __pycache__ artifacts.
  • Import smoke test passes from the extracted archive using Decky's py_modules layout.
  • Containerized Decky package build was previously attempted but could not run because the local Docker daemon was unavailable; the full build now succeeds with Docker available.

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