eslint-plugin-traceability 1.7.1 → 1.8.1
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.
- package/CHANGELOG.md +82 -0
- package/README.md +76 -37
- package/SECURITY.md +132 -0
- package/lib/src/index.d.ts +6 -35
- package/lib/src/index.js +8 -5
- package/lib/src/maintenance/batch.d.ts +5 -0
- package/lib/src/maintenance/batch.js +5 -0
- package/lib/src/maintenance/cli.js +34 -212
- package/lib/src/maintenance/commands.d.ts +32 -0
- package/lib/src/maintenance/commands.js +139 -0
- package/lib/src/maintenance/detect.d.ts +2 -0
- package/lib/src/maintenance/detect.js +4 -0
- package/lib/src/maintenance/flags.d.ts +99 -0
- package/lib/src/maintenance/flags.js +121 -0
- package/lib/src/maintenance/report.d.ts +2 -0
- package/lib/src/maintenance/report.js +2 -0
- package/lib/src/maintenance/update.d.ts +4 -0
- package/lib/src/maintenance/update.js +4 -0
- package/lib/src/rules/helpers/require-story-io.d.ts +3 -0
- package/lib/src/rules/helpers/require-story-io.js +20 -6
- package/lib/src/rules/helpers/valid-annotation-options.js +15 -4
- package/lib/src/rules/helpers/valid-annotation-utils.js +5 -0
- package/lib/src/rules/helpers/valid-story-reference-helpers.d.ts +3 -4
- package/lib/src/utils/reqAnnotationDetection.d.ts +4 -1
- package/lib/src/utils/reqAnnotationDetection.js +43 -15
- package/lib/tests/config/flat-config-presets-integration.test.d.ts +1 -0
- package/lib/tests/config/flat-config-presets-integration.test.js +75 -0
- package/lib/tests/maintenance/cli.test.js +89 -0
- package/lib/tests/plugin-default-export-and-configs.test.js +0 -2
- package/lib/tests/rules/prefer-implements-annotation.test.js +28 -0
- package/lib/tests/rules/require-req-annotation.test.js +8 -1
- package/lib/tests/rules/require-story-annotation.test.js +9 -4
- package/lib/tests/utils/ts-language-options.d.ts +1 -7
- package/lib/tests/utils/ts-language-options.js +8 -5
- package/package.json +11 -7
- package/user-docs/api-reference.md +527 -0
- package/user-docs/eslint-9-setup-guide.md +722 -0
- package/user-docs/examples.md +74 -0
- package/user-docs/migration-guide.md +174 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
## [1.8.1](https://github.com/voder-ai/eslint-plugin-traceability/compare/v1.8.0...v1.8.1) (2025-12-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* disable prefer-implements-annotation in default presets ([89c62e9](https://github.com/voder-ai/eslint-plugin-traceability/commit/89c62e907be95030f89e6a3ab6df24a4ba32ab62))
|
|
7
|
+
|
|
8
|
+
# Changelog
|
|
9
|
+
|
|
10
|
+
This project uses automated release management via [semantic-release](https://semantic-release.gitbook.io/).
|
|
11
|
+
|
|
12
|
+
For detailed release notes and changelog information, please see:
|
|
13
|
+
|
|
14
|
+
**[GitHub Releases](https://github.com/voder-ai/eslint-plugin-traceability/releases)**
|
|
15
|
+
|
|
16
|
+
Each release includes:
|
|
17
|
+
- Detailed change descriptions
|
|
18
|
+
- Commit references
|
|
19
|
+
- Breaking changes (if any)
|
|
20
|
+
- Migration notes (when applicable)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Historical Changelog (Prior to Automated Releases)
|
|
25
|
+
|
|
26
|
+
The following entries were maintained manually before the adoption of semantic-release. Current and future releases are documented exclusively on the GitHub Releases page.
|
|
27
|
+
|
|
28
|
+
### [1.0.5] - 2025-11-17
|
|
29
|
+
|
|
30
|
+
**Changed**
|
|
31
|
+
- Lowered maintainability thresholds to 70 lines/function and 300 lines/file in ESLint config.
|
|
32
|
+
- Added override for 'tar' package to mitigate moderate vulnerabilities.
|
|
33
|
+
|
|
34
|
+
### [1.0.4] - 2025-11-17
|
|
35
|
+
|
|
36
|
+
**Fixed**
|
|
37
|
+
- Ensured temporary directories are cleaned up in maintenance tests for detect and update functions.
|
|
38
|
+
- Refactored valid-req-reference rule to reduce function length and added explicit type annotations.
|
|
39
|
+
|
|
40
|
+
### [1.0.3] - 2025-11-17
|
|
41
|
+
|
|
42
|
+
**Added**
|
|
43
|
+
- CLI integration script (`cli-integration.js`) for end-to-end ESLint CLI tests.
|
|
44
|
+
- Migration guide in [`user-docs/migration-guide.md`](user-docs/migration-guide.md).
|
|
45
|
+
|
|
46
|
+
### [1.0.2] - 2025-11-17
|
|
47
|
+
|
|
48
|
+
**Changed**
|
|
49
|
+
- Updated README and docs to reference `cli-integration.js` script.
|
|
50
|
+
- Removed stale references to migration guide in CHANGELOG gradients.
|
|
51
|
+
|
|
52
|
+
### [1.0.1] - 2025-11-17
|
|
53
|
+
|
|
54
|
+
**Added**
|
|
55
|
+
- Detailed API documentation in [`user-docs/api-reference.md`](user-docs/api-reference.md)
|
|
56
|
+
- New usage examples in [`user-docs/examples.md`](user-docs/examples.md)
|
|
57
|
+
|
|
58
|
+
**Changed**
|
|
59
|
+
- Updated `README.md` with advanced usage instructions and migration guide
|
|
60
|
+
- Consolidated CI workflows into a unified GitHub Actions pipeline
|
|
61
|
+
|
|
62
|
+
### [1.0.0] - 2025-11-16
|
|
63
|
+
|
|
64
|
+
**Changed**
|
|
65
|
+
- Bumped version to 1.0.0 in package.json.
|
|
66
|
+
- Aligned CHANGELOG with package.json version.
|
|
67
|
+
|
|
68
|
+
### [0.1.0] - 2025-11-16
|
|
69
|
+
|
|
70
|
+
**Added**
|
|
71
|
+
- Initial release of `eslint-plugin-traceability`:
|
|
72
|
+
- `require-story-annotation`
|
|
73
|
+
- `require-req-annotation`
|
|
74
|
+
- `require-branch-annotation`
|
|
75
|
+
- `valid-annotation-format`
|
|
76
|
+
- `valid-story-reference`
|
|
77
|
+
- `valid-req-reference`
|
|
78
|
+
- Documentation for all rules under `docs/rules`.
|
|
79
|
+
- Configuration presets in `docs/config-presets.md`.
|
|
80
|
+
- Example usage in `README.md`.
|
|
81
|
+
- Pre-commit and pre-push hooks with formatting, linting, and tests.
|
|
82
|
+
- Comprehensive tests covering core validation rules.
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Prerequisites: Node.js >=18.18.0 and ESLint v9+.
|
|
|
15
15
|
2. Using Yarn
|
|
16
16
|
yarn add --dev eslint-plugin-traceability
|
|
17
17
|
|
|
18
|
-
For detailed setup with ESLint v9, see user-docs/eslint-9-setup-guide.md.
|
|
18
|
+
For detailed setup with ESLint v9, see the [ESLint v9 Setup Guide](user-docs/eslint-9-setup-guide.md).
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
21
21
|
|
|
@@ -26,39 +26,39 @@ Additional ESLint v9 configuration guidance:
|
|
|
26
26
|
- For detailed configuration examples, see [Common Configuration Patterns](user-docs/eslint-9-setup-guide.md#common-configuration-patterns) in the ESLint 9 Setup Guide.
|
|
27
27
|
- For troubleshooting ESLint flat-config errors, see [Troubleshooting ESLint Configuration](user-docs/eslint-9-setup-guide.md#troubleshooting-eslint-configuration).
|
|
28
28
|
|
|
29
|
-
Example eslint.config.js (ESLint v9 flat config):
|
|
29
|
+
Example `eslint.config.js` (ESLint v9 flat config):
|
|
30
|
+
|
|
31
|
+
This example shows the recommended starting point using the plugin's recommended preset alongside ESLint's recommended config:
|
|
30
32
|
|
|
31
33
|
```js
|
|
32
34
|
// eslint.config.js
|
|
33
|
-
|
|
35
|
+
import js from "@eslint/js";
|
|
36
|
+
import traceability from "eslint-plugin-traceability";
|
|
37
|
+
|
|
38
|
+
export default [
|
|
39
|
+
js.configs.recommended,
|
|
34
40
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
node: true,
|
|
38
|
-
},
|
|
39
|
-
plugins: { traceability: {} },
|
|
40
|
-
rules: {
|
|
41
|
-
"traceability/require-story-annotation": "error",
|
|
42
|
-
"traceability/require-req-annotation": "error",
|
|
43
|
-
"traceability/require-branch-annotation": "error",
|
|
41
|
+
plugins: {
|
|
42
|
+
traceability,
|
|
44
43
|
},
|
|
45
44
|
},
|
|
45
|
+
...traceability.configs.recommended,
|
|
46
46
|
];
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
### Available Rules
|
|
50
50
|
|
|
51
|
-
- `traceability/require-story-annotation` Enforces presence of `@story` annotations. (
|
|
52
|
-
- `traceability/require-req-annotation` Enforces presence of `@req` annotations. (
|
|
53
|
-
- `traceability/require-branch-annotation` Enforces presence of branch annotations. (
|
|
54
|
-
- `traceability/valid-annotation-format` Enforces correct format of traceability annotations. (
|
|
55
|
-
- `traceability/valid-story-reference` Validates that `@story` references point to existing story files. (
|
|
56
|
-
- `traceability/valid-req-reference` Validates that `@req` references point to existing requirement IDs. (
|
|
57
|
-
- `traceability/prefer-implements-annotation` Recommends migration from legacy `@story`/`@req` annotations to `@implements` (disabled by default). (
|
|
51
|
+
- `traceability/require-story-annotation` Enforces presence of `@story` annotations. (See the rule documentation in the plugin's user guide.)
|
|
52
|
+
- `traceability/require-req-annotation` Enforces presence of `@req` annotations. (See the rule documentation in the plugin's user guide.)
|
|
53
|
+
- `traceability/require-branch-annotation` Enforces presence of branch annotations. (See the rule documentation in the plugin's user guide.)
|
|
54
|
+
- `traceability/valid-annotation-format` Enforces correct format of traceability annotations. (See the rule documentation in the plugin's user guide.)
|
|
55
|
+
- `traceability/valid-story-reference` Validates that `@story` references point to existing story files. (See the rule documentation in the plugin's user guide.)
|
|
56
|
+
- `traceability/valid-req-reference` Validates that `@req` references point to existing requirement IDs. (See the rule documentation in the plugin's user guide.)
|
|
57
|
+
- `traceability/prefer-implements-annotation` Recommends migration from legacy `@story`/`@req` annotations to `@implements` (opt-in; disabled by default in the presets and must be explicitly enabled). (See the rule documentation in the plugin's user guide.)
|
|
58
58
|
|
|
59
|
-
Configuration options: For detailed per-rule options (such as scopes, branch types, and story directory settings), see the individual rule docs in
|
|
59
|
+
Configuration options: For detailed per-rule options (such as scopes, branch types, and story directory settings), see the individual rule docs in the plugin's user guide and the consolidated [API Reference](user-docs/api-reference.md).
|
|
60
60
|
|
|
61
|
-
For development and contribution guidelines, see
|
|
61
|
+
For development and contribution guidelines, see the contribution guide in the repository.
|
|
62
62
|
|
|
63
63
|
## Quick Start
|
|
64
64
|
|
|
@@ -69,8 +69,12 @@ For development and contribution guidelines, see docs/eslint-plugin-development-
|
|
|
69
69
|
import traceability from "eslint-plugin-traceability";
|
|
70
70
|
|
|
71
71
|
export default [
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
{
|
|
73
|
+
plugins: {
|
|
74
|
+
traceability,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
...traceability.configs.recommended,
|
|
74
78
|
];
|
|
75
79
|
```
|
|
76
80
|
|
|
@@ -78,7 +82,8 @@ export default [
|
|
|
78
82
|
|
|
79
83
|
```js
|
|
80
84
|
/**
|
|
81
|
-
* @story
|
|
85
|
+
* @story stories/003.0-DEV-FUNCTION-ANNOTATIONS.story.md
|
|
86
|
+
* // Point this to your own project's story/requirements file, not to this plugin's internal docs.
|
|
82
87
|
* @req REQ-ANNOTATION-REQUIRED
|
|
83
88
|
*/
|
|
84
89
|
function initAuth() {
|
|
@@ -188,18 +193,52 @@ npm test
|
|
|
188
193
|
|
|
189
194
|
These tests verify end-to-end behavior of the plugin via the ESLint CLI.
|
|
190
195
|
|
|
196
|
+
## Security and Dependency Health
|
|
197
|
+
|
|
198
|
+
For the canonical, user-facing security policy (including how to report vulnerabilities), see [SECURITY.md](SECURITY.md). The additional files under `docs/` referenced below provide deeper background and implementation details for interested readers.
|
|
199
|
+
|
|
200
|
+
### What end users can expect from production dependencies
|
|
201
|
+
|
|
202
|
+
- The published `eslint-plugin-traceability` package is intended to ship **only with production dependencies that have no known high‑severity vulnerabilities** at release time.
|
|
203
|
+
- As part of CI and the local pre‑push hook, we run:
|
|
204
|
+
- `npm audit --omit=dev --audit-level=high` – this checks only the **runtime (prod) dependency graph** and fails if any high‑severity issues are reported.
|
|
205
|
+
- This means:
|
|
206
|
+
- Known high‑severity issues in production dependencies are blocked before a version is released.
|
|
207
|
+
- Dev‑only tooling and CI infrastructure are kept separate from what you install via `npm install eslint-plugin-traceability`.
|
|
208
|
+
|
|
209
|
+
### How `dry-aged-deps` and `npm audit` work together
|
|
210
|
+
|
|
211
|
+
- **Maturity checks via `dry-aged-deps`**
|
|
212
|
+
- We use `dry-aged-deps` (via `npm run deps:maturity` and `npm run safety:deps`) to enforce basic “maturity” constraints on dependency updates.
|
|
213
|
+
- Current policy for adopting new versions:
|
|
214
|
+
- **Minimum age:** new versions are typically required to be **at least 7 days old**, reducing the chance of adopting a just‑released, unvetted version.
|
|
215
|
+
- **No known vulnerabilities:** versions with known vulnerabilities are rejected.
|
|
216
|
+
- **Security scan via `npm audit`**
|
|
217
|
+
- `npm audit --omit=dev --audit-level=high` is run on the **production dependency tree** to catch known high‑severity issues before release.
|
|
218
|
+
- **Combined effect**
|
|
219
|
+
- `dry-aged-deps` controls **which versions** we are willing to upgrade to (age + no‑known‑vulns).
|
|
220
|
+
- `npm audit` validates that the **current, locked set of production dependencies** is free from known high‑severity vulnerabilities.
|
|
221
|
+
- Together, they provide a conservative, security‑focused process for dependency updates that directly affect end users.
|
|
222
|
+
|
|
223
|
+
### Scope of the semantic‑release/npm tooling risk
|
|
224
|
+
|
|
225
|
+
- There is a known, documented risk in the semantic‑release/npm release toolchain related to bundled `npm`/`glob`/`brace-expansion`.
|
|
226
|
+
- This risk:
|
|
227
|
+
- Applies only to the **GitHub Actions release workflow and related dev‑only tooling**.
|
|
228
|
+
- Does **not** modify or run inside consumers’ projects.
|
|
229
|
+
- Does **not** affect the built plugin artifacts published to npm.
|
|
230
|
+
- In other words:
|
|
231
|
+
- The issue is confined to the CI environment that prepares and publishes releases.
|
|
232
|
+
- It **cannot impact** the runtime behavior or dependency graph of the `eslint-plugin-traceability` package you install or use in your own projects.
|
|
233
|
+
|
|
191
234
|
## Documentation Links
|
|
192
235
|
|
|
193
|
-
- ESLint v9 Setup Guide: user-docs/eslint-9-setup-guide.md
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
-
|
|
197
|
-
-
|
|
198
|
-
-
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
- Contribution guide: https://github.com/voder-ai/eslint-plugin-traceability/blob/main/CONTRIBUTING.md
|
|
203
|
-
- Issue tracker: https://github.com/voder-ai/eslint-plugin-traceability/issues
|
|
204
|
-
- Configuration Presets: docs/config-presets.md
|
|
205
|
-
- Changelog: CHANGELOG.md
|
|
236
|
+
- ESLint v9 Setup Guide: [user-docs/eslint-9-setup-guide.md](user-docs/eslint-9-setup-guide.md)
|
|
237
|
+
- API Reference: [user-docs/api-reference.md](user-docs/api-reference.md)
|
|
238
|
+
- Examples: [user-docs/examples.md](user-docs/examples.md)
|
|
239
|
+
- Migration Guide: [user-docs/migration-guide.md](user-docs/migration-guide.md)
|
|
240
|
+
- Full README: <https://github.com/voder-ai/eslint-plugin-traceability#readme>
|
|
241
|
+
- Contribution guide: <https://github.com/voder-ai/eslint-plugin-traceability/blob/main/CONTRIBUTING.md>
|
|
242
|
+
- Issue tracker: <https://github.com/voder-ai/eslint-plugin-traceability/issues>
|
|
243
|
+
- Changelog: [CHANGELOG.md](CHANGELOG.md)
|
|
244
|
+
- Versioning and Releases: This project uses semantic-release for automated versioning. The authoritative list of published versions and release notes is on GitHub Releases: <https://github.com/voder-ai/eslint-plugin-traceability/releases>
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
This document describes how security is handled for `eslint-plugin-traceability`, including how to report vulnerabilities, what guarantees apply to production dependencies, and how we manage known risks in our dev-only release tooling.
|
|
4
|
+
|
|
5
|
+
> This file is **user-facing** documentation. Internal implementation details and deeper discussion live in the project’s internal documentation and decision records.
|
|
6
|
+
|
|
7
|
+
## Reporting a Vulnerability
|
|
8
|
+
|
|
9
|
+
If you believe you have found a security vulnerability in this project:
|
|
10
|
+
|
|
11
|
+
1. **Do not open a public GitHub issue.**
|
|
12
|
+
2. Instead, open a private security advisory via the GitHub Security tab for this repository:
|
|
13
|
+
- Navigate to: `Security` → `Advisories` → `Report a vulnerability`.
|
|
14
|
+
3. Provide as much detail as you can (steps to reproduce, impact, affected environments). A maintainer will review and coordinate a fix and disclosure timeline with you.
|
|
15
|
+
|
|
16
|
+
If you cannot use GitHub Security Advisories, you may alternatively open a **minimal** issue that does not disclose details and ask for a private contact channel.
|
|
17
|
+
|
|
18
|
+
## Supported Versions
|
|
19
|
+
|
|
20
|
+
This project uses [semantic-release](https://github.com/semantic-release/semantic-release) for automated versioning and publishing.
|
|
21
|
+
|
|
22
|
+
- The **latest published version** on npm and GitHub Releases is considered supported.
|
|
23
|
+
- Older versions are not actively maintained; security fixes are applied to the current release line and then published automatically.
|
|
24
|
+
- To benefit from security fixes, users should stay reasonably up-to-date with the latest versions of `eslint-plugin-traceability`.
|
|
25
|
+
|
|
26
|
+
Authoritative release information is available on GitHub Releases:
|
|
27
|
+
|
|
28
|
+
- <https://github.com/voder-ai/eslint-plugin-traceability/releases>
|
|
29
|
+
|
|
30
|
+
## Production Dependency Guarantees
|
|
31
|
+
|
|
32
|
+
The `eslint-plugin-traceability` package has **no runtime dependencies**; it ships only its compiled plugin and CLI code plus documentation. Nevertheless, we treat any future production dependencies with care and enforce the following guarantees at release time:
|
|
33
|
+
|
|
34
|
+
- Before a release is published, CI runs:
|
|
35
|
+
- `npm audit --omit=dev --audit-level=high`
|
|
36
|
+
- A release is allowed to proceed only when:
|
|
37
|
+
- There are **no known high-severity vulnerabilities** reported in the **production (runtime) dependency tree**.
|
|
38
|
+
|
|
39
|
+
In other words:
|
|
40
|
+
|
|
41
|
+
- The published npm package is intended to ship **without known high‑severity vulnerabilities in its production dependencies** at the moment it is released.
|
|
42
|
+
- Dev-only tooling and CI infrastructure are kept separate from what you install via `npm install eslint-plugin-traceability`.
|
|
43
|
+
|
|
44
|
+
For more detail on how these checks are wired into CI, see the internal dependency health and security documentation for this project.
|
|
45
|
+
|
|
46
|
+
## Dependency Maturity and `dry-aged-deps`
|
|
47
|
+
|
|
48
|
+
In addition to `npm audit`, we use [`dry-aged-deps`](https://github.com/voder-ai/dry-aged-deps) to guide dependency upgrades for both production and development dependencies.
|
|
49
|
+
|
|
50
|
+
Current high-level policy:
|
|
51
|
+
|
|
52
|
+
- **Minimum age:** new versions are generally required to be **at least 7 days old** before adoption.
|
|
53
|
+
- **No known vulnerabilities:** versions with _any_ known vulnerability (even low severity) are not considered "safe" upgrade candidates.
|
|
54
|
+
|
|
55
|
+
`dry-aged-deps` is advisory only:
|
|
56
|
+
|
|
57
|
+
- It does **not** modify `package.json` or install anything automatically.
|
|
58
|
+
- It produces machine-readable reports that are stored as CI artifacts and referenced in internal security/incident documentation.
|
|
59
|
+
|
|
60
|
+
When `dry-aged-deps` reports that there are **no safe upgrades available** under these thresholds, we may temporarily accept residual risk in dev-only tooling while keeping production dependencies clean and fully audited.
|
|
61
|
+
|
|
62
|
+
For maintainers, the full process is described in the project’s internal dependency health and security guidelines.
|
|
63
|
+
|
|
64
|
+
## Dev-Only Release Tooling Risk (semantic-release / npm / glob / brace-expansion)
|
|
65
|
+
|
|
66
|
+
There is a known, documented risk in the **dev-only release toolchain** used by this project. It does **not** affect the runtime behavior of the published ESLint plugin or CLI, but it is relevant to how releases are built in CI.
|
|
67
|
+
|
|
68
|
+
### What is affected?
|
|
69
|
+
|
|
70
|
+
- The dev dependency `@semantic-release/npm@10.0.6` bundles `npm@9.5.0`, which in turn includes vulnerable versions of `glob` and `brace-expansion`.
|
|
71
|
+
- The relevant advisories are:
|
|
72
|
+
- `glob` CLI command injection: [GHSA-5j98-mcp5-4vw2](https://github.com/advisories/GHSA-5j98-mcp5-4vw2)
|
|
73
|
+
- `brace-expansion` ReDoS: [GHSA-v6h2-p8h4-qcjw](https://github.com/advisories/GHSA-v6h2-p8h4-qcjw)
|
|
74
|
+
- These vulnerable packages exist **only inside the npm binary bundled within `@semantic-release/npm`** and are used solely during automated publishing from CI.
|
|
75
|
+
|
|
76
|
+
### What is _not_ affected?
|
|
77
|
+
|
|
78
|
+
- The published `eslint-plugin-traceability` package has **no runtime dependencies** on this bundled npm or its `glob`/`brace-expansion` copies.
|
|
79
|
+
- End-user projects that install and run `eslint-plugin-traceability` or `traceability-maint` **do not execute** this bundled tooling.
|
|
80
|
+
- `npm audit --omit=dev --audit-level=high` continues to report **0 high‑severity vulnerabilities** for the production dependency tree at release time.
|
|
81
|
+
|
|
82
|
+
### Why is this risk currently accepted?
|
|
83
|
+
|
|
84
|
+
Under our `dry-aged-deps` policy (7‑day minimum age, no known vulnerabilities):
|
|
85
|
+
|
|
86
|
+
- There is currently **no recommended, dry‑aged‑safe upgrade path** for the semantic-release/npm toolchain that would fully eliminate these bundled vulnerabilities.
|
|
87
|
+
- We therefore treat this as a **known error in dev-only tooling** rather than a production risk.
|
|
88
|
+
|
|
89
|
+
This acceptance is documented in detail in the project’s internal security incident records and architectural decision records.
|
|
90
|
+
|
|
91
|
+
### Compensating Controls
|
|
92
|
+
|
|
93
|
+
To keep this dev-only risk tightly contained, we apply several compensating controls:
|
|
94
|
+
|
|
95
|
+
1. **Environment Isolation**
|
|
96
|
+
- The vulnerable tooling is used **only** in the GitHub Actions CI workflow (`.github/workflows/ci-cd.yml`).
|
|
97
|
+
- It runs in a single, controlled job that executes on pushes to the `main` branch, not for pull requests.
|
|
98
|
+
- The job runs on GitHub-hosted runners and does not have access to internal infrastructure.
|
|
99
|
+
|
|
100
|
+
2. **Least-Privilege Permissions for Release**
|
|
101
|
+
- Workflow-level permissions default to `contents: read`.
|
|
102
|
+
- Elevated permissions (`contents: write`, `issues: write`, `pull-requests: write`, `id-token: write`) are scoped to the release job/step that runs semantic-release and are not used for general CI tasks.
|
|
103
|
+
|
|
104
|
+
3. **Strict Input Handling**
|
|
105
|
+
- The CI configuration and project scripts **never invoke the `glob` CLI** with the dangerous `-c/--cmd` flags.
|
|
106
|
+
- The semantic-release/npm toolchain does **not** receive untrusted user input for glob patterns or environment variables.
|
|
107
|
+
- Release jobs operate only on the repository contents of this project plus standard CI-provided environment variables.
|
|
108
|
+
|
|
109
|
+
4. **Audit and Monitoring**
|
|
110
|
+
- Dev-only vulnerabilities are tracked via `npm run audit:dev-high`, which writes a machine-readable report to `ci/npm-audit.json` for each CI run.
|
|
111
|
+
- `dry-aged-deps` reports (`ci/dry-aged-deps.json`) are stored as CI artifacts to document when no safe upgrade path exists under the configured thresholds.
|
|
112
|
+
- A nightly `dependency-health` workflow re-runs dev-dependency audits to keep this risk under continuous review.
|
|
113
|
+
|
|
114
|
+
5. **Guarded semantic-release Invocation (CI-Only)**
|
|
115
|
+
- semantic-release is invoked **only from CI**, and guarded to ensure it runs under the intended safe context (GitHub Actions, push to `main`, CI environment).
|
|
116
|
+
- Local developers are not expected to run semantic-release directly; publishing is handled automatically by CI after all quality and security checks pass.
|
|
117
|
+
|
|
118
|
+
### Upgrade Plan
|
|
119
|
+
|
|
120
|
+
We intend to migrate away from the affected semantic-release/npm toolchain as soon as a safe, dry‑aged‑deps–approved upgrade path is available:
|
|
121
|
+
|
|
122
|
+
1. Continue monitoring `dry-aged-deps` output for `@semantic-release/npm`, `semantic-release`, and related packages.
|
|
123
|
+
2. When a newer, vulnerability-free version remains stable for at least 7 days and passes our audit checks, update the dev dependencies accordingly.
|
|
124
|
+
3. After migration, convert the existing known-error record into a resolved incident that documents the fix and new baseline.
|
|
125
|
+
|
|
126
|
+
Until then, the risk remains **limited to CI release automation** and does not change the guarantees we provide for production dependencies or end-user environments.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Attribution
|
|
131
|
+
|
|
132
|
+
Created autonomously by [voder.ai](https://voder.ai).
|
package/lib/src/index.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ import { detectStaleAnnotations, updateAnnotationReferences, batchUpdateAnnotati
|
|
|
17
17
|
declare const RULE_NAMES: readonly ["require-story-annotation", "require-req-annotation", "require-branch-annotation", "valid-annotation-format", "valid-story-reference", "valid-req-reference", "prefer-implements-annotation"];
|
|
18
18
|
type RuleName = (typeof RULE_NAMES)[number];
|
|
19
19
|
declare const rules: Record<RuleName, Rule.RuleModule>;
|
|
20
|
+
declare const plugin: {
|
|
21
|
+
rules: typeof rules;
|
|
22
|
+
configs?: unknown;
|
|
23
|
+
maintenance?: unknown;
|
|
24
|
+
};
|
|
20
25
|
/**
|
|
21
26
|
* @story docs/stories/007.0-DEV-ERROR-REPORTING.story.md
|
|
22
27
|
* @req REQ-ERROR-SEVERITY - Map rule types to appropriate ESLint severity levels (errors vs warnings)
|
|
@@ -25,17 +30,11 @@ declare const rules: Record<RuleName, Rule.RuleModule>;
|
|
|
25
30
|
*/
|
|
26
31
|
declare const configs: {
|
|
27
32
|
recommended: {
|
|
28
|
-
plugins: {
|
|
29
|
-
traceability: {};
|
|
30
|
-
};
|
|
31
33
|
rules: {
|
|
32
34
|
[x: string]: "error" | "warn";
|
|
33
35
|
};
|
|
34
36
|
}[];
|
|
35
37
|
strict: {
|
|
36
|
-
plugins: {
|
|
37
|
-
traceability: {};
|
|
38
|
-
};
|
|
39
38
|
rules: {
|
|
40
39
|
[x: string]: "error" | "warn";
|
|
41
40
|
};
|
|
@@ -53,32 +52,4 @@ declare const maintenance: {
|
|
|
53
52
|
generateMaintenanceReport: typeof generateMaintenanceReport;
|
|
54
53
|
};
|
|
55
54
|
export { rules, configs, maintenance };
|
|
56
|
-
|
|
57
|
-
rules: Record<"require-story-annotation" | "require-req-annotation" | "require-branch-annotation" | "valid-annotation-format" | "valid-story-reference" | "valid-req-reference" | "prefer-implements-annotation", Rule.RuleModule>;
|
|
58
|
-
configs: {
|
|
59
|
-
recommended: {
|
|
60
|
-
plugins: {
|
|
61
|
-
traceability: {};
|
|
62
|
-
};
|
|
63
|
-
rules: {
|
|
64
|
-
[x: string]: "error" | "warn";
|
|
65
|
-
};
|
|
66
|
-
}[];
|
|
67
|
-
strict: {
|
|
68
|
-
plugins: {
|
|
69
|
-
traceability: {};
|
|
70
|
-
};
|
|
71
|
-
rules: {
|
|
72
|
-
[x: string]: "error" | "warn";
|
|
73
|
-
};
|
|
74
|
-
}[];
|
|
75
|
-
};
|
|
76
|
-
maintenance: {
|
|
77
|
-
detectStaleAnnotations: typeof detectStaleAnnotations;
|
|
78
|
-
updateAnnotationReferences: typeof updateAnnotationReferences;
|
|
79
|
-
batchUpdateAnnotations: typeof batchUpdateAnnotations;
|
|
80
|
-
verifyAnnotations: typeof verifyAnnotations;
|
|
81
|
-
generateMaintenanceReport: typeof generateMaintenanceReport;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
export default _default;
|
|
55
|
+
export default plugin;
|
package/lib/src/index.js
CHANGED
|
@@ -73,6 +73,9 @@ RULE_NAMES.forEach(
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
|
+
const plugin = {
|
|
77
|
+
rules,
|
|
78
|
+
};
|
|
76
79
|
/**
|
|
77
80
|
* @story docs/stories/007.0-DEV-ERROR-REPORTING.story.md
|
|
78
81
|
* @req REQ-ERROR-SEVERITY - Map rule types to appropriate ESLint severity levels (errors vs warnings)
|
|
@@ -86,18 +89,16 @@ const TRACEABILITY_RULE_SEVERITIES = {
|
|
|
86
89
|
"traceability/valid-annotation-format": "warn",
|
|
87
90
|
"traceability/valid-story-reference": "error",
|
|
88
91
|
"traceability/valid-req-reference": "error",
|
|
89
|
-
"traceability/prefer-implements-annotation": "warn",
|
|
90
92
|
};
|
|
91
93
|
/**
|
|
92
94
|
* @story docs/stories/007.0-DEV-ERROR-REPORTING.story.md
|
|
93
95
|
* @req REQ-PLUGIN-STRUCTURE - Provide foundational plugin export and registration
|
|
94
96
|
* @req REQ-ERROR-SEVERITY - Map rule types to appropriate ESLint severity levels (errors vs warnings)
|
|
97
|
+
* @story docs/stories/002.0-DEV-ESLINT-CONFIG.story.md
|
|
98
|
+
* @req REQ-CONFIG-PRESETS - Provide flat-config presets that self-register the plugin and core rules
|
|
95
99
|
*/
|
|
96
100
|
function createTraceabilityFlatConfig() {
|
|
97
101
|
return {
|
|
98
|
-
plugins: {
|
|
99
|
-
traceability: {},
|
|
100
|
-
},
|
|
101
102
|
rules: {
|
|
102
103
|
...TRACEABILITY_RULE_SEVERITIES,
|
|
103
104
|
},
|
|
@@ -114,6 +115,7 @@ const configs = {
|
|
|
114
115
|
strict: [createTraceabilityFlatConfig()],
|
|
115
116
|
};
|
|
116
117
|
exports.configs = configs;
|
|
118
|
+
plugin.configs = configs;
|
|
117
119
|
/**
|
|
118
120
|
* @story docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md
|
|
119
121
|
* @req REQ-MAINTENANCE-API-EXPORT - Expose maintenance utilities alongside core plugin exports
|
|
@@ -126,4 +128,5 @@ const maintenance = {
|
|
|
126
128
|
generateMaintenanceReport: maintenance_1.generateMaintenanceReport,
|
|
127
129
|
};
|
|
128
130
|
exports.maintenance = maintenance;
|
|
129
|
-
|
|
131
|
+
plugin.maintenance = maintenance;
|
|
132
|
+
exports.default = plugin;
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
* @story docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md
|
|
4
4
|
* @req REQ-MAINT-BATCH - Perform batch updates
|
|
5
5
|
* @req REQ-MAINT-VERIFY - Verify annotation references
|
|
6
|
+
* @param codebasePath Absolute path to the workspace root where annotations will be updated.
|
|
7
|
+
* @param mappings Array of mapping objects describing path changes, each containing an oldPath and newPath.
|
|
8
|
+
* @returns Total number of updated @story annotations across all mappings.
|
|
6
9
|
*/
|
|
7
10
|
export declare function batchUpdateAnnotations(codebasePath: string, mappings: {
|
|
8
11
|
oldPath: string;
|
|
@@ -12,5 +15,7 @@ export declare function batchUpdateAnnotations(codebasePath: string, mappings: {
|
|
|
12
15
|
* Verify annotation references in codebase after maintenance operations
|
|
13
16
|
* @story docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md
|
|
14
17
|
* @req REQ-MAINT-VERIFY - Verify annotation references
|
|
18
|
+
* @param codebasePath Absolute path to the workspace root whose annotations should be verified.
|
|
19
|
+
* @returns Boolean indicating whether there are no stale annotations remaining (true if clean, false if any remain).
|
|
15
20
|
*/
|
|
16
21
|
export declare function verifyAnnotations(codebasePath: string): boolean;
|
|
@@ -9,6 +9,9 @@ const detect_1 = require("./detect");
|
|
|
9
9
|
* @story docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md
|
|
10
10
|
* @req REQ-MAINT-BATCH - Perform batch updates
|
|
11
11
|
* @req REQ-MAINT-VERIFY - Verify annotation references
|
|
12
|
+
* @param codebasePath Absolute path to the workspace root where annotations will be updated.
|
|
13
|
+
* @param mappings Array of mapping objects describing path changes, each containing an oldPath and newPath.
|
|
14
|
+
* @returns Total number of updated @story annotations across all mappings.
|
|
12
15
|
*/
|
|
13
16
|
function batchUpdateAnnotations(codebasePath, mappings) {
|
|
14
17
|
let totalUpdated = 0;
|
|
@@ -22,6 +25,8 @@ function batchUpdateAnnotations(codebasePath, mappings) {
|
|
|
22
25
|
* Verify annotation references in codebase after maintenance operations
|
|
23
26
|
* @story docs/stories/009.0-DEV-MAINTENANCE-TOOLS.story.md
|
|
24
27
|
* @req REQ-MAINT-VERIFY - Verify annotation references
|
|
28
|
+
* @param codebasePath Absolute path to the workspace root whose annotations should be verified.
|
|
29
|
+
* @returns Boolean indicating whether there are no stale annotations remaining (true if clean, false if any remain).
|
|
25
30
|
*/
|
|
26
31
|
function verifyAnnotations(codebasePath) {
|
|
27
32
|
const staleAnnotations = (0, detect_1.detectStaleAnnotations)(codebasePath);
|