@nerviq/cli 1.8.9 → 1.9.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.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@nerviq/cli)](https://www.npmjs.com/package/@nerviq/cli)
6
6
  [![License: AGPL-3.0](https://img.shields.io/badge/License-AGPL--3.0-blue.svg)](LICENSE)
7
- [![Checks: 2431](https://img.shields.io/badge/checks-2431-brightgreen)](https://github.com/nerviq/nerviq)
7
+ [![Checks: 2438](https://img.shields.io/badge/checks-2438-brightgreen)](https://github.com/nerviq/nerviq)
8
8
 
9
9
  ---
10
10
 
@@ -14,7 +14,7 @@ Nerviq audits, sets up, and governs AI coding agent configurations for **8 platf
14
14
 
15
15
  | Platform | Checks | Status |
16
16
  |----------|--------|--------|
17
- | Claude Code | 393 | Full |
17
+ | Claude Code | 400 | Full |
18
18
  | Codex (OpenAI) | 272 | Full |
19
19
  | Gemini CLI (Google) | 300 | Full |
20
20
  | GitHub Copilot | 299 | Full |
@@ -85,7 +85,7 @@ No install required. Zero dependencies.
85
85
  | **Team lead / DevEx** | `nerviq governance` → `nerviq audit --json` | CI threshold + `nerviq watch` |
86
86
  | **Enterprise / Platform** | `nerviq harmony-audit` → `nerviq harmony-drift` | Policy packs + `nerviq certify` |
87
87
 
88
- ## 2,431 Checks Across 96 Categories (8 Platforms × ~300 Governance Rules)
88
+ ## 2,438 Checks Across 96 Categories (8 Platforms × ~300 Governance Rules)
89
89
 
90
90
  | Category Group | Checks | Examples |
91
91
  |----------------|--------|---------|
@@ -290,7 +290,7 @@ Nerviq is built on the NERVIQ knowledge engine — the largest verified catalog
290
290
 
291
291
  - **448+ research documents** covering all 8 platforms
292
292
  - **332+ experiments** with tested, rated results
293
- - **2,431 checks** across 8 platforms (~300 unique governance rules × 8 platform adaptations), each with `sourceUrl` and `confidence` level (0.0-1.0)
293
+ - **2,438 checks** across 8 platforms (~300 unique governance rules × 8 platform adaptations), each with `sourceUrl` and `confidence` level (0.0-1.0)
294
294
  - Every check is traceable to primary documentation or verified experiment
295
295
  - 90-day freshness cycle: stale findings are re-verified or pruned
296
296
 
@@ -347,3 +347,16 @@ If Nerviq helped you, consider giving it a ⭐ on [GitHub](https://github.com/ne
347
347
  | `BETA` | Works but has limited real-world testing. API may change |
348
348
  | `EXPERIMENTAL` | Early stage, static rules, results may vary |
349
349
 
350
+ ## Previously nerviq-cli
351
+
352
+ Nerviq was previously published as `nerviq-cli`. If you were using it:
353
+
354
+ ```bash
355
+ # Old
356
+ npx nerviq-cli
357
+
358
+ # New
359
+ npx @nerviq/cli audit
360
+ ```
361
+
362
+ All features are preserved and expanded.
package/bin/cli.js CHANGED
@@ -14,6 +14,7 @@ const { auditWorkspaces } = require('../src/workspace');
14
14
  const { scanOrg } = require('../src/org');
15
15
  const { detectAntiPatterns, printAntiPatterns, printAntiPatternCatalog } = require('../src/anti-patterns');
16
16
  const { VERIFICATION_DATES, getVerificationDate, getVerificationStats } = require('../src/verification-metadata');
17
+ const { init: initI18n, t } = require('../src/i18n');
17
18
  const { version } = require('../package.json');
18
19
 
19
20
  const args = process.argv.slice(2);
@@ -91,11 +92,12 @@ function parseArgs(rawArgs) {
91
92
  let external = null;
92
93
  let repos = [];
93
94
  let teamProfile = null;
95
+ let lang = null;
94
96
 
95
97
  for (let i = 0; i < rawArgs.length; i++) {
96
98
  const arg = rawArgs[i];
97
99
 
98
- if (arg === '--threshold' || arg === '--out' || arg === '--plan' || arg === '--only' || arg === '--profile' || arg === '--mcp-pack' || arg === '--require' || arg === '--key' || arg === '--status' || arg === '--effect' || arg === '--notes' || arg === '--source' || arg === '--score-delta' || arg === '--platform' || arg === '--format' || arg === '--from' || arg === '--to' || arg === '--port' || arg === '--workspace' || arg === '--check-version' || arg === '--webhook' || arg === '--external' || arg === '--team-profile') {
100
+ if (arg === '--threshold' || arg === '--out' || arg === '--plan' || arg === '--only' || arg === '--profile' || arg === '--mcp-pack' || arg === '--require' || arg === '--key' || arg === '--status' || arg === '--effect' || arg === '--notes' || arg === '--source' || arg === '--score-delta' || arg === '--platform' || arg === '--format' || arg === '--from' || arg === '--to' || arg === '--port' || arg === '--workspace' || arg === '--check-version' || arg === '--webhook' || arg === '--external' || arg === '--team-profile' || arg === '--lang') {
99
101
  const value = rawArgs[i + 1];
100
102
  if (!value || value.startsWith('--')) {
101
103
  throw new Error(`${arg} requires a value`);
@@ -123,10 +125,16 @@ function parseArgs(rawArgs) {
123
125
  if (arg === '--webhook') webhookUrl = value.trim();
124
126
  if (arg === '--external') external = value.trim();
125
127
  if (arg === '--team-profile') teamProfile = value.trim();
128
+ if (arg === '--lang') lang = value.trim().toLowerCase();
126
129
  i++;
127
130
  continue;
128
131
  }
129
132
 
133
+ if (arg.startsWith('--lang=')) {
134
+ lang = arg.split('=').slice(1).join('=').trim().toLowerCase();
135
+ continue;
136
+ }
137
+
130
138
  if (arg.startsWith('--team-profile=')) {
131
139
  teamProfile = arg.split('=').slice(1).join('=').trim();
132
140
  continue;
@@ -258,7 +266,7 @@ function parseArgs(rawArgs) {
258
266
 
259
267
  const normalizedCommand = COMMAND_ALIASES[command] || command;
260
268
 
261
- return { flags, command, normalizedCommand, threshold, out, planFile, only, profile, mcpPacks, requireChecks, feedbackKey, feedbackStatus, feedbackEffect, feedbackNotes, feedbackSource, feedbackScoreDelta, platform, format, port, workspace, extraArgs, convertFrom, convertTo, migrateFrom, migrateTo, checkVersion, webhookUrl, external, repos, teamProfile };
269
+ return { flags, command, normalizedCommand, threshold, out, planFile, only, profile, mcpPacks, requireChecks, feedbackKey, feedbackStatus, feedbackEffect, feedbackNotes, feedbackSource, feedbackScoreDelta, platform, format, port, workspace, extraArgs, convertFrom, convertTo, migrateFrom, migrateTo, checkVersion, webhookUrl, external, repos, teamProfile, lang };
262
270
  }
263
271
 
264
272
  function printWorkspaceSummary(summary, options) {
@@ -512,6 +520,11 @@ async function main() {
512
520
 
513
521
  const { flags, command, normalizedCommand } = parsed;
514
522
 
523
+ // Initialize i18n with --lang flag or NERVIQ_LANG env var
524
+ if (parsed.lang) {
525
+ initI18n(parsed.lang);
526
+ }
527
+
515
528
  if (flags.includes('--help') || command === 'help') {
516
529
  console.log(HELP);
517
530
  process.exit(0);
@@ -547,6 +560,7 @@ async function main() {
547
560
  port: parsed.port !== null ? Number(parsed.port) : null,
548
561
  workspace: parsed.workspace || null,
549
562
  webhookUrl: parsed.webhookUrl || null,
563
+ lang: parsed.lang || null,
550
564
  external: parsed.external || null,
551
565
  dir: process.cwd()
552
566
  };
package/package.json CHANGED
@@ -1,59 +1,59 @@
1
- {
2
- "name": "@nerviq/cli",
3
- "version": "1.8.9",
4
- "description": "The intelligent nervous system for AI coding agents — 2,431 checks (8 platforms × ~300 governance rules), 10 languages, 62 domain packs. Audit, align, and amplify.",
5
- "main": "src/index.js",
6
- "bin": {
7
- "nerviq": "bin/cli.js",
8
- "@nerviq/cli": "bin/cli.js",
9
- "nerviq-mcp": "src/mcp-server.js"
10
- },
11
- "files": [
12
- "bin",
13
- "src",
14
- "README.md"
15
- ],
16
- "scripts": {
17
- "start": "node bin/cli.js",
18
- "build": "npm pack --dry-run",
19
- "test": "node test/run.js",
20
- "test:jest": "jest",
21
- "test:coverage": "jest --coverage",
22
- "test:all": "npm test && npx jest && node test/check-matrix.js && node test/codex-check-matrix.js && node test/gemini-check-matrix.js && node test/copilot-check-matrix.js && node test/cursor-check-matrix.js && node test/windsurf-check-matrix.js && node test/aider-check-matrix.js && node test/opencode-check-matrix.js && node test/golden-matrix.js && node test/codex-golden-matrix.js && node test/gemini-golden-matrix.js && node test/copilot-golden-matrix.js && node test/cursor-golden-matrix.js && node test/windsurf-golden-matrix.js && node test/aider-golden-matrix.js && node test/opencode-golden-matrix.js",
23
- "benchmark:perf": "node tools/benchmark.js",
24
- "catalog": "node -e \"const {generateCatalog}=require('./src/catalog');console.log(JSON.stringify(generateCatalog(),null,2))\""
25
- },
26
- "keywords": [
27
- "nerviq",
28
- "ai-agents",
29
- "agent-governance",
30
- "agent-config",
31
- "harmony",
32
- "synergy",
33
- "audit",
34
- "claude",
35
- "codex",
36
- "gemini",
37
- "copilot",
38
- "cursor",
39
- "windsurf",
40
- "aider",
41
- "developer-tools",
42
- "cli",
43
- "mcp",
44
- "multi-agent"
45
- ],
46
- "author": "Nerviq <hello@nerviq.net>",
47
- "license": "AGPL-3.0",
48
- "repository": {
49
- "type": "git",
50
- "url": "git+https://github.com/nerviq/nerviq.git"
51
- },
52
- "homepage": "https://nerviq.net",
53
- "engines": {
54
- "node": ">=18.0.0"
55
- },
56
- "devDependencies": {
57
- "jest": "^30.3.0"
58
- }
59
- }
1
+ {
2
+ "name": "@nerviq/cli",
3
+ "version": "1.9.0",
4
+ "description": "The intelligent nervous system for AI coding agents — 2,438 checks (8 platforms × ~300 governance rules), 10 languages, 62 domain packs. Audit, align, and amplify.",
5
+ "main": "src/index.js",
6
+ "bin": {
7
+ "nerviq": "bin/cli.js",
8
+ "@nerviq/cli": "bin/cli.js",
9
+ "nerviq-mcp": "src/mcp-server.js"
10
+ },
11
+ "files": [
12
+ "bin",
13
+ "src",
14
+ "README.md"
15
+ ],
16
+ "scripts": {
17
+ "start": "node bin/cli.js",
18
+ "build": "npm pack --dry-run",
19
+ "test": "node test/run.js",
20
+ "test:jest": "jest",
21
+ "test:coverage": "jest --coverage",
22
+ "test:all": "npm test && npx jest && node test/check-matrix.js && node test/codex-check-matrix.js && node test/gemini-check-matrix.js && node test/copilot-check-matrix.js && node test/cursor-check-matrix.js && node test/windsurf-check-matrix.js && node test/aider-check-matrix.js && node test/opencode-check-matrix.js && node test/golden-matrix.js && node test/codex-golden-matrix.js && node test/gemini-golden-matrix.js && node test/copilot-golden-matrix.js && node test/cursor-golden-matrix.js && node test/windsurf-golden-matrix.js && node test/aider-golden-matrix.js && node test/opencode-golden-matrix.js",
23
+ "benchmark:perf": "node tools/benchmark.js",
24
+ "catalog": "node -e \"const {generateCatalog}=require('./src/catalog');console.log(JSON.stringify(generateCatalog(),null,2))\""
25
+ },
26
+ "keywords": [
27
+ "nerviq",
28
+ "ai-agents",
29
+ "agent-governance",
30
+ "agent-config",
31
+ "harmony",
32
+ "synergy",
33
+ "audit",
34
+ "claude",
35
+ "codex",
36
+ "gemini",
37
+ "copilot",
38
+ "cursor",
39
+ "windsurf",
40
+ "aider",
41
+ "developer-tools",
42
+ "cli",
43
+ "mcp",
44
+ "multi-agent"
45
+ ],
46
+ "author": "Nerviq <hello@nerviq.net>",
47
+ "license": "AGPL-3.0",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/nerviq/nerviq.git"
51
+ },
52
+ "homepage": "https://nerviq.net",
53
+ "engines": {
54
+ "node": ">=18.0.0"
55
+ },
56
+ "devDependencies": {
57
+ "jest": "^30.3.0"
58
+ }
59
+ }
package/src/audit.js CHANGED
@@ -33,6 +33,7 @@ const { loadPlugins, mergePluginChecks } = require('./plugins');
33
33
  const { hasWorkspaceConfig, detectWorkspaceGlobs, detectWorkspaces } = require('./workspace');
34
34
  const { detectDeprecationWarnings } = require('./deprecation');
35
35
  const { version: packageVersion } = require('../package.json');
36
+ const { t } = require('./i18n');
36
37
 
37
38
  const COLORS = {
38
39
  reset: '\x1b[0m',
@@ -872,27 +873,27 @@ function getCodexDomainPackSignals(ctx) {
872
873
 
873
874
  function printLiteAudit(result, dir) {
874
875
  console.log('');
875
- const productLabel = result.platform === 'codex' ? 'nerviq codex quick scan' : 'nerviq quick scan';
876
+ const productLabel = result.platform === 'codex' ? t('audit.codexQuickScan') : t('audit.quickScan');
876
877
  console.log(colorize(` ${productLabel}`, 'bold'));
877
878
  console.log(colorize(' ═══════════════════════════════════════', 'dim'));
878
- console.log(colorize(` Scanning: ${dir}`, 'dim'));
879
+ console.log(colorize(` ${t('audit.scanning', { dir })}`, 'dim'));
879
880
  console.log('');
880
881
  if (result.detectedConfigFiles && result.detectedConfigFiles.length > 0) {
881
882
  console.log(colorize(` Found: ${result.detectedConfigFiles.join(', ')}`, 'dim'));
882
883
  }
883
884
  console.log('');
884
- console.log(` Score: ${colorize(`${result.score}/100`, 'bold')} (${result.passed}/${result.passed + result.failed} checks passing)`);
885
+ console.log(` ${t('audit.score', { score: colorize(`${result.score}/100`, 'bold'), passed: result.passed, total: result.passed + result.failed })}`);
885
886
 
886
887
  // Score explanation line (lite mode only)
887
888
  const _critCount = (result.results || []).filter(r => r.passed === false && r.impact === 'critical').length;
888
889
  const _highCount = (result.results || []).filter(r => r.passed === false && r.impact === 'high').length;
889
890
  let scoreExplanation;
890
891
  if (result.score >= 90) {
891
- scoreExplanation = 'Excellent setup — production-ready governance';
892
+ scoreExplanation = t('audit.excellent');
892
893
  } else if (result.score >= 70) {
893
- scoreExplanation = `Strong setup ${_critCount} critical items to address`;
894
+ scoreExplanation = t('audit.strong', { count: _critCount });
894
895
  } else if (result.score >= 50) {
895
- scoreExplanation = `Good foundation ${_critCount + _highCount} items need attention`;
896
+ scoreExplanation = t('audit.good', { count: _critCount + _highCount });
896
897
  } else if (result.score >= 30) {
897
898
  // Find weakest category (most failures)
898
899
  const catFailures = {};
@@ -901,9 +902,9 @@ function printLiteAudit(result, dir) {
901
902
  catFailures[cat] = (catFailures[cat] || 0) + 1;
902
903
  });
903
904
  const weakestCategory = Object.keys(catFailures).sort((a, b) => catFailures[b] - catFailures[a])[0] || 'config';
904
- scoreExplanation = `Basic setup significant gaps in ${weakestCategory}`;
905
+ scoreExplanation = t('audit.basic', { category: weakestCategory });
905
906
  } else {
906
- scoreExplanation = 'Early stage — run `nerviq setup` to bootstrap your config';
907
+ scoreExplanation = t('audit.early');
907
908
  }
908
909
  console.log(colorize(` ${scoreExplanation}`, 'dim'));
909
910
 
@@ -1233,10 +1234,10 @@ async function audit(options) {
1233
1234
 
1234
1235
  // Display results
1235
1236
  console.log('');
1236
- const auditTitle = spec.platform === 'codex' ? 'nerviq codex audit' : 'nerviq audit';
1237
+ const auditTitle = spec.platform === 'codex' ? t('audit.codexTitle') : t('audit.title');
1237
1238
  console.log(colorize(` ${auditTitle}`, 'bold'));
1238
1239
  console.log(colorize(' ═══════════════════════════════════════', 'dim'));
1239
- console.log(colorize(` Scanning: ${options.dir}`, 'dim'));
1240
+ console.log(colorize(` ${t('audit.scanning', { dir: options.dir })}`, 'dim'));
1240
1241
  if (spec.platformVersion) {
1241
1242
  console.log(colorize(` Platform: ${spec.platformLabel} (${spec.platformVersion})`, 'blue'));
1242
1243
  }
@@ -1,167 +1,167 @@
1
- /**
2
- * Codex Freshness Operationalization — CP-12
3
- *
4
- * Release gates, recurring probes, propagation checklists,
5
- * and staleness blocking for Codex surfaces.
6
- */
7
-
8
- const { version } = require('../../package.json');
9
-
10
- /**
11
- * P0 sources that must be fresh before any Codex release claim.
12
- * Each source has a staleness threshold in days.
13
- */
14
- const P0_SOURCES = [
15
- {
16
- key: 'codex-cli-docs',
17
- label: 'Codex CLI Official Docs',
18
- url: 'https://docs.codex.ai',
19
- stalenessThresholdDays: 30,
20
- verifiedAt: null, // Set during release gate check
21
- },
22
- {
23
- key: 'codex-config-reference',
24
- label: 'Codex Config Reference',
25
- url: 'https://docs.codex.ai/config',
26
- stalenessThresholdDays: 30,
27
- verifiedAt: null,
28
- },
29
- {
30
- key: 'codex-github-action',
31
- label: 'Codex GitHub Action',
32
- url: 'https://github.com/openai/codex-action',
33
- stalenessThresholdDays: 30,
34
- verifiedAt: null,
35
- },
36
- {
37
- key: 'codex-changelog',
38
- label: 'Codex CLI Changelog',
39
- url: 'https://github.com/openai/codex-cli/releases',
40
- stalenessThresholdDays: 14,
41
- verifiedAt: null,
42
- },
43
- ];
44
-
45
- /**
46
- * Propagation checklist: when a Codex source changes, these must update.
47
- */
48
- const PROPAGATION_CHECKLIST = [
49
- {
50
- trigger: 'Codex CLI release with config changes',
51
- targets: [
52
- 'src/codex/techniques.js — update LEGACY_CONFIG_PATTERNS if keys renamed/removed',
53
- 'src/codex/config-parser.js — update validation rules',
54
- 'src/codex/governance.js — update caveats if behavior changes',
55
- 'test/codex-check-matrix.js — update check expectations',
56
- ],
57
- },
58
- {
59
- trigger: 'New Codex hook event type added',
60
- targets: [
61
- 'src/codex/techniques.js — add to SUPPORTED_HOOK_EVENTS',
62
- 'src/codex/governance.js — add to CODEX_HOOK_REGISTRY',
63
- 'src/codex/setup.js — update hooks starter template',
64
- ],
65
- },
66
- {
67
- trigger: 'New Codex MCP transport or field',
68
- targets: [
69
- 'src/codex/mcp-packs.js — update pack TOML projections',
70
- 'src/codex/techniques.js — update MCP checks',
71
- ],
72
- },
73
- {
74
- trigger: 'Codex domain pack definitions change',
75
- targets: [
76
- 'src/codex/domain-packs.js — update pack registry',
77
- 'src/codex/governance.js — governance export picks up changes',
78
- ],
79
- },
80
- {
81
- trigger: 'New check category added',
82
- targets: [
83
- 'src/codex/techniques.js — add check implementations',
84
- 'test/codex-check-matrix.js — add pass/fail scenarios',
85
- 'test/codex-golden-matrix.js — update golden scores',
86
- ],
87
- },
88
- ];
89
-
90
- /**
91
- * Release gate: check if all P0 sources are within staleness threshold.
92
- * Returns { ready, stale, fresh } arrays.
93
- */
94
- function checkReleaseGate(sourceVerifications = {}) {
95
- const now = new Date();
96
- const results = P0_SOURCES.map(source => {
97
- const verifiedAt = sourceVerifications[source.key]
98
- ? new Date(sourceVerifications[source.key])
99
- : source.verifiedAt ? new Date(source.verifiedAt) : null;
100
-
101
- if (!verifiedAt) {
102
- return { ...source, status: 'unverified', daysStale: null };
103
- }
104
-
105
- const daysSince = Math.floor((now - verifiedAt) / (1000 * 60 * 60 * 24));
106
- const isStale = daysSince > source.stalenessThresholdDays;
107
-
108
- return {
109
- ...source,
110
- verifiedAt: verifiedAt.toISOString(),
111
- daysStale: daysSince,
112
- status: isStale ? 'stale' : 'fresh',
113
- };
114
- });
115
-
116
- return {
117
- ready: results.every(r => r.status === 'fresh'),
118
- stale: results.filter(r => r.status === 'stale' || r.status === 'unverified'),
119
- fresh: results.filter(r => r.status === 'fresh'),
120
- results,
121
- };
122
- }
123
-
124
- /**
125
- * Format the release gate results for display.
126
- */
127
- function formatReleaseGate(gateResult) {
128
- const lines = [
129
- `Codex Freshness Gate (nerviq v${version})`,
130
- '═══════════════════════════════════════',
131
- '',
132
- `Status: ${gateResult.ready ? 'READY' : 'BLOCKED'}`,
133
- `Fresh: ${gateResult.fresh.length}/${gateResult.results.length}`,
134
- '',
135
- ];
136
-
137
- for (const result of gateResult.results) {
138
- const icon = result.status === 'fresh' ? '✓' : result.status === 'stale' ? '✗' : '?';
139
- const age = result.daysStale !== null ? ` (${result.daysStale}d ago)` : ' (unverified)';
140
- lines.push(` ${icon} ${result.label}${age} — threshold: ${result.stalenessThresholdDays}d`);
141
- }
142
-
143
- if (!gateResult.ready) {
144
- lines.push('');
145
- lines.push('Action required: verify stale/unverified sources before claiming release freshness.');
146
- }
147
-
148
- return lines.join('\n');
149
- }
150
-
151
- /**
152
- * Get the propagation checklist for a given trigger.
153
- */
154
- function getPropagationTargets(triggerKeyword) {
155
- const keyword = triggerKeyword.toLowerCase();
156
- return PROPAGATION_CHECKLIST.filter(item =>
157
- item.trigger.toLowerCase().includes(keyword)
158
- );
159
- }
160
-
161
- module.exports = {
162
- P0_SOURCES,
163
- PROPAGATION_CHECKLIST,
164
- checkReleaseGate,
165
- formatReleaseGate,
166
- getPropagationTargets,
167
- };
1
+ /**
2
+ * Codex Freshness Operationalization — CP-12
3
+ *
4
+ * Release gates, recurring probes, propagation checklists,
5
+ * and staleness blocking for Codex surfaces.
6
+ */
7
+
8
+ const { version } = require('../../package.json');
9
+
10
+ /**
11
+ * P0 sources that must be fresh before any Codex release claim.
12
+ * Each source has a staleness threshold in days.
13
+ */
14
+ const P0_SOURCES = [
15
+ {
16
+ key: 'codex-cli-docs',
17
+ label: 'Codex CLI Official Docs',
18
+ url: 'https://developers.openai.com/codex/cli',
19
+ stalenessThresholdDays: 30,
20
+ verifiedAt: '2026-04-07',
21
+ },
22
+ {
23
+ key: 'codex-config-reference',
24
+ label: 'Codex Config Reference',
25
+ url: 'https://developers.openai.com/codex/config-reference',
26
+ stalenessThresholdDays: 30,
27
+ verifiedAt: '2026-04-07',
28
+ },
29
+ {
30
+ key: 'codex-github-action',
31
+ label: 'Codex GitHub Action',
32
+ url: 'https://github.com/openai/codex-action',
33
+ stalenessThresholdDays: 30,
34
+ verifiedAt: '2026-04-07',
35
+ },
36
+ {
37
+ key: 'codex-changelog',
38
+ label: 'Codex CLI Changelog',
39
+ url: 'https://github.com/openai/codex/releases',
40
+ stalenessThresholdDays: 14,
41
+ verifiedAt: '2026-04-07',
42
+ },
43
+ ];
44
+
45
+ /**
46
+ * Propagation checklist: when a Codex source changes, these must update.
47
+ */
48
+ const PROPAGATION_CHECKLIST = [
49
+ {
50
+ trigger: 'Codex CLI release with config changes',
51
+ targets: [
52
+ 'src/codex/techniques.js — update LEGACY_CONFIG_PATTERNS if keys renamed/removed',
53
+ 'src/codex/config-parser.js — update validation rules',
54
+ 'src/codex/governance.js — update caveats if behavior changes',
55
+ 'test/codex-check-matrix.js — update check expectations',
56
+ ],
57
+ },
58
+ {
59
+ trigger: 'New Codex hook event type added',
60
+ targets: [
61
+ 'src/codex/techniques.js — add to SUPPORTED_HOOK_EVENTS',
62
+ 'src/codex/governance.js — add to CODEX_HOOK_REGISTRY',
63
+ 'src/codex/setup.js — update hooks starter template',
64
+ ],
65
+ },
66
+ {
67
+ trigger: 'New Codex MCP transport or field',
68
+ targets: [
69
+ 'src/codex/mcp-packs.js — update pack TOML projections',
70
+ 'src/codex/techniques.js — update MCP checks',
71
+ ],
72
+ },
73
+ {
74
+ trigger: 'Codex domain pack definitions change',
75
+ targets: [
76
+ 'src/codex/domain-packs.js — update pack registry',
77
+ 'src/codex/governance.js — governance export picks up changes',
78
+ ],
79
+ },
80
+ {
81
+ trigger: 'New check category added',
82
+ targets: [
83
+ 'src/codex/techniques.js — add check implementations',
84
+ 'test/codex-check-matrix.js — add pass/fail scenarios',
85
+ 'test/codex-golden-matrix.js — update golden scores',
86
+ ],
87
+ },
88
+ ];
89
+
90
+ /**
91
+ * Release gate: check if all P0 sources are within staleness threshold.
92
+ * Returns { ready, stale, fresh } arrays.
93
+ */
94
+ function checkReleaseGate(sourceVerifications = {}) {
95
+ const now = new Date();
96
+ const results = P0_SOURCES.map(source => {
97
+ const verifiedAt = sourceVerifications[source.key]
98
+ ? new Date(sourceVerifications[source.key])
99
+ : source.verifiedAt ? new Date(source.verifiedAt) : null;
100
+
101
+ if (!verifiedAt) {
102
+ return { ...source, status: 'unverified', daysStale: null };
103
+ }
104
+
105
+ const daysSince = Math.floor((now - verifiedAt) / (1000 * 60 * 60 * 24));
106
+ const isStale = daysSince > source.stalenessThresholdDays;
107
+
108
+ return {
109
+ ...source,
110
+ verifiedAt: verifiedAt.toISOString(),
111
+ daysStale: daysSince,
112
+ status: isStale ? 'stale' : 'fresh',
113
+ };
114
+ });
115
+
116
+ return {
117
+ ready: results.every(r => r.status === 'fresh'),
118
+ stale: results.filter(r => r.status === 'stale' || r.status === 'unverified'),
119
+ fresh: results.filter(r => r.status === 'fresh'),
120
+ results,
121
+ };
122
+ }
123
+
124
+ /**
125
+ * Format the release gate results for display.
126
+ */
127
+ function formatReleaseGate(gateResult) {
128
+ const lines = [
129
+ `Codex Freshness Gate (nerviq v${version})`,
130
+ '═══════════════════════════════════════',
131
+ '',
132
+ `Status: ${gateResult.ready ? 'READY' : 'BLOCKED'}`,
133
+ `Fresh: ${gateResult.fresh.length}/${gateResult.results.length}`,
134
+ '',
135
+ ];
136
+
137
+ for (const result of gateResult.results) {
138
+ const icon = result.status === 'fresh' ? '✓' : result.status === 'stale' ? '✗' : '?';
139
+ const age = result.daysStale !== null ? ` (${result.daysStale}d ago)` : ' (unverified)';
140
+ lines.push(` ${icon} ${result.label}${age} — threshold: ${result.stalenessThresholdDays}d`);
141
+ }
142
+
143
+ if (!gateResult.ready) {
144
+ lines.push('');
145
+ lines.push('Action required: verify stale/unverified sources before claiming release freshness.');
146
+ }
147
+
148
+ return lines.join('\n');
149
+ }
150
+
151
+ /**
152
+ * Get the propagation checklist for a given trigger.
153
+ */
154
+ function getPropagationTargets(triggerKeyword) {
155
+ const keyword = triggerKeyword.toLowerCase();
156
+ return PROPAGATION_CHECKLIST.filter(item =>
157
+ item.trigger.toLowerCase().includes(keyword)
158
+ );
159
+ }
160
+
161
+ module.exports = {
162
+ P0_SOURCES,
163
+ PROPAGATION_CHECKLIST,
164
+ checkReleaseGate,
165
+ formatReleaseGate,
166
+ getPropagationTargets,
167
+ };