user23123: Suppose a BIP9 feature is set to expire on day T. Suppose further that the retargeting period before T actually ends on day T+5, but the retargeting period (2016 blocks) actually signals for the BIP9 feature 95%+. Does the feature get activated or not?
I ask as this is a realistic scenario should BIP148 gain traction.

user44760: As per BIP 9, the transition to FAILED takes precendence. Which means that the feature will not be activated via BIP09.
The relevant part of the code.
case STARTED: 
            if (GetMedianTimePast(block.parent) >= timeout) {
                return FAILED;
            }
            int count = 0;
            walk = block;
            for (i = 0; i < 2016; i++) {
...

23123: <p>Suppose a BIP9 feature is set to expire on day T. Suppose further that the retargeting period before T actually ends on day T+5, but the retargeting period (2016 blocks) actually signals for the BIP9 feature 95%+. Does the feature get activated or not?</p>

<p>I ask as this is a realistic scenario should BIP148 gain traction.</p>
 44760: <p>As per <a href="https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki" rel="nofollow noreferrer">BIP 9</a>, the transition to FAILED takes precendence. Which means that the feature will not be activated via BIP09.
The relevant part of the code.</p>

<p><code>case STARTED: 
            if (GetMedianTimePast(block.parent) &gt;= timeout) {
                return FAILED;
            }
            int count = 0;
            walk = block;
            for (i = 0; i &lt; 2016; i++) {
...</code></p>
