Skip to content

feat: Update folder structure and namespaces to match design documentation#12

Merged
Malcolmnixon merged 4 commits intomainfrom
copilot/update-folder-structure-namespaces
Mar 30, 2026
Merged

feat: Update folder structure and namespaces to match design documentation#12
Malcolmnixon merged 4 commits intomainfrom
copilot/update-folder-structure-namespaces

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 30, 2026

Pull Request

Description

Restructures source and test code to match the subsystem hierarchy defined in docs/design/introduction.md, adds missing design documentation for all system/subsystem/unit levels, introduces subsystem-level requirements with corresponding integration tests, adds system-level requirements, updates review-sets to follow the reviewmark-usage standard, and fixes resource disposal in subsystem tests to prevent Windows file-locking failures.

Source & Test Restructuring

Files moved from flat directories into subsystem subdirectories with updated namespaces:

Subsystem Files Namespace
Cli/ Context.cs DemaConsulting.FileAssert.Cli
Configuration/ FileAssertConfig.cs, FileAssertData.cs DemaConsulting.FileAssert.Configuration
Modeling/ FileAssertTest.cs, FileAssertFile.cs, FileAssertRule.cs DemaConsulting.FileAssert.Modeling
Utilities/ PathHelpers.cs DemaConsulting.FileAssert.Utilities
SelfTest/ Validation.cs DemaConsulting.FileAssert.SelfTest

Program.cs stays at root in DemaConsulting.FileAssert. Test project mirrors the same layout with matching namespace changes. Appropriate using directives added throughout.

Design Documentation

Added 11 new Markdown files covering the full documentation hierarchy:

  • system.md — system-level design and execution flow
  • cli.md, configuration.md, modeling.md, utilities.md, selftest.md — subsystem docs
  • program.md, context.md, file-assert-data.md, path-helpers.md, validation.md — unit docs

Updated docs/design/definition.yaml to include all new docs in hierarchical order.

Subsystem Requirements & Tests

Added 5 subsystem requirement files (docs/reqstream/subsystem-{cli,configuration,modeling,utilities,selftest}.yaml) with corresponding subsystem integration test classes that verify inter-unit integration within each subsystem. requirements.yaml updated to include subsystem requirements above unit requirements.

System-Level Requirements & Tests

Added docs/reqstream/fileassert-system.yaml with system-level requirements covering end-to-end config execution, failure detection, silent output, and log file output. Two new end-to-end integration tests added (IntegrationTest_ValidConfig_PassingAssertions_ReturnsZero and IntegrationTest_ValidConfig_FailingAssertions_ReturnsNonZero) to cover the core assertion pass/fail scenarios. requirements.yaml updated to include system requirements at the top.

Review-Sets Update

Updated .reviewmark.yaml to follow the reviewmark-usage standard with a complete review-set structure:

  • FileAssert-System — system requirements, design intro and system docs, integration tests
  • FileAssert-Cli, FileAssert-Configuration, FileAssert-Modeling, FileAssert-Utilities, FileAssert-SelfTest — subsystem reviews
  • All unit reviews updated with new design doc paths
  • FileAssert-FileAssertData review added for the DTO design doc
  • Corrected file groupings: ContextNewPropertiesTests.cs moved to FileAssert-Context; IntegrationTests.cs moved to FileAssert-System

Resource Disposal Fix

Switched from using var context (C# 8 declaration-style) to explicit using (var context = ...) { } braces in SelfTestSubsystemTests and CliSubsystemTests. This ensures the Context's StreamWriter log file handle is fully released before File.ReadAllText reads the log content and before tempDir.Delete(recursive: true) removes the temporary directory — preventing "file in use" failures on Windows.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement

Related Issues

Pre-Submission Checklist

Before submitting this pull request, ensure you have completed the following:

Build and Test

  • Code builds successfully: dotnet build --configuration Release
  • All unit tests pass: dotnet test --configuration Release
  • Self-validation tests pass:
    dotnet run --project src/DemaConsulting.FileAssert --configuration Release --framework net10.0
    --no-build -- --validate
  • Code produces zero warnings

Code Quality

  • Code formatting is correct: dotnet format --verify-no-changes
  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • All linters pass: ./lint.sh (Unix/macOS) or cmd /c lint.bat / ./lint.bat (Windows)

Testing

  • Added unit tests for new functionality
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated ARCHITECTURE.md (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

94 tests pass across net8.0, net9.0, and net10.0 (up from 84 — 10 new tests: 8 subsystem integration tests + 2 system-level end-to-end tests). CodeQL found 0 alerts.

Copilot AI linked an issue Mar 30, 2026 that may be closed by this pull request
3 tasks
- Move source files into Cli/, Configuration/, Modeling/, Utilities/, SelfTest/ subsystems
- Update namespaces to match folder hierarchy (DemaConsulting.FileAssert.{Subsystem})
- Mirror test structure in test project with matching namespaces
- Add using directives for cross-namespace references
- Add system.md, subsystem and unit design docs (cli, configuration, modeling, utilities, selftest, program, context, file-assert-data, path-helpers, validation)
- Update docs/design/definition.yaml to include all new docs
- Add subsystem requirements YAML files (cli, configuration, modeling, utilities, selftest)
- Update requirements.yaml to include subsystem requirements
- Add subsystem integration test classes for each subsystem
- Add selftest to cspell dictionary

Agent-Logs-Url: https://github.com/demaconsulting/FileAssert/sessions/fa91af23-9344-4182-aa65-6d8b99d0db2e

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title [WIP] Update folder structure and namespaces to match design documentation feat: Update folder structure and namespaces to match design documentation Mar 30, 2026
Copilot AI requested a review from Malcolmnixon March 30, 2026 19:16
@Malcolmnixon
Copy link
Copy Markdown
Member

@copilot This is looking good, with a few caveats:

  • I'm not seeing system level requirements (usually a fileassert-system.yaml)
  • I'm not seeing updated review-sets (see the reviewmark-usage standard)

- Add docs/reqstream/fileassert-system.yaml with system-level requirements
- Add two new integration tests for end-to-end config execution (pass/fail)
- Update requirements.yaml to include system requirements at top
- Update .reviewmark.yaml with complete review-set structure:
  - FileAssert-System (system requirements, design intro/system, integration tests)
  - FileAssert-Cli/Configuration/Modeling/Utilities/SelfTest subsystem reviews
  - Updated unit reviews with new design docs and corrected file groupings
  - FileAssert-FileAssertData review for the new data design doc
  - Moved ContextNewPropertiesTests.cs from FileAssert-FileAssertConfig to FileAssert-Context
  - Moved IntegrationTests.cs from FileAssert-Program to FileAssert-System

Agent-Logs-Url: https://github.com/demaconsulting/FileAssert/sessions/09aae50d-3d67-4a2c-84ef-dfe80449ee7b

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 30, 2026

@copilot This is looking good, with a few caveats:

  • I'm not seeing system level requirements (usually a fileassert-system.yaml)
  • I'm not seeing updated review-sets (see the revie...

Added in commit 5d0107c:

  • docs/reqstream/fileassert-system.yaml — system-level requirements covering end-to-end config execution, failure detection, silent output, and log file writing. Two new integration tests added to cover the core assertion pass/fail scenarios.
  • .reviewmark.yaml — updated with the full review-set structure per the standard:
    • FileAssert-System (system requirements, design intro + system.md, integration tests)
    • FileAssert-Cli, FileAssert-Configuration, FileAssert-Modeling, FileAssert-Utilities, FileAssert-SelfTest subsystem reviews
    • All unit reviews updated with new design doc paths
    • FileAssert-FileAssertData review for the DTO design doc
    • Corrected groupings: ContextNewPropertiesTests.cs moved to FileAssert-Context; IntegrationTests.cs moved to FileAssert-System

@Malcolmnixon Malcolmnixon marked this pull request as ready for review March 30, 2026 20:05
Copilot AI review requested due to automatic review settings March 30, 2026 20:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restructures the source and test projects into subsystem-aligned folders/namespaces (per the design hierarchy), adds missing design documentation and requirement streams at system/subsystem level, and updates ReviewMark review-sets to match the new documentation and layout.

Changes:

  • Reorganized C# source/test code into subsystem directories with updated namespaces and corresponding using updates.
  • Added system + subsystem requirements (ReqStream YAML) and new subsystem/system integration tests to provide evidence.
  • Added/updated design documentation files and updated .reviewmark.yaml and docs/design/definition.yaml to reflect the hierarchy.

Reviewed changes

Copilot reviewed 45 out of 45 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/DemaConsulting.FileAssert/Cli/Context.cs Moves Context into DemaConsulting.FileAssert.Cli namespace.
src/DemaConsulting.FileAssert/Configuration/FileAssertConfig.cs Moves config loader into ...Configuration and updates imports.
src/DemaConsulting.FileAssert/Configuration/FileAssertData.cs Moves DTOs into ...Configuration namespace.
src/DemaConsulting.FileAssert/Modeling/FileAssertFile.cs Moves modeling type into ...Modeling and updates imports.
src/DemaConsulting.FileAssert/Modeling/FileAssertRule.cs Moves rule hierarchy into ...Modeling and updates imports.
src/DemaConsulting.FileAssert/Modeling/FileAssertTest.cs Moves test model into ...Modeling and updates imports.
src/DemaConsulting.FileAssert/Program.cs Updates imports to reference new subsystem namespaces.
src/DemaConsulting.FileAssert/SelfTest/Validation.cs Moves Validation into ...SelfTest and updates imports.
src/DemaConsulting.FileAssert/Utilities/PathHelpers.cs Moves utilities into ...Utilities namespace.
test/DemaConsulting.FileAssert.Tests/Cli/ContextTests.cs Aligns test namespace with Cli subsystem.
test/DemaConsulting.FileAssert.Tests/Cli/ContextNewPropertiesTests.cs Aligns test namespace with Cli subsystem.
test/DemaConsulting.FileAssert.Tests/Cli/CliSubsystemTests.cs Adds subsystem-level integration tests for CLI behavior.
test/DemaConsulting.FileAssert.Tests/Configuration/FileAssertConfigTests.cs Aligns test namespace with Configuration subsystem.
test/DemaConsulting.FileAssert.Tests/Configuration/ConfigurationSubsystemTests.cs Adds subsystem-level integration tests for config load/filter behavior.
test/DemaConsulting.FileAssert.Tests/IntegrationTests.cs Adds system-level pass/fail config execution tests; updates imports.
test/DemaConsulting.FileAssert.Tests/Modeling/FileAssertFileTests.cs Aligns test namespace with Modeling subsystem.
test/DemaConsulting.FileAssert.Tests/Modeling/FileAssertRuleTests.cs Aligns test namespace with Modeling subsystem.
test/DemaConsulting.FileAssert.Tests/Modeling/FileAssertTestTests.cs Aligns test namespace with Modeling subsystem.
test/DemaConsulting.FileAssert.Tests/Modeling/ModelingSubsystemTests.cs Adds subsystem-level integration tests for modeling execution chain.
test/DemaConsulting.FileAssert.Tests/ProgramTests.cs Updates imports to new namespaces.
test/DemaConsulting.FileAssert.Tests/SelfTest/SelfTestSubsystemTests.cs Adds subsystem-level integration test for self-validation pipeline.
test/DemaConsulting.FileAssert.Tests/SelfTest/ValidationTests.cs Aligns test namespace with SelfTest subsystem.
test/DemaConsulting.FileAssert.Tests/Utilities/PathHelpersTests.cs Aligns test namespace/imports with Utilities subsystem.
test/DemaConsulting.FileAssert.Tests/Utilities/UtilitiesSubsystemTests.cs Adds subsystem-level integration test for safe path handling.
docs/design/cli.md Adds CLI subsystem design doc.
docs/design/configuration.md Adds Configuration subsystem design doc.
docs/design/context.md Adds Context unit design doc.
docs/design/definition.yaml Updates design doc build order to include new hierarchy.
docs/design/file-assert-data.md Adds DTO unit design doc.
docs/design/modeling.md Adds Modeling subsystem design doc.
docs/design/path-helpers.md Adds PathHelpers unit design doc.
docs/design/program.md Adds Program unit design doc.
docs/design/selftest.md Adds SelfTest subsystem design doc.
docs/design/system.md Adds system-level design/flow doc.
docs/design/utilities.md Adds Utilities subsystem design doc.
docs/design/validation.md Adds Validation unit design doc.
docs/reqstream/fileassert-system.yaml Adds system-level requirements and maps to integration tests.
docs/reqstream/subsystem-cli.yaml Adds CLI subsystem requirements and maps to subsystem tests.
docs/reqstream/subsystem-configuration.yaml Adds Configuration subsystem requirements and maps to subsystem tests.
docs/reqstream/subsystem-modeling.yaml Adds Modeling subsystem requirements and maps to subsystem tests.
docs/reqstream/subsystem-selftest.yaml Adds SelfTest subsystem requirements and maps to subsystem tests.
docs/reqstream/subsystem-utilities.yaml Adds Utilities subsystem requirements and maps to subsystem tests.
requirements.yaml Includes system + subsystem requirement streams ahead of unit streams.
.reviewmark.yaml Updates review-sets to match new requirements/design/test grouping.
.cspell.yaml Adds selftest dictionary word for spelling checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Malcolmnixon
Copy link
Copy Markdown
Member

@copilot SelfTestSubsystem_Run_ExecutesBuiltInTestsAndProducesSummary failed on Windows because a file was in use. Can you check for proper disposal of resources.

Use explicit `using (var context = ...) { }` braces in SelfTestSubsystemTests
and CliSubsystemTests so the log file handle is fully released before:
- File.ReadAllText reads the log content
- tempDir.Delete(recursive: true) deletes the temp directory

Prevents 'file in use' errors on Windows where handles are not immediately
released after IDisposable.Dispose() if the file is still referenced.

Agent-Logs-Url: https://github.com/demaconsulting/FileAssert/sessions/ad3cb669-ac43-4111-be69-5b914dde7fc7

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 30, 2026

@copilot SelfTestSubsystem_Run_ExecutesBuiltInTestsAndProducesSummary failed on Windows because a file was in use. Can you check for proper disposal of resources.

Fixed in commit 83f06f4. Both SelfTestSubsystemTests and CliSubsystemTests now use explicit using (...) { } braces so the Context (and its StreamWriter log file handle) is fully disposed before File.ReadAllText reads the log and before tempDir.Delete(recursive: true) removes the directory. This matches the pattern already established in the pre-existing ValidationTests.Validation_Run_WithSilentContext_PrintsSummary test.

@Malcolmnixon Malcolmnixon merged commit d51bc38 into main Mar 30, 2026
15 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/update-folder-structure-namespaces branch March 30, 2026 22:28
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.

[Feature]: Update folder structure and namespaces

3 participants