Repository navigation
Pin the engine only in the source lock, and name new engines by date and content - #79
Conversation
…and content Engine/source-lock.json becomes the only place the engine is pinned, so two branches that change the engine conflict only in the lock, not in six files: - the app's pin is generated from the lock at build time (OmarchyEnginePinPlugin) instead of committed; - read-validation-engine.py (used by build-app.sh and prepare-engine.py), rebuild-python-overlay.py, assemble-candidate-v8.sh and cutover-wizard read the lock; - the pipeline config's engine block keeps only downstreamRevision, and catalog-inputs composes the rest from the lock (pipeline_engine); - the release-input templates drop engine_name and engine_version, and make-unsigned-catalog.py always takes them from the lock. New engines are named v0.9.2-omarchy.<YYYYMMDD>.<content id>, where the id hashes the lock's build inputs, so branches never race for the next number. Engine/engine_pin.py writes the name; its check fails if a dated name no longer matches the inputs, so a merged engine must be renamed and rebuilt. Every catalog now requires app 2.1.0 or later instead of deciding from the engine's name, so nothing parses engine names. mac-catalog.yml's installer input and catalog_release.py prepare --installer become required. A test fails if any file outside the lock, docs and evidence repeats the engine digest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b800366 to
d8a2175
Compare
maralcbr
left a comment
There was a problem hiding this comment.
@scottjones reviewed at d8a2175. One lock instead of seven pins is the right shape: the plugin, read-validation-engine.py, pipeline_engine and the catalog tools all read it, and I found no other place that still repeats the pin. ./test/all passes here with Bash 5 and Python 3.12, and CI is green. I'm fine with the 2.1.0 floor for every catalog: v2.2.0 is the first public app, so no shipped app falls below it.
One change before merge:
engine_pin.py checkonly guards dated names. Any versionDATEDdoesn't match skips the content-id check (Engine/engine_pin.py:86–91). That covers.50, but also a hand-picked.51and a malformedv0.9.2-omarchy.20261019.bad. On this head, changing adownstream_overlay.files[*].sha256in the lock and naming the engine any of those three passescheckwith no problems. So until the first dated rename, and after it too for anyone who picks a number, two engine branches can still merge silently, which is the race this PR exists to stop. Suggest a frozen allowlist such asLEGACY = {"v0.9.2-omarchy.50": "2ede760866d5"}(this head's content id, which is right because.50rebuilt byte-identical), and havingcheckrefuse a legacy name whose inputs no longer match that id, and any other name that isn't a well-formed dated name. Tests for: a changed input under.50, an unknown numeric name, a malformed dated name, and a dated name whose inputs changed (already covered).
Nits, not blocking:
make-unsigned-catalog.pytakes the engine's name from the lock but digests whatever local archive has that name (model_group), without comparing it to the lock'ssize_bytes/sha256. This isn't new, but "the engine is always the lock's" would be true if it compared them before writing the catalog.pipeline_enginenow builds the stopgapengine-<version>release URL in code. Each new dated engine needs that release published before a pipeline run (--verify-remotecatches a missing one), and the R2 move becomes a code change rather than a config edit. Worth a line indocs/engine-versions.mdstep 3.
…he lock engine_pin.py check verified only dated names, so a hand-picked .51, a malformed dated name, or .50 with changed inputs passed. Now .50 passes only with the inputs it was built from (LEGACY freezes their content id, 2ede760866d5), a dated name needs a real date and a matching content id, and any other name is refused. make-unsigned-catalog.py took the engine's name from the lock but digested whatever archive had that name. It now refuses one whose size or sha256 isn't the lock's. docs/engine-versions.md: the legacy rule, and step 5, publishing the engine-<version> release that pipeline_engine's URL names before a pipeline run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Drafted with an AI assistant (Claude Code); I reviewed it before posting. @maralcbr: thanks, all three are in
One consequence to be aware of: any later change to the lock's build inputs, including the rebuild recipe or the toolchain, now requires a dated rename and a rebuild, even if the archive would come out the same. If another numbered engine lands on main before this PR, I'll update |
maralcbr
left a comment
There was a problem hiding this comment.
@scottjones re-reviewed at d3e9c8d. Approve. All three points are resolved:
- With a changed overlay digest in the lock,
checknow refuses.50,.51and.20261019.bad, gives two problems for an impossible date, and passes a freshly named dated engine.2ede760866d5matches this head's inputs. make-unsigned-catalog.pychecks every model group's engine against the lock's size and digest before it creates or writes any output, and the tests run an isolated copy, so the real lock is never touched.- Docs step 5 covers publishing the
engine-<version>release before a pipeline run.
./test/all passes here (141 ok) and CI is green. I'm fine with the consequence you noted: any change to the recipe or toolchain now forces a dated rename and a rebuild.
Why
Every engine change edits the same pin in six places besides the lock: the Swift locator and its test, the pipeline config, both release templates and
rebuild-python-overlay.py. Every branch also picks "the next number". So two branches that change the engine always conflict, and two that both pick the same number can merge the version lines silently while their digests conflict. Going from.28to.50on main did exactly this: rebasing this PR hit 11 conflicting files.What
Engine/source-lock.jsonbecomes the only place the engine is pinned. Everything else reads it:OmarchyEnginePinPlugin(modelled onOmarchyInstallerIdentityPlugin) generatesValidationEngineArtifactLocator's version, file name, digest and size from the lock at build time. The values are still compiled in; nothing is read at runtime.Packaging/read-validation-engine.pynow reads the lock and checks it the way the generator does, instead of scraping the Swift source.build-app.shandprepare-engine.py(and somac-app-release.yml) are unchanged callers.rebuild-python-overlay.py,assemble-candidate-v8.shandcutover-wizardalso read the lock.engineblock of.github/mac-release-pipeline.jsonis now just{"downstreamRevision"}.catalog-inputscomposes the full block from the lock (catalog_release.pipeline_engine) and runs the samecheck_engine.engine_name/engine_version, andmake-unsigned-catalog.pyalways takes them from the lock.New engines are named
v0.9.2-omarchy.<YYYYMMDD>.<content id>. The id is a hash of the lock's build inputs, so branches never race for a number.Engine/engine_pin.py name --writesets it. Itscheck(run by./test/all) fails if a dated name no longer matches the inputs. A merge of two engine changes therefore has to be renamed and rebuilt; it can't pass as either side's engine..50keeps its name until the next engine change.Policy change to review: every catalog now requires app 2.1.0 or later, rather than deciding that from the engine's name. Every engine since
.18already needs it, and nothing parses engine names any more. As a result,mac-catalog.yml'sinstallerinput andcatalog_release.py prepare --installerare now required.A new test fails if any file outside the lock,
docs/andevidence/repeats the engine digest.See
docs/engine-versions.md.Evidence
Rebased onto main
c276a1c(engine.50) asd8a2175.Conflicts: two branches that each change a different overlay file and record their own engine, merged in throwaway clones of today's main (
c276a1c) and of this branch:.51: 4 files conflict (the pipeline config, the lock, the Swift pin and its test). Three more (rebuild-python-overlay.pyand both templates) merge silently, because both sides wrote the same.51, so two different engines end up with one name. With different numbers they conflict too, giving 7.Engine/source-lock.jsonconflicts, on the engine's name, size and digest. Each side's name is different, so nothing merges silently. The overlay files' digests in the lock merge cleanly.Tests:
./test/allpasses with Python 3.12.14 (mise). Main's engine code no longer runs on macOS's/usr/bin/python33.9.swift testpasses: debug 820 passed and release 804 passed, 1 skipped in each. XcodeBuildMCP isn't installed on this Mac; CI runs it.Reproducible rebuild:
Engine/prepare-engine.py, with the rebuild script edited to take the version from the lock, rebuilt.50twice from the authenticated.28base and the locked Asahi checkout. Both repacks are byte-identical to the pin:313f9157…, 18,037,588 bytes, archive modes passed.Packaging: an ad-hoc
build-app.shbuild ofd8a2175passescodesign --verify --deep --strict. It used a scratchrelease.jsonwhose helper requirement is the ad-hoc one..50's digest and archive name, and neither contains.28's, so no stale generated pin survived the incremental build.313f9157…. The Recovery app doesn't use the engine pin and doesn't contain it.CI passes on
d8a2175: portable, macOS, image builder and the Neo image contract.Not run: a real pipeline or app-release workflow run.
🤖 Generated with Claude Code