Skip to content

feat(analyze): detect closed vocabulary drift - #4160

Open
AnkitPorwal04 wants to merge 1 commit into
github:mainfrom
AnkitPorwal04:feat/4106-closed-vocabulary-analysis
Open

feat(analyze): detect closed vocabulary drift#4160
AnkitPorwal04 wants to merge 1 commit into
github:mainfrom
AnkitPorwal04:feat/4106-closed-vocabulary-analysis

Conversation

@AnkitPorwal04

Copy link
Copy Markdown

Summary

  • inventory explicitly named finite sets during semantic modeling
  • compare repeated declarations and report their symmetric member difference
  • avoid false positives for documented subsets and unnamed example lists
  • expose a closed-vocabulary mismatch metric in the analysis report
  • add a focused command-template contract test

Fixes #4106

Testing

  • .venv\Scripts\python.exe -m pytest tests\test_analyze_closed_vocabulary.py tests\test_specify_template_numbering.py -q (3 passed)
  • git diff --check

AI assistance disclosure

This pull request was implemented, tested, and drafted autonomously by OpenAI Codex (GPT-5) on behalf of @AnkitPorwal04. The human operator selected the overall goal but did not line-by-line author or review the patch before submission.

Teach the analysis command to inventory and compare repeated named finite sets while distinguishing explicit subsets.

Assisted-by: OpenAI Codex (GPT-5, autonomous)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds closed-vocabulary drift detection to /speckit.analyze.

Changes:

  • Inventories and compares repeated finite sets.
  • Reports mismatches and permits declared subsets.
  • Adds a template contract test.
Show a summary per file
File Description
templates/commands/analyze.md Adds detection guidance and metrics.
tests/test_analyze_closed_vocabulary.py Verifies required guidance exists.

Review details

馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 4
  • Review effort level: Balanced

- Task ordering contradictions (e.g., integration tasks before foundational setup tasks without dependency note)
- Conflicting requirements (e.g., one requires Next.js while other specifies Vue)

#### G. Closed Vocabulary Consistency
- **User story/action inventory**: Discrete user actions with acceptance criteria
- **Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
- **Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
- **Closed-vocabulary inventory**: Record explicitly named finite sets (for example statuses, roles, categories, or enum-like value lists), their members, and each location where they are declared
- Coverage % (requirements with >=1 task)
- Ambiguity Count
- Duplication Count
- Closed Vocabulary Mismatch Count
- Find explicitly named finite sets that are enumerated in more than one artifact or section
- Compare repeated declarations after normalizing case, quoting, and presentation order while preserving the actual member names
- Flag declarations of the same named set when members are missing, added, or renamed, and report both locations plus the symmetric difference
- Treat an explicitly identified subset as intentional when the artifact states the subset relationship; otherwise report the divergence as a warning rather than assuming it is an error

@mnriem mnriem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please address Copilot feedback

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]: /speckit.analyze should flag closed vocabularies that are enumerated differently in different artifacts

3 participants