Repository navigation
feat: US-001+US-002 - External companion: snapshot from parsed save + external save path resolution (Domain) - #7
Merged
Conversation
ExternalSavePathResolver (PKForge.Domain/ExternalSavePaths.cs): pure path algebra, no I/O — existence is checked by the caller through an injected Func<string,bool>, so 'no save on disk yet' yields an empty list (the companion's no-save mode) instead of crashing. - CandidatePaths(romPath, emulator): all candidates, most likely first. Conventions registry (extensible IReadOnlyDictionary) covers RetroArch (sibling .srm/.sav, then RetroArch/saves), melonDS (sibling .sav, then melonDS folders + Android/data), Azahar/CitraMmj (sibling .sav + NAND nand/data/<titleid>/save/00000001 when the ROM name carries a 16-hex title id), Dolphin (individual .gci only, never memory cards), and a default sibling convention (.sav/.srm/.dsv/.bin + 'main') for the rest. - ExistingPaths(romPath, emulator, fileExists): only what exists; empty when none. - Null/empty romPath -> empty list, never throws. Paths normalized to '/'. 12 xunit tests: per-emulator conventions, title-id extraction, separator normalization, no-directory ROM, empty-list degradation, registry extensibility. prd.json: US-002 passes=true. progress.txt: appended learnings (pure-path pattern with injected existence check, Path normalization, GeneratedRegex partial, emulator save layouts). Co-authored-by: Varonal <Varonal@users.noreply.github.com>
… the emulator-specific extension is present Co-authored-by: Varonal <Varonal@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary (US-002)
ExternalSavePathResolverinPKForge.Domain/ExternalSavePaths.cs— pure path algebra, zero I/O: existence is checked by the caller via an injectedFunc<string,bool>, so "no save on disk yet" returns an empty list (companion's no-save mode), never a crash.CandidatePaths(romPath, emulator)→ all candidates, most likely first;ExistingPaths(romPath, emulator, fileExists)→ only existing ones.Conventionsregistry covering RetroArch (sibling.srm/.sav, thenRetroArch/saves), melonDS (sibling.sav, then melonDS folders +Android/data/...), Azahar/CitraMmj (sibling.sav+ NANDnand/data/<titleid>/save/00000001when the ROM name carries a 16-hex title id), Dolphin (individual.gcionly — never memory cards, consistent withEmulatorSaveHeuristics), plus a default sibling convention (.sav/.srm/.dsv/.bin+main) for DraStic/Linkboy/PizzaBoy/Eden./on any host.ExternalSavePathsTests.cs: one per convention, title-id extraction, separator normalization, no-directory ROM, empty-list degradation, registry extensibility.prd.json: US-002passes: true;progress.txt: appended learnings.Verification
dotnet test tests/PKForge.Domain.Tests -c Release+dotnet build src/PKForge.App -f net10.0-android..srm/.savthe external emulator writes.