@iservu-inc/adf-cli 0.9.1 → 0.11.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.
@@ -186,7 +186,20 @@ async function getLearningConfig(projectPath) {
186
186
  applyLearnedFilters: true,
187
187
  shareAnonymousPatterns: false,
188
188
  minSessionsForPattern: 3,
189
- minConfidenceForAutoFilter: 75
189
+ minConfidenceForAutoFilter: 75,
190
+ decay: {
191
+ enabled: true,
192
+ baseDecayRate: 0.15, // 15% per month
193
+ minConfidenceThreshold: 50, // Don't filter if confidence < 50
194
+ removeBelow: 40, // Auto-remove if < 40
195
+ decayCheckInterval: 'weekly', // Run decay calc weekly
196
+ renewalBoost: 10, // +10 points on renewal
197
+ protectApproved: true, // Approved patterns decay at 0.5x rate
198
+ highConfidenceThreshold: 90, // Decay slower if >= 90
199
+ lowConfidenceThreshold: 75, // Decay faster if < 75
200
+ maxRenewalsPerDay: 1, // Limit renewal inflation
201
+ maxInactiveMonths: 6 // Auto-remove if inactive 6+ months
202
+ }
190
203
  };
191
204
  }
192
205
 
@@ -199,6 +212,39 @@ async function saveLearningConfig(projectPath, config) {
199
212
  await writeLearningData(projectPath, 'config.json', config);
200
213
  }
201
214
 
215
+ /**
216
+ * Get decay configuration
217
+ * @param {string} projectPath - Project root path
218
+ * @returns {Promise<Object>} Decay config from learning config
219
+ */
220
+ async function getDecayConfig(projectPath) {
221
+ const config = await getLearningConfig(projectPath);
222
+ return config.decay || {
223
+ enabled: true,
224
+ baseDecayRate: 0.15,
225
+ minConfidenceThreshold: 50,
226
+ removeBelow: 40,
227
+ decayCheckInterval: 'weekly',
228
+ renewalBoost: 10,
229
+ protectApproved: true,
230
+ highConfidenceThreshold: 90,
231
+ lowConfidenceThreshold: 75,
232
+ maxRenewalsPerDay: 1,
233
+ maxInactiveMonths: 6
234
+ };
235
+ }
236
+
237
+ /**
238
+ * Save decay configuration
239
+ * @param {string} projectPath - Project root path
240
+ * @param {Object} decayConfig - Decay configuration
241
+ */
242
+ async function saveDecayConfig(projectPath, decayConfig) {
243
+ const config = await getLearningConfig(projectPath);
244
+ config.decay = decayConfig;
245
+ await saveLearningConfig(projectPath, config);
246
+ }
247
+
202
248
  /**
203
249
  * Get learning statistics
204
250
  * @param {string} projectPath - Project root path
@@ -289,6 +335,8 @@ module.exports = {
289
335
  saveLearnedRules,
290
336
  getLearningConfig,
291
337
  saveLearningConfig,
338
+ getDecayConfig,
339
+ saveDecayConfig,
292
340
  getLearningStats,
293
341
  updateLearningStats,
294
342
  clearLearningData,
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Pre-Publish Documentation Check
5
+ *
6
+ * This script runs before npm publish to remind about documentation updates.
7
+ * It's a safety check to prevent publishing without proper documentation.
8
+ */
9
+
10
+ const chalk = require('chalk');
11
+ const fs = require('fs');
12
+ const path = require('path');
13
+
14
+ console.log(chalk.bold.yellow('\n⚠️ PRE-PUBLISH DOCUMENTATION CHECK\n'));
15
+
16
+ // Check if CHANGELOG.md was recently updated
17
+ const changelogPath = path.join(__dirname, '../../CHANGELOG.md');
18
+ const readmePath = path.join(__dirname, '../../README.md');
19
+ const packagePath = path.join(__dirname, '../../package.json');
20
+
21
+ try {
22
+ const packageJson = require(packagePath);
23
+ const currentVersion = packageJson.version;
24
+
25
+ console.log(chalk.cyan(`📦 Publishing version: ${currentVersion}\n`));
26
+
27
+ // Read CHANGELOG.md and check for current version
28
+ const changelog = fs.readFileSync(changelogPath, 'utf8');
29
+ const hasVersionInChangelog = changelog.includes(`## [${currentVersion}]`);
30
+
31
+ // Read README.md and check for current version
32
+ const readme = fs.readFileSync(readmePath, 'utf8');
33
+ const hasVersionInReadme = readme.includes(`v${currentVersion}`);
34
+
35
+ console.log(chalk.bold('Documentation Status:\n'));
36
+
37
+ if (hasVersionInChangelog) {
38
+ console.log(chalk.green('✓ CHANGELOG.md includes version ' + currentVersion));
39
+ } else {
40
+ console.log(chalk.red('✗ CHANGELOG.md missing version ' + currentVersion));
41
+ }
42
+
43
+ if (hasVersionInReadme) {
44
+ console.log(chalk.green('✓ README.md mentions version ' + currentVersion));
45
+ } else {
46
+ console.log(chalk.yellow('⚠ README.md may not mention version ' + currentVersion));
47
+ }
48
+
49
+ console.log('');
50
+
51
+ // Show documentation checklist reminder
52
+ if (!hasVersionInChangelog || !hasVersionInReadme) {
53
+ console.log(chalk.bold.red('❌ DOCUMENTATION INCOMPLETE!\n'));
54
+ console.log(chalk.yellow('Before publishing, ensure you have updated:\n'));
55
+ console.log(' 1. CHANGELOG.md - Add version entry with comprehensive notes');
56
+ console.log(' 2. README.md - Update version history section');
57
+ console.log(' 3. SESSION-STATUS.md - Update latest version and status');
58
+ console.log('');
59
+ console.log(chalk.cyan('📋 See: .project/docs/DOCUMENTATION-UPDATE-CHECKLIST.md\n'));
60
+
61
+ // Don't block publish, just warn
62
+ console.log(chalk.yellow('⚠️ Publishing anyway, but please update documentation ASAP!\n'));
63
+ } else {
64
+ console.log(chalk.bold.green('✅ Documentation appears up-to-date!\n'));
65
+ }
66
+
67
+ // Always show the checklist reference
68
+ console.log(chalk.dim('Full checklist: .project/docs/DOCUMENTATION-UPDATE-CHECKLIST.md\n'));
69
+
70
+ } catch (error) {
71
+ console.log(chalk.yellow('⚠️ Could not verify documentation status'));
72
+ console.log(chalk.dim('Error:', error.message));
73
+ console.log(chalk.yellow('\n📋 Please manually verify documentation is updated.\n'));
74
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iservu-inc/adf-cli",
3
- "version": "0.9.1",
3
+ "version": "0.11.0",
4
4
  "description": "CLI tool for AgentDevFramework - AI-assisted development framework with multi-provider AI support",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -9,7 +9,8 @@
9
9
  "scripts": {
10
10
  "test": "jest --coverage",
11
11
  "test:watch": "jest --watch",
12
- "postinstall": "node lib/utils/postinstall.js"
12
+ "postinstall": "node lib/utils/postinstall.js",
13
+ "prepublishOnly": "node lib/utils/pre-publish-check.js"
13
14
  },
14
15
  "keywords": [
15
16
  "cli",