Skip to content

Commit 614db13

Browse files
committed
Point the deck-audit docs at the unified review entry point
Update the overflow / contrast subagent docs to reference the package modules and review_deck, and add pptx_review and the review subcommand to README, the MCP and CLI references, and the en / zh-tw / zh-cn Sphinx docs.
1 parent 1f6d5b9 commit 614db13

9 files changed

Lines changed: 94 additions & 13 deletions

File tree

.claude/agents/rules/deck-design.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,11 @@ Both layers ship together; tests pin both. The regression test
134134
``test_pptx_dark_mode_has_no_invisible_runs`` (in ``tests/test_exporters.py``)
135135
walks every run on every slide of a default-dark-mode deck and fails
136136
if any non-empty run has ``rgb is None`` or ``rgb == (0,0,0)``. A
137-
companion debug script lives at ``scripts/_audit_dark_text.py`` for
138-
manual inspection of a single rendered deck.
137+
companion auditor lives at ``thesisagents.exporters.audit.audit_deck`` (the
138+
``scripts/_audit_dark_text.py`` CLI is a thin wrapper) for manual inspection
139+
of a single rendered deck — or use the one-stop ``review_deck`` /
140+
``python -m thesisagents review`` / MCP ``pptx_review``, which bundles this
141+
contrast audit with the overflow and section-completeness checks.
139142

140143
#### "No red text" contract (HARD)
141144

@@ -223,9 +226,10 @@ stayed light. White-on-white. Fixed by adding the mapping
223226
text colour, and fails when both > 0.7 × 255 (= 178). Adding a new
224227
light-fill shape without a corresponding dark mapping will fail
225228
this test.
226-
3. **The audit script** ``scripts/_audit_dark_text.py`` now also
227-
reports failure-mode B — run it on a rendered deck during manual
228-
inspection.
229+
3. **The auditor** ``thesisagents.exporters.audit.audit_deck`` (CLI
230+
``scripts/_audit_dark_text.py``, or bundled into ``review_deck`` /
231+
``pptx_review``) now also reports failure-mode B — run it on a rendered
232+
deck during manual inspection.
229233

230234
Exposure surfaces (light is default; the toggles opt IN to DARK):
231235
- CLI: `--dark-mode` opt-in flag (when absent → light)

.claude/agents/tasks/slide-overflow-check.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,29 @@ You'll be told (or you can infer from context) which deck(s) to check. Typical i
2828
- A specific path: `exports/<run>/<key>.pptx`
2929
- Or a regen script the parent just ran: re-derive the path from the script's `out_dir` + `filename_stem`.
3030

31-
**Use the canonical inspector — `scripts/check_overflow.py`.** It already encodes
32-
the project's wrap estimate and calibration, so run it rather than reinventing one:
31+
**Use the canonical inspector.** Its logic now lives in the package at
32+
`thesisagents.exporters.overflow` (the `scripts/check_overflow.py` CLI is a thin
33+
wrapper re-exporting it), so run it rather than reinventing one:
3334

3435
```
3536
.venv/Scripts/python.exe scripts/check_overflow.py exports/<deck>.pptx [more.pptx ...]
3637
```
3738

3839
It prints the report block below per deck and exits with the count of failed decks
3940
(0 = all clean), so you can assert on the exit code. It is also importable —
40-
`from check_overflow import check_pptx, check_pptx_from_prs` — returning a list of
41+
`from thesisagents.exporters.overflow import check_pptx, check_pptx_from_prs` (the
42+
script path `from check_overflow import …` still works too) — returning a list of
4143
`Violation(slide, shape, kind, rendered_in, limit_in)`; `check_pptx_from_prs(prs)`
4244
takes an already-open `Presentation` so a test can build a deck in memory.
4345

46+
**For a full deck audit (overflow + colour contracts + section completeness) in
47+
one pass, prefer `thesisagents.exporters.review.review_deck(path)`** — exposed as
48+
the CLI `python -m thesisagents review <deck.pptx>` and the MCP `pptx_review`
49+
tool. It bundles this overflow check with the dark-mode / no-red / contrast audit
50+
and the `paper_rule` seven-section completeness check, returning a single
51+
`DeckReview` (`.ok`, `.overflow`, `.contrast`, `.missing_sections`). Use the
52+
standalone overflow inspector above when you only need the geometry check.
53+
4454
What it does (so you can trust / explain its output):
4555

4656
- Reads each run's actual `font.size` (the exporter sets it per run), classifies

CLAUDE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ Concretely, the assistant:
4747
4. **Generates** `.pptx` (three rendering tiers — lightweight / enriched-flat /
4848
thesis-style), `.xlsx`, `.bib`, `.md`, `.json` outputs.
4949
5. **Exposes** every step as an MCP tool (`search`, `fetch_paper`, `fetch_pdf_text`,
50-
`export`, `pptx_inspect`, `pptx_update_slide`, `pptx_delete_slide`,
51-
`pptx_reorder_slides`, `pptx_add_slide`).
50+
`export`, `pptx_inspect`, `pptx_review`, `pptx_update_slide`, `pptx_delete_slide`,
51+
`pptx_reorder_slides`, `pptx_add_slide`). `pptx_review` audits an existing deck
52+
(overflow + colour contracts + `paper_rule` section completeness) in one call —
53+
the same audit the CLI exposes as `python -m thesisagents review <deck.pptx>`.
5254

5355
Single-process, Python 3.12+. Heavy I/O off the event loop; shared
5456
`httpx.AsyncClient` registry pools connections per source.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ it.
6464
6. export(papers=[{...paper, "summary": {...}}], language="zh-tw", ...)
6565
```
6666

67-
All twelve MCP tools (including `list_sources`, `list_exports`,
68-
`download_pdfs`, `pptx_inspect` / `pptx_update_slide` / `pptx_add_slide`
69-
/ etc.) are
67+
All thirteen MCP tools (including `list_sources`, `list_exports`,
68+
`download_pdfs`, `pptx_inspect` / `pptx_review` / `pptx_update_slide` /
69+
`pptx_add_slide` / etc.) are
7070
documented in [`docs/mcp.md`](docs/mcp.md).
7171

7272
### Mandatory: URL / DOI verification before shipping
@@ -411,6 +411,7 @@ Tools:
411411
| `download_pdfs` | Batch-download a papers list's PDFs into `{out_dir}/pdfs/`. Returns per-paper results keyed by BibTeX key. |
412412
| `export` | Papers list + formats → writes `.pptx/.xlsx/.md/.bib/.json/.ris/.csv/.csl.json`. Accepts a `summary` field per paper for the rich thesis-style schema, `max_slides_per_paper` (default 25), and `dark_mode` (default `true` — the project's dark-deck post-pass; pass `false` for the printable light variant). |
413413
| `pptx_inspect` | Read slide / shape structure of an existing deck. |
414+
| `pptx_review` | Audit a deck in one call — overflow + colour contracts + `paper_rule` section completeness. Auto-detects the deck language; also the CLI `python -m thesisagents review <deck.pptx>`. |
414415
| `pptx_update_slide` | Replace `title` / `body` / `meta` (by shape name) or arbitrary shapes by index. |
415416
| `pptx_delete_slide` | Remove a slide and its part relationship. |
416417
| `pptx_reorder_slides` | Permute slides via `sldIdLst`. |

docs/cli.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,24 @@ research question, KPI metrics, technique table, literature
131131
positioning, per-RQ result tables, …), and the PPT exporter renders the
132132
thesis-style layout.
133133

134+
### Review an existing deck
135+
136+
```bash
137+
thesisagents review ./exports/attention.pptx
138+
thesisagents review ./exports/*.pptx --lang zh-tw
139+
```
140+
141+
The `review` subcommand audits a finished `.pptx` against all three
142+
deck-quality contracts in one pass — slide **overflow**, the dark-mode /
143+
no-red / contrast **colour** contracts, and `paper_rule` **section
144+
completeness** (Introduction, Literature Review, Methodology, Experiment,
145+
Conclusion). `--lang` is optional; the deck's language is auto-detected
146+
from its slide titles otherwise. It prints a per-deck report and exits
147+
with the number of decks that failed (`0` = all clean), so it drops into
148+
CI. Section completeness only fails a *thesis-style* deck — a lightweight
149+
abstract-only deck is never failed for legitimately lacking sections.
150+
The same audit is the MCP `pptx_review` tool.
151+
134152
## Exit codes
135153

136154
| Code | Meaning |

docs/en/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ Tools at a glance:
448448
for the printable light variant).
449449
* - ``pptx_inspect``
450450
- Read slide / shape structure of an existing deck.
451+
* - ``pptx_review``
452+
- Audit a deck in one call — overflow + colour contracts +
453+
``paper_rule`` section completeness. Auto-detects the deck
454+
language; also the CLI ``python -m thesisagents review``.
451455
* - ``pptx_update_slide``
452456
- Replace ``title`` / ``body`` / ``meta`` (by shape name) or
453457
arbitrary shapes by index.

docs/mcp.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,40 @@ Shape names are set by `PptxExporter`: each slide carries `title`,
385385
elsewhere may not have these names — fall back to `shape_updates`
386386
addressed by integer index.
387387

388+
### `pptx_review`
389+
390+
Audit an existing deck against all three deck-quality contracts in one
391+
call: slide **overflow**, the dark-mode / no-red / contrast **colour**
392+
contracts, and `paper_rule` **section completeness**.
393+
394+
```json
395+
{"path": "./exports/attention.pptx"}
396+
```
397+
398+
`language` is optional — it is auto-detected from the slide titles when
399+
omitted (pass e.g. `"zh-tw"` to force it). Returns:
400+
401+
```text
402+
{
403+
"path": "./exports/attention.pptx",
404+
"language": "zh-tw",
405+
"thesis_style": true,
406+
"ok": true,
407+
"overflow": [], // {slide, shape, kind, rendered_in, limit_in}
408+
"contrast": [], // {slide, shape, kind, detail, hard}
409+
"missing_sections": [], // canonical body sections with no covering slide
410+
"completeness_gated": true // missing_sections only fail a thesis-style deck
411+
}
412+
```
413+
414+
`ok` is `false` when there is any overflow, any *hard* contrast issue
415+
(invisible / red / light-on-light text), or — for a thesis-style deck —
416+
any missing body section (Introduction, Literature Review, Methodology,
417+
Experiment, Conclusion). A lightweight abstract-only deck is never failed
418+
for lacking sections (`thesis_style` / `completeness_gated` say which).
419+
The same audit is available on the command line as
420+
`python -m thesisagents review <deck.pptx> [more.pptx ...] [--lang xx]`.
421+
388422
### `pptx_update_slide`
389423

390424
Replace text on one slide.

docs/zh-cn/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,10 @@ Claude Desktop、Cursor …)都能驱动整套流程。
353353
代表不限)。
354354
* - ``pptx_inspect``
355355
- 读已有幻灯片文件的 slide / shape 结构。
356+
* - ``pptx_review``
357+
- 一次审核整份幻灯片 — 溢出 + 颜色契约 + ``paper_rule``\
358+
章节完整度。自动检测语言,也是 CLI
359+
``python -m thesisagents review``。
356360
* - ``pptx_update_slide``
357361
- 替换 ``title``/ ``body``/ ``meta``\ (通过 shape name)或
358362
任意 shape(通过 index)。

docs/zh-tw/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,10 @@ Claude Desktop、Cursor …)都能驅動整套流程。
354354
代表不限)。
355355
* - ``pptx_inspect``
356356
- 讀既有投影片檔的 slide / shape 結構。
357+
* - ``pptx_review``
358+
- 一次稽核整份投影片 — 溢位 + 色彩契約 + ``paper_rule``\
359+
章節完整度。自動偵測語言,亦為 CLI
360+
``python -m thesisagents review``。
357361
* - ``pptx_update_slide``
358362
- 取代 ``title``/ ``body``/ ``meta``\ (透過 shape name)或
359363
任意 shape(透過 index)。

0 commit comments

Comments
 (0)