Commit Graph
79 Commits
Author SHA1 Message Date
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 8a9591dad2 refactor: judge a data hit on the indexed roots 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 19681a3735 refactor: move ten command helpers into packages 2026-11-21 15:47:20 +01:00
Abdessamad Derraz 7623e49981 refactor: import the pipeline step labels 2026-11-21 15:31:35 +01:00
Abdessamad Derraz d4dfa18c9e docs: name sitegen.diagrams in the site comments 2026-11-21 14:59:03 +01:00
Abdessamad Derraz f158f1d485 refactor: move the site image tools into sitegen 2026-11-21 14:59:03 +01:00
Abdessamad Derraz c17d0e0cec refactor: move the demo recorder into sitegen 2026-11-21 14:59:02 +01:00
Abdessamad Derraz 985d07b97e refactor: move pipeline steps into orchestrate 2026-11-21 14:58:02 +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 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 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 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 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 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
Abdessamad Derraz ccd440f67a refactor: load install.py as a module in one place
The event schema, the installer doc, the launcher index, the site and the README each executed install.py with their own importlib block. installer_build.module.installer_module is cached and read by all five.
2026-11-21 06:02:35 +01:00
Abdessamad Derraz f5946a7845 refactor: define the pack suffix once
packs.parts held a second PACK_SUFFIX and five builders typed the literal; all read model.releaserecord.PACK_SUFFIX.
2026-11-21 06:02:28 +01:00
Abdessamad Derraz 87329ca7ee fix: refuse a second installer pin line
pinned_sha256 in installer_build.pins reads the one pin of a bootstrap and refuses any other count. stale_pins, build_port, the launcher index, the PyPI build and the site bootstraps all read it: three of them took the first line, while sh runs with the last.
2026-11-21 06:02:28 +01:00
Abdessamad Derraz 30113783c9 fix: hold the repository for source-paths.json 2026-11-21 06:02:11 +01:00
Abdessamad Derraz 198e2b2dc7 refactor: parse platform source urls in one place 2026-11-21 06:02:11 +01:00
Abdessamad Derraz 2308039452 fix: read a database record by its path field 2026-11-21 06:01:46 +01:00
Abdessamad Derraz db9a153832 refactor: place app files by the layout rule 2026-11-21 06:01:40 +01:00
Abdessamad Derraz e3294d08ea fix: decide standalone builds from standalone_set 2026-11-21 06:01:19 +01:00
Abdessamad Derraz b4075bf1ad refactor: build the entry_source index once 2026-11-21 06:01:19 +01:00
Abdessamad Derraz 8bfa188960 fix: build github api headers with forge_headers
download.py read GITHUB_TOKEN only and missed the gh login token, the
readme built its header by hand, and the large files listing cached one
failed request as an empty release for the whole run.
2026-11-21 06:00:45 +01:00
Abdessamad Derraz 6df0ec503b refactor: stamp site data with build_timestamp 2026-11-21 05:59:58 +01:00
Abdessamad Derraz 91b27854c8 refactor: name the emulator profile filters 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 8fdc00e07f refactor: look up a path's sha1 with sha1_at 2026-11-21 05:59:51 +01:00
Abdessamad Derraz 82d3f595de refactor: read data/.versions.json in one place 2026-11-21 05:59:51 +01:00
Abdessamad Derraz eef13547e1 refactor: share one derived-view cache 2026-11-21 05:59:51 +01:00
Abdessamad Derraz f025264f4e refactor: link platform lists through permalinks
ListSource.browse builds file links with source_permalink, which quotes
the path. A list read at no revision still links the repository, and a
GitLab list with no path now links its tree instead of a blob URL
ending in a slash.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz e6e4095081 refactor: read the site build commit in one place
sitegen.config.build_commit (GITHUB_SHA in CI, HEAD locally, a full
commit id or an error) replaces the copies in bootstrap, pagemarkdown
and dataexports.

The page stamps now refuse a GITHUB_SHA that is not a commit id. The
data exports now name GITHUB_SHA when it is set, and still name no
commit outside a checkout.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz ab0805e6cb refactor: print sizes with one function
core.sizes.size_text replaces readme format_size, release record
size_text, render fmt_size, the large-files notes _mib and the handheld
_size. It prints one decimal in the largest unit reached, as the site
and the installer already did.

The README download table, the release notes and the large-files page
now say 29.2 MB where they said 29 MB, a handheld archive says 85.3 KB
where it said 85 KB, and a large-files asset under 1 MB is given in KB.
2026-11-20 20:03:26 +01:00
Abdessamad Derraz cf03dcb2ef refactor: share CLI options and default paths
core.paths holds the default database, platforms, emulators and bios paths, core.cli declares the options built on them (add_repo_inputs) and the --emulator/--system modes verify and generate_pack share. model.targets.target_scope answers --target for a command line, model.profiles.no_profile_for_systems the system with no emulator. tests/sources.declared_options reads the options a script declares through either form.
2026-11-20 18:28:46 +01:00