Skip to content

fix: rank every contest row in the JAG letter migration and check titles - #4220

Merged
KATO-Hiro merged 8 commits into
stagingfrom
#4030
Oct 25, 2026
Merged

KATO-Hiro merged 8 commits into
stagingfrom
#4030

Conversation

@KATO-Hiro

@KATO-Hiro KATO-Hiro commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

close #4030

Summary by CodeRabbit

  • 改善
    • AOJ の ICPC・JAG コンテスト(予選・本選・合宿)で、問題に公式の問題記号を表示する範囲を拡大しました。
    • 欠落問題の影響を受けるコンテストにも、公式の問題記号を反映しました。
    • 対象問題のタイトルから問題 ID の接頭辞を除き、問題名を見やすくしました。

KATO-Hiro and others added 8 commits October 24, 2026 23:48
…k title index notes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… Regional

Transcribes the maintainer's spreadsheet for 66 contests and derives each
letter from its spreadsheet position, skipping problems absent from AOJ.
All 625 titles match; 8 contests / 45 rows differ from the basic rule.
Injected errors (absent letter dropped, order swap, wrong title, short absent
list, wrong truncated prefix) are all reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Regional

Extend the PR1 problem letters to the JAG training camps (Summer / Winter /
Spring, 50 contests / 467 tasks) and JAG Regional (16 contests / 158 tasks):

- Seed: add JAG Regional from production, set letters for all 625 tasks, and
  drop the legacy "<problem id>. " prefix from the training camp titles.
- Migration: apply the basic rule, overwrite the 8 contests whose letters
  shift because problems are missing from AOJ (45 rows, from the maintainer's
  problem list), and strip the title prefixes. Each step checks its row count
  (0 / camps only / camps + Regional) and raises otherwise, which rolls back
  the whole migration.
- Import: assign letters for every JAG round, not only Prelim.

Verified on the local DB: a SELECT preview matched the cross-check script for
all 625 rows; after applying, 625/625 rows match the preview and other AOJ
types are untouched. Mutants (JAG letters only for Prelim, only for ICPC, a
corrected letter reverted, A/B swapped, title prefix restored, Regional letter
left as id) are each caught.

Refs #4030

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Address the Codex cross-review:

- Migration step (1) ranked only rows still holding the problem id, so a
  contest mixing letter rows and id rows would restart at A. Rank every row
  of the contest and restrict only the UPDATE to id rows. A read-only
  simulation (2967 already "A") now yields B, C, D for 2968-2970 instead of
  A, B, C. The local DB was restored to its pre-migration snapshot, and the
  fixed migration re-applied: 625/625 rows match the preview.
- The seed test only checked that no title starts with "<problem id>. ", so
  an emptied or swapped title passed. Check that every AOJ ICPC / JAG title
  equals the problem name instead; both cases now fail.

Refs #4030

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It produced the letters written into prisma/tasks.ts and the migration's
overrides. Recover it with `git show c605d3b:docs/dev-notes/2026-09-09/task-title-index-change-impact/generate_aoj_jag_problem_letters.ts`
if the letters need to be checked again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between dd96907 and 7c68cef.

Files selected for processing: 11
  • .agents/skills/add-tasks/instructions.md
  • docs/dev-notes/2026-09-09/task-title-index-change-impact/done.md
  • docs/dev-notes/2026-09-09/task-title-index-change-impact/investigation.md
  • docs/dev-notes/2026-09-09/task-title-index-change-impact/plan-pr2-5.md
  • docs/dev-notes/2026-09-09/task-title-index-change-impact/plan-pr2.md
  • docs/dev-notes/2026-09-09/task-title-index-change-impact/plan.md
  • prisma/migrations/20261025000719_update_aoj_jag_task_table_index/migration.sql
  • prisma/tasks.ts
  • src/lib/clients/aizu_online_judge/clients.test.ts
  • src/lib/clients/aizu_online_judge/clients.ts
  • src/lib/clients/aizu_online_judge/seed_problem_letters.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

AOJ ICPC・JAG 全体に問題記号を割り当てる処理とテストを更新しました。JAG の既存データを更新するマイグレーションを追加し、関連する作業手順と調査記録を更新しました。

Changes: AOJ・JAG の問題記号と既存データ

Layer / File(s) Summary
問題記号の割り当てと検証
src/lib/clients/aizu_online_judge/clients.ts, src/lib/clients/aizu_online_judge/clients.test.ts, src/lib/clients/aizu_online_judge/seed_problem_letters.test.ts, .agents/skills/add-tasks/instructions.md
問題記号の対象を AOJ ICPC・JAG の全コンテストに拡張しました。指定コンテストの補正値、問題タイトルと名前の一致をテストで確認します。タスク追加手順も更新しました。
既存データの移行
prisma/migrations/20261025000719_update_aoj_jag_task_table_index/migration.sql, docs/dev-notes/2026-09-09/task-title-index-change-impact/*
JAG の既存タスクに記号を設定し、指定タスクの記号を補正します。更新件数が想定外の場合は例外を発生させます。対象タイトルから問題 ID の接頭辞を除去します。関連する計画、検証記録、環境別の調査結果を更新しました。

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: Minimal · up to 7c68c

The problem-letter and title changes appear ready to merge after normal checks; the inspected seed and migration values agree.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (7 skipped: 7… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed タイトルは、JAG の文字移行で全行を順位付けする修正とタイトル検証を明確に示しています。変更内容の主要部分に直接対応し、簡潔です。
Linked Issues check Passed #4030 の要求は、AOJ JAG、模擬地区、合宿の problem_index を A, B, C... 形式にすることです。migration.sql は AOJ_JAG の Regional、Summer、Winter、Spring を対象にし、コンテスト内の task_id 順で全行を順位付けします。AOJ から欠落した問題には公式の文字を上書きします。`clients.…
Out of Scope Changes check Passed 変更は #4030 の問題文字割り当てに直接関係します。移行 SQL、AOJ 取り込み処理、seed テスト、関連する手順書と実施記録を更新しています。テストと文書の変更は実装の検証または記録を目的とします。無関係な変更は確認できません。
Full details: Linked Issues check

Explanation

#4030 の要求は、AOJ JAG、模擬地区、合宿の problem_index を A, B, C... 形式にすることです。migration.sql は AOJ_JAG の Regional、Summer、Winter、Spring を対象にし、コンテスト内の task_id 順で全行を順位付けします。AOJ から欠落した問題には公式の文字を上書きします。clients.ts は全 JAG round で文字割り当てを有効にします。seed_problem_letters.test.ts は 145 コンテスト、1,257 タスクの文字割り当てと title の一致を検証します。要求を満たす実装と自動テストを確認できます。

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (7 skipped: 7 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@KATO-Hiro KATO-Hiro left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KATO-Hiro
KATO-Hiro merged commit 7bc8074 into staging Oct 25, 2026
6 checks passed
@KATO-Hiro
KATO-Hiro deleted the #4030 branch October 25, 2026 01:23

This branch was previously deployed

1 inactive deployment
preview — 7c68cef6 Deployed Oct 25, 2026 by KATO-Hiro via preview #9090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] AOJ JAG・模擬アジア地区、合宿 の problem_index を A, B, C, ... 形式に変更しましょう

1 participant