feat: versioned metadata-only environment discovery (RFC 011) - #1138
feat: versioned metadata-only environment discovery (RFC 011)#1138thegovind wants to merge 5 commits into
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
@burtenshaw tagging you for review of the RFC 011 catalog producer and discovery CLI, especially source identity, snapshot completeness, and the declaration-only profile. The independent public consumer is in huggingface/hf-discover#46. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b1b0ed0. Configure here.

Summary
Implements the first metadata-only repository discovery profile from RFC 011,
merged in #1093.
source/path/revision and interface-role invariants.
pinned Git tree. It reuses authored manifest, package and README metadata,
records provenance, and never imports candidate code.
openenv catalog build,openenv catalog inspect, and a read-onlyopenenv discover --cataloglexical baseline.same-snapshot identifier lookup, and correction/supersession/withdrawal
comparison.
No runtime endpoint, environment installation, image pull, candidate probing,
tool invocation, reset/step, or execution-policy boolean is added.
Profile decisions
This draft implements
0.1-draft: GitHub source definitions, explicit publisherconfiguration, complete inline snapshots, and declared interfaces only. It does
not pretend to verify RFC 008 runtime evidence or duplicate the normalized
validation manifest. Unsupported profiles and validated claims fail explicitly.
The initial inventory is the configured Git tree's direct-child
openenv.yamldefinitions, not every deployment or community environment. Upstream source
revision
bbd27cc959df6f6e7c961d58a9b0104be7aec0c9produces 39 records.A failed eligible record still makes the inventory incomplete; logging it does
not make the build complete.
The CLI requires an explicit snapshot. Automatic remote retrieval and a central
registry are not introduced. GitHub Actions artifacts are reviewable outputs,
not an assertion that every finder already indexes them.
Validation
84 optional-dependency skips and 37 excluded integration/network/Docker cases
in each matrix job.
rebuilds, uncommitted-file isolation, symlink rejection, duplicate metadata,
cross-revision mismatches, missing wire claims, malformed snapshots, exact
lookup, lexical selection, and lifecycle failures. Wrong-root regressions
recompute valid digests before asserting scope rejection.
package and repository scope, conflicting file/text tables, and matching query
cardinality across declaration/entry models and their packaged JSON schemas.
implemented HF discovery consumer. Every complete card round-tripped unchanged
through six HTTP pages and MCP search.
lint, documentation sync, and whitespace checks completed.
CI and the follow-up Cursor Bugbot review passed on commit
e262d0d8c24a2340325554ddb1efc25bb2633569:https://github.com/huggingface/OpenEnv/actions/runs/34401634980
An earlier Python 3.12 job missed an unchanged rubric test's 100ms wall-clock
bound. That test and its runtime files match upstream. The target passed
locally alongside the discovery and CLI tests, and one unchanged CI rerun
passed. No timing threshold, assertion or reward logic was changed.
The repository lint hook reformats and checks out modified files; the equivalent
non-mutating formatter/import-sort/lint checks were used instead to preserve the
change set. No assertions were removed and no runtime tests were replaced by
success-shaped fallbacks.
Review focus
Please review the explicit repository profile, publisher namespace contract,
metadata precedence, and the local snapshot publication/consumption boundary.
Finder integrations are separate consumers, not implementation details of the
OpenEnv runtime.
Public companions:
Note
Medium Risk
Large new public library and CLI surface with Git subprocess reads and catalog integrity rules; behavior is read-only metadata and does not execute environments, but incorrect contracts could mislead consumers about licenses or inventory completeness.
Overview
Adds RFC 011
0.1-draft: revision-bound, metadata-only environment discovery separate fromAutoEnvruntime loading.A new
openenv.discoverypackage defines Environment Cards, catalog snapshots (with SHA-256 digests), strict Pydantic invariants, packaged JSON schemas, and a Git-pinned producer that inventories direct-childenvs/*/openenv.yamlfrom tracked trees only—reading manifests,pyproject.toml, README frontmatter, and optionaldiscovery.jsonwithout importing environment code.CLI:
openenv catalog build/inspectand top-levelopenenv discoverfor lexical search, exact filters, and identifier lookup against an explicitly configured local snapshot (no remote fetch). Incomplete builds remain inspectable but fail load/search lifecycle use;compare_catalogstracks adds, withdrawals, supersession, and corrections.Supporting changes:
envs/echo_env/discovery.jsonexample, schema generation script, Discovery catalog GitHub Actions artifact job, docs guide,packagingruntime dep, and broad contract/integration tests (symlinks, license precedence, digest tampering, byte-identical rebuilds).Reviewed by Cursor Bugbot for commit e262d0d. Bugbot is set up for automated code reviews on this repo. Configure here.