@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.
- package/CHANGELOG.md +1527 -1493
- package/README.md +550 -538
- package/SECURITY.md +82 -82
- package/bin/cli.js +2562 -2558
- package/docs/api-reference.md +356 -356
- package/docs/audit-fix.md +109 -0
- package/docs/autofix.md +3 -62
- package/docs/getting-started.md +1 -1
- package/docs/index.html +592 -592
- package/docs/integration-contracts.md +287 -287
- package/docs/maintenance.md +128 -128
- package/docs/new-platform-guide.md +202 -202
- package/docs/release-process.md +63 -0
- package/docs/shallow-risk.md +244 -244
- package/docs/why-nerviq.md +82 -82
- package/package.json +67 -67
- package/src/aider/activity.js +226 -226
- package/src/aider/context.js +162 -162
- package/src/aider/freshness.js +123 -123
- package/src/aider/techniques.js +3465 -3465
- package/src/audit/layers.js +180 -180
- package/src/audit.js +1032 -1032
- package/src/benchmark.js +299 -299
- package/src/codex/activity.js +324 -324
- package/src/codex/freshness.js +142 -142
- package/src/codex/techniques.js +4895 -4895
- package/src/context.js +326 -326
- package/src/continuous-ops.js +11 -1
- package/src/convert.js +340 -340
- package/src/copilot/config-parser.js +280 -280
- package/src/copilot/context.js +218 -218
- package/src/copilot/freshness.js +177 -177
- package/src/copilot/patch.js +238 -238
- package/src/copilot/techniques.js +3578 -3578
- package/src/cursor/freshness.js +194 -194
- package/src/cursor/patch.js +243 -243
- package/src/cursor/techniques.js +3735 -3735
- package/src/doctor.js +201 -201
- package/src/fix-engine.js +511 -8
- package/src/formatters/csv.js +86 -86
- package/src/formatters/junit.js +123 -123
- package/src/formatters/markdown.js +164 -164
- package/src/formatters/otel.js +151 -151
- package/src/freshness.js +156 -156
- package/src/gemini/activity.js +402 -402
- package/src/gemini/context.js +290 -290
- package/src/gemini/freshness.js +183 -183
- package/src/gemini/patch.js +229 -229
- package/src/gemini/techniques.js +3811 -3811
- package/src/governance.js +533 -533
- package/src/harmony/audit.js +306 -306
- package/src/i18n.js +63 -63
- package/src/insights.js +119 -119
- package/src/integrations.js +134 -134
- package/src/locales/en.json +33 -33
- package/src/locales/es.json +33 -33
- package/src/migrate.js +354 -354
- package/src/opencode/activity.js +286 -286
- package/src/opencode/freshness.js +137 -137
- package/src/opencode/techniques.js +3450 -3450
- package/src/setup/analysis.js +12 -12
- package/src/setup.js +7 -6
- package/src/shallow-risk/index.js +56 -56
- package/src/shallow-risk/patterns/agent-config-cross-platform-drift.js +50 -50
- package/src/shallow-risk/patterns/agent-config-dangerous-autoapprove.js +46 -46
- package/src/shallow-risk/patterns/agent-config-deprecated-keys.js +46 -46
- package/src/shallow-risk/patterns/agent-config-missing-file.js +317 -317
- package/src/shallow-risk/patterns/agent-config-secret-literal.js +49 -49
- package/src/shallow-risk/patterns/agent-config-stack-contradiction.js +34 -34
- package/src/shallow-risk/patterns/hook-script-missing.js +70 -70
- package/src/shallow-risk/patterns/mcp-server-no-allowlist.js +52 -52
- package/src/shallow-risk/shared.js +648 -648
- package/src/source-urls.js +295 -295
- package/src/state-paths.js +85 -85
- package/src/supplemental-checks.js +805 -805
- package/src/telemetry.js +160 -160
- package/src/windsurf/context.js +359 -359
- package/src/windsurf/freshness.js +194 -194
- package/src/windsurf/patch.js +231 -231
- package/src/windsurf/techniques.js +3779 -3779
package/docs/maintenance.md
CHANGED
|
@@ -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)
|