Skip to content

phase0-B: add repo.meta.json + manifest drift gate#2

Merged
rafael5 merged 2 commits into
mainfrom
phase0-B-repo-meta
May 10, 2026
Merged

phase0-B: add repo.meta.json + manifest drift gate#2
rafael5 merged 2 commits into
mainfrom
phase0-B-repo-meta

Conversation

@rafael5
Copy link
Copy Markdown
Collaborator

@rafael5 rafael5 commented May 10, 2026

Summary

Implements Track B of the Phase 0 plan (.github/docs/phase0-plan.md §3).

  • AGENTS.md adoptedgit mv CLAUDE.md AGENTS.md + re-symlinked CLAUDE.md → AGENTS.md. The five required sections (Setup / Test / Build / generate / Verify / Guardrails) appended; the existing project-context body is preserved verbatim.
  • dist/repo.meta.json authored — \$schema points at the org-level Track A schema; exposes declares modules → dist/stdlib-manifest.json and errors → dist/errors.json; consumes: [tool:m-test-engine]; verification_commands: [make manifest, make test, make check-manifest].
  • make check-manifest added — wraps the existing manifest-check (regen + git-diff drift gate) and additionally asserts dist/repo.meta.json is committed and schema-shaped.
  • tools/gen-manifest.py — small tweak in support of the gate.
  • CI — existing manifest drift step at .github/workflows/ci.yml:72 widened to make check-manifest.
  • .gitignoredist/ is already not ignored here; payloads ship committed as designed.

Validation status (2026-05-10)

Track A is published. Verified against the live Track A schema:

✓ m-stdlib dist/repo.meta.json validates against
  https://raw.githubusercontent.com/m-dev-tools/.github/main/profile/repo.meta.schema.json
  modules: dist/stdlib-manifest.json  exists=True json-parses-✓
  errors:  dist/errors.json           exists=True json-parses-✓

Test plan

  • make check-manifest green locally
  • dist/repo.meta.json validates against the live Track A schema
  • Every exposes.* payload exists; both .json payloads parse
  • CI green on this PR — note: m-stdlib's CI on main has been red for unrelated reasons (container safe.directory / YDB workspace setup; see commits between f17acce3ca830b). The manifest-check/check-manifest step itself runs late in the job and should reflect Phase-0 status accurately once the earlier failure is sorted.

Phase 0 tier-1 contract for m-stdlib per
.github/docs/phase0-plan.md §3 (Track B).

Changes:
  - dist/repo.meta.json — hand-edited manifest with $schema pointing
    at the org-level schema (Track A, pending push); exposes the
    generated payloads modules + errors; verification_commands match
    AGENTS.md.
  - CLAUDE.md → AGENTS.md (git mv) with CLAUDE.md re-symlinked to
    AGENTS.md. Appended the five required sections (Setup, Test,
    Build / generate, Verify, Guardrails); existing project-context
    body preserved verbatim.
  - Makefile — new `check-manifest` target wraps the existing
    `manifest-check` and additionally asserts dist/repo.meta.json
    is tracked + clean. Composes rather than duplicates the existing
    gate.
  - .github/workflows/ci.yml — CI's "Manifest drift check" step now
    runs `make check-manifest` (was `make manifest-check`). The
    new wrapper subsumes the old behavior.
  - tools/gen-manifest.py — read changelog from
    docs/tracking/changelog.md (the file moved out of repo root
    per the four-bucket tracking model). Old location still
    checked as a fallback for back-compat. Without this,
    `make manifest` produced an empty stdlib_version and
    manifest-check failed on every fresh clone.

B1 audit:
  - dist/stdlib-manifest.json + dist/errors.json regenerated by
    `make manifest` (tools/gen-manifest.py).
  - CLAUDE.md existed at repo root; AGENTS.md adopted as
    canonical.
  - CI workflow is .github/workflows/ci.yml on push to main +
    pull_request; already had a manifest drift step at line 72,
    now widened to `make check-manifest`.
  - dist/ is NOT in .gitignore — payload files are committed
    as designed.

Verification:
  - Schema validation against the local repo.meta.schema.json
    in m-dev-tools/.github/profile/ exits 0 with --no-resolve.
    Full resolve-mode verification deferred until Track A is
    pushed and the validator's path-resolution mode is
    reconciled with the "relative to repo root" convention
    described in the schema.
  - `make check-manifest` is green on the post-commit tree.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
rafael5 added a commit that referenced this pull request May 10, 2026
* fix: default M to bare `m` so CI's PATH lookup works

CI installs m-cli into /tmp/venv and prepends /tmp/venv/bin to PATH,
so `m` is resolvable as a bare name. The Makefile defaulted M to
$(HOME)/projects/m-cli/.venv/bin/m — a maintainer-local absolute
path that doesn't exist on the GitHub-hosted runner — so every
target that invokes $(M) (fmt, fmt-check, lint, test, coverage)
failed with "No such file or directory" before the underlying tool
ran. CI has been failing on main for several commits because of this.

Switch the default to `M ?= m` (matches the convention m-cli and
m-standard already use). Maintainers who keep an unactivated m-cli
venv can override per-shell or per-invocation:

  make fmt-check M=$HOME/projects/m-cli/.venv/bin/m

Verified locally with `PATH=$HOME/projects/m-cli/.venv/bin:$PATH
make fmt-check` → exits 0, 81 files formatted.

Unblocks PR #2 (phase0-B repo.meta.json), which inherited the
pre-existing main breakage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(gen-manifest): look at moved changelog path

`read_stdlib_version()` was reading `CHANGELOG.md` at the repo root,
but commit 90e694e moved that file to `docs/tracking/changelog.md`
without updating the generator. CI's `make manifest-check` therefore
regenerated `dist/stdlib-manifest.json` with `stdlib_version=""`,
diffing against the committed `v0.5.0` value (last regenerated in
7e33e6b — before the move). The maintainer's local runs likely got
lucky with a stale cache or a CHANGELOG symlink.

Fix: probe the new path first, fall back to the old one for back-
compat with checkouts predating the move. Verified locally —
`make manifest` produces zero drift against the committed dist/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: default M to bare `m` so CI's PATH lookup works

CI installs m-cli into /tmp/venv and prepends /tmp/venv/bin to PATH,
so `m` is resolvable as a bare name. The Makefile defaulted M to
$(HOME)/projects/m-cli/.venv/bin/m — a maintainer-local absolute
path that doesn't exist on the GitHub-hosted runner — so every
target that invokes $(M) (fmt, fmt-check, lint, test, coverage)
failed with "No such file or directory" before the underlying tool
ran. CI has been failing on main for several commits because of this.

Switch the default to `M ?= m` (matches the convention m-cli and
m-standard already use). Maintainers who keep an unactivated m-cli
venv can override per-shell or per-invocation:

  make fmt-check M=$HOME/projects/m-cli/.venv/bin/m

Verified locally with `PATH=$HOME/projects/m-cli/.venv/bin:$PATH
make fmt-check` → exits 0, 81 files formatted.

Unblocks PR #2 (phase0-B repo.meta.json), which inherited the
pre-existing main breakage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(gen-manifest): look at moved changelog path

`read_stdlib_version()` was reading `CHANGELOG.md` at the repo root,
but commit 90e694e moved that file to `docs/tracking/changelog.md`
without updating the generator. CI's `make manifest-check` therefore
regenerated `dist/stdlib-manifest.json` with `stdlib_version=""`,
diffing against the committed `v0.5.0` value (last regenerated in
7e33e6b — before the move). The maintainer's local runs likely got
lucky with a stale cache or a CHANGELOG symlink.

Fix: probe the new path first, fall back to the old one for back-
compat with checkouts predating the move. Verified locally —
`make manifest` produces zero drift against the committed dist/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rafael5 rafael5 merged commit de250b0 into main May 10, 2026
2 checks passed
@rafael5 rafael5 deleted the phase0-B-repo-meta branch May 10, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant