feat(arch): Phase B G2/G3/G4 gates + meta-shape validation#7
Merged
Conversation
`m arch check` now runs G2 alongside G1: an m-layer repo's .m code must not reference a VistA-only symbol (FileMan/Kernel/KIDS). A v-layer repo passes trivially. Phase B item 2 of the VSL/MSL effort (m/v waterline ADR §3.2 G2). Deny-list: ^DIC/^DIE/^DIK/^DIQ, ^DD(, ^DPT(, ^VA(, ^XUS*, ^XPD*. - Comment-aware: scans only codePortion(line) (before the first ';' not inside a "..." string), so a symbol named in a comment (e.g. an STDMOCK doc example) is not a reference. - RE2 has no lookahead, so the FileMan-API pattern uses a trailing-delimiter guard `(?:[^A-Za-z0-9]|$)` to avoid matching ^DIETST as ^DIE. - Extracted a shared forEachMLine walk used by CheckMRefs (G1) and the new CheckVistaSymbols (G2). Verified: cleaned m-stdlib G2-clean; m-stdlib master flags exactly STDSEED.m:218 (do FILE^DIE); all 5 m-layer repos clean. arch pkg 88.2% cover; golangci-lint + gofmt + self `arch check` clean. Owed: G3 (transport-monopoly), G4 (seam-pin). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Completes the m/v waterline gate suite in `m arch check` (Phase B item 2,
ADR §3.2). Check now runs G1/G2 for the m layer and G3/G4 for every repo.
- G3 transport-monopoly (CheckDriverMonopoly): flags a non-SDK repo that
*execs* a driver binary. The driver literal ("m-ydb"/"m-iris") must co-occur
with exec.Command on the same code line — so the gate's own deny-list var and
test fixtures (which name the binaries but never exec them) don't trip it; the
gate is self-hosting. goCodePortion strips Go // comments. SDK exempt; a
driver may exec itself.
- G4 seam-pin (CheckSeamPin): text-parses go.mod (no x/mod dep), flags a
`replace` to m-driver-sdk or a pseudo-version (untagged) require.
- Restructured Check + added goModulePath; Report gains CheckedG3/CheckedG4;
command output lists all four gates.
Verified: all 8 ecosystem repos clean under G1–G4 (no false-positives); planted
exec/replace/pseudo-version fixtures red. arch 86.7% cover; golangci-lint +
gofmt + self `arch check` clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`m arch check` now reads the meta root-first (repo.meta.json, then dist/repo.meta.json, then dist/v-contract.json) and validates its shape: a repo.meta.json (root preferred) must carry id, layer, language, and verification_commands; layer must be m|v. consumes/exposes are optional. Problems surface as Gate:"META" violations; Report.CheckedMeta. Validation runs only when a repo.meta.json is found — a repo declaring its layer only via dist/v-contract.json or --layer has nothing to validate and is skipped (back-compat while m-stdlib/v-stdlib migrate to a root meta). The Meta struct holds only the four required fields: the live metas carry consumes/exposes as objects (not arrays), so typing them as []string made json.Unmarshal hard-error on v-pkg/v-cli/m-stdlib — caught by the all-8 sweep. Optional/descriptive fields are unknown-and-ignored. Regression test added. Verified: all 8 ecosystem repos clean under G1-G4 + meta; arch 87.3% cover; golangci-lint + gofmt + self `arch check` clean. Owed: migrate m-stdlib/v-stdlib off dist/ to a root repo.meta.json (tooling is now root-first). Co-Authored-By: Claude Opus 4.8 (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.
VSL Phase B items 1–2: m arch check G2 (forbidden-symbol), G3 (transport-monopoly), G4 (seam-pin) + meta
root-first/shape validation.