Repository navigation
Check that a manifest's schema is a string before looking it up - #357
Merged
Merged
Conversation
Since #336, every capture of the Lean sources asks whether each publication.json it finds marks a complete Autoform site. That check looked the manifest's schema up in a set, which hashes it, so a publication.json whose schema is a JSON object or array raised TypeError and crashed every command that captures the sources, such as check --lean-root, audit and work. Skeleton's guard against overwriting a foreign packet directory made the same lookup, and crashed instead of refusing. Both now check that the schema is a string first, as the managed-output check beside the first one already does.
Contributor
Author
|
Verdict: ready to merge. This is the swarm's own PR, reviewed at head d5fdfbb. All its checks pass on the merge with current main (619cc54). What was checked
The machine's free memory was below the agreed limit for review agents, so this rests on my own review, which found nothing to change. Posted by PR swarm: PR Swarm Lead |
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a crash on main that cove-b9 reported on the board after #336; there is no issue for it. Opened at the user's request.
Problem
Since #336, every capture of the Lean sources asks whether each
publication.jsonit finds marks a complete Autoform site, so it can skip rendered copies._is_complete_publicationlooked the manifest'sschemaup in a set, which hashes it. Apublication.jsonunder the Lean root whoseschemais a JSON object or array, such as another tool's manifest, raisedTypeError: unhashable typeinstead of being treated as not ours. Every command that captures the sources crashed with a traceback. On main 619cc54,check --lean-root,auditandworkall do.Skeleton's guard against overwriting a foreign packet directory,
_validate_managed_output, makes the same lookup on(kind, schema). A packetmanifest.jsonwith the right kind and an object or array schema crashed instead of being refused.Change
Both checks now test that the schema is a string before looking it up, as
_is_managed_output_manifest_bytesbeside the first one already does. Apublication.jsonwith any other schema is not an Autoform publication, so its folder is captured like any other, and such a packet manifest is refused with the existing "refusing to overwrite non-Autoform packet output" error. A string schema behaves as before.Tests
test_only_a_complete_publication_manifest_hides_its_folder(tests/test_lean_sources.py) gains an object schema and an array schema; both folders are captured.test_a_packet_manifest_whose_schema_is_not_a_string_is_refused(tests/test_skeleton.py) checks both kinds of schema.TypeError, and pass here.Overlap
Merges cleanly with main (619cc54). Two open drafts make the same lookup on the lines next to these, so whichever lands second keeps both changes:
_is_complete_publication's set as{"autoform-publication/v1", *_REPLACEABLE_SCHEMAS}; keep that set after this PR'sisinstance(value.get("schema"), str)line._validate_managed_output's lookup to take an explicit schema; keep this PR's guard line above it.This machine is over the agreed load limit for local pytest runs. The tests were called directly in Python, and CI on this PR is the full run.