Commit Graph
2854 Commits
Author SHA1 Message Date
Abdessamad Derraz 8a2ef047ab refactor: move check_freshness logic to freshness 2026-11-21 14:57:45 +01:00
Abdessamad Derraz 5fa802a3c5 refactor: move schema checks into a package 2026-11-21 14:57:45 +01:00
Abdessamad Derraz 1227152bef refactor: import the artifact lock once 2026-11-21 14:57:17 +01:00
Abdessamad Derraz 84bad2e271 chore: add the five command packages 2026-11-21 13:49:33 +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 32a4ca1fa1 fix: read .variants archives as archives
A .variants copy is named set.zip.<md5 prefix>, and five checks of a
collection path tested endswith(".zip"): the zipped_file contents index
skipped all 278 copies (658 member md5s held nowhere else), the pack added
them without the member CRC test, and the archive acceptance count gave
them -1. They now use is_archive_path. In the index a member a primary
archive holds answers with the primary, as the resolver prefers it.
2026-11-21 10:31:11 +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 15f913d0ba fix: accept a size list beside a size window
A profile entry that declares exact sizes and a min_size/max_size window
now accepts either, as the code it transcribes does. size_refusal let the
exact size outrank the window, so LinApple's ROMs (12288 to 65536 bytes),
the ZEsarUX QL ROM (16 KB floor) and MesenCE's BS-X.bin (32 KB floor) were
held to the one dump size. Master.dsk lists the two lone sizes the sector
image probe also takes. Truth, the core refusal message and the emulator
cards read the same rule.
2026-11-21 10:30:59 +01:00
Abdessamad Derraz 4d62c56730 feat: cross_reference --all --target
--target without --platform keeps every platform with the target, each narrowed to the cores it builds for it, as verify and generate_pack read --all --target. --all is accepted as the explicit whole-tree scope. Remaining CLI plurals go through count_text ("1 name", "+1 record").
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 6f510be49a refactor: share the probe commit reader
packprobe.git_head reads HEAD through core_probe.head_commit, the reader frontend_identity uses, and warns when git cannot answer instead of recording None silently.
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 74fcdd2bc5 refactor: read archive members in one place
core.ziptools.zip_members lists the name, size and crc32 of each member once per archive revision. The site lookup and cards, the gap report, the pack check, the romset importer, the recipe identification and build, provenance, derivations and the atom pool read it instead of opening each archive again.

Each reader also tested a .zip suffix and skipped the .variants/ copies (x.zip.1a2b3c4d): the site lookup listed no member of a copy, the gap report's member index never saw one, the pack check never compared a copy's members, and the pack builders copied a copy without its CRC test. They now use is_archive_path. The inner ROM index of the resolver reads copies too, and a copy answers only for a member no primary holds.
2026-11-21 10:30:40 +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 526d7f09c7 fix: accept each listed hash of a download
download_external compared the digest with the field as a string, so a list or a comma-joined field never matched. It reads the strongest declared field with declared_hash_lists and accepts any of its values. The release asset lookup reads the same helper instead of its own copy.
2026-11-21 10:29:37 +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 f10fa21d17 docs: split clause semicolons in new comments 2026-11-21 06:45:11 +01:00
Abdessamad Derraz 36f2d1129e fix: accept a platform whose siblings lack a file 2026-11-21 06:45:11 +01:00
Abdessamad Derraz bac3070228 fix: register every romfolders format 2026-11-21 06:45:11 +01:00
Abdessamad Derraz b338d94fa0 fix: record no narrowing axis for an older list
A list with cores and neither systems nor regions is from an older
release, and recorded_axes reads none from it. A pack built here or by
generate_pack wrote cores and regions in its manifest. The installer
pack now asks recorded_axes, and the builder follows the same rule.
2026-11-21 06:04:39 +01:00
Abdessamad Derraz 83b1976903 refactor: read old branches through acquire
migrate --include-branches and the acquisition search list the legacy
platform branches with acquire.fetch.legacy_branch_files and read them
with legacy_branch_blob: one branch list (migrate lacked libretro), git
run from the repository root wherever the command started.
2026-11-21 06:04:39 +01:00
Abdessamad Derraz e636614ae3 refactor: read pipeline output with shared walkers
The four generate_pack parsers walk the lines under a full pack's header
through one generator, and the two verify parsers the lines under a
summary through another. The three offline comparisons hold the policy
through resolve.packfiles.offline() and read their inputs from one
setup function; platformpack is imported once.
2026-11-21 06:04:31 +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 8255d94e75 fix: fetch pack_probe content like the campaign
probes.content.fetch_content and find_romfetch serve ContentStore and
pack_probe: RETROBIOS_ROMFETCH is honoured, a transient romfetch exit is
retried, the run has a timeout in its own process group, and an exit
without a JSON error block no longer raises KeyError.
2026-11-21 06:04:23 +01:00
Abdessamad Derraz d2984bc466 fix: start core_probe one way from every probe
pack_probe and region_check run core_probe through probes.host.run_when_idle:
a busy refusal is retried until the wait runs out, a timeout kills the
run's whole process group, and pack_probe takes core_probe's own probe
lock, which honours RETROBIOS_PROBE_LOCK_HELD. core_probe names its busy
exit status EXIT_BUSY.
2026-11-21 06:04:23 +01:00
Abdessamad Derraz 922d60807f refactor: share frontend_identity with core_probe 2026-11-21 06:04:16 +01:00
Abdessamad Derraz 4f6bb08e2a fix: print byte counts with size_text 2026-11-21 06:04:16 +01:00
Abdessamad Derraz 49a8ed801e refactor: read input paths from core.paths 2026-11-21 06:04:08 +01:00
Abdessamad Derraz 9f9fe2bfec fix: stop auto_fetch on a mistyped --db 2026-11-21 06:03:55 +01:00
Abdessamad Derraz a34949d9e4 fix: share the gap report scope with the site 2026-11-21 06:03:37 +01:00
Abdessamad Derraz a119efc149 fix: pair gaps rows with the entry they score 2026-11-21 06:03:21 +01:00
Abdessamad Derraz a9d8e571c1 refactor: join name lists through core.text 2026-11-21 06:03:21 +01:00
Abdessamad Derraz 77ba6868a0 refactor: count nouns through core.text 2026-11-21 06:03:21 +01:00
Abdessamad Derraz 4585e3ffea refactor: write card anchors through one helper 2026-11-21 06:03:21 +01:00
Abdessamad Derraz 4e67868e11 refactor: name site addresses in sitegen.config 2026-11-21 06:03:21 +01:00
Abdessamad Derraz 8db5bf6cf0 refactor: build the readme zip table in one place 2026-11-21 06:03:14 +01:00
Abdessamad Derraz be63c6575a refactor: read setup display names in one place 2026-11-21 06:03:03 +01:00
Abdessamad Derraz 8f29887bda refactor: read manifest systems once per platform 2026-11-21 06:02:56 +01:00
Abdessamad Derraz 3f33b1c247 refactor: read recipe snapshots in one place 2026-11-21 06:02:44 +01:00
Abdessamad Derraz 437690d4a8 refactor: place systems by the section index 2026-11-21 06:02:44 +01:00
Abdessamad Derraz e79d2404bc refactor: cut site pages in parts in sitegen.parts
card_runs, the share loop, the card weight and the part stems and links were copied in startwith, systempages, emulatorpage and platformfiles. sitegen.parts gives weighted_runs, even_runs, part_stems and part_links; the cuts are unchanged for every block list the site passes.
2026-11-21 06:02:44 +01:00
Abdessamad Derraz 53d49bd002 refactor: name release assets in largefiles only
The dotted spelling, the download URL and the sha256 listing were rebuilt by release.assets, release.check and sitegen.cards. model.largefiles gives asset_spellings, asset_url, RELEASE_DOWNLOAD and digests_of. The release notes link is now URL-quoted like every other.
2026-11-21 06:02:44 +01:00