EXCLUSIVE

4:45 PM PT -- Britney and her parents agreed on one thing during the hearing. According to court docs, the judge ordered an expert evaluation.

The documents don't specify what the expert will be evaluating, but in conservatorship cases, it often involves a mental examination of the conservatee ... in this case, Britney. However, the judge says the parameters of that evaluation will be set by Jamie Spears and a court-appointed lawyer.

Additionally, we're told Britney asked the judge to allow her certain freedoms -- things she's not able to do under the conservatorship -- but the judge did not grant any of her requests.

The court's decision highlights what we've been reporting ... Britney's not doing well after her 30-day stay in a mental health facility.

3:40 PM PT -- Britney just left the courthouse in bizarre fashion ... no shoes, no socks -- barefoot. The courtroom was closed because her medical condition was discussed. Unclear so far what happened, but check back soon.

12:39 PM PT -- Several Britney fans have started to gather outside the courthouse with "Free Britney" posters and chants.

Britney Spears will make the drive from Thousand Oaks to downtown L.A. Friday ... appearing in court as her mom fights to get her medical files in what is turning into a family war.

Sources with knowledge tell us, Britney will appear with her mom, Lynne Spears, who is trying to gain access to her medical information. We're told Lynne does not want to become a co-conservator, which creates a weird legal argument ... the right to medical information but no right to act on it.

Britney's dad, Jamie Spears, has been her sole conservator for more than 11 years, and is widely credited with saving her life back in 2008, when the singer was off the rails.

As we reported, Lynne has been staying at Britney's home for more than a week. The 2 have been estranged for nearly 15 years. We're told Britney cut Lynne out of her life right after her breakup with Justin Timberlake. Over the last few months, Lynne has tried to reestablish a relationship.

TMZ has reported, Lynne became alarmed when she read various posts on social media that Jamie was allegedly forcing Britney into the mental health facility where she stayed for 30 days, and that he ordered doctors to ply her with certain drugs. FYI, Jamie does not have the power to do either.

Britney, we're told, will side with her mom in court, for obvious reasons. Jamie has imposed certain restrictions to keep her and her family safe, and Britney wants freedom ... it's what happens in most conservatorships. She's banking on Lynne easing the restrictions.

As we have reported, Britney is not doing well. The meds that stabilized her for years stopped working and doctors are still struggling to find the right combination. Multiple sources have told us she did not come out of the mental health facility in great shape and her judgment is impaired.

It's an odd ask to look at medical records when you're not part of a conservatorship. Legally speaking, Lynne's parental rights are trumped by the conservatorship, and she doesn't want to be part of it.

We'll be at the courthouse, so stay tuned.