Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .agents/skills/add-contest-table-provider/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ Step 0 (seed check) is already done. Confirm the following before touching code:
- [ ] Export `OLDEST_YEAR` / `LATEST_YEAR` constants. Use `super(contestType, String(param))` for unique provider key
- [ ] Tests: `getSize() === LATEST - OLDEST + 1`, etc.
- [ ] **RED** → implement → **GREEN**
- [ ] If display label needed: use `getTaskLabels` — do NOT mutate title inside `generateTable` (optimistic update + `$derived` re-run causes prefix accumulation)
- [ ] For AOJ-specific options (`getTaskLabels` / override map / `titleStyle` / `columnWrapThreshold`), see `aoj_icpc_providers.ts` / `aoj_jag_providers.ts`
- [ ] If cells need an index prefix (e.g. `A. title`): set `isShownTaskIndex: true` so the cell builds it from `task_table_index` — do NOT mutate title inside `generateTable` (optimistic update + `$derived` re-run causes prefix accumulation)
- [ ] For AOJ-specific options (`titleStyle` / `columnWrapThreshold`), see `aoj_icpc_providers.ts` / `aoj_jag_providers.ts`

---

Expand Down
1 change: 1 addition & 0 deletions .agents/skills/add-tasks/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Source: `https://kenkoooo.com/atcoder/resources/problems.json`
- atcoder.jp is unreachable and WebFetch truncates problems.json, so a miss there is not evidence of absence — ask the user to paste the rows
- Use `id` / `problem_index` / `name` / `title` verbatim; do not derive `id` from contest_id
- ICPC Prelim / ICPC Regional / JAG Prelim: set `problem_index` to the problem letter, not the AOJ problem id — A, B, C... in ascending problem id within the contest, as `assignProblemLetters` does on import. `seed_problem_letters.test.ts` checks this

## Tests

Expand Down

Large diffs are not rendered by default.

441 changes: 441 additions & 0 deletions docs/dev-notes/2026-09-09/task-title-index-change-impact/plan.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/guides/how-to-add-contest-table-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected setFilterCondition(): (taskResult: TaskResult) => boolean {
- 年度範囲定数(`OLDEST_YEAR` / `LATEST_YEAR`)を `export` してテストでも参照
- グループ登録は最新年→古い年の降順(`addProvider` 順 = 表示順、先 = 上)

AOJ/JAG 固有の詳細(`AOJ_LABEL_OVERRIDES`、`titleStyle`、同一年2回開催の `suffix` 分割など)は `aoj_icpc_providers.ts` / `aoj_jag_providers.ts` を参照。
AOJ/JAG 固有の詳細(`titleStyle`、同一年2回開催の `suffix` 分割など)は `aoj_icpc_providers.ts` / `aoj_jag_providers.ts` を参照。

### 補足: 固定セクションによる同一 ContestType 内の共存

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- Replace the AOJ problem id in task_table_index with the problem letter (A, B, C...)
-- for ICPC Prelim / ICPC Regional / JAG Prelim.
-- Basic rule: letters follow ascending problem id within each contest.
-- JAG training camps (also AOJ_JAG) are out of scope and excluded by contest_id.

-- (1) Build a task_id -> problem letter lookup table.
WITH letters AS (
SELECT task_id,
chr(64 + row_number() OVER (
PARTITION BY contest_id -- Restart numbering for each contest.
ORDER BY task_id::int -- AOJ problem ids are numeric.
)::int) AS letter
FROM "task"
WHERE contest_type = 'AOJ_ICPC'
-- AOJ_JAG also covers training camps, so narrow it by contest_id.
OR (contest_type = 'AOJ_JAG' AND contest_id LIKE 'JAGPrelim%')
)
-- (2) Apply the lookup table to the task rows.
UPDATE "task" AS t
SET "task_table_index" = letters.letter
FROM letters
WHERE t."task_id" = letters.task_id
-- Redundant with the CTE filter, but keeps the blast radius fixed.
AND (
t."contest_type" = 'AOJ_ICPC'
OR (t."contest_type" = 'AOJ_JAG' AND t."contest_id" LIKE 'JAGPrelim%')
);

-- Align the AOJ-KUPC2011 title with the plain AOJ title format.
UPDATE "task"
SET "title" = 'Mountain'
WHERE "task_id" = '2279'
AND "title" = 'I. Mountain';
Loading
Loading