You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
spago publish accepts a manifest whose description exceeds the registry 300-char limit, producing an index entry spago build can't decode #773
spago publish accepts a package whose description exceeds the registry Manifest schema's 300-character LimitedString limit. The publish succeeds and
the version appears in the metadata, but the manifest written to the registry
index violates the schema, so consumer-side spago build cannot decode it.
Because the whole package entry fails to read, the package becomes uninstallable.
Publish-side validation and consume-side decoding disagree about what is a valid
manifest.
Reproduction
harmonia@0.1.0 (afcondon/purescript-harmonia) is a live, minimal reproducer.
A package whose spago.yamldescription is 432 characters.
spago publish → succeeds; the version appears in metadata.
From a consumer depending on it (extraPackages: { harmonia: 0.1.0 }), spago build --refresh:
‼ Could not read package manifests for 'harmonia' from index. Error: $.description: Could not decode Manifest:
LimitedString: Exceeds limit of 300 characters.
✘ The following packages do not exist in the package index:
- harmonia
spago publish (or the registry pipeline it submits to) should reject a
manifest whose description exceeds the 300-char limit, with a clear error, before writing it to the index — so that anything which publishes is always
decodable by consumers.
Impact
The published version is uninstallable from the registry.
The invalid line appears to poison the entire package index entry: a later
corrected version (e.g. 0.1.1) would still leave the bad 0.1.0 line in ha/rm/harmonia, so the entry stays unreadable until 0.1.0 is unpublished.
Recovery is awkward: spago exposes registry transfer but no unpublish
(only spago auth mentions "transfer and unpublish operations"), so removing
the bad version needs the registry's own process.
Environment
spago 1.0.3
purs 0.15.x
macOS (darwin 24.6.0)
Note
The root cause may live in the registry's publish validation
(purescript/registry / the registry-lib Manifest codec) rather than in spago
itself — feel free to transfer. Filing here because spago publish is the
user-facing entry point that accepted the invalid manifest.
package@{ name, description, dependencies: spagoDependencies } <- note "No 'package' key found in config." config.package
publish@{ version, license, owners } <- note "No 'publish' key found under the 'package' key in config." package.publish
location <- note "No 'location' key found under the 'publish' key in config." publish.location
let includeFiles = NonEmptyArray.fromArray =<< (Array.mapMaybe NonEmptyString.fromString <$> publish.include)
let excludeFiles = NonEmptyArray.fromArray =<< (Array.mapMaybe NonEmptyString.fromString <$> publish.exclude)
let printRangeError packages = "The following packages did not have their ranges specified: " <> String.joinWith ", " (map PackageName.print (Set.toUnfoldable packages))
We should have either validated the string length (easy to forget), or defined a LimitedString type in the manifest type so that you have to parse to that string. The first would be an immediate solution, something like this:
spagoYamlToManifest ref config = do-- ... existing checks ...-- Add description length validation:case package.description ofJust desc | String.length desc > 300->Left"Description exceeds 300 character limit"
_ -> pure unit
pure $ Manifest { ... }
but the second would be the long-term fix, just a little more far-reaching. And alas we'd need to unpublish this package version.
ooops, i didn't check back in on this...so the 24 hour window would have passed by now, but i'm back in that Harmonia library now and will try unpublishing it and resubmitting when i have a new version
I think we are ok with having that description be 432 char long. The bug is indeed in the registry-dev code, so I will transfer this ticket there.
I would propose that we extend the description tolerance to 500 chars so that harmonia fits there, and add the LimitedString type to the manifest so we don't stumble on this again.
Activity
thomashoneyman commentedon Jun 30, 2026
This is probably a registry-dev bug. The manifest type indeed restricts to the specified 300 character limit:
registry-dev/lib/src/Manifest.purs
Line 80 in fa708f6
However, when coming from
SpagoYamlwe never validate the string length:registry-dev/app/src/App/Manifest/SpagoYaml.purs
Lines 32 to 44 in fa708f6
We should have either validated the string length (easy to forget), or defined a
LimitedStringtype in the manifest type so that you have to parse to that string. The first would be an immediate solution, something like this:but the second would be the long-term fix, just a little more far-reaching. And alas we'd need to unpublish this package version.
thomashoneyman commentedon Jun 30, 2026
There should be a
spago unpublishcommand? You can certainly unpublish registry packages within a window, something like 24hrs.Build harmonia from the published git tag (v0.1.1)
afcondon commentedon Jul 6, 2026
ooops, i didn't check back in on this...so the 24 hour window would have passed by now, but i'm back in that Harmonia library now and will try unpublishing it and resubmitting when i have a new version
thanks for the follow-up!
f-f commentedon Jul 18, 2026
I think we are ok with having that description be 432 char long. The bug is indeed in the registry-dev code, so I will transfer this ticket there.
I would propose that we extend the description tolerance to 500 chars so that harmonia fits there, and add the
LimitedStringtype to the manifest so we don't stumble on this again.thomashoneyman commentedon Jul 18, 2026
That’s fine with me, it was an arbitrary limit anyway.