Complete native file reads and verify existing memory #143

Merged
ClaudiuSchuster merged 1 commit from oss-oo/native-file-reads-20261018-4b72 into main 2026-10-18 08:51:50 +00:00
Owner

Native file reads could stop at a truncated text prefix or report an empty file when the provider omitted a large blob. This change provides immutable, lossless byte continuation for get_file and memory_read, with explicit offsets and end-of-file state. Small UTF-8 responses retain their existing shape; legacy memory character offsets remain supported.

Every continuation rechecks the caller's native repository access and the pinned file identity, then reads only the requested raw byte range. Binary files retain their original bytes. Encoded or inconsistent upstream responses are refused. The provider may still perform internal blob reads or range skips; this does not claim constant server-side work.

memory_append verifies the complete existing bytes before writing and retains the expected-old-SHA conflict check, so omitted or malformed old content cannot be mistaken for an empty file. Existing write policy limits and the separate public plugin remain unchanged.

Validation: 196 repository tests and 25 independent real-HTTP contracts pass in both normal and optimized Python. All 35 file-read tests also pass on the native test host. The exact-tree full E2E run passed against the deployed Core image, including full reconstruction above the native 10 MiB contents threshold, an actual conflicting append, and the same pinned cursor resuming after the real read-budget refusal. Lower provider thresholds and SHA256 object variants are covered by contract fixtures. Production deployment remains a separate acceptance step.

Native file reads could stop at a truncated text prefix or report an empty file when the provider omitted a large blob. This change provides immutable, lossless byte continuation for `get_file` and `memory_read`, with explicit offsets and end-of-file state. Small UTF-8 responses retain their existing shape; legacy memory character offsets remain supported. Every continuation rechecks the caller's native repository access and the pinned file identity, then reads only the requested raw byte range. Binary files retain their original bytes. Encoded or inconsistent upstream responses are refused. The provider may still perform internal blob reads or range skips; this does not claim constant server-side work. `memory_append` verifies the complete existing bytes before writing and retains the expected-old-SHA conflict check, so omitted or malformed old content cannot be mistaken for an empty file. Existing write policy limits and the separate public plugin remain unchanged. Validation: 196 repository tests and 25 independent real-HTTP contracts pass in both normal and optimized Python. All 35 file-read tests also pass on the native test host. The exact-tree full E2E run passed against the deployed Core image, including full reconstruction above the native 10 MiB contents threshold, an actual conflicting append, and the same pinned cursor resuming after the real read-budget refusal. Lower provider thresholds and SHA256 object variants are covered by contract fixtures. Production deployment remains a separate acceptance step.
feat(gateway): complete native file and memory reads
All checks were successful
access-validation-contract / contract (pull_request) Successful in 3m24s
ci / ci (pull_request) Successful in 3m56s
fdbfa786b9
ClaudiuSchuster changed title from WIP: Complete native file reads and verify existing memory to Complete native file reads and verify existing memory 2026-10-18 08:51:35 +00:00
ClaudiuSchuster deleted branch oss-oo/native-file-reads-20261018-4b72 2026-10-18 08:51:50 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OSS-OO/laboratory!143
No description provided.