Defendant Brian K. Fox was charged with eight felony counts, including two counts of attempted murder, and several firearm enhancements. To resolve his case, he pleaded guilty to a single count of robbery, admitted to personally using a firearm during the offense, and agreed to be sentenced to 15 years in prison, including 10 years for the firearm enhancement. The trial court accepted the plea and sentenced Fox in accordance with it.
Fox appealed without obtaining a certificate of probable cause from the trial court. He now contends that under Senate Bill No. 620 (2017-2018 Reg. Sess.) (Senate Bill No. 620), he is entitled to a remand not for the purpose of seeking to withdraw his plea, but instead for the purpose of asking the trial court to exercise its discretion under the new legislation to strike the firearm enhancement, potentially reducing his negotiated sentence by 10 years.
We reject Fox's view of Senate Bill No. 620, and in so doing decline to adopt the analysis of People v. Hurlic (2018) 25 Cal.App.5th 50, 235 Cal.Rptr.3d 255 ( Hurlic ) and other decisions following it. We agree that Senate Bill No. 620 applies to defendants whose judgments were not final when the law took effect, that it permits those who did not agree to serve a specific term for a firearm enhancement to seek resentencing, and that it permits those who did agree to a specific sentence to seek to withdraw from their pleas. But we perceive no legislative intent to authorize trial courts to reduce agreed-upon sentences while otherwise permitting defendants to retain the benefits of their plea agreements and avoid the likely risk of having to continue defending against the charges. Fox, who entered his plea after Senate Bill No. 620 was passed but happened to be sentenced before it took effect, is asking for an extraordinary remedy to which no defendants currently being sentenced are entitled. Since the only relief Fox could obtain under Senate Bill No. 620 would require him to challenge the validity of his plea by seeking to withdraw it, we must dismiss his appeal for failure to obtain a certificate of probable cause.
I.
FACTUAL AND PROCEDURAL BACKGROUND
In August 2015, Fox's co-defendant, Eric Espanol, stole a camera from a tourist in San Francisco.1 The tourist and his friends pursued Espanol, who then punched the tourist in the face. Fox pulled up in a car, and as Espanol tried to get in, the tourist and one of his friends struggled with Espanol to regain the camera. Fox *876then rolled down the car's window, shouted at Espanol to get in, and shot at the tourist, hitting him once. Fox and Espanol fled, but after a police chase they were quickly apprehended in the East Bay.
Fox was charged with eight felony counts-two counts of attempted murder, one count of second degree robbery, two counts of assault with a semiautomatic firearm, one count of evading a peace officer, one count of possession of a firearm by a felon, and one count of unlawfully carrying a loaded firearm-and two misdemeanor counts, both of resisting, obstructing, or delaying a peace officer.2 Numerous enhancement allegations accompanied the first six felony charges, including several firearm enhancements and allegations that the attempted murders were premeditated. The trial court later granted Fox's motion to dismiss one of the counts of attempted murder and one of the counts of assault with a firearm, which both pertained to the tourist's friend.
As part of a plea agreement, Fox pleaded guilty to the robbery count and admitted to personally using a firearm during the offense in exchange for a 15-year prison sentence, composed of a term of five years for the robbery and 10 years for the firearm enhancement.3 The remaining counts and allegations were dismissed. There is no indication in the record that Fox waived his right to appeal.
Fox entered his plea on September 19, 2017, the week after the Legislature passed Senate Bill No. 620 and the day after it was enrolled. He was sentenced on October 11, 2017, the same day the Governor signed the bill into law. Before the trial court pronounced sentence, Fox's trial counsel noted that Fox appeared to misunderstand how his custody credits would be calculated. Counsel also relayed Fox's request that the court strike the firearm enhancement, even though counsel had attempted "to explain to him that a plea deal isn't subject to renegotiation because we've agreed upon the terms of the plea deal. [¶] So the enhancement, even if it becomes discretionary on the Court's part at sentencing to the first of the year, if the Governor signs it into law and it happens, it wouldn't [a]ffect his sentence because he's agreed to a set disposition in exchange for taking 25 to life off the table if he went to trial and was unsuccessful." The court, counsel, and Fox discussed the custody credits issue, but striking the firearm enhancement was not mentioned again. The court then sentenced Fox in accordance with the plea agreement.
Fox filed a notice of appeal in pro per on December 4, 2017. He sought a certificate of probable cause to enable him to challenge on appeal the validity of the plea, on the basis that his trial counsel "coerce[d] [him] into taking [the] plea offer." The trial court denied the request. In March 2018, this court granted Fox's unopposed request to construe the notice of appeal to include matters occurring after the plea that did not affect the plea's validity and therefore did not require a certificate of probable cause.
Fox then moved in this court for permission to file a late request for a certificate *877of probable cause in the trial court. Specifically, he sought to request a certificate to permit him to argue on appeal that he should be permitted to withdraw his plea in light of Senate Bill No. 620. This court denied the motion, concluding that Fox's failure to timely seek a certificate of probable cause could not be excused. Fox petitioned for review of this ruling, and the Supreme Court denied the petition in August 2018. He then filed an opening brief raising a single claim: that he does not need to seek to withdraw his plea to be entitled to a remand to permit the trial court to exercise the discretion conferred by Senate Bill No. 620.
II.
DISCUSSION
A. The Certificate of Probable Cause Requirement.
"Under section 1237.5, a defendant cannot appeal after entering a plea of [guilty or] no contest unless he or she 'has filed with the trial court a written statement, executed under oath or penalty of perjury showing reasonable constitutional, jurisdictional, or other grounds going to the legality of the proceedings' and the trial court 'has executed and filed a certificate of probable cause for such appeal with the clerk of the court.' ' "The purpose of section 1237.5 is ... 'to discourage and weed out frivolous or vexatious appeals challenging convictions following guilty and nolo contendere pleas.' " ' " ( People v. Espinoza (2018) 22 Cal.App.5th 794, 798-799, 231 Cal.Rptr.3d 827 ( Espinoza ).) The Supreme Court has emphasized that the certificate rules must "be applied in a strict manner" and that a defendant cannot "obtain review of certificate issues" except by complying with the rules "fully, and, specifically, in a timely fashion." ( People v. Mendez (1999) 19 Cal.4th 1084, 1099, 81 Cal.Rptr.2d 301, 969 P.2d 146 ( Mendez ); People v. Cole (2001) 88 Cal.App.4th 850, 860, 106 Cal.Rptr.2d 174.)
Under California Rules of Court, rule 8.304, a defendant who has entered a plea of guilty need not obtain a certificate of probable cause "if the notice of appeal states that the appeal is based on: [¶] ... [¶] ... Grounds that arose after entry of the plea [that] do not affect the plea's validity." ( Cal. Rules of Court, rule 8.304(b)(4) ; see id. , rule 8.304(b)(1).) But such a statement alone is not dispositive. " 'In determining whether section 1237.5 applies to a challenge of a sentence imposed after a plea of guilty ..., courts must look to the substance of the appeal: "the crucial issue is what the defendant is challenging, not the time or manner in which the challenge is made." [Citation.] Hence, the critical inquiry is whether a challenge to the sentence is in substance a challenge to the validity of the plea, thus rendering the appeal subject to the requirements of section 1237.5.' " ( People v. Buttram (2003) 30 Cal.4th 773, 781-782, 134 Cal.Rptr.2d 571, 69 P.3d 420, italics omitted.)
Fox sought and was denied a certificate of probable cause on the custody credits issue. He also unsuccessfully sought leave from this court to file a late request for a certificate of probable cause to permit him to argue on appeal that he should be permitted to withdraw his plea in light of Senate Bill No. 620. (See In re Chavez (2003) 30 Cal.4th 643, 646, 134 Cal.Rptr.2d 54, 68 P.3d 347 ; Mendez , supra , 19 Cal.4th at pp. 1088-1089, 81 Cal.Rptr.2d 301, 969 P.2d 146.) As he points out, the issue he now raises is different: that "without requesting the opportunity to withdraw his plea on remand," he is entitled to have the trial court exercise its discretion under amended section 12022.5, subdivision (c) to determine whether to strike the firearm enhancement. In other words, rather than *878seeking to withdraw his plea, which would allow the prosecution to reinstate the dismissed charges, he seeks to have the trial court strike some or all of the 10-year portion of his 15-year sentence while leaving the rest of the negotiated plea intact.
Generally, when a defendant agrees to a sentence of a specific term-as opposed to agreeing to a maximum sentence that the trial court will not exceed when exercising its sentencing discretion-a challenge to the sentence "attacks an integral part of the plea, [and] is, in substance, a challenge to the validity of the plea" that requires a certificate of probable cause. ( People v. Panizzon (1996) 13 Cal.4th 68, 73, 51 Cal.Rptr.2d 851, 913 P.2d 1061 ; Hurlic , supra , 25 Cal.App.5th at pp. 55-56, 235 Cal.Rptr.3d 255 ; see People v. Shelton (2006) 37 Cal.4th 759, 770, 37 Cal.Rptr.3d 354, 125 P.3d 290.) "This differential treatment flows directly from the substance of the parties' agreement: Where the parties agree to a specific sentence, the court's '[a]cceptance of the agreement binds the court and the parties to the agreement' [citation], and a defendant's challenge to the specific sentence is 'in substance a challenge to the validity of the plea' [citation]. But where the parties agree to any sentence at or beneath an agreed-upon maximum, that 'agreement, by its nature, contemplates that the court will choose from among a range of permissible sentences within the maximum, and that abuses of this discretionary sentencing authority' do not attack the validity of the plea and 'will be reviewable on appeal' without a certificate of probable cause." ( Hurlic , at p. 56, 235 Cal.Rptr.3d 255.) Fox properly concedes that "the firearm enhancement was a[n] integral part of his plea bargain," as it represented two-thirds of the sentence to which he agreed, and that his claim is therefore "in substance a challenge to the validity of his plea" under the precedent governing certificates of probable cause. ( People v. Buttram , supra , 30 Cal.4th at p. 782, 134 Cal.Rptr.2d 571, 69 P.3d 420, italics omitted; see People v. Johnson (2009) 47 Cal.4th 668, 678, 101 Cal.Rptr.3d 332, 218 P.3d 972.)
B. Hurlic and the Decisions Following It.
Relying largely on Hurlic , Fox nonetheless contends that he does not need a certificate of probable cause to seek a remand on direct appeal for the trial court to determine whether to strike the firearm enhancement. In Hurlic , the defendant pleaded no contest to attempted murder and "admitted to a 20-year sentencing enhancement for the personal discharge of a firearm under section 12022.53, subdivision (c)" in exchange for a 25-year prison sentence and the dismissal of a premeditation allegation and two other charges of attempted premeditated murder. ( Hurlic , supra , 25 Cal.App.5th at pp. 53-54, 235 Cal.Rptr.3d 255.) On appeal, the defendant sought a remand for the trial court to exercise its discretion under Senate Bill No. 620, which was passed the month after he was sentenced. ( Hurlic , at p. 54, 235 Cal.Rptr.3d 255.) Like Fox, the defendant in Hurlic did not obtain a certificate of probable cause, and the case addressed the same threshold issue we face: Is a certificate required to seek a remand for the exercise of a trial court's discretion to strike firearm enhancements?
Division Two of the Second District Court of Appeal answered in the negative. It held that even though the defendant was in essence attacking the validity of the plea, a "second line of authority governing the retroactivity of new criminal statutes," under which courts have uniformly held that Senate Bill No. 620 applies retroactively to all convictions that are not yet final, "trumps" the line of authority governing when a certificate of probable cause is required. ( *879Hurlic , supra , 25 Cal.App.5th at pp. 56-57, 235 Cal.Rptr.3d 255.) The court gave three reasons for its conclusion: the general rule that plea agreements are deemed to contemplate the possibility of subsequent changes to the law, the purposes of the certificate requirement, and the principle that when two statutes conflict, the later and more specific one takes precedence. ( Id. at pp. 57-58, 235 Cal.Rptr.3d 255.)
Hurlic characterized Supreme Court precedent as establishing that "[u]nless a plea agreement contains a term requiring the parties to apply only the law in existence at the time the agreement is made, ... 'the general rule in California is that the plea agreement will be " 'deemed to incorporate and contemplate not only the existing law but the reserve power of the state to amend the law or enact additional laws for the public good and in pursuance of public policy.' " ' " ( Hurlic , supra , 25 Cal.App.5th at p. 57, 235 Cal.Rptr.3d 255, quoting Doe v. Harris (2013) 57 Cal.4th 64, 66, 158 Cal.Rptr.3d 290, 302 P.3d 598 ( Doe ).) "Put differently," Hurlic stated, "courts will not amend a plea agreement to add ' "an implied promise [that] the defendant will be unaffected by a change in the statutory consequences attending his or her conviction." ' " ( Hurlic , at p. 57, 235 Cal.Rptr.3d 255, quoting Harris v. Superior Court (2016) 1 Cal.5th 984, 991, 209 Cal.Rptr.3d 584, 383 P.3d 648 ( Harris ).) Hurlic concluded that because the "defendant's plea agreement [did] not contain a term incorporating only the law in existence at the time of execution," the agreement could be " 'deemed to incorporate' the subsequent enactment of Senate Bill No. 620 ..., and thus give [the] defendant the benefit of its provisions without calling into question the validity of the plea." ( Hurlic , at p. 57, 235 Cal.Rptr.3d 255.)
Hurlic also opined that "dispensing with the certificate of probable cause requirement in the circumstances present ... better implement[ed] the intent behind that requirement," which is to encourage plea agreements and " 'weed out frivolous or vexatious appeals.' " ( Hurlic , supra , 25 Cal.App.5th at pp. 57-58, 235 Cal.Rptr.3d 255.) The court explained, "If ... a defendant who enters a plea of guilty or no contest must go through the additional step of seeking and obtaining a certificate of probable cause to avail himself or herself of the advantage of ameliorative laws like Senate Bill No. 620 ... that are otherwise indisputably applicable to him or her, the incentive to enter a plea-or, at a minimum, the incentive to do so expeditiously if legislation or voter initiative along these lines is being contemplated-is reduced. And where, as here, the defendant's entitlement to a new law's retroactive application is undisputed, an appeal seeking such application is neither 'frivolous' nor 'vexatious.' " ( Id. at p. 58, 235 Cal.Rptr.3d 255.)
Finally, Hurlic reasoned that "the rules of statutory construction favor application of Senate Bill No. 620 ... over section 1237.5. Where two statutes conflict, courts give precedence to the later-enacted statute and precedence to the more specific statute." ( Hurlic , supra , 25 Cal.App.5th at p. 58, 235 Cal.Rptr.3d 255.) Because Senate Bill No. 620 is "the later-enacted statute" and "more specific because it deals with ... particular sentencing enhancement[s], whereas section 1237.5 deals more generally with appeals from pleas," the court concluded that the legislative intent in passing Senate Bill No. 620 "prevails" over the intent behind section 1237.5. ( Hurlic , at p. 58, 235 Cal.Rptr.3d 255.)
The Sixth District Court of Appeal followed Hurlic in People v. Baldivia (2018) 28 Cal.App.5th 1071, 239 Cal.Rptr.3d 704 ( Baldivia ), which likewise addressed whether a defendant who pleaded no contest to various charges in exchange for a *880specific sentence was entitled to a remand under Senate Bill No. 620 even though he had not obtained a certificate of probable cause on the issue. ( Baldivia , at pp. 1073-1074, 1076, 239 Cal.Rptr.3d 704.) Baldivia agreed that a certificate of probable cause was not required because a plea agreement is deemed to incorporate later retroactive changes in the law, characterizing Hurlic 's first reason for its holding as "dispositive." ( Id. at p. 1078, 239 Cal.Rptr.3d 704.) Thus, Baldivia remanded for the trial court to determine whether to strike the firearm enhancements-which comprised 13 years and four months of the total sentence of 17 years and four months-based on the Attorney General's concession that a remand was appropriate. ( Id. at p. 1079, 239 Cal.Rptr.3d 704.)
Division Four of this court recently adopted the reasoning of Hurlic and Baldivia in addressing similar legislation. ( People v. Stamps (2019) 34 Cal.App.5th 117, 245 Cal.Rptr.3d ( Stamps ).) In Stamps , the defendant agreed to a nine-year prison sentence in exchange for a plea to burglary and a five-year sentencing enhancement under section 667, subdivision (a) based on a prior serious felony conviction. ( Stamps , at p. 119, 245 Cal.Rptr.3d 821.) Subsequently, Senate Bill No. 1393 (2017-2018 Reg. Sess.) (Senate Bill No. 1393) was signed into law. Similar to Senate Bill No. 620, the new law gives trial courts the discretion to dismiss enhancements under section 667, subdivision (a) and applies retroactively to all judgments that were not yet final as of January 1, 2019. ( Stamps , at p. 120, 245 Cal.Rptr.3d 821.) Stamps concluded that even though the defendant had agreed to a five-year term for the sentencing enhancement, he was entitled to a remand for the trial court to exercise its discretion to strike it. ( Id. at p. 119, 245 Cal.Rptr.3d 821.)
C. A Certificate of Probable Cause Was Required Here.
Although we ultimately conclude that Hurlic and Baldivia do not control the outcome here, we begin our discussion by rejecting the Attorney General's argument that this case is distinguishable from those cases because the defendants in them, unlike Fox, did not check the box on the notice of appeal indicating that they sought to challenge the validity of the plea. According to the Attorney General, the fact that Fox checked this box means the trial court "performed its mandated screening function and determined that the proposed appellate claim challenging the underlying plea was frivolous." We cannot agree. Although Fox may have indicated that he sought to challenge the validity of the plea by claiming in his notice of appeal that he had been "coerce[d]" into accepting the plea offer, he did not clearly raise Senate Bill No. 620 as the basis of his request for a certificate of probable cause. Thus, we cannot construe the court's denial of his request as encompassing the firearm-enhancement issue. And even if we could, the court's ruling cannot be held against Fox if a certificate was not required in the first place, as Hurlic and Baldivia suggest.
We nonetheless agree with the Attorney General that Hurlic and Baldivia (and by extension, Stamps ) are not convincing. To begin with, we disagree with Hurlic 's initial premise that a conflict exists between the line of authority involving certificates of probable cause and the line of authority recognizing Senate Bill No. 620's retroactive effect, requiring a determination of which authority "prevails." ( Hurlic , supra , 25 Cal.App.5th at pp. 56-57, 235 Cal.Rptr.3d 255.) Just because Senate Bill No. 620 applies to Fox's nonfinal judgment after a plea does not mean that Fox "is entitled to have the trial court exercise its discretion" under the new law without regard *881to other legal requirements. ( Hurlic , at p. 56, 235 Cal.Rptr.3d 255.) Nothing prevented Fox-who was fully aware by the time he appealed that Senate Bill No. 620 had been signed into law-from seeking a certificate on the issue. Indeed, nothing prevented the Hurlic defendant from doing so. The Hurlic defendant filed his notice of appeal a few weeks after the Governor signed Senate Bill No. 620, and even though the defendant did not check the box indicating he challenged the validity of the plea, "in the blank space where defendants are to spell out why they are requesting a certificate of probable cause, [he] wrote that he sought to avail himself of 'the new Senate Bill 620.' "4 ( Hurlic , at p. 54, 235 Cal.Rptr.3d 255.)
In our view, the real issue is whether seeking a remand for a trial court to exercise its discretion under Senate Bill No. 620 is a challenge to the validity of the plea. Both Doe and Harris , the two Supreme Court cases on which Hurlic relied, involve the general rule that a plea agreement is " ' " 'deemed to incorporate and contemplate not only the existing law but the reserve power of the state to amend the law or enact additional laws for the public good and in pursuance of public policy.' " ' " ( Hurlic , supra , 25 Cal.App.5th at p. 57, 235 Cal.Rptr.3d 255, quoting Doe , supra , 57 Cal.4th at p. 66, 158 Cal.Rptr.3d 290, 302 P.3d 598.) Neither had occasion to discuss certificates of probable cause, as Doe addressed a question certified to it by the Ninth Circuit Court of Appeals ( Doe , at p. 65, 158 Cal.Rptr.3d 290, 302 P.3d 598 ), and Harris was an appeal from a denial of a Proposition 47 petition to recall sentence. ( Harris , supra , 1 Cal.5th at p. 987, 209 Cal.Rptr.3d 584, 383 P.3d 648.) The decisions did, however, conclude that parties to a plea agreement could not avoid the consequences of " 'changes in the law that the Legislature [or the electorate] has intended to apply to them.' " ( Id. at p. 991, 209 Cal.Rptr.3d 584, 383 P.3d 648, italics omitted.) Harris determined that the People could not withdraw from the plea when the defendant sought resentencing under Proposition 47, and Doe determined that the defendant was subject to a change in the registration requirements for sex offenders. ( Harris , at p. 987, 209 Cal.Rptr.3d 584, 383 P.3d 648 ; Doe , at pp. 65-66, 158 Cal.Rptr.3d 290, 302 P.3d 598.) Hurlic , in turn, relied on Doe and Harris to conclude that a defendant whose "plea agreement does not contain a term incorporating only the law in existence at the time of execution ... will be 'deemed to incorporate' the subsequent enactment of Senate Bill No. 620 ... and thus give [the] defendant the benefit of [the bill's] provisions without calling into the question the validity of the *882plea." ( Hurlic , at p. 57, 235 Cal.Rptr.3d 255.)
But the general rule that plea agreements incorporate subsequent changes in the law is not pertinent here for two reasons. First, Fox entered his plea the week after Senate Bill No. 620 passed the Legislature, whereas the Stamps , Baldivia , and Hurlic defendants all entered their pleas and were sentenced before the relevant legislation was passed or signed into law. ( Stamps , supra , 34 Cal.App.5th at pp. 119-120, 245 Cal.Rptr.3d 821 ; Baldivia , supra , 28 Cal.App.5th at p. 1075, 239 Cal.Rptr.3d 704 ; Hurlic , supra , 25 Cal.App.5th at p. 53, 235 Cal.Rptr.3d 255.) In a footnote that neither Fox nor the Attorney General addresses, Hurlic observed, "Because defendant's plea agreement was negotiated and fully executed prior to Senate Bill No. 620 ... becoming law on October 11, 2017, we have no occasion to address whether a defendant whose plea agreement was negotiated while Senate Bill No. 620 was already part of the legal landscape must obtain a certificate of probable cause." ( Hurlic , at p. 57, fn. 3, 235 Cal.Rptr.3d 255.) In this case, the bill was "already part of the legal landscape" before Fox entered his plea and was sentenced upon it, and his trial counsel's comments at the sentencing hearing reveal that in agreeing to a 10-year term for the firearm enhancement the parties understood that Fox would not have the benefit of the new law once it went into effect.5 (See Doe , supra , 57 Cal.4th at p. 71, 158 Cal.Rptr.3d 290, 302 P.3d 598 [recognizing possibility that "the parties to a particular plea bargain might affirmatively agree or implicitly understand the consequences of a plea will remain fixed despite amendments to the relevant law"].) Thus, even if Hurlic and the cases following it were correctly decided, they would not compel us to conclude that a certificate of probable cause was unnecessary here.
Second, and more importantly, the general rule that plea agreements incorporate subsequent changes in the law pertains only to changes that the Legislature or electorate " 'intended to apply to ' " the parties to plea agreements, a crucial limitation. ( Harris , supra , 1 Cal.5th at p. 991, 209 Cal.Rptr.3d 584, 383 P.3d 648.) Doe addressed Megan's Law, which amended California's Sex Offender Registration Act (§ 290 et seq.) to make personal information about registered sex offenders available to the public. ( Doe , supra , 57 Cal.4th at pp. 65-67, 158 Cal.Rptr.3d 290, 302 P.3d 598 ; see § 290.46.) This amendment applied to " 'every person described in [section 290.46]' "-that is, every person required to register as a sex offender-" 'without regard to when his or her crimes were committed or when his or her duty to register pursuant to Section 290 arose.' " ( Doe , at pp. 66-67, 158 Cal.Rptr.3d 290, 302 P.3d 598, quoting § 290.46, subd. (m), italics added.) And Harris addressed Proposition 47, which reduced certain nonviolent crimes from felonies to misdemeanors and created a procedure by which defendants serving sentences for " 'a conviction, *883whether by trial or plea ,' " of such a crime could petition to be resentenced. ( Harris , at pp. 988-989, 209 Cal.Rptr.3d 584, 383 P.3d 648, quoting § 1170.18, subd. (a), italics added.) Thus, in both cases the statutory language reflected an intent that the amendment apply to all defendants convicted by plea, either by not excluding them ("every person") or by specifically including them (defendants convicted "by trial or plea"). Senate Bill No. 620 reflects no such intent.
We disagree with the suggestion by the dissent and other decisions that if a new law applies retroactively to defendants with nonfinal judgments, as Senate Bill No. 620 undisputedly does, this equates to the Legislature's intent that the change be incorporated into all plea agreements in cases where the judgment is not yet final. (See Stamps , supra , 34 Cal.App.5th at p. 123, 245 Cal.Rptr.3d 821 ; Hurlic , supra , 25 Cal.App.5th at pp. 56-57.) Senate Bill No. 620's retroactivity is based on the general presumption under In re Estrada (1965) 63 Cal.2d 740, 48 Cal.Rptr. 172, 408 P.2d 948 ( Estrada ) that " 'when a statute mitigating punishment becomes effective after the commission of the prohibited act but before final judgment the lesser punishment provided by the new law should be imposed in the absence of an express statement to the contrary by the Legislature.' " ( People v. Woods (2018) 19 Cal.App.5th 1080, 1090, 228 Cal.Rptr.3d 318.) But as framed by the Supreme Court, in Estrada the relevant question of legislative intent was, "[D]id the Legislature intend the old or new statute to apply?" ( Estrada , at p. 744, 48 Cal.Rptr. 172, 408 P.2d 948.) In other words, the issue was whether the governing law at the time of the crime or a subsequent change in the governing law applied when sentencing the defendant, and it was taken for granted that the defendant was entitled to the lesser punishment under the new law if it did apply.
Here, in contrast, we accept that the new versions of sections 12022.5 and 12022.53 apply, and the issue we must resolve is whether the Legislature intended that the new versions be incorporated into plea agreements like Fox's that include an agreed-upon sentence. Thus, the dissent's charge that we are "pay[ing] insufficient heed" to Estrada 's holding that a change in the criminal law mitigating punishment " 'should apply to every case to which it constitutionally could apply' " (quoting Estrada , supra , 63 Cal.2d at p. 745, 48 Cal.Rptr. 172, 408 P.2d 948 ) rests on a misreading of Estrada . Again, the issue of legislative intent in that case was whether "the amendatory statute should prevail" over the earlier version of the law-i.e., whether the new law should apply-not whether the defendant qualified for relief under the amended law-i.e., how the new law should apply. ( Id. at pp. 744-745, 48 Cal.Rptr. 172, 408 P.2d 948.) By the dissent's logic, a defendant who agreed to a specific term for a firearm enhancement after Senate Bill No. 620 took effect and is sentenced today would be entitled to have the trial court exercise its discretion to strike the enhancement, violating the plea agreement, because the statutory amendments undoubtedly now "apply" any time a defendant is sentenced. But defendants enter plea bargains all the time in which they give up the opportunity for the trial court to exercise its discretion in a way that might otherwise benefit them. Estrada cannot be read to authorize more beneficial treatment under Senate Bill No. 620 for defendants who were sentenced before January 1, 2019, and whose judgments happened to be nonfinal on that date, than it does for defendants sentenced after that date.
We therefore turn to whether the Legislature intended for a trial court to be able to exercise sentencing discretion under Senate Bill No. 620 even when a defendant *884agrees to serve a specific term for a firearm enhancement and does not seek to withdraw the plea. Both sections 12022.5, subdivision (c) and 12022.53, subdivision (h) now authorize a trial court to strike or dismiss a firearm enhancement "at the time of sentencing," including "any resentencing that may occur pursuant to any other law." Although the amended statutes thus do not expressly exclude defendants convicted by plea, they do not purport, in any way analogous to Megan's Law, to apply to all defendants convicted of firearm enhancements either. Nor did Senate Bill No. 620 create a separate procedural mechanism, akin to the one created by Proposition 47, under which defendants serving sentences that include a firearm enhancement can seek resentencing.6 Rather, a trial court's ability to exercise its discretion under the new law arises only when a defendant is being sentenced or resentenced under another law. Given the amended statutes' utter silence on the matter, we discern no legislative intent to dispose of existing limits on a trial court's discretion when sentencing a defendant convicted by plea. Those limits effectively preclude defendants who agreed to a specific term for a firearm enhancement from gaining relief under Senate Bill No. 620 unless they withdraw their pleas , meaning a certificate of probable cause is required to pursue such claims on direct appeal.
" 'The process of plea bargaining ... contemplates an agreement negotiated by the People and the defendant and approved by the [trial] court.' " ( People v. Collins (1978) 21 Cal.3d 208, 214, 145 Cal.Rptr. 686, 577 P.2d 1026.) Before sentencing a defendant convicted by plea, a trial court has the authority to withdraw its approval of the plea agreement. (§ 1192.5; People v. Segura (2008) 44 Cal.4th 921, 931, 80 Cal.Rptr.3d 715, 188 P.3d 649.) But once the court " 'has accepted a plea bargain[, it] is bound to impose a sentence within the limits of that bargain. ... Should the court consider the plea bargain to be unacceptable, its remedy is to reject it, not to violate it, directly or indirectly.' " ( Segura , at p. 931, 80 Cal.Rptr.3d 715, 188 P.3d 649.) In other words, a court is prohibited "from unilaterally modifying the terms of the bargain without affording-or after it has become impossible to afford-an opportunity to the aggrieved party to rescind the plea agreement and resume proceedings where they left off." ( People v. Kim (2011) 193 Cal.App.4th 1355, 1361, 122 Cal.Rptr.3d 832.) Nothing in Senate Bill No. 620 suggests that, upon becoming effective, it empowers a trial court to disregard the express terms of a plea agreement by imposing a sentence that does not reflect an agreed-upon term for a firearm enhancement. Thus, we cannot agree with Fox that the new law entitles him to "whittle down" his sentence by two-thirds, to five years, while otherwise retaining the benefits of a bargain that resulted in the dismissal of numerous other charges and allowed him to avoid a potential life sentence. ( People v. Kelly (2019) 32 Cal.App.5th 1013, 1018, 244 Cal.Rptr.3d 394 ( Kelly ); see Collins , at pp. 214-215, 145 Cal.Rptr. 686, 577 P.2d 1026 ; People v. Enlow (1998) 64 Cal.App.4th 850, 854, 75 Cal.Rptr.2d 402.)
We find additional support in Kelly , a recent decision of Division Six of the Second District Court of Appeal. In that case, the defendant agreed to an 18-year prison sentence in exchange for a plea to burglary and various sentencing enhancements, *885including two five-year terms based on prior serious felony convictions under section 667, subdivision (a). ( Kelly , supra , 32 Cal.App.5th at p. 1015, 244 Cal.Rptr.3d 394.) The defendant sought a remand for resentencing under Senate Bill No. 1393, and Kelly concluded that her failure to obtain a certificate of probable cause required dismissal of her appeal, because she effectively sought to challenge an integral part of the plea agreement by seeking a remand for possible dismissal of the five-year enhancements.7 ( Id. at pp. 1015-1016, 244 Cal.Rptr.3d 394.) Relying on the principle that a sentencing court cannot modify the terms of an accepted plea bargain, the Court of Appeal noted that even if it "were to remand for resentencing, the trial court would still be bound by the terms of the plea agreement which provides a floor and ceiling of 18 years state prison." ( Id. at p. 1017, 244 Cal.Rptr.3d 394.)
We also find support in People v. Cunningham (1996) 49 Cal.App.4th 1044, 57 Cal.Rptr.2d 179, in which the Third District Court of Appeal also relied on the limits on a trial court's ability to unilaterally modify the terms of a plea bargain to deny a remand in circumstances similar to ours. In People v. Superior Court (Romero) (1996) 13 Cal.4th 497, 53 Cal.Rptr.2d 789, 917 P.2d 628, the Supreme Court held that the Three Strikes law did not remove a trial court's discretion under section 1385 to strike prior felony convictions. ( Romero , at pp. 529-530, 53 Cal.Rptr.2d 789, 917 P.2d 628.) The Court made its holding "fully retroactive" and authorized defendants to "raise the issue on appeal, or, if relief on appeal is no longer available, [to] file a petition for habeas corpus to secure reconsideration of the sentence." ( Id. at p. 530, fn. 13, 53 Cal.Rptr.2d 789, 917 P.2d 628.) Cunningham held that a defendant who entered a plea and agreed to a particular sentence was not entitled to a post- Romero remand for the trial court to consider whether to exercise its discretion to strike a prior offense under section 1385, however, based on the same principle that a court that has accepted a negotiated plea cannot modify the plea bargain's terms. ( Cunningham , at pp. 1047-1048, 57 Cal.Rptr.2d 179 ; see also People v. Cepeda (1996) 49 Cal.App.4th 1235, 1239-1240, 57 Cal.Rptr.2d 246 [defendant who pleaded guilty in exchange for specified sentence estopped from seeking Romero remand], disapproved on other grounds in Mendez , supra , 19 Cal.4th 1084 at p. 1098, 81 Cal.Rptr.2d 301, 969 P.2d 146 ; cf. People v. Smith (1997) 59 Cal.App.4th 46, 51, 68 Cal.Rptr.2d 732 [where parties did not agree to specific sentence, Romero remand would not violate plea bargain].)
Senate Bill No. 620 has the laudatory purpose of giving trial courts the discretion to strike firearm enhancements, which often comprise the bulk of a sentence, when doing so is in the interest of justice. And many defendants convicted by plea have had and will have the opportunity to benefit from Senate Bill No. 620, such as those entering pleas in exchange for an agreed-upon maximum sentence, i.e., agreements that allow a court to retain significant sentencing discretion. (See Espinoza , supra , 22 Cal.App.5th at p. 799.) But we cannot conclude that the Legislature intended the new law to enable defendants who agreed to serve a specific term *886for a firearm enhancement to avoid that term yet retain the benefits of their plea agreements. Rather, we conclude the remedy for such defendants is to seek to withdraw their pleas, and they may therefore seek resentencing under Senate Bill No. 620 on direct appeal only if they first obtain a certificate of probable cause-hardly as onerous a requirement as Hurlic suggests-to enable them to challenge the validity of their pleas. (See Hurlic , supra , 25 Cal.App.5th at pp. 57-58, 235 Cal.Rptr.3d 255.) In turn, this will weed out appeals in which the trial court is not inclined to exercise its discretion to strike a firearm enhancement. And even if a defendant is able to procure a certificate and successfully seeks a remand, he or she will not be entitled to have the trial court exercise that discretion unless the plea agreement is set aside, or is modified with the People's agreement.
III.
DISPOSITION
The appeal is dismissed.
I concur:
Banke, J.
DISSENT OF SANCHEZ, J.
The majority holds that a defendant, like Fox, who agrees to a specified sentence for a firearm enhancement under a negotiated plea is required to obtain a certificate of probable cause to challenge his sentence on appeal. Notwithstanding recent legislation that allows trial courts the discretion to strike firearm enhancements in the interests of justice, the majority concludes the Legislature did not intend "to authorize trial courts to reduce agreed-upon sentences while permitting defendants to retain the benefits of their plea agreements." I respectfully dissent.
The Legislature intended for Senate Bill No. 620 (2017-2018 Reg. Sess.) (Senate Bill No. 620) to apply retroactively to all nonfinal judgments of conviction, whether by trial or negotiated plea. Under applicable Supreme Court authority, a plea agreement is deemed to incorporate not only existing law but subsequent changes in law that are intended to apply retroactively to the parties. Requiring the parties' compliance with these changes does not violate the terms of a plea agreement or challenge its validity. Because Fox's appeal concerns just such a matter reserved by the plea agreement, he was not required to obtain a certificate of probable cause.
The majority questions whether the Legislature would have intended for defendant in effect to 'have his cake and eat it too.' But it is not unusual for legislative enactments to alter the consequences of a plea agreement to the detriment of one party or the other. Parties to a plea deal understand that sometimes they must bend to the will of the Legislature. Senate Bill No. 620 requires only that the trial court exercise its discretion to decide whether to strike a firearm enhancement, in full view of the circumstances that gave rise to the plea agreement and in accordance with the equities of the situation and the interests of justice. Accordingly, I would remand the matter for resentencing.
I. FACTUAL BACKGROUND
In exchange for a stipulated 15-year sentence and the dismissal of several charges, including attempted premeditated murder, Fox pleaded guilty to a single count of second degree robbery and admitted to the personal use of a firearm under Penal Code1 section 12022.5, subdivision (a). The court sentenced Fox to the agreed-upon term of 15 years, comprised of five years for the robbery plus 10 years *887for the firearm enhancement. There is no indication in the record that Fox waived his right to appeal or that the parties expressly agreed to insulate their plea agreement from any future changes in law.
Six days before Fox's entry of his guilty plea on September 19, 2017, the Legislature passed Senate Bill No. 620 and ordered it to be enrolled. (Sen. Bill No. 620, adopted by Assem., Sept. 13, 2017.) No mention of Senate Bill No. 620 was made at the hearing in which Fox entered his plea. The bill was signed by Governor Brown on October 11, 2017, the same day as Fox's sentencing hearing. At sentencing, Fox requested through his counsel that the trial court strike his firearm enhancement. The circumstances of Fox's sentencing hearing are discussed in more detail below. The court denied his request and sentenced Fox to a 15-year prison term less 894 days in custody credits. Fox filed a notice of appeal on December 4, 2017. He did not seek a certificate of probable cause related to his present claim that the matter should be remanded for resentencing in accordance with the newly enacted legislation.
Senate Bill No. 620 amended sections 12022.5 and 12022.53 to grant trial courts the discretion to strike or dismiss firearm enhancements at sentencing in the interests of justice. (Stats. 2017-2018, ch. 682, §§ 1, 2.) Section 12022.5 now provides: "The court may, in the interest of justice pursuant to Section 1385 and at the time of sentencing, strike or dismiss an enhancement otherwise required to be imposed by this section. The authority provided by this subdivision applies to any resentencing that may occur pursuant to any other law." ( § 12022.5, subd. (c).) Identical language appears in section 12022.53. ( § 12022.53, subd. (h).) These provisions became effective January 1, 2018, and have been held to apply retroactively to nonfinal judgments. ( People v. McVey (2018) 24 Cal.App.5th 405, 418, 233 Cal.Rptr.3d 915 ; People v. Woods (2018) 19 Cal.App.5th 1080, 1090-1091, 228 Cal.Rptr.3d 318 ; People v. McDaniels (2018) 22 Cal.App.5th 420, 424, 231 Cal.Rptr.3d 443 ; People v. Arredondo (2018) 21 Cal.App.5th 493, 507, 230 Cal.Rptr.3d 380 ( Arredondo ) ["Provisions which give trial courts discretion to reduce a sentence previously required by the Penal Code are nonetheless changes which benefit offenders who committed particular offenses or engaged in particular conduct and thereby manifest an intent by the Legislature that such offenders be given the benefit of that discretion in all cases which are not yet final."].)2 The question facing this court is whether Fox was required to obtain a certificate of probable cause in order to benefit from Senate Bill No. 620's sentencing discretion provisions.
II. DISCUSSION
a. Precedential Authority
Three lines of precedent come into play in this type of situation. Under the first, courts have held that a plea agreement is a type of contract whose terms cannot be altered unilaterally by the trial court. "[A] 'negotiated plea agreement is a form of contract,' [and] it is interpreted according to general contract principles. [Citations.] ... [Citations.] ' "When a guilty [or nolo *888contendere] plea is entered in exchange for specified benefits such as the dismissal of other counts or an agreed maximum punishment, both parties, including the state, must abide by the terms of the agreement." ' " ( People v. Segura (2008) 44 Cal.4th 921, 930-931, 80 Cal.Rptr.3d 715, 188 P.3d 649.) A trial court need not approve the plea agreement negotiated by the parties and may reject it, allowing the defendant to withdraw his or her plea and the parties to be restored to their pre-negotiation positions. ( Id. at p. 931, 80 Cal.Rptr.3d 715, 188 P.3d 649 ; see § 1192.5; People v. Kim (2011) 193 Cal.App.4th 1355, 1360-1361, 122 Cal.Rptr.3d 832.) Acceptance of the plea agreement by the court, on the other hand, "binds the court and the parties to the agreement." ( Segura , at p. 930, 80 Cal.Rptr.3d 715, 188 P.3d 649.) Although the trial court retains its inherent sentencing discretion, it must impose a sentence within the limits of the plea agreement. ( Id. at p. 931, 80 Cal.Rptr.3d 715, 188 P.3d 649.)
Under a second line of authority, a defendant who enters a plea of guilty or nolo contendere and who seeks to challenge his or her sentence on appeal is required, under certain circumstances, to obtain a certificate of probable cause to maintain the appeal. "Section 1237.5 states the general rule: A defendant may not take an appeal from a judgment of conviction entered on a plea of guilty or nolo contendere unless: (1) the defendant himself has 'filed with the trial court a written statement, executed under oath or penalty of perjury[,] showing reasonable constitutional, jurisdictional, or other grounds going to the legality of the proceedings'; and (2) the trial court has 'executed and filed a certificate of probable cause for such appeal with the county clerk.' " ( People v. Lloyd (1998) 17 Cal.4th 658, 663, 72 Cal.Rptr.2d 224, 951 P.2d 1191 ; see § 1237.5.) Two recognized exceptions permit the filing of an appeal without a certificate of probable cause: where an appeal raises "issues relating to the validity of a search and seizure, ... [or] issues regarding proceedings held subsequent to the plea for the purpose of determining the degree of the crime and the penalty to be imposed." ( People v. Buttram (2003) 30 Cal.4th 773, 780, 134 Cal.Rptr.2d 571, 69 P.3d 420 ( Buttram ); see Cal. Rules of Court, rule 8.304(b)(4).)
An appeal that attacks the validity of a plea agreement requires compliance with section 1237.5. ( People v. Panizzon (1996) 13 Cal.4th 68, 76, 51 Cal.Rptr.2d 851, 913 P.2d 1061 ( Panizzon ).) However, " '[i]n determining whether section 1237.5 applies to a challenge of a sentence imposed after a plea of guilty or no contest, courts must look to the substance of the appeal: "the crucial issue is what the defendant is challenging, not the time or manner in which the challenge is made." [Citation.] Hence, the critical inquiry is whether a challenge to the sentence is in substance a challenge to the validity of the plea, thus rendering the appeal subject to the requirements of section 1237.5.' " ( Buttram , supra , 30 Cal.4th at pp. 781-782, 134 Cal.Rptr.2d 571, 69 P.3d 420.)
Where an appeal challenges a specified sentence that constituted an element of a negotiated plea agreement, such challenge "attacks an integral part of the plea, ... [and] is, in substance, a challenge to the validity of the plea" itself. ( Panizzon , supra , 13 Cal.4th at p. 73, 51 Cal.Rptr.2d 851, 913 P.2d 1061.) In Panizzon , the defendant pleaded no contest to multiple felonies in exchange for a specific sentence after signing a written waiver of his right to appeal. ( Id. at pp. 80-83, 51 Cal.Rptr.2d 851, 913 P.2d 1061.) The court concluded that the defendant's failure to obtain a certificate of probable cause was fatal to his appeal. ( Id. at p. 79, 51 Cal.Rptr.2d 851, 913 P.2d 1061 ["[A] challenge to a *889negotiated sentence imposed as part of a plea bargain is properly viewed as a challenge to the validity of the plea itself. Therefore, it was incumbent upon defendant to seek and obtain a probable cause certificate in order to attack the sentence on appeal."].)
On the other hand, where an "open" plea is entered-that is, "where the terms of the plea agreement leave issues open for resolution by litigation,"-the Supreme Court has held that "appellate claims arising within the scope of that litigation do not attack the validity of the plea, and thus do not require a certificate of probable cause." ( Buttram , supra , 30 Cal.4th at p. 783, 134 Cal.Rptr.2d 571, 69 P.3d 420.) The parties in Buttram negotiated a plea agreement which provided for a maximum sentence rather than a specified sentence. The agreement thus contemplated that the trial court would exercise its discretion to determine an appropriate sentence within the constraints of the bargain. ( Id. at pp. 785-786, 134 Cal.Rptr.2d 571, 69 P.3d 420.) In these circumstances, the Buttram court held a certificate of probable cause was not required because the defendant "seeks only to raise issues reserved by the plea agreement, and as to which he did not expressly waive the right to appeal. Accordingly, his appeal does not, in substance, attack the validity of the plea." ( Id. at p. 787, 134 Cal.Rptr.2d 571, 69 P.3d 420.)
These two strands of authority, standing alone, provide support for the majority's position that a defendant who agrees to a specified sentence for a firearm enhancement under a negotiated plea must obtain a certificate of probable cause to seek resentencing under Senate Bill No. 620. The majority reasons that asking the trial court to exercise its discretion to strike the firearm enhancement alters the terms of the agreement unilaterally and amounts to an attack on the validity of the plea itself.
But as our sister districts recognized in People v. Hurlic (2018) 25 Cal.App.5th 50, 235 Cal.Rptr.3d 255 ( Hurlic ) and People v. Baldivia (2018) 28 Cal.App.5th 1071, 239 Cal.Rptr.3d 704 ( Baldivia ), and now Division Four of this court in People v. Stamps (2019) 34 Cal.App.5th 117, 245 Cal.Rptr.3d 821 (Stamps ), a third line of Supreme Court precedent clarifies that plea agreements are not immune to changes in law that have retroactive application. Parties to a plea agreement "are deemed to know and understand that the state ... may enact laws that will affect the consequences attending the conviction entered upon the plea." ( Doe v. Harris (2013) 57 Cal.4th 64, 70, 158 Cal.Rptr.3d 290, 302 P.3d 598 ( Doe ).) Under this precedent, a plea agreement is deemed to incorporate changes in law such as Senate Bill No. 620 that are intended to apply to the parties. Defendant Fox's appeal, which seeks resentencing to allow the trial court to exercise its discretion consistent with the new legislation, is not an attack on the validity of the plea itself but rather an effort to raise issues reserved by the plea agreement, and as to which Fox did not waive his right to appeal. ( Buttram , supra , 30 Cal.4th at p. 787, 134 Cal.Rptr.2d 571, 69 P.3d 420.) No certificate of probable cause was required under the circumstances.
In Doe , the defendant entered into a plea agreement that required him to register as a sex offender. At the time of his plea, the defendant's registration information was deemed confidential, available only to law enforcement. The law was amended to mandate public access to that information and made retroactive. ( Doe , supra , 57 Cal.4th at pp. 66-67, 158 Cal.Rptr.3d 290, 302 P.3d 598.) The defendant challenged these statutory amendments as a violation of his plea agreement. In response to a question certified to the California Supreme Court, Doe explained that the terms of a plea agreement can be *890affected by changes in law without breaching the agreement itself. The "general rule in California is that the plea agreement will be ' "deemed to incorporate and contemplate not only the existing law but the reserve power of the state to amend the law or enact additional laws for the public good and in pursuance of public policy." ' " ( Doe , at p. 66, 158 Cal.Rptr.3d 290, 302 P.3d 598.) Therefore, "requiring the parties' compliance with changes in the law made retroactive to them does not violate the terms of the plea agreement , nor does the failure of a plea agreement to reference the possibility the law might change translate into an implied promise the defendant will be unaffected by a change in the statutory consequences attending to his or her conviction." ( Id. at pp. 73-74, 158 Cal.Rptr.3d 290, 302 P.3d 598, (italics added).)
Doe clarified "it is not impossible the parties to a particular plea bargain might affirmatively agree or implicitly understand the consequences of a plea will remain fixed despite amendments to the relevant law." ( Doe , supra , 57 Cal.4th at p. 71, 158 Cal.Rptr.3d 290, 302 P.3d 598.) However, "prosecutorial and judicial silence on the possibility the Legislature might amend a statutory consequence of a conviction should not ordinarily be interpreted to be an implied promise that the defendant will not be subject to the amended law." ( Id. at p. 72, 158 Cal.Rptr.3d 290, 302 P.3d 598.) In the absence of express agreement or clear indication from the record that the parties intended to insulate a plea agreement from later changes in law, a plea agreement will be understood to incorporate legislative amendments that may alter the consequences of the negotiated plea, even to the detriment to one party or another. As later cases show, these legal principles apply with equal force to negotiated plea agreements for specified sentences.
In Harris v. Superior Court (2016) 1 Cal.5th 984, 209 Cal.Rptr.3d 584, 383 P.3d 648 ( Harris ), the defendant pleaded guilty to a felony count of grand theft and admitted to a prior robbery conviction in exchange for a specified sentence of six years and dismissal of a robbery charge and other enhancement allegations. ( Harris , at p. 987, 209 Cal.Rptr.3d 584, 383 P.3d 648.) After passage of Proposition 47, the defendant petitioned to have his sentence recalled and to be resentenced to a misdemeanor term. The People moved to set aside the plea agreement and reinstate the dismissed felony charges on the basis that resentencing would deprive them of the benefit of their bargain. ( Harris , at p. 988, 209 Cal.Rptr.3d 584, 383 P.3d 648.) Reciting the foregoing principles in Doe , the Supreme Court held the state could not withdraw from the plea agreement. "Critical to this question," the court stated, is legislative intent and "whether the electorate intended the changes to apply to the parties to this plea agreement." ( Id. at p. 991, 209 Cal.Rptr.3d 584, 383 P.3d 648.) The court answered in the affirmative, noting that Proposition 47 expressly governed those individuals " 'serving a sentence for a conviction, whether by trial or plea ' " and established a resentencing process that contemplated relief to all persons that met the qualifying criteria. ( Id. at pp. 991-992, 209 Cal.Rptr.3d 584, 383 P.3d 648, citing § 1170.18, subd. (a).) The court concluded that allowing the state to set aside the plea agreement would frustrate the intended benefits of Proposition 47 in reducing nonviolent offenders in state prisons and the costs of incarceration. ( Id. at p. 992, 209 Cal.Rptr.3d 584, 383 P.3d 648.) Harris instructs that even as to negotiated pleas where a specified sentence is an integral term, parties to a plea agreement cannot escape the consequences attendant to retroactive changes in law.
*891Applying Doe and Harris, the Second District Court of Appeals held in Hurlic that a defendant who entered a guilty plea and agreed to a specified term of years for a firearm enhancement was not required to obtain a certificate of probable cause to challenge his sentence on appeal. ( Hurlic , supra , 25 Cal.App.5th at p. 53, 235 Cal.Rptr.3d 255.) Like Fox, the defendant in Hurlic sought resentencing under the new discretionary authority granted by Senate Bill No. 620. The Hurlic court concluded that a conflict exists between the line of authority under Panizzon that requires a certificate of probable cause to appeal from a stipulated sentence arising from a negotiated plea, and the line of authority governing the retroactive application of ameliorative changes in criminal laws, which holds that "absent an express indication to the contrary, courts will infer an intent to apply a new law retroactively to all nonfinal convictions where the new law 'mitigat[es]' or 'lessens' 'the punishment for a particular criminal offense.' " ( Ibid. , citing People v. Brown (2012) 54 Cal.4th 314, 324, 142 Cal.Rptr.3d 824, 278 P.3d 1182 ; In re Estrada (1965) 63 Cal.2d 740, 744-745, 48 Cal.Rptr. 172, 408 P.2d 948 ( Estrada ).) Hurlic concluded that the certificate of probable cause requirement must give way to this latter precedent for three reasons.
First, a plea agreement must be deemed to incorporate the subsequent enactment of legislation such as Senate Bill No. 620 "and thus give defendant the benefit of its provisions without calling into question the validity of the plea." ( Hurlic , supra , 25 Cal.App.5th at p. 57, 235 Cal.Rptr.3d 255.) Second, the purpose underlying the certificate requirement, to " 'weed out frivolous or vexatious appeals,' " is not served by requiring a defendant who is indisputably entitled to the benefits of Senate Bill No. 620 to overcome additional procedural hurdles entailed by section 1237.5. ( Id. at pp. 57-58, 235 Cal.Rptr.3d 255.) Third, the court concluded that where two statutes conflict, the later-enacted Senate Bill No. 620 should take precedence over the earlier-enacted section 1237.5. ( Id. at p. 58, 235 Cal.Rptr.3d 255.)
Following Hurlic , the Sixth District held in Baldivia that a certificate of probable cause was not required for a defendant who appealed from a no contest plea and admitted to two robbery counts and a firearm enhancement in exchange for a specified term of 17 years four months. ( Baldivia , supra , 28 Cal.App.5th at p. 1074, 239 Cal.Rptr.3d 704.) "Under Doe and Harris , a plea agreement is deemed to incorporate subsequent changes in law so long as those changes were intended by the Legislature or the electorate to apply to such a plea agreement." ( Id. at p. 1078, 239 Cal.Rptr.3d 704.) The Baldivia court concluded Senate Bill No. 620 applies to all nonfinal judgments of conviction. ( Ibid. )
Finally, in Stamps, Division Four of this court adopted the reasoning in Hurlic and ordered resentencing for a defendant who had stipulated to a nine-year prison term in exchange for pleading no contest to residential burglary and admitting to a prior conviction for a serious felony under section 667, subdivision (a)(1). ( Stamps , supra , 34 Cal.App.5th at p. 119, 245 Cal.Rptr.3d 821.) At the time of sentencing, the trial court was required to impose a five-year enhancement for a prior serious felony conviction. (Pen. Code, former § 1385, subd. (b).) The law was amended to give trial courts discretion to dismiss this prior-conviction enhancement in the interests of justice. (Sen. Bill No. 1393 (2017-2018 Reg. Sess.) Stats. 2018, ch. 1013, § 2.) The Stamps court similarly relied on Doe and Harris to conclude that "[b]ecause the Senate Bill No. 1393 amendment was intended to apply retroactively, defendant is entitled to seek relief *892under the new law." ( Stamps , at p. 123, 245 Cal.Rptr.3d 821.)
I agree with the majority that Hurlic posits a conflict between legal precedent and statutes that need not exist. But I would resolve the matter differently. Under Panizzon and Buttram , a certificate of probable cause is required when an appeal in substance challenges the validity of the guilty plea, but one is not required when the appeal raises issues reserved by the plea agreement and left open for further resolution by the trial court. Doe and Harris clarify that a plea agreement is deemed to incorporate later changes in law that are intended to have retroactive application and these changes are to be given effect without calling into question the validity of the plea agreement. ( Hurlic , supra , 25 Cal.App.5th at p. 57, 235 Cal.Rptr.3d 255.) The necessary inquiry is therefore twofold: Did the Legislature intend for Senate Bill No. 620 to apply to convictions arising by plea agreement and criminal trial alike? And did the parties to the plea bargain at issue here intend to insulate themselves from future changes in law? I would answer "yes" to the first question, and "no" to the second.
b. Senate Bill No. 620 is intended to reach all nonfinal criminal convictions
Senate Bill No. 620 provides that "[t]he court may, in the interest of justice pursuant to Section 1385 and at the time of sentencing, strike or dismiss an enhancement otherwise required to be imposed by this section." ( §§ 12022.5, subd. (c) ; 12022.53, subd. (h).) Under prior law, firearm enhancement statutes mandated the imposition of an enhancement when the firearm allegation was found true, and expressly forbade trial courts from staying or dismissing such punishment. (See former § 12022.5, subd. (c) ["Notwithstanding Section 1385 or any other provisions of law, the court shall not strike an allegation under this section or a finding bringing a person within the provisions of this section."]; People v. Hutchins (2001) 90 Cal.App.4th 1308, 1314, 109 Cal.Rptr.2d 643 ).
Senate Bill No. 620 deleted this restriction and conferred discretion on trial courts to strike or dismiss firearm enhancements to the same extent a court may do so for other enhancement allegations under section 1385. The amendment broadly applies "at the time of sentencing" and draws no distinction between sentencing based upon a conviction by negotiated plea or jury trial. Furthermore, this discretionary authority expressly "applies to any resentencing that may occur pursuant to any other law ." ( § 12022.5, subd. (c), (italics added).) These provisions make clear the Legislature intended for these amendments to apply at the time of any sentencing or resentencing, which necessarily includes sentencing after entry of a guilty or no contest plea. Nothing in the statutory language suggests the Legislature intended to limit the reach of these statutory amendments to convictions by jury or court trial.
The legislative history of Senate Bill No. 620, while silent on its applicability to plea agreements, supports the view that it was intended to apply broadly to all nonfinal criminal convictions. The Senate Committee on Public Safety's analysis of the bill states "[t]he purpose of this legislation is to allow the court, in the interest of justice and at the time of sentencing, strike a firearm enhancement, as specified." (Sen. Com. on Pub. Safety, Rep. on Sen. Bill No. 620, as amended Mar. 28, 2017, p. 1.) The analysis notes that the bill author identified several problems with mandatory firearm enhancements, including "[o]ver 30,000 persons currently incarcerated as a result of these extensions," a "greatly increase[d] population of incarcerated persons" and "[d]isproportionately increase[d]
*893racial disparities in imprisonments," and noting "[s]everal studies have concluded that increasing an already long sentence has no material deterrent effect." (Id. at pp. 2-3.)
An analysis by the Assembly Committee on Public Safety discusses background information provided by the bill author. According to this background, laws such as the "10-20-Life Firearm Law" significantly increased sentencing enhancements for firearm offenses, where the enhancement often exceeds the sentence for the crime itself, and "[d]eterrence was a driving factor behind this legislation." (Assem. Com. on Pub. Safety, Rep. on Sen. Bill No. 620, as amended Mar. 28, 2017, pp. 3-4.) Recent studies have called that premise into question. One report on the growth of incarceration in prisons found that "[t]he incremental deterrent effect of increases in lengthy prison sentences is modest at best." (Id. at pp. 4-5.) Another report by the Little Hoover Commission tied "California's sentencing structure and enhancements" to the state's "20-year ... prison building boom." (Id . at p. 5.) The bill author summarized: "In light of the questionable deterrent effect and state prison impact of sentence increases, should these firearm enhancements be mandatory in every case irrespective of the underlying facts of a specific case?" (Ibid .) These points are repeated throughout the bill and floor analyses and indicate that the Legislature was grappling with the large-scale impacts of mandatory firearm enhancements on lengthy prison sentences, prison crowding, and incarceration costs.3 As a practical matter, where judgments based on plea agreements "represent the vast majority of felony and misdemeanor dispositions in criminal cases" ( In re Chavez (2003) 30 Cal.4th 643, 654, fn. 5, 134 Cal.Rptr.2d 54, 68 P.3d 347 [citing statistics that less than 5 percent of felony convictions resulted from a court or jury trial] ), it is difficult to conceive that the Legislature would undermine the law's effect by excluding plea agreements from a trial court's sentencing discretion.
The majority agrees that Senate Bill No. 620 applies to plea agreements generally, but disagrees as to the type of negotiated plea here, involving a stipulated sentence for a firearm enhancement. It concludes that because the statutory amendments do not specifically mention convictions by plea or provide a mechanism for resentencing, the Legislature did not intend to disturb this type of plea agreement, which is protected by other governing principles. Not so. While the Harris court addressed express provisions in Proposition 47 making clear the electorate's intent to affect all plea agreements, that does not mean legislative intent cannot be discerned by other means. As discussed above, sections 12022.5 and 12022.53 broadly apply "at the time of sentencing" and at "any resentencing" pursuant to any other law and they draw no distinction between convictions based on a negotiated plea or criminal trial. ( § 12022.5, subd. (c), § 12022.53, subd. (h).) The statutory language evinces a legislative intent to apply to any sentencing or resentencing, and is no less broad than the examples in Doe and Harris referenced by the majority.
The majority also pays insufficient heed to the principle in Estrada that when ameliorative changes in criminal law mitigate a punishment, the "inevitable inference [is] that the Legislature must have intended that the new statute ... should apply to every case to which it constitutionally could apply." ( *894Estrada , supra , 63 Cal.2d at p. 745, 48 Cal.Rptr. 172, 408 P.2d 948 ; see People v. Conley (2016) 63 Cal.4th 646, 657, 203 Cal.Rptr.3d 622, 373 P.3d 435 ["The Estrada rule rests on an inference that, in the absence of contrary indications, a legislative body ordinarily intends for ameliorative changes to the criminal law to extend as broadly as possible, distinguishing only as necessary between sentences that are final and sentences that are not."].)
In People v. Superior Court (Lara) (2018) 4 Cal.5th 299, 303, 228 Cal.Rptr.3d 394, 410 P.3d 22, the Supreme Court addressed whether a new requirement in Proposition 57 that all juvenile offenders must be given a transfer hearing prior to the filing of adult criminal charges against them should apply retroactively. The court concluded that while this change in law did not directly mitigate the punishment for a particular crime, it permitted courts to exercise their discretion in ways that ameliorate the possible punishment for a class of persons. ( Id. at pp. 308, 228 Cal.Rptr.3d 394, 410 P.3d 22.) The court concluded: " Estrada 's inference of retroactivity applies here. Proposition 57 is an 'ameliorative change[ ] to the criminal law' that we infer the legislative body intended 'to extend as broadly as possible.' " ( Id. at p. 309, 228 Cal.Rptr.3d 394, 410 P.3d 22.) Therefore, "[a]s nothing in Proposition 57's text or ballot materials rebuts this inference," the transfer hearing requirement "applies to all juveniles charged directly in adult court whose judgment was not final at the time it was enacted." ( Id. at pp. 303-304, 228 Cal.Rptr.3d 394, 410 P.3d 22.)
The same reasoning and presumption should control here. There is no dispute that Senate Bill No. 620 effectuated an ameliorative change in law that mitigates the potential punishment for a class of persons-offenders convicted of a firearm enhancement-through the exercise of a trial court's sentencing discretion. Estrada 's inference of retroactivity applies, meaning in the absence of contrary indication, the Legislature is presumed to intend that the statutory amendments should apply to every case whose judgment has not yet become final. Under the majority's reasoning, Lara should have excluded from its holding those juvenile offenders convicted under a plea agreement because Proposition 57 is equally silent as to whether negotiated pleas should be affected by the new requirements. The majority has incorrectly flipped the presumption of legislative intent that ordinarily attaches under Estrada when ameliorative changes in criminal laws are enacted. An express statement that the Legislature intended to affect all plea agreements would have been helpful here, but it was not necessary to give full effect to Senate Bill No. 620's intended reach.4
The majority draws support from People v. Kelly (2019) 32 Cal.App.5th 1013, 244 Cal.Rptr.3d 394, in which Division Six of the Second Appellate District held that a defendant who entered a guilty plea and stipulated to an 18-year prison sentence could not obtain the benefits of a change in law that permits a trial court to strike a five-year enhancement for a prior serious felony conviction. ( Id. at p. 1016, 244 Cal.Rptr.3d 394.) The court concluded that dismissal of the appeal was warranted based on defendant's failure to obtain a certificate of probable cause, but even with *895a certificate, remand for resentencing would have been futile because the trial court was bound by the terms of the plea agreement. ( Id. at p. 1017, 244 Cal.Rptr.3d 394.) As the majority observes, Kelly did not address the reasoning on which Hurlic is based or the fact that the defendant in Hurlic had also entered a negotiated plea for a stipulated sentence. (Maj. opn., pp. 884-85, fn. 6.) Kelly also fails to cite or address Doe or Harris , which, as discussed, are important if not controlling authority on the effect that retroactive changes in law may have on parties to a plea agreement.
For similar reasons, the majority's reliance in People v. Cunningham (1996) 49 Cal.App.4th 1044, 57 Cal.Rptr.2d 179, may be of limited value. There the Third District Court of Appeal concluded that defendant's negotiated plea for a specified sentence foreclosed the trial court's ability to exercise its sentencing discretion under the Supreme Court's then recently decided People v. Superior Court (Romero) (1996) 13 Cal.4th 497, 53 Cal.Rptr.2d 789, 917 P.2d 628. ( Cunningham , at p. 1047, 57 Cal.Rptr.2d 179 [concluding the trial court was bound by the accepted terms of the agreement].) The Cunningham court did not have the benefit of the Supreme Court's later precedent that "requiring the parties' compliance with changes in the law made retroactive to them does not violate the terms of the plea agreement ...." ( Doe , supra , 57 Cal.4th at p. 66, 158 Cal.Rptr.3d 290, 302 P.3d 598 ; see Harris , supra , 1 Cal.5th at p. 992, 209 Cal.Rptr.3d 584, 383 P.3d 648 ["The electorate may bind the People to a unilateral change in a sentence without affording them the option to rescind the plea agreement."].) The central inquiry, as the majority acknowledges, is what the Legislature intended to effectuate.
For the reasons explained, I conclude the Legislature intended for Senate Bill No. 620 to apply to all nonfinal judgments of conviction, whether by plea or trial. Under Doe , the parties to Fox's plea agreement are deemed to know and understand that the enactment of amendments to section 12022.5, subdivision (c) were incorporated into the terms of their plea agreement. Because Fox's appeal concerns matters reserved by the plea agreement and does not challenge the validity of his plea, Fox was not required to obtain a certificate of probable cause to maintain his appeal.
c. There is no indication the parties intended to insulate their plea agreement from future changes in law
The majority concludes Fox's appeal must be dismissed for a second reason, that Senate Bill No. 620 was "already part of the legal landscape" when Fox entered his plea, distinguishing this case from Hurlic , Baldivia , and Stamps . The record does not support this contention, but more to the point, it is not the appropriate inquiry. As Doe instructs, the parties must show, either by express agreement or an implicit understanding made clear by the record, that they intended to insulate their plea agreement from subsequent changes in law to avoid its consequences. ( Doe , supra , 57 Cal.4th at pp. 71-72, 158 Cal.Rptr.3d 290, 302 P.3d 598.) The record is devoid of any such understanding.
To begin with, nothing in the record supports the majority's assertion that Senate Bill No. 620 was part of the legal landscape when Fox entered his plea on September 19, 2017. At the hearing in which Fox entered his plea, there is no mention of Senate Bill No. 620 or any other pending legislation. Moreover, Senate Bill No. 620 was just that, a bill, and would not become law until signed by the Governor on October 11, 2017. (Sen. Bill No. 620, adopted by Assem., Sept. 13, 2017, enrolled and presented to Governor, 4:00 p.m., Sept. 19, 2017, approved by Governor, *896Oct. 11, 2017). There is no indication the parties were aware of Senate Bill No. 620 at this point or that it figured into their plea negotiations or Fox's entry of his plea. Common sense would suggest that a legal change cannot be "part of the legal landscape" if it has not become law.
At the sentencing hearing on October 11, 2017, the record indicates some awareness about Senate Bill No. 620, mixed with considerable confusion. Fox, through his counsel, requested that the trial court strike his firearm enhancement, to which defense counsel seemed to resist. Defense counsel addressed the trial court as follows: "The second thing is that he asked today that I ask the Court to strike the enhancement that was part of his plea deal, and when I was trying to explain to him that a plea deal isn't subject to renegotiation because we've agreed upon the terms of the plea deal. [¶] So the enhancement, even if it becomes discretionary on the Court's part at sentencing to the first of the year, if the Governor signs it into law and it happens, it wouldn't effect [sic ] his sentence because he's agreed to a set disposition in exchange for taking 25 [years] to life off the table if he went to trial and was unsuccessful."
This record falls far short of showing any agreement or understanding by the parties that their plea agreement would be insulated from the effects of Senate Bill No. 620. Counsel's statements demonstrate the parties and trial court were unaware whether the bill would be signed into law (the Governor would sign it later that day), and Fox was apparently unaware Senate Bill No. 620 would not take effect until January 1 of the following year-and therefore the trial court was without any authority to act on his request at the time of sentencing.5 Indeed, Fox was being advised by his defense counsel that the trial court would have no authority to affect the terms of the plea deal should the legislation come to pass.
"A plea bargain may include the waiver of the right to appeal. [Citation.] ... ' "[T]he valid waiver of a right presupposes an actual and demonstrable knowledge of the very right being waived. [Citations]." [Citation.] It " '[i]s the intelligent relinquishment of a known right after knowledge of the facts.' [Citation.]" [Citation.] The burden is on the party claiming the existence of the waiver to prove it by evidence that does not leave the matter to speculation, and doubtful cases will be resolved against a waiver.' " ( People v. Wright (2019) 31 Cal.App.5th 749, 754, 242 Cal.Rptr.3d 837 ( Wright ).)
Nothing in the record suggests Fox entered into a guilty plea with the understanding he would forego his right to seek relief under Senate Bill No. 620. His confusion about a basic aspect of the law, its operative date, demonstrates he had not knowingly and intelligently relinquished his right to have the trial court exercise its discretion to strike his firearm enhancement. The majority faults Fox for not withdrawing his plea, but that unfairly assumes he should have ignored his defense counsel's advice that doing so would make no difference because the court would have no authority to alter the terms of the plea agreement after the new legislation went into effect.6 In short, nothing in the record *897leads me to believe that the parties should be allowed to escape the consequences attendant to the passage of Senate Bill No. 620.
The majority raises a concern about the defendant being able to "whittle down" his sentence while otherwise retaining the benefits of the plea bargain. But it is not uncommon for courts to conclude that parties to a plea agreement must accept the consequences of legislative amendments even when the change in law works a detriment on one party or the other. (See, e.g., People v. Acuna (2000) 77 Cal.App.4th 1056, 1062, 92 Cal.Rptr.2d 224 [defendant who entered guilty plea for sex offense and completed probation could not expunge conviction based on later-amended statute making expungement for his offense unavailable]; Harris , supra , 1 Cal.5th at p. 992, 209 Cal.Rptr.3d 584, 383 P.3d 648 [state not permitted to withdraw from plea agreement where resentencing under ballot measure deprived it of benefit of the bargain]; People v. Gipson (2004) 117 Cal.App.4th 1065, 1070, 12 Cal.Rptr.3d 478 [rejecting defendant's claim that plea bargain incorporated prior recidivist statute and bargain would be violated if he were sentenced under later-enacted Three Strikes law].)7 In these cases, the losing side invariably claimed they would be deprived of the benefit of their bargain if the statutory amendment was enforced against them. In rejecting such arguments, the courts relied on the basic premise that subsequent changes in law are incorporated into the terms of the plea agreement and enforcement of the statutory amendments do not breach the plea agreement. As other parties to a plea agreement have had to live with the changing consequences of legislative enactments, so too should the parties below.
I would reverse the judgment and remand the matter to permit the court to determine whether to strike defendant's firearm enhancement pursuant to section 12022.5, subdivision (a) and to resentence defendant accordingly.
The facts about the offenses are drawn from the evidence presented at the preliminary hearing, to which Fox stipulated as the factual basis of his plea.
The charges were brought under Penal Code sections 187, subdivision (a) and 664 (attempted murder), 211 (robbery), 245, subdivision (b) (assault with firearm), 29800, subdivision (a)(1) (possession of firearm by felon), 25850, subdivisions (a) and (c)(1) (carrying of loaded firearm by felon), 148, subdivision (a)(1) (resisting, obstructing, or delaying peace officer), and Vehicle Code section 2800.2, subdivision (a) (evading peace officer). All further statutory references are to the Penal Code.
The allegation was brought under section 12022.5, subdivision (a), which provides for a three-, four-, or ten-year sentence for the personal use of a firearm during a felony or attempted felony.
It is unclear whether the trial court in Hurlic denied the request for a certificate of probable cause or did not construe the defendant's statement as a request upon which it needed to rule. (See Hurlic , supra , 25 Cal.App.5th at p. 54, 235 Cal.Rptr.3d 255.) Regardless, the defendant had a remedy if he in fact intended to seek a certificate: He could have either insisted on a ruling or sought a writ of mandate to challenge an unfavorable ruling. (See Espinoza , supra , 22 Cal.App.5th at p. 803, 231 Cal.Rptr.3d 827.)
We recognize that in some cases a defendant would be unable to timely seek a certificate of probable cause on the grounds of Senate Bill No. 620. For example, the Baldivia defendant was sentenced in June 2016, well before the bill passed, but due to unrelated delays in the appeal the new law went into effect before the appeal was resolved. (Baldivia , supra , 28 Cal.App.5th at pp. 1075-1076.) And the Stamps defendant was sentenced in January 2018, nearly nine months before Senate Bill No. 1393 was signed into law. (Stamps , supra , 34 Cal.App.5th at pp. 119-120, 245 Cal.Rptr.3d 821.) Although a reviewing court would lack jurisdiction in a direct appeal to consider a remand for such a defendant, the defendant could nonetheless seek writ relief and, upon a proper showing, be permitted to withdraw his or her plea.
The dissent states that "[c]ommon sense would suggest that a legal change cannot be 'part of the legal landscape' if it hasn't become law," but we believe the relevant consideration is the parties' awareness of a pending change. Here, even though Senate Bill No. 620 was signed into law the same day Fox was sentenced, it was enrolled before he entered his plea, and there was no indication that a gubernatorial veto was likely. Moreover, Fox had actual knowledge of the bill by the time of the sentencing hearing, and he could have sought to withdraw his plea at that point had he wished to obtain the potential benefit of the new law. (See § 1018.) At the very least, Fox knew of the new law long before the deadline for filing a timely request for a certificate of probable cause on the issue he now pursues.
Similar procedural mechanisms can also be found in other laws with retroactive effect, such as recently enacted Senate Bill No. 1437 (2017-2018 Reg. Sess.), which reduces liability under the felony murder rule and natural and probable consequences doctrine. (See People v. Martinez (2019) 31 Cal.App.5th 719, 722-723, 242 Cal.Rptr.3d 860.)
In addressing Hurlic , Kelly did not grapple with the fact that the Hurlic defendant had also entered a negotiated disposition for a specific sentence. Instead, Kelly distinguished Hurlic on the basis that the defendant did not state in her notice of appeal that she sought to rely on the new law. (Kelly , supra , 32 Cal.App.5th at p. 1017, 244 Cal.Rptr.3d 394.) We question the significance of this distinction. It appears to us that when a certificate of probable cause has not been obtained, the key issue is the new law's effect on existing plea agreements, not the defendant's intent.
All statutory references are to the Penal Code.
Courts have also concluded that Senate Bill No. 620 does not extend to judgments of conviction that have become final, unless a person has obtained collateral relief by way of a state or federal habeas proceeding or is being resentenced through another statutory mechanism such as section 1170, subdivision (d). (Arredondo , supra , 21 Cal.App.5th at p. 507, 230 Cal.Rptr.3d 380 ; People v. Harris (2018) 22 Cal.App.5th 657, 662, 231 Cal.Rptr.3d 768 ; People v. Fuimaono (2019) 32 Cal.App.5th 132, 135, 243 Cal.Rptr.3d 545 ; People v. Johnson (2019) 32 Cal.App.5th 938, 941, 244 Cal.Rptr.3d 361 ; see People v. Hargis (2019) 33 Cal.App.5th 199, 210, 244 Cal.Rptr.3d 745.)
See, e.g., Senate Rules Committee, Office of Senate Floor Analyses, third reading analysis of Senate Bill No. 620, as amended March 28, 2017, pages 3-6; Assembly Floor Analysis, Senate Bill No. 620, as amended June 15, 2017, pages 1-3.
As the Baldivia court noted, "If the electorate or the Legislature expressly or implicitly contemplated that a change in the law related to the consequences of criminal offenses would apply retroactively to all nonfinal cases, those changes logically must apply to preexisting plea agreements, since most criminal cases are resolved by plea agreements." (Baldivia , supra , 28 Cal.App.5th at p. 1079, 239 Cal.Rptr.3d 704 [applying Lara to conclude Senate Bill No. 620 applies to all nonfinal judgments of conviction].)
Defendant was originally scheduled to be sentenced on January 9, 2018. At Fox's own request, his sentencing hearing was moved up to October 11, 2017, thus foreclosing any potential relief he might obtain under the new legislation.
This is not a situation where Senate Bill No. 620 is now the established law and a defendant today stipulates to a specified term of years for a firearm enhancement. Those circumstances might indicate a clear understanding by the parties that defendant has knowingly relinquished his right to have the trial court exercise its discretion to strike the firearm enhancement.
In People v. Smith (2014) 227 Cal.App.4th 717, 174 Cal.Rptr.3d 103, this division concluded a defendant whose negotiated plea contemplated relief under former section 1203.4 had to live with the consequences of amendments to that law. At the time of the defendant's no contest plea, section 1203.4 permitted the defendant to dismiss his conviction upon successful completion of a probationary term. (Id. at p. 723, 174 Cal.Rptr.3d 103.) Before the defendant completed probation, section 1203.4 was amended to exclude certain sex offense convictions from relief otherwise obtainable by the statute. (Id. at pp. 727-728, 174 Cal.Rptr.3d 103.) This court held that under Doe , application of amended section 1203.4 did not violate the terms of the plea agreement because a "probationer's entitlement to relief under section 1203.4 is not frozen at the time of the probationary grant but is subject to subsequent legislative amendments to the statute." (Id. at p. 731, 174 Cal.Rptr.3d 103.)