procurement-ingest/lambdas/po/email_processor/tests/fixtures/expected
Adam Moussa ffa8a625a7
Scrub fixture-body PII and harden cancellation gate (sec review)
/sh-security-review of PR #105 (5 fresh-context detectors + proof-or-kill
verifier) confirmed two diff-introduced findings; both fixed here.

F3 (medium, real PII in new fixtures): the harvest scrub replaced header
tokens but left real third-party PII in message BODIES -- an Amazon
contact's name/phone/personal email in non-coupa-02.eml and an internal
t.corp.amazon.com ticket URL in comment-02.eml, plus real submitter/attn
names recurring across the new_po corpus. Replaced every personal name,
phone, personal email, and internal URL with synthetic placeholders
(QP-soft-wrap aware) across both .eml bodies and expected goldens.
Extended test_fixture_hygiene to scan BODIES (phone shapes, corp URLs,
the leaked tokens), closing the header-only gap that let this through.

F1 (medium, cancellation gate): _CANCELLATION_SUBJECT was unanchored and
matched with .search(), unlike the anchored new_po pattern -- a subject
merely ending with the cancellation phrase could be routed to the sticky-
Cancelled write. Fully anchored it and switched to .match, and added a
body-corroboration gate (the real Coupa body independently restates
'Purchase Order #<po> ... has been cancelled'); a near-miss/misrouted
subject whose body does not corroborate now fails closed to the LLM
(new reason code cancellation_body_unconfirmed).

Pre-existing (advisory, not this PR): the LLM-fallback else->save_new_po
dispatch and undelimited extraction prompt (issue #101 family) are
byte-identical to main and unchanged here.

401 tests pass; ruff/format clean; cdk synth po-ingest clean.
2026-07-16 17:17:35 -04:00
..
cancellation-01.json Add offline PO parser suite with scrubbed fixture corpus 2026-07-16 15:15:49 -04:00
cancellation-02.json Add offline PO parser suite with scrubbed fixture corpus 2026-07-16 15:15:49 -04:00
cancellation-03.json Add offline PO parser suite with scrubbed fixture corpus 2026-07-16 15:15:49 -04:00
cancellation-04.json Add offline PO parser suite with scrubbed fixture corpus 2026-07-16 15:15:49 -04:00
cancellation-05.json Add offline PO parser suite with scrubbed fixture corpus 2026-07-16 15:15:49 -04:00
cancellation-06.json Add offline PO parser suite with scrubbed fixture corpus 2026-07-16 15:15:49 -04:00
cancellation-07.json Add offline PO parser suite with scrubbed fixture corpus 2026-07-16 15:15:49 -04:00
cancellation-08.json Add offline PO parser suite with scrubbed fixture corpus 2026-07-16 15:15:49 -04:00
new-po-01.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-02.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-03.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-04.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-08.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-09.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-10.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-11.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-12.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-13.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-14.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-15.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-16.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-17.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-18.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-19.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00
new-po-20.json Scrub fixture-body PII and harden cancellation gate (sec review) 2026-07-16 17:17:35 -04:00