Skip to content

Commit 4266e06

Browse files
Module reference guidance states concrete development rules (#566)
Module authors have direct reference guidance for integration modules, data conversion, Pester test structure, framework test jobs, and guidance-script maintenance. This documentation change preserves the existing technical contracts. Module and pipeline behavior do not change, and no consumer action is required. <!-- ANNOUNCEMENT STOP --> ## Changed: Module development references use direct technical prose The references replace metaphors and vague assurances with concrete descriptions and direct instructions. They distinguish conventions from proof of enforcement. The no-mocks prohibition, Context requirements, conversion directions, test hierarchy, public names, paths, samples, and framework test IDs retain their meaning. The conversion section has a descriptive heading and retains its previous `#the-neutral-object-is-the-pivot` anchor. No cross-owner link change is required. The dependency reference remains unchanged because its roles and version statement are already clear. <details> <summary>Technical details</summary> **Delivery and comparison.** #556 owns this one focused prose delivery. The immutable comparison is `64ffb1d87f86bd5d487891fdb140b78385a00531` to `5ee3e9393c6bd47f78def6b5841cf22ecacad86f`. The remote branch and PR head match the delivered SHA. The PR stays in draft; no merge, auto-merge, or Agent merge action is taken. Three small commits deliver the change: `8d148a49fa24915dc6bbb5b5acd92bd93e27c2f9` states module-type conventions, `b158a5312295ec0271c6d967aca24bd81b3d6772` states Pester test rules, and `5ee3e9393c6bd47f78def6b5841cf22ecacad86f` clarifies test jobs and script maintenance. The draft was opened after the first coherent commit. Ownership checks immediately before the commits inspected 11, 14, and 16 open PRs and found no other owner of an assigned path. **Complete reviewed scope.** All six assigned documents were read in full before editing and after the final edits. The five changed paths below are the complete PR diff. | Exact path | Result | Review evidence | | --- | --- | --- | | `docs\content\reference\dependencies.md` | Reviewed; no change | Dependency roles, URLs, and the independent-version statement are direct. Baseline and final blob: `04e3e15b239a7e9390bed9d91e043d70ed2ce5bf`. | | `docs\content\reference\framework-test-ids.md` | Reviewed; changed | Jobs are the actors, and import validation describes the existing no-throw assertion. Source-code test rows, IDs, categories, skip examples, paths, and module-test names are unchanged. | | `docs\content\reference\guidance-scripts.md` | Reviewed; changed | Reference scripts are distinct from module source. The complete-file import instruction names `guidance/`. Script names, table content, environment caution, and content preservation remain. | | `docs\content\reference\module-development-foundations.md` | Reviewed; changed | Conventions do not become blanket enforcement claims. All five linked reference pages remain. | | `docs\content\reference\module-types.md` | Reviewed; changed | Concrete service, settings, and conversion descriptions preserve transport choices, Context obligations, command patterns, examples, and both conversion directions. | | `docs\content\reference\test-specification.md` | Reviewed; changed | Direct instructions preserve the hierarchy, naming examples, complete Pester sample, no-mocks prohibition, real-input recommendation, and full-coverage requirement. | **Before/after acceptance evidence.** The [pre-edit review](#556 (comment)) records the source criteria, actual baseline text, expected changes, and exclusions before editing. | Before | Delivered text or result | Acceptance basis | | --- | --- | --- | | "feel the same to use" | "This page defines additional conventions for each module type." | A present-tense statement replaces subjective intent. | | "PowerShell face" | "Integration modules provide PowerShell commands for an external service." | A concrete interface replaces a metaphor. | | "common pivot" | "as the intermediate representation", followed by the two conversion steps | The object model and both directions remain explicit. | | "The goal is to ensure consistency" | "This specification defines the Pester test hierarchy, input guidance, and coverage requirements for PowerShell functions." | The page states its contract instead of an aspiration. | | "This ensures our tests are structured, maintainable, and adhere to best practices." | "The example groups `Get-Uri` tests under the `Uri` module and uses separate contexts for direct and pipeline input." | An observable description replaces an assurance. | | "Run by the ... job"; "imports cleanly" | The named jobs run the tests; import validation says an import "does not throw an error". | Active descriptions match the existing `Should -Not -Throw` assertion. | | "conventions that the framework supports and validates"; "framework wiring" | The pages "define repository, source, test, and release conventions"; "workflow configuration" | Guidance is distinct from implementation and enforcement evidence. | | "framework learning assets"; "into this directory" | "These scripts are not Process-PSModule module source"; import into `guidance/` | The role and destination are explicit; the published-set condition, complete-file import, and content-preservation instructions remain. | **Pinned source criteria.** The writing baseline is MSXOrg/docs at `1b0d4893c8fefabe604d04393068a8ff6f848082`: - [Documentation Model](https://github.com/MSXOrg/docs/blob/1b0d4893c8fefabe604d04393068a8ff6f848082/src/docs/Ways-of-Working/Documentation-Model.md): present-tense resource documentation; delivery evidence belongs in the issue and PR; a contract does not prove CI enforcement. - [Natural Language](https://github.com/MSXOrg/docs/blob/1b0d4893c8fefabe604d04393068a8ff6f848082/src/docs/Coding-Standards/Natural-Language.md) and [Writing Guide](https://github.com/MSXOrg/docs/blob/1b0d4893c8fefabe604d04393068a8ff6f848082/src/docs/Coding-Standards/Writing-Guide.md): en-US, concrete nouns, active verbs, precise obligations, and preserved technical meaning, identifiers, native syntax, and normative force. - [Markdown](https://github.com/MSXOrg/docs/blob/1b0d4893c8fefabe604d04393068a8ff6f848082/src/docs/Coding-Standards/Markdown.md), [Documentation](https://github.com/MSXOrg/docs/blob/1b0d4893c8fefabe604d04393068a8ff6f848082/src/docs/Coding-Standards/Documentation.md), and [reference/standard templates](https://github.com/MSXOrg/docs/blob/1b0d4893c8fefabe604d04393068a8ff6f848082/src/docs/Ways-of-Working/Spec-Driven-Development-Templates.md): retain lookup and rule purposes, native samples, and valid links without empty template sections. - [Task format](https://github.com/MSXOrg/docs/blob/1b0d4893c8fefabe604d04393068a8ff6f848082/src/docs/Ways-of-Working/Issues/Types/Task.md) and [PR format](https://github.com/MSXOrg/docs/blob/1b0d4893c8fefabe604d04393068a8ff6f848082/src/docs/Ways-of-Working/PR-Format.md): keep the executable plan in the delivery leaf and supporting evidence in this block. The [official STE description](https://www.asd-ste100.org/about_STE.html), [FAQ](https://www.asd-ste100.org/STE_faq.html), and [Issue 9](https://doi.org/10.5281/zenodo.23666006) were available. Rules 1.1-1.3, 3.2, 3.6, 5.1-5.4, 6.1-6.5, and 9.1-9.4 and relevant dictionary material informed the manual review. The supplied PDF's MD5, `9c720341c350ed77943b2c73d01c716f`, matches the official Zenodo record. The reference files remain local and read-only. This review does not claim complete STE conformance or certification; lint and word counts do not establish it. | Changed surface | Standards checked | Framework docs checked | Result | | --- | --- | --- | --- | | `framework-test-ids.md` | Pinned writing criteria; active voice; exact technical names | Existing source-code and module-test definitions | Fixed in this PR. | | `guidance-scripts.md` | Pinned writing criteria; direct instructions; explicit destinations | Existing guidance-script inventory and maintenance contract | Fixed in this PR. | | `module-development-foundations.md` | Pinned writing criteria; guidance versus enforcement | Existing five linked reference pages | Fixed in this PR. | | `module-types.md` | Pinned writing criteria; concrete terminology; stable anchors | Existing module-type and Context conventions; linked PowerShell module standard | Fixed in this PR. | | `test-specification.md` | Pinned writing criteria; imperative instructions; preserved obligations | Existing Pester hierarchy and sample | Fixed in this PR. Exception - #563 remains unresolved. | **Validation.** These existing commands pass: ```powershell npx --no-install markdownlint-cli2 --config .github\linters\.markdown-lint.yml docs\content\reference\dependencies.md docs\content\reference\framework-test-ids.md docs\content\reference\guidance-scripts.md docs\content\reference\module-development-foundations.md docs\content\reference\module-types.md docs\content\reference\test-specification.md git --no-pager diff 64ffb1d HEAD --check Push-Location -LiteralPath docs zensical build --clean Pop-Location gh pr checks 566 --repo PSModule/Process-PSModule ``` Markdownlint reports six files and zero issues before editing and at the final head (markdownlint-cli2 0.24.0, markdownlint 0.42.0). The site build reports "No issues found" before editing and after the final edit. Whitespace checks pass. Inline Python standard-library comparisons at the committed final head verify the unchanged front matter, link targets, source-code test rows, IDs, skip examples, module-test names, guidance table, REST mapping, command patterns, identifiers, Pester sample, hierarchy, and naming examples. All five original prose acceptance failures are absent. A final generated-HTML comparison preserves all 132 baseline HTML IDs across the six pages. `HTMLParser` resolves all 41 rendered local article links and fragments, including both conversion anchors. The complete tracked-path comparison finds five changed paths, one reviewed/no-change path, 330 excluded paths, and zero excluded changes. The worktree is clean after removal of only task-generated site/cache outputs. Final-head GitHub checks: **22 passed; one skipped; none pending or failing**. The Docs `Publish` job is skipped for a PR, as the existing workflow specifies. The explicitly requested [final-head review](#566 (review)) is approved at `5ee3e9393c6bd47f78def6b5841cf22ecacad86f` with no inline comments. An initial `--site-dir` build attempt failed because the installed Zensical CLI does not support that option. The unmodified repository build command passed. No tool or dependency was installed or added. The repository has no `Test-DocumentationLink.ps1` or `Test-CrossRepositoryLink.ps1`; external URL availability is not asserted. Runtime Pester tests were not run because no executable source or sample changed. **Exclusions.** Every tracked path outside the six-row reviewed scope is excluded. The complete excluded reference list is `pipeline-stages.md`, `powershell-module-standard.md`, `repository-standard.md`, `scenario-matrix.md`, `settings.md`, `versioning.md`, and `workflow-inputs.md`, all under `docs\content\reference\`. All four specification pages remain excluded: `docs\content\specification\design.md`, `index.md`, `principles-and-practices.md`, and `spec.md`. All guides, getting-started pages, indexes, glossary/module pages, skills, source code, native help, tests, functional test-fixture Markdown, configuration, site design, README files, and guidance-script source remain unchanged. #551 is outside this delivery. **Unresolved policy exception.** The baseline test specification says "**No Mocks**: We do not use mocks in tests." The reserved `powershell-module-standard.md#tests` says "Unit tests mock boundaries owned by the module, not third-party APIs or SDKs directly." The delivered instruction is "**No Mocks**: Do not use mocks in tests." It preserves the prohibition without choosing a policy or claiming enforcement. #563 owns the unresolved contradiction and is not closed by this PR. There is no blocker to this prose-only draft. **Plan and issue convergence.** Source review, pre-edit evidence, baseline checks, three prose slices, invariant review, final checks, and durable evidence complete the delivery leaf's plan. The scoped search covered the documentation-writing leaves and open issues whose bodies name `module-types` or `test-specification`. #479 requires module audits, #483 requires a resilience contract, #338 requires DSC support, and #471 requires dependency-versioning guidance. This diff does not deliver those outcomes. No additional issue fully converges. Only #556 is a closing reference. The documentation-only paths do not invoke `.github/workflows/Release.yml`; no release labels or release-decision block apply. </details> <details> <summary>Related references</summary> - Resolves #556 - References #563 </details>
1 parent 1ae6c11 commit 4266e06

5 files changed

Lines changed: 80 additions & 72 deletions

File tree

‎docs/content/reference/framework-test-ids.md‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ description: The PSModule framework tests enforced on module source code and on
55

66
# Framework test IDs
77

8-
The PSModule framework runs a fixed set of tests on every module, separate from the module's own Pester tests. Each
9-
source-code test has an ID that can be used to
10-
[skip it for a single file](../guides/skipping-framework-tests.md).
8+
The PSModule framework runs a fixed set of tests on every module. These tests are separate from the module's own Pester tests.
9+
Each source-code test has an ID. Use the ID to
10+
[skip the test for a single file](../guides/skipping-framework-tests.md).
1111

1212
## Source-code tests
1313

14-
Run by the [Test source code](pipeline-stages.md#test-source-code) job against files in `src/`. Implemented in
15-
[PSModule - SourceCode tests](https://github.com/PSModule/Process-PSModule/blob/main/.github/actions/Test-PSModule/src/tests/SourceCode/PSModule/PSModule.Tests.ps1).
14+
The [Test source code](pipeline-stages.md#test-source-code) job runs these tests against files in `src/`.
15+
The [PSModule - SourceCode tests](https://github.com/PSModule/Process-PSModule/blob/main/.github/actions/Test-PSModule/src/tests/SourceCode/PSModule/PSModule.Tests.ps1)
16+
file defines them.
1617

1718
| ID | Category | Description | Example skip comment |
1819
| ---- | ---------- | ------------- | ---------------------- |
@@ -30,17 +31,18 @@ Run by the [Test source code](pipeline-stages.md#test-source-code) job against f
3031

3132
## Module tests
3233

33-
Run by the [Framework test](pipeline-stages.md#framework-test) job against the compiled module in
34-
`.PSModule/module`. Implemented in
35-
[PSModule - Module tests](https://github.com/PSModule/Process-PSModule/blob/main/.github/actions/Test-PSModule/src/tests/Module/PSModule/PSModule.Tests.ps1).
34+
The [Framework test](pipeline-stages.md#framework-test) job runs these tests against the compiled module in
35+
`.PSModule/module`. The
36+
[PSModule - Module tests](https://github.com/PSModule/Process-PSModule/blob/main/.github/actions/Test-PSModule/src/tests/Module/PSModule/PSModule.Tests.ps1)
37+
file defines them.
3638

3739
| Name | Description |
3840
| ---- | ----------- |
3941
| Module Manifest exists | Verifies that a module manifest file is present. |
4042
| Module Manifest is valid | Verifies that the module manifest file is valid. |
41-
| Module import validation | Verifies that the built module imports cleanly. |
43+
| Module import validation | Verifies that an import of the built module does not throw an error. |
4244

43-
Module tests typically don't need to be skipped, as they validate the final built module.
45+
In most cases, keep module tests enabled to validate the final built module.
4446

4547
## Related
4648

‎docs/content/reference/guidance-scripts.md‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ description: Reference PowerShell scripts that demonstrate implementation patter
55

66
# PowerShell guidance scripts
77

8-
The [guidance directory](https://github.com/PSModule/Process-PSModule/tree/main/guidance) contains runnable reference scripts for common PowerShell implementation patterns. They are framework learning assets, not Process-PSModule module source, so they are intentionally kept outside `src/` and are not included in a module manifest.
8+
The [guidance directory](https://github.com/PSModule/Process-PSModule/tree/main/guidance) contains runnable reference scripts for common PowerShell implementation patterns.
9+
These scripts are not Process-PSModule module source. The `guidance/` directory is outside `src/`. Module manifests do not include these scripts.
910

10-
Run an individual script only when its scenario is suitable for the local environment. Several scripts create temporary files, make web requests, or measure execution time.
11+
Before you run a script, make sure that its scenario is suitable for the local environment.
12+
Several scripts create temporary files, make web requests, or measure execution time.
1113

1214
| Script | Focus |
1315
| --- | --- |
@@ -28,4 +30,6 @@ Run an individual script only when its scenario is suitable for the local enviro
2830

2931
## Maintenance
3032

31-
The files are maintained in the [`guidance` directory](https://github.com/PSModule/Process-PSModule/tree/main/guidance). When that published set changes, import the complete current file from its Git blob into this directory and preserve its contents. Keep this index synchronized with the directory so users can discover every available script.
33+
Maintain the reference scripts in the [`guidance` directory](https://github.com/PSModule/Process-PSModule/tree/main/guidance).
34+
When the published script set changes, import the complete file from its Git blob into `guidance/`.
35+
Preserve the file contents. Keep this index synchronized with the directory so it lists every available script.
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
# Module development foundations
22

3-
Process-PSModule is the framework for building, testing, versioning, documenting, and publishing PowerShell modules. These foundations define the repository, source, test, and release conventions that the framework supports and validates.
3+
Process-PSModule builds, tests, versions, documents, and publishes PowerShell modules.
4+
These pages define repository, source, test, and release conventions for modules that use the framework.
45

5-
Start with the [Process-PSModule overview](../index.md) to understand the workflow. Use these pages when creating or maintaining a module that runs through it.
6+
Start with the [Process-PSModule overview](../index.md) for the workflow description.
7+
Use these pages to create or maintain a module that uses Process-PSModule.
68

79
| Page | Use it for |
810
| --- | --- |
9-
| [Repository Standard](repository-standard.md) | Creating a module repository with the required metadata, files, and framework wiring. |
11+
| [Repository Standard](repository-standard.md) | Creating a module repository with the required metadata, files, and workflow configuration. |
1012
| [PowerShell module standard](powershell-module-standard.md) | Structuring source code, designing functions, and applying module-specific conventions. |
1113
| [Module types](module-types.md) | Applying conventions for integration (API) and data modules. |
12-
| [Test Specification](test-specification.md) | Writing consistent, comprehensive Pester tests for module functions. |
14+
| [Test Specification](test-specification.md) | Defining the Pester test hierarchy, input guidance, and coverage requirements for module functions. |
1315
| [Versioning](versioning.md) | Choosing semantic version changes from the module's public API impact. |
Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
# Module types
22

3-
Most PSModule modules fall into one of a few archetypes. The general rules in
4-
[PowerShell module standard](powershell-module-standard.md) and [MSX PowerShell Standards](https://msx.no/docs/Coding-Standards/PowerShell/) always apply; this
5-
page adds the conventions that are specific to a module's type so that modules of the same kind feel
6-
the same to use.
3+
Most PSModule modules use one or both of the module types below. The general rules in
4+
[PowerShell module standard](powershell-module-standard.md) and [MSX PowerShell Standards](https://msx.no/docs/Coding-Standards/PowerShell/)
5+
always apply. This page defines additional conventions for each module type.
76

8-
Two archetypes have enough shared shape to standardize:
7+
The module types are:
98

10-
- **Integration (API) modules** wrap an external service's REST or GraphQL API.
9+
- **Integration (API) modules** provide PowerShell commands for an external service's REST or GraphQL API.
1110
- **Data modules** convert or manage a data format or in-memory structure.
1211

13-
A module can be both (for example, an integration module that also exposes conversion helpers).
14-
Apply each relevant section.
12+
A module can serve both roles. For example, an integration module can also provide conversion helpers. Apply each relevant section.
1513

1614
## Integration (API) modules
1715

18-
Integration modules are the PowerShell face of an external service. `GitHub`, and the
19-
service-client modules such as `Anthropic`, `OpenAI`, `Bluesky`, and `Domeneshop`, are integration
20-
modules.
16+
Integration modules provide PowerShell commands for an external service. `GitHub` and the
17+
service-client modules `Anthropic`, `OpenAI`, `Bluesky`, and `Domeneshop` are integration modules.
2118

2219
### Command naming maps to the resource, not the HTTP method
2320

24-
Name commands after the resource and the intent, using approved verbs. Never name a command after
21+
Name commands after the resource and the intended operation. Use approved verbs. Never name a command after
2522
the HTTP method or the endpoint path. Map REST methods to verbs:
2623

2724
| REST method | PowerShell verb | Example |
@@ -32,75 +29,78 @@ the HTTP method or the endpoint path. Map REST methods to verbs:
3229
| `DELETE` | `Remove-` | `Remove-GitHubRepository` |
3330
| Non-CRUD action | Approved verb for the intent | `Invoke-`, `Start-`, `Stop-`, `Enable-`, ... |
3431

35-
Prefix the noun with the service's term of art (`GitHubRepository`, not `Repository`).
32+
Prefix the noun with the service-specific term (`GitHubRepository`, not `Repository`).
3633

3734
### Transport abstraction
3835

39-
Lower-level helpers own the concrete `Invoke-RestMethod` / GraphQL / HTTP calls. How you expose
40-
or hide this abstraction is a design choice:
36+
Helper functions make the `Invoke-RestMethod`, GraphQL, or HTTP calls. Choose how to expose the transport and module state:
4137

4238
- **Private transport** (common): Keep REST, GraphQL, and HTTP helpers private. Public functions
43-
accept resolved inputs and typed objects. This follows the Dependency Inversion rule from
44-
[Standards](powershell-module-standard.md#solid-applied) applied to the network boundary.
45-
- **Public transport**: Expose REST or GraphQL functions publicly for power users or module
39+
accept resolved inputs and typed objects. This applies the Dependency Inversion rule from
40+
[Standards](powershell-module-standard.md#solid-applied) to network calls.
41+
- **Public transport**: Expose REST or GraphQL functions publicly for advanced users or module
4642
composition.
47-
- **Public Context**: Expose the `Context` module as public so users can configure and manage
43+
- **Public Context**: Expose the `Context` module so users can configure and manage
4844
module state, secrets, and settings directly.
4945

50-
Choose the strategy that best serves your module's audience.
46+
Choose the strategy for the module's intended users.
5147

5248
### Use Context for user and module settings
5349

54-
Integration modules persist state with the [`Context`](https://github.com/PSModule/Context) module
55-
rather than inventing bespoke storage. Context provides on-disk storage for user data and secrets,
56-
organized by context and environment. Two kinds of state are both standard:
50+
Integration modules use the [`Context`](https://github.com/PSModule/Context) module to store state instead of a separate storage implementation.
51+
Context stores user data and secrets on disk, organized by context and environment. It supports two standard kinds of state:
5752

5853
- **User settings and secrets**: accounts, tokens, sessions, and per-user configuration. Store these
59-
in a per-user context. `Context` encrypts secrets at rest (via `Sodium`), so a user can resume work
60-
without reconfiguring or logging in again when the service supports session refresh.
54+
in a per-user context. `Context` encrypts stored secrets with `Sodium`.
55+
If the service supports session refresh, users can resume work without new configuration or another login.
6156
- **Module settings**: module-wide defaults, endpoints, and feature flags that are not tied to a
6257
single user. Store these in a module-scoped context.
6358

64-
Your module must expose functions and object types so users can target specific contexts and
65-
environments. Users need to be able to read from, write to, and manage contexts programmatically,
66-
selecting which environment or context their functions operate against. Persisting both through
67-
`Context` gives every integration module the same, discoverable settings model and keeps secrets
68-
out of source, logs, and plain files.
59+
Your module must expose functions and object types for specific contexts and environments.
60+
Users must be able to read, write, and manage contexts programmatically.
61+
They must be able to select the environment or context that their functions use.
62+
Use `Context` for both kinds of state to give integration modules the same settings model.
63+
Keep secrets out of source code, logs, and unencrypted files.
6964

7065
## Data modules
7166

7267
Data modules convert between representations or manage an in-memory structure. `Hashtable` is the
73-
reference shape; `Base64`, `Json`, `Lua`, `Hcl`, `Sodium`, and `Uri` follow the same pattern.
68+
reference implementation. `Base64`, `Json`, `Lua`, `Hcl`, `Sodium`, and `Uri` follow the same pattern.
7469

75-
### The neutral object is the pivot
70+
<a id="the-neutral-object-is-the-pivot"></a>
7671

77-
Every conversion goes through the neutral PowerShell object model
78-
(`[PSCustomObject]` / `[hashtable]` / `[PSObject]`). `ConvertFrom-<Format>` parses a
79-
format-specific representation into an object; `ConvertTo-<Format>` renders an object into the
80-
format. Converting through the object as a common pivot means any format interoperates with any
81-
other, instead of writing a direct converter for every pair.
72+
### Conversions use the neutral object model
8273

83-
Always ship both directions so data can round-trip between the format and the object model.
74+
Every conversion uses the neutral PowerShell object model
75+
(`[PSCustomObject]` / `[hashtable]` / `[PSObject]`) as the intermediate representation.
76+
`ConvertFrom-<Format>` parses a format-specific representation into an object.
77+
`ConvertTo-<Format>` converts an object into the target format.
78+
79+
To convert between formats, first convert the source representation to an object.
80+
Then convert the object to the target format.
81+
The common object model removes the need for a separate converter for each pair of formats.
82+
83+
Always provide both conversion directions so users can convert from a format to an object and back.
8484

8585
### Verb vocabulary
8686

8787
| Verb pattern | Purpose |
8888
| ------------ | ------- |
8989
| `ConvertFrom-<Format>` | Format-specific text/representation → `[PSCustomObject]` / `[hashtable]` |
9090
| `ConvertTo-<Format>` | `[PSCustomObject]` / `[hashtable]` → format-specific text/representation |
91-
| `Import-<Noun>` | Read from a file or store into objects |
92-
| `Export-<Noun>` | Write objects to a file or store |
93-
| `Format-<Noun>` | Produce a normalized or pretty rendering |
91+
| `Import-<Noun>` | Read objects from a file or data store |
92+
| `Export-<Noun>` | Write objects to a file or data store |
93+
| `Format-<Noun>` | Produce a normalized or human-readable representation |
9494
| `Merge-<Noun>` | Combine two structures |
95-
| `Compare-<Noun>` | Diff two structures |
95+
| `Compare-<Noun>` | Identify differences between two structures |
9696
| `Test-<Noun>` | Validate a value or structure |
97-
| `Remove-<Noun>Entry` | Remove elements by criteria |
97+
| `Remove-<Noun>Entry` | Remove elements that match specified criteria |
9898

99-
The `Hashtable` module demonstrates the full set: `ConvertFrom-Hashtable`, `ConvertTo-Hashtable`,
99+
The `Hashtable` module demonstrates `ConvertFrom-Hashtable`, `ConvertTo-Hashtable`,
100100
`Import-Hashtable`, `Export-Hashtable`, `Format-Hashtable`, `Merge-Hashtable`, and
101101
`Remove-HashtableEntry`.
102102

103103
## Where this connects
104104

105105
- [PowerShell module standard](powershell-module-standard.md): layout, private functions, and the mandatory context parameter.
106-
- [Repository Standard](repository-standard.md): repository files, README shape, and agent onboarding.
106+
- [Repository Standard](repository-standard.md): repository files, README content, and instructions for agents.

‎docs/content/reference/test-specification.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,43 @@
22

33
## Overview
44

5-
This document defines the structure and guidelines for writing Pester tests for PowerShell functions. The goal is to ensure consistency and comprehensive test coverage while maintaining clarity.
5+
This specification defines the Pester test hierarchy, input guidance, and coverage requirements for PowerShell functions.
66

77
## Test Structure
88

9-
Each function is tested within a structured Pester `Describe` block that follows this hierarchy:
9+
Organize each function's Pester tests in the following hierarchy:
1010

1111
### 1. Module-Level `Describe`
1212

1313
- The outermost `Describe` block corresponds to the module.
14-
- The module name is derived from the prefix of the function name's noun part.
14+
- Use the prefix of the function name's noun part as the module name.
1515

1616
### 2. Function-Level `Describe`
1717

18-
- Each function within the module gets its own `Describe` block.
19-
- Named using the full function name.
18+
- Give each function in the module its own `Describe` block.
19+
- Use the full function name as the block name.
2020

2121
### 3. Use Case `Context`
2222

23-
- Each use case is grouped within a `Context` block.
23+
- Group each use case in a `Context` block.
2424
- The context name starts with the function name followed by a descriptive test case identifier.
2525
- Example: `Get-Uri - simple usage`
2626
- Example: `Get-Uri - Pipeline usage`
2727
- Example: `Get-Uri - ParameterSet: Detailed`
2828

2929
### 4. Functional `It` Statements
3030

31-
- Each `It` block tests a specific aspect of the function's behavior.
31+
- Each `It` block tests one aspect of the function's behavior.
3232
- The name follows the format: `FunctionName - <expected behavior>`
3333
- Example: `Get-Uri - gets the URI object when provided a string`
3434
- Example: `Get-Uri - returns $null when input is empty`
3535
- Example: `Get-Uri - throws error on invalid input`
3636

3737
### 5. Test Guidelines
3838

39-
- **No Mocks**: We do not use mocks in tests.
39+
- **No Mocks**: Do not use mocks in tests.
4040
- **Real Inputs**: Tests should use actual inputs and expected outputs.
41-
- **Comprehensive Coverage**: All function functionality, including edge cases, must be tested.
41+
- **Comprehensive Coverage**: Tests must cover all function behavior, including edge cases.
4242

4343
## Example Test Structure
4444

@@ -62,4 +62,4 @@ Describe 'Uri' {
6262
}
6363
```
6464

65-
This ensures our tests are structured, maintainable, and adhere to best practices.
65+
The example groups `Get-Uri` tests under the `Uri` module and uses separate contexts for direct and pipeline input.

0 commit comments

Comments
 (0)