Repository navigation
shell: writable's probe is never named twice in a process (#760) - #835
Open
kitokey-marc[bot] wants to merge 4 commits into
Open
kitokey-marc[bot] wants to merge 4 commits into
kitokey-marc[bot] wants to merge 4 commits into
Conversation
…the last one's deletion (#760, red) `probe` taken out of `writable`, as it was. Its name kept taken after removal — a folder in its place, as Windows keeps a name whose deletion is pending (#705) —, the second probe must still be made, under another name. Red: one name per process. Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As the trial's file beside the day (#759): a count for the process in its name, the file made new, one left under the same number passed over. On Windows a name whose deletion is pending refuses to be made again (#705); a second probe no longer meets the first one's name. Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-named-twice The e2e finds a start's tray item in a second: this branch's attest saves about 20 minutes. Agent-Session: 14f73956-90b9-46a3-9fcc-52dc45c43948 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
shell: writable's probe is never named twice in a process
Closes #760.
Module
modules/shell— exactly one.cross-modulelabel is required, justification belowDeliverable
Out of cycle: #760, found by the independent verifier of #759 and taken from ines's backlog triage (2026-11-14). It bears on D93 criterion 4 on Windows: the meeting's folder said not writable.
What it changes
sessions::writablewrote and then removed.kitokey-writable-<pid>, the same name on every call. On Windows, a name whose removal is still pending answers « Access is denied » when it is made again (shell: on Windows, starts at once can fail the trial's day with « Access is denied » #705). A second call in the same process could therefore find a writable folder not writable. This has not been observed yet.probemakes a new file named.kitokey-writable-<pid>-<count>, where the count is kept for the process (AtomicU64). A file that an earlier Kitokey left under the same number is passed over (AlreadyExists).trial.rs,beside).tempfile::NamedTempFilewas the other way, and it is the field's convention. In the shell, though,tempfileis a dev-dependency only, so using it insrcwould add a runtime dependency (the security playbook). The counter adds none.writable's behaviour is otherwise as before: it makes the folder, writes the probe, removes it, and returns the first error.Oracle
sessions::tests::a_second_probe_does_not_wait_on_the_first_ones_deletion(cdca9f5).writablemust then pass.src/sessions.rs:333(probe(…).unwrap()) on the name the first one had taken.cargo test --lib sessions::passes 2 of 2, andtests/sessions.rspasses 12 of 12.a_probe_left_in_the_folder_is_passed_over, as shell: a name beside the trial's day is never given twice (#705) #759's: fifty names under this process's number taken, the probe made under another. Without theAlreadyExistsbranch, it fails.Kind of oracle: a unit test, in the module, as #759's.
Review budget
Contracts
Definition of Done
cargo fmt --check,cargo clippy --all-targets -D warningsfetch_add→load) fails the first test at the second probe;AlreadyExistsbranch fails the second test.tests/migrate.rs::a_model_written_from_home_is_named_where_it_went. That test writes in$HOME, which this sandbox refuses; it fails the same way onmain, and shell: the test of a model written from the home uses a home of its own #819 fixes it.probe's comment says why its name changesTest sheet
Verifier: session bfdb23f1-1199-4cda-ab11-22e178326643
writablepassescargo test --locked --lib sessions::at 467e94f, run by me on Linux:a_second_probe_does_not_wait_on_the_first_ones_deletionok, 2 passed;--test sessions12 passed. Windows: run 43619901365, head 467e94f, job Windows — shellcargo testsuccess. Hand mutantfetch_add→load(the count fixed): both tests failed, killed.467e94fa_probe_left_in_the_folder_is_passed_overok at 467e94f, run by me. Windows: run 43619901365, head 467e94f, job Windows — shellcargo testsuccess. Hand mutantAlreadyExists => continue→return Err(error): that test failed, killed. Hand mutant, the probe no longer removed: the unit tests pass,tests/sessions.rsa_folder_of_sessions_is_writable_or_said_not_to_be_and_nothing_is_left_in_itfails, killed.467e94fVerifier's remarks: S1's pending deletion is played on Linux by a folder in the name's place, which answers
AlreadyExists; Windows answers a name whose deletion is pending with « Access is denied » (PermissionDenied), whichprobereturns as an error, not passed over. Within one process the count never meets it; a probe of an earlier Kitokey under the same process number and count, its deletion still pending, would makewritablefail — rare, not exercised. A probe left by a Kitokey stopped between its making and its removal now stays in the meeting's folder under its own name, where the old one was written over by the next call.Summary
DONE
sessions::probe: a name never given twice in a process, the file made new, one left under the same number passed over.VERIFIED
maintoo.ASSUMED
NOT VERIFIED
RISKS
.kitokey-writable-<pid>-<n>) are not cleaned. The same was true of the old name.Signals to report
🤖 Generated with Claude Code