feat(analyze): detect closed vocabulary drift - #4160
Open
AnkitPorwal04 wants to merge 1 commit into
Open
Conversation
Teach the analysis command to inventory and compare repeated named finite sets while distinguishing explicit subsets. Assisted-by: OpenAI Codex (GPT-5, autonomous)
Contributor
There was a problem hiding this comment.
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
requested changes
Aug 17, 2026
mnriem
left a comment
Collaborator
There was a problem hiding this comment.
Please address Copilot feedback
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.
Summary
Fixes #4106
Testing
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.