Repository navigation
Refresh a rewritten shortcut's icon where the shell cannot define the type - #11116
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
4cafbde to
fecfdef
Compare
Adversarial verification pass, and three real defects it foundI ran this stack through an independent adversarial audit whose brief was to falsify the claim that these are pure hardening changes, plus AST routing checks and a measured idempotency run. Three findings were genuine and are fixed here. 1. The Constrained Language Mode fallback did not workFixing the launcher was necessary and not sufficient, and my own check gave a false pass by exercising the launcher in isolation. Driven end to end in a runspace created with
Discovery now uses 2. A broken extraction reported itself as a skip, and CI recorded a pass
All three early-Python suites now tell those two states apart: if the probe finds nothing while a python is on PATH, that is a broken extraction in the test file and it exits 1. Removing the helper names again reproduces the original break and now exits 1 instead of 0. 3. The icon rung's "never throws" promise was false
Idempotency, measuredThe cmdlet launcher is the only new code that writes anything: three temporary files per call. Pointed at a private empty directory so a concurrent process cannot move the measurement, then run through ten successful calls, five non-zero exits, two timeout kills and a missing interpreter: nothing left behind. Removing the Nothing else in this stack writes to disk or the registry at all, confirmed by scanning every new function body for write operations. ExactnessThe ctypes rung and the native rung must return the same string for the same process, or RoutingAST checks confirm each new function has exactly one definition and its call sites are guarded as intended: Every call is inside a function invoked later, so PowerShell's lack of hoisting does not bite here. Cross-platformStaging CI on six OSes: Linux x64, Linux ARM64, Windows x64, Apple Silicon macOS, Intel macOS all green. Windows ARM64 failed on What I will not claimThis is not zero-effect on every host. On a locked-down host the installer now sees a running Unsloth it previously missed, and refuses to install over it rather than proceeding. That is the intended behaviour and the reason the rung exists, but it is a behaviour change, not an invisible one. |
|
@codex security review |
24d1f05 to
0271b2f
Compare
2b3eb8a to
9371c69
Compare
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Confirmed the type-defining rung in install.ps1 is still tried first and the child interpreter is only reached from its catch, with the same two SHChangeNotify constants in the same order. Will get this reviewed after the base lands. |
1 similar comment
|
Confirmed the type-defining rung in install.ps1 is still tried first and the child interpreter is only reached from its catch, with the same two SHChangeNotify constants in the same order. Will get this reviewed after the base lands. |
79726aa to
1a4a5cf
Compare
1a4a5cf to
1653d4a
Compare
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…acted helper sets
# Conflicts: # tests/python/test_windows_installer_concurrency_guard.py # tests/python/test_windows_installer_native_type_fallback.py
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Both warnings fire before the Python rung runs, so they cannot promise that paths are compared as written: an interpreter may still resolve them exactly.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
# Conflicts: # .github/workflows/cross-platform-parity-ci.yml # install.ps1 # tests/studio/test_early_python_path_resolver.ps1 # tests/studio/test_early_python_process_image.ps1
Stacked on #11115. Review the top commit only; the base will disappear from this diff once #11115 merges.
What this changes
After writing the Unsloth Studio shortcuts, the installer tells Explorer about them with
SHChangeNotify. The per-item notification is the one that matters: the globalSHCNE_ASSOCCHANGEDbroadcast misses a same-name.lnkthat was rewritten in place, and rewriting one in place is what every update does.That call needs a type defined at runtime. Constrained Language Mode and WDAC Dynamic Code Security both refuse it, and on those hosts the whole block threw straight into its own
catch: the shortcut worked, but its icon stayed stale until something else invalidated Explorer's cache.The
catchnow sends the same two notifications, with the same constants in the same order, through a child interpreter usingctypes.Why it is additive only
shell32.Cosmetic in both directions: the best case is a correct icon, the worst case is the stale icon that host already had.
A gap the test found
The function's own comment promised every path returns rather than throws, and a throw from the runner escaped it. That was covered by the caller's
catch, so it would never have failed an install, but the function was not what it said it was. It now holds on its own, and removing the guard makes the check fail.Testing
New
tests/studio/test_early_python_icon_refresh.ps1, 12 checks, wired intocross-platform-parity-ci.ymlon both the pwsh 7 and the Windows PowerShell 5.1 legs.The notifications themselves are Windows only, so the rung is driven through a stubbed runner: every shortcut written is named to the child rather than just the last, a silent or unexpected answer is not treated as success, a throwing child does not escape, an empty list is handled, and the rung declines off Windows without spawning anything. The embedded probe is extracted from the AST, compiled as Python, and checked for both notification calls and for the declared
SHChangeNotifysignature, since an undeclaredctypesargument defaults to a Cintand would truncate a pointer on 64 bit.tests/studio/test_ci_shell_suite_coverage.py,tests/studio/test_installer_av_shapes.pyand both installer test suites: 394 passed, 18 skipped.No effect on installation, update, login or the shortcuts themselves
The shortcuts are written by exactly the code that wrote them before, to the same paths, with the same targets and icons. Only the notification that follows changes, and only on hosts where it previously did not happen at all.