To create dramatic irony and increase tension in this story, the writer could choose to reveal the killer’s identity to readers right before the detective unknowingly enters a scene with the killer. This method effectively builds suspense as readers become aware of the threat while the detective remains in the dark, heightening the stakes of the impending encounter.
By doing this, the audience is left anxious about the detective's safety and eager to see how the confrontation will unfold. As the story progresses, the tension can be amplified through various narrative techniques, such as showing the detective's investigative process and the developing relationship with the librarian, juxtaposed against the reader's knowledge of the lurking danger. This can create an emotional investment, as readers root for the detective to uncover the truth while fearing for her safety.
In contrast, suggesting that the librarian is the killer after it seems the case is resolved could lead to confusion and diminish the impact of the initial reveal. By focusing on the dramatic irony of the detective being unknowingly close to danger, the tension remains constant and engaging throughout the final act of the story.