Skip to content

feat(aoj): add JAG Domestic Preliminary (JAGPrelim) contest table (2005–2026)#3830

Merged
KATO-Hiro merged 5 commits into
stagingfrom
#3828
Jul 8, 2026
Merged

feat(aoj): add JAG Domestic Preliminary (JAGPrelim) contest table (2005–2026)#3830
KATO-Hiro merged 5 commits into
stagingfrom
#3828

Conversation

@KATO-Hiro

@KATO-Hiro KATO-Hiro commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

close #3828

Summary by CodeRabbit

  • 新機能
    • AOJ の JAG 模擬国内予選を年別(必要に応じて A/B)に表示・分類できるようになりました。
    • 対象期間のコンテスト/問題データ範囲を拡充しました。
  • 不具合修正
    • 一部の JAG コンテストIDで、末尾英字の付いた形式が分類・ラベル表示の対象に含まれるよう改善しました。
    • タイトル表記と表示ラベルの整合性を調整しました。
  • テスト
    • JAG 予選(年境界・2016A/B)およびラベル/テーブル生成の検証を追加しました。
  • ドキュメント
    • 追加手順のガイドとチェックリストを更新しました。

KATO-Hiro and others added 3 commits July 8, 2026 09:41
…05–2026)

- Rename aoj_icpc_labels.ts → aoj_labels.ts, neutralising all exported names
  (formatAojIcpcTitle → formatAojTitle, ICPC_LABEL_OVERRIDES → AOJ_LABEL_OVERRIDES,
  etc.) so ICPC and JAG providers can share the same helpers
- Fix regexForJag to match JAGPrelim2016A / JAGPrelim2016B (trailing bare letter)
- Add JagPrelimProvider (Pattern 4) with optional suffix param for the 2016 A/B split
- Register aojJagPrelim group (2005–2026, 23 providers) in contest_table_provider_groups
- Seed 169 JAGPrelim tasks (2005–2026) into prisma/tasks.ts
- Add aoj_jag_providers.test.ts covering metadata, filter isolation, label assignment,
  2016 A/B split, and year boundary behaviour
- Update aoj_icpc_providers.ts/test.ts and TaskTableBodyCell.svelte to use renamed exports

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ementation learnings

- Skill: add note to skip Layers 1–2 when an existing ContestType covers the family
- Guide: update AOJ_LABEL_OVERRIDES / formatAojTitle references (aoj_icpc_labels rename)
- Guide: document suffix-based A/B split pattern (JAGPrelim2016A/B) with code example
- Guide: add troubleshooting entry for silent regex miss on new contest_id shapes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ee4109ee-0015-48a3-862f-0748d0190cf3

📥 Commits

Reviewing files that changed from the base of the PR and between 37cc690 and f6949a6.

📒 Files selected for processing (2)
  • src/features/tasks/utils/contest-table/aoj_jag_providers.ts
  • src/features/tasks/utils/contest-table/aoj_labels.test.ts

📝 Walkthrough

Walkthrough

AOJ JAG国内予選のテーブル処理を追加するため、ラベル処理をAOJ汎用へ統合し、新規プロバイダとプリセットを実装しました。分類regexを拡張し、JAG Prelimの大量データ、参照ケース、実装ガイドも更新されています。

Changes

AOJラベル汎用化

Layer / File(s) Summary
ラベル関数とICPC側の参照更新
src/features/tasks/utils/contest-table/aoj_labels.ts, src/features/tasks/utils/contest-table/aoj_icpc_providers.ts, src/features/tasks/utils/contest-table/aoj_labels.test.ts, src/features/tasks/utils/contest-table/aoj_icpc_providers.test.ts, src/features/tasks/components/contest-table/TaskTableBodyCell.svelte, src/features/tasks/utils/contest-table/contest_table_provider.ts, .claude/skills/add-contest-table-provider/instructions.md
ICPC_* 由来のラベル/表示ヘルパーを AOJ_* に置換し、ICPC プロバイダと表示セルの呼び出し先を新しい汎用関数へ切り替えた。

AOJ JAG Prelim プロバイダ

Layer / File(s) Summary
JagPrelimProvider 追加
src/features/tasks/utils/contest-table/aoj_jag_providers.ts, src/features/tasks/utils/contest-table/aoj_jag_providers.test.ts
年と A/B サフィックスから contestId を組み立てる JagPrelimProvider を追加し、filter、表示設定、ラベル生成、2016 分割を含む挙動をテストした。
プリセット登録と分類ルール
src/features/tasks/utils/contest-table/contest_table_provider_groups.ts, src/features/tasks/utils/contest-table/contest_table_provider_groups.test.ts, src/lib/utils/contest.ts
AojJagPrelim プリセットを追加し、JAG の contest_id 正規表現を末尾英字付きに対応させ、年範囲と 2016 A/B 分割の生成・検証を追加した。

データと参照ケース

Layer / File(s) Summary
JAG Prelim データと参照ケース
prisma/tasks.ts, src/test/lib/utils/test_cases/contest_type.ts, src/test/lib/utils/test_cases/contest_name_labels.ts, docs/guides/how-to-add-contest-table-provider.md, .claude/skills/add-contest-table-provider/instructions.md
JAG Prelim 2005〜2026 のタスクレコードを増補し、contest type/name の参照ケースと実装ガイドの例示を更新した。

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 主要変更である AOJ JAG 国内予選のテーブル追加を的確に表しています。
Linked Issues check ✅ Passed AOJ JAG 国内予選テーブルの追加、2016 A/B 対応、関連ラベル・テスト・データ更新が #3828 の要件に沿っています。
Out of Scope Changes check ✅ Passed 変更は実装・テスト・ドキュメント・データ追加に集中しており、明確なスコープ外変更は見当たりません。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch #3828

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.

…DisplayConfig

Previously untested after the aoj_icpc_labels → aoj_labels rename.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/features/tasks/utils/contest-table/aoj_labels.test.ts (1)

3-143: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

sortAojHeaderIdsbuildAojDisplayConfig の隣接ユニットテストを追加すべき

aoj_labels.ts から export されている4関数のうち、formatAojTitlebuildAojLetterMap には直接テストが存在しますが、sortAojHeaderIdsbuildAojDisplayConfig にはこのテストファイル内に直接テストがありません。プロバイダーテストで間接的に検証されていますが、パスインストラクション(src/**/*utils/** の各関数には隣接ユニットテストが必須)に照らすと不足しています。

♻️ 提案するテスト追加
 describe('formatAojTitle', () => {
   // ...existing tests...
 });

+describe('sortAojHeaderIds', () => {
+  test('deduplicates and sorts task_table_index numerically ascending', () => {
+    const filtered = [
+      { task_table_index: '1665' },
+      { task_table_index: '1664' },
+      { task_table_index: '1665' },
+    ] as unknown as TaskResults;
+    const result = sortAojHeaderIds(filtered);
+    expect(result).toEqual(['1664', '1665']);
+  });
+
+  test('returns empty array for empty input', () => {
+    expect(sortAojHeaderIds([] as unknown as TaskResults)).toEqual([]);
+  });
+});
+
+describe('buildAojDisplayConfig', () => {
+  test('returns config with AOJ-specific settings', () => {
+    const config = buildAojDisplayConfig();
+    expect(config).toEqual({
+      isShownHeader: false,
+      isShownRoundLabel: false,
+      roundLabelWidth: '',
+      tableBodyCellsWidth: 'w-1/2 xs:w-1/3 sm:w-1/4 md:w-1/5 lg:w-1/6 px-1 py-2',
+      isShownTaskIndex: true,
+      columnWrapThreshold: 6,
+    });
+  });
+});
+
 describe('buildAojLetterMap', () => {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/tasks/utils/contest-table/aoj_labels.test.ts` around lines 3 -
143, Add direct adjacent unit tests in aoj_labels.test.ts for the exported
sortAojHeaderIds and buildAojDisplayConfig helpers, since they are currently
only covered indirectly. Use the existing aoj_labels symbols and mirror the
style of the formatAojTitle and buildAojLetterMap suites to verify their core
behavior explicitly, including any ordering and display-config output expected
from each function.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/features/tasks/utils/contest-table/aoj_jag_providers.ts`:
- Around line 24-25: The suffix field in the AOJ/JAG provider class is typed too
loosely compared to its intended values. Update the `suffix` member on
`AojJagProviders` to use the narrower `'' | 'A' | 'B'` type, and make sure the
constructor assignment and any related usages still align with that union so the
type information from the constructor is preserved.

In `@src/lib/utils/contest.ts`:
- Line 3: regexForJag currently allows an optional trailing uppercase letter
even when no -day suffix is present, which can widen matching too much. Update
the regexForJag pattern in contest.ts so the optional single-letter suffix is
only accepted when it follows a -day segment, keeping the existing JAG year/type
matching intact while preventing unknown standalone suffixes from being
classified as AOJ_JAG.

---

Outside diff comments:
In `@src/features/tasks/utils/contest-table/aoj_labels.test.ts`:
- Around line 3-143: Add direct adjacent unit tests in aoj_labels.test.ts for
the exported sortAojHeaderIds and buildAojDisplayConfig helpers, since they are
currently only covered indirectly. Use the existing aoj_labels symbols and
mirror the style of the formatAojTitle and buildAojLetterMap suites to verify
their core behavior explicitly, including any ordering and display-config output
expected from each function.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: df1a957f-93e4-4d92-8eec-be74a5e2b74a

📥 Commits

Reviewing files that changed from the base of the PR and between 0e4831c and 37cc690.

📒 Files selected for processing (16)
  • .claude/skills/add-contest-table-provider/instructions.md
  • docs/guides/how-to-add-contest-table-provider.md
  • prisma/tasks.ts
  • src/features/tasks/components/contest-table/TaskTableBodyCell.svelte
  • src/features/tasks/utils/contest-table/aoj_icpc_providers.test.ts
  • src/features/tasks/utils/contest-table/aoj_icpc_providers.ts
  • src/features/tasks/utils/contest-table/aoj_jag_providers.test.ts
  • src/features/tasks/utils/contest-table/aoj_jag_providers.ts
  • src/features/tasks/utils/contest-table/aoj_labels.test.ts
  • src/features/tasks/utils/contest-table/aoj_labels.ts
  • src/features/tasks/utils/contest-table/contest_table_provider.ts
  • src/features/tasks/utils/contest-table/contest_table_provider_groups.test.ts
  • src/features/tasks/utils/contest-table/contest_table_provider_groups.ts
  • src/lib/utils/contest.ts
  • src/test/lib/utils/test_cases/contest_name_labels.ts
  • src/test/lib/utils/test_cases/contest_type.ts

Comment thread src/features/tasks/utils/contest-table/aoj_jag_providers.ts Outdated
Comment thread src/lib/utils/contest.ts
… 'B'

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@KATO-Hiro KATO-Hiro merged commit 1e7434b into staging Jul 8, 2026
3 checks passed
@KATO-Hiro KATO-Hiro deleted the #3828 branch July 8, 2026 11:27
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.

[feat] テーブル「AOJ JAG 国内予選」を追加しましょう

1 participant