Add Docker-style image tagging - #425
Conversation
8fe5d5f to
6c6cb0f
Compare
-->
✱ stlc build✅ go code · compare
✅ python code · compare
✅ typescript code · compare
Diagnostics: ❗ 0 new / 1 total error, 💡 0 new / 5 total note
Build metadata
This comment is auto-generated by stlc and is kept up to date as you push. |
|
companion PR here: kernel/hypeman-cli#65 |
5fc6e04 to
fe0fa4e
Compare
|
mentioned to assess this directory layout: and if the migration is worth it or if we should stick to existing for now. un-requesting review until pinged again. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit a170537. Configure here.

summary
Kernel runs browser sessions and app deployments as VM-backed instances. This PR adds Docker-style local image tagging and separates immutable bootable image content from mutable repository/tag references.
The result is one local rootfs per content digest, with repository tags acting as lightweight references. A ready Hypeman image can be retagged and pushed without pulling or reconverting it, while existing legacy images remain readable during the layout transition.
1. pre-existing flows + new flows
pre-existing image pull flow
pre-existing lookup flow
pre-existing delete flow
new local tagging flow
This allows:
The operation does not pull or reconvert the image.
2. changes to the data model
There is no database schema or migration. The main change is separating image content from image references.
API model
Added:
The endpoint returns explicit errors for invalid references, missing images, and non-ready sources.
internal model
The existing image metadata fields remain compatible:
The ownership model changes conceptually:
Tags are still represented by filesystem references rather than a new database table. An image can therefore have multiple repository/tag references without duplicating its metadata or rootfs.
This matches the app platform’s existing deployment model: deployments persist both an image reference and an image digest, while app versions identify the deployable version. The reference remains a convenient name; the digest identifies the immutable image used by the VM.
3. changes to filesystem layout
legacy layout
On macOS, the rootfs uses
rootfs.ext4.The legacy layout stores a separate digest directory under each repository.
content-addressed layout
The content directory is shared across repositories. Repository tags are references into that shared content directory.
compatibility behavior
Readers understand both layouts:
New writes use the content-addressed layout. Existing legacy images are promoted when a cross-repository tag requires shared ownership.
Deletion distinguishes between:
4. justifications for the filesystem change
keep the bootable browser image immutable
Hypeman does not run the OCI layer graph directly. It converts the image into a bootable EROFS or EXT4 rootfs disk, which is consumed by the VM that runs a Kernel browser session.
That disk is the expensive, host-local runtime artifact. Repository tags such as
chrome:stable, customer-specific names, or deployment names are mutable references to it. They should not create another rootfs or change the bytes used to start the browser.make app deployment identity stable
The app platform records both
image_refandimage_digestfor a deployment and uses the image to create a deploy-mode instance. The reference is useful for display and lookup, but the digest is the stable identity needed to reproduce, roll out, or roll back an app version.Content-addressed storage keeps that identity local to the digest. Moving a tag or adding a deployment-specific alias does not create a second image or change which bytes an app version refers to.
support host-local caching for browsers and apps
A browser session or app invocation may start on a different host from the one that first converted the image. Each host needs a local cache of the same immutable bootable content.
With the shared layout, a host can:
The host does not need to preserve every repository name that previously referenced the image.
avoid duplicate rootfs data
A single digest can be referenced by multiple repositories, app versions, and browser-facing names. Keeping content under the repository path creates duplicate rootfs files as aliases are added.
The shared layout gives each digest one local content owner while allowing any number of references. Hard-linked aliases also let disk accounting count the physical rootfs once.
make deletion and rollback safe
Deleting a tag must not remove content still needed by another app version, browser session, or digest-only deployment. Conversely, an old app version should be able to roll back to its digest even after a mutable tag moves forward.
Separating content from references lets cleanup answer the correct question:
rather than inferring ownership from one repository directory.
enable atomic promotion and compatibility
Legacy content can be promoted into the shared layout by:
The rootfs is not copied, and incomplete content does not become authoritative over a ready legacy image. Dual-layout readers allow existing browser and app images to continue working while new writes use the shared layout.
enable future lifecycle operations
The shared content boundary gives later browser and app platform operations a clear object to manage:
One follow-up constraint remains: if the same OCI digest can produce different rootfs bytes for different platforms, output formats, or converter versions, the eventual content key should include those dimensions rather than using the OCI digest alone.