Commit Graph
5830 Commits
Author SHA1 Message Date
Abdessamad Derraz ed6ae84d2c refactor: move generate_db logic into collection 2026-11-21 14:58:03 +01:00
Abdessamad Derraz 9de949dfdb refactor: name the truth directory once 2026-11-21 14:58:02 +01:00
Abdessamad Derraz 7ff8b5faf6 fix: read pipeline caches from the repository root 2026-11-21 14:58:02 +01:00
Abdessamad Derraz 985d07b97e refactor: move pipeline steps into orchestrate 2026-11-21 14:58:02 +01:00
Abdessamad Derraz 5be72484d8 refactor: move refresh_stale logic into freshness 2026-11-21 14:58:02 +01:00
Abdessamad Derraz 7203b5be84 fix: read targets and data from --platforms-dir 2026-11-21 14:57:45 +01:00
Abdessamad Derraz 88e39b6380 refactor: drop the unused core_info_names 2026-11-21 14:57:45 +01:00
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 8303c133ab chore: register five domain packages for commands 2026-11-21 13:49:07 +01:00
Abdessamad Derraz 6d7f81d010 fix: hold the 3.8 screen tests off build modules
The 3.8 run of tests.test_install_tui failed on 9ffbedbb1: installer_build
now caches with functools.cache, and test_install_offline imports
packs.parts, which reaches the core.cli floor exit. The card marker test
skips below 3.9 like the other build-script tests, and packs.parts loads
only above that floor.
2026-11-21 11:18:25 +01:00
Abdessamad Derraz 1561af6a4a chore: give the e2e fake response its headers 2026-11-21 10:54:45 +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 872ffc7cc6 chore: write recalbox and retropie exports again
Recalbox: kick33180.A500 (amiga600) and kick39106.A1200 (amiga1200),
whose element names the standalone amiberry only, are now written
mandatory="false". The name used to resolve to amiberry-5.6.5, a ROCKNIX
build that reads nothing in Recalbox's truth, so the platform's value
stood. It now resolves to amiberry-8.2.2, the build Recalbox ships, which
declares both as optional aliases of amiga-os-120.rom and
amiga-os-300-a1200.rom (required: false). 131 required flags aligned
instead of 129.

RetroPie: the amiberry package is no longer listed among the packages
no profiled core matches. Its help sentence already names every file
its two builds require, so no scriptmodule changes.
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 3518e1c53c chore: write native exports again
Regenerated from main with the cached platform originals before the
exporter change, so the next commit shows only what it moves.
2026-11-21 10:30:40 +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 780d40fb7b chore: refresh manifests for the ppsspp assets 2026-11-21 08:02:59 +01:00
Abdessamad Derraz 9ffbedbb12 docs: regenerate the readme 2026-11-21 07:12:32 +01:00
Abdessamad Derraz fc77b55144 chore: publish redream in the retropie x86_64 list 2026-11-21 06:45:11 +01:00
Abdessamad Derraz 6aee415098 chore: align three tests with the shared helpers 2026-11-21 06:45:11 +01:00
Abdessamad Derraz 6c0679095e chore: rebuild the site when new helpers change 2026-11-21 06:45:11 +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 589174c369 chore: move new tests onto the shared test helpers 2026-11-21 06:05:48 +01:00
Abdessamad Derraz 98775b7e4d refactor: share the loopback server of the tests
Each installer test module rebuilt the same loopback fixture: a silent SimpleHTTPRequestHandler, a ThreadingHTTPServer on a daemon thread with its two cleanups, closed_port(), noise() and the CRC-32 text. tests/loopback.py holds them once; handlers with their own behaviour (Slow, Range, Held) pass in as handler=. The test_install servers that set log_message on a functools.partial, which never reached the handler, now use the quiet one. The journeys comment says why their root stays in tmp/.
2026-11-21 06:04:40 +01:00
Abdessamad Derraz 13db912e52 refactor: read the heading level without a regex
mypy saw re.fullmatch() as optional. Splitting the hashes off the heading gives the same level and title.
2026-11-21 06:04:40 +01:00
Abdessamad Derraz d73afff852 fix: find generated pages through sitepages
test_release_packs looked for platforms/knulli.md, but the page is knulli.mdx, so test_a_built_setup_page_has_the_line always skipped, in CI too. Under the skip it asserted text the generator never writes: the glossary wraps ZIP in an <abbr>, and the heading is '## On the device { #install }', not '## Install'. It now reads the page through sitepages.page() after sitepages.require(), strips the glossary markup and looks for the #install heading. The single-page helpers of test_site_reference and test_site_emulators go through sitepages too, so a missing page fails in CI instead of skipping or reading as empty.
2026-11-21 06:04:40 +01:00
Abdessamad Derraz a58ca7bf6b refactor: one markdown section reader for tests
test_doc_surfaces, test_doc_pages, test_site_wiki and test_site_integration each cut a markdown section their own way. Two of them did not blank fenced code, so a shell comment such as '# from a checkout' in a bash block ended the section early and test_user_sections_never_send_to_verify could pass without reading the command below it. tests/mdsections.section() blanks fences and takes the stop level each caller used.
2026-11-21 06:04:40 +01:00
Abdessamad Derraz fbbb941e38 refactor: one owner for the test scratch folder
Test modules passed dir= the repository's tmp/ or a hard-coded tmp/tests by hand, and seven modules kept their own _tempdir copy. Under run_tests.py the literal tmp/tests did not exist in a fresh clone (FileNotFoundError in test_core_probe and scratch_checkout), and dir=tmp/ wrote beside the per-module scratch folders. Every temporary directory now lands in the folder tests/__init__ sets, and scratch_dir() replaces the copies. The X socket binds by a relative name, since a scratch path can exceed the 108-byte AF_UNIX limit. The journeys keep the short tmp/ root: their word budgets count the printed card path.
2026-11-21 06:04:40 +01:00
Abdessamad Derraz ec50bf6b41 fix: say why a local list beside --manifest fails
An oversized or unreadable standalone layout said "not valid: Expecting
value", and an unreadable target list read as absent, so the offline
run asked for the file already there. One reader of a capped local JSON
file now says the cause: unreadable, too large or not JSON.
2026-11-21 06:04:39 +01:00
Abdessamad Derraz 8d2f71b026 fix: say why no list is found on the screen too
With RETROBIOS_REF on a tag that has no list, line mode named the
variable and the way out. The screen said only that there is no list at
this address, and gave no advice with the default revision either. Both
now read the same advice.
2026-11-21 06:04:39 +01:00
Abdessamad Derraz 68378b4423 refactor: join names and date records in one place
Five sentences joined names by hand beside _names_and, the plan counted
"more systems" beside _plural, a record stamped its time beside
_record_now, and the record day and the backup day each formatted a
date. Each now calls the one helper.
2026-11-21 06:04:39 +01:00
Abdessamad Derraz f412f7803d chore: keep two blank lines after part names 2026-11-21 06:04:39 +01:00