Skip to content

A folder grant settles the other open asks it covers - #1068

Merged
ualtinok merged 3 commits into
mainfrom
land/folder-grant-covered-asks
Oct 28, 2026
Merged

ualtinok merged 3 commits into
mainfrom
land/folder-grant-covered-asks

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Allowing a whole folder from a permission card (allow_scope) used to leave sibling asks for paths inside that folder waiting for their own answers. In the specimen, two parallel reads were filed 8 ms apart, and allowing the folder on the first card left the second card waiting. Now, once a folder grant is stored, AFT withdraws every other live ask it truly covers: same session, same scope (owner, ref and epoch), same kind of access, and a path inside the folder. The withdrawn card leaves the phone, and its waiting call runs under the stored grant.

If the user answered a covered card at the same moment, Cingulate's withdraw returns the settled record and that answer stands. Asks for other folders, other access kinds, other sessions or other scope epochs stay pending. One info log line per withdrawn ask names the covering ask, and logs only a hash of the folder path.

Withdraw vectors come from Cingulate tool-permission-v1 (04b7cbd). Tests: covered sibling settled and withdrawn; uncovered cases stay pending; the withdraw race keeps the recorded denial; the log line. The tests pick each consent request by file name, because parallel requests arrive in either order. 135 consent tests pass three times in a row on Linux; Windows target check passes.


Summary by cubic

Allowing a folder grant (allow_scope) now settles and withdraws other open asks for paths inside that folder (same session, scope, and operation), so sibling cards no longer wait for a second answer. Asks for other folders, operations, sessions, or scope epochs stay pending. If a covered ask settled at the same moment, its recorded outcome stands. Each withdrawn ask logs one info line naming its covering ask, with only a hashed path.

Written for commit b7145fd. Summary will update on new commits.

View guided diff Turn on auto-fix

ualtinok and others added 3 commits October 28, 2026 00:47
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
(cherry picked from commit c0fedb7cd3c05c5ba7f8f9c309114b8aa4481c01)
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Two parallel reads file their consent requests in either order, so taking
the first request answered the wrong file about half the time
(consent_folder_grant_leaves_uncovered_asks_pending failed on the build
server). The tests now pick each request by its file name.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 7ba277f Oct 28, 2026
92 checks passed
@ualtinok
ualtinok deleted the land/folder-grant-covered-asks branch October 28, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant