Skip to content

Repair the Flatpak index labels, and keep them repaired - #334

Merged
hanthor merged 6 commits into
mainfrom
claude/sweet-gauss-5h3cma
Aug 27, 2026
Merged

Repair the Flatpak index labels, and keep them repaired#334
hanthor merged 6 commits into
mainfrom
claude/sweet-gauss-5h3cma

Conversation

@hanthor

@hanthor hanthor commented Aug 27, 2026

Copy link
Copy Markdown
Member

The remote is decaying on its own

Coverage of AppStream labels in the served index, measured over a few hours:

Time Coverage
Start 18/20
~1h later 10/22
~1h later 6/22

Nothing broke to cause that. It is just routine republishes. Every app that publishes re-strips its own index entry, and in a software centre each one drops to a bare application ID with an "Unknown" licence and no icon.

Why the earlier per-repo fixes stopped working

finupdate, the four installer frontends, mariner, dualcut and mandelbrot have migrated to publish through tuna-os/.github/.github/workflows/publish-flatpak.yml@main, and their local .github/scripts/ directories were deleted by that migration. The one-line fixes merged into each repo are no longer executed at all.

finupdate, xfce, kde, cosmic, niri, mariner   SHARED-WORKFLOW  (local script deleted)
dualcut                                        SHARED-WORKFLOW  (local script vestigial)
tavern                                         local script     <- the only holdout

Consolidating onto one publisher is the right direction. It just means the fix has to live in that one place, and it does not yet.

What this PR does

1. Repairs the index now. Labels read back from the registry — no rebuild, no republish. The conflict against main was resolved by taking main's index and re-deriving the repair, so this carries main's newer digests rather than reverting them.

Property Result
Image set + digests identical to main, 22 images
Labels removed none
Coverage 6/22 → 21/22

2. Keeps it repaired. .github/workflows/repair-flatpak-index.yml does the same thing hourly, so the remote stops depending on a human noticing. A hand-applied repair currently has a shelf life of about an hour; this PR has already been rebuilt twice while open for exactly that reason.

The workflow refuses to commit anything but added labels. If the image set changes, a digest changes, or any label would be removed, it fails rather than pushing a corrupted index to the live remote. That guard is tested in all four directions:

no-op (identical)              rc=0  0 label(s) added; 21/22 images carry AppStream labels
a label removed  (must FAIL)   rc=1  ::error::labels would be removed: {...}
a digest changed (must FAIL)   rc=1  ::error::the image set or a digest changed; refusing to commit
an image dropped (must FAIL)   rc=1  ::error::the image set or a digest changed; refusing to commit

It pulls the script from tuna-os/flatpak-index rather than vendoring a copy — vendoring is precisely how the original one-line bug reached nine repositories.

This is a mitigation, not the fix

The fix is one line in tuna-os/.github's publish-flatpak.yml:

keep_prefixes = ("org.flatpak.", "org.freedesktop.appstream.")
"Labels": {k: v for k, v in labels.items() if k.startswith(keep_prefixes)}

Once that lands, this workflow finds nothing to do and can be deleted. I cannot open a PR against tuna-os/.github from this session — dot-prefixed repositories cannot be attached — so that one needs a human.

tuna-os/Tavern#133 remains effective on its own, since Tavern still publishes with its own script.

The one that cannot be repaired at all

ghcr.io/tuna-os/bootc-installer returns 401 from the GHCR token endpoint, so its labels cannot be read back by any means. The package is private. Until its visibility changes it stays missing, and the app is not installable from the remote by anyone. That is the 1 in 21/22.

Tavern republished on 26 Aug after the earlier repair, using a
publisher that still filtered org.freedesktop.appstream.* out of the
index, so its entry regressed to org.flatpak.* labels only. In a
software centre that reads as a bare "org.tunaos.tavern" with an
Unknown licence and no icon.

The metadata was never missing from the artifact: the GHCR image
carries appdata (2726 bytes), icon-64 and icon-128, exactly as
`flatpak build-bundle --oci` wrote them. This reads them back from the
registry into the index -- no rebuild, no republish.

Verified the diff touches nothing else: all 20 images and every digest
are byte-identical before and after, and the only change is Tavern's
Labels map gaining those three keys, with none removed. The restored
appdata parses and names Tavern, its summary and GPL-3.0-or-later.

bootc-installer remains the one image that cannot be repaired this way:
its GHCR package is private, so the registry returns 401 and its labels
cannot be read back. That needs the package made public.

The publisher-side fix for Tavern is in tuna-os/Tavern#133; until that
merges and Tavern next publishes, this repair is what keeps the entry
correct.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012PBB7xFah5bANaygPQcuHh
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tunaos-org 29ad8c7 Commit Preview URL

Branch Preview URL
Aug 27 2026, 06:51 AM

main moved while this branch sat: overnight republishes took the served
index from 18/20 down to 10/22. Twelve images had lost their AppStream
labels, not one -- mariner (both arches), finupdate (both arches), all
four installer frontends, Tavern, and blueshell, an app that did not
exist when this branch was cut.

Resolved the conflict by taking main's index and re-deriving the repair
from the registry rather than replaying the old one, so this carries
main's newer digests instead of reverting them.

Result: 21 of 22 images now carry AppStream labels, 33 labels added,
none removed, and all 22 digests byte-identical to main.

bootc-installer is again the sole exception: its GHCR token endpoint
returns 401 because the package is private, so its labels cannot be
read back at all.

Note this is a stopgap, and a smaller one than it looks. finupdate, the
four installers, mariner and dualcut now publish through
tuna-os/.github/.github/workflows/publish-flatpak.yml@main and have had
their local .github/scripts/ deleted, so the per-repo fixes merged
earlier no longer run at all. Every one of those apps will strip its own
entry again on its next publish until the shared workflow keeps the
org.freedesktop.appstream.* labels. Tavern is the exception: it still
uses its own local script, which tuna-os/Tavern#133 fixes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012PBB7xFah5bANaygPQcuHh
@hanthor hanthor changed the title Restore Tavern's AppStream labels in the published index Repair AppStream labels in the published index (21/22) Aug 27, 2026
Coverage went 18/20 -> 10/22 -> 6/22 in a few hours, purely from routine
republishes: finupdate, the four installers, mariner, dualcut and
mandelbrot have all migrated to the shared publisher at tuna-os/.github,
which still filters org.freedesktop.appstream.* out of the index, and
their local scripts were deleted by that migration. Every republish
strips that app's entry again, so a hand-applied repair has a shelf life
of about an hour.

This re-derives the repair against current main (6/22 -> 21/22, all 22
digests identical, no labels removed) and adds a workflow that does the
same thing hourly, so the remote stops depending on someone noticing.

The workflow refuses to commit anything except added labels: if the
image set changes, a digest changes, or any label would be removed, it
fails rather than pushing a corrupted index to the live remote. Tested
in all four directions -- a clean no-op passes, and a removed label, a
changed digest and a dropped image each fail.

It pulls the script from tuna-os/flatpak-index rather than vendoring a
copy, since vendoring is how the original bug reached nine repositories.

This is a MITIGATION, not the fix. The fix is one line in
tuna-os/.github's publish-flatpak.yml:

    keep_prefixes = ("org.flatpak.", "org.freedesktop.appstream.")

Once that lands this workflow finds nothing to do and can be deleted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012PBB7xFah5bANaygPQcuHh
@hanthor hanthor changed the title Repair AppStream labels in the published index (21/22) Repair the Flatpak index labels, and keep them repaired Aug 27, 2026
@hanthor-hive-agent

Copy link
Copy Markdown
Contributor

Merge attempt found a genuine branch conflict; deferring for rebase per the scanner starvation guard.

🐝 Hive Agent: scanner | Instance: hive-keen-mink | SHA: unknown

— hive: agent=scanner backend=codex model=claude-opus-4-6 codex=0.146.0

claude added 3 commits August 27, 2026 06:18
main moved again (6/22) while this PR was open, so the merge conflict is
resolved the same way as before: take main's index and re-derive the
repair from the registry rather than replaying the old one, which would
revert newer digests.

This one reaches 22/22 rather than 21/22, because
ghcr.io/tuna-os/bootc-installer is now a public package. Its GHCR token
endpoint returns 200 where it previously returned 401, so its labels can
be read back for the first time. That was the single image no repair
could reach.

All 22 digests identical to main, 16 images updated, no labels removed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012PBB7xFah5bANaygPQcuHh
main moved again while this PR was open. Resolved the same way as
before: take main's index and re-derive the repair from the registry
rather than replaying the previous version, which would revert newer
digests.

All 22 digests identical to main, 16 images updated, no labels removed.

This is the third re-derive on this branch, which is the argument for
the hourly workflow it also adds: by hand, the repair has a shelf life
of under an hour.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012PBB7xFah5bANaygPQcuHh
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012PBB7xFah5bANaygPQcuHh
@hanthor
hanthor merged commit 79d5a39 into main Aug 27, 2026
4 of 5 checks passed
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