parse_manuscript
Parse a manuscript into source-tagged section spans, detect protocol tables/flow diagrams, and return a text hash. Include supplements so appendix content is assessed rather than marked not reported.
Instructions
PRIMARY entry point: parse a manuscript into a SectionMap with character-offset, source-tagged section spans.
PASS citation=: the manuscript's full bibliographic reference in APA style
(authors, year, title, journal, volume(issue), pages, DOI). It is carried
into the assessment and displayed on every rendered checklist so the
assessed publication is unambiguous — without it, renders can only show the
short manuscript_id. You have the paper in hand; format the reference from
its title page.
document is EITHER the raw manuscript text OR a file path — but the path
must be readable on the SERVER host. If you are an agent whose uploaded files
live on your own filesystem (a mounted upload dir, a sandbox), the server
cannot see them: paste the manuscript TEXT instead, or use parse_pmcid for an
open-access PMCID. Reach for a file path only when the file is on the same
host as this server (server-local/batch use). A path-looking string that the
server can't find raises rather than being silently ingested as its own text.
supplements is a list of server-readable file paths (PDF/docx/text) to
merge as supplementary material — PASS IT WHEN YOU HAVE IT: TTE methods
(estimand, identifying assumptions) frequently live in a supplementary
protocol table, and without a supplement the verdicts on those leaves come
back not_reported when the content was merely in an un-ingested appendix.
When supplements are provided, supplement_status defaults to 'user_provided'.
Pass supplement_status='none_exists' to assert the article has no supplement.
section_hints is a LAST RESORT for a section the detector cannot find:
{'introduction': 6543} splits whatever section contains that character
offset. Some journals print no heading for a section (an introduction that
simply follows the abstract) and interpose prose — a lay-summary box — that
no structural rule can tell apart from the section itself; check the
warnings for 'may have swallowed an unheaded introduction'. A hint never
edits the text, so text_sha256 is unchanged and a hinted parse is the same
document; the hinted section carries an empty heading because the paper
prints none. Only supply an offset you established by READING the paper, and
expect an error rather than silence if the hint cannot be applied.
Returns source-tagged section boundaries, protocol-table and flow-diagram detection over the combined text, supplement_status, and the text hash used to key later calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| citation | No | ||
| document | Yes | ||
| supplements | No | ||
| manuscript_id | No | ||
| section_hints | No | ||
| supplement_status | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | ||
| n_pages | No | ||
| citation | No | ||
| sections | No | ||
| warnings | No | ||
| documents | No | ||
| full_text | No | ||
| text_sha256 | No | ||
| manuscript_id | No | ||
| extractor_version | No | ||
| supplement_status | No | ||
| flow_diagram_detected | No | ||
| protocol_table_detected | No |