Commit Graph
88 Commits
Author SHA1 Message Date
Abdessamad Derraz 88ea3d58ad refactor: one naming style per package 2026-11-24 03:46:21 +01:00
Abdessamad Derraz c0d85cca0b refactor: grouping returns its labels and moves 2026-11-24 03:38:59 +01:00
Abdessamad Derraz 02c33be3b5 fix: read catalog coverage under the database 2026-11-24 02:19:13 +01:00
Abdessamad Derraz 1c4d26e939 refactor: move installed sections into sitegen
model.systemnames keeps the pure section functions. The sections a site run installs, their heading ids and their generation now live in sitegen.runsections, replaced per run and dropped once the site inputs change.
2026-11-24 02:19:03 +01:00
Abdessamad Derraz 08fbeff62f fix: read a source declared gone at its mirror 2026-11-24 02:18:53 +01:00
Abdessamad Derraz 3abe6862e2 fix: read the release record through siteinputs 2026-11-24 02:18:40 +01:00
Abdessamad Derraz 40dadc5dcd fix: one rule for the held file a hash names
The system index read sha1 and md5 only, the file lookup any index
with no size bound, the gap table any index unbounded. declared_records
in model.database follows the resolver: a crc32 names only a record of
the declared size, and beside a stronger hash only what it names.
systems.json gains 511 held files declared by sha256 or crc32, and 41
MAME members no longer point at Chihiro's ver1305.bin through the crc32
of an erased flash block.
2026-11-24 02:18:40 +01:00
Abdessamad Derraz f143a8719b fix: publish only the registry the loader merged
The platform API rebuilt the registry by subtracting keys, so the
rom folders the loader attaches (_roms_root, _rom_folders) leaked into
every platform's published registry. model.platforms now says which
registry fields it merged and which per-entry tags it adds.
2026-11-24 02:18:40 +01:00
Abdessamad Derraz 1631ad0f4d refactor: one loader for the rom-folder sources 2026-11-24 02:18:40 +01:00
Abdessamad Derraz dfc1860d0d fix: record a data tree's version beside its cache 2026-11-24 01:14:04 +01:00
Abdessamad Derraz 83e810d1b3 fix: let core.upstream refuse requests offline
RETROBIOS_OFFLINE was read by six callers and never by the network
gateway: a caller that did not pass offline=True sent the request,
untokened. core.offline holds the rule, open_retrying refuses with
OfflineError and the cached reads answer as an offline run. The callers
read the same predicate, and the tests that fake the network clear the
variable for themselves (tests.ONLINE).
2026-11-24 00:20:03 +01:00
Abdessamad Derraz 387ca39a9d fix: site reads citations through the shared walk
sitegen.sources had its own walk of a profile: it skipped string list
items and read a repository prefix as part of the path, so prboom-plus
and future-pinball-fploader citations that profile_sync tracks were
neither recorded in source-paths.json nor linked. The walk moves to
model.citations, which collect_citations, cited_paths and
link_prose_citations all read.
2026-11-24 00:20:03 +01:00
Abdessamad Derraz 5d8320f735 fix: watch the source rom folders are read from 2026-11-24 00:20:03 +01:00
Abdessamad Derraz dedbde7917 fix: pack readme reads the guides of its run
model.guides took its platforms folder from the site's inputs, so a pack built with --platforms-dir printed the manual and install commands of the repository's guides. The loaders now take the folder (or the install address) explicitly; sitegen.guidedata binds them to the site's inputs, the pack README to the run's platforms folder, the release notes and the site validation to the folder they were given.
2026-11-23 23:07:45 +01:00
Abdessamad Derraz 1ab22ec956 refactor: elect arcade boards in their own module
The board election, its lazy load and its cache sat in render, with the
cache flag in model.systemnames. sitegen.arcadeboards elects them into a
frozen ArcadeBoards, build.py installs them once the sections are the
run's, and render keeps the hrefs. systemnames counts its installs
instead of holding a board flag, and section_without_boards moves there.
The elected boards and the Arcade sections are identical before and
after on the repository's data.
2026-11-23 21:44:08 +01:00
Abdessamad Derraz e8b3cef5d5 fix: read the platform guides on first use
model.guides read and checked _registry.yml and _guides.yml at import,
from the repository: a pack build died on a registry entry without a guide
before parsing its options, and a site run on another platforms folder
took the repository's guides. The guides now load on first use, keyed on
siteinputs.current().platforms, behind accessor functions.
2026-11-23 21:02:46 +01:00
Abdessamad Derraz ed73caf489 fix: write rom-folder refs through one formatter 2026-11-23 21:02:27 +01:00
Abdessamad Derraz 0757698063 refactor: one owner for a launcher emulator list
The comma-joined emulator field of a launcher record was written in
eleven places and read in nine, four of them splitting on ", " with no
strip. model.launcherrecords joins and splits it, and every scraper,
resolve and packs reader goes through it.
2026-11-23 21:02:27 +01:00
Abdessamad Derraz 12c8d66163 refactor: read the clone map in one place 2026-11-22 02:26:45 +01:00
Abdessamad Derraz 04e1d2d3ab fix: name every export change on the site page
The run's summary and the exports page each built the sentence from their
own table, and the page dropped sizes and hashes removed and md5 lists.
Both now read one table of change kinds, and each report stores a count
per kind. The committed reports gain those counts from their own records.
2026-11-22 02:26:45 +01:00
Abdessamad Derraz 74c59ad3b9 fix: read installed_on from the run's profiles 2026-11-22 02:26:45 +01:00
Abdessamad Derraz a51e6d3e3c docs: drop three clause semicolons 2026-11-22 01:25:24 +01:00
Abdessamad Derraz d83ba31d31 fix: keep only judged evidence when reviewing 2026-11-22 00:58:05 +01:00
Abdessamad Derraz 0d44254504 fix: read site manifests and zips from the inputs 2026-11-22 00:58:05 +01:00
Abdessamad Derraz c07a47362e fix: decide offline once before the release check 2026-11-21 21:42:19 +01:00
Abdessamad Derraz 3779f07bb5 fix: write retrodeck repeats to each component
duckstation and retroarch both list the PS1 BIOS with one md5, and the
entry was filed under the first component read: an export correction
reached duckstation's manifest and left retroarch's line as it was.
component now lists every component that repeats an entry (a string for
one), and the exporter writes the entry back to each. A repeat is the
same name, path, hashes, native system and requirement: MAME's and
FBNeo's cchip.zip, or two required labels, stay two entries, since an
export corrects a line by its system and writes its requirement back.
Rescraped at components fcd0d729: 73 entries list two components, 9
come back as their own entries. install/retrodeck.json is unchanged.
2026-11-21 21:04:19 +01:00
Abdessamad Derraz 1593dfa85a docs: drop two clause semicolons 2026-11-21 16:59:28 +01:00
Abdessamad Derraz 69d29e786a fix: title pack systems from the given collection
system_titles read the site's installed sections, loaded from the repository's database.json and profiles, so a manifest built with --db and --emulators-dir titled its systems from another collection. The lookup now takes the console sections, and the manifest builds them from its own db, bios folder and profiles.
2026-11-21 16:43:46 +01:00
Abdessamad Derraz 8787f453c7 fix: return target skip notes, print them in scope
build_target_cores_cache printed its INFO notes itself, so expected_pack_names wrote notes about platforms nobody asked for. The notes come back with the cache and target_scope, the command-line wrapper, prints them.
2026-11-21 16:43:46 +01:00
Abdessamad Derraz 8780398518 fix: read targets from the config's own tree
resolve_platform_cores and offer_boards read the RetroArch and platform
targets under the repository, whatever --platforms-dir a run was given,
behind a process-long cache. load_platform_config now records the
directory it read (_platforms_dir), the resolver reads targets from it,
the cache is keyed on that directory, and downloadable_on takes it from
its callers. The key is kept out of the published registry export.
2026-11-21 16:43:46 +01:00
Abdessamad Derraz bce9abedc7 fix: read profile repositories from one model rule
The site permalinks read only source and upstream, so a profile whose
forge is gone (yuzu answers 451) linked nothing although profile_sync
judged it through its source_mirror. declared_repositories, pin_field
and the declared pin now live in model.profilerepos, read by both.
2026-11-21 16:43:46 +01:00
Abdessamad Derraz e6295aba88 refactor: move es_systems readers out of batocera
es_systems.yml readers move to scraper/es_systems.py, which the board
target scraper imports at load time instead of inside a function to dodge
the cycle. The _default.remove_cores list is target override data: it is
model.targets.not_cores, no longer a private name of batocera_scraper.
2026-11-21 16:43:46 +01:00
Abdessamad Derraz 036a6ebf29 refactor: reuse the shared helpers left copied
Copies of helpers the first pass created, replaced by the helper:
- source_yaml_file for our YAML sources (generate_db read them in the
  locale's encoding, a syntax error named no file);
- data_dir_registry_at in registry_bundles, platform_registry_at (new,
  beside load_platform_registry) in the manifest;
- DATA_DIRS_FILE for the registry path five modules spelled;
- load_optional_database, sha1_at, VERSIONS_FILE, installer_module;
- DerivedView where a cache was keyed by id() of a dict;
- count_text and series where a plural or a list was written by hand.
2026-11-21 10:31:29 +01:00
Abdessamad Derraz b8fe881327 fix: place system pages by the reviewed sections
The site placed a system page through an index of folders only, while
own_section reads the folders plus the reviewed parents. The Atom has no
folder of its own and was placed on the BBC Micro section while every link
named its Atom section. Both now build their index from section_pairs_of,
and a test checks every id against own_section on the repository data.
2026-11-21 10:30:59 +01:00
Abdessamad Derraz 7bc02025dc refactor: share the cli mode conflict table
model.cliargs.mode_conflicts holds the mode, --standalone, --target and --no-game-data rules verify and generate_pack read, each adding its own flags. verify --all --system --standalone is now refused instead of dropping --standalone. Summary, listing and pack counts go through count_text (no more "1 platforms" or "0 data directory").
2026-11-21 10:30:51 +01:00
Abdessamad Derraz b6bd585ee4 refactor: name the platform's own core build
The Recalbox and RetroPie exporters each rebuilt the folded core-name
index that model.profiles provides, and kept one claimant of a contested
name by load order (Recalbox the first, RetroPie the last). Neither read
built_by.

Both now read core_key_index through BaseExporter.core_profiles, and
model.profiles.platform_core_profiles chooses: the builds the platform
ships itself (built_by), all of them, else the claimants no platform
builds on its own, the profile keyed by the name first. platform_builds
carries the first half, shared with resolve.launchers.

Recalbox names that change: amiberry and libretro/amiberry
(amiberry-5.6.5, ROCKNIX's build, to amiberry-8.2.2), libretro/pcsx2
(lrps2-416291a, Batocera's, to pcsx2-libretro-408e3b2), bare pcsx2 (to
the standalone pcsx2), libretro/px68k (px68k-sdl, RetroPie's standalone,
to px68k), libretro/dosbox_pure (dosbox-pure-unleashed to dosbox_pure),
libretro/vice_x64, x64sc, x128, xvic (vice to each own core). A name no
profile of the written build claims falls back to either build:
es_bios.xml writes libretro/fba2x for piFBA, a standalone binary.

RetroPie: the amiberry package now stands for Amiberry 5.7.2 and 6.3.3,
the two builds RetroPie compiles, instead of the generic profile.
2026-11-21 10:30:51 +01:00
Abdessamad Derraz 331f244aac refactor: find held records by the resolver rule
The gap report counted a file held on any crc32 hit, without the declared size and even against a contradicting stronger hash. The pack check split md5 lists by hand and took a loose ROM for the member a zipped_file md5 names. Both now ask held_record_for, the resolver's hash steps. The pack check still compares whole digests, as Batocera does, so a cut md5 names a file without satisfying it.

records_for_hash returns every held record an index value names. The variant search reads it instead of its own kind-to-index table. Any one accepted value still nominates a candidate there, because the validation index merges what several emulators accept and their own checks judge each file.
2026-11-21 10:30:40 +01:00
Abdessamad Derraz 4acfd8f763 refactor: read mame release tags in the model
The tag and version helpers lived in the romset DAT importer, so the site cards, which may not import a scraper, matched the label with their own pattern. model.mamerelease now owns mame_tag, mame_version and tag_version. Both scrapers and the cards call it. check_freshness only lifts tags out of labels and converts nothing, so it keeps its own search.
2026-11-21 10:30:22 +01:00
Abdessamad Derraz 8a8fa71fbc refactor: route network access through upstream
Branch heads (scrapers, FBNeo import, data directories) resolve through
core.upstream.resolve_head, with cache_dir=None to keep nothing under
.cache/upstream. Streaming downloads (large files, external pack files,
data directory archives, scraper downloads, standalone probe) go through
one core.upstream.download: scratch then rename, size cap, retries of a
cut stream, a 5xx or a rate limit. The shared rate limit wait reads
GoatCounter's X-Rate-Limit-Reset, so site insights, download.py,
indexnow and the contributor list use the same retrying client.

list_gitlinks raises TruncatedListingError on a partial tree, read
from one tree walk shared with list_tree (Forgejo paging included).
The Recalbox configs/ listing is paged with the shared page cap.
2026-11-21 10:30:13 +01:00
Abdessamad Derraz 02969dda06 refactor: read declared hashes with one helper
core.hashing.declared_hash_lists gives an entry's declared values per
field in the order written, and declared_hashes builds its sets on it.
The gap page, the doubled-destination report and the file lookup used
their own copies of that reader. The wanted page keeps its filters on
top of it. sitegen.lookup.hash_pairs replaces sorted_hash_values for
the lookup, the data exports and the structured data. The one-field
aliases parse_md5_list and reconcile.hash_values are gone, and
model.profiles reads HASH_FIELDS instead of a fourth tuple.
2026-11-21 10:29:37 +01:00
Abdessamad Derraz ea68e85c06 fix: stop profile loading when pyyaml is missing
load_emulator_profiles warned and returned no profile, so every command reported zero coverage and exited 0. It now goes through model.safeparse.require_yaml: the one-line message and exit 1 the other loaders give.
2026-11-21 10:29:37 +01:00
Abdessamad Derraz 71776198e9 refactor: move profile kinds to their own module
model.systems kept an inline copy of reads_own_files because model.profiles imports it. The predicates live in model.profilekinds, which both import, and model.profiles re-exports them. sitegen.build reads lists_files instead of its own launcher/alias tuple.
2026-11-21 10:29:37 +01:00
Abdessamad Derraz 36f2d1129e fix: accept a platform whose siblings lack a file 2026-11-21 06:45:11 +01:00
Abdessamad Derraz 96539e353c fix: let verify report on --all --system
verify refused --all --system as mutually exclusive while generate_pack
builds a --system pack per platform. Both now resolve the list through
model.cliargs.resolve_system_ids and scope the platforms through
resolve.cores.platforms_with_systems: a platform without the system is
skipped under --all and refused under --platform, with the note on
stderr so verify --json stays a document.
2026-11-21 06:04:31 +01:00
Abdessamad Derraz b52c7cfafb fix: share listing and region parsing in CLIs
verify and generate_pack read --region, comma lists and the listing
modes through model.cliargs (requested_regions, comma_list, LISTING_FLAGS,
refuse_beside_mode, run_listing). verify --list-emulators --list-systems
printed the first listing and exited 0; it now refuses the second as
generate_pack does.
2026-11-21 06:04:31 +01:00
Abdessamad Derraz ee66aa4e66 fix: scope --target the same way in every tool
slots and cross_reference go through model.targets.target_scope, so a
mistyped target ends with ERROR and exit 1 as in verify, where they
exited 2. The platforms --all skips are noted on stderr, which kept
slots --json from printing them ahead of its document. slots reads the
mode through platform_mode and builds the ZIP index and data-directory
registry once per run instead of twice per platform.
2026-11-21 06:04:31 +01:00
Abdessamad Derraz 3467b80b38 fix: check every romfolders source_ref
model.romfolders.source_refs walks every ref a setup carries, offers[]
and searched_by[] included, which the three hand lists in
validate_schemas and the tests skipped: 4176 refs were never matched
against the declared sources. validate_schemas parses them with
split_refs and reports a malformed part.
2026-11-21 06:04:31 +01:00
Abdessamad Derraz ed19ae4198 fix: accept only registered platforms
require_platform checks the registry instead of any platforms/<name>.yml:
verify --platform _shared reported 0/0 present and exited 0. --all and
--platform resolve through model.cliargs.selected_platforms in auto_fetch,
generate_truth, diff_truth, export_native and verify. The truth directory
is core.paths.TRUTH_DIR for its writer and its three readers, and the
remaining literal database and profile paths read core.paths and
add_repo_inputs.
2026-11-21 06:04:31 +01:00
Abdessamad Derraz 9f9fe2bfec fix: stop auto_fetch on a mistyped --db 2026-11-21 06:03:55 +01:00
Abdessamad Derraz 437690d4a8 refactor: place systems by the section index 2026-11-21 06:02:44 +01:00