gdk_runtime_calls: validate table lookup shapes (GDK-TABLE-SHAPE) #1119

Open
github-bot wants to merge 1 commit from github-bot/gh-1119 into main AGit
Owner

@⁠Taffyyy-ops on GitHub · 2026-11-24 18:50 UTC · original
Taffyyy-ops:fix/gdk-table-shape → main · +77 −0 · 2 files · 1 commits · open

Item ID: GDK-TABLE-SHAPE

Validates the JSON structure of GDK class/interface tables in tools/gdk_runtime_calls.py:RuntimeTable.__init__() before opening or inspecting any PE image.

Changes

  • tools/gdk_runtime_calls.py (RuntimeTable.__init__): Validates that the parsed document is a dict, that classes and interfaces are dicts, that each entry is a dict, and that every entry's id is a non-empty str, raising a descriptive ValueError on malformed inputs.
  • tests/test_gdk_table_shape.py: Adds synthetic tests covering non-dict roots, non-dict classes/interfaces, non-dict entries, and missing/empty/non-string id values before PE inspection.

Verification

  • AI-assisted; synthetic tests only, no game data (python -I scripts/check_no_game_data.py).
**@⁠Taffyyy-ops** on GitHub · 2026-11-24 18:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1119) `Taffyyy-ops:fix/gdk-table-shape` → `main` · +77 −0 · 2 files · 1 commits · open Item ID: `GDK-TABLE-SHAPE` Validates the JSON structure of GDK class/interface tables in `tools/gdk_runtime_calls.py:RuntimeTable.__init__()` before opening or inspecting any PE image. ### Changes - **`tools/gdk_runtime_calls.py` (`RuntimeTable.__init__`):** Validates that the parsed document is a `dict`, that `classes` and `interfaces` are `dict`s, that each entry is a `dict`, and that every entry's `id` is a non-empty `str`, raising a descriptive `ValueError` on malformed inputs. - **`tests/test_gdk_table_shape.py`:** Adds synthetic tests covering non-dict roots, non-dict `classes`/`interfaces`, non-dict entries, and missing/empty/non-string `id` values before PE inspection. ### Verification - AI-assisted; synthetic tests only, no game data (`python -I scripts/check_no_game_data.py`).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:39:15 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 18:56 UTC · original · approved these changes

Reviewed and verified. Robust validation of classes and interfaces JSON dictionary structure in tools/gdk_runtime_calls.py:RuntimeTable.__init__. Fails cleanly with descriptive ValueError before reading PE images. Verified with tests/test_gdk_table_shape.py. 100% clean-room.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 18:56 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1119#pullrequestreview-6045429410) · **approved these changes** Reviewed and verified. Robust validation of `classes` and `interfaces` JSON dictionary structure in `tools/gdk_runtime_calls.py:RuntimeTable.__init__`. Fails cleanly with descriptive `ValueError` before reading PE images. Verified with `tests/test_gdk_table_shape.py`. 100% clean-room.
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:16 UTC · original

Recommendation: [MERGE]

Reasoning: gdk_runtime_calls validates table lookup shapes before using them, with a synthetic test. Tool-only hardening (+11). The description is a one-liner; please give future PRs a fuller description. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 2/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1119#issuecomment-7143274641) **Recommendation:** [MERGE] **Reasoning:** `gdk_runtime_calls` validates table lookup shapes before using them, with a synthetic test. Tool-only hardening (+11). The description is a one-liner; please give future PRs a fuller description. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 2/10
Author
Owner

@⁠Taffyyy-ops on GitHub · 2026-11-25 10:44 UTC · original

@⁠abnalstlll-byte @⁠Deedlyy Thanks for the review and [MERGE] recommendation! Updated the PR description with a full summary of the RuntimeTable.__init__ shape checks and tests/test_gdk_table_shape.py.

**@⁠Taffyyy-ops** on GitHub · 2026-11-25 10:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1119#issuecomment-7160120047) @⁠abnalstlll-byte @⁠Deedlyy Thanks for the review and `[MERGE]` recommendation! Updated the PR description with a full summary of the `RuntimeTable.__init__` shape checks and `tests/test_gdk_table_shape.py`.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1119/head:github-bot/gh-1119'
git switch 'github-bot/gh-1119'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1119'
git switch 'github-bot/gh-1119'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1119'
git switch 'github-bot/gh-1119'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1119'
git switch 'main'
git merge --squash 'github-bot/gh-1119'
git switch 'main'
git merge --ff-only 'github-bot/gh-1119'
git switch 'main'
git merge 'github-bot/gh-1119'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.