Repository navigation
Add opt-in session-origin enforcement for suppressed-flow callbacks - #28
Merged
Merged
Conversation
Port the archived session-origin host side onto origin/main (cbac2a6): - PrototypeRequireOriginScan on MapRunOptions and HostContractSessionOptions, requiring RequireInterpreter plus an API policy - PrototypeReflectionPolicy.PrepareOriginScan binds the runtime capability before author loading and fails closed with PlatformNotSupportedException - session-origin test projects, verifier and the default-off matrix mode - integration notes in docs/validation/session-origin-integration-20261112.md and short pointers in development.md and ugc-session-policy.md Paired runtime branch: runeclr/session-origin-integration-20261112 in ReneeGA2020/runtime, commit 2077f1478f2b43533d368dd7521a04bf6c52809a. The runtime switch defaults to disabled, so a host that does not opt in keeps the existing reflection-policy behavior. Verified: host build, stock reflection tests, lifecycle 156/156, and the 16-mode matrix against a fresh Checked runtime build. Not merged into main. Assisted-by: Cindy (https://cindy.app)
- Distinguish the three runtime relations: tested tree 5/5 raw against the manifest, published blobs 5/5 after CRLF to LF normalization, and only 3/5 byte-identical to the archived experiment (qcall entry re-applied onto dev, CoreLib changed for default-off). Host: 14 of 16 archived files identical, two changed intentionally. - Record the host toolchain (ambient dotnet 11.0.100), the explicit rebuild and the fact that rebuilt outputs embed the source revision, plus the post-commit matrix / stock / lifecycle re-run. - State that upstream targeted tests are owned by a separate worker and remain pending; no pass is claimed here. Docs only; no source, test, policy or runtime commit changes. Assisted-by: Cindy (https://cindy.app)
Add --runtime-committed-source: validate the exact integration commit against a recorded build-source receipt instead of requiring a dirty worktree. - receipt splits buildSource (head + raw file hashes that were built), integration (commit, its exact parent, canonical blob hashes) and the private runtime binary hashes - require a clean worktree at the receipt commit, the exact parent, a five-file modification-only delta, per-file committed blob hash and parent difference - per file, accept the working bytes only when their hash equals the recorded build source (raw) or when the build read the canonical form while the checkout materialises CRLF (normalized-canonical); mismatches are rejected - verify the fresh build outputs and CoreLib against the receipt binaries - the existing source-manifest (dirty build) and clean-commit modes stay unchanged This removes the need to check out the build-time dirty state; the shared runtime tree stays clean at the integration commit. No runtime source, binary or facades change. Assisted-by: Cindy (https://cindy.app)
Describe --runtime-committed-source (clean commit and parent, five-file modification-only delta, per-file raw vs normalized-canonical relations, binary receipt), record the 5/5 negative checks, and record the stable run: runtime clean at 2077f147, host clean at 24e5a8f, 16 modes / 695 pins, with no HEAD switching. The earlier dev+dirty run stays as history. Docs only; no source, test, policy or runtime change. Assisted-by: Cindy (https://cindy.app)
The committed-source mode read the receipt but never froze it: inputs only included the dirty-mode manifest, so the run could not prove which authoritative receipt it validated. - read the receipt bytes once, parse those bytes, and keep their sha256 and length - add the committed-source receipt to the before/after input pins, alongside the manifest path in the existing dirty mode - reject a receipt that changes between load and pin - write the consumed receipt bytes into the run output as consumed-source-receipt.json and record its sha256/bytes in the summary - re-check the consumed file hash, the copy hash and the runtime commit/parent/ clean state after the run; any drift fails the run - apply the same consumed-bytes identity and post-run re-check to the dirty source-manifest mode without relaxing its existing checks No runtime source, binary, layout or host business code change. Assisted-by: Cindy (https://cindy.app)
Record that the committed-source receipt is a frozen input (single read, pinned before/after, consumed bytes copied into the run output with its sha256), that a receipt change between load and pin or during the run fails the run, and that the same identity applies to the dirty manifest mode. Add the receipt-drift negative (6/6) and the new stable run: runtime clean at 2077f147, host clean at 49fc6df, 16 modes, 696 pins (the receipt pin), drift 0. The earlier 695-pin run is kept as history and marked superseded. Docs only; no source, test, policy or runtime change. Assisted-by: Cindy (https://cindy.app)
- Extract check_consumed_source and check_binary_identity from the verifier so the consumed-receipt drift, copy mismatch and binary mismatch paths are shared with the tests instead of reimplemented. - Extend eng/test-session-origin-provenance.py with a synthetic committed-source fixture: one positive with four raw and one normalized-canonical file, and rejections for wrong build source, wrong parent, inconsistent parent, unexpected dirty tree, binary mismatch, receipt drift and receipt copy mismatch. All cases are tooling fixtures; the historical native negative stays in the artifact evidence. - Convert the two session-origin fixture project files to LF so git diff --check no longer reports trailing CR. This is an integration-only line-ending change: the archived snapshot bytes are preserved in the archive branch and evidence. No runtime source, binary, layout or host policy change. Assisted-by: Cindy (https://cindy.app)
- Replace the pending upstream statement with the focused dotnet/runtime results (ContextualReflection, CollectibleAssemblies/Statics, GenericVirtualMethod pass with origin-scan off; the switch-on contextual run is parsing-only, not enforcement). - Key runs by provenance, host commit and consumed source sha instead of pin count; explain the self-declared receipt versus build-log provenance boundary and the four-raw/one-normalized basis. - Describe the 24-case tooling suite and the integration-only LF normalization of the two fixture project files. - Separate PR base resolution from the verifier's historical ancestor check. Docs only; no source, runtime or policy change. Assisted-by: Cindy (https://cindy.app)
Record separate ordinary and RequireInterpreter lifecycle passes on the matching private runtime, with unchanged binary identities. Documentation only; no build or epoch performance claim. Assisted-by: Cindy (https://cindy.app)
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.
Problem
An author callback running on a thread whose ExecutionContext does not flow (a Task or Thread created inside a UGC session) had no policy origin, so reflection and managed-load checks could fall through to the trusted path.
Change (19 files, 2146 insertions)
RuneCLR.EnableReflectionPolicyOriginScandefaults to disabled. Enabling requires the process runtimeconfig switch true plus the host capability assertionPrototypeRequireOriginScan = true; a runtime without capability bit 0 rejects before any author file is opened.tests/RuneCLR.SessionOrigin.Testsplus author/chain/compiled fixtures;eng/verify-runtime-session-origin.py --runtime-committed-sourcevalidates the committed integration source (clean tree, exact parent, five-file delta, per-file raw vs normalized-canonical relation), pins the consumed receipt before and after, and fails on receipt or runtime drift. The existing dirty-source mode is unchanged.Verification
--require-interpreter; source clean at 2077f147 and all five binary hashes match the receipt.eng/test-session-origin-provenance.py(24 synthetic cases) covers the dirty-manifest and committed-source modes, including the four-raw/one-normalized relation and the receipt drift path.Provenance
474eb8ad7230122cc0d34318b25d673da63fd138plus five raw files (recorded hashes); the private Checked x64 native output and CoreLib were built there.2077f1478f2b43533d368dd7521a04bf6c52809aonruneclr/session-origin-integration-20261112; the published blobs equal the tested bytes 5/5 after CRLF to LF normalization. The binaries are not rebuilt from that commit and are not labelled as such.assemblynative.cpp,assemblynative.hppand the ILLink descriptor;qcallentrypoints.cppis re-applied onto the newer dev upstream andRuneCLRReflectionPolicy.csdiffers by the deliberate default-off change.Scope and limits
Opt-in and scoped; no public policy or default execution change. Upstream focused dotnet/runtime tests pass on the matching Checked runtime with origin-scan off: ContextualReflection, CollectibleAssemblies/Statics and CollectibleAssemblies/GenericVirtualMethod (expected 100, actual 100). A switch-on ContextualReflection run also succeeds, but those tests do not attach a RuneCLR session, so it shows switch parsing only; enforcement evidence remains the 16-mode host matrix. Not covered: device/AOT/mobile, unmanaged entry, global all-load, direct native status 1/2 observation, the compiled-only child case, walk-cost measurement, sandbox or unload. The private test layout reuses the dev Release facades (not rebuilt). The two session-origin fixture project files were normalized to LF in this branch (integration-only line-ending change); the archived snapshot bytes stay on the archive branch.
Review-tool note: the verifier's
RUNTIME_BASE(7cbdad39) is a historical ancestor check, not the PR base; PR base resolution is done separately against currentmainwith an explicit merge-base/diff check.Paired runtime branch: https://github.com/ReneeGA2020/runtime/tree/runeclr/session-origin-integration-20261112 (2077f147). The two branches must land together. No merge or CI claim.
Assisted-by: Cindy (https://cindy.app)