# Pi model-independent document inspection demonstration

## Evidence status

This is a manually approved local demonstration recorded on 2026-10-22. It shows Pi's `/inspect-document` command inspecting a public paper supplied by its author, Gino Tesei. The command uses the reference application's bounded document-ingestion path and makes no model, provider, or public-network call. The selected model remains visible in Pi's footer but is not invoked.

The inspected paper is:

> Gino Tesei, Stefanos Giampanis, Jingpu Shi, and Beau Norgeot, “Learning end-to-end patient representations through self-supervised covariate balancing for causal treatment effect estimation,” *Journal of Biomedical Informatics* 140 (2023), 104339. <https://doi.org/10.1016/j.jbi.2023.104339>

The paper PDF is not distributed with this repository. Article text and publisher formatting remain subject to their respective rights and are not relicensed by this demonstration.

## Accessible interaction transcript

The custom document viewer redraws the terminal rather than emitting an ordinary conversational transcript. The sequence below records the meaningful visible interaction without reproducing the paper in full.

1. Pi 1.0.4 starts with the repository context and five reviewed extensions, including `document-inspection.ts`.
2. The user invokes `/inspect-document` on the local public-paper PDF.
3. Pi displays `Extracting document locally…`; there is no assistant response or tool-progress card.
4. A read-only view opens with the heading `BCAUSS_paper.pdf.extracted.md — full extraction`.
5. The view reports:
   - 129,145 characters;
   - 16 pages;
   - 44 chunks;
   - 0 warnings; and
   - extracted-text SHA-256 `f5676a2e78eb050fcb13b8b1225d0f2476710bdd6ff981c81af7251fc96208b9`.
6. The first visible material includes the journal name, article type, article title, author list, and the beginning of the abstract. The title is “Learning end-to-end patient representations through self-supervised covariate balancing for causal treatment effect estimation.”
7. The user navigates through the complete extraction. Visible portions include the abstract, abbreviations, introduction, related work, and discussion. The status line continuously identifies the remaining line count and offers `S save`, line/page navigation, and `Esc close`.
8. The user presses `S`.
9. Pi asks `Replace extracted Markdown?` and explains that the selected regular file already exists. `No` is initially selected.
10. The user selects `Yes` and confirms.
11. Pi closes the viewer and reports: `Saved BCAUSS_paper.pdf.extracted.md.`
12. The session returns to an empty Pi editor. No model-generated answer appears.

## What this establishes

For this input, commit, and environment, the command opened the bounded local extraction, exposed extraction metadata, allowed navigation, required confirmation before replacement, and reported a successful save. It does not establish that extraction preserved every layout or semantic relation in the original PDF, that the article's claims are true, or that every PDF will parse successfully.
