Commit graph

4 commits

Author SHA1 Message Date
jedarden
1c6f26ecaa fix(bf-4mkhv): clean up unused imports in hash.rs
The bead description mentioned compile errors in hash.rs from API drift,
but those errors were either already fixed or misattributed. The API usage
was already correct:
- compute_fingerprint already takes 3 arguments with source
- len() already propagates Result with ?
- read_at method already used correctly
- Catalog fields accessed via trailer correctly

Only cleanup: removed unused std::fs::File and std::io imports.

Verification: notes/bf-4mkhv.md
2026-06-01 09:43:48 -04:00
jedarden
895f1ce43d fix(bf-1avnz): remove .code field access on String diagnostics in serve.rs
Fix two compilation errors at lines 584 and 658 where code was calling
.code on &String diagnostics. Replaced d.code.to_string() with direct
Vec<String> clone since diagnostics is already Vec<String>.

Accepts criteria:
- cargo check -p pdftract-cli emits no 'no field code' errors
- serve.rs compiles cleanly
2026-06-01 04:14:05 -04:00
jedarden
778d9e4c13 feat(pdftract-69iwi): implement remote source mock server test corpus
Add wiremock-based integration test infrastructure for HttpRangeSource with
bandwidth tracking and all 5 critical test scenarios from plan Section 1.8.

## Files added
- tests/remote/fixtures/generate_linearized.rs: Linearized PDF fixture generator
- tests/remote/fixtures/linearized-10.pdf: 10-page linearized PDF with hint stream
- tests/remote/integration.rs: Complete test suite with 12+ test scenarios
- notes/pdftract-69iwi.md: Verification note with PASS/WARN/FAIL status

## Test infrastructure
- BandwidthTracker utility for bandwidth and request counting
- Mock server factories: create_range_server(), create_no_range_server(),
  create_416_server()
- Verification helpers: assert_bytes_transferred(), assert_range_request_count()

## Critical tests implemented (Plan 1.8)
1. test_range_support_page_5_of_100: Bandwidth verification (<100KB)
2. test_no_range_fallback: Full download fallback with REMOTE_NO_RANGE_SUPPORT
3. test_416_retry_without_range: 416 response handling infrastructure
4. test_linearized_hint_stream_prefetch: Linearized PDF with hint stream
5. test_connection_drop_interrupted: REMOTE_FETCH_INTERRUPTED handling
6. test_tls_handshake_failure: Self-signed cert rejection (rcgen)

## INV-8 compliance
All tests verify no panic occurs on network errors, connection drops, or TLS
failures. Errors return Result<> types with appropriate ErrorKind.

## Dependencies
- wiremock 0.6 (mock HTTP server)
- rcgen 0.13 (self-signed TLS certificate generation)
- tokio 1.x (async runtime)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 08:25:23 -04:00
jedarden
38d1deb57c wip: intermediate state from previous work 2026-05-29 08:25:23 -04:00