Explicit N/M module visibility
Negotiate public/private workspace exports while keeping private declarations local and stable 0.1 declarations legacy-public.
Explicit N/M 0.2 module visibility
NM-RFC-0001 gives workspace modules an explicit export boundary without changing stable 0.1 source. Public and private declarations are accepted only after deliberate feature negotiation.
Local availability
A private circuit, observable, or constant remains available inside its declaring module. Local document symbols also keep it visible to the author.
Workspace export filtering
Imported completion, workspace symbols, definition, signature help, references, prepare-rename, and rename expose public and legacy-unqualified declarations but exclude private declarations.
Stable-default compatibility
Unqualified 0.1 declarations remain legacy-public. Without the experimental flag, public/private syntax is rejected with a stable diagnostic instead of changing project meaning silently.
Module and consumer
1module phase_helpers;2 3private const HALF = PI / 2;4 5private circuit prepare_phase(data: QReg<1>) {6 Ry(data[0], HALF);7}8 9public circuit prepare_plus(data: QReg<1>) {10 H(data[0]);11}12 13// consumer.nm14use workspace.phase_helpers;15// prepare_plus(q) is exported; prepare_phase(q) is not.Explicit negotiation
parseNMCode(source, { experimental: { moduleVisibility: true } })nm check main.nm --experimental-module-visibilityinitializationOptions.nm.experimental.moduleVisibility = truenm.experimental.moduleVisibility = trueContract diagnostics
NM-PARSE-051NM-PARSE-052Visibility is a language namespace boundary, not access control. It does not protect source from readers and does not define package publication, re-exports, friend modules, or source-version negotiation.