Repository navigation
fix: Guard transcript path probes and sanitize parser errors - #815
Draft
buildingjoshbetter wants to merge 2 commits into
Draft
buildingjoshbetter wants to merge 2 commits into
buildingjoshbetter wants to merge 2 commits into
Conversation
This was referenced Oct 8, 2026
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.
Scope
Fix the reproduced recurrence of #306, stacked on the detailed parser-outcome foundation in #798. This draft covers transcript source classification and parser diagnostics. Codex native grammar (#762) and durable ingestion completion (#768) remain separate.
Reproduction and correction
On macOS Python 3.13, the legacy parser raises ENAMETOOLONG for a long inline transcript because filesystem probes occur outside its guard. Both the exception filename and rendered exception contain the complete inline input. The closed issue's prior resolution did not cover this runtime behavior. The reproduction used a generated JSON message with a 600-character payload; no real transcript was read.
A first candidate caught the probes, but additional review identified a cross-version gap: Python 3.14 makes exists/is_file return false on all operating-system errors. Catching those methods therefore cannot reliably distinguish an inaccessible source from inline content. The first candidate and its passing suite remain preserved as insufficient evidence.
The existing detailed-outcome test changes only its denied-probe injection from exists to stat. Its assertions remain intact. A new suite tests both public APIs, Python 3.14 suppression, real synthetic files, missing/read-race behavior and sentinel-free diagnostics.
Validation
613c3820323a3b4045c07d2b78e2306ab7aa547508e3503309356265821f57af.c0af6173bba2b27a86c5f9d73e0c831a33f2efc76cc96ec4513d7e8b8eaad0e9.f0813a3f5165aeade5b2a8b83d77373939e1a91b.Compatibility and limits
A nonexistent string or a string naming a nonregular object can still be inline under the existing API contract; callers requiring file-only interpretation use Path. This draft does not authenticate source identity or prove that any real transcript was logged or transmitted. It removes the demonstrated parser diagnostic exposure path.
Only synthetic data was used. No personal memories, transcripts or credentials were exported. No main merge, package publication, release or issue closure.
Reference: Python 3.14 pathlib error behavior.
Hosted diagnostic compatibility follow-up
The initial head
061eb0a31f495a0ed13ec97d646f532111e85a2ffailed the existing real unreadable-file test on nonroot hosted runners. Its assertion requires the fixed phrase “Cannot read transcript”; the candidate used a different fixed phrase. The GPUBox root suite skipped this chmod test because root bypasses mode 000. The retained Ubuntu Python 3.12 job is113582779433; log SHA256 isd29c843169f0fe99b0e230f2b51c53a724f25bc6a8feec2e89c762b59adac7c8.Follow-up
f0813a3f5165aeade5b2a8b83d77373939e1a91brestores the expected fixed phrase at both logging sites, without source text, path, exception arguments or traceback. The existing permission test remains unchanged. The portable privacy cases now also assert the existing diagnostic phrase. All 10 focused stdlib tests pass.An unprivileged GPUBox container ran the unchanged chmod test, the full new parser-boundary module and the detailed-outcome module: 43 passed, 64 subtests passed, zero skips. Effective nonroot identity was asserted before pytest. Log SHA256:
314da972ba62cd9fd51e5c54c337953907382cfc54c71092f2a3015aa5c49366. Whitespace, Ruff and scoped privacy checks pass. The earlier full suites belong to the earlier exact head; this bounded follow-up changes only two fixed log strings and adds one assertion.