Skip to content

feat(arch): Phase B G2/G3/G4 gates + meta-shape validation#7

Merged
rafael5 merged 3 commits into
mainfrom
phase-b-arch-gates
Jun 15, 2026
Merged

feat(arch): Phase B G2/G3/G4 gates + meta-shape validation#7
rafael5 merged 3 commits into
mainfrom
phase-b-arch-gates

Conversation

@rafael5

@rafael5 rafael5 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

VSL Phase B items 1–2: m arch check G2 (forbidden-symbol), G3 (transport-monopoly), G4 (seam-pin) + meta
root-first/shape validation.

rafael5 and others added 3 commits June 14, 2026 22:30
`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>
@rafael5 rafael5 merged commit e3a6537 into main Jun 15, 2026
@rafael5 rafael5 deleted the phase-b-arch-gates branch June 15, 2026 13:22
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