Repository navigation
Support junction routing for reversing train consists - #57
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (11)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughTrain movement now tracks body orientation and independent turnout choices while planning and moving consists across connected rails. Saved consist data and throttle tapes include orientation and junction choices. TrackRegistry rejects turnout changes while a junction is occupied. Tests and README cover reverse movement, persistence, relinking and turnout occupancy. ChangesTrain routing and persistence
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~60 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant TrainHandler
participant TrainRoute
participant TrackRegistry
TrainHandler->>TrainRoute: Plan consist positions and walk the route
TrainRoute->>TrackRegistry: Read connected tracks and junction choices
TrackRegistry-->>TrainRoute: Return track and turnout route data
TrainRoute-->>TrainHandler: Return positions and traversed junction choices
TrackRegistry->>TrainHandler: Query junction occupancy before changing turnout
TrainHandler-->>TrackRegistry: Return whether the train occupies the junction
Merge Risk: ⚪ Minimal · up to This change adds reverse junction routing, turnout locking while a train occupies a junction, and persistence of train facing and route choices. Existing saves and throttle tapes remain readable. No concrete defects were identified, and the reported tests cover the main traversal and persistence scenarios. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The inspected steering path retains its mounted-captain restriction and adds occupied-switch checks. Legacy save handling is deliberate, but downgrade requires matching data backups, and some loading and recovery transitions remain unconfirmed. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
Comment |
|
Opus 5.5 high and Astra completed two review passes through
The initial review regressions reproduced four failures before the fixes. Final Java 21 Opus noted a non-blocking follow-up: a train moving with an unresolved link retains newly crossed route decisions until that link resolves. This release keeps those decisions rather than expiring a route that a missing carriage may still need when the consist is reconstructed. Bounding that history requires proving the missing cars no longer need it. |
|
Released and deployed as v2.9.0.
JAR SHA-256: |
Trains can now choose and traverse junctions while reversing. A/D acts ahead of the leading wheels; once those wheels enter, every carriage follows the same route until the whole consist clears. Reversing midway retraces that route, and adjacent occupied switches remain locked independently.
Track body orientation separately from movement direction, preserve route decisions across partial chunk loading and reloads, and convert recorded throttle samples into the current orientation. Existing saves and tapes remain readable. Downgrading after writing opposite-facing saves requires restoring matching vehicle-data backups.
Validation: Java 21
mvn clean verifypasses all 675 tests. Coverage includes an engine with three carriages, both turnout directions, reverse entry/exit, changing direction midway, adjacent switches, asymmetric axles, partial loading, route recovery, legacy saves, and throttle tape frames. Opus 5.5 high and Astra reviewed the changes; their premature-lock and partial-load findings have regression coverage and fixes inba99244.