phase2-onboarding: adopt Phase 0 contract for m-cli-extras#2
Merged
Conversation
Onboards m-cli-extras as a Tier-2 entry to the org-level AI-discoverability catalog. Mirrors the contract shape used by m-modern-corpus (generator-based exposed payload) and m-test-engine (authored-from-scratch AGENTS.md + check-manifest.py drift gate). Adds: - AGENTS.md (+ CLAUDE.md symlink): YAML descriptor (kind=plugin-host, exposes.plugins, companions.m-cli=consumer-of-this-plugin-group) plus the five required Phase-0 sections (Setup / Test / Build / Verify / Guardrails). Calls out the not-a-CLI semantics, the don't-hand-edit-dist/plugins.json gate, the new-plugin-as-own-subdir convention, and m-stdlib's architectural priority. - tools/gen-plugins.py: stdlib-only deterministic generator (tomllib). Reads pyproject.toml's [project.entry-points."m_cli.plugins"] table and emits dist/plugins.json with schema_version="1", sorted by plugin name, 2-space indent, trailing newline. Byte-identical on re-run against an unchanged pyproject.toml (verified locally). - tools/check-manifest.py: copied verbatim from tree-sitter-m. Validates dist/repo.meta.json shape + that exposes.* paths resolve on disk. - dist/plugins.json: today's output — the corpus-stats plugin. - dist/repo.meta.json: id=tool:m-cli-extras, role=out-of-tree m-cli plugins, exposes.plugins + exposes.pyproject_toml, consumes=[tool:m-cli], verification_commands=[make manifest, make check-manifest, make test]. Extends: - Makefile: three new .PHONY targets — manifest, check-manifest, check-docs-prose. Existing dev targets (test/lint/format/mypy/cov/ check/clean) untouched. - .github/workflows/ci.yml: two engine-free steps inserted BEFORE the sibling-clone / uv-sync / test steps so a broken manifest fails fast without paying the install cost. - .gitignore: dist/ → dist/* with !dist/repo.meta.json and !dist/plugins.json exceptions. Same fix tree-sitter-m's onboarding needed (see its commit ade59d6); without this, the Python-default dist/ ignore silently drops the Phase-0 contract artifacts. Local verification (all green): - make manifest twice → byte-identical dist/plugins.json (md5 match) - make check-manifest → 0 - make check-docs-prose → no docs/ ✓ - canonical Track-A validator (.github/profile/build/validate-repo-meta.py) → OK: dist/repo.meta.json DON'Ts honored: no changes to .github/ (org-side update is a separate coordinated follow-up); no new runtime deps (tools/gen-plugins.py is stdlib-only, tomllib lands in Python 3.11+). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Onboards
m-cli-extrasas a Tier-2 entry to the org-level AI-discoverability catalog. Pattern mirrorsm-modern-corpus(generator-based exposed payload) andm-test-engine(authored-from-scratchAGENTS.md+tools/check-manifest.pydrift gate).AGENTS.md(+CLAUDE.mdsymlink) — YAML frontmatter descriptor (kind: [tool, plugin-host],exposes.plugins,companions.m-cli = consumer-of-this-plugin-group) plus the five required Phase-0 sections (Setup / Test / Build / Verify / Guardrails). Calls out the not-a-CLI semantics, the don't-hand-edit-dist/plugins.jsonrule, the new-plugin-as-its-own-subdir convention, and m-stdlib's architectural priority over m-cli-extras.tools/gen-plugins.py— stdlib-only deterministic generator (tomllib). Reads[project.entry-points."m_cli.plugins"]frompyproject.tomland emitsdist/plugins.jsonwithschema_version="1", sorted by plugin name, 2-space indent, trailing newline. Byte-identical on re-run (md5 verified).tools/check-manifest.py— copied verbatim from tree-sitter-m. Validatesdist/repo.meta.jsonshape + that everyexposes.*path resolves on disk.dist/plugins.json— today's emission, listing the one shipped plugin (corpus-stats→m_cli_extras.corpus_stats.cli:register).dist/repo.meta.json—id: tool:m-cli-extras, role = out-of-tree m-cli plugins,exposes:plugins+pyproject_toml,consumes: [tool:m-cli],verification_commands: [make manifest, make check-manifest, make test],verified_on: 2026-05-10.Makefile— three new.PHONYtargets added (manifest,check-manifest,check-docs-prose). Existing dev targets untouched..github/workflows/ci.yml— two engine-free steps (make check-manifest,make check-docs-prose) inserted before the sibling-clone /uv sync/ test steps, so a broken manifest fails fast without paying the install cost..gitignore—dist/→dist/*with!dist/repo.meta.jsonand!dist/plugins.jsonexceptions. Same fix tree-sitter-m's onboarding needed in commitade59d6— without this, Python's defaultdist/ignore silently drops the Phase-0 contract artifacts.Local verification (all green)
Plugins enumerated
{ "plugins": [ { "module": "m_cli_extras.corpus_stats.cli:register", "name": "corpus-stats", "registered_by": "m_cli.plugins" } ], "schema_version": "1" }Out of scope (deliberate)
m-dev-tools/.github. Org-side catalog refresh is a separate coordinated follow-up.tools/gen-plugins.pyis stdlib-only (tomllib, Python 3.11+).Test plan
make manifesttwice produces byte-identicaldist/plugins.jsonmake check-manifestexits 0 locallymake check-docs-proseexits 0 locallyOK: dist/repo.meta.json