fix(policy): revalidate current semantic state at dispatch - #103
Draft
seonghobae wants to merge 5 commits into
Draft
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Partial implementation of #28, stacked on exact PR #102 head
c751865412d5642357203f917f16c6c2bbd12324.Buyer/correctness gap
PR #96 makes browser-authority revalidation and adapter callback invocation one call, and PR #102 adds exact current semantic-observation revalidation at the core target boundary. Those checks were still independently callable: the policy dispatch boundary could validate session/context/origin/document epoch and invoke the adapter while ignoring a same-document semantic change such as the target becoming disabled, the selected action disappearing, or a different node being observed.
This slice composes one freshly supplied semantic observation into the policy-authorized dispatch boundary so that stale same-document semantic state cannot be ignored immediately before the callback.
Dependency
This Draft targets PR #102 branch
fix/semantic-node-current-observation-revalidationat unchanged exact headc751865412d5642357203f917f16c6c2bbd12324. Keep Draft while #102/#101/#96/#95/#93/#58/#57/#52/#40 remain active. No prerequisite check, review, status, coverage, or mergeability evidence transfers.TDD / RCA sequence
64bc330d801dcaddad29cb907fce68a9de367afarequiredPolicyAuthorizedSemanticNodeAction::dispatch_if_current_observation. CI run31555786236, Rust contracts job93987800295, passed repository contracts and canonical formatting and then failed at the Rust workspace check because the production boundary did not yet exist. That is the intended production-boundary RED.2bf613a1d185f6d6dbdc6ede23ebad710d067103. Rust contracts job93988351769succeeded, but Production coverage job93988351855failed the exact gate. Coverage artifact9126022747localized the gap to a generic-monomorphization region aroundvalidate_current_observation(current_observation)?: separate test closure types had exercised success and rejection through different monomorphized copies.1c033b60250d2119a4ecece0ce541dd7b6b9d087routes success, semantic rejection, and adapter-failure cases through one shared typed dispatch helper so one monomorphization exercises both success and error paths. CI run31556160372then exposed only canonical rustfmt wrapping in that test helper.c4c32d4305d6485a5e9f2bf202316b216d95f71fapplies only that formatting delta.Implemented boundary
PolicyAuthorizedSemanticNodeAction::dispatch_if_current_observationnow:SemanticNodeObservationbefore callback invocation;Focused regressions prove exact-current dispatch, newly disabled denial, removed-action denial, different same-document-node denial, callback non-invocation on every semantic rejection, and separation of adapter failure after successful validation.
Exact-head proof
On unchanged exact current head
c4c32d4305d6485a5e9f2bf202316b216d95f71fagainst unchanged exact prerequisite #102 headc751865412d5642357203f917f16c6c2bbd12324:31556233043: success;93989132459: success, including repository contracts, canonical formatting, locked workspace/all-target check, full tests, strict Clippy, and rustdoc;93989132433: success, including exact owned production function/line/region/branch enforcement;No predecessor-head or prerequisite evidence is transferred.
Truth boundary
This slice does not obtain or authenticate the observation, decide when browser mutation requires re-observation, rotate document epochs, execute Chromium input by itself, authorize destination/network/TLS/HTTP, mint approval, resolve secrets, or prove a post-condition. Its safety value depends on a trusted runtime supplying the fresh bounded observation immediately before the side effect.