@nerviq/cli 1.29.0 → 1.29.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +1527 -1493
  2. package/README.md +550 -538
  3. package/SECURITY.md +82 -82
  4. package/bin/cli.js +2562 -2558
  5. package/docs/api-reference.md +356 -356
  6. package/docs/audit-fix.md +109 -0
  7. package/docs/autofix.md +3 -62
  8. package/docs/getting-started.md +1 -1
  9. package/docs/index.html +592 -592
  10. package/docs/integration-contracts.md +287 -287
  11. package/docs/maintenance.md +128 -128
  12. package/docs/new-platform-guide.md +202 -202
  13. package/docs/release-process.md +63 -0
  14. package/docs/shallow-risk.md +244 -244
  15. package/docs/why-nerviq.md +82 -82
  16. package/package.json +67 -67
  17. package/src/aider/activity.js +226 -226
  18. package/src/aider/context.js +162 -162
  19. package/src/aider/freshness.js +123 -123
  20. package/src/aider/techniques.js +3465 -3465
  21. package/src/audit/layers.js +180 -180
  22. package/src/audit.js +1032 -1032
  23. package/src/benchmark.js +299 -299
  24. package/src/codex/activity.js +324 -324
  25. package/src/codex/freshness.js +142 -142
  26. package/src/codex/techniques.js +4895 -4895
  27. package/src/context.js +326 -326
  28. package/src/continuous-ops.js +11 -1
  29. package/src/convert.js +340 -340
  30. package/src/copilot/config-parser.js +280 -280
  31. package/src/copilot/context.js +218 -218
  32. package/src/copilot/freshness.js +177 -177
  33. package/src/copilot/patch.js +238 -238
  34. package/src/copilot/techniques.js +3578 -3578
  35. package/src/cursor/freshness.js +194 -194
  36. package/src/cursor/patch.js +243 -243
  37. package/src/cursor/techniques.js +3735 -3735
  38. package/src/doctor.js +201 -201
  39. package/src/fix-engine.js +511 -8
  40. package/src/formatters/csv.js +86 -86
  41. package/src/formatters/junit.js +123 -123
  42. package/src/formatters/markdown.js +164 -164
  43. package/src/formatters/otel.js +151 -151
  44. package/src/freshness.js +156 -156
  45. package/src/gemini/activity.js +402 -402
  46. package/src/gemini/context.js +290 -290
  47. package/src/gemini/freshness.js +183 -183
  48. package/src/gemini/patch.js +229 -229
  49. package/src/gemini/techniques.js +3811 -3811
  50. package/src/governance.js +533 -533
  51. package/src/harmony/audit.js +306 -306
  52. package/src/i18n.js +63 -63
  53. package/src/insights.js +119 -119
  54. package/src/integrations.js +134 -134
  55. package/src/locales/en.json +33 -33
  56. package/src/locales/es.json +33 -33
  57. package/src/migrate.js +354 -354
  58. package/src/opencode/activity.js +286 -286
  59. package/src/opencode/freshness.js +137 -137
  60. package/src/opencode/techniques.js +3450 -3450
  61. package/src/setup/analysis.js +12 -12
  62. package/src/setup.js +7 -6
  63. package/src/shallow-risk/index.js +56 -56
  64. package/src/shallow-risk/patterns/agent-config-cross-platform-drift.js +50 -50
  65. package/src/shallow-risk/patterns/agent-config-dangerous-autoapprove.js +46 -46
  66. package/src/shallow-risk/patterns/agent-config-deprecated-keys.js +46 -46
  67. package/src/shallow-risk/patterns/agent-config-missing-file.js +317 -317
  68. package/src/shallow-risk/patterns/agent-config-secret-literal.js +49 -49
  69. package/src/shallow-risk/patterns/agent-config-stack-contradiction.js +34 -34
  70. package/src/shallow-risk/patterns/hook-script-missing.js +70 -70
  71. package/src/shallow-risk/patterns/mcp-server-no-allowlist.js +52 -52
  72. package/src/shallow-risk/shared.js +648 -648
  73. package/src/source-urls.js +295 -295
  74. package/src/state-paths.js +85 -85
  75. package/src/supplemental-checks.js +805 -805
  76. package/src/telemetry.js +160 -160
  77. package/src/windsurf/context.js +359 -359
  78. package/src/windsurf/freshness.js +194 -194
  79. package/src/windsurf/patch.js +231 -231
  80. package/src/windsurf/techniques.js +3779 -3779
@@ -1,9 +1,9 @@
1
- # Knowledge Maintenance Process
2
-
3
- How to keep Nerviq's knowledge base accurate, current, and trustworthy.
4
-
5
- ## Maintenance Cadences
6
-
1
+ # Knowledge Maintenance Process
2
+
3
+ How to keep Nerviq's knowledge base accurate, current, and trustworthy.
4
+
5
+ ## Maintenance Cadences
6
+
7
7
  ### Daily: Freshness Daemon
8
8
 
9
9
  The freshness system runs automatically and flags checks whose source documentation may have changed.
@@ -17,9 +17,9 @@ The freshness system runs automatically and flags checks whose source documentat
17
17
  - Review `nerviq doctor` output for broken MCP declarations (missing commands, unreachable URLs, missing env vars)
18
18
  - Review `nerviq doctor` output for broken hook runtime health (missing scripts, missing runtimes, or starter hook regressions)
19
19
  - Review `.claude/logs/prompt-injection-alerts.log` if the starter `injection-defense` hook reports suspicious external-content patterns during normal development
20
- - If a check's `sourceUrl` returns 404 or has changed significantly, mark for review
21
- - Update `confidence` values for any checks with degraded sources
22
-
20
+ - If a check's `sourceUrl` returns 404 or has changed significantly, mark for review
21
+ - Update `confidence` values for any checks with degraded sources
22
+
23
23
  **Automation:**
24
24
  ```bash
25
25
  npx @nerviq/cli doctor --verbose # Shows freshness gates + MCP + hook runtime validation
@@ -32,124 +32,124 @@ const { getPlatformChangeManifest, summarizePlatformChangeManifest } = require('
32
32
  console.log(summarizePlatformChangeManifest());
33
33
  console.log(getPlatformChangeManifest()[0].trackedSources);
34
34
  ```
35
-
36
- ### Weekly: Platform Changelog Review
37
-
38
- Each supported platform publishes updates that may affect Nerviq's checks.
39
-
40
- **Process:**
41
- 1. Check official changelogs/release notes for all 8 platforms:
42
- - Claude Code: Anthropic changelog
43
- - Codex: OpenAI platform updates
44
- - Gemini CLI: Google AI Studio releases
45
- - GitHub Copilot: GitHub blog/changelog
46
- - Cursor: Cursor changelog
47
- - Windsurf: Codeium/Windsurf releases
48
- - Aider: GitHub releases
49
- - OpenCode: GitHub releases
50
-
51
- 2. For each relevant change:
52
- - Does it add a new config option? → Candidate for new check
53
- - Does it deprecate a feature? → Update or retire affected checks
54
- - Does it change file formats? → Update config-parser.js
55
-
35
+
36
+ ### Weekly: Platform Changelog Review
37
+
38
+ Each supported platform publishes updates that may affect Nerviq's checks.
39
+
40
+ **Process:**
41
+ 1. Check official changelogs/release notes for all 8 platforms:
42
+ - Claude Code: Anthropic changelog
43
+ - Codex: OpenAI platform updates
44
+ - Gemini CLI: Google AI Studio releases
45
+ - GitHub Copilot: GitHub blog/changelog
46
+ - Cursor: Cursor changelog
47
+ - Windsurf: Codeium/Windsurf releases
48
+ - Aider: GitHub releases
49
+ - OpenCode: GitHub releases
50
+
51
+ 2. For each relevant change:
52
+ - Does it add a new config option? → Candidate for new check
53
+ - Does it deprecate a feature? → Update or retire affected checks
54
+ - Does it change file formats? → Update config-parser.js
55
+
56
56
  3. Log findings in `research/` with date stamp
57
57
  4. If the change affects rollout posture or config semantics, update `src/platform-change-manifest.js` so cadence + triggers stay aligned with reality
58
-
59
- ### Monthly: Cross-Reference Audit
60
-
61
- Verify internal consistency across the knowledge base.
62
-
63
- **Process:**
64
- 1. Run the cross-reference audit:
65
- ```bash
66
- # From the NERVIQ research repo
67
- python tools/check-trust-drift.py
68
- ```
69
-
70
- 2. Check for:
71
- - Duplicate check IDs across platforms
72
- - Checks with confidence below 0.7 (candidates for re-verification)
73
- - Techniques referenced in research but missing from code
74
- - Techniques in code with no corresponding research doc
75
-
76
- 3. Reconcile any mismatches:
77
- - Update source URLs that have moved
78
- - Re-verify claims that have contradicting evidence
79
- - Remove techniques that are no longer applicable
80
-
81
- ### Quarterly: Pruning
82
-
83
- Remove or archive knowledge that is no longer relevant.
84
-
85
- **Process:**
86
- 1. Query all checks by `lastVerified` date
87
- 2. Identify checks not verified in 90+ days
88
- 3. For each stale check:
89
- - **Re-verify**: Visit sourceUrl, test the check, update confidence
90
- - **Archive**: If the feature no longer exists, move to `_archived/`
91
- - **Retire**: If the platform deprecated the feature, remove the check and note in CHANGELOG
92
-
93
- 4. Review research documents older than 90 days:
94
- - Still accurate? → Update `lastVerified` date
95
- - Outdated? → Mark as `status: archived` in frontmatter
96
- - Contradicted by newer findings? → Create superseding document
97
-
98
- 5. Audit experiment results:
99
- - Re-run 5 random experiments to confirm results still hold
100
- - Update ratings if behavior has changed
101
-
102
- ## The 90-Day Rule
103
-
104
- Every piece of knowledge in Nerviq has a maximum freshness window of 90 days.
105
-
106
- **What this means:**
107
- - After 90 days without re-verification, a check's confidence is automatically degraded
108
- - Research documents older than 90 days without updates are flagged in `nerviq doctor`
109
- - Stale checks are not removed automatically but are surfaced in audit output with warnings
110
-
111
- **How to handle stale checks:**
112
-
113
- 1. **Check still valid, source unchanged:**
114
- Update `lastVerified` timestamp. No code change needed.
115
-
116
- 2. **Check valid but source URL changed:**
117
- Update `sourceUrl` in the technique definition. Update `lastVerified`.
118
-
119
- 3. **Check partially valid — behavior changed:**
120
- Update the check function, fix text, confidence level. Create a research note documenting the change.
121
-
122
- 4. **Check no longer valid — feature removed:**
123
- Remove from `techniques.js`. Add entry to CHANGELOG. If other checks depend on it, update those too.
124
-
125
- 5. **Check cannot be verified — source unavailable:**
126
- Lower confidence to 0.5. Add a `TODO` comment. Flag for next weekly review.
127
-
128
- ## Freshness Tracking Fields
129
-
130
- Each technique in Nerviq supports these freshness-related fields:
131
-
132
- | Field | Type | Purpose |
133
- |-------|------|---------|
134
- | `sourceUrl` | string | Primary documentation URL |
135
- | `confidence` | number (0.0-1.0) | How confident we are the check is correct |
136
- | `lastVerified` | ISO date string | When the check was last manually verified |
137
- | `addedVersion` | string | Nerviq version when the check was added |
138
-
139
- ## Emergency Updates
140
-
141
- When a platform ships a breaking change:
142
-
143
- 1. Create a research doc immediately: `research/{platform}-breaking-change-YYYY-MM-DD.md`
144
- 2. Update affected techniques in the same session
145
- 3. Run full check matrix: `node test/{platform}-check-matrix.js`
146
- 4. Run golden matrix to detect output changes: `node test/{platform}-golden-matrix.js`
147
- 5. Publish patch release if checks produce incorrect results
148
-
149
- ## Metrics to Track
150
-
151
- - **Freshness coverage**: % of checks verified within 90 days
152
- - **Confidence distribution**: histogram of confidence values across all checks
153
- - **Stale check count**: number of checks past 90-day window
154
- - **Source availability**: % of sourceUrls returning 200
155
- - **Platform coverage**: checks per platform (target: balanced distribution)
58
+
59
+ ### Monthly: Cross-Reference Audit
60
+
61
+ Verify internal consistency across the knowledge base.
62
+
63
+ **Process:**
64
+ 1. Run the cross-reference audit:
65
+ ```bash
66
+ # From the NERVIQ research repo
67
+ python tools/check-trust-drift.py
68
+ ```
69
+
70
+ 2. Check for:
71
+ - Duplicate check IDs across platforms
72
+ - Checks with confidence below 0.7 (candidates for re-verification)
73
+ - Techniques referenced in research but missing from code
74
+ - Techniques in code with no corresponding research doc
75
+
76
+ 3. Reconcile any mismatches:
77
+ - Update source URLs that have moved
78
+ - Re-verify claims that have contradicting evidence
79
+ - Remove techniques that are no longer applicable
80
+
81
+ ### Quarterly: Pruning
82
+
83
+ Remove or archive knowledge that is no longer relevant.
84
+
85
+ **Process:**
86
+ 1. Query all checks by `lastVerified` date
87
+ 2. Identify checks not verified in 90+ days
88
+ 3. For each stale check:
89
+ - **Re-verify**: Visit sourceUrl, test the check, update confidence
90
+ - **Archive**: If the feature no longer exists, move to `_archived/`
91
+ - **Retire**: If the platform deprecated the feature, remove the check and note in CHANGELOG
92
+
93
+ 4. Review research documents older than 90 days:
94
+ - Still accurate? → Update `lastVerified` date
95
+ - Outdated? → Mark as `status: archived` in frontmatter
96
+ - Contradicted by newer findings? → Create superseding document
97
+
98
+ 5. Audit experiment results:
99
+ - Re-run 5 random experiments to confirm results still hold
100
+ - Update ratings if behavior has changed
101
+
102
+ ## The 90-Day Rule
103
+
104
+ Every piece of knowledge in Nerviq has a maximum freshness window of 90 days.
105
+
106
+ **What this means:**
107
+ - After 90 days without re-verification, a check's confidence is automatically degraded
108
+ - Research documents older than 90 days without updates are flagged in `nerviq doctor`
109
+ - Stale checks are not removed automatically but are surfaced in audit output with warnings
110
+
111
+ **How to handle stale checks:**
112
+
113
+ 1. **Check still valid, source unchanged:**
114
+ Update `lastVerified` timestamp. No code change needed.
115
+
116
+ 2. **Check valid but source URL changed:**
117
+ Update `sourceUrl` in the technique definition. Update `lastVerified`.
118
+
119
+ 3. **Check partially valid — behavior changed:**
120
+ Update the check function, fix text, confidence level. Create a research note documenting the change.
121
+
122
+ 4. **Check no longer valid — feature removed:**
123
+ Remove from `techniques.js`. Add entry to CHANGELOG. If other checks depend on it, update those too.
124
+
125
+ 5. **Check cannot be verified — source unavailable:**
126
+ Lower confidence to 0.5. Add a `TODO` comment. Flag for next weekly review.
127
+
128
+ ## Freshness Tracking Fields
129
+
130
+ Each technique in Nerviq supports these freshness-related fields:
131
+
132
+ | Field | Type | Purpose |
133
+ |-------|------|---------|
134
+ | `sourceUrl` | string | Primary documentation URL |
135
+ | `confidence` | number (0.0-1.0) | How confident we are the check is correct |
136
+ | `lastVerified` | ISO date string | When the check was last manually verified |
137
+ | `addedVersion` | string | Nerviq version when the check was added |
138
+
139
+ ## Emergency Updates
140
+
141
+ When a platform ships a breaking change:
142
+
143
+ 1. Create a research doc immediately: `research/{platform}-breaking-change-YYYY-MM-DD.md`
144
+ 2. Update affected techniques in the same session
145
+ 3. Run full check matrix: `node test/{platform}-check-matrix.js`
146
+ 4. Run golden matrix to detect output changes: `node test/{platform}-golden-matrix.js`
147
+ 5. Publish patch release if checks produce incorrect results
148
+
149
+ ## Metrics to Track
150
+
151
+ - **Freshness coverage**: % of checks verified within 90 days
152
+ - **Confidence distribution**: histogram of confidence values across all checks
153
+ - **Stale check count**: number of checks past 90-day window
154
+ - **Source availability**: % of sourceUrls returning 200
155
+ - **Platform coverage**: checks per platform (target: balanced distribution)