Repository navigation
Conversation
The spec in #1341 depends on two facts that had not been checked. The first is that the extension can read the engine's decrypted record frame with the public stack-encrypt API. The second is the sync contract: an interrupt waits for a GIL-released call, and a dropped Pending wipes its plaintext. Both facts hold. A Sink written outside the engine reads the frame. A probe function behind an off-by-default cargo feature is sent SIGINT during the call. The interrupt arrives after the call returns. The wipe is from source reading only. The issue's wording of the first fact is corrected: a sealed value's kind is inside its encryption, so the kind is read after decrypting. The findings, how to run each probe again, and what was not tested are in languages/python/docs/. Refs #1384 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
) The codes follow the amendment on #1341. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Summary
The Python SDK spec (#1341) depends on two facts about the engine that nobody had checked. This PR checks both, with a probe for each, and records the results in
languages/python/docs/gate-facts/. Both facts hold. No SDK code changes, and the normal wheel build is unchanged.The engine is the Rust crate
stack-encrypt. The engine encrypts and decrypts. The extension is the Rust code compiled into the Python package. Python calls the extension, and the extension calls the engine.KeyboardInterrupt) during an engine call is raised only after the call finishes. Also, a request object (Pending) that is dropped early wipes the plaintext it contains.Changes
crates/core/tests/gate_frame_reader.rs: the probe for fact 1. A reader written outside the engine walks a record and records each field's type.crates/engine/src/lib.rsandcrates/engine/Cargo.toml: the probe for fact 2. A function that blocks with Python's global interpreter lock (GIL) released, behind a new cargo feature,gate-probe. The feature is off by default, so the function is not in a normal wheel.tests/test_gate_keyboard_interrupt.py: sends Ctrl-C during that call. The tests skip themselves when the feature is not built.docs/gate-facts/frame-reader.mdanddocs/gate-facts/keyboard-interrupt.md: the findings, how to run each probe again, and what was not tested.Cargo.lock: one line, fortokioas an optional dependency of the probe feature.Verification
All of this was run on macOS 14 (arm64) with Python 3.14.7:
cargo test --locked -p stackencrypt-core --test gate_frame_reader: 2 passed.--features gate-probe: 2 passed. Ctrl-C was sent 0.2 seconds into a 1-second call. The interrupt was raised after 1.01 seconds. As a control, the same signal interrupted a plain Pythontime.sleep(1.0)after 0.21 seconds.mise run test: 4 passed and 2 skipped. The 2 skipped tests are the probe tests, in a normal build.mise run test:cargoandcargo fmt --check: both pass.cargo clippy -D warnings, with and without the probe feature: passes.pnpm run test:scriptson Node 22: 83 of 83 test files pass.Not tested:
Related
Closes #1384. Refs #1341 (the spec). Stacked on #1406.
Review notes
Start with the two files in
docs/gate-facts/. Each one says what was checked, how, and what was not.🤖 Generated with Claude Code