CEP 37: loosen `custom_metadata` from `dict[str, str]`
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python, yaml
- Domain
- documentation
Research direction
Start with the custom_metadata section of CEP 37 and compare it with conda-lock's LockMeta.custom_metadata type in conda_lock/lockfile/v1/models.py. Review conda-lockfiles PR 132 and the existing LockMeta.or merge behavior; done means the accepted specification and implementation support structured YAML values without breaking existing string metadata.
Written by the indexing model from the issue text.
Description
CEP 37 specifies metadata.custom_metadata as dict[str, str], free-form key-value string pairs. The current conda-lock implementation enforces this via a StrictModel.
The string constraint is fine for flat annotations (a git SHA, a build ID, a commit URL), but it breaks down as soon as anyone wants to stash a structured payload there.
Concrete example: in conda-lockfiles (https://github.com/conda-incubator/conda-lockfiles/pull/132) I'm recording user-requested MatchSpec strings so that exported lockfiles carry user intent, not just the pinned solve. That's a list[str]. The spec forces me to JSON-encode it and embed it as a single string:
custom_metadata:
created_by: conda-lockfiles 0.1.x
requested_specs: '["python_abi", "python >=3.11"]'
versus what the YAML actually wants to be:
custom_metadata:
created_by: conda-lockfiles 0.1.x
requested_specs:
- python_abi
- python >=3.11
The JSON-string form is less diffable, less greppable, and hides structure from anyone casually reading the lockfile. It also means every consumer has to know which keys are JSON-encoded and which aren't.
What I'd like to see
Widen the type to something like dict[str, str | int | bool | list | dict] or dict[str, Any] (effectively "any YAML-scalar-or-container value"). That keeps the intent (free-form user metadata) and removes the string wrapper workaround.
Lockfile writers that don't want to generate structured values can continue to write flat strings and nothing changes for them. Consumers need to handle more value types, but arguably they already need to: conda-lock's LockMeta.__or__ merges custom_metadata dicts today, which would produce surprising results with JSON-string collision anyway.
Why now
CEP 37 is accepted but very recent (March 2026) and conda-lock's implementation is the only one that meaningfully enforces it. Catching this before a second implementation bakes in the same constraint seems worthwhile.
Alternatives considered
- Invent a sibling block. CEP 37 already lists
git_metadata,inputs_metadata,time_metadataas structured cousins ofcustom_metadata. I could propose a new structured block per use case, but that explodes the spec and misses the point:custom_metadatais the escape hatch, it should actually work as one. - Keep JSON-strings as the convention. Works, ships today, ugly forever.
Prior art
- conda-lock
LockMeta.custom_metadatatype: https://github.com/conda/conda-lock/blob/main/conda_lock/lockfile/v1/models.py - CEP 37 text: https://github.com/conda/ceps/blob/main/cep-0037.md#custom_metadata
- Downstream use case: https://github.com/conda-incubator/conda-lockfiles/pull/132
- Dominant language
- No language data
- Stars
- 35
- Forks
- 43
- Avg merge
- 2h 11m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from conda/ceps
-
Difficulty 2/5 1-3 hours Newbie friendliness 54/100
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
-
Difficulty 3/5 Half a day Newbie friendliness 28/100
-
Difficulty 5/5 Over a week Newbie friendliness 32/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
-
Reloading /package-documentation/ shows pkgdown README instead of version chooserPossibly taken @ANAMASGARD claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
PecanProject/PecanProject.github.io#206 · 1 comment ·
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 76/100
slackapi/slack-health-score#253 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
vercel-labs/agent-skills#385 ·
-
area:docs type:docs
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
jejjohnson/gauss_flows#246 ·
Maintainers usually reply within 1 day