Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Who this helps
CI/CD engineers and Python SDK consumers uploading test coverage or connecting over MCP behind HTTP proxies benefit in two ways:
upload_coverage_files/read_coverage_files): Previouslysdk-pythononly exposed the low-levelupload_coverage_reports(body=...)wrapper whilesdk-typescriptalready provideduploadCoverageFiles(readCoverageFiles). Worse, the README example usingPath.read_text(encoding="utf-8")silently stripped\r\ninto\nunder Python universal newlines—corrupting CRLF coverage reports. NowProoflineClient.upload_coverage_files,AsyncProoflineClient.upload_coverage_files, andread_coverage_files:tested_sha,1..50report bounds, and unique relative POSIX names before sending a request.root, reject non-regular files, and fail fast with clearValueError/FileNotFoundErrorerrors.read_bytes().decode("utf-8")) so BOMs and\r\n/\nline endings stay verbatim, enforce the 30 MiB serialized JSON limit pre-upload, and offload disk I/O toanyio.to_thread.run_syncinAsyncProoflineClient.proofline/_mcp.py):_decodepreviously comparedcontent-typemedia types case-sensitively (!= "application/json"), rejecting valid headers likeApplication/JSON; charset=utf-8even thoughproofline/exports.pyalready handled media types case-insensitively.What changed
proofline/coverage.py: AddedCoverageFile,read_coverage_files, path/symlink containment checks, pre-read size budget checks, strict UTF-8 byte-preserving decode, and post-serialization 30 MiB check.proofline/client.py: Addedupload_coverage_filesto bothProoflineClientandAsyncProoflineClient(anyio.to_thread.run_sync).proofline/__init__.py: ExportedCoverageFileandread_coverage_files.proofline/_mcp.py: Normalized extractedContent-Typemedia type with.lower().scripts/contracts.py: Registeredupload_coverage_filesinhelpersand verified operation & claim-vocabulary contracts.README.md: Documentedupload_coverage_files/CoverageFile/read_coverage_files.tests/test_coverage.py: Added sync/async upload tests, verbatim BOM+\r\npreservation, validation/symlink/size/encoding failure tests, server problem propagation, and mixed-case MCPContent-Typetests.How I verified it
Verified in
.venv(Python 3.13.2, pinnedrequirements-dev.txtpackages):ruff check .— all checks passedruff format --check proofline/coverage.py proofline/client.py proofline/_mcp.py proofline/__init__.py scripts/contracts.py tests/test_coverage.py— passedpython scripts/contracts.py— passed (Python operation and outcome-vocabulary contracts passed.)mypy proofline scripts—Success: no issues found in 230 source files(andmypy --follow-imports=silent tests/test_coverage.py— 0 issues)pytest -q tests/test_coverage.py tests/test_exports.py tests/test_generated_operation.py—22 passed, 1 skipped(symlink test skips cleanly when unprivileged Windows disables symlink creation)pytest -q -k "not test_body_stream_deadline_does_not_turn_authority_into_timeout"—220 passed, 1 skipped, 4 deselectedtest_body_stream_deadline_does_not_turn_authority_into_timeout[403-sync]intests/test_http.pyhits the known Windows socket timing race tracked in On Windows, wait_for_review sometimes raises a timeout error instead of returning TIMED_OUT #89 / fix(client): treat timeout errors near deadline as TIMED_OUT on Windows #100 on untouchedmain.)python -m build --no-isolation --outdir <temp>— builtproofline_sdk-10.2.3-py3-none-any.whlandproofline_sdk-10.2.3.tar.gzcleanly