@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/src/freshness.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Code Freshness Operationalization
|
|
3
|
-
*
|
|
4
|
-
* Release gates, recurring probes, propagation checklists,
|
|
5
|
-
* and staleness blocking for Claude Code surfaces.
|
|
6
|
-
*
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code Freshness Operationalization
|
|
3
|
+
*
|
|
4
|
+
* Release gates, recurring probes, propagation checklists,
|
|
5
|
+
* and staleness blocking for Claude Code surfaces.
|
|
6
|
+
*
|
|
7
7
|
* P0 sources from code.claude.com/docs and official Anthropic launch posts,
|
|
8
8
|
* with propagation for CLAUDE.md, output style, and agent harness changes.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const { version } = require('../package.json');
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* P0 sources that must be fresh before any Claude Code release claim.
|
|
15
|
-
*/
|
|
16
|
-
const P0_SOURCES = [
|
|
17
|
-
{
|
|
18
|
-
key: 'claude-code-docs',
|
|
19
|
-
label: 'Claude Code Official Docs',
|
|
20
|
-
url: 'https://code.claude.com/docs',
|
|
21
|
-
stalenessThresholdDays: 30,
|
|
22
|
-
verifiedAt: '2026-04-07',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
key: 'claude-md-format',
|
|
26
|
-
label: 'CLAUDE.md / Memory Documentation',
|
|
27
|
-
url: 'https://code.claude.com/docs/en/memory',
|
|
28
|
-
stalenessThresholdDays: 30,
|
|
29
|
-
verifiedAt: '2026-04-07',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
key: 'claude-mcp-docs',
|
|
33
|
-
label: 'Claude Code MCP Documentation',
|
|
34
|
-
url: 'https://code.claude.com/docs/en/mcp',
|
|
35
|
-
stalenessThresholdDays: 30,
|
|
36
|
-
verifiedAt: '2026-04-07',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
key: 'claude-hooks-docs',
|
|
40
|
-
label: 'Claude Code Hooks Documentation',
|
|
41
|
-
url: 'https://code.claude.com/docs/en/hooks',
|
|
42
|
-
stalenessThresholdDays: 14,
|
|
43
|
-
verifiedAt: '2026-04-07',
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
key: 'claude-security-docs',
|
|
47
|
-
label: 'Claude Code Security Documentation',
|
|
48
|
-
url: 'https://code.claude.com/docs/en/security',
|
|
49
|
-
stalenessThresholdDays: 30,
|
|
50
|
-
verifiedAt: '2026-04-07',
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
key: 'claude-permissions-docs',
|
|
54
|
-
label: 'Claude Code Permissions Documentation',
|
|
55
|
-
url: 'https://code.claude.com/docs/en/permissions',
|
|
56
|
-
stalenessThresholdDays: 14,
|
|
57
|
-
verifiedAt: '2026-04-07',
|
|
58
|
-
},
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const { version } = require('../package.json');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* P0 sources that must be fresh before any Claude Code release claim.
|
|
15
|
+
*/
|
|
16
|
+
const P0_SOURCES = [
|
|
17
|
+
{
|
|
18
|
+
key: 'claude-code-docs',
|
|
19
|
+
label: 'Claude Code Official Docs',
|
|
20
|
+
url: 'https://code.claude.com/docs',
|
|
21
|
+
stalenessThresholdDays: 30,
|
|
22
|
+
verifiedAt: '2026-04-07',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
key: 'claude-md-format',
|
|
26
|
+
label: 'CLAUDE.md / Memory Documentation',
|
|
27
|
+
url: 'https://code.claude.com/docs/en/memory',
|
|
28
|
+
stalenessThresholdDays: 30,
|
|
29
|
+
verifiedAt: '2026-04-07',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: 'claude-mcp-docs',
|
|
33
|
+
label: 'Claude Code MCP Documentation',
|
|
34
|
+
url: 'https://code.claude.com/docs/en/mcp',
|
|
35
|
+
stalenessThresholdDays: 30,
|
|
36
|
+
verifiedAt: '2026-04-07',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: 'claude-hooks-docs',
|
|
40
|
+
label: 'Claude Code Hooks Documentation',
|
|
41
|
+
url: 'https://code.claude.com/docs/en/hooks',
|
|
42
|
+
stalenessThresholdDays: 14,
|
|
43
|
+
verifiedAt: '2026-04-07',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: 'claude-security-docs',
|
|
47
|
+
label: 'Claude Code Security Documentation',
|
|
48
|
+
url: 'https://code.claude.com/docs/en/security',
|
|
49
|
+
stalenessThresholdDays: 30,
|
|
50
|
+
verifiedAt: '2026-04-07',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: 'claude-permissions-docs',
|
|
54
|
+
label: 'Claude Code Permissions Documentation',
|
|
55
|
+
url: 'https://code.claude.com/docs/en/permissions',
|
|
56
|
+
stalenessThresholdDays: 14,
|
|
57
|
+
verifiedAt: '2026-04-07',
|
|
58
|
+
},
|
|
59
59
|
{
|
|
60
60
|
key: 'claude-settings-docs',
|
|
61
61
|
label: 'Claude Code Settings Documentation',
|
|
@@ -96,37 +96,37 @@ const P0_SOURCES = [
|
|
|
96
96
|
label: 'Claude Code Changelog',
|
|
97
97
|
url: 'https://code.claude.com/docs/en/changelog',
|
|
98
98
|
stalenessThresholdDays: 14,
|
|
99
|
-
verifiedAt: '2026-04-07',
|
|
100
|
-
},
|
|
101
|
-
];
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Propagation checklist: when a Claude Code source changes, these must update.
|
|
105
|
-
*/
|
|
106
|
-
const PROPAGATION_CHECKLIST = [
|
|
107
|
-
{
|
|
108
|
-
trigger: 'CLAUDE.md format change (new fields, import syntax, hierarchy change)',
|
|
109
|
-
targets: [
|
|
110
|
-
'src/context.js — update ProjectContext parsing',
|
|
111
|
-
'src/techniques.js — update memory/context checks',
|
|
112
|
-
'src/setup.js — update CLAUDE.md template generation',
|
|
113
|
-
],
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
trigger: 'Hooks system change (event types, exit codes, schema)',
|
|
117
|
-
targets: [
|
|
118
|
-
'src/governance.js — update hookRegistry',
|
|
119
|
-
'src/techniques.js — update hooks checks',
|
|
120
|
-
],
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
trigger: 'MCP configuration format change',
|
|
124
|
-
targets: [
|
|
125
|
-
'src/techniques.js — update MCP checks',
|
|
126
|
-
'src/mcp-packs.js — update pack projections',
|
|
127
|
-
'src/context.js — update mcpConfig parsing',
|
|
128
|
-
],
|
|
129
|
-
},
|
|
99
|
+
verifiedAt: '2026-04-07',
|
|
100
|
+
},
|
|
101
|
+
];
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Propagation checklist: when a Claude Code source changes, these must update.
|
|
105
|
+
*/
|
|
106
|
+
const PROPAGATION_CHECKLIST = [
|
|
107
|
+
{
|
|
108
|
+
trigger: 'CLAUDE.md format change (new fields, import syntax, hierarchy change)',
|
|
109
|
+
targets: [
|
|
110
|
+
'src/context.js — update ProjectContext parsing',
|
|
111
|
+
'src/techniques.js — update memory/context checks',
|
|
112
|
+
'src/setup.js — update CLAUDE.md template generation',
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
trigger: 'Hooks system change (event types, exit codes, schema)',
|
|
117
|
+
targets: [
|
|
118
|
+
'src/governance.js — update hookRegistry',
|
|
119
|
+
'src/techniques.js — update hooks checks',
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
trigger: 'MCP configuration format change',
|
|
124
|
+
targets: [
|
|
125
|
+
'src/techniques.js — update MCP checks',
|
|
126
|
+
'src/mcp-packs.js — update pack projections',
|
|
127
|
+
'src/context.js — update mcpConfig parsing',
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
130
|
{
|
|
131
131
|
trigger: 'Permissions model change (allow/deny lists, operator/user split)',
|
|
132
132
|
targets: [
|
|
@@ -159,72 +159,72 @@ const PROPAGATION_CHECKLIST = [
|
|
|
159
159
|
],
|
|
160
160
|
},
|
|
161
161
|
];
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Release gate: check if all P0 sources are within staleness threshold.
|
|
165
|
-
*/
|
|
166
|
-
function checkReleaseGate(sourceVerifications = {}) {
|
|
167
|
-
const now = new Date();
|
|
168
|
-
const results = P0_SOURCES.map(source => {
|
|
169
|
-
const verifiedAt = sourceVerifications[source.key]
|
|
170
|
-
? new Date(sourceVerifications[source.key])
|
|
171
|
-
: source.verifiedAt ? new Date(source.verifiedAt) : null;
|
|
172
|
-
|
|
173
|
-
if (!verifiedAt) {
|
|
174
|
-
return { ...source, status: 'unverified', daysStale: null };
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const daysSince = Math.floor((now - verifiedAt) / (1000 * 60 * 60 * 24));
|
|
178
|
-
const isStale = daysSince > source.stalenessThresholdDays;
|
|
179
|
-
|
|
180
|
-
return {
|
|
181
|
-
...source,
|
|
182
|
-
verifiedAt: verifiedAt.toISOString(),
|
|
183
|
-
daysStale: daysSince,
|
|
184
|
-
status: isStale ? 'stale' : 'fresh',
|
|
185
|
-
};
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
return {
|
|
189
|
-
ready: results.every(r => r.status === 'fresh'),
|
|
190
|
-
stale: results.filter(r => r.status === 'stale' || r.status === 'unverified'),
|
|
191
|
-
fresh: results.filter(r => r.status === 'fresh'),
|
|
192
|
-
results,
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function formatReleaseGate(gateResult) {
|
|
197
|
-
const lines = [
|
|
198
|
-
`Claude Code Freshness Gate (nerviq v${version})`,
|
|
199
|
-
'═══════════════════════════════════════',
|
|
200
|
-
'',
|
|
201
|
-
`Status: ${gateResult.ready ? 'READY' : 'BLOCKED'}`,
|
|
202
|
-
`Fresh: ${gateResult.fresh.length}/${gateResult.results.length}`,
|
|
203
|
-
'',
|
|
204
|
-
];
|
|
205
|
-
|
|
206
|
-
for (const result of gateResult.results) {
|
|
207
|
-
const icon = result.status === 'fresh' ? '✓' : result.status === 'stale' ? '✗' : '?';
|
|
208
|
-
const age = result.daysStale !== null ? ` (${result.daysStale}d ago)` : ' (unverified)';
|
|
209
|
-
lines.push(` ${icon} ${result.label}${age} — threshold: ${result.stalenessThresholdDays}d`);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if (!gateResult.ready) {
|
|
213
|
-
lines.push('', 'Action required: verify stale/unverified sources before claiming release freshness.');
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return lines.join('\n');
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
function getPropagationTargets(triggerKeyword) {
|
|
220
|
-
const keyword = triggerKeyword.toLowerCase();
|
|
221
|
-
return PROPAGATION_CHECKLIST.filter(item => item.trigger.toLowerCase().includes(keyword));
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
module.exports = {
|
|
225
|
-
P0_SOURCES,
|
|
226
|
-
PROPAGATION_CHECKLIST,
|
|
227
|
-
checkReleaseGate,
|
|
228
|
-
formatReleaseGate,
|
|
229
|
-
getPropagationTargets,
|
|
230
|
-
};
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Release gate: check if all P0 sources are within staleness threshold.
|
|
165
|
+
*/
|
|
166
|
+
function checkReleaseGate(sourceVerifications = {}) {
|
|
167
|
+
const now = new Date();
|
|
168
|
+
const results = P0_SOURCES.map(source => {
|
|
169
|
+
const verifiedAt = sourceVerifications[source.key]
|
|
170
|
+
? new Date(sourceVerifications[source.key])
|
|
171
|
+
: source.verifiedAt ? new Date(source.verifiedAt) : null;
|
|
172
|
+
|
|
173
|
+
if (!verifiedAt) {
|
|
174
|
+
return { ...source, status: 'unverified', daysStale: null };
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const daysSince = Math.floor((now - verifiedAt) / (1000 * 60 * 60 * 24));
|
|
178
|
+
const isStale = daysSince > source.stalenessThresholdDays;
|
|
179
|
+
|
|
180
|
+
return {
|
|
181
|
+
...source,
|
|
182
|
+
verifiedAt: verifiedAt.toISOString(),
|
|
183
|
+
daysStale: daysSince,
|
|
184
|
+
status: isStale ? 'stale' : 'fresh',
|
|
185
|
+
};
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
return {
|
|
189
|
+
ready: results.every(r => r.status === 'fresh'),
|
|
190
|
+
stale: results.filter(r => r.status === 'stale' || r.status === 'unverified'),
|
|
191
|
+
fresh: results.filter(r => r.status === 'fresh'),
|
|
192
|
+
results,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function formatReleaseGate(gateResult) {
|
|
197
|
+
const lines = [
|
|
198
|
+
`Claude Code Freshness Gate (nerviq v${version})`,
|
|
199
|
+
'═══════════════════════════════════════',
|
|
200
|
+
'',
|
|
201
|
+
`Status: ${gateResult.ready ? 'READY' : 'BLOCKED'}`,
|
|
202
|
+
`Fresh: ${gateResult.fresh.length}/${gateResult.results.length}`,
|
|
203
|
+
'',
|
|
204
|
+
];
|
|
205
|
+
|
|
206
|
+
for (const result of gateResult.results) {
|
|
207
|
+
const icon = result.status === 'fresh' ? '✓' : result.status === 'stale' ? '✗' : '?';
|
|
208
|
+
const age = result.daysStale !== null ? ` (${result.daysStale}d ago)` : ' (unverified)';
|
|
209
|
+
lines.push(` ${icon} ${result.label}${age} — threshold: ${result.stalenessThresholdDays}d`);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (!gateResult.ready) {
|
|
213
|
+
lines.push('', 'Action required: verify stale/unverified sources before claiming release freshness.');
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
return lines.join('\n');
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function getPropagationTargets(triggerKeyword) {
|
|
220
|
+
const keyword = triggerKeyword.toLowerCase();
|
|
221
|
+
return PROPAGATION_CHECKLIST.filter(item => item.trigger.toLowerCase().includes(keyword));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
module.exports = {
|
|
225
|
+
P0_SOURCES,
|
|
226
|
+
PROPAGATION_CHECKLIST,
|
|
227
|
+
checkReleaseGate,
|
|
228
|
+
formatReleaseGate,
|
|
229
|
+
getPropagationTargets,
|
|
230
|
+
};
|