WIP: test(mods): exercise the documented RomFS file contract #93
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
needs measurements
question
testing wanted
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!93
Loading…
Reference in a new issue
No description provided.
Delete branch "mooki/Longshot:test/mods-romfs-contract"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Mod authors need an example of the file route Longshot already supports, without mistaking co-op's internal hooks for a mod interface. This documents that route and runs its authored example through the real loader without a game dump. See #42.
WIP, based directly on main; independent of pull requests 51 and 68. This is documentation and test coverage, not a new loader or mod format. It does not settle the later chest-table, bridge, catalog or native-module decisions.
What changed
docs/mods.md: the current RomFS contract, with source symbols, discovery depth, whole-relative-path precedence, disabling, restart requirements, resource-size/prompt interaction and limitations. A JSON block describes invented text files for a game-free example; it is test input, not a manifest read by Longshot.tests/test_mods_size_table.py,documented_example_checks: materializes that exact documentation example in a temporary folder and runs the existing compiledhost/mods.c/host/prompts.cfixture. Six fresh processes check explicit/default roots, nested discovery, full-path order, non-conflicting files, case/slash lookup, ignored ExeFS, disabled parents and fallback after disabling every file mod. Selected file contents are checked, not just log messages.README.md, Mods: corrects “folder name” to the whole relative path, says to restart after changes, and links the author guide.Flags and settings
No new switches, options, menu rows or command-line flags. These existing settings are documented and exercised, not changed:
HOS_MODSmodsbeside the executableHOS_FS_OVERLAYThe existing test driver's
--ccand--sourceoptions are unchanged. No new setting needs a switch-reference entry.Measurements
main:
77f605a25f(2026-11-12)this PR: move/mods/romfs-contract @
36539b7fa0Suite totals: main 509 passed, 0 failed, 19 skipped; this PR 509 passed, 0 failed, 19 skipped.
Hardware: Linux 7.2.15-1-omarchy, x86_64; Python 3.12.16, GCC 16.2.1. No GPU used for the named fixture.
Scene: invented text files and resource tables, not a running game.
Method: one expanded named-driver run against this PR's source, then one against main's source. The existing
--sourceoption selects main'shostdirectory; the documentation and new assertions remain this PR's in both runs. The whole game-free suite ran once on the exact final head. Main's full-suite receipt is the shared run on the pinned base. Times below are receipts, not a speed comparison; there were no interleaved timing pairs.How to reproduce:
python -I -B tests/test_mods_size_table.py; repeat with--sourcenaming thehostdirectory of a checkout at the stated main commit. Run the complete suite withpython -I -B tests/run_all.py --jobs 6 --strict.77f605a2536539b7faBoth named runs print:
Whole-suite output, main then this PR:
Passing against main is expected: this records existing behavior, not a runtime bug fix. The previous updater reference-pack failure is not inherited here; main removed that updater test. The 19 skips remain explicit platform/device/dump requirements, not passes.
Testing
Tested: Linux execution of the expanded
tests/test_mods_size_table.pyon this branch and with main's loader source, including selected bytes from the exact documented example. Whole game-free suite on the final commit: 509 passed, 0 failed, 19 skipped. Existing source rules and table/prompt checks are retained; no C fixture source or compiler command changed.Not tested: a game build or game run, a real Clawshot seed, progression, real controller prompts, native Windows execution, macOS filesystem behavior, or an unknown mod's safety. This driver already skips filesystem routing on Windows and macOS; a passing table-only run there would not prove the new example. No native-module, chest-table, checked-location, grant or Archipelago compatibility claim. No performance claim.
Needs other testers:
Screenshots
Nothing on screen. The example uses invented paths the game never requests, so a screenshot would not prove the contract.
Risk and rollback
The risk is misleading documentation or a fixture expectation that drifts from the loader. The example is read from the guide itself and checked through the real loader; the guide separates established behavior from proposals and warns that file mods are not a sandbox. Reverting this commit removes only docs and test coverage. It changes no installed files, saves or runtime defaults.
Reviewer notes
Start with
documented_example_checksand the example table indocs/mods.md; comparehost/mods.c'sfind_mods,mod_cmp,hos_mods_initandhos_mods_romfs. The nested example deliberately makes a folder named00-nestedwin over02-override, demonstrating that the whole relative path is compared.Pull request 51 is the shared menu text editor, not the earlier Mods-tab proposal. Pull request 68 builds core co-op on it;
coop_on_eventis not a native-module ABI. This branch needs neither head. They also edit the README, but not its Mods section; this change does not touch their code.Maintainers still need to choose the chest-table versus bridge-first direction, progression/save/conflict ownership, community recipes versus an official catalog, trusted native modules versus companions, and co-op module-first versus core-first. This test-only slice does not choose for them.
No game proof is needed to establish this documentation/test change: production behavior is unchanged. Before claiming current Longshot/Clawshot compatibility, a separate proof should run a locally generated seed for up to five minutes with a copied save, check a known changed reward and controller prompts, then restart for one minute with the mod disabled and confirm the original route. That run has not been requested or performed here and would not prove the higher tiers.
Issues
See #42
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.tests/that reads changed source updated in this PR, not weakened.New on this forge; not opened on GitHub.
Assisted-by: GPT-6 Astra
Co-Authored-By: GPT-6 Astra [email protected]
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.