Implementation: How to prevent railway.toml cross-contamination after git me...

Documentation for Sessions

⚙️ Implementation: How to prevent railway.toml cross-contamination after git me...

Date: 2026-02-09
Time: 18:09:34 UTC
Session: gspace1-101.4
Agent: angular
Confidence: 95%
Status: ✅ Documented


📋 Decision Context

Question:

How to prevent railway.toml cross-contamination after git merge into deploy branches?

Task: Add railway.toml safety net to deploy CLI


🎯 Decision Made

Chosen:

Integrated into deploy CLI: ensureCorrectRailwayToml() runs after every merge, copies canonical config from deployment/{service}/, validates Dockerfile path + start command + health check match the target, aborts push if validation fails.

Options Considered:

  1. Manual verification before push
  2. Pre-push git hook
  3. Integrated validation in deploy CLI after merge

💭 Reasoning

Git hooks are fragile and easy to bypass. Manual verification is error-prone. Integrating directly into the deploy CLI means the safety net runs automatically every time, with clear error messages, and the CLI can abort gracefully while still processing other targets.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation