
83 Cal.Rptr.2d 314 (1999)
70 Cal.App.4th 1152
In re URIAH R., a Person Coining Under the Juvenile Court Law.
The People, Plaintiff and Respondent,
v.
Uriah R., Defendant and Appellant.
No. A082072.
Court of Appeal, First District, Division Four.
March 24, 1999.
*316 Ozro William Childs, under appointment by the Court of Appeal, Santa Rosa, for Defendant and Appellant.
Daniel E. Lungren and Bill Lockyer, Attorneys General, George Williamson, Chief Assistant Attorney General, Ronald A. Bass, Senior Assistant Attorney General, Ronald E. Niver, Supervising Deputy Attorney General and Amy Haddix, Deputy Attorney General, Counsel for Plaintiff and Respondent.
Certified for Partial Publication[*]
POCHÉ, J.
The novel issue presented is whether and to what extent a waiver of the right to appeal by a juvenile is effective to restrict appellate review. We conclude that, in general, juvenile waivers are subject to the same principles governing waivers by adults. Like an adult criminal defendant, a juvenile can knowingly and intelligently waive or restrict appellate review, particularly when the waiver is part of a plea bargain that includes a stipulated disposition. But where, as here, a juvenile admits the truth of criminal allegations and acknowledges the maximum length of a possible commitment to the California Youth Authority (CYA), without agreement that the juvenile court's disposition will in fact be a CYA commitment, the waiver will not preclude the juvenile arguing on appeal that the commitment was an abuse of the juvenile court's discretion.

BACKGROUND
It was alleged in petitions filed by the District Attorney of Solano County that 16-year-old Uriah R. had committed possession of marijuana for sale (Health & Saf.Code, § 11359), attempted murder (Pen.Code, §§ 187, 664),[1] first degree robbery producing great bodily injury (§§ 211, 12022.7), assault with a deadly weapon on a public transit employee producing great bodily injury (§§ 245, subd. (a)(2), 245.2, 12022.7), and unlawful possession of a firearm (§ 12021). The juvenile court granted the prosecutor's motion to join Uriah's case with those of two other juveniles involved in all but the marijuana charge.
About the time the jurisdictional hearing was to be held, the prosecutor and counsel for Uriah had agreed to a partial negotiated disposition. A new charge, that Uriah had been an accessory (§ 32), was added. Uriah would admit this charge, and the ones of unlawful weapon and marijuana possession; the remaining charges would be dismissed, but they could be considered at disposition (People v. Harvey (1979) 25 Cal.3d 754, 159 Cal.Rptr. 696, 602 P.2d 396). Uriah was aware that the maximum possible incarceration was five years in CYA. The juvenile court was given a three-page "Waiver of Constitutional Rights and Declaration in Support of Minor's Motion to Admit" signed and initialed by Uriah. Several of the initialed admonitions read as follow:
"APPEAL RIGHTS: Even though the court will take jurisdiction (I will be convicted) in this case as a result of my admission, I have the right to appeal the judgment and rulings of the courts. I give up my right of appeal.
"The maximum punishment which the court may impose based upon this admission is a commitment to the California Youth Authority for 5 yrs.
"I understand that if, as a result of my admissions, I am made a ward of the court, the court has many options at its disposal ranging from returning me to my home to placing me in the California Youth Authority....
"Whether or not I will be granted probation is determined solely by the judge. I understand that the court's order of disposition (my sentence) is solely within the discretion of the court."
The court asked Uriah whether he had read the form, whether his attorney had explained it to him, and whether he understood that "your maximum period of confinement is five years." Uriah answered "Yes" *317 to all three questions. The court then accepted his admissions, which it found were made after Uriah had "knowingly, intelligently, and voluntarily waived [his] rights."
The court rejected the urging of Uriah's mother and counsel that the most appropriate disposition would be probation or local placement; the court agreed with the probation officer's recommendation for a CYA placement. Uriah was made a ward of the juvenile court and committed to the CYA for a period not to exceed four years and four months. The commitment term was calculated as follows: three years for what the commitment order described as "Accessory to attempted murder," plus eight months for the weapons charge and another eight months for the marijuana charge.
Uriah filed a timely notice of appeal.

REVIEW

I
In his opening brief Uriah contends: (1) the juvenile court abused its discretion in ordering the CYA commitment; (2) the weapons "sentence" should have been stayed pursuant to section 654 pending completion of the term on the accessory charge; and (3) "because the juvenile court did not specify an intent to sentence consecutively, the maximum period of Youth Authority confinement must be stated to be three years, the maximum term for any single count." The Attorney General in his brief responded that review of the second and third of these contentions was precluded by Uriah's waiver of appellate rights, but that his first contention could be examined on its merits. We requested supplemental briefing on the effectiveness and extent of Uriah's waiver with respect to the issues he raised in his brief. The parties' supplemental briefing has not only been very helpful, it reveals a surprising area of agreement.
The parties concur that there is no reported decision addressing the issue of juvenile appeal waivers. They further concuras do wethat the most logical starting point for analyzing the issue of juvenile waivers is the treatment of adult waivers. That area is largely settled.
Proceeding from the premise that the right to appeal is purely statutory, courts have reasoned that if in the course of pleading guilty a defendant may validly waive important constitutional rights, the merely statutory right to appeal could also be surrendered. (E.g., People v. Vargas (1993) 13 Cal.App.4th 1653, 1659, 17 Cal.Rptr.2d 445; People v. Charles (1985) 171 Cal.App.3d 552, 557-559, 217 Cal.Rptr. 402.) Although the issue of whether the guilty plea was informed and voluntarily made will always remain open for appellate review, the plea will generally preclude review of matters or rulings occurring prior to the change of plea; an adult is allowed to bring up only "constitutional, jurisdictional, or other grounds going to the legality of the proceedings" (§ 1237.5, subd. (a)), but not issues of guilt or innocence, or irregularities that do not go to the fundamental power of the State to try the defendant.[2] (See, e.g., People v. Robinson (1997) 56 Cal.App.4th 363, 369, 65 Cal. Rptr.2d 406 and decisions cited.) Exceptions to this general rule may exist by virtue of statute (see § 1538.5, subd. (m); Welf. & Inst.Code, § 800, subd. (a)), court rule (see Cal. Rules of Court, rule 31(d)), or may be reserved by the parties at the time the guilty plea is entered (see People v. Sumstine (1984) 36 Cal.3d 909, 914, 206 Cal.Rptr. 707, 687 P.2d 904). Because waivers of appellate rights are ordinarily found in the context of a plea bargain, the scope of the waiver is approached like a question of contract interpretation to what did the parties expressly or by reasonable implication agree? (See People v. Vargas, supra, at pp. 1658-1659, 17 *318 Cal.Rptr.2d 445; People v. Nguyen (1993) 13 Cal.App.4th 114, 120, 16 Cal.Rptr.2d 490.)
As a general proposition, a broad or general waiver, such as "I waive my appeal rights," will include error occurring prior to the waiver, but not subsequent error because the defendant could not make "a knowing and intelligent waiver of the right to appeal any unforeseen or unknown future error...." (People v. Vargas, supra, 13 Cal. App.4th 1653, 1662, 17 Cal.Rptr.2d 445.) If, however, the defendant agrees to a bargain which includes a specific or indicated sentence, and if that is the sentence actually imposed, the defendant's waiver will foreclose appellate review of the sentence; any challenge to the sentence will be deemed a challenge to an integral component of the bargain. (See People v. Panizzon, supra, 13 Cal.4th 68, 78-79, 85-86, 51 Cal.Rptr.2d 851, 913 P.2d 1061; People v. Nguyen, supra, 13 Cal.App.4th 114, 122, 16 Cal.Rptr.2d 490.) The waiver will not cover claims that the trial court imposed a sentence in excess of its fundamental jurisdiction or the terms of the bargain, but the waiver will not allow review of alleged error in the computation or imposition of the sentence, including application of section 654. (See People v. Nguyen, supra, at pp. 121-124, 16 Cal.Rptr.2d 490.)
Uriah argues in effect that a juvenile should not be allowed to waive the right of appeal. He notes that waiver is not mentioned in either the statute authorizing juvenile appeals (Welf. & Inst.Code, § 800) or the court rule governing admissions of criminal allegations (Cal. Rules of Court, rule 1487) and thus concludes that this omission "is a strong indication that for juveniles, such a waiver is impermissible." But there are two statutory recognitions that a juvenile can waive his constitutional right to counsel (Welf. & Inst.Code, §§ 634, 700) and two rule recognitions that a juvenile may waive additional constitutional rights and admit the charging allegations (Cal. Rules of Court, rules 1485(e), 1487(f)). Moreover, just like appeals from adult criminal court, all appeals from the juvenile court have a purely statutory basis. (E.g., People v. Chi Ko Wong (1976) 18 Cal.3d 698, 709, 135 Cal.Rptr. 392, 557 P.2d 976; In re Rottanak K. (1995) 37 Cal.App.4th 260, 265, 43 Cal.Rptr.2d 543; Moch v. Superior Court (1919) 39 Cal.App. 471, 478, 179 P. 440.) The same logic upholding adult waivers is equally applicable to juvenilesthe mind capable of waiving constitutional rights is just as capable of waiving a less important statutory right. (See People v. Charles, supra, 171 Cal.App.3d 552, 559-560, 217 Cal.Rptr. 402.) Put another way, the person deemed intelligent enough to appreciate the consequences of admitting having committed a crime can also make an intelligent appreciation of the decision to forego review of that admission.
The general validity of juvenile waivers notwithstanding, the pertinent issue becomes the scope of the waiver that Uriah actually made. And here context is crucial. This was not the ordinary criminal prosecution, which almost invariably involves incarceration. Here, however, the venue was juvenile court, with a range of judicial responses extending all the way from release to parents to a CYA commitment. (See Welf. & Inst.Code, §§ 727, 730.) Nothing said on the record by counsel, court, or client at the time Uriah admitted the allegations establishes that the decision to commit Uriah to the CYA had already been made. The same is true of the dispositional hearing. No onenot the probation officer, not the deputy district attorney, not the courtsuggested there was no need to consider other alternatives because it was already decided that the minor would be sent to CYA. Further corroboration can be found in the waiver form executed by Uriah. It shows that Uriah was advised that "the court has many options at its disposal ranging from returning me to my home to placing me in the California Youth Authority" and that "disposition," including probation, "is solely within the discretion of the court." The extent of the bargain was that Uriah would admit the three least serious allegations, the four more serious violent charges would be dismissed, and the parties would proceed to the dispositional phase where the worst possible result for Uriah would be a CYA commitment not to exceed five years.
*319 Clearly there was no specified disposition that was an integral part of the plea bargain. Because the plea agreement left the ultimate result reserved and unresolved, Uriah could not knowingly and intelligently waive his right to complain of whatever unforeseeable error might occur at the dispositional hearing. (See People v. Panizzon, supra, 13 Cal.4th 68, 84-86, 51 Cal.Rptr.2d 851, 913 P.2d 1061; People v. Vargas, supra, 13 Cal. App.4th 1653, 1662, 17 Cal.Rptr.2d 445.) In challenging the CYA commitment Uriah is not seeking "appellate review of an integral element of the negotiated plea agreement, as opposed to a matter left open or unaddressed by the deal." (People v. Panizzon, supra, at p. 86, 51 Cal.Rptr.2d 851, 913 P.2d 1061.)
The Attorney General concedes that Uriah can challenge the decision to commit him to the CYA, but he argues that the contentions based on section 654 and the terms imposed on the accessory and weapon charges cannot be reviewed because these are matters affecting "the maximum term of confinement to which he consented." The Attorney General apparently reasons that because Uriah acknowledged that the "maximum punishment" he might receive was five years with the CYA, and the total term of the actual commitment was four years and four months, any claims regarding the configuration or computation of the commitment term is covered by the appellate waiver. In effect, the Attorney General reads the minor's part of the bargain as "I don't accept that I am going to CYA, but if I do it will be for no more than five years."
The Attorney General appears to be proposing that a waiver can be valid in situations where a defendant or juvenile agrees to a disposition with a ceiling or maximum term of possible incarceration. Although one court has intimated that an appellate waiver may be acceptable in exchange for an indefinite term (see People v. Nguyen, supra, 13 Cal.App.4th 114, 122, 16 Cal.Rptr.2d 490), and the Attorney General's reading of the waiver form is not beyond plausibility, we cannot find waiver here. As already established, Uriah was never expressly told by the change of plea form that he would be committed to the CYA. Nor is this want remedied by the brief reporter's transcript, which has no mention of appellate consequences of Uriah admitting the allegations. There is nothing in the change of plea form or the reporter's transcript to show that Uriah was acquainted with the consequences of waiving his right to appeal with respect to error past, present, and future. It is therefore very unlikely that he made an informed waiver of the length of a CYA commitment should one be ordered. Because the relevant portions of the record cannot remove the substantial element of speculation from the Attorney General's construction, the written waiver cannot be read as accepting a CYA commitment of five years or less. (See People v. Rosso (1994) 30 Cal.App.4th 1001, 1006-1007, 36 Cal.Rptr.2d 218; People v. Vargas, supra, 13 Cal.App.4th 1653, 1662, 17 Cal.Rptr.2d 445.) Because the matter of disposition was left unresolved at the time Uriah admitted the allegations, the length of a CYA commitment amounts to an issue that may "fairly be characterized as falling outside of [his] contemplation and knowledge when the waiver was made...." (People v. Panizzon, supra, 13 Cal.4th 68, 85-86, 51 Cal.Rptr.2d 851, 913 P.2d 1061.) Finally, because the disposition was not precisely specified, it does not constitute an integral element of the bargain that a waiver would ordinarily exempt from scrutiny. Accordingly, the issues Uriah seeks to raise do not challenge the validity of his admissions. (See id., at pp. 78-79, 51 Cal.Rptr.2d 851, 913 P.2d 1061.) If Uriah was an adult, the issues he now seeks to raise would not be foreclosed by his waiver. We discern no reason why a stricter standard should be applied to juveniles.
We summarize our conclusions: (1) a juvenile is just as capable as an adult of making an intelligent and voluntary waiver of the purely statutory right to appeal; (2) the relevant statutes governing the proceedings conducted pursuant to the Juvenile Court Law do not prohibit juvenile waivers; (3) a juvenile can agree to what is in obvious effect a plea bargain and, as an integral part of that bargain, the right to appeal may be waived; and, (4) in situations not involving a specified disposition, a juvenile's general waiver will not preclude attacks on subsequent errors *320 that are unforeseen or unforeseeable at the time the waiver was made.
A final note. The fact that a waiver of right to appeal will only rarely be applied according to its ordinarily brief and general language makes it important that the scope of the parties' understanding of the waiver be put on the record. This may be done orally by court or counsel; a voluntary and enforceable waiver may also be shown by a writing, such as a change of plea form. (See People v. Panizzon, supra, 13 Cal.4th 68, 83-84, 51 Cal.Rptr.2d 851, 913 P.2d 1061, and decisions cited.) In this case, however, the scope of his waiver was never explained to Uriah or stated for the record. The broad interpretation urged by the Attorney General is too heavily dependent upon speculation to be enforced. It therefore cannot block our examining the merits of Uriah's contentions.

II[**]
The commitment order is modified to show that appellant was found to be an accessory, within the meaning of section 32, with no further reference to any criminal offense. As so modified, the order is affirmed.
HANLON, P.J., and SEPULVEDA, J., concur.
NOTES
[*]  Pursuant to California Rules of Court, rules 976(b) and 976.1, this opinion is certified for publication with the exception of part II.
[1]  Unless otherwise indicated all further statutory references are to the Penal Code.
[2]  Section 1237.5 imposes certain procedural requirements an adult criminal defendant who pleads guilty must satisfy before an appeal will be perfected. (See also Cal. Rules of Court, rule 31(d); People v. Mendez (1999) 19 Cal.4th 1084, 1093-1094, 81 Cal.Rptr.2d 301, 969 P.2d 146; People v. Panizzon (1996) 13 Cal.4th 68, 74-75, 51 Cal.Rptr.2d 851, 913 P.2d 1061.) The parties agree that these requirements do not apply to juvenile appeals. (See In re Joseph B. (1983) 34 Cal.3d 952, 955-960, 196 Cal.Rptr. 348, 671 P.2d 852.) Nevertheless, the adult standard of non-jurisdictional irregularities and issues going to guilt or innocence have been applied to juveniles. (In re John B. (1989) 215 Cal.App.3d 477, 263 Cal.Rptr. 607.)
[**]  See footnote *, ante.
