Repository navigation
Conversation
…for third-party portal read-back
Independent adversarial review: REQUEST CHANGESFrom: Claude I read the full diff and ran the module at this head against hand-built PDFs (stdlib only, no network). P0: the PDF oracle returns
|
|
|
||
| # Match both single literal `(text) Tj` and array `[(a) -20 (b)] TJ` | ||
| token_re = re.compile( | ||
| r"\(((?:\\.|[^\\()])*)\)\s*Tj|\[((?:[^\[\]]|\((?:\\.|[^\\()])*\))*)\]\s*TJ", |
Independent adversarial review: REQUEST CHANGESFrom: Grok Head confirmed open and unchanged versus this SHA. I claimed the review in openadapt-internal#211 (7093104720). I read the full diff and the module at this head. Claude already posted REQUEST CHANGES (7092953946) at this same head; this is a cross-vendor pass. I independently confirmed those findings from the source, and I am adding two more fail-open notes. Independently confirmed (agree with Claude)
Additional findings
Review only; I will not merge this PR. |
Summary
Adds fail-closed independent read-back oracles in
packages/verify/src/openadapt_verify/portal_readback.pyfor third-party web portals where direct SQL or backend API access is unavailable:FreshReloadSummaryOracle: Requires explicit fresh navigation/reload proof (navigation_type in {"reload", "fresh_navigation", "new_session"}plus non-empty, distinctsubmit_dom_token != summary_dom_token) and diffs extracted summary fields against the expected intake record. Stale in-memory DOM without reload proof ->HALT; missing required field ->ABSTAIN(overallHALT); field mismatch ->REFUTED(overallHALT).ConfirmationPdfOracle: Extracts persisted field values from a downloaded quote/submission confirmation PDF using Python stdlib only (supports uncompressed andFlateDecode-compressed PDF streams,Tj/TJoperators, and PDF string escapes), normalizes currency/dates/booleans without blurring look-alike identifiers, and diffs every agreed field with per-field provenance and SHA-256 artifact digest. Fail-closedHALTon missing/corrupt/unreadable PDF, missing required fields (ABSTAIN), or field mismatch (REFUTED).ConfirmationPdfOracle,FieldCheck,FreshReloadSummaryOracle,PortalReadbackResult, andReloadProoffromopenadapt_verify.packages/verify/tests/test_portal_readback.py. Zero touches topackages/types/and zero new dependencies.Generality Gate
field_labels,field_patterns, andfield_types.ABSTAIN), corrupt PDFs, or mismatched values (REFUTED) deterministically returnHALT.Verification
pytest -q packages/verify/tests/test_portal_readback.py-> 18 passedruff check&ruff format --check-> cleanmypy --follow-imports=silent --explicit-package-bases-> 0 errorspython scripts/check_source_boundary.py-> OKgitleaks detect --no-git-> 0 leaks