Repository navigation
[Fix] 1호선 주말 원천 중복 행을 공식 근거로 격리하고 같은 출발 trip 중복을 후보 생성에서 차단 - #924
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
AquilaXk
left a comment
There was a problem hiding this comment.
Actionable comments posted: 3
🎯 Linked issue & acceptance criteria audit
- Linked issue: #920 [Fix] Line 1 weekend duplicate trips from duplicated source rows
- Goal summary: Duplicate source rows are quarantined by evidence; duplicate departures fail the build.
- Acceptance criteria verified: 6/6
| ID | Acceptance criterion | Status | Evidence |
|---|---|---|---|
| AC-1 | Confirm whether the duplicates come from the source response and record evidence | PASS | tools/datapack/lib/kric-capital-timetable-records.mjs:82 |
| AC-2 | Merge only by a rule with official evidence, never drop without evidence | PASS | tools/datapack/lib/kric-capital-timetable-records.mjs:287 |
| AC-3 | Fix the collection or projection stage if the defect lives there | PASS | Not applicable branch, the duplicates are in the source rows |
| AC-4 | Add a check that fails the build when same-calendar trips share a departure key | PASS | tools/datapack/lib/timetable-duplicate-departures.mjs:7 |
| AC-5 | Write the failing test first | PASS | tools/datapack/lib/timetable-duplicate-departures.test.mjs:18 |
| AC-6 | Ship in the next reissue and verify the backend weekend response | PASS | PR body Not run section defers the backend check until the reissued bundle is deployed |
🛡️ Adversarial audit evidence
- Falsifiability verified: No (Failed: Probe left 2 mutants alive on the rule match logic, see F1.)
- Hollow assertions detected: 0
- Production backdoors detected: 0
- Ground-truth sources verified:
Capital timetable report quarantine counts of 2 duplicate rows and 453 monotonic rowsCommitted KRIC file snapshot rows 121231, 121234, 121241 and 121245 with pinned hashesIssue 920 body Done When list and the 34 duplicate group reproductionWeekend and weekday rows for trains 506, 508, 512 and 514 compared cell by cell
🤖 Prompt for all review comments with AI agents
Could we verify each finding against the current code and keep only those that
still apply? Could we make the smallest validated fix and briefly note why any
finding no longer applies?
Inline comments:
- `@tools/datapack/lib/kric-capital-timetable-records.mjs:82-85`
Could the three station responses for day codes 7, 8 and 9 be kept as a retained
fixture, as the holiday pull request does for the KASI months with hashes, and could
the test assert the keep and drop choice against that fixture?
- `@tools/datapack/lib/kric-capital-timetable-records.mjs:298-300`
Could a test give a rule whose hash matches but whose train number differs, and a
rule with a matching train number but a different hash, and expect the
DUPLICATE_TRIP_UNRESOLVED failure in both cases? A third case could change the
routeNumber or weekdayType only. That would pin the narrow match as claimed.
- `@tools/datapack/prepare-nationwide-candidate-run.mjs:1581-1587`
Could the merge order be stated on both pull requests, with the second regenerating
the candidate and re-checking the pinned counts after the rebase?
---
Outside diff comments:
None.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Aquila review skill, project CLAUDE.md, PR template full.md and issue 920 body
Review profile: ASSERTIVE
Plan: Aquila fallback
Run ID: N/A (Aquila fallback)
Review source: Aquila CLI
Repository visibility: public GitHub repository
Trigger:
Discovery review of the current change set on the draft pull request
Base:
main@53f01fc5c4c5d2b7630c2c6dcdb79608200eaa1c
Head:
fix/line1-weekend-duplicate-trips-920@9f46ad5960e918ac75fa5885b85377a1b5adde23
Command:
node post-review.mjs input.json payload-1.json --repo AquilaXk/easysubway-data --pr 924
📥 Commits
Reviewing files changed in this pull request between:
- Base:
53f01fc5c4c5d2b7630c2c6dcdb79608200eaa1c - Head:
9f46ad5960e918ac75fa5885b85377a1b5adde23
📒 Files selected for processing (6)
tools/datapack/lib/kric-capital-timetable-records.mjstools/datapack/lib/kric-capital-timetable-records.test.mjstools/datapack/lib/timetable-duplicate-departures.mjstools/datapack/lib/timetable-duplicate-departures.test.mjstools/datapack/prepare-nationwide-candidate-run.mjstools/datapack/prepare-nationwide-candidate-run.test.mjs
📜 Review details
- KRIC 전체_도시철도운행정보 파일의 1호선 '토요일+공휴일' 512·514 행은 같은 시각 506·508 행과 정차·시각이 모두 같다. KRIC 역별 API(subwayTimetable, 2026-10-04 실측)는 휴일에 506·508만, 평일에 512·514를 준다. 고정 근거로 512·514 주말 행을 DUPLICATE_SERVICE_ROW로 격리한다. 근거 없는 내용 중복은 적재를 실패시킨다. - 전국 후보 조립 뒤 같은 달력에서 (노선, 역, 출발 시각, 다음 역, 종착역)이 같은 trip이 있으면 후보 생성을 실패시킨다. Closes #920
refresh-nationwide-candidate --evaluated-at 2026-10-03T05:27:51.411Z --release-sequence 126 원천 snapshot과 fan-in head는 그대로다. 1호선 주말 중복 trip 2개(정차 36행)가 빠지고 격리 보고서에 남는다. Refs #920
baaa231 to
7fd5c7d
Compare
|
AquilaXk
left a comment
There was a problem hiding this comment.
Actionable comments posted: 0
🎯 Linked issue & acceptance criteria audit
- Linked issue: #920 Line 1 weekend calendar carries duplicate trips
- Goal summary: Source duplicate rows are resolved by an evidenced rule and duplicates fail the build.
- Acceptance criteria verified: 4/4
| ID | Acceptance criterion | Status | Evidence |
|---|---|---|---|
| AC-1 | Confirm the duplicates come from the KRIC source and retain the response | PASS | tools/datapack/fixtures/kric-line1-weekend-duplicate-evidence/responses.json |
| AC-2 | Merge source duplicates only by an evidenced rule | PASS | tools/datapack/lib/kric-capital-timetable-records.mjs |
| AC-3 | Fail the build on same-calendar trips with equal stop, departure, next and terminal | PASS | tools/datapack/lib/timetable-duplicate-departures.mjs |
| AC-4 | Write the failing test first | PASS | tools/datapack/lib/timetable-duplicate-departures.test.mjs |
🔄 PR review lifecycle & thread tracking
- Previous review ID: 5404249635
- Previous commit SHA:
9f46ad5960e918ac75fa5885b85377a1b5adde23 - Resolved findings: 3
- Active tracked threads: 0
| Status | Finding / Thread | Path | Resolution note |
|---|---|---|---|
| RESOLVED | F1 | tools/datapack/lib/kric-capital-timetable-records.mjs |
KRIC API responses are retained without the key and checked against the rule |
| RESOLVED | F2 | tools/datapack/lib/kric-capital-timetable-records.mjs |
Drop rule applies only when row hash and train number both match |
| RESOLVED | F3 | tools/datapack/prepare-nationwide-candidate-run.mjs |
Rebased after 922 merged; both count assertions kept and outputs regenerated |
🛡️ Adversarial audit evidence
- Falsifiability verified: Yes (Hash-only and train-only match mutants of the drop rule now fail)
- Hollow assertions detected: 0
- Production backdoors detected: 0
- Ground-truth sources verified:
Issue 920 body done criteriaKRIC file rows for trains 506, 508, 512 and 514 pinned by row sha256Retained KRIC station timetable API responses for Line 1 weekend trains, key removed
🤖 Prompt for all review comments with AI agents
Could we verify each finding against the current code and keep only those that
still apply? Could we make the smallest validated fix and briefly note why any
finding no longer applies?
Inline comments:
None.
---
Outside diff comments:
None.
ℹ️ Review info
⚙️ Run configuration
Configuration used: CLAUDE.md, AGENTS.md and .github/PULL_REQUEST_TEMPLATE/full.md in easysubway-data
Review profile: ASSERTIVE
Plan: Aquila fallback
Run ID: N/A (Aquila fallback)
Review source: Aquila CLI
Repository visibility: public GitHub repository
Trigger:
Closure review of frozen findings F1 to F3 on the rebased head of PR 924
Base:
main@46885d420cf1b89d42fcb5dc76a0e1d1eb561e30
Head:
fix/line1-weekend-duplicate-trips-920@7fd5c7da88626a6039af7c8484b9da992bcb6c9b
Command:
node aquila-review/scripts/compile-review-payload.mjs input.json --output payload-1.json
📥 Commits
Reviewing files changed in this pull request between:
- Base:
46885d420cf1b89d42fcb5dc76a0e1d1eb561e30 - Head:
7fd5c7da88626a6039af7c8484b9da992bcb6c9b
📒 Files selected for processing (24)
tools/ci/data-test-ownership.jsontools/datapack/fixtures/kric-line1-weekend-duplicate-evidence/P149-dayCd7.jsontools/datapack/fixtures/kric-line1-weekend-duplicate-evidence/P149-dayCd8.jsontools/datapack/fixtures/kric-line1-weekend-duplicate-evidence/P149-dayCd9.jsontools/datapack/fixtures/kric-line1-weekend-duplicate-evidence/P155-dayCd7.jsontools/datapack/fixtures/kric-line1-weekend-duplicate-evidence/P155-dayCd8.jsontools/datapack/fixtures/kric-line1-weekend-duplicate-evidence/P155-dayCd9.jsontools/datapack/fixtures/kric-line1-weekend-duplicate-evidence/P157-1-dayCd7.jsontools/datapack/fixtures/kric-line1-weekend-duplicate-evidence/P157-1-dayCd8.jsontools/datapack/fixtures/kric-line1-weekend-duplicate-evidence/P157-1-dayCd9.jsontools/datapack/fixtures/kric-line1-weekend-duplicate-evidence/responses.jsontools/datapack/lib/kric-capital-timetable-records.mjstools/datapack/lib/kric-capital-timetable-records.test.mjstools/datapack/lib/timetable-duplicate-departures.mjstools/datapack/lib/timetable-duplicate-departures.test.mjstools/datapack/prepare-nationwide-candidate-run.mjstools/datapack/prepare-nationwide-candidate-run.test.mjstools/datapack/release/candidate-build-spec.jsontools/datapack/release/hash-evidence.jsontools/datapack/release/nationwide-candidate-preparation.jsontools/datapack/release/nationwide-capital-timetable-report.jsontools/datapack/release/nationwide-official-stop-times.json.gztools/datapack/release/nationwide-production-canonical-pack.jsontools/datapack/release/release-request.json
📜 Review details
|
No description provided. |



Related issue
Closes #920
Refs AquilaXk/easysubway-backend#479
Summary
kric-capital-weekend-holiday1호선에는 같은 초에 같은 역에서 같은 다음 역·같은 종착역으로 출발하는 묶음이 34개 있다. backend #479는 이 묶음 때문에TIMETABLE_IDENTITY_MISMATCH(503)를 낸다.kc-s1101-e-15e9735e2c6f와kc-s1101-e-d26c61c9c11b는 서동탄 23:14 → 구로,kc-s1101-e-5189a24752f7와kc-s1101-e-f8bab3a18549는 서동탄 23:34 → 구로다.kric-nationwide-timetable-file-capital-dec3ef2f…에 서로 다른 원천 행 4개가 있다.토요일+공휴일, row shaef710da9…토요일+공휴일, row sha0f5059b6…토요일+공휴일, row sha7fde1eb7…토요일+공휴일, row sha317ea0f4…trainUseInfo/subwayTimetable, 카탈로그provider:kric-subway-timetable, 2026-10-04 실측,railOprIsttCd=KR·lnCd=1)는 다음과 같다.03 데이터가 없습니다라서 휴일 시간표가 토요일에도 운행한다.DUPLICATE_SERVICE_ROW로 격리하고 보고서에 남긴다.Changes
lib/kric-capital-timetable-records.mjsKRIC_CAPITAL_DUPLICATE_ROW_RESOLUTIONS(신규 export): 위 2건의 근거와 행 해시를 고정한다.kricCapitalOfficialTimetable이 내용 중복 묶음을 판정한다. 규칙이 없거나 남길 행이 하나가 아니면KRIC_CAPITAL_TIMETABLE_DUPLICATE_TRIP_UNRESOLVED로 실패한다.lib/timetable-duplicate-departures.mjs(신규):duplicateDepartureGroupsprepare-nationwide-candidate-run.mjs: 광주 보관본까지 합친 뒤duplicateDepartureGroups가 비어 있지 않으면 실패한다.lib/kric-capital-timetable-records.test.mjsfixtures/kric-line1-weekend-duplicate-evidence/(리뷰 F2): KRICsubwayTimetable응답 원문 9개와 sha256 manifest다.lib/timetable-duplicate-departures.test.mjs(신규,data-test-ownership.json에 data920로 등록)prepare-nationwide-candidate-run.test.mjs: 조립 팩 중복 0을 확인한다. 고정 건수를 trip 26,490→26,488, 정차 677,156→677,120으로 바꿨다.refresh-nationwide-candidate --evaluated-at 2026-10-03T05:27:51.411Z --release-sequence 126Scope
Included
Excluded
Ownership / dependencies
refresh-nationwide-candidate를 다시 돌려야 한다. 재생성 산출물은 손으로 병합하지 않는다.prepare-nationwide-candidate-run.mjs의 코드 줄은 겹치지 않는다.병합 순서
refresh-nationwide-candidate를 다시 돌린다.prepare-nationwide-candidate-run.test.mjs의 고정 건수(trip 26,488·stop_time 677,120·예외 행 398)를 다시 확인한다. 재생성 산출물은 손으로 고치지 않는다.도구/데이터 PR을 한 PR에 둔 이유
prepare-nationwide-candidate-run.test.mjs의writeFiles: true테스트가 실행 중에 정본 팩·보고서를 덮어쓰기 때문이다.#899 커밋된 전국 팩·외부 시간표 파일은 … 보고서와 같다가 이 경합으로 실패했다.Contract & Compatibility
DUPLICATE_SERVICE_ROW2건이 추가된다.TIME_NOT_MONOTONIC453행)는 그대로다.Version impact
Product gate impact
Provenance impact
Version decision
Verification
api-catalog.mjs list --query kric-subway-timetable의 결과는provider:kric-subway-timetable(admitted)이다. 원천 파일 행은 커밋 snapshot에서, 열차 실체는 위 API 실측에서 확인했다. 키는 루트.env에 있고 출력하지 않았다.duplicateDepartureGroups를 적용하면 34묶음이다(kric-capital-weekend-holiday, trip 4개). 새 테스트는 export가 없어 실패했다. GREEN:kric-capital-timetable-records.test.mjs11/11,timetable-duplicate-departures.test.mjs2/2, prepare 대상 2건 통과duplicateResolutions: []를 주면KRIC_CAPITAL_TIMETABLE_DUPLICATE_TRIP_UNRESOLVED: S1101 토요일+공휴일 506,512로 실패한다.refresh-nationwide-candidate→ RCbuild-datapack→validate-datapack --require-production→ 번들 staging이 통과했다. 서명은 로컬 임시 키를 썼다.kc-s1101-e-15e9735e2c6f(506)·kc-s1101-e-5189a24752f7(508)만 남는다.Not run
Risk
Rollout / Recovery
TIMETABLE_IDENTITY_MISMATCH가 사라진다.Review focus
Checklist