Spaces:
Sleeping
Sleeping
Commit History
-
fix_pptx_lang_tags: stop counting noProof as a language tag
ClaudeUnverified signaturenoProof is a boolean spell-check toggle (value '1'/'0'), not a language code. The tool already declined to rewrite it, but it was being counted in the findings — invisible before, but the new per-XML-part table surfaces it clearly as confusing rows like 'Slide 12 | 1 | 1'. Removed noProof from LANG_ATTRS so it's no longer scanned at all; dropped the now-unnecessary guard in the rewrite branch. Verified: 'noProof' values no longer appear in the language findings; smoke test 7/7; acronym tests pass.75e9921 -
fix_pptx_lang_tags: per-XML-part breakdown in the findings table
ClaudeUnverified signatureThe findings table for the PPTX language tool now shows one row per (XML part, language) pair instead of a per-language total — so you can see exactly which slide/layout/master XML files contain each tag and how many occurrences live in each. Rows are sorted with non-target languages first (the ones actually being changed), then by occurrence count desc. Smoke test 7/7.299af37
-
Add four accessibility checks/tools (now 14 tools)
ClaudeUnverified signature- check_slide_titles (pptx): reports slides with missing/empty or duplicated titles — key for screen-reader navigation. Read-only. - check_hyperlinks (pptx): flags non-descriptive link text ("click here", bare URLs, empty). Read-only. - check_font_size (pptx): reports runs below a minimum point size (default 18, configurable); runs with inherited sizes are counted as undetermined. Read-only. - set_pdf_title (pdf): sets the document title (/Info + XMP) and enables the DisplayDocTitle viewer preference so readers show the title, not the filename (PDF/UA). Produces a file. All wired into the registry/runners with structured reports; CLIs included. Smoke test bumped to 14 tools (7/7), acronym tests pass, all four verified on a purpose-built deck/PDF.e553423 -
Cosmetic cleanup: dead code and a fragile temp-dir name
ClaudeUnverified signature- remove_footer_text: drop unused imports (os, copy, RELATIONSHIP_TYPE, etree). - pptx_to_accessible_html: remove dead locals in get_alt_text (it computed nvPr/cNvPr and a fallback loop whose results were never used; the iter-based search below is the real logic). - fix_math_italics: use a unique tempfile.mkdtemp() dir instead of a fixed '_pptx_math_temp' name, removing a latent collision risk. No behavior change: all modules import, the touched tools and CLIs run, alt text still extracted, temp dirs cleaned up, smoke test 7/7.093436e -
fix_pdf_lang_tags: terminate the object-graph walk on cyclic PDFs
ClaudeUnverified signaturewalk_all_objects deduped visited nodes by id(), but pikepdf returns a fresh Python wrapper on every access, so the visited set never matched and reference cycles (page /Parent -> /Pages -> /Kids -> page) were re-walked until the recursion limit — masked by the broad `except Exception: pass`. A 3-page blank PDF triggered 2,071 walk calls; a real multi-page tagged PDF could near-hang. Now dedupe indirect objects by their stable (objnum, gen) id (objgen) and always recurse direct objects (which can't form cycles). Same 3-page PDF now takes 36 calls; /Lang detection and rewriting still work.3879475 -
Minor robustness fixes: B4, B5, S5
ClaudeUnverified signatureB5: fix_pdf_lang_tags now escapes the target language for the PDF content- stream literal string, so a value containing '(' ')' or '\\' can't malform the stream (the dictionary path already escaped via pikepdf.String). B4: a background task sweeps abandoned result files every 10 min via the app lifespan, so idle downloads are cleaned even with no further requests (was only swept at the start of the next run). S5: uploads are now content-checked by leading bytes (%PDF / PK zip header), not just extension, so files that don't match their claimed type are rejected before reaching a parser. Verified: garbage .pptx rejected as invalid, PDF target with parens stays a valid PDF, sweeper starts with the app, smoke test 7/7, acronym tests pass. B3 (lone 'i'->'I') investigated and dropped: _to_mixed_case output is identical to str.title() in every 'i' case, so there is no real defect.bc4fb4f -
fix_math_italics: honor OMML run styling (B2)
ClaudeUnverified signatureItalic/bold detection previously used only Unicode math codepoints and DrawingML <a:rPr> i/b attributes, so a variable stored as a plain letter with OMML <m:rPr><m:sty m:val="i"/> exported upright. Now also read <m:sty> (i/b/bi/p) and <m:nor>, and default a single-letter variable to italic when no styling is specified (the OMML convention). Verified: a variable with m:sty val="i" now exports as an italic run.059aa58 -
Sanitize error responses, guard env var, drop runtime pip (S2/B1/S3)
ClaudeUnverified signatureS2: unexpected runner failures and the 500 handler no longer echo raw exception text (which could include temp paths/internals) to the client. The full traceback is logged server-side; the client gets a generic message. Intentional ToolError messages are still shown as before. B1: MAX_UPLOAD_MB now falls back to 100 on a non-numeric value instead of crashing the app at startup. S3: removed the os.system("pip install lxml ...") ImportError fallbacks in fix_slide_number_order and fix_math_italics (lxml is a declared dependency); dropped the now-unused os import. Verified: corrupt upload yields a generic per-file error (traceback logged), both CLIs still run, smoke test 7/7, acronym tests pass.99f30ce -
Harden XML parsing against hostile uploads (S4)
ClaudeUnverified signatureThe three lxml-based PPTX tools parse XML straight from uploaded files. They now use a parser with resolve_entities=False, load_dtd=False, no_network=True, closing entity-expansion (billion-laughs) and external-entity vectors as defense-in-depth. A fresh parser is created per call so it's safe to use from the threadpool (lxml parsers aren't shareable across threads). Verified: a nested-entity payload is left unexpanded; all three tools still process a real deck; smoke test 7/7.2718b7d -
Flag filename-like alt text as WEAK
ClaudeUnverified signaturereport_alt_text now distinguishes alt text that is just an image filename (e.g. python-pptx's auto-filled "dot.png") from a real description: such images get a WEAK status and their own count, so reviewers don't mistake a filename for genuine alt text. The heuristic only flags text ending in an image extension, so prose like "See diagram.png in the appendix" stays OK.359428c -
Add alt-text reporter tool
ClaudeUnverified signaturetools/pptx/report_alt_text.py scans a deck and reports every image's alt-text status (OK / DECORATIVE / MISSING), reusing the same descr/decorative detection as the HTML exporter. Read-only — produces a structured findings report (slide, shape, status, alt_text) and no output file. Wired into the registry and runners as the 10th tool; usable from the CLI too. Verified: OK, DECORATIVE, and MISSING paths all detected; smoke test updated to expect 10 tools (7/7 green).4e7642c -
Structured reports instead of scraped stdout
ClaudeUnverified signatureRunners now return a structured RunResult (summary, counts, findings table rows + columns, and a collapsible raw_log) rather than a captured-text blob. The structured data comes from each tool's return value or an additive, non-breaking hook (an optional changes list, or a return dict where the function previously returned None) — the CLIs are byte-for-byte unchanged. - tools: convert_caps/replace_allcaps/remove_footer_text expose before->after changes; fix_pptx_lang_tags/fix_pdf_lang_tags return their findings counters; fix_math_italics returns structured replacements; fix_slide_number_order lists the slides it reordered. - API: /api/run/{tool} now returns one structured block per file (unifying single + batch); per-file errors are reported in-band rather than aborting. - frontend: renders summary, count chips, a findings table, and a "Show log" details pane per result. Verified: structured output end-to-end, all CLIs unchanged, acronym tests and smoke test (7/7) green.154b1f0 -
Unify the two caps tools' acronym lists
ClaudeUnverified signatureconvert_caps (KEEP_WORDS) and replace_allcaps_pptx (PRESERVE_UPPERCASE) each carried their own hardcoded acronym list, and they had drifted: e.g. "WCAG" was preserved by replace_allcaps but mangled to "Wcag" by convert_caps when it appeared as caps *formatting*. Both now load one shared source of truth, tools/pptx/acronyms.txt (loaded relative to __file__, so it works for the CLI, the run.py launcher, and the web app's importlib loading). convert_caps uses the canonical casing; replace_allcaps uses the uppercased forms. Verified: lists agree (72 entries), WCAG with caps formatting now stays WCAG, and the smoke test passes 7/7.d0a3b3d -
Wire all 9 tools into the FastAPI web app
ClaudeUnverified signature- runners.py: adapter layer that loads each CLI tool by file path (so tools/pptx never shadows the python-pptx package) and wraps its existing core function, capturing printed output as the report and normalising the report-only / dry-run / no-output cases. - registry.py: metadata + option schema + runner for each of the 9 tools. - main.py: POST /api/run/{tool} (multipart upload + typed options) and GET /api/result/{id} (download then clean up); /api/tools serves schemas. - frontend: tool picker + dynamic option fields, upload, report, download. - fix_slide_number_order: extract importable process_pptx() from main(). - replace_allcaps_pptx: fix double ._element deref in clear_font_allcaps (the script was previously untested and crashed on any run). All 9 tools verified end-to-end through the HTTP API with sample files.8bc7d4e -
Scaffold PPTX/PDF accessibility tools web app
ClaudeUnverified signatureLays out the structure from CLAUDE_CODE_BRIEF.md without implementing tool logic: empty FastAPI app with /api/health and /api/tools, static frontend stub, empty tool registry, Dockerfile + docker-compose with qpdf baked in for pikepdf. Existing CLI scripts moved into tools/.307de64