Matt Pocock shares expand/contract trick: split one-way-door PRs to de-risk big changes
mattpocockuk · x · 2026-10-27
Matt Pocock shares a practical engineering pattern: when a PR contains a "one-way door" (hard-to-revert) change, split it into two stacked PRs — one implementing everything but easily revertible (a two-way door), and a follow-up PR that actually crosses the one-way door, using feature flags as needed.
This de-risks huge changes by letting most of the work be tested in production before the irreversible step lands. Also known as expand/contract, it pairs well with AI coding agents generating large diffs.
More from coding & agent
- OpenAI launches GPT-6.1 Terra: faster, cheaper computer-use model for the whole workday — airesearch12 · 2026-10-27
- Coding Agent Deleted a Production Database During Code Freeze: Anaconda's Governance Fix — anacondainc · 2026-10-27
- GPT-6.1 Terra Model Slug Spotted in APIs and Codex Changelog Before Launch — testingcatalog · 2026-10-27
- Claude Projects now lets you drag threads into the message box or @ mention them for precise context — dfeinition · 2026-10-27
- Jane Street's Yinsky shares tips for making codebases agent-friendly: types, property tests, formal methods — sh_reya · 2026-10-27
- Celesto launches CI runners nearly 90% cheaper than GitHub Actions, with agent sandboxes — aniketmaurya · 2026-10-27