Skip to content

Conversation

@TabishB
Copy link
Contributor

@TabishB TabishB commented Oct 16, 2025

Summary

  • Skip metadata lines when extracting requirement text so SHALL/MUST validation inspects the requirement statement.
  • Respect intentional validation skips from the CLI so archive runs without Validator work when requested.

Root Cause

  • Requirement metadata such as **ID**: ... was the first non-empty line, so validation looked at metadata instead of requirement text.
  • Commander maps --no-validate to options.validate = false, but the archive command only checked noValidate, so validation still executed.

Changes

  • Update the requirement text extraction helper to ignore blank and metadata lines before returning content.
  • Treat both noValidate and validate: false as skip signals and guard downstream validation calls.
  • Add tests covering metadata-aware validation and the no-validate archive path.

Tests

  • pnpm test

Fixes validation incorrectly checking metadata lines instead of requirement text.

The extractRequirementText() function was returning the first non-empty line
after the requirement header, which was often metadata like **ID**: REQ-001
instead of the actual requirement statement.

Changes:
- Updated extractRequirementText() to skip lines matching **Key**: Value pattern
- Skip blank lines between header and requirement text
- Return first substantive text line for SHALL/MUST validation

Added comprehensive tests for:
- Requirements with metadata before SHALL/MUST text
- Requirements with SHALL in text but not header
- Requirements correctly failing without SHALL/MUST
- Requirements without metadata fields

All 20 validation tests pass.

Fixes #159
@TabishB TabishB changed the title fix: skip metadata when validating requirement SHALL/MUST keywords fix: honor --no-validate and ignore metadata during archive validation Oct 16, 2025
@TabishB TabishB merged commit 88b260d into main Oct 16, 2025
6 checks passed
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.

2 participants