Skip to content

feat: flag SVCs as stale when their requirement changed after review #487

Open

Description

@jimisola

Problem description

When a requirement or an SVC changes, nothing tells you that the tests verifying it were written against the old text. status keeps showing the requirement as complete as long as the same tests pass, even if the requirement now says something different. The revision and lifecycle fields exist, but no command compares them with anything.

Desired solution

Record, per SVC, which version of its requirement it was last reviewed against, and have status and validate flag the SVC as stale when the requirement has changed since.

One way:

  • A command (for example reqstool approve local -p docs/reqstool [--svc SVC_CORE_0001]) stores a content hash of each requirement and SVC in a lock file committed with the repository.
  • status and validate recompute the hashes and report an SVC as stale when its requirement or the SVC itself changed after approval, with an option to make that an error in CI.
  • The hash covers every field that changes meaning (title, description, significance, rationale, requirement_ids, lifecycle), not only the description, so a change cannot slip past by editing a field that is not hashed.

Alternatives considered

  • Compare the requirement's revision with a revision recorded on the SVC: no lock file, but relies on people bumping revision on every change.
  • Review the diff of requirements.yml in pull requests: works only if reviewers check which tests are affected.

Additional context

This turns "the tests pass" into "the tests pass and were reviewed against the current requirement", which is what traceability evidence is usually meant to show.

Activity

  1. jimisola commented on Nov 20, 2026

    @jimisola
    MemberAuthor

    Two suggestions for the design:

    • Record who approved, not only the hash. For example reqstool approve ... --by <name> writing {by, at, hash} per SVC. A lock file that says the SVC was reviewed but not by whom is weaker evidence than it looks. An entry without by could be reported as unapproved.
    • Hash meaning, not bookkeeping. The list in the issue is right to hash title, description, significance, rationale, requirement_ids and lifecycle. It should also leave out fields that do not change meaning (for example revision alone, formatting, key order), so a cosmetic edit does not invalidate every approval and teach people to re-approve without reading. Normalise the YAML before hashing.

    A related idea: when status reports an SVC as stale, show which fields changed since approval, so the reviewer knows what to look at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions