Skip to content

Add archive contents_sha256 and ARCHIVE_FORMATS - #242

Merged
rtibbles merged 2 commits into
learningequality:mainfrom
rtibblesbot:issue-241-85627b
Sep 25, 2026
Merged

rtibbles merged 2 commits into
learningequality:mainfrom
rtibblesbot:issue-241-85627b

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds archive.contents_sha256: zip identity hash independent of compression and metadata.
  • Adds file_formats.ARCHIVE_FORMATS.

References

Fixes #241. Parent: learningequality/ricecooker#722.

Reviewer guidance

  • Paths hash as ZipInfo.orig_filename, not .filename; is that the frozen choice consumers expect?

AI usage

Used Claude Code to implement the hash, constant and tests from the issue's definition. Verified with the full test suite, an independent recomputation of the pinned digest, and prek hooks.

🤖 Generated with Claude Code


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Ran pre-flight CI checks (lint, format, tests) and verified all pass
  • Rebased onto the target branch and resolved any conflicts
  • Reorganized commit history into clean, logical commits
  • Audited the diff to ensure only issue-relevant files are changed
  • Built PR body from the repository's PR template with evidence blocks
@rtibblesbot

🟡 Waiting for feedback

Last updated: 2026-09-25 03:23 UTC

@rtibblesbot
rtibblesbot marked this pull request as ready for review September 23, 2026 06:30

@rtibbles rtibbles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned digest recomputes independently from the #241 definition. One comment fix below.

Comment thread le_utils/constants/file_formats.py Outdated
BLOOMPUB_MIMETYPE = "application/bloompub+zip"

# Zip-based formats identified by le_utils.archive.contents_sha256.
# FROZEN: ricecooker and Studio's upload Cloud Function pin this; any change breaks their index lookups.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocking: "Any change breaks their index lookups" overstates it: adding a format breaks no existing lookup; removing one orphans its index entries.

Suggested change
# FROZEN: ricecooker and Studio's upload Cloud Function pin this; any change breaks their index lookups.
# FROZEN: ricecooker and Studio's upload Cloud Function pin this; removing a format orphans its index entries.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applied in 00e9343. Searched the diff (README, archive.py docstring, tests) for other breakage claims about the frozen definition: 0 more; they say only "frozen"/"index by".

rtibblesbot and others added 2 commits September 24, 2026 20:21
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Compression- and metadata-independent identity hash for zip archives.

Fixes learningequality#241

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rtibbles
rtibbles merged commit d625e96 into learningequality:main Sep 25, 2026
39 checks passed
@rtibblesbot
rtibblesbot deleted the issue-241-85627b branch September 25, 2026 03:28
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.

Add contents_sha256 archive identity hash and ARCHIVE_FORMATS

2 participants