Cross-platform CLI implementing multidimensional versioning: [ARCH].[FEAT].[PROT].[FIX]-[CONT].
Package SemVer / release tags project to ARCH.FEAT.FIX. Protocol (PROT) stays in mvs.json for host/extension compatibility. The scheme itself is specified independently of this tool in docs/SPEC.md, so other implementations can exist.
To mark your own project's README, add the same badge:
[](https://github.com/alextheberge/MVSengine)The companion extension mvs-vscode runs mvs-manager from the editor, surfaces lint --format json in the Problems view, and exposes MVS commands. Install from a VSIX, the VS Marketplace, or Open VSX as described in that repository. Keep mvs-manager on your PATH or point the extension at the binary with mvsManager.executablePath.
- Separate data breaks from integration breaks:
ARCHandPROTmove independently. - Stop silent plugin/SDK regressions:
lintfails when public API or AI contract drift is unaccounted. - Keep compatibility explicit: protocol ranges, legacy shims, capabilities, and context live in
mvs.json.
curl -fsSL https://raw.githubusercontent.com/alextheberge/MVSengine/master/scripts/install.sh | bashirm https://raw.githubusercontent.com/alextheberge/MVSengine/master/scripts/install.ps1 | iexOnce installed, mvs-manager can update itself with:
mvs-manager self-updateself-update downloads the release archive and checksums.txt over HTTPS inside the running binary, verifies SHA-256, extracts mvs-manager (or mvs-manager.exe), and installs next to the current executable. It does not run curl | bash or irm | iex on the install scripts. For debugging only, you can set MVS_LEGACY_SHELL_INSTALL=1 to restore that legacy path (not recommended for production).
self-update refuses Cargo target/debug|release, Nix store, or read-only locations unless you set MVS_ALLOW_UNSAFE_SELF_UPDATE=1. Forks should set MVS_REPO / MVS_UPDATE_REPO to owner/name so updates match install.sh.
See docs/SUPPLY_CHAIN.md for what is verified on upgrade and what is not.
Interactive runs of the CLI also notify on stderr when a newer stable release is available (GitHub releases/latest only—prereleases are not advertised there).
Diagnostics and install troubleshooting:
mvs-manager doctorSee docs/INSTALL_AND_CI.md for CI env vars, the Linux/macOS/Windows PR gate, and pinned installs; docs/DISTRIBUTION.md for packaging; docs/SUPPLY_CHAIN.md for TLS, minisign, and download limits on self-update.
mvs-manager generate --root . --manifest mvs.json --context cliDecorator syntax can be function-style or : style:
// @mvs-feature("offline_storage")
// @mvs-protocol("auth-api-v1")
export function login(user: string): string {
return user;
}/// @mvs-feature("runtime_bridge")
/// @mvs-protocol("host_extension_handshake")
pub fn handshake(version: u32) -> bool {
version > 0
}Only actual source comments are scanned. Examples embedded in string literals, test fixtures, or documentation blobs inside source files do not count as decorators.
# verify current code matches mvs.json
mvs-manager lint --root . --manifest mvs.json
# after code/decorator/API changes, reconcile and persist rationale/history
mvs-manager generate --root . --manifest mvs.json --context cli
# bug fix / minor release with no FEAT or PROT drift
mvs-manager generate --root . --manifest mvs.json --context cli --fixPin the CLI as a CI/tool dependency (GitHub Action, npm wrapper, or install.sh) — see docs/INSTALL_AND_CI.md. The stable 2.x identity contract is in docs/CONTRACT_2X.md.
Or keep it running as a maintenance loop while you work:
mvs-manager watch --root . --manifest mvs.json --remediate --interval-secs 30For schedulers such as cron, launchd, or systemd, use one-shot mode:
mvs-manager watch --root . --manifest mvs.json --once --remediatemvs-manager derives the registry-facing SemVer projection (ARCH.FEAT.FIX) from mvs.json, but package managers each read that version from their own file. sync keeps those files in lock-step without hand-editing them:
# Auto-detects Cargo.toml, package.json, pyproject.toml, pom.xml, and other
# well-known version files when release.version_files is empty.
mvs-manager sync --root . --manifest mvs.json --check # CI gate: fails on drift
mvs-manager sync --root . --manifest mvs.json # writes the projection in place
mvs-manager sync --root . --manifest mvs.json --save-detected # persist what was auto-detectedOnly the version span inside each file is touched; every other byte of formatting is preserved. Declare files explicitly instead of relying on auto-detection by adding a release.version_files array to mvs.json:
{
"release": {
"version_files": [
{ "path": "Cargo.toml", "kind": "cargo_toml" },
{ "path": "packages/mvs-manager/package.json", "kind": "npm_package_json" }
]
}
}Supported kind values: cargo_toml, npm_package_json, pyproject_pep621, pyproject_poetry, composer_json, pubspec_yaml, gradle_properties, build_gradle, pom_xml, csproj, gemspec_literal, ruby_version_constant, lua_rockspec, plain_version_file. An optional projection of full writes the complete identity.mvs string instead of the default semver projection.
mvs-manager semver prints the SemVer projection for scripts and CI (2.6.1), with --for git-tag|npm|cargo|pep440|go|maven|docker|all for ecosystem-specific syntax, --prerelease, and --with-prot to carry PROT as build metadata (2.6.1+prot.6) so it isn't lost in places that only see a version string. See docs/USAGE.md section 10.
convert-version parses a legacy version string (SemVer, ZeroVer, PEP 440, Maven/Gradle, .NET four-part, Go module tags, CalVer, a bare build number, Debian/RPM epoch:version-revision, or a custom regex) and maps it onto MVS axes, so you can see what a migrated identity would look like before touching mvs.json:
mvs-manager convert-version --version 1.4.2 # -> 1.4.0.2-cli (SemVer default mapping)
mvs-manager convert-version --version 0.3.1 # ZeroVer: flags minor bumps as often-breaking
mvs-manager convert-version --version 24.04 # CalVer: rebases to 1.0.0.0-cli by default
mvs-manager convert-version --version 24.04 --map year=arch,month=feat,patch=fix # date-passthrough instead
mvs-manager convert-version --version "2:1.4.2-3ubuntu1" --scheme debian-rpm # epoch folds into ARCH
mvs-manager convert-version --version "1.2.3.4" --scheme dotnet4 # 4th component flagged, not silently dropped
mvs-manager convert-version --version "R7-F12-P3" --scheme custom \
--scheme-regex '(?P<arch>\d+)-F(?P<feat>\d+)-P(?P<prot>\d+)' # fully custom mappingThe default component -> axis mapping for each scheme, and every axis not covered by it, is documented in docs/USAGE.md. --map replaces the mapping entirely; advisories in the output call out anything a scheme's numbering can't fully represent (a dropped .NET revision, a folded PEP 440/Debian epoch, CalVer's rebase choice) so nothing is silently discarded. convert-version only prints a conversion for one version string; migrate (below) turns that into a full, reversible migration of a project.
migrate takes a project from any versioning scheme to MVS in one flow, using convert-version's scheme translators under the hood:
mvs-manager migrate detect --root . # what version sources, git tags, and release tooling exist
mvs-manager migrate plan --root . --context cli # preview the proposed mvs.json; writes nothing
mvs-manager migrate backfill --root . --limit 30 # replay git tag history for a SemVer-honesty report
mvs-manager migrate apply --root . --context cli # write mvs.json, sync version files, save a snapshot
mvs-manager migrate rollback --root . # undo the last apply from its snapshotdetectlists every recognized version file (flagging disagreement between them), the git tag history, the auto-detected scheme, and any release tooling it recognizes (.bumpversion.cfgandtbump.tomlhave their declared file lists imported directly into the proposedrelease.version_files; semantic-release, release-please, changesets, GitVersion, Nerdbank.GitVersioning, cargo-release, goreleaser, and lerna are detected by config presence).planconverts the latest git tag (or--from-version, or a detected version file, in that order) into a proposed identity, scan policy, andrelease.version_files, plus a full legacy-tag -> MVS-identity preview table. It refuses to propose a SemVer projection lower than the latest published tag unless you pass--allow-non-monotonic.backfillchecks out each of the last--limitgit tags into a disposable worktree, crawls it, and diffs consecutive snapshots to find SemVer-honesty violations: a patch release that changed the public API/protocol surface (patches should carry zero surface change), or a minor release that removed surface (additions are fine in a minor under conventional SemVer; removals aren't). This is the strongest case for switching — it shows a team its own history of quietly-breaking releases.applyruns the same conversion asplanand writes it:mvs.json, plussync-ing every declared version file, after saving everything it's about to touch to.mvs/migration-snapshot.json. Refuses to overwrite an existing manifest without--force.rollbackrestores exactly whatapplyoverwrote (deletingmvs.jsonif it didn't exist before) and removes the snapshot, so a rollback runs cleanly exactly once per apply.
Hand-placing @mvs-feature/@mvs-protocol comments is the biggest manual cost in adopting MVS. suggest-decorators proposes them from the code you already have:
mvs-manager suggest-decorators --root . # preview; writes nothing
mvs-manager suggest-decorators --root . --write # insert them- One protocol suggestion per undecorated file that has public API surface (a boundary); one feature suggestion per undecorated directory of such files (a capability cluster), placed on that directory's alphabetically-first file.
- Names come from the file/directory path (
src/auth/login.rs-> protocolauth_login), but a name is replaced with a matching Conventional Commits scope's own spelling when one exists in recent history —feat(offline-storage): ...in your log means the suggested feature isoffline-storage, not a re-derivedoffline_storage. - Already-decorated files/directories are never suggested again, so
--writeis idempotent: run it, then run it again, and the second run finds nothing left to propose. --writeinserts each decorator using that file's own comment syntax (///for Rust,//for TS/JS/Go/Java/Kotlin/C#/Swift/Dart,#for Python/Ruby,--for Lua/Luau, right after PHP's<?phptag) right after any leading header comment/shebang — the exact same comment tokenization the crawler reads back, so a written suggestion is guaranteed to be picked up by the very nextlint.- Non-code protocol surfaces (OpenAPI, GraphQL SDL,
.proto, JSON Schema, Avro) aren't covered yet — see the Roadmap.
A team can run MVS alongside its existing release process before deciding to gate on it:
mvs-manager lint --advisory --root . --manifest mvs.jsonShadow mode runs the exact same drift checks as lint, but always exits 0 and reports what MVS would require instead of failing the build: status is advisory_clean or advisory_drift, and a shadow object gives the projected identity (MVS would require 2.5.0.1-cli, currently 2.4.4.1-cli) alongside the current one. Because PROT never appears in the SemVer projection, this is often the clearest way to show a team a protocol break their existing process would publish invisibly.
- GitHub:
.github/actions/mvs-actionwithmode: shadowposts (and keeps updated) a single PR comment with the shadow summary and, when the base branch's manifest is reachable, the axis diff between base and head. See docs/INSTALL_AND_CI.md. - GitLab CI / CircleCI / Azure Pipelines / Buildkite: ready-made snippets in docs/INSTALL_AND_CI.md.
- pre-commit:
.pre-commit-hooks.yamlexposesmvs-lint-advisory(shadow) andmvs-lint(blocking) hook IDs for the pre-commit framework.
A downstream package that depends on yours doesn't need to adopt MVS to benefit from it. range converts a PROT compatibility range into the native constraint syntax for a package manager, using the manifest's history to find which published arch.feat.fix versions actually had a PROT value in that range:
mvs-manager range --manifest mvs.json --host --for npm,cargo,pip,maven
mvs-manager semver
mvs-manager semver --for git-tag --prerelease rc.1 --with-prot
mvs-manager semver --for all --format json
mvs-manager range --manifest mvs.json --min-prot 3 --max-prot 5 --for npm--host/--extension read compatibility.host_range/compatibility.extension_range from the manifest instead of explicit --min-prot/--max-prot. The lower bound is inclusive; the upper bound is exclusive and only present when a later published version with a different PROT is known — otherwise the range is left open, since future compatibility isn't assumed.
make install-hooksThis installs a repo-managed pre-commit hook that runs make lint-manifest.
- Enable Actions with write access:
- Repository Settings -> Actions -> Workflow permissions -> Read and write permissions
- Keep dogfood versions aligned:
make dogfood-sync-version make ci
- Push version changes to
mainormaster:Auto Tag Versionworkflow creates canonical tag automatically.- If
mvs.jsonis0.2.3-cli, canonical tag isv0.2.3.
- Wait for
Auto Tag Versionto dispatchReleaseand publish assets:mvs-manager-<version>-<target>.<tar.gz|zip>checksums.txt- If needed, run
Auto Tag Versionmanually from GitHub Actions (Run workflow) to force tag/release dispatch.
The installer (.../scripts/install.sh) depends on these release assets.
One-command flow from repo root:
make release-githubRelease-candidate flow:
make release-rc RELEASE_TAG_SUFFIX=rc1 RELEASE_ALLOW_NON_DEFAULT=truelatest installers intentionally ignore prerelease tags. To install an RC explicitly, set MVS_VERSION=vX.Y.Z-rcN.
make ci
make build-releasemvs-manager generate --root . --manifest mvs.json --context cli
mvs-manager generate --root . --manifest mvs.json --context edge.mobile --backwards-compatible 3
mvs-manager generate --root . --manifest mvs.json --context cli --public-api-root src/cli.rs
mvs-manager generate --root . --manifest mvs.json --context cli --public-api-root src/api.go --go-export-following package-only
mvs-manager generate --root . --manifest mvs.json --context cli --public-api-root src/lib.rs --rust-export-following public-modules
mvs-manager generate --root . --manifest mvs.json --context cli --exclude-path src/generated
mvs-manager generate --root . --manifest mvs.json --context cli --format json
mvs-manager lint --root . --manifest mvs.json
mvs-manager lint --root . --manifest mvs.json --format json
mvs-manager lint --root . --manifest mvs.json --available-model-capabilities tool_calling,json_schema,reasoning-v1
mvs-manager watch --root . --manifest mvs.json --remediate --interval-secs 30
mvs-manager watch --root . --manifest mvs.json --once --remediate
mvs-manager validate --host-manifest host.json --extension-manifest extension.json
mvs-manager validate --host-manifest host.json --extension-manifest extension.json --format json
mvs-manager validate --host-manifest host.json --extension-manifest extension.json --host-model-capabilities tool_calling,reasoning-v1
mvs-manager report --base-manifest old-mvs.json --target-manifest new-mvs.json
mvs-manager report --base-manifest old-mvs.json --target-manifest new-mvs.json --format json
mvs-manager sync --root . --manifest mvs.json --check
mvs-manager sync --root . --manifest mvs.json --save-detected
mvs-manager sync --root . --manifest mvs.json --dry-run --format json
mvs-manager convert-version --version 1.4.2
mvs-manager convert-version --version 24.04 --map year=arch,month=feat,patch=fix
mvs-manager convert-version --version "2:1.4.2-3ubuntu1" --scheme debian-rpm
mvs-manager migrate detect --root .
mvs-manager migrate plan --root . --context cli
mvs-manager migrate backfill --root . --limit 30
mvs-manager migrate apply --root . --context cli
mvs-manager migrate rollback --root .
mvs-manager suggest-decorators --root .
mvs-manager suggest-decorators --root . --write
mvs-manager lint --root . --manifest mvs.json --advisory
mvs-manager range --manifest mvs.json --host --for npm,cargo,pip,maven
mvs-manager self-update --check
mvs-manager self-updatemvs.json persists version-change rationale in history, enabling compatibility reports to explain protocol breaks (for example, auth-flow changes tied to a specific PROT).
watch is the maintenance-oriented workflow: it repeatedly runs lint, can auto-run generate when drift is found via --remediate, skips unchanged cycles by default, and supports --once for scheduler-friendly single-pass runs.
The stable 2.x manifest and command-output contract is documented in docs/CONTRACT_2X.md (identity) with command JSON continuity from docs/CONTRACT_1X.md. Checked-in golden fixtures under tests/fixtures/contracts/ back that contract so output and canonical evidence changes stay deliberate.
mvs-manager now stores the semantic surfaces it reasons about, not just their hashes. The evidence block in mvs.json includes:
feature_inventory: sorted unique@mvs-feature(...)tag namesprotocol_inventory: sorted unique@mvs-protocol(...)tag namespublic_api_inventory: sortedfile + canonical signatureentries for detected public API surfaces
This gives you two things:
- deterministic hashing for version-axis decisions
- machine-readable diffs explaining exactly what changed between manifest generations
- machine-readable boundary debugging in
generate --format jsonandlint --format jsonwhen scan policy shapes the public surface - scanner precision that ignores decorator-like examples inside source string literals
Typical evidence shape:
{
"evidence": {
"feature_hash": "…",
"protocol_hash": "…",
"public_api_hash": "…",
"feature_inventory": [
"manifest_generation",
"manifest_linting"
],
"protocol_inventory": [
"cli_generate_command",
"cli_lint_command"
],
"public_api_inventory": [
{
"file": "src/cli.rs",
"signature": "rust:enum Command"
}
]
}
}If an older manifest predates these inventory snapshots, lint will fail until you regenerate once. That is intentional: it brings the manifest up to the current evidence model.
Rust API entries are now AST-normalized into stable, readable forms such as:
rust:fn run() -> i32rust:impl-fn HostAdapter::connect(&self, target: &str) -> boolrust:fn async load<'a, T>(value: &'a T) -> &'a T where T: Clone
This reduces formatting noise in public_api_inventory and makes policy patterns easier to author.
The crawler now tokenizes source before matching decorators, uses AST extraction for Rust, and uses parser-backed public API adapters for every other supported language: TypeScript/JavaScript, Go, Python, Java, Kotlin, C#, PHP, Ruby, Swift, Lua, Luau, and Dart (Dart uses line-regex extraction today because the published Tree-sitter grammar targets a newer ABI than the tree-sitter 0.24 stack pinned here; see docs/USAGE.md). Shopify-style Liquid (.liquid) is scanned for decorators inside HTML comments, {% comment %}…{% endcomment %}, and {% # … %} tags; templates do not emit public_api entries.
Internally, parser-backed extraction now dispatches through dedicated language adapters under src/mvs/crawler/adapters/, with shared language metadata in src/mvs/crawler/language.rs. That keeps new language work localized instead of expanding one monolithic extractor path.
Member signatures inside class-like scopes are now owner-qualified, and Java/C#/Kotlin signatures also include declared package or namespace context so inventories stay stable across files and modules. Typical forms include python:def Worker.run_job(...), ruby:def Demo::AuthApi#login(...), java:type public class demo.AuthApi, java:field public String demo.AuthApi.status, csharp:property public string Demo.AuthApi.DisplayName { get }, kotlin:const val demo.auth.API_VERSION: String, kotlin:val demo.auth.AuthApi.token: String, php:public readonly string AuthApi.$token, and swift:public func AuthApi.login(...).
@mvs-feature(...)and@mvs-protocol(...)are counted only when they appear in real comments- block comments such as
/* ... */are supported for decorator extraction - string literals and embedded fixture blobs are ignored during decorator extraction
- TypeScript/JavaScript public API extraction handles multiline exports, named export clauses, re-exports, and default exports without depending on line-based regex matching;
scan_policy.ts_export_followingor--ts-export-followingcan follow same-workspace relative barrel re-exports, andworkspace_onlymode also follows same-workspacepackage.jsonexport maps andimportsmaps, including wildcard subpaths, multi-condition entries, and package-local monorepo self-references, plus roottsconfig.jsonorjsconfig.jsonbaseUrlandpathsaliases so facade files contribute the concrete signatures they export instead of rawexport ... fromstatements - Go public API extraction tracks exported
funcdeclarations, exported methods, exported named types, exported struct fields, exported embedded struct fields, exported interface methods, embedded interface type elements, exported constants, and exported packagevardeclarations from syntax trees;scan_policy.go_export_followingor--go-export-followingcan expand a rooted.gofacade file to same-package sibling source files while skipping_test.gofiles - Rust public API extraction still uses AST-normalized signatures, and
scan_policy.rust_export_followingor--rust-export-followingcan expand a rooted Rust facade such assrc/lib.rsacross same-cratepub modgraphs, including nested inline public modules, without pulling in private-module files ortests/examples/benches; direct and chained same-cratepub usefacades, including grouped and glob reexports that stay inside the crate, are also resolved onto the public alias names, including associated inherent methods, andscan_policy.rust_workspace_membersor--rust-workspace-membercan explicitly allow selected sibling crates when a facade intentionally reexports workspace members, including chained facade crates and crates with nonstandard[lib].pathroots - Python public API extraction tracks public
classand non-underscoredefdeclarations, publictypealiases, module-level constants such asAPI_VERSIONor__all__, and public class-level constants such asWorker.STATUS, without promoting nested local helpers or private class bodies into the API inventory; when a parseable__all__is present it becomes the top-level export boundary, including common alias, unpacking, and+=composition patterns built from parseable literals, and explicit import re-exports are stored in canonical forms such aspython:from auth.core import login as authorize; for same-workspace Python modules, imported__all__aliases andfrom ... import *re-exports also resolve when the source module export graph is static and parseable, andscan_policy.python_export_followingplusscan_policy.python_module_rootsor--python-module-rootcan pin how aggressively module resolution follows nonstandard repository roots - Java public API extraction tracks public types, public fields, interface constants, and public or interface methods while stripping leading annotations out of the stored signature; declared package plus nesting context is preserved in canonical forms such as
java:type public class demo.AuthApi,java:field public String demo.AuthApi.status,java:const public static final String demo.AuthApi.Contract.STATE, andjava:method public String demo.AuthApi.login(...) - C# public API extraction tracks public types, public fields, public constants, public properties, and public or interface methods while stripping leading attributes out of the stored signature; declared namespace plus nesting context is preserved in canonical forms such as
csharp:type public class Demo.AuthApi,csharp:field public static readonly string Demo.AuthApi.Version,csharp:const public string Demo.AuthApi.STATUS_READY,csharp:property public string Demo.AuthApi.DisplayName { get }, andcsharp:method public static string Demo.AuthApi.Login(...) - Kotlin public API extraction tracks public or default-visible
class,interface,object,fun,val,var, and top-levelconst valdeclarations, preserving modifiers such asdataandsuspendwhile skippingprivate,protected, andinternal; declared package plus nesting context is preserved in canonical forms such askotlin:public class demo.auth.AuthApi,kotlin:const val demo.auth.API_VERSION: String,kotlin:fun demo.auth.AuthApi.login(...), andkotlin:val demo.auth.AuthApi.token: String - PHP public API extraction tracks top-level functions and constants, classes, interfaces, traits, enums, public properties, public or interface constants, and public or interface methods while treating
#comments as decorators and ignoring attribute syntax in stored signatures; class and interface members are owner-qualified asAuthApi.run(...),AuthApi.$token, andAuthApi::STATUS_READY - Ruby public API extraction tracks
class,module, publicdef, singleton methods,class << selfmethod bodies, publicattr_reader/attr_writer/attr_accessormacros, and constant assignments within public namespaces while ignoring heredoc fixture content;private_constanthides constants untilpublic_constantre-exposes them,module_functionandextend selfpromote module exports into singleton signatures,private_class_methodremoves hidden singleton methods, and member signatures use Ruby owner forms such asDemo::AuthApi#login(...)andDemo::AuthApi.connect(...);scan_policy.ruby_export_followingor--ruby-export-followingcan keep that macro-driven export shaping enabled or reduce Ruby scanning to file-local declarations only - Lua public API extraction tracks global
functiondeclarations and returned module-table exports such asApi.connect = function(...) end,function Api:refresh(...), and named fields from returned tables, while--and long-bracket comments remain decorator-aware; when a file returns a module root such asreturn Api, that returned root becomes the export boundary and unrelated globals stop counting;scan_policy.lua_export_followingor--lua-export-followingcan disable returned-root following or require explicit returned roots before runtime exports are inferred - Swift public API extraction tracks
publicandopentypes, functions, properties, and inherited protocol requirements, and the scanner masks multiline Swift string literals so embedded examples do not pollute evidence; type and protocol members are owner-qualified asswift:public func AuthApi.login(...)andswift:public var SessionContract.token: ... - Luau public API extraction tracks global
functiondeclarations,export typedefinitions, and returned module-table exports such asApi.connect = function(...) end,function Api:refresh(...), and named fields from returned tables; when a file returns a module root such asreturn Api, that returned root becomes the runtime export boundary whileexport typedeclarations remain explicit API - Dart public API extraction uses comment-aware scanning plus line-regex heuristics for classes, mixins, enums, extensions, typedefs, fields, getters, setters, and callables; a
librarydirective qualifies signatures with a dotted prefix, and names starting with_are skipped as library-private. Typical stored forms includedart:type demo.class AuthApi,dart:field demo.static const String VERSION =, anddart:function demo.String login(String username)
If you already track Java, C#, or Kotlin API evidence, expect one regeneration after this change because canonical signatures now include declared package or namespace prefixes.
This matters for repositories that keep code examples, fixture payloads, or prompt templates alongside real source. Those examples no longer pollute mvs.json.evidence.
You can persist scan policy in mvs.json so public API evidence reflects the contract you actually support instead of every reachable pub item.
The scan_policy block supports:
public_api_roots: relative file or directory roots that define the public API boundaryts_export_following: TypeScript/JavaScript barrel-following mode:off(default),relative_only, orworkspace_onlygo_export_following: Go package expansion mode:off(default) orpackage_onlyrust_export_following: Rust module-following mode:off(default) orpublic_modulesrust_workspace_members: relative crate directories orCargo.tomlpaths that Rust facade following may resolve across when a facade intentionally reexports selected workspace membersruby_export_following: Ruby export-shaping mode:heuristic(default) orofflua_export_following: Lua/Luau runtime export mode:heuristic(default),returned_root_only, oroffpython_export_following: Python cross-module export resolution mode:heuristic(default),roots_only, oroffpublic_api_includes: wildcard patterns for declarations that should count as public APIpublic_api_excludes: wildcard patterns for declarations that should not count as public APIpython_module_roots: relative directory roots used to resolve same-workspace Python module names before following__all__, explicit re-exports, orfrom ... import *facadesexclude_paths: relative file or directory prefixes to skip entirely during tag and API scanning
Example:
{
"scan_policy": {
"public_api_roots": [
"src/cli.rs"
],
"ts_export_following": "workspace_only",
"go_export_following": "package_only",
"rust_export_following": "public_modules",
"rust_workspace_members": [
"crates/shared"
],
"ruby_export_following": "off",
"lua_export_following": "returned_root_only",
"python_export_following": "roots_only",
"public_api_excludes": [
"rust:const EXIT_*",
"rust:struct *Args",
"rust:enum OutputFormat"
],
"python_module_roots": [
"app"
],
"exclude_paths": [
"src/generated"
]
}
}You can set these during generation:
mvs-manager generate --root . --manifest mvs.json --context cli --public-api-root src/cli.rs
mvs-manager generate --root . --manifest mvs.json --context cli --exclude-path src/generated
mvs-manager generate --root . --manifest mvs.json --context cli --public-api-exclude 'rust:const EXIT_*'
mvs-manager generate --root . --manifest mvs.json --context cli --public-api-root app/src/lib.rs --rust-export-following public-modules --rust-workspace-member shared
mvs-manager generate --root . --manifest mvs.json --context cli --public-api-include 'src/cli.rs|rust:fn *'
mvs-manager generate --root . --manifest mvs.json --context cli --public-api-root src/index.ts --ts-export-following relative-only
mvs-manager generate --root . --manifest mvs.json --context cli --public-api-root src/index.ts --ts-export-following workspace-only
mvs-manager generate --root . --manifest mvs.json --context cli --public-api-root src/api.go --go-export-following package-only
mvs-manager generate --root . --manifest mvs.json --context cli --public-api-root src/lib.rs --rust-export-following public-modules
mvs-manager generate --root . --manifest mvs.json --context cli --ruby-export-following off
mvs-manager generate --root . --manifest mvs.json --context cli --lua-export-following returned-root-only
mvs-manager generate --root . --manifest mvs.json --context cli --python-export-following roots-only --python-module-root app
mvs-manager generate --root . --manifest mvs.json --context cli --python-module-root appPractical guidance:
- CLI-first projects: point
public_api_rootsat the CLI facade such assrc/cli.rs - SDKs and libraries: point
public_api_rootsat exported facades such assrc/lib.rs,src/index.ts, orsrc/public/ - Generated or vendor-like code under the root: add it to
exclude_paths - Use
public_api_excludeswhen a facade file still contains public constants, argument structs, or helper exports that are not real compatibility surface - Use
public_api_includeswhen you want to pin the contract to a small explicit subset of declarations - TypeScript or JavaScript repos with only relative barrel facades: set
ts_export_followingtorelative_only - TypeScript or JavaScript repos with
package.jsonexport maps,importsmaps, package-local monorepo self-references, ortsconfig/jsconfigpath aliases inside the same workspace: setts_export_followingtoworkspace_only - When
workspace_onlyfollowspackage.jsonexportsorimportsconditions, it preferstypes, thenimport,module,browser,node,default, andrequire; any remaining custom conditions are tried after that in key order - When both root config files exist,
workspace_onlyreadstsconfig.jsonbeforejsconfig.json - Go repos that root the contract on one
.gofile but ship a whole package surface: setgo_export_followingtopackage_onlyso same-package sibling files count without dragging_test.gohelpers intopublic_api_inventory - Rust repos that root the contract on
src/lib.rsor another crate facade file: setrust_export_followingtopublic_modulesso same-cratepub modfiles count with that facade while private-module files stay out - Rust workspaces where one facade crate intentionally reexports selected sibling crates: add
rust_workspace_membersso only those member crates resolve acrosspub use member_crate::...paths instead of widening to the entire workspace - Ruby repos that want file-local declarations only: set
ruby_export_followingtooff - Lua or Luau repos that require explicit runtime module returns: set
lua_export_followingtoreturned_root_only - Lua or Luau repos that want file-local globals only: set
lua_export_followingtooff - Python repos with nonstandard package roots: set
python_module_roots - Python repos that want strict facade tracking: set
python_export_followingtoroots_onlyand providepython_module_roots - Python repos that want file-local behavior only: set
python_export_followingtooff
This policy only scopes public API evidence. Feature and protocol tags are still gathered across the scanned codebase unless a path is explicitly excluded.
Pattern rules:
*matches zero or more characters- A plain pattern such as
rust:struct *Argsmatches only the normalized signature - A selector pattern such as
src/cli.rs|rust:fn *matches both the relative file path and the signature - If both include and exclude rules match the same declaration, the exclude rule wins
- The easiest way to author patterns is to copy a signature from
mvs.json.evidence.public_api_inventoryorlint --format json - Legacy Rust function patterns with duplicated
fnstill match during migration, but regenerated manifests rewrite them to the canonical form
The Rust code is split into a small Cargo workspace so the versioning logic
is embeddable outside the CLI: mvs-core (manifest, hashing, scheme
translators — no network/process deps), mvs-crawler (the tree-sitter
scanners), and mvs-manager (this CLI). crates/mvs-wasm binds mvs-core's
convert-version logic to WASM; try it live in the
interactive playground.
Distribution channels (GitHub Releases, cargo binstall, Docker, Nix,
Homebrew/Scoop/winget templates) are cataloged in
docs/DISTRIBUTION.md — several are templates or
untested-in-CI at this point, and that document says exactly which.
napi-rs/pyo3 bindings and 6 additional language crawlers (Elixir, Scala,
C/C++, Zig, Haskell, OCaml) are planned but not yet built.
- Usage details: docs/USAGE.md
- Release workflow: docs/RELEASE.md
1.xreadiness roadmap: docs/TODO_1.0.md- Not yet built: crawler adapters that treat OpenAPI, GraphQL SDL,
.proto, JSON Schema, and Avro files as public API/protocol surface, for teams whose real protocol is a schema rather than a function signature; crawlers for Elixir, Scala, C/C++, Zig, Haskell, and OCaml;napi-rs/pyo3bindings; a hostedmvs.dev(schema + playground); and publishing any of the Docker/Homebrew/Scoop/winget/Nix packaging templates to their respective registries.
All commands support --format text|json and default to text.
Examples:
mvs-manager generate --root . --manifest mvs.json --context cli --format json
mvs-manager lint --root . --manifest mvs.json --format json
mvs-manager validate --host-manifest host.json --extension-manifest extension.json --format jsonJSON responses are designed for CI, bots, editor tooling, and release automation. They include:
commandstatusexit_code- semantic diff details where relevant
- command-specific metadata such as identity changes, inventory counts, or compatibility reasons
When scan policy actively shapes the public API boundary, generate --format json and lint --format json also emit boundary_debug with included and excluded candidate declarations, excluded paths, and the matched root/include/exclude rule or follow-mode reason. Default ignored directories such as tests, target, and node_modules also show up there when they affect the crawl.
validate --format json also includes:
failure_countdegraded_countchecks: structured compatibility checks with stableaxis,status, andcodevalues
report --format json also includes:
change_countchanged_sectionscomparison: structured manifest-to-manifest deltas across identity, compatibility, capabilities, AI contract, environment, scan policy, and evidence inventories
report intentionally stays manifest-only in 1.x. It does not recrawl source or emit boundary_debug.
Example lint --format json failure shape:
{
"command": "lint",
"status": "failed",
"exit_code": 20,
"failure_count": 1,
"failures": [
"Public API signature drift detected. Added: src/api.ts|ts/js:function rotateToken(token:string): string Build must fail until PROT is incremented and manifest is regenerated."
]
}Example validate --format json incompatibility shape:
{
"command": "validate",
"status": "incompatible",
"exit_code": 30,
"compatible": false,
"degraded": false,
"failure_count": 1,
"degraded_count": 0,
"checks": [
{
"axis": "protocol",
"status": "fail",
"code": "protocol_range_mismatch",
"message": "Protocol range mismatch: extension requires host 1-1, host exposes 2-2 and is at PROT 2.",
"details": {
"extension_protocol": 1,
"host_protocol": 2,
"required_host_range": {
"min_prot": 1,
"max_prot": 1
},
"host_extension_range": {
"min_prot": 2,
"max_prot": 2
}
}
}
],
"reasons": [
"Protocol range mismatch: extension requires host 1-1, host exposes 2-2 and is at PROT 2."
]
}Example report --format json shape:
{
"command": "report",
"status": "changed",
"exit_code": 0,
"change_count": 21,
"changed_sections": [
"identity",
"compatibility",
"evidence"
]
}mvs-manager now uses command-stable nonzero exit codes so automation can distinguish drift from execution failures.
0: success10:generateexecution failure20:lintdetected manifest/code drift or policy failure (never returned bylint --advisory, which always exits0)21:lintexecution failure30:validatefound incompatibility40: manifest read/parse/write/validation failure70: output rendering failure80:sync --checkfound version files out of sync with the manifest projection81:syncfailed to read or write a version file82:convert-versioncould not parse the input, resolve--scheme-regex, or apply--map83: amigratesubcommand failed (detect/plan/backfill/apply/rollback)84:suggest-decoratorsfailed to crawl the source tree or write a decorator85:rangewas given an invalid range/ecosystem, or no recorded version has PROT in range86:semverwas given an unknown--fortarget or an identifier that isn't valid SemVer (or that the target can't express, e.g. a non-PEP-440 prerelease)
This means CI can treat 20 as “manifest must be regenerated” and 30 as “host/extension contract is incompatible” without scraping human text.
Release assets include:
- per-platform archives
checksums.txt- optional
checksums.txt.ascGPG signature
Verify checksum:
scripts/verify-release.sh dist/vX.Y.Z/mvs-manager-X.Y.Z-<target>.tar.gz dist/vX.Y.Z/checksums.txtSee docs/USAGE.md and docs/RELEASE.md for complete workflows.
For the 2.x identity contract see docs/CONTRACT_2X.md; legacy 1.x surface notes remain in docs/CONTRACT_1X.md.
This repository is licensed under the GNU Affero General Public License v3.0 only (AGPL-3.0-only).
- Full license text: LICENSE
- If you modify and run this software for users over a network, AGPL requires offering corresponding source to those users.