@@ -101,6 +101,28 @@ manifest validity, or module removal. Such a framework or contract test should
101101say so in its name and use a deliberate, isolated import as the behavior under
102102test. It must not become setup for unrelated tests.
103103
104+ ### Build, load, and interface boundary
105+
106+ The normal module-local execution sequence is:
107+
108+ 1 . Process-PSModule builds the module from ` src/ ` .
109+ 2 . The framework prepares and loads that built module for the test job.
110+ 3 . Pester runs the module-local test files against the prepared module.
111+ 4 . Results and coverage are collected for the configured suite.
112+
113+ Module-local tests validate the module's ** public interface** : exported
114+ functions, exported aliases, public classes, public variables, documented
115+ formats, and observable behavior. They must not call private functions,
116+ private variables, internal classes, or implementation scripts directly.
117+ Private implementation is covered indirectly through public behavior. This
118+ keeps tests stable when internals are refactored and proves that the shipped
119+ module artifact works for consumers.
120+
121+ Source-code or framework suites may inspect internal files when that is their
122+ explicit purpose, but they are a separate test surface. Do not use source-code
123+ access as setup for module-local tests, and do not interpret source-suite
124+ coverage as proof that the public module artifact is usable.
125+
104126Every additional fixture is also part of the test-state contract. A test set
105127must explicitly load its own JSON, CSV, XML, PSD1, script, or generated data,
106128or document which setup phase provides it. In particular, a PSD1 dataset is
@@ -117,6 +139,8 @@ Record fixture ownership and availability in the inventory:
117139| Fixture or state | Owner | Loaded in | Required environment |
118140| --- | --- | --- | --- |
119141| Target module | Process-PSModule or explicit contract test | Framework pre-run | Built module path and version |
142+ | Public interface | Module-local test set | Pester after framework module load | Exported commands/classes and observable behavior |
143+ | Private implementation | Source/framework suite only when explicitly required | Separate source-test setup | Never a module-local test dependency |
120144| PSD1/JSON/CSV data | Test set or documented setup | ` BeforeDiscovery ` , ` BeforeAll ` , or setup job | Relative path and encoding |
121145| Secrets/variables | Calling workflow | ` Expose-TestData ` and environment | ` TestData ` JSON contract |
122146| Shared service | ` tests/BeforeAll.ps1 ` | Before module-local matrix | Deterministic run-scoped name |
@@ -163,6 +187,9 @@ Use this per-repository checklist:
163187 invocation and its ` Run.Path ` /` Run.ExcludePath ` is recorded.
164188- [ ] The built target module is loaded by the framework before module-local
165189 tests; tests do not silently load it themselves.
190+ - [ ] Module-local tests exercise only the built module's public interface;
191+ private implementation tests, if required, are separate source/framework
192+ suites.
166193- [ ] Source-code test loading is explicit and documented separately from the
167194 module-local contract.
168195- [ ] Every PSD1, JSON, CSV, XML, script, generated fixture, secret, variable,
0 commit comments