WIP: Harden booklet validator contract #5
Loading…
Reference in a new issue
No description provided.
Delete branch "audit/validator-contract"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Scope
Hardens booklet validation around semantic completeness, normalized cross-artifact reconciliation, strict canonical HTTPS/QR policy, path containment, and decoded image integrity. Adds focused behavior fixtures before implementation, requires non-empty source candidate websites while respecting the generator's explicit website override, and excludes commented TeX commands from semantic reconciliation and asset/imposition scans.
No political roster or candidate content was changed.
CI root cause and remediation
Forgejo run 19 on
0703207failed duringmake generate: the network-backed generator could not resolvebentrumanforcongress.com, so generation exited before validator or PDF build steps. The branch now contains signed merge commitec000a8, which integrates committed, content-addressed Git LFS media and its digest manifest. Normalgenerate,validate, andbuildresolve reviewed local media only; remote fetching is isolated to the explicitmake refresh-mediaoperation.Verification
git lfs pullcompletedmake generatepassedmake testpassed: 32 testsmake validatepassedmake buildpassed: 8-page digital and 4-page imposed print PDFsuv run --offline --with ruff ruff check scripts/validate_booklet.py tests/test_validate_booklet.pypassedpython3 -m py_compile scripts/validate_booklet.py tests/test_validate_booklet.py scripts/generate_booklet.py scripts/media_inputs.py scripts/refresh_media.pypassedgit diff --checkand generated-source reproducibility checks passedgit verify-commitLive CI and integration status
ec000a8bafc1ec22efa620b9d9afac45008a65b4is green: the sole requiredBooklet CI / Validate and build booklet PDFs (pull_request)status completed successfully in 18m45s at Forgejo Actions run 22 (internal run 3551), 2026-07-12 20:35 ET.mergeable: false, butorigin/main(5058059) is an ancestor of the exact head andgit merge-tree --write-tree origin/main ec000a8is clean. No merge was attempted; this remains a Forgejo integration-state discrepancy, not a Git conflict.Review
Independent review requested from @mehalter after the final CI result.
Tracks kanban task
t_d9dd0c1b.8424be0be54275830301test: enforce booklet validator contractto WIP: Harden booklet validator contractValidator/content-scope blocker remediation is pushed for independent review.
Signed logical commits:
3fc448f839df5c50b14b5fe83d8064171c26e704— reject animated/multi-frame media25b6eb2bc93c0c002b3c1ec6d39840e200dd0588— remove political/content edits from this validator PRStill-image contract evidence:
ffprobe_nb_read_frames=4;validate_still_image=False.-xerrorto decode the full selected stream rather than stopping after frame 1.Verification at head
25b6eb2:make test: 35 tests passed.ruff check scripts/validate_booklet.py tests/test_validate_booklet.py: passed.python3 -m compileall -q scripts tests: passed.git diff --check: passed.data/ballot_data.json,data/render_data.json, anddata/shortio-candidate-links.jsonexactly match fetchedorigin/main; they are absent from the PR diff.Practical content gate after restoring current input:
make generate: exit 0.python3 scripts/validate_booklet.py: exit 1, correctly reporting legacy non-HTTPS entries for the Dana Barrett, Penny Brown Reynolds, and Shelia Edwards links (including the corresponding short-link records).make: exit 2 at the validation prerequisite for the same reason; PDF compilation is intentionally blocked.Those URLs now require politically authorized input remediation. This validator-only task deliberately does not alter them or weaken the HTTPS/QR contract.
Forgejo CI was still
pending/Waiting to runafter a bounded five-minute poll, consistent with shared-runner queue contention.Narrow multi-stream still-image remediation pushed at signed head
4e9a948d23c6423d4429bc0a067d665c67ce22a5.scripts/validate_booklet.pynow probes every video stream (-select_streams v), rejects containers unless exactly one video stream with exactly one decoded frame is present, and fully decodes all accepted video streams (-map 0:v).tests/test_validate_booklet.pygenerates a Matroska payload saved with a.pngname containing two independent one-frame PNG streams and proves rejection.Verification:
True.make test: 36 tests passed in 19.209s aftergit lfs install --local && git lfs pull.git diff --check, and merge-tree against fetchedorigin/mainpassed.nb_read_frames=1each; validator returnedFalse.make generatepassed; validation and build stopped at the expected legacy-HTTP gate for Dana Barrett, Penny Brown Reynolds, and Shelia Edwards without content edits or policy weakening.Please re-review the new signed head. The new exact-head Forgejo run is queued / Waiting to run; this is shared-runner contention, not a code failure.
Ci/cd isn't passing
Closing without merge because the owner cancelled the
code-security-audit-2026-07campaign. This does not revert previously merged work.Pull request closed