docguard-cli 0.17.0 → 0.17.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.
@@ -200,23 +200,31 @@ export function diffEntities(dir, config = {}) {
200
200
  };
201
201
  }
202
202
 
203
- // v0.16-P4: common system environment variables that get backticked in
204
- // prose ("the venv `PATH`", "your `HOME` directory") but are NEVER user-set
205
- // application env vars. Excluding them from the docVars set kills the
206
- // false-positive class reported by the Python user where `PATH` was flagged
207
- // as "documented-but-not-implemented".
203
+ // v0.16-P4 (revised in v0.17.1): conservative denylist of system env vars
204
+ // that appear in prose ("the venv `PATH`") but are never user-set app env
205
+ // vars. v0.17.1-B7: trimmed to TRULY-system-only after wu feedback
206
+ // NODE_ENV / CI / GITHUB_* are legitimately app env vars when read via
207
+ // process.env. Including them caused diff to falsely flag `NODE_ENV` as
208
+ // "in code but not docs" even when ENVIRONMENT.md documented it.
208
209
  //
209
- // Conservative list only the names that are unambiguously OS/shell vars.
210
- // Application names like `DATABASE_URL`, `API_KEY` etc. still count.
210
+ // Rule of thumb for inclusion: would a sane Node/Python/Go app ever
211
+ // `process.env.X` this name and treat it as app config? If yes → NOT a
212
+ // system var. PATH/HOME/SHELL/TERM never satisfy that bar.
211
213
  const SYSTEM_ENV_VARS = new Set([
212
- 'PATH', 'HOME', 'USER', 'USERNAME', 'SHELL', 'PWD', 'OLDPWD', 'TMPDIR', 'TEMP', 'TMP',
214
+ // POSIX shell / OS
215
+ 'PATH', 'HOME', 'USER', 'USERNAME', 'SHELL', 'PWD', 'OLDPWD',
216
+ 'TMPDIR', 'TEMP', 'TMP',
217
+ // Locale
213
218
  'LANG', 'LC_ALL', 'LC_CTYPE', 'LC_MESSAGES', 'TZ',
219
+ // Terminal / interactive
214
220
  'EDITOR', 'VISUAL', 'PAGER', 'TERM', 'COLORTERM',
221
+ // SSH / Display
215
222
  'DISPLAY', 'SSH_AUTH_SOCK', 'SSH_CONNECTION', 'SSH_TTY',
223
+ // XDG base directory spec
216
224
  'XDG_CONFIG_HOME', 'XDG_DATA_HOME', 'XDG_CACHE_HOME', 'XDG_RUNTIME_DIR',
217
- // CI/build platform vars (set by the platform, not by the app)
218
- 'CI', 'GITHUB_TOKEN', 'GITHUB_ACTIONS', 'GITHUB_REF', 'GITHUB_SHA',
219
- 'NODE_ENV', // could be app-set but more often platform-set; conservative skip
225
+ // NOTE: NODE_ENV / CI / GITHUB_* used to be here. Removed in v0.17.1
226
+ // because apps DO read them as app config (e.g. NODE_ENV=production
227
+ // gates branching in nearly every Node.js app).
220
228
  ]);
221
229
 
222
230
  export function diffEnvVars(dir, config = {}) {
@@ -66,6 +66,40 @@ function _checkVersionPin(config) {
66
66
  return null;
67
67
  }
68
68
 
69
+ /**
70
+ * v0.17.1: small in-code highlight reel surfaced when a project's pinned
71
+ * version is behind the running CLI. The biggest recurring user pattern is
72
+ * "I asked for feature X" → "X shipped two releases ago". This eliminates
73
+ * the need to grep the CHANGELOG. Keep entries short and command-oriented.
74
+ *
75
+ * Add to this table on every release. Format: [introducedIn, oneLineFeature].
76
+ */
77
+ const _RELEASE_HIGHLIGHTS = [
78
+ ['0.13.0', '`docguard sync --since <ref>` — surgical refresh of code-truth doc sections'],
79
+ ['0.13.1', '`docguard impact --since <ref>` — changed files → affected canonical docs map'],
80
+ ['0.13.1', '`Cross-Reference` validator + "did you mean #X?" hints for broken anchors'],
81
+ ['0.14.1', '`docguard fix --write` auto-fixes high-confidence anchor matches'],
82
+ ['0.15.0', '`docguard guard --timings` — per-validator wall-time profile'],
83
+ ['0.15.0', '`.docguard.json` JSON Schema for VS Code autocomplete'],
84
+ ['0.16.0', '`docguard explain "<warning>"` — paste any warning, get the validator help'],
85
+ ['0.16.0', '`docguard guard --quiet` — suppress banner in hooks/CI'],
86
+ ['0.16.0', '`docguard init --no-spec-kit` — opt out of Spec Kit scaffolding'],
87
+ ['0.16.0', 'Language-aware test patterns (Python `test_*.py`, Rust `tests/*.rs`, Go `*_test.go`, ...)'],
88
+ ['0.17.0', '`docguard memory --diff` — drill into accuracy mismatches (which claim ≠ code)'],
89
+ ['0.17.0', '`docguard guard --pin` — record running CLI version into .docguard.json'],
90
+ ];
91
+
92
+ function _whatsNewSince(pinnedVersion) {
93
+ if (!pinnedVersion) return [];
94
+ const out = [];
95
+ for (const [introducedIn, feature] of _RELEASE_HIGHLIGHTS) {
96
+ if (_semverCompare(introducedIn, pinnedVersion) > 0) {
97
+ out.push(`v${introducedIn}: ${feature}`);
98
+ }
99
+ }
100
+ return out;
101
+ }
102
+
69
103
  /**
70
104
  * v0.17-P1: update the docguardVersion field in .docguard.json after a
71
105
  * successful guard run. Triggered by `docguard guard --pin`. Idempotent.
@@ -445,6 +479,18 @@ export function runGuard(projectDir, config, flags) {
445
479
  const pinHint = _checkVersionPin(config);
446
480
  if (pinHint) {
447
481
  console.log(`\n ${c.yellow}📌 ${pinHint}${c.reset}`);
482
+ // v0.17.1: surface features added since the pinned version so users
483
+ // who pinned at v0.12 and just upgraded actually KNOW about sync,
484
+ // impact, explain, memory --diff, etc. The biggest user complaint
485
+ // pattern is "I asked for X but X already shipped two releases ago."
486
+ const whatsNew = _whatsNewSince(config.docguardVersion);
487
+ if (whatsNew.length > 0) {
488
+ console.log(` ${c.dim}New since v${config.docguardVersion}:${c.reset}`);
489
+ for (const item of whatsNew.slice(0, 5)) {
490
+ console.log(` ${c.dim}• ${item}${c.reset}`);
491
+ }
492
+ if (whatsNew.length > 5) console.log(` ${c.dim}... ${whatsNew.length - 5} more in CHANGELOG.md${c.reset}`);
493
+ }
448
494
  }
449
495
 
450
496
  // K-6 / S-2: sweep-needed nudge. Aggregates freshness warnings — if 2+
@@ -45,16 +45,18 @@ export function validateEnvironment(projectDir, config) {
45
45
  // tokens like `VITE_` (the convention prefix) from being treated as a real
46
46
  // variable name.
47
47
  const varRe = /`([A-Z][A-Z0-9_]*[A-Z0-9])`/g;
48
- // v0.16-P4: skip backticked SYSTEM env vars (PATH, HOME, USER, etc.).
49
- // They appear in ENVIRONMENT.md prose ("the venv `PATH`") but aren't
50
- // user-set application vars. Mirrors the same skip in diff.mjs.
48
+ // v0.16-P4 (revised in v0.17.1-B7): skip backticked SYSTEM env vars
49
+ // (PATH, HOME, USER, etc.) that appear in ENVIRONMENT.md prose. Trimmed
50
+ // to TRULY-system-only after wu feedback NODE_ENV / CI / GITHUB_* were
51
+ // causing asymmetric flagging between diff and this validator. Apps
52
+ // legitimately treat NODE_ENV as app config; keep the list to vars that
53
+ // no sane application would read as runtime config.
51
54
  const SYSTEM = new Set([
52
55
  'PATH','HOME','USER','USERNAME','SHELL','PWD','OLDPWD','TMPDIR','TEMP','TMP',
53
56
  'LANG','LC_ALL','LC_CTYPE','LC_MESSAGES','TZ',
54
57
  'EDITOR','VISUAL','PAGER','TERM','COLORTERM',
55
58
  'DISPLAY','SSH_AUTH_SOCK','SSH_CONNECTION','SSH_TTY',
56
59
  'XDG_CONFIG_HOME','XDG_DATA_HOME','XDG_CACHE_HOME','XDG_RUNTIME_DIR',
57
- 'CI','GITHUB_TOKEN','GITHUB_ACTIONS','GITHUB_REF','GITHUB_SHA','NODE_ENV',
58
60
  ]);
59
61
  let m;
60
62
  while ((m = varRe.exec(content)) !== null) {
@@ -3,7 +3,7 @@ schema_version: "1.0"
3
3
  extension:
4
4
  id: "docguard"
5
5
  name: "DocGuard — CDD Enforcement"
6
- version: "0.17.0"
6
+ version: "0.17.1"
7
7
  description: "Canonical-Driven Development enforcement as a true spec-kit extension. LLM-first design with 19 automated validators, 4 AI behavior skills, spec-kit skill chaining, and workflow hooks. Zero NPM runtime dependencies."
8
8
  author: "Ricardo Accioly"
9
9
  repository: "https://github.com/raccioly/docguard"
@@ -6,10 +6,10 @@ description: AI-driven documentation repair with structured research workflow, t
6
6
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
7
7
  metadata:
8
8
  author: docguard
9
- version: 0.17.0
9
+ version: 0.17.1
10
10
  source: extensions/spec-kit-docguard/skills/docguard-fix
11
11
  ---
12
- <!-- docguard:version: 0.17.0 -->
12
+ <!-- docguard:version: 0.17.1 -->
13
13
 
14
14
  # DocGuard Fix Skill
15
15
 
@@ -7,10 +7,10 @@ description: Run DocGuard guard validation against Canonical-Driven Development
7
7
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
8
8
  metadata:
9
9
  author: docguard
10
- version: 0.17.0
10
+ version: 0.17.1
11
11
  source: extensions/spec-kit-docguard/skills/docguard-guard
12
12
  ---
13
- <!-- docguard:version: 0.17.0 -->
13
+ <!-- docguard:version: 0.17.1 -->
14
14
 
15
15
  # DocGuard Guard Skill
16
16
 
@@ -6,10 +6,10 @@ description: Cross-document consistency analysis and quality assessment. Perform
6
6
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
7
7
  metadata:
8
8
  author: docguard
9
- version: 0.17.0
9
+ version: 0.17.1
10
10
  source: extensions/spec-kit-docguard/skills/docguard-review
11
11
  ---
12
- <!-- docguard:version: 0.17.0 -->
12
+ <!-- docguard:version: 0.17.1 -->
13
13
 
14
14
  # DocGuard Review Skill
15
15
 
@@ -6,10 +6,10 @@ description: CDD maturity assessment with category-aware improvement roadmap. Ru
6
6
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
7
7
  metadata:
8
8
  author: docguard
9
- version: 0.17.0
9
+ version: 0.17.1
10
10
  source: extensions/spec-kit-docguard/skills/docguard-score
11
11
  ---
12
- <!-- docguard:version: 0.17.0 -->
12
+ <!-- docguard:version: 0.17.1 -->
13
13
 
14
14
  # DocGuard Score Skill
15
15
 
@@ -4,7 +4,7 @@ description: Keep canonical documentation ALWAYS UP TO DATE. Refreshes code-trut
4
4
  compatibility: Requires DocGuard CLI installed (npm i -g docguard-cli or npx docguard-cli)
5
5
  metadata:
6
6
  author: docguard
7
- version: 0.17.0
7
+ version: 0.17.1
8
8
  source: extensions/spec-kit-docguard/skills/docguard-sync
9
9
  ---
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docguard-cli",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "The enforcement tool for Canonical-Driven Development (CDD). Audit, generate, and guard your project documentation.",
5
5
  "type": "module",
6
6
  "bin": {