Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12"]
python-version: ["3.12", "3.14"]
steps:
- uses: actions/checkout@v4

Expand All @@ -31,10 +31,9 @@ jobs:

- name: Run tests
working-directory: plugins/scriptorium
# Coverage once, on 3.12: its sys.monitoring core keeps subprocess coverage
# cheap; on 3.11 the fallback tracer makes the suite ~8x slower.
# Coverage once, on 3.12; 3.14 runs the suite without it.
# The floor sits a little under the local figure: CI skips the LibreOffice tests.
run: uv run pytest ${{ matrix.python-version == '3.11' && '--no-cov' || '--cov-fail-under=94' }}
run: uv run pytest ${{ matrix.python-version == '3.12' && '--cov-fail-under=94' || '--no-cov' }}

# The LLM-free extraction eval: fails when a corpus score drops below
# its floor in evals/extraction/corpus.json. Deterministic, so once.
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Installs the Python dependencies (PyMuPDF, pdfplumber, pytesseract, Pillow,
Jinja2, PyYAML, python-pptx, python-docx, openpyxl, beautifulsoup4) plus
the dev group: `pytest`/`pytest-cov`, and ReportLab for the fixture
generators in `examples/`. Requires
[`uv`](https://docs.astral.sh/uv/) and Python 3.11+. Also runs automatically
[`uv`](https://docs.astral.sh/uv/) and Python 3.12+. Also runs automatically
via a `SessionStart` hook when the plugin loads in a Claude Code session.

## Running the plugin from this checkout
Expand All @@ -46,7 +46,7 @@ Config lives in `plugins/scriptorium/pyproject.toml`
(`[tool.pytest.ini_options]`). Two markers gate environment-dependent tests:
`requires_tesseract` and `requires_libreoffice` (the latter skipped in
the main CI job and run by its own `libreoffice` job in
`.github/workflows/ci.yml`). CI runs on Python 3.11 and 3.12, with a
`.github/workflows/ci.yml`). CI runs on Python 3.12 and 3.14, with a
coverage floor on 3.12. `tests/test_prompt_contract.py` checks every
script, subcommand and `--flag` that `commands/` and `agents/` name
against the scripts' argparse.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![CI](https://github.com/MichaelD-42/scriptorium/actions/workflows/ci.yml/badge.svg)](https://github.com/MichaelD-42/scriptorium/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Python 3.11 | 3.12](https://img.shields.io/badge/python-3.11%20%7C%203.12-blue.svg)](plugins/scriptorium/pyproject.toml)
[![Python 3.12 | 3.14](https://img.shields.io/badge/python-3.12%20%7C%203.14-blue.svg)](plugins/scriptorium/pyproject.toml)

A Claude Code plugin that extracts documents into structured text — headings,
tables, figures with descriptions — and checks its own result before handing
Expand Down
2 changes: 1 addition & 1 deletion docs/c4/workspace.dsl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ workspace "scriptorium" "Document extraction pipeline run as a Claude Code plugi
extractor = container "Extractor" "Extracts one page batch at its assigned tier (OCR, vision) plus image descriptions, figure text and mermaid; may correct a figure text Tesseract read. Writes only its own pages' shards. Its prompt names each command it runs; it reads a tool's README.md only when a step needs more." "Claude Code subagent (agents/extractor.md), one per batch, in parallel" "Agent"
grader = container "Grader" "Tags one page batch's defects from the rubric's fixed taxonomy by comparing rendered pages to the assembled output; never scores (the score is computed from the tags). Visual layout is not graded; a paragraph left split across pages is. Writes only its own pages' grade shards. Its prompt names each command it runs; it reads tools/grade-output/rubric.md before grading." "Claude Code subagent (agents/grader.md), one per batch, in parallel" "Agent"

scripts = container "Tool scripts" "Deterministic CLI steps, tools/<name>/scripts/ with a README.md each (not Claude Code skills), one tool per tier or format." "Python 3.11+, uv" {
scripts = container "Tool scripts" "Deterministic CLI steps, tools/<name>/scripts/ with a README.md each (not Claude Code skills), one tool per tier or format." "Python 3.12+, uv" {
setup = component "Environment setup" "Bootstraps uv, the Python env, tesseract and LibreOffice; resolves and installs a document's OCR language pack." "setup-environment"
queue = component "Queue state + plan" "Owns runs/state.json and the pass / retry / needs-human rules (content tag or text_layer_coverage: page to vision; image tag: recheck images; split_paragraph: human); records each attempt's time and cost; plans which pages need an agent and the batch sizes; writes the end-of-run report; with --findings, saves each page of a passed PDF that failed at a script tier and passed at vision as a suggested correction." "queue-state"
triage = component "Triage" "Per format: page split, tier per page, loop size. PDF also: preflight, furniture, TOC, body font size, and the pre-analysis: detection scopes and known quirks (layout table, heading in block, side-margin text, garbled text layer, text language), each with the measure the scripts apply." "pdf/pptx/docx/xlsx/html/image-triage"
Expand Down
2 changes: 1 addition & 1 deletion plugins/scriptorium/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "scriptorium",
"displayName": "Scriptorium",
"version": "0.8.1",
"version": "0.8.2",
"description": "Elastic-loop document extraction team: tiered text/OCR/image extraction agents run in parallel page batches, an independent quality grader, and a queue orchestrator. PDF, pptx, docx, xlsx, HTML, and standalone images in (Markdown, HTML, OKF multi-file bundle, or ReqIF out); more formats arrive as sibling tools.",
"author": {
"name": "Michael Dold"
Expand Down
12 changes: 12 additions & 0 deletions plugins/scriptorium/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ PDF, PowerPoint (`.pptx`), Word (`.docx`), Excel (`.xlsx`), HTML (`.html`),
and standalone images (`.png`/`.jpg`/`.jpeg`/`.webp`/`.tiff`) are
implemented today.

## 0.8.2

Python support.

- **Python 3.12 and 3.14**: CI tests both; Python 3.11 is no longer
supported (`requires-python = ">=3.12"`). uv fetches a matching Python
on its own, so an install needs no action.
- **Fix** (Python 3.14): an `input/` file named only dots and an extension
(`..pdf`) is reported as "not a usable document name" again. Python
3.14's pathlib gives such a name no suffix, so `state.py init` skipped it
without a word. Nothing was deleted either way.

## 0.8.1

PDF figure fix.
Expand Down
2 changes: 1 addition & 1 deletion plugins/scriptorium/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "scriptorium-scripts"
version = "0.1.0"
description = "Python scripts backing the Scriptorium Claude Code plugin"
requires-python = ">=3.11"
requires-python = ">=3.12"
dependencies = [
"pymupdf>=1.24",
"pdfplumber>=0.11",
Expand Down
9 changes: 5 additions & 4 deletions plugins/scriptorium/tools/queue-state/scripts/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ def cmd_init(args) -> None:
sys.exit(1)
state = load_state()
for path in sorted(Path("input").iterdir()):
ext = path.suffix.lstrip(".").lower()
if ext not in paths.SUPPORTED_INPUT_EXTS:
# Split the name ourselves: Python 3.14's pathlib gives "..pdf" no
# suffix, which would skip it silently instead of warning below.
doc, _, ext = path.name.rpartition(".")
if ext.lower() not in paths.SUPPORTED_INPUT_EXTS:
continue
doc = path.stem
if doc in (".", ".."): # work/<doc> would be work/ or the project root, and init deletes it
if doc in ("", ".", ".."): # work/<doc> would be work/ or the project root, and init deletes it
print(f"warning: {path} skipped; not a usable document name", file=sys.stderr)
continue
chosen = paths.input_file(doc)
Expand Down
Loading
Loading