feat: add --depth command-line argument to VersionMark#73
Merged
Malcolmnixon merged 4 commits intomainfrom Apr 15, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/demaconsulting/VersionMark/sessions/578eb4ab-7f67-4133-baeb-e90a2e02b12f Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Add --depth argument that: - Controls the markdown header depth for the self-validation report - Serves as the default value for --report-depth when not explicitly specified - Defaults to 1 (depth 1 = '#', depth 2 = '##', etc.) Changes: - Context.cs: Add Depth property, update ArgumentParser with Depth, _explicitReportDepth field, and computed ReportDepth property - Program.cs: Add --depth to help text, update --report-depth description - Validation.cs: Use context.Depth for PrintValidationHeader heading level - ContextTests.cs: Rename DefaultsToTwo -> DefaultsToDepthOne, add 6 new tests - SelfTestTests.cs: Add SelfTest_Run_WithDepthTwo_WritesHashHashHeader test - IntegrationTests.cs, ProgramTests.cs: Update assertions for new default depth=1 - docs/user_guide/guide.md: Document --depth option and usage examples - docs/design/version-mark/cli/context.md: Add Depth property to table - docs/reqstream/version-mark/cli/context.yaml: Add new test names - docs/reqstream/version-mark/self-test/validation.yaml: Add HeaderDepth requirement - README.md: Fix pre-existing table alignment lint error Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Malcolmnixon
April 14, 2026 11:14
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new --depth CLI argument to control Markdown heading depth for self-validation output and to serve as the default for --report-depth in publish mode, updating documentation and tests accordingly.
Changes:
- Add
Context.Depth(default1) and makeContext.ReportDepthdefault toDepthunless--report-depthis explicitly provided. - Use
context.Depthto control the self-validation report heading level. - Update docs and tests to reflect the new default heading depth behavior.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/DemaConsulting.VersionMark/Cli/Context.cs |
Adds Depth, changes ReportDepth defaulting behavior, and extends argument parsing. |
src/DemaConsulting.VersionMark/Program.cs |
Updates help output to include --depth and adjust --report-depth description. |
src/DemaConsulting.VersionMark/SelfTest/Validation.cs |
Uses context.Depth when printing the validation report heading. |
test/DemaConsulting.VersionMark.Tests/Cli/ContextTests.cs |
Adds coverage for --depth parsing and defaulting rules between Depth and ReportDepth. |
test/DemaConsulting.VersionMark.Tests/SelfTest/SelfTestTests.cs |
Adds a test verifying --depth affects the self-validation header level. |
test/DemaConsulting.VersionMark.Tests/ProgramTests.cs |
Updates expected default publish report heading from ## to #. |
test/DemaConsulting.VersionMark.Tests/IntegrationTests.cs |
Updates expected default publish report heading from ## to #. |
README.md |
Documents --depth and updates --report-depth default semantics. |
docs/user_guide/guide.md |
Documents --depth and updates publish examples/default semantics. |
docs/design/version-mark/cli/context.md |
Updates design table to include Depth and new ReportDepth defaulting. |
docs/reqstream/version-mark/cli/context.yaml |
Adds new/renamed test method references for the Context depth behavior. |
docs/reqstream/version-mark/self-test/validation.yaml |
Adds requirement/test mapping for depth-controlled validation header. |
Comments suppressed due to low confidence (1)
src/DemaConsulting.VersionMark/Cli/Context.cs:405
- Same concern for
--depth: it is unbounded above, but is used to construct Markdown heading prefixes. Please add an upper-bound validation (e.g., 6) or clamp the value to avoid pathological allocations / invalid Markdown output.
case "--depth":
Depth = GetRequiredIntArgument(arg, args, index, "a depth value");
if (Depth < 1)
{
throw new ArgumentException($"{arg} requires a positive integer value (minimum 1)", nameof(args));
}
return index + 1;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/demaconsulting/VersionMark/sessions/a2d2cf22-46bc-4489-99dd-a64396c4a723 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Malcolmnixon
requested changes
Apr 14, 2026
Agent-Logs-Url: https://github.com/demaconsulting/VersionMark/sessions/c16f98d3-5602-4292-97e1-31d0b2c82925 Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Malcolmnixon
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Adds a
--depthargument (default: 1, range: 1–6) that controls the markdown heading depth of the self-validation report and acts as the default value for--report-depthin publish mode when not explicitly specified.Behavior:
--depth Nsets the self-validation heading toNhashes (e.g.,--depth 2→## DEMA Consulting VersionMark)--depth Nsets the default for--report-depth— explicit--report-depthalways wins# DEMA Consulting VersionMark)--depthand--report-depthare validated to the range 1–6 (matching Markdown heading levels), with anArgumentExceptionthrown for out-of-range valuesExample:
Implementation highlights:
Context.cs: AddedDepthproperty;ArgumentParser.ReportDepthcomputed as_explicitReportDepth ?? Depth; both--depthand--report-depthvalidated to range 1–6Validation.cs:PrintValidationHeaderderives heading prefix fromcontext.DepthProgram.cs: Help text updated for--depthand--report-depthshowing range 1–6--report-depthchanged from 2 → 1 (via--depthdefault); affected integration tests updated accordinglySelfTestTests.cs: UsesValidation.Run(context)directly instead ofProgram.Run(context)to respect subsystem hierarchyType of Change
Related Issues
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
dotnet build --configuration Releasedotnet test --configuration Releasedotnet run --project src/DemaConsulting.VersionMark --configuration Release --framework net10.0--no-build -- --validateCode Quality
dotnet format --verify-no-changesQuality Checks
Please run the following checks before submitting:
cspell "**/*.{md,cs}"markdownlint "**/*.md"yamllint .Testing
Documentation
Additional Notes
Context_Create_NoReportDepth_DefaultsToTworenamed toContext_Create_NoReportDepth_DefaultsToDepthOneto reflect the new default. Integration tests expecting## Tool Versionsupdated to# Tool Versions. Upper-bound testsContext_Create_DepthSeven_ThrowsArgumentExceptionandContext_Create_ReportDepthSeven_ThrowsArgumentExceptionadded to cover the range 1–6 enforcement. SelfTest subsystem tests now callValidation.Run(context)directly rather thanProgram.Run(context)to comply with subsystem hierarchy rules.