Skip to content

build: untrack the ADR KB blob, ship it as its own release asset - #673

Merged
cuttlefisch merged 8 commits into
mainfrom
fix/adr-kb-blob-untrack
Aug 7, 2026
Merged

build: untrack the ADR KB blob, ship it as its own release asset#673
cuttlefisch merged 8 commits into
mainfrom
fix/adr-kb-blob-untrack

Conversation

@cuttlefisch

Copy link
Copy Markdown
Owner

The blob is a build artifact with no consumer

assets/mae-adr.cozo was tracked at ~57 MB. It is derived from docs/adr/*.md,
regenerated on every ADR change, so each regeneration wrote a fresh ~57 MB object
into history. GitHub had started warning on the push.

Nothing read the committed copy:

Path What it actually does
release.yml runs build-adr-kboverwrites the committed blob, then packages it
make install depends on the adr-kb target, so it rebuilds before copying
verify-adr-kb-sync only diffs mae-adr.cozo.sha256; never opens the store
runtime no references outside the builder and the gate; ADR-059 keeps it opt-in

57 MB of history for a file every consumer rebuilt first.

Why not Git LFS

LFS would keep a 57 MB fetch in every contributor's clone path, spend LFS quota,
require git lfs install, and not reclaim existing history — all to keep storing
a build output. It treats the symptom.

What this does

  • .gitignore the store; keep assets/mae-adr.cozo.sha256 tracked, so ADR-059's
    Phase E staleness gate is unchanged (verified: the gate ran on this PR's own ADR
    edit and correctly reported prose-only, no regen required).
  • Drop it from every user package — linux tarball, AppImage, macOS .app, macOS
    CLI + GUI. It is MAE's decision history: useful to contributors, dead weight in an
    end user's download.
  • Publish mae-adr.cozo.tar.gz as a standalone release asset, covered by the
    existing SHA256SUMS manifest.
  • make fetch-adr-kb downloads and verifies before unpacking, for contributors who
    don't want a release build. make adr-kb stays authoritative. Portable per
    principle feat: GUI visual polish, OptionRegistry, desktop launcher (Phase 8 M3) #13 (sha256sumshasum -a 256, refuses if neither exists).
  • Stop building the ADR KB in the AppImage and macOS jobs, which no longer ship it.

A wrong turn worth recording

The first cut verified downloads against the tracked .sha256, on the reasoning
that a hash committed to git is better provenance than one shipped inside the
artifact it certifies. That reasoning is sound; the premise was not.

A sled store is rewritten in place the first time it is opened, and is not
byte-reproducible across builds. Measured on this checkout: the local store hashes
d1ab9b… against a committed ec30dd…. So a make fetch-adr-kb verifying against
the sidecar would have failed on every correct download, and a release step
verifying a fresh build against it would have failed every release.

Integrity comes from the tarball's hash in SHA256SUMS. The sidecar records
"make adr-kb was re-run" — all the staleness gate needs, and not an oracle. That
constraint is now written at all three places someone might reach for it.

Scope

Stops the growth; does not reclaim it. ~365 blob objects are already in history
(most of the 405 MB .git). Reclaiming needs a filter-repo rewrite, which
invalidates every clone, fork and open PR — a deliberate call for a release
boundary, not something to slip into this PR. Filing separately.

The other three bundled KBs stay tracked. Unlike the ADR KB, mae-manual.cozo
and the two guidance KBs are read out of assets/ at runtime by source builds, so
untracking them is a behaviour change needing a fallback path first. Bundling that
here would have hidden a real regression behind a cleanup.

🤖 Generated with Claude Code

`assets/mae-adr.cozo` was tracked in git at ~57 MB. It is a build artifact
derived from `docs/adr/*.md`, regenerated on every ADR change, so each
regeneration wrote a fresh ~57 MB object into history. GitHub had started
warning on the push, and it was the repo's largest single source of growth.

Nothing read the committed copy. `make install` depends on the `adr-kb`
target and `release.yml` runs `build-adr-kb` before packaging, so both
rebuild it first; `verify-adr-kb-sync` only diffs the `.sha256` sidecar and
never opens the store; ADR-059 keeps registration opt-in, so nothing
auto-locates it. It was 57 MB of history for a file with no consumer.

Changes:

  * `.gitignore` the store; `git rm --cached` it. `assets/mae-adr.cozo.sha256`
    stays tracked, so ADR-059's Phase E staleness gate is unchanged.
  * Drop it from every user-facing package (linux tarball, AppImage, macOS
    .app, macOS CLI + GUI packages). It is MAE's own decision history —
    useful to contributors, dead weight in an end user's download.
  * Publish `mae-adr.cozo.tar.gz` as a standalone release asset, covered by
    the existing SHA256SUMS manifest.
  * `make fetch-adr-kb` downloads and verifies it before unpacking, for
    contributors who would rather not do a release build. `make adr-kb`
    remains the authoritative path.
  * Stop building the ADR KB in the AppImage and macOS jobs, which no longer
    package it.

One thing worth recording, because the first cut of this got it wrong: the
committed `.sha256` is NOT a verification oracle. A sled store is rewritten
in place the first time it is opened and is not byte-reproducible across
builds, so a legitimately rebuilt — or merely once-opened — store hashes
differently from the committed value (measured: local d1ab9b… against a
committed ec30dd…). A `make fetch-adr-kb` that verified against the tracked
sidecar would have failed on every correct download, and a release step that
verified a fresh build against it would have failed every release. Integrity
comes from the tarball's hash in the release's SHA256SUMS. The sidecar
records "`make adr-kb` was re-run", which is all the staleness gate needs.

This stops the growth; it does not reclaim the ~365 blob objects already in
history. Doing that needs a `filter-repo` rewrite, which invalidates every
clone, fork and open PR — a deliberate call for a release boundary, tracked
separately.

The other three bundled KBs stay tracked: unlike the ADR KB, `mae-manual.cozo`
and the two guidance KBs are read out of `assets/` at runtime by source builds,
so untracking them needs a fallback path first.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cuttlefisch
cuttlefisch enabled auto-merge August 6, 2026 11:37
@cuttlefisch
cuttlefisch disabled auto-merge August 6, 2026 12:03
@cuttlefisch

Copy link
Copy Markdown
Owner Author

Holding this one for last on purpose. #669 regenerates assets/mae-adr.cozo — the file this PR untracks — so whichever of the two lands second needs a delete/modify resolution. Better that it lands here, where the resolution is simply "keep the deletion", than in a contributor's branch.

Auto-merge disabled on this PR only; it will be back-merged and merged by hand once #669 is in.

Conflict was entirely in the ADR KB store — `assets/mae-adr.cozo/{db,blobs/*}`
— and is a direct instance of what this branch removes. main regenerated the
store (git saw it as blobs 12435352→19576751, 64685803→64667100,
72286036→71976944 renamed-and-modified) while this branch deletes it.

Resolved in favour of the deletion, which is this branch's whole purpose: the
store is a build artifact derived from `docs/adr/*.md`, rebuilt by `make
adr-kb` / `build-adr-kb`, with no consumer reading the committed copy.

`assets/mae-adr.cozo.sha256` is deliberately kept tracked — the ADR-059
Phase E staleness gate diffs that checksum, so it must stay visible. Verified
after resolution: nothing under `assets/mae-adr.cozo/` remains tracked, the
.sha256 does, and the other three bundled KB stores (devpractices, manual,
practices) are untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@cuttlefisch
cuttlefisch merged commit c07b2ca into main Aug 7, 2026
45 of 46 checks passed
cuttlefisch added a commit that referenced this pull request Aug 7, 2026
Ten conflicts on the first attempt, two after #673 (untrack the ADR KB blob)
landed — this branch was a live instance of the churn #673 removes: adding
three ADRs regenerated the tracked 57 MB store and collided with main's copy.

Resolutions:

* assets/mae-adr.cozo/{db,blobs/*} — took the deletion. Post-#673 these are
  gitignored build artifacts derived from docs/adr/*.md; nothing reads the
  committed copy.

* CLAUDE.md — union, not a pick. Both sides appended to the same ADR-index
  sentence: main added ADR-095–100 (via #669), this branch added ADR-101–103.
  Kept main's text, then appended this branch's paragraph after the
  "holistic sharing story" sentence, where it deliberately placed it.
  Verified: all of ADR-095…103 present, and zero ADR references dropped from
  either side (main 59 refs, branch 57, merged 64).

* assets/mae-adr.cozo.sha256 — REGENERATED via `make adr-kb`, not taken from
  either side. This matters: the ADR-059 gate only checks that the file
  differs from base, so either side's value would have gone green. But this
  branch predates #669, so its checksum describes an ADR set missing
  ADR-097–100 — committing it would have produced a passing gate certifying
  something false. The regenerated value covers the merged corpus, and the
  build validated it (no dangling references, no Extends cycles).

No ADRs were lost: no docs/adr/*.md has ever been deleted in history, ADR-094
was never created, and the merged tree has all 103 files main had plus the
three new ones.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:none Skip version bump on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant