Skip to content

fix(pptx): unique paragraph coordinates + DET-009 speaker notes; pin DET-008 evals - #5

Merged
sscodeai merged 1 commit into
mainfrom
fix/eval-artifacts-and-pptx
Oct 19, 2026
Merged

sscodeai merged 1 commit into
mainfrom
fix/eval-artifacts-and-pptx

Conversation

@sscodeai

Copy link
Copy Markdown
Owner

Follow-up to a review of the DET-008 write-up. Three things: a real sanitizer bug, a real detection gap, and making the DET-008 evaluation numbers reproducible.

1. PPTX paragraph coordinates (bug)

PptxParser used the slide number as TextParagraph.index, so every text box and the notes on a slide shared one coordinate. A single hidden run therefore matched every run on that slide, and aiitg sanitize --mode redact replaced the whole slide with [REDACTED] — i.e. quarantine destroyed the visible content it was supposed to preserve.

  • Indices are now unique per paragraph; the slide number remains in raw["slide"].
  • Regression tests: unique indices across a slide; sanitizing a deck redacts only the notes and keeps "Visible slide content".

2. DET-009 speaker_notes (detection gap)

Speaker notes were already parsed (element="notes") and are read by any extractor/LLM, but nothing scored them. A deck whose only injection was a plain-text note scanned with 0 findings and was judged safe/allow.

  • HIGH for an explicit override / "do not tell" payload, MEDIUM for a system-addressed or verdict-directing note; the notes run is defused on quarantine.
  • Generic reminders ("update the roadmap slide") are not reported.
  • Trust labeling treats it as concealment (structure), so it can never score safe.
  • Wired into ALL_DETECTORS, README/README.ja tables, SECURITY scope, and the list-detectors e2e assertion.

3. DET-008 evaluation artifacts made reproducible

Two rows of the measured table had no committed artifact; now they do:

  • AMBIGUOUS_CORPUS pinned in tests/detectors/test_comment_directive.py (the 4 legit notes that are reported on purpose). The docs now call them accepted false positives, not detections.
  • scripts/probe_comment_directive.py — the live false-positive probe, committed. Build output is excluded by default (--include-build to include it). It counts exactly the full-line comments the detector reads and runs the shipped run_scan().
  • Figures updated to what the committed script produces: 106 files / 738 comment lines, 0 findings. The old "167 files / 4,643 comment lines" came from including dist/ build output and from a looser comment-line definition (with --include-build the probe reports 168 files).
  • DET-008 detector docstring said "0/45 benign comments"; the corpus holds 46.

Verification

pytest        # 339 collected (2 skipped), all pass
ruff check src tests
mypy src

Also re-ran the local adversarial corpus against this branch: the notes-only deck that used to scan clean is now dangerous (DET-009), the PPTX sample keeps its slide text after sanitize --mode redact, and the clean controls are still safe/allow.

…evals

Two fixes chosen from a review of the DET-008 write-up, plus a new detector.

PPTX paragraph coordinates (bug):
  PptxParser used the slide number as TextParagraph.index, so every text box
  and the notes on a slide shared one coordinate. A single hidden run therefore
  matched every run on that slide and `sanitize --mode redact` replaced the whole
  slide with [REDACTED]. Indices are now unique per paragraph; the slide number
  stays in raw["slide"]. Regression tests assert unique indices and that only the
  notes run is redacted.

DET-009 speaker_notes (gap):
  Notes were already parsed and are read by any extractor/LLM, but nothing scored
  them, so a deck whose only injection was a plain-text note scanned clean and was
  allowed. DET-009 reports a note that instructs a reader: HIGH for an explicit
  override / "do not tell" payload, MEDIUM for a system-addressed or
  verdict-directing one; the notes run is defused on quarantine. Generic reminders
  are not reported. Trust labeling counts it as concealment (structure).

DET-008 evaluation artifacts (reproducibility):
  - AMBIGUOUS_CORPUS pinned in tests/detectors/test_comment_directive.py (4 legit
    notes that are reported on purpose; counted as accepted false positives).
  - scripts/probe_comment_directive.py, the committed live false-positive probe;
    build output (dist/...) is excluded by default, --include-build restores the
    older, larger 168-file figure. The README/coverage numbers now come from these
    artifacts (106 files / 738 comment lines, 0 findings) instead of the
    unverifiable "167 files / 4,643 comment lines".
  - DET-008 detector docstring said 0/45 benign comments; the corpus holds 46.

README/README.ja detector table and counts, SECURITY directive-bypass scope,
CHANGELOG Unreleased, Makefile `probe` target, and the test-count badge (339).
@sscodeai
sscodeai merged commit ccf8a41 into main Oct 19, 2026
2 checks passed
@sscodeai
sscodeai deleted the fix/eval-artifacts-and-pptx branch October 19, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant