@unrdf/diataxis-kit 26.4.2

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.
Files changed (49) hide show
  1. package/README.md +425 -0
  2. package/bin/report.mjs +529 -0
  3. package/bin/run.mjs +114 -0
  4. package/bin/verify.mjs +356 -0
  5. package/capability-map.md +92 -0
  6. package/package.json +42 -0
  7. package/src/classify.mjs +584 -0
  8. package/src/diataxis-schema.mjs +425 -0
  9. package/src/evidence.mjs +268 -0
  10. package/src/hash.mjs +37 -0
  11. package/src/inventory.mjs +280 -0
  12. package/src/reference-extractor.mjs +324 -0
  13. package/src/scaffold.mjs +458 -0
  14. package/src/stable-json.mjs +113 -0
  15. package/src/verify-implementation.mjs +131 -0
  16. package/test/determinism.test.mjs +321 -0
  17. package/test/evidence.test.mjs +145 -0
  18. package/test/fixtures/scaffold-det1/explanation/explanation.md +35 -0
  19. package/test/fixtures/scaffold-det1/index.md +29 -0
  20. package/test/fixtures/scaffold-det1/reference/reference.md +34 -0
  21. package/test/fixtures/scaffold-det1/tutorials/tutorial-test-tutorial.md +37 -0
  22. package/test/fixtures/scaffold-det2/explanation/explanation.md +35 -0
  23. package/test/fixtures/scaffold-det2/index.md +29 -0
  24. package/test/fixtures/scaffold-det2/reference/reference.md +34 -0
  25. package/test/fixtures/scaffold-det2/tutorials/tutorial-test-tutorial.md +37 -0
  26. package/test/fixtures/scaffold-empty/explanation/explanation.md +35 -0
  27. package/test/fixtures/scaffold-empty/index.md +25 -0
  28. package/test/fixtures/scaffold-empty/reference/reference.md +34 -0
  29. package/test/fixtures/scaffold-escape/explanation/explanation.md +35 -0
  30. package/test/fixtures/scaffold-escape/index.md +29 -0
  31. package/test/fixtures/scaffold-escape/reference/reference.md +36 -0
  32. package/test/fixtures/scaffold-output/explanation/explanation.md +39 -0
  33. package/test/fixtures/scaffold-output/how-to/howto-configure-options.md +39 -0
  34. package/test/fixtures/scaffold-output/index.md +41 -0
  35. package/test/fixtures/scaffold-output/reference/reference.md +36 -0
  36. package/test/fixtures/scaffold-output/tutorials/tutorial-getting-started.md +41 -0
  37. package/test/fixtures/test-artifacts/ARTIFACTS/diataxis/test-pkg-1.inventory.json +115 -0
  38. package/test/fixtures/test-artifacts/ARTIFACTS/diataxis/test-pkg-2.inventory.json +93 -0
  39. package/test/fixtures/test-artifacts/ARTIFACTS/diataxis/test-pkg-3.inventory.json +97 -0
  40. package/test/fixtures/test-package/LICENSE +1 -0
  41. package/test/fixtures/test-package/README.md +15 -0
  42. package/test/fixtures/test-package/docs/guide.md +3 -0
  43. package/test/fixtures/test-package/examples/basic.mjs +3 -0
  44. package/test/fixtures/test-package/src/index.mjs +3 -0
  45. package/test/inventory.test.mjs +199 -0
  46. package/test/reference-extractor.test.mjs +187 -0
  47. package/test/report.test.mjs +503 -0
  48. package/test/scaffold.test.mjs +242 -0
  49. package/test/verify-gate.test.mjs +634 -0
@@ -0,0 +1,37 @@
1
+ ---
2
+ title: "Test Tutorial"
3
+ type: "tutorial"
4
+ packageName: "test-deterministic"
5
+ version: "1.0.0"
6
+ generatedAt: "2000-01-01T00:00:00.000Z"
7
+ confidenceScore: 0.9
8
+ proof: "fa5ec3edd8fd24ada2fbe509ea3369703fea30ef1c5d0707430893d876099862"
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ Test
14
+
15
+ ## Prerequisites
16
+
17
+ - None
18
+
19
+ ## Steps
20
+
21
+ 1. Step 1
22
+
23
+ ## Proof
24
+
25
+ This file was generated from the following evidence sources:
26
+
27
+ - test.md
28
+
29
+ ```json
30
+ {
31
+ "fingerprintInput": "test.md|Test Tutorial|0.9",
32
+ "hash": "fa5ec3edd8fd24ada2fbe509ea3369703fea30ef1c5d0707430893d876099862",
33
+ "sources": [
34
+ "test.md"
35
+ ]
36
+ }
37
+ ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: "empty-package Explanation"
3
+ type: "explanation"
4
+ packageName: "empty-package"
5
+ version: "0.0.1"
6
+ generatedAt: "2025-12-26T20:10:17.162Z"
7
+ confidenceScore: 0
8
+ proof: "d10e1c3c48b31942bc49c4138fa54ceba73dd01cd79a814c2a0f323b198c9ba8"
9
+ ---
10
+
11
+ ## Concepts
12
+
13
+ - (No concepts documented)
14
+
15
+ ## Architecture
16
+
17
+ (No architecture documented)
18
+
19
+ ## Tradeoffs
20
+
21
+ - (No tradeoffs documented)
22
+
23
+ ## Proof
24
+
25
+ This file was generated from the following evidence sources:
26
+
27
+ - (No sources recorded)
28
+
29
+ ```json
30
+ {
31
+ "fingerprintInput": "|empty-package Explanation|0",
32
+ "hash": "d10e1c3c48b31942bc49c4138fa54ceba73dd01cd79a814c2a0f323b198c9ba8",
33
+ "sources": []
34
+ }
35
+ ```
@@ -0,0 +1,25 @@
1
+ ---
2
+ title: "empty-package Documentation"
3
+ packageName: "empty-package"
4
+ version: "0.0.1"
5
+ generatedAt: "2025-12-26T20:10:17.162Z"
6
+ ---
7
+
8
+ # empty-package Documentation
9
+
10
+ Generated documentation using the Diátaxis framework.
11
+
12
+ ## Quick Stats
13
+
14
+ - **Tutorials**: 0
15
+ - **How-To Guides**: 0
16
+ - **Reference**: Not available
17
+ - **Explanation**: Not available
18
+
19
+ ## Documentation Sections
20
+
21
+
22
+
23
+ ---
24
+
25
+ *Generated at 2025-12-26T20:10:17.162Z*
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: "empty-package Reference"
3
+ type: "reference"
4
+ packageName: "empty-package"
5
+ version: "0.0.1"
6
+ generatedAt: "2025-12-26T20:10:17.162Z"
7
+ confidenceScore: 0
8
+ proof: "2d17512c420e24c284f4f9c0e93c76b2c07ea1b78325009f886d17747df6cfc6"
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ This reference documentation provides technical details for empty-package.
14
+
15
+ ## API Reference
16
+
17
+ | Name | Type | Description |
18
+ |------|------|-------------|
19
+ | - | - | (No items documented) |
20
+
21
+
22
+ ## Proof
23
+
24
+ This file was generated from the following evidence sources:
25
+
26
+ - (No sources recorded)
27
+
28
+ ```json
29
+ {
30
+ "fingerprintInput": "|empty-package Reference|0",
31
+ "hash": "2d17512c420e24c284f4f9c0e93c76b2c07ea1b78325009f886d17747df6cfc6",
32
+ "sources": []
33
+ }
34
+ ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: "escape-test Explanation"
3
+ type: "explanation"
4
+ packageName: "escape-test"
5
+ version: "1.0.0"
6
+ generatedAt: "2025-12-26T20:10:17.202Z"
7
+ confidenceScore: 0
8
+ proof: "cb3c88a8793cc92dfd46143689c8623844218d8349391e9daa41567614139499"
9
+ ---
10
+
11
+ ## Concepts
12
+
13
+ - (No concepts documented)
14
+
15
+ ## Architecture
16
+
17
+ (No architecture documented)
18
+
19
+ ## Tradeoffs
20
+
21
+ - (No tradeoffs documented)
22
+
23
+ ## Proof
24
+
25
+ This file was generated from the following evidence sources:
26
+
27
+ - (No sources recorded)
28
+
29
+ ```json
30
+ {
31
+ "fingerprintInput": "|escape-test Explanation|0",
32
+ "hash": "cb3c88a8793cc92dfd46143689c8623844218d8349391e9daa41567614139499",
33
+ "sources": []
34
+ }
35
+ ```
@@ -0,0 +1,29 @@
1
+ ---
2
+ title: "escape-test Documentation"
3
+ packageName: "escape-test"
4
+ version: "1.0.0"
5
+ generatedAt: "2025-12-26T20:10:17.202Z"
6
+ ---
7
+
8
+ # escape-test Documentation
9
+
10
+ Generated documentation using the Diátaxis framework.
11
+
12
+ ## Quick Stats
13
+
14
+ - **Tutorials**: 0
15
+ - **How-To Guides**: 0
16
+ - **Reference**: Available
17
+ - **Explanation**: Not available
18
+
19
+ ## Documentation Sections
20
+
21
+ ### Reference
22
+
23
+ - [Reference](reference/reference.md)
24
+
25
+
26
+
27
+ ---
28
+
29
+ *Generated at 2025-12-26T20:10:17.202Z*
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: "Reference"
3
+ type: "reference"
4
+ packageName: "escape-test"
5
+ version: "1.0.0"
6
+ generatedAt: "2025-12-26T20:10:17.202Z"
7
+ confidenceScore: 0.9
8
+ proof: "8857370d6270a1bc31f7d5e4045fae4f9e463f366430be5bd543c7546cd1652e"
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ This reference documentation provides technical details for escape-test.
14
+
15
+ ## API Reference
16
+
17
+ | Name | Type | Description |
18
+ |------|------|-------------|
19
+ | test\|pipe | export | Description with \| pipe |
20
+
21
+
22
+ ## Proof
23
+
24
+ This file was generated from the following evidence sources:
25
+
26
+ - test.md
27
+
28
+ ```json
29
+ {
30
+ "fingerprintInput": "test.md|Reference|0.9",
31
+ "hash": "8857370d6270a1bc31f7d5e4045fae4f9e463f366430be5bd543c7546cd1652e",
32
+ "sources": [
33
+ "test.md"
34
+ ]
35
+ }
36
+ ```
@@ -0,0 +1,39 @@
1
+ ---
2
+ title: "Architecture"
3
+ type: "explanation"
4
+ packageName: "test-package"
5
+ version: "1.0.0"
6
+ generatedAt: "2025-12-26T20:10:17.126Z"
7
+ confidenceScore: 0.8
8
+ proof: "7a544673d311153cefea152a2b46a655f60a985c32e1f6cd22c1c5a1df094b82"
9
+ ---
10
+
11
+ ## Concepts
12
+
13
+ - Event-driven design
14
+ - Plugin system
15
+
16
+ ## Architecture
17
+
18
+ The system uses a modular architecture with plugins.
19
+
20
+ ## Tradeoffs
21
+
22
+ - Performance vs flexibility
23
+ - Memory vs speed
24
+
25
+ ## Proof
26
+
27
+ This file was generated from the following evidence sources:
28
+
29
+ - docs/architecture.md
30
+
31
+ ```json
32
+ {
33
+ "fingerprintInput": "docs/architecture.md|Architecture|0.8",
34
+ "hash": "7a544673d311153cefea152a2b46a655f60a985c32e1f6cd22c1c5a1df094b82",
35
+ "sources": [
36
+ "docs/architecture.md"
37
+ ]
38
+ }
39
+ ```
@@ -0,0 +1,39 @@
1
+ ---
2
+ title: "Configure Options"
3
+ type: "how-to"
4
+ packageName: "test-package"
5
+ version: "1.0.0"
6
+ generatedAt: "2025-12-26T20:10:17.126Z"
7
+ confidenceScore: 0.85
8
+ proof: "2581b7f7f9698a696a4f86cb63fb7a85c362988199a7bf9ad665397aee5f790b"
9
+ ---
10
+
11
+ ## Task
12
+
13
+ Configure advanced options
14
+
15
+ ## Context
16
+
17
+ When you need custom configuration
18
+
19
+ ## Steps
20
+
21
+ 1. Open config file
22
+ 2. Set options
23
+ 3. Validate config
24
+
25
+ ## Proof
26
+
27
+ This file was generated from the following evidence sources:
28
+
29
+ - docs/config.md
30
+
31
+ ```json
32
+ {
33
+ "fingerprintInput": "docs/config.md|Configure Options|0.85",
34
+ "hash": "2581b7f7f9698a696a4f86cb63fb7a85c362988199a7bf9ad665397aee5f790b",
35
+ "sources": [
36
+ "docs/config.md"
37
+ ]
38
+ }
39
+ ```
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: "test-package Documentation"
3
+ packageName: "test-package"
4
+ version: "1.0.0"
5
+ generatedAt: "2025-12-26T20:10:17.126Z"
6
+ ---
7
+
8
+ # test-package Documentation
9
+
10
+ Generated documentation using the Diátaxis framework.
11
+
12
+ ## Quick Stats
13
+
14
+ - **Tutorials**: 1
15
+ - **How-To Guides**: 1
16
+ - **Reference**: Available
17
+ - **Explanation**: Available
18
+
19
+ ## Documentation Sections
20
+
21
+ ### Tutorials
22
+
23
+ - [Getting Started](tutorials/tutorial-getting-started.md)
24
+
25
+ ### How-To Guides
26
+
27
+ - [Configure Options](how-to/howto-configure-options.md)
28
+
29
+ ### Reference
30
+
31
+ - [API Reference](reference/reference.md)
32
+
33
+ ### Explanation
34
+
35
+ - [Architecture](explanation/explanation.md)
36
+
37
+
38
+
39
+ ---
40
+
41
+ *Generated at 2025-12-26T20:10:17.126Z*
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: "API Reference"
3
+ type: "reference"
4
+ packageName: "test-package"
5
+ version: "1.0.0"
6
+ generatedAt: "2025-12-26T20:10:17.126Z"
7
+ confidenceScore: 0.95
8
+ proof: "dd195914e600c469aac3a7998e4820170ce963a6ee331fd357366d03339b9dfd"
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ This reference documentation provides technical details for test-package.
14
+
15
+ ## API Reference
16
+
17
+ | Name | Type | Description |
18
+ |------|------|-------------|
19
+ | createClient | export | Creates a new client instance |
20
+
21
+
22
+ ## Proof
23
+
24
+ This file was generated from the following evidence sources:
25
+
26
+ - src/index.mjs
27
+
28
+ ```json
29
+ {
30
+ "fingerprintInput": "src/index.mjs|API Reference|0.95",
31
+ "hash": "dd195914e600c469aac3a7998e4820170ce963a6ee331fd357366d03339b9dfd",
32
+ "sources": [
33
+ "src/index.mjs"
34
+ ]
35
+ }
36
+ ```
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: "Getting Started"
3
+ type: "tutorial"
4
+ packageName: "test-package"
5
+ version: "1.0.0"
6
+ generatedAt: "2025-12-26T20:10:17.126Z"
7
+ confidenceScore: 0.9
8
+ proof: "f63cc5a2e01b2001bbe58aefe40e432bbb623f7866afb2ee4ac3d52083afdec4"
9
+ ---
10
+
11
+ ## Overview
12
+
13
+ Learn the basics
14
+
15
+ ## Prerequisites
16
+
17
+ - Node.js 18+
18
+
19
+ ## Steps
20
+
21
+ 1. Install package
22
+ 2. Create config
23
+ 3. Run first command
24
+
25
+ ## Proof
26
+
27
+ This file was generated from the following evidence sources:
28
+
29
+ - README.md
30
+ - docs/tutorial.md
31
+
32
+ ```json
33
+ {
34
+ "fingerprintInput": "README.md|docs/tutorial.md|Getting Started|0.9",
35
+ "hash": "f63cc5a2e01b2001bbe58aefe40e432bbb623f7866afb2ee4ac3d52083afdec4",
36
+ "sources": [
37
+ "README.md",
38
+ "docs/tutorial.md"
39
+ ]
40
+ }
41
+ ```
@@ -0,0 +1,115 @@
1
+ {
2
+ "packageName": "@unrdf/test-pkg-1",
3
+ "version": "1.0.0",
4
+ "generatedAt": "2025-01-01T00:00:00.000Z",
5
+ "confidence": {
6
+ "tutorials": 0.9,
7
+ "howtos": 0.85,
8
+ "reference": 1,
9
+ "explanation": 0.8
10
+ },
11
+ "tutorials": [
12
+ {
13
+ "id": "tutorial-getting-started",
14
+ "title": "Getting Started",
15
+ "goal": "Learn basics",
16
+ "prerequisites": [],
17
+ "stepsOutline": [
18
+ "Install",
19
+ "Import",
20
+ "Use"
21
+ ],
22
+ "confidenceScore": 0.9,
23
+ "source": [
24
+ "readme",
25
+ "examples"
26
+ ]
27
+ }
28
+ ],
29
+ "howtos": [
30
+ {
31
+ "id": "howto-configure",
32
+ "title": "Configure Package",
33
+ "task": "Set up configuration",
34
+ "context": "When customizing",
35
+ "steps": [
36
+ "Create config",
37
+ "Set options"
38
+ ],
39
+ "confidenceScore": 0.85,
40
+ "source": [
41
+ "readme"
42
+ ]
43
+ },
44
+ {
45
+ "id": "howto-use-cli",
46
+ "title": "Use CLI",
47
+ "task": "Use command line",
48
+ "context": "When running CLI",
49
+ "steps": [
50
+ "Install",
51
+ "Run"
52
+ ],
53
+ "confidenceScore": 1,
54
+ "source": [
55
+ "bin"
56
+ ]
57
+ }
58
+ ],
59
+ "reference": {
60
+ "id": "reference-api",
61
+ "title": "API Reference",
62
+ "items": [
63
+ {
64
+ "name": "export1",
65
+ "type": "export",
66
+ "description": "Export 1",
67
+ "example": "import x"
68
+ },
69
+ {
70
+ "name": "cli-tool",
71
+ "type": "bin",
72
+ "description": "CLI tool",
73
+ "example": "cli-tool"
74
+ }
75
+ ],
76
+ "confidenceScore": 1,
77
+ "source": [
78
+ "exports",
79
+ "bin"
80
+ ]
81
+ },
82
+ "explanation": {
83
+ "id": "explanation-overview",
84
+ "title": "Understanding Package",
85
+ "concepts": [
86
+ "concept1",
87
+ "concept2"
88
+ ],
89
+ "architecture": "This is the architecture",
90
+ "tradeoffs": [
91
+ "Tradeoff 1",
92
+ "Tradeoff 2"
93
+ ],
94
+ "confidenceScore": 0.8,
95
+ "source": [
96
+ "readme",
97
+ "keywords"
98
+ ]
99
+ },
100
+ "evidence": {
101
+ "readmeHeadings": [
102
+ "Usage",
103
+ "API",
104
+ "Examples"
105
+ ],
106
+ "docsFiles": [
107
+ "guide.md"
108
+ ],
109
+ "examplesFiles": [
110
+ "example1.mjs",
111
+ "example2.mjs"
112
+ ],
113
+ "fingerprint": "abc123"
114
+ }
115
+ }
@@ -0,0 +1,93 @@
1
+ {
2
+ "packageName": "@unrdf/test-pkg-2",
3
+ "version": "0.5.0",
4
+ "generatedAt": "2025-01-01T00:00:00.000Z",
5
+ "confidence": {
6
+ "tutorials": 0.3,
7
+ "howtos": 0.4,
8
+ "reference": 0.5,
9
+ "explanation": 0.4
10
+ },
11
+ "tutorials": [
12
+ {
13
+ "id": "tutorial-basic",
14
+ "title": "Basic Tutorial",
15
+ "goal": "Learn",
16
+ "prerequisites": [],
17
+ "stepsOutline": [
18
+ "Step 1"
19
+ ],
20
+ "confidenceScore": 0.3,
21
+ "source": [
22
+ "inferred"
23
+ ]
24
+ }
25
+ ],
26
+ "howtos": [
27
+ {
28
+ "id": "howto-use",
29
+ "title": "Use Package",
30
+ "task": "Use it",
31
+ "context": "When needed",
32
+ "steps": [
33
+ "Import",
34
+ "Use"
35
+ ],
36
+ "confidenceScore": 0.4,
37
+ "source": [
38
+ "inferred"
39
+ ]
40
+ },
41
+ {
42
+ "id": "howto-troubleshoot",
43
+ "title": "Troubleshoot",
44
+ "task": "Fix issues",
45
+ "context": "When broken",
46
+ "steps": [
47
+ "Check",
48
+ "Fix"
49
+ ],
50
+ "confidenceScore": 0.4,
51
+ "source": [
52
+ "inferred"
53
+ ]
54
+ }
55
+ ],
56
+ "reference": {
57
+ "id": "reference-api",
58
+ "title": "API Reference",
59
+ "items": [
60
+ {
61
+ "name": "unknown",
62
+ "type": "unknown",
63
+ "description": "To be added",
64
+ "example": null
65
+ }
66
+ ],
67
+ "confidenceScore": 0.5,
68
+ "source": [
69
+ "inferred"
70
+ ]
71
+ },
72
+ "explanation": {
73
+ "id": "explanation-overview",
74
+ "title": "Understanding Package",
75
+ "concepts": [
76
+ "core"
77
+ ],
78
+ "architecture": "Basic package",
79
+ "tradeoffs": [
80
+ "Generic tradeoff"
81
+ ],
82
+ "confidenceScore": 0.4,
83
+ "source": [
84
+ "inferred"
85
+ ]
86
+ },
87
+ "evidence": {
88
+ "readmeHeadings": [],
89
+ "docsFiles": [],
90
+ "examplesFiles": [],
91
+ "fingerprint": "def456"
92
+ }
93
+ }