- Notifications
You must be signed in to change notification settings - Fork 0
S2 Step 11 — Verified Target Wrapper gate (own-fix subscriptions verify-target)#291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
78da5df71a7d44e2469f436cea9aa44564ffb4fcd1619d3c490ddc9f49614608c692b897db6e39876b36a44368cf0af45c964507c1045ec85f0984a4cc5737e1578a7c7ab5e4File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <!-- S2 Step 11: the fixed Verified Target Wrapper probe. Two internal modes: bind (Roslyn | ||
| SemanticModel over the pristine preimage plus the accepted Step 8 postimage; per-finding | ||
| callsite bijection, G1; framework references from the SELECTED runtime the probe is | ||
| pinned to, plus the ordered reference slots, G2) and probe (a fresh child that loads the | ||
| derived wrapper from its EXACT materialized slot path via a dedicated AssemblyLoadContext, | ||
| G3, runs the runtime-compatibility preflight, G4, then the frozen GC harness for ONE | ||
| attempt). No code generation, build, restore, or NuGet happens inside verify-target; this | ||
| project is pre-built and passed as the probe-dll input. --> | ||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| <AssemblyName>OwnSharp.WeakTargetProbe</AssemblyName> | ||
| <Deterministic>true</Deterministic> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" /> | ||
| </ItemGroup> | ||
| </Project> |
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -672,8 +672,58 @@ def _cmd_verify_delta(rest: list[str]) -> int: | ||
| return 0 | ||
| def _cmd_verify_target(rest: list[str]) -> int: | ||
| """S2 step 11: `own-fix subscriptions verify-target` — the fake-target gate. Binds the | ||
| accepted Step 8 bundle + Step 10 delta, runs the fixed OwnSharp.WeakTargetProbe (Roslyn | ||
| callsite bijection, then three isolated runtime probes) over the wrapper the postimage | ||
| actually calls, and proves it is a genuine non-retaining subscription.""" | ||
| from ownlang.fix_gate import GateError | ||
| from ownlang.fix_target import TargetError, run_verify_target | ||
| flags = {"--bundle", "--root", "--plan", "--candidates", "--delta", "--out", | ||
| "--probe-dll", "--wrapper-ordinal"} | ||
| parsed = _own_fix_parse(rest, flags, {"--ref-dir"}) | ||
| if parsed is None: | ||
| return 2 | ||
| positional, opts = parsed | ||
| for f in flags: | ||
| if rest.count(f) > 1: | ||
| print(f"own-fix: {f} given more than once", file=sys.stderr) | ||
| return 2 | ||
| required = ("--bundle", "--root", "--plan", "--candidates", "--delta", "--out") | ||
| if positional or not all(opts.get(k) for k in required): | ||
| print("usage: own-fix subscriptions verify-target --bundle <step8-bundle> " | ||
| "--root <pristine-source-root> --plan <validated-plan.json> " | ||
| "--candidates <candidates.json> --delta <step10-delta-result.json> " | ||
| "--out <target-evidence-dir> [--ref-dir <dir>]... " | ||
| "[--probe-dll <probe.dll>] [--wrapper-ordinal <N>]", file=sys.stderr) | ||
| return 2 | ||
| wrapper_ordinal = None | ||
| if opts.get("--wrapper-ordinal") is not None: | ||
| raw = opts["--wrapper-ordinal"] | ||
| if not raw.isdigit(): | ||
| print("own-fix: --wrapper-ordinal must be a non-negative integer", file=sys.stderr) | ||
| return 2 | ||
| wrapper_ordinal = int(raw) | ||
| try: | ||
| published = run_verify_target( | ||
| opts["--bundle"], opts["--root"], opts["--plan"], opts["--candidates"], | ||
| opts["--delta"], opts.get("--probe-dll"), opts["--out"], | ||
| opts.get("--ref-dir") or [], wrapper_ordinal) | ||
| except (TargetError, GateError) as exc: | ||
| print(f"own-fix: refuse: {exc.category}: {exc}", file=sys.stderr) | ||
| return 2 | ||
| except Exception as exc: # fail closed | ||
| print(f"own-fix: refuse: INFRASTRUCTURE: internal error " | ||
| f"({type(exc).__name__}: {exc})", file=sys.stderr) | ||
| return 2 | ||
| print(f"own-fix: wrote target-result.json -> {published}") | ||
| return 0 | ||
| def cmd_own_fix(rest: list[str]) -> int: | ||
| """`own-fix subscriptions {candidates|render|validate-plan|apply|gate|verify-delta} ...`.""" | ||
| """`own-fix subscriptions {candidates|render|validate-plan|apply|gate|verify-delta| | ||
| verify-target} ...`.""" | ||
Comment on lines
724
to
+726
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Add The new verb is documented and dispatched here, but the 🤖 Prompt for AI Agents | ||
| if len(rest) < 2 or rest[0] != "subscriptions": | ||
| print("usage: python -m ownlang own-fix subscriptions " | ||
| "{candidates|render|validate-plan|apply|gate|verify-delta} ...", file=sys.stderr) | ||
| @@ -691,8 +741,10 @@ def cmd_own_fix(rest: list[str]) -> int: | ||
| return _cmd_gate(args) | ||
| if verb == "verify-delta": | ||
| return _cmd_verify_delta(args) | ||
| print(f"own-fix: unknown subcommand {verb!r} " | ||
| "(candidates | render | validate-plan | apply | gate | verify-delta)", file=sys.stderr) | ||
| if verb == "verify-target": | ||
| return _cmd_verify_target(args) | ||
| print(f"own-fix: unknown subcommand {verb!r} (candidates | render | validate-plan | apply " | ||
| "| gate | verify-delta | verify-target)", file=sys.stderr) | ||
| return 2 | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: PhysShell/Own.NET
Length of output: 4882
🏁 Script executed:
Repository: PhysShell/Own.NET
Length of output: 21681
🏁 Script executed:
Repository: PhysShell/Own.NET
Length of output: 26917
🏁 Script executed:
Repository: PhysShell/Own.NET
Length of output: 26917
🌐 Web query:
GitHub actions/setup-dotnet multiple dotnet-version list SDK selection latest installed global.json dotnet SDK resolver💡 Result:
When you use the actions/setup-dotnet GitHub Action to install multiple.NET SDK versions, the action installs all specified versions side-by-side on the runner [1][2]. However, the.NET SDK selection—which version is actually used when you run the dotnet command—is governed by the.NET SDK resolver's standard logic, not by the order in which the action installed them [3][4]. Here is how the selection works and how you can manage it: 1. How the.NET SDK Resolver Selects a Version By default, the dotnet CLI automatically selects the latest installed.NET SDK version [2][4]. This behavior is a fundamental part of the.NET design and occurs regardless of which versions were installed by the setup-dotnet action [3]. 2. The Role of global.json The presence of a global.json file in your project or repository is the primary mechanism to override this "latest version" default [4][5]. The.NET CLI iteratively searches for a global.json file by traversing upward from the current working directory [4]. If a file is found, it instructs the resolver to use the specific version defined in that file, subject to your defined roll-forward policy [6][4]. 3. Managing Multiple Versions with setup-dotnet Because the setup-dotnet action installs multiple versions without automatically creating a global.json file, the system default (the latest installed version) will be used by the dotnet CLI unless you explicitly take control [3]. To ensure a specific version from your installed set is used, you have two primary options: - Use a global.json file: Explicitly include a global.json file in your repository [4]. When the dotnet CLI runs, it will detect this file and bind to the required version, provided that version was installed by the action [4]. - Matrix Strategy (Recommended for CI): Instead of installing multiple versions in one step, use a matrix strategy in your GitHub Actions workflow [7][2]. This allows you to run your build/test jobs for each version independently, ensuring that the environment is explicitly configured for the specific version you intend to test [8]. Example of using a matrix strategy: jobs: build: runs-on: ubuntu-latest strategy: matrix: dotnet-version: [ '8.0.x', '9.0.x' ] steps: - uses: actions/checkout@v6 - name: Setup dotnet uses: actions/setup-dotnet@v5 with: dotnet-version: ${{ matrix.dotnet-version }} - run: dotnet build Summary of Behavior The action installs all requested versions [2]. If no global.json is present, the highest version number installed on the runner will be used by the dotnet CLI [2][4]. If you need to use a non-latest version that you installed, you must provide a global.json file to direct the resolver to the specific version [3][4].
Citations:
Pin the net8 build steps to 8.0.x
Installing
9.0.xalongside8.0.xletsdotnetresolve to the newest SDK on this job, so the laterdotnet runsteps can use the 9.0 toolchain instead of the intended net8 one. Keep9.0.xscoped to the net9 fixture build, or pin the net8 steps explicitly.🤖 Prompt for AI Agents