You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modernizes ManifestGenerationService to use the authoritative CSV game installation catalog (Generals-1.08.csv and ZeroHour-1.04.csv) rather than ad-hoc disk directory file discovery. Embeds the CSV registries and index metadata directly into GenHub.Core for offline fallback, enforces pristine vanilla manifests by excluding untracked non-vanilla files, and implements multi-language filtering.
Motivation
As outlined in the CSV suite plan (Phase 1), base game installation manifests must be generated strictly from authoritative file registry records with exact SHA256 hashes, sizes, and requirement flags to ensure deterministic CAS workspace materialization and eliminate corrupt/modded file contamination in base game manifests.
Changes
Core Assets: Embedded Generals-1.08.csv, ZeroHour-1.04.csv, and index.json directly into GenHub.Core as assembly resources for zero-latency, offline authoritative catalog loading.
Content Manifest Builder: Updated IContentManifestBuilder and ContentManifestBuilder (AddGameInstallationFileAsync) to accept optional precomputed hash, size, and isRequired flags, allowing fast, authoritative record population.
Manifest Generation: Refactored ManifestGenerationService.AddGameFilesToManifest to:
Query CsvResolver or embedded/local CSV fallbacks for authoritative records matching game type, version, and language.
We reviewed changes in 19678f2...be24d50 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
The reason will be displayed to describe this comment to others. Learn more.
Ternary expression used is too complex
The ternary operator ?: evaluates a boolean expression and returns the result of one of the two expressions, depending on whether the expression evaluates to true or false. While the ternary operator may be particularly useful in avoiding simple if statements, it can, however, affect the readability when nested. Therefore, it is recommended that you avoid nesting such operators.
• Builds installation manifests only from authoritative, versioned CSV catalog entries.
• Filters localized assets and resolves case differences, backups, hashes, sizes, and permissions.
• Embeds offline catalogs and tests pristine Generals and Zero Hour manifest generation.
Diagram
graph TD
A["Manifest Request"] --> B["Generation Service"] --> C["Language Detection"]
B --> D["Catalog Resolver"]
D -. fallback .-> E["Embedded Registries"]
C --> F["File Matching"]
D --> F
E --> F
F --> G["Manifest Builder"] --> H["Pristine Manifest"]
Loading
High-Level Assessment
The following are alternative approaches to this PR:
1. Remote resolver only
➕ Avoids shipping duplicate catalog data
➕ Allows catalog corrections without rebuilding the application
➖ Prevents deterministic offline generation
➖ Adds network availability and latency to a local workflow
2. Build-time generated registry
➕ Eliminates runtime CSV parsing
➕ Can validate catalog schema and checksums during compilation
➖ Requires a generation pipeline and generated model maintenance
➖ Makes catalog inspection and replacement less direct
Recommendation: Keep the layered resolver-first approach with embedded CSV fallback: it preserves remotely managed authority when available while guaranteeing offline operation. A build-time generated registry is worth revisiting only if runtime parsing or catalog validation becomes measurable operational risk.
Files changed (9) +933 / -193
Enhancement (4) +388 / -191
IContentManifestBuilder.csAccept authoritative file metadata in manifest builder API+11/-1
Accept authoritative file metadata in manifest builder API
• Extends game installation file addition with optional precomputed hash, size, and required-state values.
ContentManifestBuilder.csPropagate supplied file metadata into manifests+41/-10
Propagate supplied file metadata into manifests
• Stores caller-provided hash, size, and required flags while computing missing metadata from local files. Game installation files now receive hashes consistently rather than only for executables.
• Adds the versioned Generals installation catalog with canonical paths, sizes, checksums, language scopes, and required flags used to constrain manifest contents.
When an authoritative entry marked required is absent, generation only emits a debug message and
skips the entry. The caller then builds and registers a manifest with no record of that required
file, preventing downstream validation from reporting the missing installation dependency.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
The generation loop continues after logging a missing required entry, and only found entries are
added. GameInstallationService immediately builds and stores the resulting manifest without a
required-entry completeness check; validators can only inspect files present in that manifest.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Missing required catalog entries are silently omitted from the generated manifest.
## Issue Context
Treat a missing required source as manifest-generation failure, or preserve the authoritative required entry in a form downstream validation can check. Do not return a successful incomplete builder.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[702-712]
- GenHub/GenHub/Features/GameInstallations/GameInstallationService.cs[632-646]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Modified files become authoritative✓ Resolved🐞 Bug≡ Correctness
Description
Manifest generation ignores each catalog entry's authoritative Sha256 and Size, instead hashing
and sizing the selected local or backup file and recording those values in the manifest. A corrupted
or modded tracked file can therefore become the trusted baseline and pass later content validation,
defeating pristine authoritative catalog validation.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
The catalog model exposes authoritative Size and Sha256 fields, but the generation loop computes
localHash and uses FileInfo.Length from the selected local or backup file, then passes those
values to the builder. The builder's precomputed-metadata path persists them without comparison to
the catalog, and ContentValidator later checks installation content against that locally derived
manifest hash, allowing the same modified bytes to validate successfully.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`AddGameFilesToManifest` currently replaces the authoritative CSV catalog SHA-256 and size with metadata calculated from the selected local installation or backup file. This allows modified tracked files to define the expected baseline in newly generated base-installation manifests and pass later validation.
## Issue Context
`CsvCatalogEntry` already provides authoritative `Sha256` and `Size` values, and the builder accepts precomputed metadata for this flow. Compare the selected source, including backups, against the catalog metadata; local bytes may be hashed to determine whether a file should be omitted or reported as modified, but only entries satisfying the authoritative metadata should be emitted, and the catalog values—not locally calculated values—should be stored in the manifest.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[715-727]
- GenHub/GenHub/Features/Manifest/ContentManifestBuilder.cs[912-933]
- GenHub/GenHub.Core/Models/Content/CsvCatalogEntry.cs[16-32]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
3. Advertised languages lack records 🐞 Bug≡ Correctness
Description
The embedded index advertises DE, FR, ES, IT, KO, PL, PT-BR, ZH-CN, and ZH-TW, but both new
registries contain only All and EN rows. Automatic detection or selection of an advertised
non-English language therefore retains only language-neutral files, omits required localized
archives and movies, and still returns a successful but incomplete manifest that cannot materialize
the detected language's base game.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
Both index entries advertise eleven languages, while the added CSV rows use only All and EN.
MatchesLanguage retains an entry only when it is language-neutral (All) or exactly matches the
normalized requested language, so a DE, FR, or other advertised non-English request excludes every
EN-localized asset without finding a corresponding localized replacement; LanguageDetector can
nevertheless return those advertised codes based on language-specific files or directories.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Language filtering is enabled for detected or selected non-English installations, but the embedded registries contain no records for most languages advertised by the index. Filtering consequently retains only `All` entries and excludes required language-specific files, producing an incomplete manifest.
## Issue Context
The index declares support for DE, FR, ES, IT, KO, PL, PT-BR, ZH-CN, and ZH-TW in addition to the registry's available language values, and `LanguageDetector` can detect such codes from game directories and archives. Add authoritative language-specific rows for every advertised language or restrict each index language list so unsupported languages are neither advertised nor accepted; manifest generation should also reject a requested language when the selected registry does not support it.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[523-565]
- GenHub/GenHub.Core/Assets/Registries/index.json[7-16]
- GenHub/GenHub.Core/Assets/Registries/index.json[23-32]
- GenHub/GenHub.Core/Assets/Registries/Generals-1.08.csv[1-165]
- GenHub/GenHub.Core/Assets/Registries/ZeroHour-1.04.csv[1-176]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
View high (3) 4. Resolver parses index as CSV✓ Resolved🐞 Bug≡ Correctness
Description
The service sets SourceUrl to the JSON index and stores the actual CSV filename only in csvUrl
resolver metadata, while CsvResolver loads and parses SourceUrl directly without consuming that
metadata. The production resolver path therefore attempts to parse index.json as CSV, fails, and
silently bypasses the selected remote/current catalog in favor of the embedded fallback.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
The changed code assigns DefaultIndexFileUrl to SourceUrl and stores only the CSV filename under
CsvUrlMetadataKey. CsvResolver passes discoveredItem.SourceUrl to LoadCsvContentAsync and
parses the returned content as CsvCatalogEntry records, while its metadata readers never consume
csvUrl; the manifest service then catches the resolver failure and falls back.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`GetAuthoritativeEntriesAsync` in `ManifestGenerationService` gives `CsvResolver` the registry index URL instead of the selected CSV resource URL. Because the resolver downloads and parses `ContentSearchResult.SourceUrl` as CSV, it cannot resolve this request and falls back instead of using the selected remote catalog.
## Issue Context
The CSV filename is currently stored only under resolver metadata, but `CsvResolver` does not consume `CsvUrlMetadataKey` while loading content. Resolve the selected registry URL from the index and assign the actual absolute CSV URL to `SourceUrl`, or explicitly update `CsvResolver` to resolve and load the metadata URL before parsing.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[1012-1030]
- GenHub/GenHub/Features/Content/Services/ContentResolvers/CsvResolver.cs[51-70]
- GenHub/GenHub.Core/Constants/CsvConstants.cs[41-44]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Fallback CSV entries are accepted after only a non-empty path check, and FindFileCaseInsensitive
combines rooted or traversal paths directly with the installation path. A modified local fallback
catalog can therefore read, hash, and place an arbitrary file outside the game directory into the
generated manifest.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
The fallback filter validates only that RelativePath is non-empty plus game/language matching.
FindFileCaseInsensitive then feeds Path.Combine the record path and the generation loop hashes and
adds the resolved file. CsvResolver already has an IsUnsafeRelativePath guard, demonstrating that
equivalent validation is required on the newly added fallback path.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Fallback catalog relative paths are not validated or constrained to the game installation root before filesystem access.
## Issue Context
Reject rooted paths and traversal components, normalize the combined path, and verify it remains beneath the normalized installation root. Apply the same validation to every fallback record before adding it to the authoritative path set or manifest.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[571-608]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[693-702]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[1081-1085]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
6. Requested version is ignored✓ Resolved🐞 Bug≡ Correctness
Description
Both resolver and embedded fallback loading select a hard-coded Generals 1.08 or Zero Hour 1.04
catalog solely from gameType, ignoring the detected or explicitly requested version. As a
result, requests for any other version produce a manifest labeled with the caller-supplied version
but populated from the wrong release registry.
Hard-coding registry filenames by game type ignores the requested version and creates an incorrect
manifest baseline.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
The public path forwards the supplied version to GetAuthoritativeEntriesAsync, and the search
result and resulting manifest identity retain that version, but both resolver and fallback methods
derive csvFileName only from gameType. GameInstallationService passes its base client's
detected version through this public API, making the mismatch reachable for non-default
installations.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The requested manifest version is accepted and retained in the manifest identity, but it is not used to select or validate the authoritative catalog. Versions other than the hard-coded Generals 1.08 and Zero Hour 1.04 therefore receive files from the wrong registry while remaining labeled with the requested version.
## Issue Context
Game-installation callers pass the detected base-client version through to manifest generation. Resolve the catalog through index metadata using both game type and exact version; if no exact active registry or supported catalog exists, return no authoritative entries with a clear warning or otherwise fail generation instead of silently substituting another version.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[663-679]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[999-1005]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[1065-1071]
- GenHub/GenHub/Features/GameInstallations/GameInstallationService.cs[1009-1026]
- GenHub/GenHub.Core/Assets/Registries/index.json[5-37]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
CountExtraNonVanillaFiles catches every failure and returns 0, so recursive enumeration,
permission, and I/O errors are silently reported as no extra files. This hides an inaccurate
cleanliness result instead of handling specific expected exceptions.
+ catch
{
- logger.LogError(ex, "Error adding game files to manifest");+ return 0;
Relevance
●●● Strong
Bare catch returning zero hides filesystem failures and produces an inaccurate cleanliness result.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
Rule 3001350 forbids suppressing generic exceptions in non-boundary helpers. This private helper
recursively enumerates files and its newly added bare catch returns zero without logging or
rethrowing.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`CountExtraNonVanillaFiles` uses a bare catch and converts every failure into a successful count of zero.
## Issue Context
Catch only expected filesystem exceptions and make the degraded result explicit through logging or failure propagation; do not suppress unrelated exceptions.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[614-640]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
AddGameFilesToManifest catches generic Exception, logs it, and returns normally—and also returns
normally when no catalog entries exist—so failures during language detection, catalog loading,
filesystem access, hashing, or insertion are reported as successful generation.
CreateGameInstallationManifestAsync can consequently return an empty or partially populated
manifest that callers may build and register in the manifest pool.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
Rule 3001350 permits generic catches in non-boundary code only when the failure is rethrown, but
this private helper catches all exceptions, logs them, and returns without rethrowing; it also
returns when zero catalog entries are found. Its public caller then logs creation success and
returns the manifest builder, after which GameInstallationService builds the manifest and adds it
to the manifest pool, demonstrating how failed generation can be persisted as an empty or partial
success.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`AddGameFilesToManifest` suppresses all exceptions and returns normally when no catalog entries are available, allowing authoritative manifest generation to report an empty or partially populated manifest as successful.
## Issue Context
The helper is not a process boundary and must not suppress unexpected failures. Handle only concrete, expected exceptions where recovery is valid; otherwise propagate failures to `CreateGameInstallationManifestAsync`, or represent predictable domain failures with the project's result type or an explicit failed result. Ensure callers never build or register an empty or partial manifest after generation has failed.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[652-743]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[103-112]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[679-688]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[740-743]
- GenHub/GenHub/Features/GameInstallations/GameInstallationService.cs[632-646]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The fallback logic embeds the docs/GameInstallationFilesRegistry layout directly in service code
and duplicates authoritative CSV filenames elsewhere in the same class. These operational path
segments and filenames should be centralized and reused through constants.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
Rule 3001297 requires business-meaningful filesystem paths and filenames to come from centralized
constants. The service directly embeds and duplicates the CSV names plus the development registry
directory layout.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Authoritative CSV filenames and fallback filesystem path segments are hardcoded and duplicated in manifest service logic.
## Issue Context
Define the registry filenames, embedded resource naming, and development fallback path segments in an appropriate centralized constants class, then compose filesystem paths with `Path.Combine` using those constants.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[1004-1005]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[1070-1078]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[1097-1105]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The changed manifest-generation API performs language detection, CSV resolution, per-file hashing,
and file insertion without accepting or propagating a CancellationToken. Callers therefore cannot
cancel this long-running I/O workflow even though downstream detector, resolver, and hash APIs
support cancellation.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
Rule 3001311 requires long-running hashing and I/O methods to accept and propagate cancellation. The
changed signature has no token, while the workflow calls token-aware
ILanguageDetector.DetectAsync, CsvResolver.ResolveAsync, and
IFileHashProvider.ComputeFileHashAsync without passing one.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The game-installation manifest generation API does not accept or propagate a `CancellationToken` through its long-running I/O operations.
## Issue Context
Add a token to both public overloads and their interface declarations, then forward it through language detection, CSV resolution, hashing, and builder operations. Extend internal and builder APIs where necessary rather than dropping the caller's token.
## Fix Focus Areas
- GenHub/GenHub.Core/Interfaces/Manifest/IManifestGenerationService.cs[20-41]
- GenHub/GenHub.Core/Interfaces/Manifest/IContentManifestBuilder.cs[174-181]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[73-142]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[652-727]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[999-1030]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
11. Disk CSV catch returns empty✓ Resolved📘 Rule violation≡ Correctness
Description
Local CSV fallback catches every Exception and then returns an empty catalog, causing read or
parse failures to look like no authoritative records exist. This suppresses unexpected failures in a
non-boundary service helper.
catch (Exception ex)
{
- logger.LogError(ex, "Failed to add files from CSV for {GameType}", gameType);- return false;+ logger.LogWarning(ex, "Failed to load authoritative CSV from local disk for {GameType}", gameType);
Relevance
●● Moderate
Returning an empty catalog after broad failure is risky, but historical evidence is mixed for
best-effort fallback behavior.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
Rule 3001350 forbids generic catches that merely log and continue outside a process boundary. The
catch is followed by return [], and the caller handles that as an empty catalog rather than a load
failure.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Local CSV loading suppresses all failures and converts them into an empty authoritative catalog.
## Issue Context
Handle only specific recoverable filesystem exceptions. Propagate malformed data and unexpected failures, or return an explicit failure result so callers do not confuse errors with an empty catalog.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[1097-1128]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[681-688]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Embedded-resource loading catches generic Exception, logs a warning, and continues to disk
fallback. CSV parse and programming failures are therefore suppressed alongside legitimate
resource-access failures.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
Rule 3001350 prohibits generic catch-and-continue logic in service helpers. The cited code catches
failures from resource access and CSV parsing indiscriminately, then continues to another source.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
Embedded CSV loading catches and suppresses every exception before attempting local-disk fallback.
## Issue Context
Catch only concrete resource or I/O failures for which fallback is valid. Let malformed CSV and unexpected failures propagate or become explicit failure results.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[1073-1095]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The CSV resolver path catches every Exception and treats it as an ordinary signal to use fallback
data. This can mask programming or configuration defects instead of limiting fallback behavior to
specific recoverable resolver failures.
ⓘ Recommendations generated based on similar findings in past PRs
Evidence
Rule 3001350 disallows generic catch-and-continue behavior outside an explicit process boundary.
After the generic catch logs, this service helper unconditionally proceeds to fallback loading.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The CSV resolver fallback catches generic `Exception` and continues, suppressing unexpected failures.
## Issue Context
Identify concrete recoverable resolver exceptions that should trigger offline fallback. Allow all other failures to propagate or return an explicit failure result.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[1007-1059]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The changed manifest-generation API performs language detection, CSV resolution, per-file hashing,
and file insertion without accepting or propagating a CancellationToken. Callers therefore cannot
cancel this long-running I/O workflow even though downstream detector, resolver, and hash APIs
support cancellation.
Agent Prompt
## Issue description
The game-installation manifest generation API does not accept or propagate a `CancellationToken` through its long-running I/O operations.
## Issue Context
Add a token to both public overloads and their interface declarations, then forward it through language detection, CSV resolution, hashing, and builder operations. Extend internal and builder APIs where necessary rather than dropping the caller's token.
## Fix Focus Areas
- GenHub/GenHub.Core/Interfaces/Manifest/IManifestGenerationService.cs[20-41]
- GenHub/GenHub.Core/Interfaces/Manifest/IContentManifestBuilder.cs[174-181]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[73-142]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[652-727]
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[999-1030]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The reason will be displayed to describe this comment to others. Learn more.
10. Required files are omitted 🐞 Bug≡ Correctness
When an authoritative entry marked required is absent, generation only emits a debug message and
skips the entry. The caller then builds and registers a manifest with no record of that required
file, preventing downstream validation from reporting the missing installation dependency.
Agent Prompt
## Issue description
Missing required catalog entries are silently omitted from the generated manifest.
## Issue Context
Treat a missing required source as manifest-generation failure, or preserve the authoritative required entry in a form downstream validation can check. Do not return a successful incomplete builder.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[702-712]
- GenHub/GenHub/Features/GameInstallations/GameInstallationService.cs[632-646]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The reason will be displayed to describe this comment to others. Learn more.
11. Advertised languages lack records 🐞 Bug≡ Correctness
The embedded index advertises DE, FR, ES, IT, KO, PL, PT-BR, ZH-CN, and ZH-TW, but both new
registries contain only All and EN rows. Automatic detection or selection of an advertised
non-English language therefore retains only language-neutral files, omits required localized
archives and movies, and still returns a successful but incomplete manifest that cannot materialize
the detected language's base game.
Agent Prompt
## Issue description
Language filtering is enabled for detected or selected non-English installations, but the embedded registries contain no records for most languages advertised by the index. Filtering consequently retains only `All` entries and excludes required language-specific files, producing an incomplete manifest.
## Issue Context
The index declares support for DE, FR, ES, IT, KO, PL, PT-BR, ZH-CN, and ZH-TW in addition to the registry's available language values, and `LanguageDetector` can detect such codes from game directories and archives. Add authoritative language-specific rows for every advertised language or restrict each index language list so unsupported languages are neither advertised nor accepted; manifest generation should also reject a requested language when the selected registry does not support it.
## Fix Focus Areas
- GenHub/GenHub/Features/Manifest/ManifestGenerationService.cs[523-565]
- GenHub/GenHub.Core/Assets/Registries/index.json[7-16]
- GenHub/GenHub.Core/Assets/Registries/index.json[23-32]
- GenHub/GenHub.Core/Assets/Registries/Generals-1.08.csv[1-165]
- GenHub/GenHub.Core/Assets/Registries/ZeroHour-1.04.csv[1-176]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
…resolution
- Centralize CSV registry filenames, resource namespace, and URLs in CsvConstants
- Add path traversal protection and directory boundary verification in FindFileCaseInsensitive
- Use authoritative SHA256 hashes and file sizes from CSV catalog entries
- Map catalog filename dynamically from game type and version
- Handle specific exceptions (IOException, UnauthorizedAccessException, CsvHelperException) instead of generic catches
- Simplify ternary expressions and update unit tests to verify authoritative hashes
The reason will be displayed to describe this comment to others. Learn more.
`Exception` caught is very generic
The exception caught is generic and defeats the purpose of exception handling. Each type of exception provides an insight into what exactly went wrong and provides scenario-specific ways for graceful recovery. While it is easy to recover from some exceptions, a small subset of them make the recovery very difficult, usually because the conditions are not suitable for the program to continue executing. It is therefore suggested that you switch to a better approach of exception handling and recovery.
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
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
Modernizes
ManifestGenerationServiceto use the authoritative CSV game installation catalog (Generals-1.08.csvandZeroHour-1.04.csv) rather than ad-hoc disk directory file discovery. Embeds the CSV registries and index metadata directly intoGenHub.Corefor offline fallback, enforces pristine vanilla manifests by excluding untracked non-vanilla files, and implements multi-language filtering.Motivation
As outlined in the CSV suite plan (Phase 1), base game installation manifests must be generated strictly from authoritative file registry records with exact SHA256 hashes, sizes, and requirement flags to ensure deterministic CAS workspace materialization and eliminate corrupt/modded file contamination in base game manifests.
Changes
Generals-1.08.csv,ZeroHour-1.04.csv, andindex.jsondirectly intoGenHub.Coreas assembly resources for zero-latency, offline authoritative catalog loading.IContentManifestBuilderandContentManifestBuilder(AddGameInstallationFileAsync) to accept optional precomputedhash,size, andisRequiredflags, allowing fast, authoritative record population.ManifestGenerationService.AddGameFilesToManifestto:CsvResolveror embedded/local CSV fallbacks for authoritative records matching game type, version, and language.FindFileCaseInsensitive)..ghbak/.bak) resolution when original binaries are replaced.ContentSearchQuery.NormalizeLanguage) across manifests.ManifestGenerationServiceTestscovering CSV authority, multi-language filtering, backup file handling, and non-vanilla file exclusion.Verification
GenHub.Tests.Corepassed)Created with Claude 3.7 Sonnet via Antigravity