A trial in federal court here against the District's child welfare system is cracking open the walls of an entire city agency -- one charged with caring for abused and neglected children, but shielded from scrutiny by privacy laws.

As the American Civil Liberties Union's class action lawsuit against the District's Child and Family Services Division starts its second week of hearings today, the picture that has emerged is of a system that catches children in a series of bureaucratic logjams and consigns them to childhoods spent in the "temporary" solution of foster care.

The lawsuit charges that the District is violating the rights of the roughly 2,200 children in its care by failing to take steps to reunite them with their families or free them for adoption. The ACLU is asking U.S. District Judge Thomas F. Hogan to appoint a special master to oversee reform of the division.

ACLU lawyers used the legal tool of discovery to get direct access to case files that the public rarely sees because federal and local laws bar social workers from talking about their work and keep the public out of most child abuse court hearings.

The lawsuit has given another perspective too, that of social workers in an underfunded and understaffed agency ill-equipped to cope with an unending flood of abuse reports. Depositions from division caseworkers portray the agency not as an inhumane bureaucracy, but as the governmental equivalent of a frantic parent who cannot rescue his children from a burning house.

The workers describe caseloads three times what they are supposed to be, workers who put in 80-hour weeks and supervisors who cannot supervise because they inherit the work left behind when burned-out subordinates quit. Of the 240 social worker positions at the division, 80 are vacant, the result of chronic budget problems at the agency, according to court records.

"I feel strongly that if I had a smaller caseload, I could be more effective," Joseph C. Rae, a supervisory social worker, said in a deposition given last May. "As it stands right now . . . workers seem to function in a crisis-oriented situation. A fire starts and you put it out and then we move on to the next."

So far, courtroom testimony has been one-sided. Lawyers for the city have told Hogan they may not be ready to present their case when ACLU attorneys wind up their testimony, probably this week. Spokesmen for the agency and the D.C. Corporation Counsel's Office declined to comment on the lawsuit last week. In pretrial hearings, city attorneys have said the District is doing the best it can with the money it has to spend.

But ACLU lawyers contend that problems arising from the lack of money are compounded by insufficient training of workers.

They say their contention is bolstered by a two-volume study of the District's child welfare system conducted last summer by Theodore J. Stein, a professor of social welfare. The study was filed months ago as part of the court record in the case, but its conclusions had not been made public until now.

The study was designed to pinpoint the logjams that have made foster care a permanent solution instead of a temporary measure. Stein and 20 researchers took a random sample of 665 files for children in the District who either were in foster care, were living at home under the supervision of social workers, or who had been the subject of abuse and neglect reports. Those cases represented roughly 30 percent of the 2,135 children under some form of Department of Human Services supervision at the time.

"We really have a very short period of time -- about 18 months -- when a child's chance of moving into an adoptive home are great," Stein testified on Friday. "There's no question in my mind" that District social workers too often merely shuffle the paperwork on children in foster care, maintaining plans to reunite them with their families for months and years after their biological parents have stopped visiting or have dropped out of sight.

That failure, as well as the failure to help families reunite, "is denying {children} the opportunity to be placed in an adoptive home," he testified, because children who grow up in foster care often become emotionally troubled teenagers who are difficult to place.

Bottlenecks start forming when children put into foster care stay there without case plans or periodic reviews, the report said.

Without goals and specific plans for reaching them, families who could be reunited are not referred for services that might bring them back together, such as drug counseling, homemaker services, transportation or help in finding housing, according to the report.

More important, it also means that other children remain in "return home" status long past the time it is clear that their parents have abandoned them.

Under the guidelines provided by the federal Adoption Assistance and Child Welfare Act of 1980, 18 months is the maximum length of time a child should spend in foster care before steps are taken to place the child with adoptive parents. But of the 110 children in foster care whose case plans called for "return home" at the time of Stein's study, 52 percent had been in that category for more than 18 months.

Finally, because there aren't enough social workers, paperwork on children whose plan is changed to adoption often takes months to move from one desk to another. Then it could take more months to move the paperwork through an understaffed Corporation Counsel's Office, which must file legal papers necessary to make children available for adoption.

D.C. law requires that all children whose plans are changed to "adoption" be referred to the adoption unit of the child welfare agency within three days. The Stein study showed that 69 percent of the children who were candidates for adoption on paper had never had their cases referred to the adoption unit. Of the 31 percent who had been, 28 percent were referred after a six-month wait.

In testimony on Friday, Stein spoke of still another category many foster children fall into -- "plan for independent living." The category is essentially an acknowledgement that the child is never going to have a permanent home, either with his own family or an adoptive one, he said. Federal law allows it to be used for children 16 and older.

But Stein said that a "remarkable" 35 percent of children he studied in the District who fell into this category were under the age of 3.

"It's really a wastepaper basket in which you throw kids," he said. "This is just being done indiscriminately."

In some cases, he added, caseworkers might lack the training to know that putting a child in that category means that "the child is likely to spend the rest of his or her {childhood} in foster care."