Skip to content

Measure whether a hardening change alters what the installer does, instead of arguing that it does not - #10992

Merged
danielhanchen merged 2 commits into
mainfrom
av-fp-installer-differential
Sep 15, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
av-fp-installer-differential

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Six antivirus-hardening passes have shipped (#7822, #8586, #6326, #10540, #10560, #10504). Each was argued safe in prose, because there was no way to show it. The worry that hardening breaks functionality is the right worry, and the answer to it is a measurement, not a more careful argument.

This lane installs from the merge base and from the candidate on two identical Windows runners and compares four things. Zero differences is the pass condition.

  • The transcript. Every line the installer printed, normalised. step pads its label to exactly 15 columns and the output lock pins the indent, so leading whitespace is compared and only trailing whitespace is stripped.
  • The .lnk launch contract, read back through the shell rather than taken from the installer's own log: target, arguments, working directory, window style, icon. arguments carries -WindowStyle and -ExecutionPolicy, which is the pair this whole effort is about, and a change there is completely invisible in the transcript -- which is what a prose review looks at.
  • The generated files whose text is a contract: launch-studio.ps1, unsloth.cmd, share/studio.conf, plus the shape of the install tree.
  • Idempotency, by installing twice. Several of the changes this lane judges touch content-comparison paths -- the code deciding whether a launcher needs rewriting at all -- so "a reinstall writes nothing" is a contract that can break silently.

VOID is not a pass

Same commit on both sides, missing evidence, an installer that did not finish, a checkout that resolved to the wrong tree: each is reported as "nothing was measured" and exits 3, distinct from 2 for "it changed", because those need different reactions from whoever reads the run.

Two of those guards exist because the failure actually happened while building this:

  • A collection error on both sides compared equal to itself. Two runs that both failed to read any shortcut reported "1 compared, every field equal" and exited zero. Failures are symmetric far more often than behaviour changes are, since they come from the host and both sides share it, so the symmetry is no comfort at all. Any entry carrying an error is now VOID.
  • ConvertTo-Json unwraps a one-element collection into a bare object, and -AsArray does not exist on Windows PowerShell 5.1. With exactly one shortcut found, shortcuts.json was an object; iterating that yields dictionary keys, so two different launch contracts would have compared as agreement. Forced to an array on the producing side and tolerated on the consuming side.

The measure job also asserts that git rev-parse HEAD equals the SHA it asked for. A checkout that silently resolved to the default branch would make both sides the same tree, the comparison trivially pass, and the lane report that a change broke nothing while never having seen the change.

Both sides are measured with the tools from the candidate, never each side's own copy: a base commit that predates them has neither, and measuring two sides with two different rulers is not a measurement.

The comparer can fail, and that is tested

A differ reporting no differences looks identical whether it is working or broken, so the comparer carries positive controls and refuses to produce a verdict if they fail. They run twice: once before either install starts, so a drifted normaliser costs seconds rather than ninety minutes of runner time ending in a meaningless green check, and once immediately before the verdict.

20 unit tests in tests/python/test_installer_differential_comparer.py, weighted toward the failure direction. A changed output line, a lost indent, RemoteSigned becoming Bypass in a shortcut, a shortcut that stopped being created, a changed generated launcher, a second run that rewrote something: each must be reported. One test widens the normaliser until it erases every line and requires the self-test to notice, because a control that cannot fail is decoration.

The other direction is tested too, since a lane that fails on every run gets disabled, which costs the same coverage by a slower route: a uv patch release and a 30-second timing difference must not fail it. Version drift is normalised away and printed anyway -- silently normalising something and never mentioning it is how a lane stops being able to tell you anything. Every normalisation rule carries a written cause, enforced by a test, because that list is exactly where a future "just make it green" change would land.

Cost

Two full clean-machine installs, so it opts in: the installer-differential label, a dispatch, or the weekly schedule. synchronize is in the trigger list so a labelled PR keeps being re-measured as it is pushed to, rather than the verdict being about whichever commit was there when the label went on. Not a required check.

What it cannot answer

Nothing about a third-party antivirus: hosted runners have none, and installing an endpoint agent per run is neither fast nor faithful. Nothing about Windows PowerShell 5.1 at a real console either, which is windows-vt-preflight.yml (#10984).

Verification

  • 887 passed, 9 skipped across tests/security/, the new comparer tests, the workflow-trigger lint and the installer shape suite.
  • The collector was run end to end under pwsh on Linux, feeding the real comparer. That is what exposed both JSON defects above and a third: Join-Path throws on a null path, and composing %APPDATA% unconditionally made a parse-clean script print a binding error before doing any work.
  • Parser::ParseFile clean on the collector; the workflow parses as YAML with the three expected jobs.
  • The lane itself has not yet run on Windows. Its first real run is the honest test of it, and I will report that result rather than imply this has already measured an install.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-15T22:13:54.567397Z 346bff6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Comment on lines +307 to +328
- name: Prove the comparer can still fail, then compare
run: |
set -euo pipefail
# Again, immediately before the verdict. The run above was 10 minutes and two installs
# ago, and this is the assertion the whole lane rests on.
python .github/scripts/compare_installer_evidence.py --self-test
echo
set +e
python .github/scripts/compare_installer_evidence.py \
--base evidence/base --head evidence/head \
--base-sha '${{ needs.resolve.outputs.base_sha }}' \
--head-sha '${{ needs.resolve.outputs.head_sha }}'
code=$?
set -e
case "$code" in
0) echo "VERDICT: no behaviour difference." ;;
2) echo "::error::VERDICT: the installer's behaviour changed. See the differences above."
echo "::error::If the change is intended, say so in the PR and update whichever test pins the old behaviour. Do not widen the comparer's normalisation to make this green." ;;
3) echo "::error::VERDICT: VOID. Nothing was compared, so nothing was shown to be unchanged." ;;
*) echo "::error::VERDICT: the comparer itself failed (exit $code); no verdict." ;;
esac
exit "$code"
@danielhanchen

Copy link
Copy Markdown
Member Author

Validation: can this lane lie?

This PR ships no user-facing file, so it cannot break an install. The only risk it carries is that the lane reports "same" when something differed, which launders a regression into a green check. So I went at it from that direction only.

Theorised failure modes first, then 95 adversarial fixture pairs asserting the exact 3/2/0 verdict for each. 12 came back wrong, all of them false greens. Fixed in c9b40ce and 4804b16.

What I theorised could produce a false verdict

  1. A normaliser wide enough to erase a real difference, and in particular a version rule that also swallows a number that matters.
  2. The collector failing halfway and emitting truncated but parseable JSON that compares equal to another truncated one.
  3. $env:APPDATA unset, so Join-Path throws before any work happens.
  4. ConvertTo-Json on 5.1 unwrapping a one-element array, so a single shortcut serialises as an object and iterating it yields dictionary keys.
  5. Entries carrying an error field treated as data.
  6. Empty compared against empty reporting SAME when nothing was measured.
  7. The collector's exit 0 masking failure.
  8. Unicode and encoding in the transcript.
  9. Ordering nondeterminism between the two runs.
  10. A workflow whose triggers do not fire, or which can become release-blocking.

3, 4 and 6 were already closed, and correctly. 1, 2, 5 and 7 were open.

The adversarial matrix

95 cases, synthetic base/head evidence pairs, each asserting an exact exit code.

Group Cases Before After
Identical and known noise, must be 0 19 19 pass 19 pass
Real behaviour change, must be 2 23 20 pass, 3 false green 23 pass
VOID, must be 3 30 21 pass, 8 false green, 1 false red 30 pass
Encoding, shape and normaliser reach 23 20 pass, 3 wrong 23 pass
Total 95 83 pass, 12 wrong 95 pass

Every one of the 12 was a run that exited 0 and printed PASS: ... produced the same user-visible output, the same shortcuts and the same installed files, except one that reported a difference about evidence it had never parsed.

Defects found and fixed

The installer's exit status never reached the comparer. install_exit was written to a step output. Step outputs do not cross into the compare job, and the matrix job does not declare any, so nothing the verdict looked at could tell a successful install from a failed one. This is the lane's worst symmetry: a mirror outage, a runner image change or a definition push fails both sides at the same point, printing the same lines and leaving the same empty manifests, so everything the comparison can see matches. Both installs now write run.json into the evidence directory, and a non-zero, unusable or absent exit status is VOID.

An error field in the artifact manifest was data. The shortcut side of this was already closed; the artifact side fails more quietly. A file the collector could not read keeps its key and loses only its content, so if "content" in before and "content" in after skipped it in silence and the run reported agreement about launch-studio.ps1. Per-file errors, the top-level error the collector writes when the install root does not exist, and content captured on one side only are all VOID now.

The unsloth-* temp-name normaliser reached too far. unsloth-[A-Za-z0-9_]{6,} matches any six characters after unsloth-, which covers unsloth-studio-managed-launcher: the marker written into unsloth.cmd that the installer uses to recognise its own shim (install.ps1:2641, read back at :2944). Renaming it compared equal, in a file whose text this lane calls a contract. The rule is now anchored on the random hex tail it was written for, so unsloth-uv-<hex8>, unsloth-probe-<hex8>.tmp and .unsloth-write-probe.<guid> still normalise and a name that means something no longer can.

A manifest of the wrong shape was coerced, not rejected. base_shortcuts or [] turned a manifest of the wrong shape into an empty one of the right shape, which then compared against a populated side as "every shortcut disappeared". A behaviour difference claimed about evidence nobody parsed. Shape is checked now.

A BOM made valid evidence unreadable. Windows PowerShell 5.1 writes one for Set-Content -Encoding utf8, and json.loads rejects it. utf-8-sig.

The tools-extraction guard passed on a zero-byte file. A failed git show writes nothing down the pipeline, Set-Content still creates the file, and Test-Path returns true. The exit status and the size are both checked now.

The label gate matched as a bare substring, so a future installer-differential-skip would have started two installs. The quotes are part of the match.

A transcript difference suppressed the shortcut note, so a run reporting a changed line also stopped saying whether the launch contract had been looked at.

Version drift was reported from the transcript only. normalise_line runs on shortcut fields too, so a launcher retargeted from a python-3.11 directory to a python-3.13 one is erased exactly as a patch release is. Still normalised, but now printed, which is this file's own stated rule for that rule.

Every new guard is in --self-test as well as the unit tests, so the control that runs before each verdict fails if any of them is widened back.

Normaliser audit

Rule Verdict
\b\d+\.\d+s\b durations Clean. Needs a decimal point and a trailing s; cannot reach an integer, a version or a flag value.
\d{1,3}(\.\d+)?\s?% progress Clean. Bounded to three digits, requires a literal %.
`\d+(.\d+)?\s?([KMGT]i?B bytes)` sizes
\d{4}-\d{2}-\d{2}[T ]... timestamps Clean.
40 and 64 character hex Accepted with a caveat. Correct for the transcript, where the two sides are different commits by construction. It also erases a pinned digest inside a generated file, though adding or removing the line carrying it is still reported (verified).
unsloth-[A-Za-z0-9_]{6,} Defect, fixed. See above.
\\Temp\\[A-Za-z0-9._-]{6,} Clean. Replaces one path segment after \Temp\; everything there is ephemeral by construction and deeper segments survive.
\b(pid|PID)[= ]\d+ Clean. The \b means rapid 5 does not match; verified.
127.0.0.1:\d+, localhost:\d+ Clean.
ANSI sequences Clean.
[\r\x08] Clean. splitlines already handles CRLF, so this only removes a lone CR from a redraw. Verified both directions.
_VERSION_PATTERN Accepted, now reported. The only rule that can reach a deliberate change. Mitigated by printing the drift wherever it applies rather than only in the transcript.

Everything else I checked

  • actionlint clean on the workflow, before and after. Parses as YAML with the three expected jobs, permissions: contents: read, resolve gating both others.
  • Advisory: repos/unslothai/unsloth/rulesets is empty, nothing in the repo names this workflow as a required check, and it declares no permission that would let it write a status. Classic branch protection is not readable with my token, which is the one thing here I am asserting from absence rather than from a read.
  • Parser::ParseFile clean on the collector under pwsh.
  • Collector executed end to end on Linux, feeding the real comparer. Off Windows there is no WScript.Shell, so it writes the error shape, and the comparer calls that VOID with exit 3. Confirmed rather than assumed.
  • The single-element array forcing verified by running it: one entry produces a JSON list, zero entries produce [], and nested single-element arrays (rewrittenOnSecondRun) are not affected by the top-level unwrapping. The pwsh invocation from the test goes through tests/_shared/unsloth_pwsh_runner.py::run_pwsh.
  • The run.json write and merge simulated under pwsh, including the path where the first step never wrote it (-1, therefore VOID).
  • tests/python/test_installer_differential_comparer.py: 20 to 51 tests. 29 of the 31 new ones fail against the comparer as it stood (29 failed, 22 passed on 7616170); the other 2 are coverage rather than regression, and the original 20 still pass unchanged. tests/studio/test_studio_smokes_do_not_trigger_on_the_training_library.py and test_macos_slots_per_commit.py still pass (45).

What a Linux host cannot tell you about a windows-latest lane

Everything above is about the comparer and the collector's portable half. It is not a run of the lane.

  • No .lnk was ever created or read back. WScript.Shell does not exist here, so the entire shortcut collection path, which is the part of the evidence the whole effort is about, is unexercised. The comparer was fed hand-written manifests in that shape.
  • Windows PowerShell 5.1 was not exercised. ConvertTo-Json depth behaviour, Set-Content -Encoding utf8 emitting a BOM, and the OEM code page on a redirected pipe are all 5.1 behaviours I defended against by construction, not by observation. pwsh 7 on Linux does none of them.
  • install.ps1 was not run, so nothing here says the transcript it produces is stable enough between two runs of the same commit for this lane to be usable at all. That is the question the first real run answers, and a lane that flakes gets disabled, which costs the same coverage by a slower route.
  • The resolve job's merge-base arithmetic, the checkout SHA assertion and the fork-PR fetch path were read, not run.
  • One hole I could not close: a transcript truncated while the installer still exited 0, identically on both sides. Nothing in the evidence distinguishes that from a short install. The exit status closes the realistic version of it, where the truncation and the failure have the same cause.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex security review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen

Copy link
Copy Markdown
Member Author

From a CI sweep: your pre-commit.ci - pr failure is one blank line.

ruff-format-with-kwargs wants a blank line between the docstring and the nested def:

--- a/tests/python/test_installer_differential_comparer.py
+++ b/tests/python/test_installer_differential_comparer.py
@@ -781,6 +781,7 @@ def test_a_contract_that_moved_without_changing_its_bytes_is_a_difference() -> N
     was added to make observable.
     """
+
     def side(found_at: str) -> dict:

Reproduced against your head 73c7b6c0e with the pinned ruff 0.6.9, running the hook over every file it selects: exactly one file modified, one line inserted.

Two things that make the log misleading:

  • The 1201 files reformatted summary is not the failure. The same script reports 2404 files reformatted on clean main and leaves git status empty, because it reformats and then restores kwarg spacing. Only files were modified by this hook counts.
  • The run linked from the check says the autofix push was skipped: a conflict occurred when applying fixes to the pr. try pulling the upstream branch. Your branch is MERGEABLE again as of 73c7b6c0e, but the check still points at that older run, so pre-commit.ci has not re-run. An empty push should get you the autofix.

Not touching the branch, since you have it in flight.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

danielhanchen added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Sep 15, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

danielhanchen added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Sep 15, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90550ab37f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

}

# Always zero. A collection failure is data for the comparer, not a red step.
exit 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Return instead of exiting the collector host

When the collector is invoked after the second install in windows-installer-differential-ci.yml, this exit 0 terminates the entire hosting pwsh step rather than merely returning from the script. Consequently, the commands after that invocation never merge secondInstallExit into run.json, and compare_run_status treats every otherwise-successful run as VOID because that required status is missing. Remove the explicit exit or use return so the caller can finish recording the evidence.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not correct, and this one is settled by running it rather than by reading it.

exit inside a script invoked with the call operator terminates that script's scope and returns to the caller with $LASTEXITCODE set. It only takes the host down when the script is dot-sourced, and the workflow uses & at both call sites (windows-installer-differential-ci.yml:328 and :354).

Executed here, with the real collector and the same invocation shape as the step:

pwsh -NoProfile -Command "$ErrorActionPreference='Continue'; & './.github/scripts/Collect-InstallerEvidence.ps1' -StudioHome ... -OutDir ... | Out-Null; Write-Host 'STEP CONTINUED...'; 'second_install_exit=0' | Out-File ...; Write-Host ('proof written: ' + (Test-Path ...))"

collected 2 artifact entr(ies)
STEP CONTINUED AFTER THE COLLECTOR, LASTEXITCODE=0
proof written: True
step exit=0

And under the shape GitHub actually uses for a shell: pwsh step, which dot-sources the step script into the host (pwsh -command ". '<step>.ps1'") and then calls the collector with & from inside it:

pwsh -NoProfile -Command ". './step.ps1'"

inner start
STEP CONTINUED (dot-sourced host), LASTEXITCODE=0
host exit=0

So the commands after the second collector invocation do run, and secondInstallExit is merged into run.json. The exit 0 is deliberate and documented where it sits: a collection failure is data for the comparer, not a red step, and the comparer is what decides VOID.

Worth adding one thing in your favour, because it came out of checking this: I had been treating a green run of this lane on a staging repo as evidence it works end to end, and it was not. That run only executed the gate job and skipped the two installs, because the staging PR carries no installer-differential label. I have now labelled it, the real two-install differential is running, and I will report what the comparer actually says rather than what a skipped job implies.

@danielhanchen
danielhanchen force-pushed the av-fp-installer-differential branch from 90550ab to 8f42c42 Compare September 15, 2026 21:50
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Sep 15, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen
danielhanchen force-pushed the av-fp-installer-differential branch from 8f42c42 to c7631a9 Compare September 15, 2026 21:58
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@danielhanchen
danielhanchen force-pushed the av-fp-installer-differential branch from ee74fdb to 963c3e9 Compare September 15, 2026 22:05
… has to prove it changed nothing

The claim every antivirus-shape change in this series rests on is that the
installer still does exactly what it did. Nothing measured that. This lane runs
install.ps1 to completion twice on windows-latest, once from the merge base and
once from the candidate, and compares four contracts:

- the transcript, first run and reinstall, so a change to what a user sees fails
- the shortcut manifest, every field of the launch contract including the
  description install.ps1 reads back when it decides whether a shortcut is
  already correct
- the generated launch-studio.ps1 and unsloth.cmd, by content, encoding and
  location
- idempotency, by running the installer a second time and requiring it to write
  nothing

The design rule throughout is that unmeasured is not passed. Both legs are
produced by the same collector, so malformed evidence is symmetric and compares
equal to itself, and every check is written for that: an empty shortcut object, a
content contract with no captured content, a manifest of the wrong shape, an
installer that exited non-zero, an unmeasured idempotency run and an unknown
expected set are all VOID rather than agreement. The comparer carries a positive
control it must call different and a pair it must call equal, because a differ
that reports no differences looks the same whether it is working or broken.

Normalisation is deliberately narrow. Console output and generated files get
different rules: a port, a size or an elapsed time is noise in a transcript and
content in a launcher. Only values that genuinely vary between two installs of two
commits are erased, and the one rule that can reach a deliberate change, the
version normaliser, prints what it erased.

Two full installs per run, so a pull request opts in with the
installer-differential label, the label event is scoped so an unrelated label
cannot cancel a measurement in flight, and a weekly run keeps the lane known to
work before it is relied on to judge anything.

No shipped file is touched: two CI scripts, one workflow and its tests.
@danielhanchen
danielhanchen force-pushed the av-fp-installer-differential branch from 963c3e9 to 1e491b4 Compare September 15, 2026 22:09
danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Sep 15, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 346bff65e0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danielhanchen
danielhanchen merged commit 6370afe into main Sep 15, 2026
17 of 19 checks passed
@danielhanchen
danielhanchen deleted the av-fp-installer-differential branch September 15, 2026 22:15
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 15, 2026
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…stead of arguing that it does not (unslothai#10992)

* Windows: a base vs head installer differential, so a hardening change has to prove it changed nothing

The claim every antivirus-shape change in this series rests on is that the
installer still does exactly what it did. Nothing measured that. This lane runs
install.ps1 to completion twice on windows-latest, once from the merge base and
once from the candidate, and compares four contracts:

- the transcript, first run and reinstall, so a change to what a user sees fails
- the shortcut manifest, every field of the launch contract including the
  description install.ps1 reads back when it decides whether a shortcut is
  already correct
- the generated launch-studio.ps1 and unsloth.cmd, by content, encoding and
  location
- idempotency, by running the installer a second time and requiring it to write
  nothing

The design rule throughout is that unmeasured is not passed. Both legs are
produced by the same collector, so malformed evidence is symmetric and compares
equal to itself, and every check is written for that: an empty shortcut object, a
content contract with no captured content, a manifest of the wrong shape, an
installer that exited non-zero, an unmeasured idempotency run and an unknown
expected set are all VOID rather than agreement. The comparer carries a positive
control it must call different and a pair it must call equal, because a differ
that reports no differences looks the same whether it is working or broken.

Normalisation is deliberately narrow. Console output and generated files get
different rules: a port, a size or an elapsed time is noise in a transcript and
content in a launcher. Only values that genuinely vary between two installs of two
commits are erased, and the one rule that can reach a deliberate change, the
version normaliser, prints what it erased.

Two full installs per run, so a pull request opts in with the
installer-differential label, the label event is scoped so an unrelated label
cannot cancel a measurement in flight, and a weekly run keeps the lane known to
work before it is relied on to judge anything.

No shipped file is touched: two CI scripts, one workflow and its tests.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

2 participants