add accepts Infinity scores and writes records that immediately fail validation
メンテナーはふだん 2 日以内に返信
@vivek-3728 がすでに取り組んでいます。
2026年10月29日 から。
評価
調査の方向性
まず、コマンド add における score と max_score の解析および検証を見つけ、そのチェックをコマンド validate の数値規則と比較します。提示された CLI コマンドを一時的な CSV で再現し、関連するテストを確認します。完了条件は、add がレコードを書き込まずに有限でない値を拒否し、受け入れられたレコードが validate に合格することです。
索引モデルが issue の本文から書いたものです。
説明
Description
I found a bug where the add command accepts inf as both the score and maximum score, even though these are not valid numeric grades.
The command reports success and writes the record to the CSV, but running validate immediately afterward rejects the same record.
This means a normal add operation can turn an otherwise valid grade file into one that fails the application's own validation.
Steps to Reproduce
Run:
python -m grade_tracker --data grades.csv add S1 Math inf inf 2026-10-30 3 1
python -m grade_tracker --data grades.csv validate
Actual Behavior
The add command reports:
Added grade for S1 in Math.
The CSV now contains:
S1,Math,inf,inf,2026-10-30,3.0,1
However, validation reports:
Error: row 2, field score: 'inf' is not a numeric score
Error: row 2, field max_score: 'inf' is not a numeric maximum score
Validation failed: 2 problems found.
Expected Behavior
The add command should reject non-finite values before writing anything to the CSV.
Any record successfully added through the CLI should also pass the application's numeric validation rules.
Likely Cause
The add command relies on numeric range comparisons without explicitly checking whether the values are finite.
Since Python evaluates float("inf") <= float("inf") as True, the invalid values pass the existing checks.
The validation command applies stricter numeric rules and correctly rejects them.
Using math.isfinite() for both score and max_score would prevent Infinity and NaN values from being accepted.
Impact
A successful CLI operation can introduce invalid grade records into an otherwise valid CSV file.
This creates inconsistent behavior between add and validate and may affect subsequent calculations, reporting, or exports.
The issue was reproduced on the latest upstream/main and no matching report was found among the 68 open and closed issues and PRs checked.
- 主要言語
- Python
- スター
- 0
- フォーク
- 5
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 27
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
techcsispit/grade-tracker のほかの issue
-
feat: add cross-file integrity verification and repair対応中かも @deepmhatre13 が今日担当しました。 オープンfeature
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
techcsispit/grade-tracker#66 ·
メンテナーはふだん 2 日以内に返信
-
Blank credits pass validation but cause valid grade records to disappear対応中かも @vivek-3728 が 9 日前に担当しました。 オープンbug good first issue
techcsispit/grade-tracker#53 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
techcsispit/grade-tracker の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
Validate finite output clamping limits in StepPredictor.prepare_clamping_params to prevent silent NaN/Inf propagation対応中かも @muskan-creates352 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
mllam/neural-lam#848 ·
メンテナーはふだん 2 日以内に返信
-
infra
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
fab-geocommuns/RNB-coeur#1166 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
deepspeedai/DeepSpeed#8951 ·
メンテナーはふだん 2 日以内に返信