***********************************************
    The “officially released” date that appears near the be-
ginning of each opinion is the date the opinion will be pub-
lished in the Connecticut Law Journal or the date it was
released as a slip opinion. The operative date for the be-
ginning of all time periods for filing postopinion motions
and petitions for certification is the “officially released”
date appearing in the opinion.

   All opinions are subject to modification and technical
correction prior to official publication in the Connecticut
Reports and Connecticut Appellate Reports. In the event of
discrepancies between the advance release version of an
opinion and the latest version appearing in the Connecticut
Law Journal and subsequently in the Connecticut Reports
or Connecticut Appellate Reports, the latest version is to
be considered authoritative.

   The syllabus and procedural history accompanying the
opinion as it appears in the Connecticut Law Journal and
bound volumes of official reports are copyrighted by the
Secretary of the State, State of Connecticut, and may not
be reproduced and distributed without the express written
permission of the Commission on Official Legal Publica-
tions, Judicial Branch, State of Connecticut.
***********************************************
       ANTHONY GILCHRIST v. COMMISSIONER
                OF CORRECTION
                   (AC 39626)
                       Prescott, Elgo and Harper, Js.

                                  Syllabus

The petitioner, who had been convicted, on a guilty plea, of the crime of
   robbery in the third degree, sought a writ of habeas corpus, claiming
   that because his plea bargain had not been followed, the habeas court
   should allow him to withdraw the guilty plea and that the court should
   vacate or dismiss the charge, or both. In his habeas petition, the peti-
   tioner alleged that his total effective sentence was an unconditional
   discharge. The habeas court, sua sponte and without holding a hearing,
   dismissed the petition for a writ of habeas corpus for lack of subject
   matter jurisdiction pursuant to the applicable rule of practice (§ 23-29
   [1]) because the petitioner no longer was in custody on the conviction
   that he was challenging at the time he filed the habeas petition. From
   the judgment rendered thereon, the petitioner, on the granting of certifi-
   cation, appealed to this court. He claimed, inter alia, that he was denied
   his constitutional and statutory rights to due process, to notice of a
   hearing, to assigned counsel and to be heard on his habeas petition.
   Held that the habeas court properly dismissed the petition for a writ of
   habeas corpus; because the petitioner did not allege sufficient facts to
   establish that he was, at the time he filed the habeas petition, in custody
   on the conviction he was challenging, the habeas court lacked jurisdic-
   tion over the habeas petition and, therefore, it had no obligation under
   § 23-29 (1) to grant a hearing to the petitioner prior to dismissing the
   petition.
      Argued November 28, 2017—officially released March 6, 2018

                            Procedural History

  Petition for a writ of habeas corpus, brought to the
Superior Court in the judicial district of Tolland, where
the court, Oliver, J., dismissed the petition and ren-
dered judgment thereon, from which the petitioner, on
the granting of certification, appealed to this court.
Affirmed.
  Adele V. Patterson, senior assistant public defender,
for the appellant (petitioner).
   James A. Killen, senior assistant state’s attorney,
with whom, on the brief, was John C. Smriga, state’s
attorney, for the appellee (respondent).
                          Opinion

  HARPER, J. The petitioner, Anthony Gilchrist,
appeals from the judgment of the habeas court dismiss-
ing his petition for a writ of habeas corpus for lack of
subject matter jurisdiction because, at the time he filed
the petition, he was not in custody as a result of the
conviction that he challenges. On appeal, the petitioner
asserts that he was denied his rights to due process,
assigned counsel, and notice and a hearing, when the
court, sua sponte, dismissed his petition for lack of
subject matter jurisdiction. The respondent, the Com-
missioner of Correction, contends that the court was
not required to hold a hearing because the petitioner
was not in custody at the time he filed the petition. We
agree with the respondent and, accordingly, affirm the
judgment of the habeas court.
  The following facts and procedural history are rele-
vant to this appeal. On June 24, 2016, the petitioner,
representing himself, filed a petition for a writ of habeas
corpus. In his petition, under the ‘‘details of conviction
and sentence now being served’’ section, he listed the
location of the court as ‘‘Bridgeport low court.’’ The
petitioner further stated that he pleaded guilty on ‘‘9/
2013’’ in ‘‘CR-12-267383, robbery in the third degree,’’
and listed the total effective sentence as ‘‘unconditional
discharge.’’ In a handwritten attachment to his petition,
he stated, ‘‘[m]y plea bargain was not followed because
my lawyer stated [specifically] that the robbery third
charge would not make me 85 [percent] due to the
unconditional discharge and it being on a completely
separate [docket].’’ He also attached a letter that he
received from the Board of Pardons and Paroles, which
stated in relevant part: ‘‘[Y]ou are ineligible for parole
until you have served not less than 85 [percent] of your
definite sentence imposed by the court.’’ As relief, the
petitioner requested that the court allow him to with-
draw his guilty plea and ‘‘vacate and/or dismiss [the]
charge.’’
   On July 28, 2016, the court, sua sponte and without
holding a hearing, dismissed the petition for lack of
subject matter jurisdiction pursuant to Practice Book
§ 23-29 (1),1 explaining that ‘‘the petitioner was no
longer in custody for the conviction being challenged
at the time the petition was filed.’’ The petitioner filed
a motion to reconsider, which was denied on August
18, 2016. The court subsequently granted the petition
for certification to appeal.
   On appeal, the petitioner claims that he improperly
was denied his constitutional and statutory rights to
due process, to notice of a hearing, to assigned counsel,
and to be heard on his petition, in violation of General
Statutes § 52-470 (a) and Practice Book § 23-24.2 Addi-
tionally, the petitioner claims that his pleadings could
be construed to state a cognizable claim for relief, i.e.,
the court could infer, on the basis of the information
in his petition, that he was incarcerated on a separate
conviction for which his parole eligibility was affected
by his plea of guilty to robbery in the third degree.
The petitioner argues that once the ‘‘habeas case [was]
docketed,’’ the court is required to provide him with
assigned counsel and the opportunity to attend any
dispositive hearing. Moreover, the petitioner argues that
because he filed his petition without the assistance of
counsel, the court should have inferred that it had sub-
ject matter jurisdiction on the basis of a broad and
liberal interpretation of the pleadings. In response, the
respondent contends that the court’s sua sponte dis-
missal for lack of subject matter jurisdiction was proper
and that the court appropriately construed the petition
as challenging an expired conviction.
   We first set forth our well established standard of
review and relevant legal principles. ‘‘Subject matter
jurisdiction for adjudicating habeas petitions is con-
ferred on the Superior Court by General Statutes § 52-
466, which gives it the authority to hear those petitions
that allege illegal confinement or deprivation of liberty.
. . . We have long held that because [a] determination
regarding a trial court’s subject matter jurisdiction is a
question of law, our review is plenary. . . . Moreover,
[i]t is a fundamental rule that a court may raise and
review the issue of subject matter jurisdiction at any
time. . . . Subject matter jurisdiction involves the
authority of the court to adjudicate the type of contro-
versy presented by the action before it. . . . [A] court
lacks discretion to consider the merits of a case over
which it is without jurisdiction . . . . The subject mat-
ter jurisdiction requirement may not be waived by any
party, and also may be raised by a party, or by the court
sua sponte, at any stage of the proceedings, including
on appeal.’’ (Internal quotation marks omitted.)
Anthony A. v. Commissioner of Correction, 159 Conn.
App. 226, 234–35, 122 A.3d 730 (2015), aff’d, 326 Conn.
668, 166 A.3d 614 (2017). ‘‘Once the question of lack of
jurisdiction of a court is raised, [it] must be disposed
of no matter in what form it is presented. . . . The
court must fully resolve it before proceeding further
with the case. . . . Whenever a court finds that it has
no jurisdiction, it must dismiss the case, without regard
to previous rulings.’’ (Internal quotation marks omit-
ted.) Johnson v. Commissioner of Correction, 258
Conn. 804, 813, 786 A.2d 1091 (2002).
   ‘‘A habeas court has subject matter jurisdiction to
hear a petition for habeas corpus when the petitioner
is in custody at the time that the habeas petition is
filed. . . . It is well settled that [t]he petition for a writ
of habeas corpus is essentially a pleading and, as such,
it should conform generally to a complaint in a civil
action. . . . The principle that a plaintiff may rely only
upon what he has alleged is basic. . . . It is fundamen-
tal in our law that the right of a plaintiff to recover is
limited to the allegations of his complaint.’’ (Citation
omitted; emphasis added; internal quotation marks
omitted.) Arriaga v. Commissioner of Correction, 120
Conn. App. 258, 262, 990 A.2d 910 (2010), appeal dis-
missed, 303 Conn. 698, 36 A.3d 224 (2012).
   A habeas court lacks subject matter jurisdiction when
the petitioner is not in custody on the conviction under
attack at the time the petition was filed. Lebron v. Com-
missioner of Correction, 274 Conn. 507, 532, 876 A.2d
1178 (2005), overruled in part on other grounds by State
v. Elson, 311 Conn. 726, 747, 754, 91 A.3d 862 (2014).
The custody requirement ‘‘has never been extended
to the situation where a habeas petitioner suffers no
present restraint from a conviction.’’ (Emphasis in
original; internal quotation marks omitted.) Id., 531.
Furthermore, ‘‘the collateral consequences of the peti-
tioner’s expired convictions, although severe, are insuf-
ficient to render the petitioner in custody on those
convictions and, therefore, to invoke the jurisdiction
of the habeas court.’’ Ajadi v. Commissioner of Correc-
tion, 280 Conn. 514, 541, 911 A.2d 712 (2006).
   The petitioner alleged in his petition that his total
effective sentence was an ‘‘unconditional discharge.’’
General Statutes § 53a-34 (b) provides: ‘‘When the court
imposes a sentence of unconditional discharge, the
defendant shall be released with respect to the convic-
tion for which the sentence is imposed without impris-
onment, probation supervision or conditions. A
sentence of unconditional discharge is for all purposes a
final judgment of conviction.’’ ‘‘[A] Connecticut habeas
court has subject matter jurisdiction only over those
cases brought by a petitioner who is legally confined
or deprived of his liberty under the challenged convic-
tion. . . . A person is in custody when he is under
a legal restraint.’’ (Internal quotation marks omitted.)
Young v. Commissioner of Correction, 104 Conn. App.
188, 191, 932 A.2d 467 (2007), cert. denied, 285 Conn.
907, 942 A.2d 416 (2008).
   The petitioner claims that the court erred by not
conducting a hearing before deciding that it did not
have subject matter jurisdiction. We refer to our recent
decision in Pentland v. Commissioner of Correction,
176 Conn. App. 779, 169 A.3d 851, cert. denied, 327
Conn. 978, 174 A.3d 800 (2017), in which we stated:
‘‘The habeas court did not conduct a hearing before it
dismissed the petition because, as can be determined
from a review of the petition, the petitioner had not
satisfied his obligation to allege sufficient facts in his
pleading, which, if proved, would establish that he was
in custody at the time he filed the petition. The court
thus lacked jurisdiction, and the habeas court at any
time, upon its own motion, could dismiss the petition.
Practice Book § 23-29. Under these circumstances,
where § 23-29 did not require a hearing before dismissal,
the habeas court did not have an obligation to grant a
hearing to the petitioner prior to dismissing the peti-
tion.’’ (Internal quotation marks omitted.) Pentland v.
Commissioner of Correction, supra, 787.
   Moreover, the circumstances of the present case are
distinguishable from prior cases in which it was deter-
mined that the petition improperly was dismissed with-
out a hearing. See, e.g., Mercer v. Commissioner of
Correction, 230 Conn. 88, 92, 644 A.2d 340 (1994) (court
improperly dismissed habeas petition based on underly-
ing conviction of felony murder without holding hearing
because petitioner was ‘‘entitled to an opportunity to
present further evidence to support his claim that inade-
quate assistance of counsel deprived him of a fair trial’’);
Boyd v. Commissioner of Correction, 157 Conn. App.
122, 126, 115 A.3d 1123 (2015) (court improperly dis-
missed second habeas petition based on underlying con-
viction of murder without holding hearing, prior to
conclusion of first habeas appeal, because petitioner
alleged ‘‘new ground upon which his second habeas
petition could have been granted’’); Mitchell v. Commis-
sioner of Correction, 93 Conn. App. 719, 726, 891 A.2d
25 (court improperly dismissed second habeas petition
based on underlying convictions of kidnapping and sex-
ual assault without holding hearing because petitioner
raised new claims not raised before), cert. denied, 278
Conn. 902, 896 A.2d 104 (2006). In those prior cases, the
court’s subject matter jurisdiction was never challenged
on the basis of the petitioner’s ‘‘in custody’’
requirement.
   On the basis of our interpretation of his pleadings,
the petitioner has not alleged sufficient facts to estab-
lish that he was, at the time of filing, in custody on the
conviction that was the subject of his petition to the
habeas court for allegations of illegal confinement or
deprivation of liberty.3 See Pentland v. Commissioner
of Correction, supra, 176 Conn. App. 779; Arriaga v.
Commissioner of Correction, supra, 120 Conn. App.
263. Because the custody requirement is necessary to
invoke the jurisdiction of the habeas court, the court
lacked jurisdiction to hear the petition for a writ of
habeas corpus.4
      The judgment is affirmed.
      In this opinion the other judges concurred.
  1
     Practice Book § 23-29 provides in relevant part: ‘‘The judicial authority
may, at any time, upon its own motion or upon motion of the respondent,
dismiss the petition, or any count thereof, if it determines that . . . (1) the
court lacks jurisdiction . . . .’’
   2
     General Statutes § 52-470 (a) provides: ‘‘The court or judge hearing any
habeas corpus shall proceed in a summary way to determine the facts and
issues of the case, by hearing the testimony and arguments in the case, and
shall inquire fully into the cause of imprisonment and thereupon dispose
of the case as law and justice require.’’
   Practice Book § 23-24 provides: ‘‘(a) The judicial authority shall promptly
review any petition for a writ of habeas corpus to determine whether the writ
should issue. The judicial authority shall issue the writ unless it appears that:
   ‘‘(1) the court lacks jurisdiction;
   ‘‘(2) the petition is wholly frivolous on its face; or
   ‘‘(3) the relief sought is not available.
   ‘‘(b) The judicial authority shall notify the petitioner if it declines to issue
the writ pursuant to this rule.’’
   3
     We are mindful that ‘‘[a]lthough we allow pro se litigants some latitude,
the right of self-representation provides no attendant license not to comply
with relevant rules of procedural and substantive law. . . . A habeas court
does not have the discretion to look beyond the pleadings . . . . In addition,
while courts should not construe pleadings narrowly and technically, courts
also cannot contort pleadings in such a way so as to strain the bounds of
rational comprehension.’’ (Internal quotation marks omitted.) Arriaga v.
Commissioner of Correction, supra, 120 Conn. App. 263.
   4
     Because this conclusion is dispositive, we need not address the petition-
er’s other claims. See, e.g., Kleen Energy Systems, LLC v. Commissioner
of Energy & Environmental Protection, 319 Conn. 367, 380, 125 A.3d 905
(2015).
