eslint-plugin-traceability 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/CHANGELOG.md +82 -0
  2. package/README.md +73 -32
  3. package/docs/ci-cd-pipeline.md +224 -0
  4. package/docs/cli-integration.md +22 -0
  5. package/docs/code-quality-refactor-opportunities-2025-12-03.md +78 -0
  6. package/docs/config-presets.md +38 -0
  7. package/docs/conventional-commits-guide.md +185 -0
  8. package/docs/custom-rules-development-guide.md +659 -0
  9. package/docs/decisions/0001-allow-dynamic-require-for-built-plugins.md +26 -0
  10. package/docs/decisions/001-typescript-for-eslint-plugin.accepted.md +111 -0
  11. package/docs/decisions/002-jest-for-eslint-testing.accepted.md +137 -0
  12. package/docs/decisions/003-code-quality-ratcheting-plan.md +48 -0
  13. package/docs/decisions/004-automated-version-bumping-for-ci-cd.md +196 -0
  14. package/docs/decisions/005-github-actions-validation-tooling.accepted.md +144 -0
  15. package/docs/decisions/006-semantic-release-for-automated-publishing.accepted.md +227 -0
  16. package/docs/decisions/007-github-releases-over-changelog.accepted.md +216 -0
  17. package/docs/decisions/008-ci-audit-flags.accepted.md +60 -0
  18. package/docs/decisions/009-security-focused-lint-rules.accepted.md +64 -0
  19. package/docs/decisions/010-implements-annotation-for-multi-story-requirements.proposed.md +184 -0
  20. package/docs/decisions/adr-0001-console-usage-for-cli-guards.md +190 -0
  21. package/docs/decisions/adr-accept-dev-dep-risk-glob.md +40 -0
  22. package/docs/decisions/adr-commit-branch-tests.md +54 -0
  23. package/docs/decisions/adr-maintenance-cli-interface.md +140 -0
  24. package/docs/decisions/adr-pre-push-parity.md +112 -0
  25. package/docs/decisions/code-quality-ratcheting-plan.md +53 -0
  26. package/docs/dependency-health.md +238 -0
  27. package/docs/eslint-9-setup-guide.md +517 -0
  28. package/docs/eslint-plugin-development-guide.md +487 -0
  29. package/docs/functionality-coverage-2025-12-03.md +250 -0
  30. package/docs/jest-testing-guide.md +100 -0
  31. package/docs/rules/prefer-implements-annotation.md +219 -0
  32. package/docs/rules/require-branch-annotation.md +71 -0
  33. package/docs/rules/require-req-annotation.md +203 -0
  34. package/docs/rules/require-story-annotation.md +159 -0
  35. package/docs/rules/valid-annotation-format.md +418 -0
  36. package/docs/rules/valid-req-reference.md +153 -0
  37. package/docs/rules/valid-story-reference.md +120 -0
  38. package/docs/security-incidents/2025-11-17-glob-cli-incident.md +45 -0
  39. package/docs/security-incidents/2025-11-18-brace-expansion-redos.md +45 -0
  40. package/docs/security-incidents/2025-11-18-bundled-dev-deps-accepted-risk.md +93 -0
  41. package/docs/security-incidents/2025-11-18-tar-race-condition.md +43 -0
  42. package/docs/security-incidents/2025-12-03-dependency-health-review.md +58 -0
  43. package/docs/security-incidents/SECURITY-INCIDENT-2025-11-18-semantic-release-bundled-npm.known-error.md +104 -0
  44. package/docs/security-incidents/SECURITY-INCIDENT-TEMPLATE.md +37 -0
  45. package/docs/security-incidents/dependency-override-rationale.md +57 -0
  46. package/docs/security-incidents/dev-deps-high.json +116 -0
  47. package/docs/security-incidents/handling-procedure.md +54 -0
  48. package/docs/stories/001.0-DEV-PLUGIN-SETUP.story.md +92 -0
  49. package/docs/stories/002.0-DEV-ESLINT-CONFIG.story.md +82 -0
  50. package/docs/stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md +112 -0
  51. package/docs/stories/004.0-DEV-BRANCH-ANNOTATIONS.story.md +153 -0
  52. package/docs/stories/005.0-DEV-ANNOTATION-VALIDATION.story.md +138 -0
  53. package/docs/stories/006.0-DEV-FILE-VALIDATION.story.md +144 -0
  54. package/docs/stories/007.0-DEV-ERROR-REPORTING.story.md +163 -0
  55. package/docs/stories/008.0-DEV-AUTO-FIX.story.md +150 -0
  56. package/docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md +117 -0
  57. package/docs/stories/010.0-DEV-DEEP-VALIDATION.story.md +124 -0
  58. package/docs/stories/010.1-DEV-CONFIGURABLE-PATTERNS.story.md +149 -0
  59. package/docs/stories/010.2-DEV-MULTI-STORY-SUPPORT.story.md +216 -0
  60. package/docs/stories/010.3-DEV-MIGRATE-TO-IMPLEMENTS.story.md +236 -0
  61. package/docs/stories/developer-story.map.md +120 -0
  62. package/docs/ts-jest-presets-guide.md +548 -0
  63. package/lib/src/index.d.ts +2 -2
  64. package/lib/src/index.js +2 -0
  65. package/lib/src/maintenance/batch.d.ts +5 -0
  66. package/lib/src/maintenance/batch.js +5 -0
  67. package/lib/src/maintenance/cli.js +34 -212
  68. package/lib/src/maintenance/commands.d.ts +32 -0
  69. package/lib/src/maintenance/commands.js +139 -0
  70. package/lib/src/maintenance/detect.d.ts +2 -0
  71. package/lib/src/maintenance/detect.js +4 -0
  72. package/lib/src/maintenance/flags.d.ts +99 -0
  73. package/lib/src/maintenance/flags.js +121 -0
  74. package/lib/src/maintenance/report.d.ts +2 -0
  75. package/lib/src/maintenance/report.js +2 -0
  76. package/lib/src/maintenance/update.d.ts +4 -0
  77. package/lib/src/maintenance/update.js +4 -0
  78. package/lib/src/rules/helpers/require-story-io.d.ts +3 -0
  79. package/lib/src/rules/helpers/require-story-io.js +20 -6
  80. package/lib/src/rules/helpers/valid-annotation-format-internal.d.ts +30 -0
  81. package/lib/src/rules/helpers/valid-annotation-format-internal.js +36 -0
  82. package/lib/src/rules/helpers/valid-annotation-options.js +15 -4
  83. package/lib/src/rules/helpers/valid-annotation-utils.js +5 -0
  84. package/lib/src/rules/helpers/valid-implements-utils.d.ts +75 -0
  85. package/lib/src/rules/helpers/valid-implements-utils.js +149 -0
  86. package/lib/src/rules/helpers/valid-story-reference-helpers.d.ts +3 -4
  87. package/lib/src/rules/prefer-implements-annotation.d.ts +39 -0
  88. package/lib/src/rules/prefer-implements-annotation.js +276 -0
  89. package/lib/src/rules/valid-annotation-format.js +87 -28
  90. package/lib/src/rules/valid-req-reference.js +71 -0
  91. package/lib/src/utils/reqAnnotationDetection.d.ts +4 -1
  92. package/lib/src/utils/reqAnnotationDetection.js +43 -15
  93. package/lib/tests/maintenance/cli.test.js +89 -0
  94. package/lib/tests/plugin-default-export-and-configs.test.js +3 -0
  95. package/lib/tests/rules/prefer-implements-annotation.test.d.ts +1 -0
  96. package/lib/tests/rules/prefer-implements-annotation.test.js +84 -0
  97. package/lib/tests/rules/require-req-annotation.test.js +8 -1
  98. package/lib/tests/rules/require-story-annotation.test.js +9 -4
  99. package/lib/tests/rules/valid-annotation-format.test.js +78 -0
  100. package/lib/tests/rules/valid-req-reference.test.js +34 -0
  101. package/lib/tests/utils/ts-language-options.d.ts +1 -7
  102. package/lib/tests/utils/ts-language-options.js +8 -5
  103. package/package.json +7 -3
  104. package/user-docs/api-reference.md +507 -0
  105. package/user-docs/eslint-9-setup-guide.md +639 -0
  106. package/user-docs/examples.md +74 -0
  107. package/user-docs/migration-guide.md +158 -0
@@ -0,0 +1,227 @@
1
+ ---
2
+ status: "accepted"
3
+ date: 2025-11-17
4
+ decision-makers: [Development Team]
5
+ consulted:
6
+ [
7
+ semantic-release Documentation,
8
+ Conventional Commits Specification,
9
+ GitHub Actions Best Practices,
10
+ npm Publishing Guidelines,
11
+ ]
12
+ informed: [Project Stakeholders, CI/CD Pipeline Maintainers]
13
+ ---
14
+
15
+ # Semantic Release for Automated Publishing
16
+
17
+ ## Context and Problem Statement
18
+
19
+ The current automated version bumping strategy (ADR 004) has several limitations that impact maintainability and developer experience:
20
+
21
+ 1. **Single Increment Logic**: The CI/CD pipeline only increments the version once, requiring complex loop logic to handle cases where multiple increments are needed (e.g., when both 1.0.3 and 1.0.4 already exist on npm)
22
+
23
+ 2. **No Semantic Version Determination**: The system only performs patch increments and cannot automatically determine when minor or major version bumps are appropriate based on the nature of changes
24
+
25
+ 3. **Missing Release Management**: No automatic git tagging, release notes, or CHANGELOG.md generation, reducing traceability and release visibility
26
+
27
+ 4. **Workflow Complexity**: The custom version increment logic in GitHub Actions is becoming complex and error-prone, potentially violating workflow validation best practices established in ADR 005
28
+
29
+ 5. **Package.json/npm Version Drift**: The package.json version in the repository can lag behind the published npm version, creating confusion about the actual release state
30
+
31
+ The current approach was designed as a temporary solution to prevent npm publish failures, but its limitations suggest that a more comprehensive release automation strategy is needed.
32
+
33
+ ## Decision Drivers
34
+
35
+ - Need for proper semantic version determination based on change significance
36
+ - Automatic generation of release notes and changelog maintenance
37
+ - Git tag creation for release tracking and traceability
38
+ - Elimination of complex custom version increment logic in CI/CD workflows
39
+ - Integration with conventional commit standards for automated version type detection
40
+ - Prevention of unnecessary publishing when no changes warrant a release
41
+ - Alignment with npm ecosystem best practices for release management
42
+ - Simplification of GitHub Actions workflow to improve maintainability and validation compliance
43
+
44
+ ## Considered Options
45
+
46
+ - Enhance current in-memory version increment approach with loop logic
47
+ - Implement semantic-release with conventional commits
48
+ - Switch to git write-back approach with automated tagging
49
+ - Implement manual release workflow with GitHub releases
50
+
51
+ ## Decision Outcome
52
+
53
+ Chosen option: "semantic-release with conventional commits", because it provides comprehensive release automation, proper semantic versioning, automated changelog generation, and eliminates the need for complex custom version logic while following industry standards.
54
+
55
+ ### Implementation Strategy
56
+
57
+ 1. **Install and Configure semantic-release**:
58
+ - Add `semantic-release` and related plugins as development dependencies
59
+ - Configure semantic-release with conventional commits preset
60
+ - Set up plugins for npm publishing, git tagging, and changelog generation
61
+
62
+ 2. **Establish Conventional Commit Standards**:
63
+ - Adopt conventional commit message format for semantic version determination
64
+ - Configure semantic-release to analyze commit messages for version impact
65
+ - Document commit message guidelines for contributors
66
+
67
+ 3. **Update CI/CD Pipeline**:
68
+ - Replace custom version increment logic with semantic-release execution
69
+ - Configure semantic-release to run on main branch pushes
70
+ - Set up proper npm registry authentication and git permissions
71
+
72
+ 4. **Configure Release Automation**:
73
+ - Automatic CHANGELOG.md generation and maintenance
74
+ - Git tag creation for each release
75
+ - GitHub release creation with release notes
76
+ - Conditional publishing (only when changes warrant a release)
77
+
78
+ ### Consequences
79
+
80
+ - Good, because eliminates complex custom version increment logic from CI/CD workflows
81
+ - Good, because provides proper semantic version determination based on commit analysis
82
+ - Good, because automatically generates and maintains CHANGELOG.md with release notes
83
+ - Good, because creates proper git tags and GitHub releases for traceability
84
+ - Good, because follows conventional commits standard adopted widely in open source
85
+ - Good, because only publishes when changes actually warrant a new release
86
+ - Good, because avoids package.json version drift by using git tags as source of truth
87
+ - Good, because simplifies GitHub Actions workflow, improving validation compliance
88
+ - Good, because provides comprehensive release management with minimal configuration
89
+ - Good, because prevents infinite CI loops from version commits
90
+ - Neutral, because requires team adoption of conventional commit message format
91
+ - Neutral, because package.json version in repository may lag behind published version (git tags are source of truth)
92
+ - Bad, because introduces dependency on semantic-release tool and its ecosystem
93
+ - Bad, because may require learning curve for conventional commit message format
94
+
95
+ ### Confirmation
96
+
97
+ Implementation compliance will be confirmed through:
98
+
99
+ - semantic-release successfully analyzes commits and determines appropriate version increments
100
+ - Automatic CHANGELOG.md generation and git tag creation on releases
101
+ - CI/CD pipeline publishes to npm only when semantic-release determines a release is warranted
102
+ - No npm publish failures due to version conflicts or unnecessary publishing attempts
103
+ - Package.json version remains synchronized with published npm version
104
+ - GitHub Actions workflow simplified and validates successfully with actionlint (ADR 005)
105
+ - Conventional commit message format adopted and documented for contributors
106
+
107
+ ## Pros and Cons of the Options
108
+
109
+ ### semantic-release with conventional commits
110
+
111
+ Comprehensive automated release management based on commit message analysis.
112
+
113
+ - Good, because industry standard tool with extensive ecosystem
114
+ - Good, because proper semantic version determination based on commit analysis
115
+ - Good, because automatic CHANGELOG.md and release notes generation
116
+ - Good, because creates git tags and GitHub releases automatically
117
+ - Good, because only publishes when changes warrant a release
118
+ - Good, because eliminates custom version increment logic complexity
119
+ - Good, because maintains git history and package.json synchronization
120
+ - Good, because follows conventional commits standard
121
+ - Good, because comprehensive documentation and community support
122
+ - Neutral, because requires conventional commit message discipline
123
+ - Neutral, because adds dependency on semantic-release ecosystem
124
+ - Bad, because requires git write permissions in CI/CD
125
+ - Bad, because learning curve for commit message conventions
126
+
127
+ ### Enhanced in-memory version increment with loop logic
128
+
129
+ Improve the current approach with better version conflict resolution.
130
+
131
+ - Good, because builds on existing working foundation
132
+ - Good, because no external dependencies or new tooling
133
+ - Good, because maintains current simplicity of git read-only CI/CD
134
+ - Neutral, because addresses immediate technical limitation
135
+ - Bad, because still provides only patch-level version increments
136
+ - Bad, because no semantic version determination capability
137
+ - Bad, because no automatic changelog or git tag generation
138
+ - Bad, because increases complexity of custom GitHub Actions logic
139
+ - Bad, because doesn't address package.json/npm version synchronization
140
+ - Bad, because potential for workflow validation issues with complex logic
141
+
142
+ ### Git write-back approach with automated tagging
143
+
144
+ Custom solution with git operations for version commits and tagging.
145
+
146
+ - Good, because provides git tag creation and version history
147
+ - Good, because maintains package.json synchronization
148
+ - Good, because can be customized for specific project needs
149
+ - Neutral, because requires git write permissions
150
+ - Bad, because requires complex infinite loop prevention logic
151
+ - Bad, because no semantic version determination
152
+ - Bad, because no automated changelog generation
153
+ - Bad, because potential race conditions in CI/CD
154
+ - Bad, because increased failure modes with git operations
155
+ - Bad, because custom implementation maintenance burden
156
+
157
+ ### Manual release workflow with GitHub releases
158
+
159
+ Manual release creation through GitHub interface with automated publishing.
160
+
161
+ - Good, because provides full control over release timing and messaging
162
+ - Good, because natural integration with GitHub releases interface
163
+ - Good, because allows for manual changelog and release notes
164
+ - Good, because no automated commit message requirements
165
+ - Neutral, because requires manual intervention for releases
166
+ - Bad, because breaks continuous delivery principle
167
+ - Bad, because prone to human error and forgotten releases
168
+ - Bad, because no automation of version determination
169
+ - Bad, because workflow friction for regular development
170
+ - Bad, because doesn't solve original npm publish failure problem
171
+
172
+ ## More Information
173
+
174
+ This decision supersedes ADR 004 "Automated Version Bumping for CI/CD Publishing", which served as a temporary solution to prevent npm publish failures but has reached its limitations in terms of semantic versioning and release management.
175
+
176
+ semantic-release configuration will include:
177
+
178
+ ```json
179
+ {
180
+ "branches": ["main"],
181
+ "plugins": [
182
+ "@semantic-release/commit-analyzer",
183
+ "@semantic-release/release-notes-generator",
184
+ "@semantic-release/changelog",
185
+ "@semantic-release/npm",
186
+ "@semantic-release/github"
187
+ ]
188
+ }
189
+ ```
190
+
191
+ **Note**: The `@semantic-release/git` plugin is intentionally excluded. semantic-release will manage versions through git tags only, without committing version changes back to package.json. This approach:
192
+
193
+ - Prevents infinite CI loops from version commits
194
+ - Follows npm ecosystem best practices where tags are the source of truth
195
+ - Keeps the repository history clean of automated version bump commits
196
+ - Aligns with how other projects in the ecosystem use semantic-release
197
+
198
+ The published npm package will have the correct version, but package.json in the repository may not reflect the latest published version. Git tags serve as the authoritative version record.
199
+
200
+ Conventional commit format examples:
201
+
202
+ - `feat: add new validation rule` → minor version increment
203
+ - `fix: resolve annotation parsing issue` → patch version increment
204
+ - `feat!: change API interface` → major version increment
205
+ - `docs: update README` → no version increment
206
+
207
+ GitHub Actions workflow simplification:
208
+
209
+ - Remove custom version increment logic
210
+ - Replace with single `npx semantic-release` command
211
+ - Configure necessary permissions (contents:write, issues:write, pull-requests:write, id-token:write)
212
+ - Set HUSKY=0 environment variable to disable git hooks during release
213
+ - Maintain existing quality checks and security audits
214
+ - Add smoke test for published package verification
215
+
216
+ This decision should be re-evaluated if:
217
+
218
+ - Conventional commit discipline becomes difficult to maintain
219
+ - semantic-release ecosystem introduces breaking changes or maintenance issues
220
+ - Project requirements change to need custom release logic not supported by semantic-release
221
+ - Team prefers different commit message standards incompatible with conventional commits
222
+
223
+ Related resources:
224
+
225
+ - [semantic-release Documentation](https://semantic-release.gitbook.io/)
226
+ - [Conventional Commits Specification](https://www.conventionalcommits.org/)
227
+ - [GitHub Actions with semantic-release](https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/github-actions.md)
@@ -0,0 +1,216 @@
1
+ ---
2
+ status: "accepted"
3
+ date: 2025-11-17
4
+ decision-makers: [Development Team]
5
+ consulted:
6
+ [
7
+ semantic-release Documentation,
8
+ GitHub Releases Best Practices,
9
+ Open Source Project Standards,
10
+ ]
11
+ informed: [Project Contributors, Package Users]
12
+ ---
13
+
14
+ # GitHub Releases Over Manual CHANGELOG.md Maintenance
15
+
16
+ ## Context and Problem Statement
17
+
18
+ With the adoption of semantic-release (ADR 006), the project now has automated changelog generation and GitHub release creation capabilities. However, we currently maintain a manual CHANGELOG.md file that duplicates this information and creates several issues:
19
+
20
+ 1. **Duplicate Effort**: semantic-release automatically generates release notes and CHANGELOG.md content, making manual maintenance redundant
21
+
22
+ 2. **Synchronization Risk**: Manual CHANGELOG.md updates can become out of sync with actual releases, creating confusion about what changes were included in which version
23
+
24
+ 3. **Source of Truth Ambiguity**: Having both a manual CHANGELOG.md and automated GitHub Releases creates uncertainty about which source is authoritative for release information
25
+
26
+ 4. **Maintenance Burden**: Developers must remember to update CHANGELOG.md manually in addition to following conventional commit standards, increasing cognitive load
27
+
28
+ 5. **Incomplete Historical Record**: Manual changelogs are prone to omissions, while automated generation from commits provides complete traceability
29
+
30
+ The current CHANGELOG.md was valuable during manual release management, but semantic-release provides a superior automated alternative that eliminates these problems.
31
+
32
+ ## Decision Drivers
33
+
34
+ - Elimination of duplicate changelog maintenance effort
35
+ - Single source of truth for release information
36
+ - Consistency between commits, releases, and changelog
37
+ - Leveraging semantic-release capabilities fully
38
+ - Reducing manual maintenance burden on developers
39
+ - Following modern open source project practices
40
+ - Improving traceability from commits to releases
41
+ - Preventing changelog/release synchronization issues
42
+
43
+ ## Considered Options
44
+
45
+ - Continue maintaining both manual CHANGELOG.md and GitHub Releases
46
+ - Use CHANGELOG.md as redirect to GitHub Releases page
47
+ - Completely remove CHANGELOG.md file
48
+ - Keep manual CHANGELOG.md and disable semantic-release changelog generation
49
+
50
+ ## Decision Outcome
51
+
52
+ Chosen option: "Use CHANGELOG.md as redirect to GitHub Releases page", because it maintains backward compatibility for users who expect a CHANGELOG.md file while directing them to the authoritative and automatically maintained release information on GitHub.
53
+
54
+ ### Implementation Strategy
55
+
56
+ 1. **Replace CHANGELOG.md Content**:
57
+ - Replace current content with a simple redirect message
58
+ - Include link to GitHub Releases page
59
+ - Provide brief explanation of why releases are maintained on GitHub
60
+ - Keep file in repository to avoid breaking tooling that expects it
61
+
62
+ 2. **Configure semantic-release**:
63
+ - Ensure semantic-release is configured to create GitHub Releases with complete release notes
64
+ - Verify automated release notes include all commit types appropriately
65
+ - Maintain git tags as authoritative version markers
66
+
67
+ 3. **Update Documentation**:
68
+ - Update contributing guidelines to reference GitHub Releases
69
+ - Document that changelog is maintained automatically via semantic-release
70
+ - Remove any references to manual CHANGELOG.md maintenance
71
+
72
+ 4. **Archive Historical Content**:
73
+ - Historical CHANGELOG.md content remains in git history
74
+ - Previous releases maintain their existing changelog entries
75
+ - New releases will be documented exclusively on GitHub
76
+
77
+ ### Consequences
78
+
79
+ - Good, because eliminates duplicate changelog maintenance effort
80
+ - Good, because provides single source of truth (GitHub Releases)
81
+ - Good, because leverages semantic-release automation fully
82
+ - Good, because ensures changelog is always synchronized with releases
83
+ - Good, because provides richer release information (links, commits, contributors)
84
+ - Good, because maintains backward compatibility with CHANGELOG.md file presence
85
+ - Good, because follows modern open source project conventions
86
+ - Good, because reduces manual maintenance burden on developers
87
+ - Good, because improves traceability from commits through releases
88
+ - Neutral, because requires users to access GitHub for detailed release information
89
+ - Neutral, because CHANGELOG.md becomes a pointer rather than content
90
+ - Bad, because users without GitHub access cannot see detailed changelogs
91
+ - Bad, because breaks offline changelog access (mitigated by git tags and package.json version)
92
+
93
+ ### Confirmation
94
+
95
+ Implementation compliance will be confirmed through:
96
+
97
+ - CHANGELOG.md file contains redirect message with GitHub Releases URL
98
+ - semantic-release creates GitHub Releases with comprehensive release notes
99
+ - No manual CHANGELOG.md maintenance occurs in subsequent releases
100
+ - Documentation updated to reference GitHub Releases as changelog source
101
+ - New contributors directed to GitHub Releases rather than CHANGELOG.md
102
+ - Release process validates that GitHub Releases are created automatically
103
+ - Historical changelog content remains accessible in git history
104
+
105
+ ## Pros and Cons of the Options
106
+
107
+ ### Use CHANGELOG.md as redirect to GitHub Releases page
108
+
109
+ Replace CHANGELOG.md with a redirect message pointing to GitHub Releases.
110
+
111
+ - Good, because maintains file presence for backward compatibility
112
+ - Good, because clearly directs users to authoritative source
113
+ - Good, because eliminates duplicate maintenance
114
+ - Good, because simple and clear implementation
115
+ - Good, because preserves historical changelog in git history
116
+ - Neutral, because requires GitHub access for detailed changelog
117
+ - Bad, because CHANGELOG.md no longer contains actual changelog content
118
+
119
+ ### Continue maintaining both manual CHANGELOG.md and GitHub Releases
120
+
121
+ Keep manual CHANGELOG.md updated alongside automated GitHub Releases.
122
+
123
+ - Good, because provides maximum accessibility
124
+ - Good, because maintains traditional expectations
125
+ - Neutral, because offers redundancy
126
+ - Bad, because duplicates maintenance effort significantly
127
+ - Bad, because creates synchronization risk
128
+ - Bad, because negates benefits of semantic-release automation
129
+ - Bad, because requires manual discipline for every release
130
+ - Bad, because potential for inconsistency between sources
131
+
132
+ ### Completely remove CHANGELOG.md file
133
+
134
+ Delete CHANGELOG.md entirely and rely solely on GitHub Releases.
135
+
136
+ - Good, because completely eliminates duplicate maintenance
137
+ - Good, because clearly establishes GitHub Releases as source of truth
138
+ - Good, because most direct implementation of semantic-release pattern
139
+ - Neutral, because follows some modern project conventions
140
+ - Bad, because breaks tooling that expects CHANGELOG.md presence
141
+ - Bad, because unexpected for users accustomed to changelog files
142
+ - Bad, because removes clear signposting to release information
143
+ - Bad, because loses historical changelog from repository view
144
+
145
+ ### Keep manual CHANGELOG.md and disable semantic-release changelog generation
146
+
147
+ Maintain manual CHANGELOG.md as primary changelog and disable automated generation.
148
+
149
+ - Good, because provides full control over changelog content
150
+ - Good, because maintains traditional changelog maintenance
151
+ - Neutral, because keeps changelog in repository
152
+ - Bad, because foregoes semantic-release automation benefits
153
+ - Bad, because requires manual discipline for every release
154
+ - Bad, because prone to omissions and inconsistencies
155
+ - Bad, because creates additional maintenance burden
156
+ - Bad, because doesn't leverage conventional commits for changelog
157
+ - Bad, because prevents automated release notes generation
158
+
159
+ ## More Information
160
+
161
+ This decision builds upon ADR 006 "Semantic Release for Automated Publishing" by completing the transition to fully automated release management. The manual CHANGELOG.md served the project well during the initial development phase, but semantic-release provides superior automation and consistency.
162
+
163
+ The CHANGELOG.md redirect will contain:
164
+
165
+ ```markdown
166
+ # Changelog
167
+
168
+ This project uses automated release management via semantic-release.
169
+
170
+ For detailed release notes and changelog information, please see:
171
+ **[GitHub Releases](https://github.com/voder-ai/eslint-plugin-traceability/releases)**
172
+
173
+ Each release includes:
174
+
175
+ - Detailed change descriptions
176
+ - Commit references
177
+ - Breaking changes (if any)
178
+ - Migration notes (when applicable)
179
+
180
+ Historical changelog entries prior to automated release management are preserved in this file's git history.
181
+ ```
182
+
183
+ GitHub Releases will automatically include:
184
+
185
+ - Semantic version number from conventional commits
186
+ - Release date and tag reference
187
+ - Categorized changes (Features, Bug Fixes, Breaking Changes)
188
+ - Individual commit references with links
189
+ - Contributor information
190
+ - Generated from conventional commit messages
191
+
192
+ semantic-release configuration ensures:
193
+
194
+ - `@semantic-release/release-notes-generator` creates formatted release notes
195
+ - `@semantic-release/github` publishes releases to GitHub
196
+ - All commits since last release are analyzed and categorized
197
+ - Release notes follow consistent format across all releases
198
+
199
+ This decision should be re-evaluated if:
200
+
201
+ - Significant user base requires offline changelog access
202
+ - Project moves away from GitHub hosting
203
+ - semantic-release becomes unmaintained or problematic
204
+ - Tooling dependencies emerge that require traditional CHANGELOG.md
205
+ - Community feedback strongly favors manual changelog maintenance
206
+
207
+ Related decisions:
208
+
209
+ - ADR 006: Semantic Release for Automated Publishing (establishes automated release management)
210
+ - ADR 004: Automated Version Bumping for CI/CD (superseded by ADR 006)
211
+
212
+ Related resources:
213
+
214
+ - [semantic-release GitHub Plugin](https://github.com/semantic-release/github)
215
+ - [GitHub Releases Documentation](https://docs.github.com/en/repositories/releasing-projects-on-github)
216
+ - [Keep a Changelog](https://keepachangelog.com/) - traditional approach being deprecated
@@ -0,0 +1,60 @@
1
+ # ADR-008: Standardize npm audit flags in CI and local verification
2
+
3
+ ## Status
4
+
5
+ Accepted
6
+
7
+ ## Context
8
+
9
+ Newer versions of `npm` emit a configuration warning when the `--production` flag is used with `npm audit`:
10
+
11
+ > npm WARN config production Use `--omit=dev` instead.
12
+
13
+ Our CI/CD pipeline and local `ci-verify:full` script were invoking:
14
+
15
+ - `npm audit --production --audit-level=high` in the GitHub Actions workflow
16
+ - `npm audit --production --audit-level=high` inside the `ci-verify:full` npm script
17
+
18
+ This produced noisy warnings during both local verification and CI runs, even though the intent was simply to exclude development dependencies from the production-focused audit.
19
+
20
+ ## Decision
21
+
22
+ We will standardize on the modern, npm-recommended flag set for production-focused audits:
23
+
24
+ - Use `npm audit --omit=dev --audit-level=high` instead of `npm audit --production --audit-level=high`.
25
+
26
+ Concretely:
27
+
28
+ 1. **GitHub Actions CI/CD workflow**
29
+ - In `.github/workflows/ci-cd.yml`, the "Run production security audit" step now runs:
30
+ - `npm audit --omit=dev --audit-level=high`
31
+
32
+ 2. **Local CI verification script**
33
+ - In `package.json`, the `ci-verify:full` script now runs:
34
+ - `npm audit --omit=dev --audit-level=high`
35
+
36
+ 3. **CI audit helper script**
37
+ - `scripts/ci-audit.js` continues to run `npm audit --json` to capture a complete machine-readable audit report for CI artifacts. The JSDoc description was updated to avoid hard-coding specific flag combinations in documentation, keeping behavior and documentation loosely coupled.
38
+
39
+ ## Rationale
40
+
41
+ - **Align with npm guidance**: Using `--omit=dev` is the officially recommended modern way to exclude development dependencies from production operations. This avoids the recurring `npm WARN config production` warning.
42
+ - **Consistency between local and CI behavior**: Both the GitHub Actions workflow and the local `ci-verify:full` script now use the same `npm audit` flags for production-focused audits, ensuring developers see the same behavior locally that CI enforces.
43
+ - **Separation of concerns**:
44
+ - Production-focused audits use `--omit=dev --audit-level=high` to focus on runtime dependencies and fail the pipeline if high-severity issues are detected.
45
+ - Dev-dependency audits are handled separately via `npm run audit:dev-high` (which is already wired into both `ci-verify:full` and the CI workflow) and through our `dry-aged-deps`-backed safety checks.
46
+ - **Noise reduction**: Removing the `--production` flag eliminates unnecessary warnings from CI logs, making real problems easier to spot.
47
+
48
+ ## Consequences
49
+
50
+ - **Positive**:
51
+ - CI logs are cleaner, with no spurious `npm WARN config production` messages.
52
+ - The project follows current npm best practices for production audits.
53
+ - Local and CI verification remain in sync, preventing "works locally but fails in CI" discrepancies for security audits.
54
+
55
+ - **Neutral/Expected**:
56
+ - The effective set of audited packages for the production-focused audit remains equivalent to what we intended with `--production`: runtime (non-dev) dependencies only.
57
+ - Our separate dev-dependency audit and `dry-aged-deps` processes remain unchanged.
58
+
59
+ - **Future work**:
60
+ - If npm introduces further changes to `npm audit` flags or behavior, we will revisit this ADR and update the workflow and scripts accordingly.
@@ -0,0 +1,64 @@
1
+ ---
2
+ status: "accepted"
3
+ date: 2025-11-23
4
+ decision-makers: [Development Team]
5
+ consulted:
6
+ [ESLint Documentation, eslint-plugin-security, Node.js Security Guidance]
7
+ informed: [All Contributors]
8
+ ---
9
+
10
+ # 009-Security-Focused Lint Rules
11
+
12
+ ## Context and Problem Statement
13
+
14
+ This project already has strong baseline linting focused on maintainability (complexity, max-lines, no-magic-numbers, max-params). However, a few classes of security-relevant issues are not explicitly guarded by lint rules yet, such as dynamic code evaluation, construction of regular expressions from untrusted input, and accidental use of insecure randomness APIs.
15
+
16
+ While this plugin is primarily an ESLint rule set and maintenance CLI (not a network service), adding lightweight security-focused rules will help catch risky patterns early, especially in helper scripts and potential future extensions.
17
+
18
+ ## Decision
19
+
20
+ We will tighten the ESLint configuration by enabling a **minimal set of built-in security-relevant rules** that are low-noise for this codebase and do not require additional dependencies:
21
+
22
+ - `no-eval`: disallow use of `eval()` entirely.
23
+ - `no-implied-eval`: disallow string forms of `setTimeout`, `setInterval`, and `Function` constructors.
24
+ - `no-new-func`: disallow `new Function(...)`.
25
+ - `no-new-wrappers`: disallow boxed primitives (`new String`, `new Number`, `new Boolean`).
26
+
27
+ These rules will be enabled for all TypeScript and JavaScript source files (not tests) with severity `error`.
28
+
29
+ ## Rationale
30
+
31
+ - These rules are part of core ESLint and require **no new plugins**.
32
+ - They directly guard against dynamic code evaluation and other patterns that frequently lead to security vulnerabilities when combined with untrusted input.
33
+ - The current codebase already avoids these patterns, so enabling the rules should have **zero or near-zero violations**, keeping the ratcheting impact small.
34
+ - By starting with a small, well-justified subset, we avoid overwhelming contributors while still improving the security posture.
35
+
36
+ ## Consequences
37
+
38
+ - **Positive**
39
+ - Immediate feedback in local development and CI if unsafe patterns such as `eval` or `new Function` are introduced.
40
+ - No additional dependency or configuration complexity.
41
+ - Aligns the project with common Node.js security linting baselines.
42
+
43
+ - **Negative / Trade-offs**
44
+ - Very rare legitimate uses of `new Function` or similar patterns would require design reconsideration or narrowly scoped disable comments.
45
+ - Contributors must be aware of these rules and avoid dynamic evaluation patterns.
46
+
47
+ ## Implementation
48
+
49
+ - Update `eslint.config.js` TypeScript and JavaScript rule blocks to include:
50
+ - `"no-eval": "error"`
51
+ - `"no-implied-eval": "error"`
52
+ - `"no-new-func": "error"`
53
+ - `"no-new-wrappers": "error"`
54
+ - Run `npm run lint` and adjust any unexpected violations (none expected in the current codebase).
55
+
56
+ ## Validation
57
+
58
+ - `npm run lint -- --max-warnings=0` passes with the new rules enabled.
59
+ - CI (`npm run ci-verify:full`) passes without additional changes.
60
+ - Future attempts to introduce `eval`, `new Function`, or similar patterns fail linting locally and in CI.
61
+
62
+ ## Future Work
63
+
64
+ If the project grows to include more complex parsing, templating, or data handling, we may consider introducing additional security-focused rules via dedicated plugins (e.g., `eslint-plugin-security`) following the same ratcheting approach: start with a small, low-noise subset, validate impact, and expand incrementally.