mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3277
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1162
Author: @demetree
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:update-rebased📝 Commits (7)
4b0ec89Verify the downloaded engine against GitHub's SHA-256, before anything is applied78c3baaMake the swap all or nothing, and stop leaking the staging tree17e3fdeSix things an adversarial review turned up, five of them real bugs353cd3eRepair the app.js splice the shell ate again, and drop the harness from the PR3202e6cReword the comparison to the install path now that it has the same check48ca524Two version-number bugs in the update card, both found by running itcb5077dCount all four copies in the free-space check, and fix a docstring naming a path that no longer exists📊 Changes
9 files changed (+3005 additions, -0 deletions)
View changed files
📝
docs/DETAILS.md(+38 -0)📝
docs/INSTALL.md(+20 -0)📝
serve/server.py(+116 -0)➕
serve/test_update.py(+1061 -0)➕
serve/test_update_http.py(+501 -0)➕
serve/update.py(+947 -0)📝
serve/web/app.css(+24 -0)📝
serve/web/app.js(+279 -0)📝
serve/web/index.html(+19 -0)📄 Description
Verify the download against GitHub's SHA-256 (and rebase onto current
main)Closes the review objection: without a hash check, the only thing between a substituted download and a
running engine was the byte count, which a file of the same length passes.
setup.py'sget_prebuilt()has the same gap today - it calls
download()and nothing else.GitHub publishes the hash, so this needed no release-process change. The releases API returns
digest(sha256:<hex>) for every asset on every release - I checked v0.1.34 through v0.1.40.1 and everyone is present, including the ones published before GitHub added the field. This is the same idea as
setup.py'sverify_sha256(), which pins hashes for the Unsloth shards in the repo; the API'sdigestisthe equivalent for a published asset.
It is worth having because the two values arrive on different connections: the bytes from the release
download, the expected hash from
api.github.com. A substituted download does not come with a matchinghash.
What it does now:
UPDATE.batwill still fetch it, so nobody is stuck;
sha512:ormd5:as if it were sha256;Measured, against the live release
On this machine (GTX 1070, compute capability 6.1, CUDA 12.6 engine), a real update of the real
v0.1.40.1:
18 s end to end. The digest came from the API as
5ffaf2ba1fc68cc4cc7ef26889a0eaad5b302e251067a12f191911ea29770f42and matched.Also fixed: the asset table had gone stale
It was a hardcoded map, and it did not know about
strata-windows-x64-cuda12.zip(setup.py'sCUDA12_ASSET, published since). A machine on the experimental CUDA 12 engine would have been handed theCUDA 13 build, which it cannot run - and on this machine that is exactly what would have happened.
The name is now built from the platform plus the CUDA major the installed engine's own
BUILD.jsonrecords, so keeping an install on the CUDA line it already uses needs no code change when a new asset
appears, and an unknown CUDA falls back rather than refusing.
Two bugs the live run found that no offline test had
The tag is not the engine version.
v0.1.40.1is a hotfix release whose engine isv0.1.40, so theexact comparison in the inspect step refused a perfectly good update. Only an older engine is a refusal
now - that means the wrong asset was picked.
_verify()had the same comparison and the same bug: itfailed after a correct install and rolled back, which is the right behaviour for the wrong reason. The
panel repeated it too, saying "The engine is now v0.1.40.1" about a 0.1.40 engine.
Please note: this is a new branch
mainhas moved ~1150 commits and its history was rewritten - the previous branch (#645) shared noancestry with upstream at all, so its diff was not reviewable. This is a fresh branch off
82f46a8withthe work re-applied, not a rebase. #645 should be closed in favour of this.
The UI port nearly broke the app, and nothing noticed
Splicing the panel into
app.jswith PowerShell line arrays silently dropped ~30 lines, includingfmt,kfmtandgb.node --checkpassed - the file still parsed. Same lesson asvv0.1.38: a syntax checkis not a functional check. The insert is now done in Python and verified by asserting that every top-level
name upstream defines still exists afterwards, and the app was re-checked in a browser. The same re-encode
turned the step marks into mojibake (
ľó) in the browser; the block is now fetched as raw bytes and therender check asserts the code points.
Tests
The hash cases are asserted as firmly as the rest: a matching digest updates and reports the hash; a
same-length file with different bytes is refused, deleted, and no later step runs; no digest is
refused; a non-sha256 digest is refused; a four-part tag with a three-part engine is accepted while an
older engine is refused; and the same refusal over HTTP.
The UI render check (61 checks) is not in the PR - it needs node and the repo has no JS harness.
Still open from before, unchanged
BUILD.jsonwith a BOM (json.loads(read_text())atserve/server.pyraises on it, so an engine saved bya Windows editor reports no version). One line,
encoding="utf-8-sig". I would rather send it as its ownPR than smuggle it in here.
get_prebuilt()could use the samedigestcheck described above - that is achange in
setup.pyand I have not touched it.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.