fix(rules): restore pk column to Rules CSV (follow-up to #228) - #233
Merged
Conversation
PR #228 merged with DatasetUpdaterRootConfig.cs referencing `PrimaryField = "pk"` for the Rules PT translation config, but the accompanying Rules CSV change (pk column addition with Rules_01..Rules_18 prefixes) was lost during an earlier rebase of that PR. Master's Rules CSV therefore has no `pk` column, which would cause the DatasetUpdater to fail at runtime if someone enables the Rules PT config. This fix restores the exact `pk` column that was present in the original PR #228 commit, matching what Rule.cs expects via its Pk property + ClassMap. The config is still Enabled=false by default, so this is purely a latent-bug fix — no behavior changes for anyone who hasn't enabled the config. Changes: - Cards/Rules/Argumentum Rules - Cards.csv: prepend `pk` column header + `Rules_01` through `Rules_18` row prefixes (18 data rows, matches the 18 rule cards in the game's print&play structure). Validation: - Build: 0 errors - Tests: 88 pass, 1 skip (Freeplane GUI), 0 fail Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
Review — self-review before mergeContexteFix chirurgical pour un bug latent découvert après merge de #228. Je l'ai documenté en détail dans la PR body. Rappel rapide :
Audit du fix
Validation
ConclusionFix safe, self-contained, resolves a latent bug. Prêt à merger. |
3 tasks
4 tasks
Collaborator
|
Post-hoc review — PR #233 Verdict: ✅ LGTM — necessary follow-up This PR restores the Observations:
No regressions. Correct fix. |
4 tasks
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.
Problem
PR #228 merged with
DatasetUpdaterRootConfig.csreferencingPrimaryField = "pk"for the Rules PT translation config, but the accompanying CSV change (pk column addition withRules_01..Rules_18prefixes) was lost during an earlier rebase of that PR branch.Master's
Cards/Rules/Argumentum Rules - Cards.csvcurrently has headers:```
Text,Text_en,Text_ru,Text_pt,print_and_play
```
No `pk` column. The config references it anyway:
```csharp
// DatasetUpdaterRootConfig.cs:675
PrimaryField = "pk",
```
Result: if someone sets
Enabled = trueon the Rules PT config and runs the pipeline, DatasetUpdater will fail to identify rows (no primary key column to match).Fix
Restore the exact
pkcolumn that was in the original PR #228 commit (`a99f228a`), matching whatRule.csexpects via itsPkproperty + ClassMap.Header becomes:
```
pk,Text,Text_en,Text_ru,Text_pt,print_and_play
```
Rows get prefixed
Rules_01..Rules_18. 18 data rows — matches the game's rule-card structure (École des Menteurs, Bingo, Parlote Coinchée variants).Scope
Cards/Rules/Argumentum Rules - Cards.csvRule.csalready has.Optional()on the Pk mapping (robust to reads)Enabled = false— this is purely a latent-bug fix with zero runtime behavior change for anyone who hasn't enabled the configDiff
19 insertions + 19 deletions (just the row-level boundaries where
pkis prepended):```
-Text,Text_en,Text_ru,Text_pt,print_and_play
+pk,Text,Text_en,Text_ru,Text_pt,print_and_play
-"# Argumentum
+Rules_01,"# Argumentum
...
```
Validation
Test plan
RuleClassMap(Pk mapping with.Optional()already in place)Enabled = trueon Rules PT config withTakeChunkNb = 1and confirm DatasetUpdater identifies rows by pk (full end-to-end run deferred to translation campaign with OpenAI key)Related
🤖 Generated with Claude Code