dsh-plugin-wiki-tools 0.10.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.
package/lib/lint.js CHANGED
@@ -9,6 +9,7 @@
9
9
  import { mkdir, readFile, writeFile } from 'node:fs/promises'
10
10
  import { join } from 'node:path'
11
11
  import {
12
+ PAGE_STATUSES,
12
13
  buildAliasMap,
13
14
  collectMarkdown,
14
15
  isMachineryPage,
@@ -37,6 +38,7 @@ export async function lintVault(root) {
37
38
  const inbound = checkDeadLinks(pages, add)
38
39
  checkOrphans(pages, inbound, indexed, add)
39
40
  checkFrontmatterGaps(pages, add)
41
+ checkStatusVocabulary(pages, add)
40
42
  checkEmptySections(pages, add)
41
43
  await checkHotCacheStaleness(root, pages, add)
42
44
 
@@ -172,6 +174,25 @@ function checkFrontmatterGaps(pages, add) {
172
174
  }
173
175
  }
174
176
 
177
+ /**
178
+ * Status values outside the lifecycle vocabulary (seed/developing/mature/
179
+ * evergreen). A stray value silently breaks status-based queries and
180
+ * promotion flows, so it is flagged even though links stay intact.
181
+ * @param {Pages} pages - collected pages.
182
+ * @param {Add} add - issue recorder.
183
+ */
184
+ function checkStatusVocabulary(pages, add) {
185
+ for (const page of pages) {
186
+ if (isMachineryPage(page.name)) continue
187
+ const status = page.fields?.status
188
+ if (typeof status === 'string' && !PAGE_STATUSES.includes(status)) {
189
+ add('status-vocabulary', 'warn', page.name,
190
+ `status "${status}" is outside the lifecycle vocabulary (${PAGE_STATUSES.join('/')})`,
191
+ `Set status to one of ${PAGE_STATUSES.join('/')}`)
192
+ }
193
+ }
194
+ }
195
+
175
196
  /**
176
197
  * Headings with no content before the next heading.
177
198
  * @param {Pages} pages - collected pages.
package/lib/vault.js CHANGED
@@ -32,6 +32,9 @@ export const TYPE_FOLDERS = {
32
32
  meta: 'wiki/meta',
33
33
  }
34
34
 
35
+ /** Lifecycle status vocabulary; writePage rejects anything else and lint flags it. */
36
+ export const PAGE_STATUSES = ['seed', 'developing', 'mature', 'evergreen']
37
+
35
38
  /** Master-index section headings follow the mapped folder basename, computed per vault. */
36
39
 
37
40
  /**
@@ -284,6 +287,9 @@ export class Vault {
284
287
  const existing = await this.readPage(path)
285
288
  await this.assertUniqueFilename(cleanTitle, path)
286
289
  validateExtraFrontmatter(extraFrontmatter)
290
+ if (status !== undefined && !PAGE_STATUSES.includes(status)) {
291
+ throw new Error(`wiki-tools: status must be one of ${PAGE_STATUSES.join('/')} (got ${JSON.stringify(status)})`)
292
+ }
287
293
  const date = today()
288
294
  const fields = {
289
295
  ...(existing?.fields ?? {}),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-wiki-tools",
3
- "version": "0.10.1",
3
+ "version": "0.11.0",
4
4
  "description": "Native DeepSeek Harness tools for an Obsidian wiki vault: wiki_query, wiki_write, and wiki_lint implement the mechanical core (path routing, delta tracking, index/log bookkeeping, health checks) of the wiki skill suite.",
5
5
  "license": "MIT",
6
6
  "type": "module",