Skip to content

master<-dev#1442

Merged
TinyKitten merged 2 commits into
masterfrom
dev
Mar 21, 2026
Merged

master<-dev#1442
TinyKitten merged 2 commits into
masterfrom
dev

Conversation

@TinyKitten

Copy link
Copy Markdown
Member

No description provided.

* Optimize GetStationsByLineIdList with HashMap indexing and lightweight query

- Pre-index lines by station_g_cd into a HashMap for O(1) lookup,
  replacing the O(n×m) linear scan in update_station_vec_with_attributes
- Add get_by_station_group_id_vec_no_types that skips station_station_types
  and types JOINs when train type data is unused (line_group_id is None)
- Add quality/performance-first guideline to AGENTS.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Use explicit skip_types_join flag instead of line_group_id for no-types optimization

- Add skip_types_join parameter to update_station_vec_with_attributes to
  decouple the optimization from line_group_id semantics
- Only pass true from get_stations_by_line_id_vec (GetStationsByLineIdList),
  keeping all other callers on the full query to preserve station type data
- Update ConfigurableMock get_by_station_group_id_vec_no_types to strip
  type fields (line_group_cd, pass, sst_id, type_cd, type_id, type_name,
  color, direction, kind) mirroring production behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Run cargo fmt

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Move update_station_vec_with_attributes out of public trait into inherent impl

- Remove update_station_vec_with_attributes from QueryUseCase trait to
  keep the skip_types_join optimization detail private to QueryInteractor
- Remove the method from the gRPC controller mock (no longer needed)
- Add has_train_types and train_type clearing to the
  ConfigurableMock get_by_station_group_id_vec_no_types to match
  production behavior where line_group_cd=NULL makes has_train_types=false
- Add regression test for skip_types_join=true path verifying that
  lines, company, and station_numbers are still enriched correctly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix line.station referencing unenriched station clone

Move line.station assignment after station_numbers and train_type are
set so the cloned station embedded in the line is fully populated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix station.line.station.train_type not enriched in get_stations_by_line_group_id_vec

The train_type enrichment loop was updating station.train_type and
station.lines[*].station.train_type but missed station.line.station.train_type.

Also improve skip_types_join test to seed stations_by_group with actual
type fields and verify they are stripped by the no_types code path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TinyKitten TinyKitten self-assigned this Mar 21, 2026
@coderabbitai

coderabbitai Bot commented Mar 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e53f48e5-7445-45a5-a1a1-66bfe4762b2c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

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

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TinyKitten TinyKitten merged commit ab9a7fd into master Mar 21, 2026
7 checks passed
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.

1 participant