sdtk-wiki-kit 0.1.3 → 0.1.4
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 +23 -18
- package/package.json +1 -1
- package/src/commands/enrich.js +51 -0
- package/src/commands/help.js +16 -11
- package/src/commands/lint.js +1 -1
- package/src/commands/operations.js +5 -4
- package/src/commands/search.js +5 -4
- package/src/commands/wiki.js +7 -6
- package/src/index.js +4 -0
- package/src/lib/wiki-compile.js +776 -28
- package/src/lib/wiki-enrich.js +264 -0
- package/src/lib/wiki-extract.js +12 -12
- package/src/lib/wiki-lint.js +90 -29
- package/src/lib/wiki-paths.js +55 -0
- package/src/lib/wiki-search.js +17 -10
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`sdtk-wiki-kit` is the standalone SDTK-WIKI Foundation/Beta toolkit package for
|
|
4
4
|
project-local wiki, document graph, provenance, lint/gap analysis, local source
|
|
5
|
-
intake, grounded Ask, and report-first
|
|
5
|
+
intake, grounded Ask, and report-first local wiki maintenance workflows.
|
|
6
6
|
|
|
7
7
|
SDTK-WIKI is the canonical home for new SDTK wiki work. The older
|
|
8
8
|
`sdtk-spec atlas` commands remain a compatibility path for free graph/viewer
|
|
@@ -28,7 +28,7 @@ Implemented in the Foundation/Beta package:
|
|
|
28
28
|
| Capability | Command |
|
|
29
29
|
|---|---|
|
|
30
30
|
| Initialize SDTK-WIKI workspace | `sdtk-wiki init` |
|
|
31
|
-
| Build a
|
|
31
|
+
| Build a local wiki without timestamp variables | `sdtk-wiki ingest`, `sdtk-wiki compile --mode safe --apply`, `sdtk-wiki query` |
|
|
32
32
|
| Build graph, viewer, generated pages, and provenance | `sdtk-wiki atlas build` |
|
|
33
33
|
| Open local viewer | `sdtk-wiki atlas open` |
|
|
34
34
|
| Watch markdown sources and rebuild | `sdtk-wiki atlas watch` |
|
|
@@ -42,8 +42,8 @@ Implemented in the Foundation/Beta package:
|
|
|
42
42
|
| Generate semantic extraction dry-run report | `sdtk-wiki wiki extract --dry-run` |
|
|
43
43
|
| Generate compile dry-run preview and JSON sidecar | `sdtk-wiki wiki compile --dry-run` |
|
|
44
44
|
| Apply an approved compile JSON sidecar | `sdtk-wiki wiki compile --apply --yes` |
|
|
45
|
-
| Search generated
|
|
46
|
-
| Query generated
|
|
45
|
+
| Search generated local wiki pages locally | `sdtk-wiki search` |
|
|
46
|
+
| Query generated local wiki pages locally | `sdtk-wiki query` |
|
|
47
47
|
| Ask grounded questions over built graph | `sdtk-wiki ask` with `wiki.ask` entitlement/runtime preconditions |
|
|
48
48
|
| Save one redacted query record after successful Ask | `sdtk-wiki ask --save-query` with `wiki.ask` entitlement/runtime preconditions |
|
|
49
49
|
|
|
@@ -60,17 +60,20 @@ Not implemented in the Foundation/Beta runtime:
|
|
|
60
60
|
|
|
61
61
|
| Path | Meaning |
|
|
62
62
|
|---|---|
|
|
63
|
-
|
|
|
63
|
+
| `wiki` | canonical human-facing local wiki output |
|
|
64
|
+
| `.sdtk/wiki` | internal SDTK-WIKI workspace root |
|
|
64
65
|
| `.sdtk/wiki/graph` | graph/viewer output |
|
|
65
66
|
| `.sdtk/wiki/pages` | generated managed wiki pages |
|
|
66
67
|
| `.sdtk/wiki/raw` | metadata-only raw/source registry |
|
|
67
68
|
| `.sdtk/wiki/provenance` | source/build/ingest provenance |
|
|
68
69
|
| `.sdtk/wiki/reports` | lint, prune, discover, and compile preview reports |
|
|
69
|
-
| `.sdtk/wiki/personal-brain` | generated semantic
|
|
70
|
+
| `.sdtk/wiki/personal-brain` | legacy generated semantic pages, readable as fallback only |
|
|
70
71
|
| `.sdtk/wiki/queries` | opt-in redacted Ask query records |
|
|
71
72
|
| `.sdtk/atlas` | legacy Atlas compatibility output, readable only |
|
|
72
73
|
|
|
73
|
-
SDTK-WIKI writes
|
|
74
|
+
SDTK-WIKI writes human-facing generated wiki pages under project-local `wiki/`.
|
|
75
|
+
Internal state, reports, provenance, raw registry, graph, logs, and legacy
|
|
76
|
+
fallback pages stay under project-local `.sdtk/wiki`. It must not auto-delete,
|
|
74
77
|
auto-migrate, or rewrite `.sdtk/atlas`.
|
|
75
78
|
|
|
76
79
|
Existing `sdtk-spec atlas init|build|open|watch|status` commands remain the R1
|
|
@@ -95,9 +98,9 @@ Open the viewer:
|
|
|
95
98
|
sdtk-wiki atlas open --project-path .
|
|
96
99
|
```
|
|
97
100
|
|
|
98
|
-
## Simple
|
|
101
|
+
## Simple Local Wiki Flow
|
|
99
102
|
|
|
100
|
-
Use this when you want the shortest local
|
|
103
|
+
Use this when you want the shortest local wiki path and do not need to
|
|
101
104
|
inspect timestamped JSON files:
|
|
102
105
|
|
|
103
106
|
```powershell
|
|
@@ -115,7 +118,8 @@ Behavior:
|
|
|
115
118
|
- `ingest` runs local semantic extraction and writes a report.
|
|
116
119
|
- `compile --mode safe --apply` creates or refreshes the compile preview/JSON
|
|
117
120
|
sidecar internally, then applies the sidecar contract.
|
|
118
|
-
- `query` is deterministic local search over
|
|
121
|
+
- `query` is deterministic local search over `wiki/`, with legacy
|
|
122
|
+
`.sdtk/wiki/personal-brain` fallback; it
|
|
119
123
|
does not use premium Ask, LLM/RAG, web fetch, or query history.
|
|
120
124
|
- `discover` and `maintain` are report-first and do not apply, delete, archive,
|
|
121
125
|
fetch web sources, or mutate `.sdtk/atlas`.
|
|
@@ -182,7 +186,7 @@ source records and writes the latest
|
|
|
182
186
|
`semantic-extraction-dry-run-*.json` report under `.sdtk/wiki/reports`.
|
|
183
187
|
|
|
184
188
|
This is the beginner-friendly facade for `sdtk-wiki wiki extract --dry-run`.
|
|
185
|
-
It does not mutate source files,
|
|
189
|
+
It does not mutate source files, local wiki pages, raw/provenance state,
|
|
186
190
|
graph outputs, web sources, Ask state, or `.sdtk/atlas`.
|
|
187
191
|
|
|
188
192
|
Supported JSON repository records may be an array or an object containing a
|
|
@@ -312,7 +316,8 @@ are rejected for apply.
|
|
|
312
316
|
Apply behavior:
|
|
313
317
|
|
|
314
318
|
- requires `--apply --yes`
|
|
315
|
-
- writes only under
|
|
319
|
+
- writes only under `wiki/` for new canonical output
|
|
320
|
+
- legacy `.sdtk/wiki/personal-brain` sidecars remain readable for compatibility
|
|
316
321
|
- create-only or same-content no-op
|
|
317
322
|
- no overwrite with different content
|
|
318
323
|
- no delete, archive, rewrite, or reorder
|
|
@@ -325,8 +330,8 @@ Apply behavior:
|
|
|
325
330
|
sdtk-wiki search --project-path <path> "<query>"
|
|
326
331
|
```
|
|
327
332
|
|
|
328
|
-
Searches generated
|
|
329
|
-
`.sdtk/wiki/personal-brain/**/*.md
|
|
333
|
+
Searches generated local wiki Markdown pages under `wiki/**/*.md`, falling
|
|
334
|
+
back to `.sdtk/wiki/personal-brain/**/*.md` for legacy workspaces.
|
|
330
335
|
|
|
331
336
|
Search is deterministic, read-only, and non-premium. It does not require
|
|
332
337
|
`wiki.ask` entitlement, does not call an LLM/RAG runtime, does not write query
|
|
@@ -396,7 +401,7 @@ Preview a compile plan without applying it:
|
|
|
396
401
|
sdtk-wiki wiki compile --plan <local-plan.md-or-json> --project-path . --dry-run
|
|
397
402
|
```
|
|
398
403
|
|
|
399
|
-
Build a
|
|
404
|
+
Build a local wiki from local Markdown sources and search it:
|
|
400
405
|
|
|
401
406
|
```powershell
|
|
402
407
|
sdtk-wiki ingest docs
|
|
@@ -421,13 +426,13 @@ sdtk-wiki ask --project-path . --question "Which docs describe the deployment pa
|
|
|
421
426
|
```
|
|
422
427
|
|
|
423
428
|
This flow requires valid `wiki.ask` entitlement/runtime preconditions. Use
|
|
424
|
-
`sdtk-wiki search` for non-premium local validation of generated
|
|
425
|
-
|
|
429
|
+
`sdtk-wiki search` for non-premium local validation of generated local wiki
|
|
430
|
+
pages.
|
|
426
431
|
|
|
427
432
|
## Foundation/Beta Boundaries
|
|
428
433
|
|
|
429
434
|
This release is local-first and report-first. It is a foundation for a
|
|
430
|
-
|
|
435
|
+
local wiki workflow, not a fully autonomous second brain.
|
|
431
436
|
|
|
432
437
|
Do not claim the Foundation/Beta runtime includes:
|
|
433
438
|
|
package/package.json
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { parseFlags } = require("../lib/args");
|
|
4
|
+
const { ValidationError } = require("../lib/errors");
|
|
5
|
+
const { runWikiGithubEnrichmentReview } = require("../lib/wiki-enrich");
|
|
6
|
+
|
|
7
|
+
const ENRICH_FLAG_DEFS = {
|
|
8
|
+
help: { type: "boolean", alias: "h" },
|
|
9
|
+
"project-path": { type: "string" },
|
|
10
|
+
source: { type: "string" },
|
|
11
|
+
mode: { type: "string" },
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function cmdEnrichHelp() {
|
|
15
|
+
console.log(`SDTK-WIKI Enrich
|
|
16
|
+
|
|
17
|
+
Usage:
|
|
18
|
+
sdtk-wiki enrich --source github --mode review [--project-path <path>]
|
|
19
|
+
|
|
20
|
+
Purpose:
|
|
21
|
+
Write an explicit opt-in GitHub enrichment review report from local wiki evidence.
|
|
22
|
+
|
|
23
|
+
Safety:
|
|
24
|
+
Review mode only in R1.
|
|
25
|
+
No network fetch, page rewrite, source mutation, apply, entitlement change, or .sdtk/atlas mutation.
|
|
26
|
+
Network-backed metadata verification requires a later controller-approved slice.`);
|
|
27
|
+
return 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function cmdEnrich(args) {
|
|
31
|
+
const { flags } = parseFlags(args || [], ENRICH_FLAG_DEFS);
|
|
32
|
+
if (flags.help) return cmdEnrichHelp();
|
|
33
|
+
if (flags.source !== "github") {
|
|
34
|
+
throw new ValidationError("sdtk-wiki enrich requires --source github in R1. No project files were changed.");
|
|
35
|
+
}
|
|
36
|
+
const mode = flags.mode || "review";
|
|
37
|
+
if (mode !== "review") {
|
|
38
|
+
throw new ValidationError("sdtk-wiki enrich supports only --mode review in R1. No project files were changed.");
|
|
39
|
+
}
|
|
40
|
+
const result = runWikiGithubEnrichmentReview({ projectPath: flags["project-path"] });
|
|
41
|
+
console.log(`[wiki] GitHub enrichment review: ${result.markdownPath}`);
|
|
42
|
+
console.log(`[wiki] JSON report: ${result.jsonPath}`);
|
|
43
|
+
console.log(`[wiki] Candidates: ${result.records.length}`);
|
|
44
|
+
console.log("[wiki] Review-only local metadata. No network fetch, page rewrite, source mutation, or .sdtk/atlas mutation was performed.");
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
module.exports = {
|
|
49
|
+
cmdEnrich,
|
|
50
|
+
cmdEnrichHelp,
|
|
51
|
+
};
|
package/src/commands/help.js
CHANGED
|
@@ -12,6 +12,7 @@ Usage:
|
|
|
12
12
|
sdtk-wiki query --help
|
|
13
13
|
sdtk-wiki discover --help
|
|
14
14
|
sdtk-wiki maintain --help
|
|
15
|
+
sdtk-wiki enrich --help
|
|
15
16
|
sdtk-wiki atlas build --help
|
|
16
17
|
sdtk-wiki atlas open --help
|
|
17
18
|
sdtk-wiki atlas watch --help
|
|
@@ -24,7 +25,7 @@ Usage:
|
|
|
24
25
|
sdtk-wiki search --help
|
|
25
26
|
sdtk-wiki lint --help
|
|
26
27
|
|
|
27
|
-
Simple
|
|
28
|
+
Simple local wiki workflow:
|
|
28
29
|
sdtk-wiki init --no-open
|
|
29
30
|
sdtk-wiki ingest <source-root>
|
|
30
31
|
sdtk-wiki compile --mode safe [--apply]
|
|
@@ -36,10 +37,11 @@ Simple personal-brain workflow:
|
|
|
36
37
|
R1 command model:
|
|
37
38
|
init Initialize the SDTK-WIKI workspace.
|
|
38
39
|
ingest Run local semantic extraction without handling timestamped JSON.
|
|
39
|
-
compile Run safe
|
|
40
|
-
query Search generated
|
|
40
|
+
compile Run safe local wiki compile preview, optionally apply to wiki/.
|
|
41
|
+
query Search generated local wiki pages without premium Ask.
|
|
41
42
|
discover Write a local-only discovery plan from WIKI gap evidence.
|
|
42
43
|
maintain Run safe lint, discover, and compile-preview maintenance reports.
|
|
44
|
+
enrich Write explicit opt-in GitHub enrichment review reports.
|
|
43
45
|
atlas build Build graph/viewer plus local wiki pages/provenance.
|
|
44
46
|
atlas open Open or serve the local graph viewer.
|
|
45
47
|
atlas watch Watch markdown sources and rebuild the graph.
|
|
@@ -47,9 +49,9 @@ R1 command model:
|
|
|
47
49
|
wiki ingest Register one local source in metadata-only raw/provenance state.
|
|
48
50
|
wiki prune Write a report-only dry-run stale managed-page review.
|
|
49
51
|
wiki discover Write a local-only discovery plan from WIKI gap evidence.
|
|
50
|
-
wiki compile Preview or explicitly apply local
|
|
52
|
+
wiki compile Preview or explicitly apply local wiki compile plans.
|
|
51
53
|
ask Ask grounded questions over the built SDTK-WIKI graph.
|
|
52
|
-
search Search generated
|
|
54
|
+
search Search generated local wiki pages without premium Ask.
|
|
53
55
|
lint Write a report-first, non-destructive wiki lint report.
|
|
54
56
|
|
|
55
57
|
Advanced/audit workflow:
|
|
@@ -57,15 +59,17 @@ Advanced/audit workflow:
|
|
|
57
59
|
sdtk-wiki wiki compile --plan <extract-json> --dry-run
|
|
58
60
|
sdtk-wiki wiki compile --plan <apply-json> --apply --yes
|
|
59
61
|
sdtk-wiki search "<query>"
|
|
62
|
+
sdtk-wiki enrich --source github --mode review
|
|
60
63
|
|
|
61
64
|
Workspace paths:
|
|
62
|
-
|
|
65
|
+
wiki/ Canonical human-facing local wiki output target.
|
|
66
|
+
.sdtk/wiki Internal SDTK-WIKI state target.
|
|
63
67
|
.sdtk/wiki/graph New SDTK-WIKI graph output target.
|
|
64
|
-
.sdtk/wiki/pages
|
|
68
|
+
.sdtk/wiki/pages Internal graph/wiki compatibility page target.
|
|
65
69
|
.sdtk/wiki/raw Metadata-only local source registry target.
|
|
66
70
|
.sdtk/wiki/provenance Generated source provenance target.
|
|
67
71
|
.sdtk/atlas Legacy Atlas workspace, readable for compatibility.
|
|
68
|
-
|
|
72
|
+
Human-facing generated wiki paths must stay under project-local wiki/.
|
|
69
73
|
|
|
70
74
|
Compatibility:
|
|
71
75
|
Existing sdtk-spec atlas commands remain the R1 compatibility path.
|
|
@@ -78,13 +82,14 @@ Premium Ask:
|
|
|
78
82
|
Query history, discover, compile, and cleanup automation are not enabled in R1.
|
|
79
83
|
|
|
80
84
|
Local Search:
|
|
81
|
-
sdtk-wiki query Beginner-friendly local deterministic search over .sdtk/wiki/personal-brain.
|
|
82
|
-
sdtk-wiki search Deterministic, read-only local search over .sdtk/wiki/personal-brain.
|
|
85
|
+
sdtk-wiki query Beginner-friendly local deterministic search over wiki/, with legacy .sdtk/wiki/personal-brain fallback.
|
|
86
|
+
sdtk-wiki search Deterministic, read-only local search over wiki/, with legacy .sdtk/wiki/personal-brain fallback.
|
|
83
87
|
Does not require wiki.ask entitlement and does not perform LLM/RAG behavior.
|
|
84
88
|
|
|
85
89
|
Maintenance:
|
|
86
90
|
sdtk-wiki discover --plan is a top-level alias for local-only discovery planning.
|
|
87
91
|
sdtk-wiki maintain --mode safe runs report-first lint/discover/compile-preview checks without apply.
|
|
92
|
+
sdtk-wiki enrich --source github --mode review writes a local-only enrichment review report.
|
|
88
93
|
sdtk-wiki wiki prune --dry-run is report-only and writes under .sdtk/wiki/reports.
|
|
89
94
|
It never deletes, archives, applies, or mutates .sdtk/atlas.`);
|
|
90
95
|
console.log(`
|
|
@@ -92,7 +97,7 @@ Maintenance:
|
|
|
92
97
|
It never fetches web sources, ingests sources, compiles pages, applies edits, prunes, or mutates .sdtk/atlas.`);
|
|
93
98
|
console.log(`
|
|
94
99
|
sdtk-wiki wiki compile --dry-run writes a markdown preview plus JSON sidecar under .sdtk/wiki/reports.
|
|
95
|
-
sdtk-wiki wiki compile --apply --yes consumes only the JSON sidecar and writes create-only
|
|
100
|
+
sdtk-wiki wiki compile --apply --yes consumes only the JSON sidecar and writes create-only local wiki pages under wiki/.
|
|
96
101
|
It never rewrites pages, mutates raw/provenance files, or mutates .sdtk/atlas.`);
|
|
97
102
|
return 0;
|
|
98
103
|
}
|
package/src/commands/lint.js
CHANGED
|
@@ -21,7 +21,7 @@ Output:
|
|
|
21
21
|
Behavior:
|
|
22
22
|
Findings are written to the report and do not auto-modify wiki or source files.
|
|
23
23
|
Source-quality checks report mojibake-like text, missing source URLs, weak titles, duplicate repo/source candidates, low-confidence extraction, and raw/graph/provenance coverage mismatch.
|
|
24
|
-
|
|
24
|
+
Local wiki quality metrics report frontmatter coverage, required sections, source refs, internal links, stub ratio, giant pages, density, and source evidence coverage.
|
|
25
25
|
Completed lint runs exit 0 even when findings exist.
|
|
26
26
|
Missing workspace or fatal report-write failures exit non-zero.
|
|
27
27
|
|
|
@@ -101,7 +101,7 @@ Purpose:
|
|
|
101
101
|
|
|
102
102
|
Safety:
|
|
103
103
|
Local sources only.
|
|
104
|
-
No source mutation,
|
|
104
|
+
No source mutation, local wiki page writes, graph rebuild, web fetch, Ask, raw/provenance mutation, or .sdtk/atlas mutation.
|
|
105
105
|
|
|
106
106
|
Next:
|
|
107
107
|
sdtk-wiki compile --mode safe`);
|
|
@@ -132,7 +132,7 @@ Usage:
|
|
|
132
132
|
sdtk-wiki query [--project-path <path>] [--json] [--limit <n>] "<query>"
|
|
133
133
|
|
|
134
134
|
Purpose:
|
|
135
|
-
Deterministically search generated
|
|
135
|
+
Deterministically search generated local wiki Markdown pages.
|
|
136
136
|
|
|
137
137
|
Behavior:
|
|
138
138
|
Local search only.
|
|
@@ -195,7 +195,7 @@ function cmdIngest(args) {
|
|
|
195
195
|
console.log(`[wiki] Tool candidates: ${extraction.tool_entities.length}`);
|
|
196
196
|
console.log(`[wiki] Concept candidates: ${extraction.concepts.length}`);
|
|
197
197
|
console.log(`[wiki] Quality findings: ${extraction.source_quality_findings.length}`);
|
|
198
|
-
console.log("[wiki] No source files,
|
|
198
|
+
console.log("[wiki] No source files, local wiki pages, raw/provenance state, graph outputs, or atlas compatibility files were modified.");
|
|
199
199
|
console.log("[wiki] Next: sdtk-wiki compile --mode safe");
|
|
200
200
|
return 0;
|
|
201
201
|
}
|
|
@@ -264,8 +264,9 @@ function cmdCompile(args) {
|
|
|
264
264
|
}
|
|
265
265
|
console.log(`[wiki] Created files: ${result.created.length}`);
|
|
266
266
|
console.log(`[wiki] Unchanged files: ${result.unchanged.length}`);
|
|
267
|
+
console.log(`[wiki] Scaffold created/skipped: ${result.scaffoldCreated.length}/${result.scaffoldSkipped.length}`);
|
|
267
268
|
console.log(`[wiki] Source-quality warnings: ${result.sourceQualityWarningCount}`);
|
|
268
|
-
console.log("[wiki] No source files, raw sources, provenance descriptors, or atlas compatibility files were modified.");
|
|
269
|
+
console.log("[wiki] Canonical local wiki output is <project>/wiki; .sdtk/wiki remains internal state. No source files, raw sources, provenance descriptors, or atlas compatibility files were modified.");
|
|
269
270
|
console.log("[wiki] Next: sdtk-wiki query \"multi-agent\"");
|
|
270
271
|
return 0;
|
|
271
272
|
}
|
package/src/commands/search.js
CHANGED
|
@@ -22,10 +22,10 @@ Usage:
|
|
|
22
22
|
sdtk-wiki search --project-path <path> --json --limit 10 "Claude Code"
|
|
23
23
|
|
|
24
24
|
Purpose:
|
|
25
|
-
Deterministically search generated
|
|
25
|
+
Deterministically search generated local wiki Markdown pages.
|
|
26
26
|
|
|
27
27
|
Inputs:
|
|
28
|
-
.sdtk/wiki/personal-brain/**/*.md
|
|
28
|
+
wiki/**/*.md, falling back to .sdtk/wiki/personal-brain/**/*.md for legacy workspaces.
|
|
29
29
|
|
|
30
30
|
Behavior:
|
|
31
31
|
Read-only and non-premium.
|
|
@@ -38,14 +38,15 @@ function printHumanResult(result) {
|
|
|
38
38
|
const lines = [
|
|
39
39
|
`Query: ${result.query}`,
|
|
40
40
|
`Search mode: ${result.searchMode}`,
|
|
41
|
-
`
|
|
41
|
+
`Wiki content: ${result.wikiContentPath}`,
|
|
42
|
+
`Wiki content mode: ${result.wikiContentMode}`,
|
|
42
43
|
`Scanned files: ${result.scannedFiles}`,
|
|
43
44
|
`Matches: ${result.totalMatches}`,
|
|
44
45
|
"",
|
|
45
46
|
];
|
|
46
47
|
|
|
47
48
|
if (result.matches.length === 0) {
|
|
48
|
-
lines.push("No local
|
|
49
|
+
lines.push("No local wiki matches found.");
|
|
49
50
|
} else {
|
|
50
51
|
result.matches.forEach((match, index) => {
|
|
51
52
|
lines.push(`${index + 1}. ${match.path}`);
|
package/src/commands/wiki.js
CHANGED
|
@@ -37,7 +37,7 @@ function cmdWikiExtractHelp() {
|
|
|
37
37
|
sdtk-wiki wiki extract --project-path <path> --source-root <path> --dry-run
|
|
38
38
|
|
|
39
39
|
Purpose:
|
|
40
|
-
Write a local semantic extraction dry-run report for SDTK-WIKI
|
|
40
|
+
Write a local semantic extraction dry-run report for SDTK-WIKI local wiki generation.
|
|
41
41
|
|
|
42
42
|
Writes:
|
|
43
43
|
.sdtk/wiki/reports/semantic-extraction-dry-run-YYYYMMDD-HHMMSSZ.json
|
|
@@ -45,7 +45,7 @@ Writes:
|
|
|
45
45
|
Safety:
|
|
46
46
|
Dry-run report only.
|
|
47
47
|
Local Markdown and supported JSON source roots only; remote URLs are rejected.
|
|
48
|
-
No
|
|
48
|
+
No local wiki pages, managed pages, raw sources, provenance state, atlas compatibility files, web fetch, Ask, compile/apply, prune, delete, archive, or source files are modified.`);
|
|
49
49
|
return 0;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -60,13 +60,13 @@ Purpose:
|
|
|
60
60
|
Writes:
|
|
61
61
|
.sdtk/wiki/reports/compile-dry-run-preview-YYYY-MM-DD.md
|
|
62
62
|
.sdtk/wiki/reports/compile-apply-plan-YYYY-MM-DD.json
|
|
63
|
-
|
|
63
|
+
wiki/... only when --apply --yes is used with an apply JSON sidecar
|
|
64
64
|
|
|
65
65
|
Safety:
|
|
66
66
|
Dry-run remains preview-only.
|
|
67
67
|
Apply consumes only record_type sdtk_wiki_compile_apply_plan JSON sidecars.
|
|
68
68
|
Markdown plans and semantic extraction JSON are rejected for apply.
|
|
69
|
-
Apply is create-only or same-content no-op under
|
|
69
|
+
Apply is create-only or same-content no-op under project-local wiki/.
|
|
70
70
|
No delete, archive, rewrite, reorder, raw source, provenance, atlas compatibility, discover, prune, query-history, or release mutation.
|
|
71
71
|
Unknown operation types are reported as unsupported_operation and cause a non-zero exit after the report is written.`);
|
|
72
72
|
return 0;
|
|
@@ -225,11 +225,12 @@ function cmdWikiCompile(args) {
|
|
|
225
225
|
console.log(`[wiki] Compile apply plan: ${result.planPath}`);
|
|
226
226
|
console.log(`[wiki] Created files: ${result.created.length}`);
|
|
227
227
|
console.log(`[wiki] Unchanged files: ${result.unchanged.length}`);
|
|
228
|
+
console.log(`[wiki] Scaffold created/skipped: ${result.scaffoldCreated.length}/${result.scaffoldSkipped.length}`);
|
|
228
229
|
console.log(`[wiki] Source-quality warnings: ${result.sourceQualityWarningCount}`);
|
|
229
230
|
if (result.sourceQualityWarningCount > 0) {
|
|
230
231
|
console.log("[wiki] Source-quality findings were present in the apply plan; pages were still applied because --yes was explicit.");
|
|
231
232
|
}
|
|
232
|
-
console.log("[wiki] No source files, raw sources, provenance descriptors, or atlas compatibility files were modified.");
|
|
233
|
+
console.log("[wiki] Canonical local wiki output is <project>/wiki; .sdtk/wiki remains internal state. No source files, raw sources, provenance descriptors, or atlas compatibility files were modified.");
|
|
233
234
|
return 0;
|
|
234
235
|
}
|
|
235
236
|
if (!flags["dry-run"]) {
|
|
@@ -274,7 +275,7 @@ function cmdWikiExtract(args) {
|
|
|
274
275
|
console.log(`[wiki] Tool candidates: ${extraction.tool_entities.length}`);
|
|
275
276
|
console.log(`[wiki] Concept candidates: ${extraction.concepts.length}`);
|
|
276
277
|
console.log(`[wiki] Quality findings: ${extraction.source_quality_findings.length}`);
|
|
277
|
-
console.log("[wiki] No
|
|
278
|
+
console.log("[wiki] No local wiki pages, raw sources, provenance state, or atlas compatibility files were modified.");
|
|
278
279
|
return 0;
|
|
279
280
|
}
|
|
280
281
|
|
package/src/index.js
CHANGED
|
@@ -12,6 +12,7 @@ const {
|
|
|
12
12
|
cmdMaintain,
|
|
13
13
|
cmdQuery,
|
|
14
14
|
} = require("./commands/operations");
|
|
15
|
+
const { cmdEnrich } = require("./commands/enrich");
|
|
15
16
|
const { cmdSearch } = require("./commands/search");
|
|
16
17
|
const { cmdWiki } = require("./commands/wiki");
|
|
17
18
|
const { ValidationError } = require("./lib/errors");
|
|
@@ -51,6 +52,7 @@ const COMMANDS = new Set([
|
|
|
51
52
|
"query",
|
|
52
53
|
"discover",
|
|
53
54
|
"maintain",
|
|
55
|
+
"enrich",
|
|
54
56
|
]);
|
|
55
57
|
|
|
56
58
|
async function run(argv) {
|
|
@@ -90,6 +92,8 @@ async function run(argv) {
|
|
|
90
92
|
return cmdDiscover(args);
|
|
91
93
|
case "maintain":
|
|
92
94
|
return cmdMaintain(args);
|
|
95
|
+
case "enrich":
|
|
96
|
+
return cmdEnrich(args);
|
|
93
97
|
}
|
|
94
98
|
}
|
|
95
99
|
|