Conversation
This was referenced May 26, 2026
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.
Experimental Status
Experimental work: this PR is part of an exploratory contract/generated docs and SDK effort, and is intentionally kept as a Draft while the approach is validated.
Why: this is the Java companion canary for the API2 contract generator work. API2 owns the TUS protocol contract; this PR proves tus-java-client can consume generated protocol facts and contract-owned scenarios without duplicating wire knowledge in the Java repo.
What changed:
TusProtocol.DEFAULT_PROTOCOL_VERSIONfrom the API2 TUS wire contractTusClient.TUS_VERSIONfrom that generated constantLocationresolution, PATCH method override, file URL storage, retry state transitions, detailed create-upload errors, start-option validation, abort upload, parallel concat, protocol version selection, and node path input sourcesTusClient.createUploadWithData(TusUpload, int)for Creation With UploadTusURLFileStoreas a persistent file-backedTusURLStoreTusExecutorretry hooks and retry-attempt reset support while preserving the existing default retry behaviorTusDetailedError,TusResponseException, andTusRequestExceptionso callers can inspect response/request failures with original request contextTusStartOptionsandTusClient.validateStartOptions(...)so callers can validate typed start options before issuing any requestTusClient.abortUpload()/TusClient.abortUpload(TusUploader, boolean)plusTusUploader.abort()/TusUploader.isAborted()so Java can abort in-flight uploads and optionally terminate stored URLsTusClient.createPartialUpload(...)andTusClient.concatenateUploads(...)so Java can prove TUS concatenation with public SDK APIsTusClient.setProtocol(...)/TusClient.getProtocol()so Java can select generated client protocol modes such astus-v1andietf-draft-05Api2DevdockTusNodePathInputSource, which proves the contract-ownednode-path-referencescenario through Java's existingTusUpload(File)source primitiveLatest update:
tusNodePathInputSourceto Java as the twenty-fourth TUS Java checked proofcontent, sonode-path-referenceuses the same validation path asblobValidation:
./gradlew check --rerun-tasksgit diff --checknode api2/bin/cli.ts contracts sdks --no-motd --target tus --platform java --sdk-root ../tus-java-client --compare-existingnode api2/bin/cli.ts contracts sdks qa --no-motd --target tus --platform java --dry-runcore/bin/devdock.ts exec tstrun cmds/ContractsCommand.vitest.ts -vv --max-time-per-test 420yarn checkUploaderProcessdid not emit its ready pattern within 120s; this is recorded on the API2 side for follow-up.Companion PRs (tus org only)
Notes
Local/API2 clone-based validation is the strongest signal because it exercises the generated contract path and live devdock API2/tusd stack. The latest direct Java conformance proof passed; the latest clone-based live proof is blocked by API2 uploader readiness before any example runs.