@v11g/agents-rock 1.0.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/README.md +65 -0
- package/bin/agents-rock.mjs +4 -0
- package/package.json +13 -0
- package/plugins/solution-architect/.claude-plugin/plugin.json +9 -0
- package/plugins/solution-architect/skills/analyze-requirements/README.md +75 -0
- package/plugins/solution-architect/skills/analyze-requirements/SKILL.md +31 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/OFL.txt +98 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/mermaid-theme.json +52 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/section-help.json +101 -0
- package/plugins/solution-architect/skills/analyze-requirements/assets/viewer-template.html +2389 -0
- package/plugins/solution-architect/skills/analyze-requirements/references/interview.md +53 -0
- package/plugins/solution-architect/skills/analyze-requirements/references/likec4.md +157 -0
- package/plugins/solution-architect/skills/analyze-requirements/references/project-types.md +60 -0
- package/plugins/solution-architect/skills/analyze-requirements/references/research.md +78 -0
- package/plugins/solution-architect/skills/analyze-requirements/references/viewer.md +772 -0
- package/plugins/solution-architect/skills/analyze-requirements/references/writing.md +206 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/cdp.mjs +74 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/chrome.mjs +66 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/companion-links.mjs +20 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-kinds.mjs +37 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-links.mjs +26 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-routes.mjs +27 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/doc-sections.mjs +78 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/embed.mjs +8 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/er-entities.mjs +16 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/fonts.mjs +39 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/frontmatter.mjs +17 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/inputs.mjs +41 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/likec4-config.mjs +41 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/likec4-extract.mjs +29 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/likec4-steps.mjs +22 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-defs.mjs +20 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-flows.mjs +46 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-inline.mjs +31 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-links.mjs +7 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-list.mjs +64 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-render.mjs +127 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-shape.mjs +19 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-tables.mjs +30 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-views.mjs +48 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/md-wide.mjs +44 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/nav.mjs +72 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/offline.mjs +19 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/port.mjs +13 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/quality-gate.mjs +113 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/section-help.mjs +49 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/slug-registry.mjs +11 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-clusters.mjs +15 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-deployment.mjs +8 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-elections.mjs +20 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-links.mjs +23 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-model-tables.mjs +24 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-palette.mjs +34 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-provenance.mjs +20 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/validate-tree.mjs +16 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/likec4-config.mjs +19 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/likec4-export.mjs +35 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/likec4-gen.mjs +39 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/render.mjs +130 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/serve.mjs +71 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/browser.test.mjs +553 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/companion-links.test.mjs +60 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/doc-kinds.test.mjs +41 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/doc-links.test.mjs +104 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/doc-routes.test.mjs +54 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/doc-sections.test.mjs +197 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/embed.test.mjs +28 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/er-entities.test.mjs +14 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/ARCHITECTURE.md +47 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/c4-src/broken/model.c4 +27 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/c4-src/pass/model.c4 +29 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/docs/adr/0001-sample.md +18 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/docs/estimate.html +2 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/docs/estimation.md +8 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/model-broken.json +1 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/model.json +1 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/docs-pass/threat-model.md +8 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/sample-model.json +1 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fixtures/sample.c4 +28 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/fonts.test.mjs +38 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/frontmatter.test.mjs +27 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/inputs.test.mjs +72 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-config-cli.test.mjs +26 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-config.test.mjs +74 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-export-cli.test.mjs +61 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-extract.test.mjs +37 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-gen-cli.test.mjs +73 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/likec4-steps.test.mjs +32 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-flows.test.mjs +82 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-links.test.mjs +16 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-provenance.test.mjs +42 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-render.test.mjs +226 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-tables.test.mjs +30 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-views.test.mjs +76 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/md-wide.test.mjs +76 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/nav.test.mjs +236 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/offline.test.mjs +37 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/quality-gate.test.mjs +86 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/quality-gates.test.mjs +20 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/render.test.mjs +171 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/research-workflow.test.mjs +38 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/section-help.test.mjs +101 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/serve.test.mjs +48 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-clusters.test.mjs +46 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-deployment.test.mjs +23 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-elections.test.mjs +30 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-links.test.mjs +38 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-model-tables.test.mjs +51 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-provenance.test.mjs +28 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-tree.test.mjs +43 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/test/viewer-template.test.mjs +1206 -0
- package/plugins/solution-architect/skills/analyze-requirements/scripts/validate.mjs +88 -0
- package/plugins/solution-architect/skills/analyze-requirements/workflows/research.js +57 -0
- package/plugins/solution-architect/skills/estimate/README.md +67 -0
- package/plugins/solution-architect/skills/estimate/SKILL.md +64 -0
- package/plugins/solution-architect/skills/estimate/assets/estimate-template.html +1128 -0
- package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +95 -0
- package/plugins/solution-architect/skills/estimate/references/interview.md +80 -0
- package/plugins/solution-architect/skills/estimate/references/slicing.md +55 -0
- package/plugins/solution-architect/skills/estimate/references/techniques.md +111 -0
- package/plugins/solution-architect/skills/estimate/references/writing.md +211 -0
- package/plugins/solution-architect/skills/estimate/scripts/compute.mjs +23 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/checks.mjs +128 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/components.mjs +19 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/estimate-math.mjs +85 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/inline.mjs +10 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +30 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/roadmap.mjs +32 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +122 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/schema.mjs +128 -0
- package/plugins/solution-architect/skills/estimate/scripts/render.mjs +65 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/browser.test.mjs +623 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/compute.test.mjs +88 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/e2e.test.mjs +34 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/estimate-math.test.mjs +112 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/booking-inputs.json +58 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/estimation-fail.md +30 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/estimation-pass.md +60 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/quality-gates.test.mjs +20 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/references.test.mjs +71 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +121 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/schema.test.mjs +129 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/validate.test.mjs +72 -0
- package/plugins/solution-architect/skills/estimate/scripts/validate.mjs +20 -0
- package/plugins/solution-architect/skills/new-lead/README.md +48 -0
- package/plugins/solution-architect/skills/new-lead/SKILL.md +113 -0
- package/plugins/solution-architect/skills/new-lead/assets/dashboard/detail.html +842 -0
- package/plugins/solution-architect/skills/new-lead/assets/dashboard/index.html +655 -0
- package/plugins/solution-architect/skills/new-lead/assets/dashboard/start.sh +3 -0
- package/plugins/solution-architect/skills/new-lead/assets/dashboard/stats.mjs +98 -0
- package/plugins/solution-architect/skills/new-lead/assets/dashboard/vendor/reactflow-bundle.js +473 -0
- package/plugins/solution-architect/skills/new-lead/assets/vendor-build/entry.jsx +33 -0
- package/plugins/solution-architect/skills/new-lead/assets/vendor-build/package-lock.json +1055 -0
- package/plugins/solution-architect/skills/new-lead/assets/vendor-build/package.json +19 -0
- package/plugins/solution-architect/skills/new-lead/scripts/init-root.mjs +73 -0
- package/plugins/solution-architect/skills/new-lead/scripts/lead-upsert.mjs +31 -0
- package/plugins/solution-architect/skills/new-lead/scripts/lib/enrich.mjs +20 -0
- package/plugins/solution-architect/skills/new-lead/scripts/lib/map-nodes.mjs +124 -0
- package/plugins/solution-architect/skills/new-lead/scripts/lib/map.mjs +117 -0
- package/plugins/solution-architect/skills/new-lead/scripts/lib/port.mjs +15 -0
- package/plugins/solution-architect/skills/new-lead/scripts/lib/registry.mjs +116 -0
- package/plugins/solution-architect/skills/new-lead/scripts/serve.mjs +163 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/e2e-workspace.test.mjs +59 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/enrich.test.mjs +16 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/ARCHITECTURE.md +16 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/brief.md +4 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/dist/index.html +11 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/dist/proposal-non-tech.html +2 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/dist/threat-model.html +2 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/estimation-inputs.json +6 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/estimation.json +10 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/notes.md +3 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/proposal-non-tech.md +3 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/rfp.md +3 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/fixtures/root/leads.json +25 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/init-root.test.mjs +81 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/lead-upsert.test.mjs +67 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/map.test.mjs +72 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/port.test.mjs +31 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/registry-io.test.mjs +57 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/registry.test.mjs +49 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/serve.test.mjs +205 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/stats.test.mjs +92 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/validate-cli.test.mjs +24 -0
- package/plugins/solution-architect/skills/new-lead/scripts/test/vendor-bundle.test.mjs +9 -0
- package/plugins/solution-architect/skills/new-lead/scripts/validate.mjs +9 -0
- package/plugins/solution-architect/skills/proposal/README.md +36 -0
- package/plugins/solution-architect/skills/proposal/SKILL.md +58 -0
- package/plugins/solution-architect/skills/proposal/assets/proposal-template.html +82 -0
- package/plugins/solution-architect/skills/proposal/references/interview.md +63 -0
- package/plugins/solution-architect/skills/proposal/references/review.md +28 -0
- package/plugins/solution-architect/skills/proposal/references/writing.md +102 -0
- package/plugins/solution-architect/skills/proposal/scripts/derive.mjs +22 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/checks-client.mjs +75 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/checks-doc.mjs +54 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/checks.mjs +17 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/figures.mjs +43 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/jargon.mjs +9 -0
- package/plugins/solution-architect/skills/proposal/scripts/lib/sections.mjs +32 -0
- package/plugins/solution-architect/skills/proposal/scripts/render.mjs +60 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/checks-client.test.mjs +144 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/checks-doc.test.mjs +93 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/docs.test.mjs +51 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/e2e.test.mjs +30 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/figures.test.mjs +81 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-fail.md +22 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-pass.md +55 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/quality-gates.test.mjs +20 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/render.test.mjs +70 -0
- package/plugins/solution-architect/skills/proposal/scripts/test/validate.test.mjs +40 -0
- package/plugins/solution-architect/skills/proposal/scripts/validate.mjs +20 -0
- package/src/cli/agents.mjs +12 -0
- package/src/cli/args.mjs +46 -0
- package/src/cli/install.mjs +68 -0
- package/src/cli/main.mjs +124 -0
- package/src/cli/picker.mjs +78 -0
- package/src/cli/registry.mjs +26 -0
- package/src/cli/uninstall.mjs +38 -0
package/plugins/solution-architect/skills/analyze-requirements/scripts/test/section-help.test.mjs
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { SPINE_TITLES, normTitle, sectionHelp, serialiseHelp } from '../lib/section-help.mjs';
|
|
4
|
+
|
|
5
|
+
const help = sectionHelp();
|
|
6
|
+
|
|
7
|
+
// references/writing.md states the spine headings never change, which is what
|
|
8
|
+
// makes the heading text a usable key. If a heading is renamed there, this test
|
|
9
|
+
// is the thing that says the explainer no longer reaches it.
|
|
10
|
+
test('every canonical spine heading has an explainer', () => {
|
|
11
|
+
assert.equal(SPINE_TITLES.length, 16);
|
|
12
|
+
for (const title of SPINE_TITLES) {
|
|
13
|
+
assert.ok(help.spine[title], `no explainer for "${title}"`);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
// An entry keyed on a heading that does not exist is dead weight that looks
|
|
18
|
+
// like coverage.
|
|
19
|
+
test('no explainer is keyed on a heading that does not exist', () => {
|
|
20
|
+
assert.deepEqual(Object.keys(help.spine).sort(), [...SPINE_TITLES].sort());
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('the three elected companions have an explainer and nothing else does', () => {
|
|
24
|
+
assert.deepEqual(Object.keys(help.companions).sort(),
|
|
25
|
+
['domain-overview', 'estimation', 'threat-model']);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// An empty field renders as a blank row in the panel, which reads as a bug
|
|
29
|
+
// rather than as an absence.
|
|
30
|
+
test('every explainer states all three fields', () => {
|
|
31
|
+
const all = [...Object.entries(help.spine), ...Object.entries(help.companions)];
|
|
32
|
+
assert.equal(all.length, 19);
|
|
33
|
+
for (const [key, entry] of all) {
|
|
34
|
+
for (const field of ['what', 'why', 'good']) {
|
|
35
|
+
assert.equal(typeof entry[field], 'string', `${key}.${field} is not a string`);
|
|
36
|
+
assert.ok(entry[field].trim().length > 20, `${key}.${field} is too short to help`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// The JSON is embedded into an inline <script> the same way THEME is. Prose is
|
|
42
|
+
// author-written and may legitimately contain "<", so an unescaped "</script"
|
|
43
|
+
// anywhere in it would end the element early and inject the rest as markup.
|
|
44
|
+
// themeJson gets away with a raw splice because a palette file is hex and keys;
|
|
45
|
+
// this is sentences.
|
|
46
|
+
test('serialising escapes every < so it cannot close the script element', () => {
|
|
47
|
+
const out = serialiseHelp({ spine: { X: { what: 'a </script> b', why: 'c', good: 'd' } } });
|
|
48
|
+
assert.doesNotMatch(out, /</);
|
|
49
|
+
assert.match(out, /\\u003c/);
|
|
50
|
+
assert.deepEqual(JSON.parse(out).spine.X.what, 'a </script> b');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// The keys came from references/writing.md, which tables the spine with the
|
|
54
|
+
// section number in its own column and an "&" in the title. The generator does
|
|
55
|
+
// not write headings that way: a real set (NoveonProposal/ARCHITECTURE.md) emits
|
|
56
|
+
// "## 1 Goals and Scope" — number folded into the heading, "and" spelled out. So
|
|
57
|
+
// every one of the 16 exact-match lookups missed and the viewer drew no buttons
|
|
58
|
+
// at all, while the hand-written fixture agreed with the mistake and 415 tests
|
|
59
|
+
// passed. These are the headings as a generator actually writes them.
|
|
60
|
+
const REAL_HEADINGS = [
|
|
61
|
+
'1 Goals and Scope', '2 Constraints', '3 Project Structure', '4 Solution Strategy',
|
|
62
|
+
'5 Architecture Model', '6 Core Components', '7 Runtime Behaviour', '8 Data Stores',
|
|
63
|
+
'9 External Integrations', '10 Deployment and Infrastructure', '11 Crosscutting Concepts',
|
|
64
|
+
'12 Security', '13 Quality Requirements and SLOs', '14 Decisions',
|
|
65
|
+
'15 Risks and Technical Debt', '16 Glossary',
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
test('every heading a generator really writes resolves to an explainer', () => {
|
|
69
|
+
const byNorm = new Map(SPINE_TITLES.map((t) => [normTitle(t), t]));
|
|
70
|
+
for (const heading of REAL_HEADINGS) {
|
|
71
|
+
assert.ok(byNorm.has(normTitle(heading)), `"${heading}" resolves to no explainer`);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// Both spellings have to land on the same entry, or fixing one set of documents
|
|
76
|
+
// breaks the other. The fixture writes "Goals & Scope"; real sets write
|
|
77
|
+
// "1 Goals and Scope".
|
|
78
|
+
test('the numbered and the ampersand spelling reach the same entry', () => {
|
|
79
|
+
assert.equal(normTitle('1 Goals and Scope'), normTitle('Goals & Scope'));
|
|
80
|
+
assert.equal(normTitle('10 Deployment and Infrastructure'), normTitle('Deployment & Infrastructure'));
|
|
81
|
+
assert.equal(normTitle('13 Quality Requirements and SLOs'), normTitle('Quality Requirements & SLOs'));
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
test('normalisation absorbs a trailing dot, odd casing and extra spaces', () => {
|
|
85
|
+
assert.equal(normTitle('4. Solution Strategy'), normTitle('Solution Strategy'));
|
|
86
|
+
assert.equal(normTitle('6) CORE Components'), normTitle('Core Components'));
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// A number is stripped only when it leads the heading. "16 Glossary" loses its
|
|
90
|
+
// number; a heading that is genuinely about a quantity must not.
|
|
91
|
+
test('normalisation does not eat a number that is part of the title', () => {
|
|
92
|
+
assert.equal(normTitle('C4 Model Levels'), 'c4 model levels');
|
|
93
|
+
assert.notEqual(normTitle('2 Constraints'), normTitle('Constraints 2'));
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// The 16 normalised keys must stay distinct, or one section silently shows
|
|
97
|
+
// another's explainer — worse than showing none.
|
|
98
|
+
test('no two spine titles collide once normalised', () => {
|
|
99
|
+
const seen = new Set(SPINE_TITLES.map(normTitle));
|
|
100
|
+
assert.equal(seen.size, 16, 'two spine titles normalise to the same key');
|
|
101
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { mkdtempSync, writeFileSync, mkdirSync } from 'node:fs';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { findFreePort } from '../lib/port.mjs';
|
|
7
|
+
import { createServer } from '../serve.mjs';
|
|
8
|
+
|
|
9
|
+
test('findFreePort returns a usable port', async () => {
|
|
10
|
+
const port = await findFreePort(4173);
|
|
11
|
+
assert.ok(port >= 4173);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('serves index.html, 404s missing, 403s traversal', async () => {
|
|
15
|
+
const dir = mkdtempSync(join(tmpdir(), 'analyze-requirements-'));
|
|
16
|
+
writeFileSync(join(dir, 'index.html'), '<h1>ok</h1>');
|
|
17
|
+
const srv = await createServer({ dir, port: await findFreePort(4200) });
|
|
18
|
+
const base = `http://127.0.0.1:${srv.port}`;
|
|
19
|
+
assert.equal((await fetch(`${base}/`)).status, 200);
|
|
20
|
+
assert.match(await (await fetch(`${base}/`)).text(), /ok/);
|
|
21
|
+
assert.equal((await fetch(`${base}/nope.js`)).status, 404);
|
|
22
|
+
assert.equal((await fetch(`${base}/..%2f..%2fetc%2fpasswd`)).status, 403);
|
|
23
|
+
srv.close();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('rejects sibling-prefix escape', async () => {
|
|
27
|
+
const parent = mkdtempSync(join(tmpdir(), 'analyze-requirements-'));
|
|
28
|
+
const dir = join(parent, 'viewer');
|
|
29
|
+
const evil = join(parent, 'viewer-evil');
|
|
30
|
+
for (const d of [dir, evil]) { mkdirSync(d); }
|
|
31
|
+
writeFileSync(join(evil, 'secret.txt'), 'leak');
|
|
32
|
+
const srv = await createServer({ dir, port: await findFreePort(4300) });
|
|
33
|
+
const res = await fetch(`http://127.0.0.1:${srv.port}/..%2fviewer-evil%2fsecret.txt`);
|
|
34
|
+
assert.equal(res.status, 403);
|
|
35
|
+
srv.close();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('malformed percent-encoding 400s without crashing the server', async () => {
|
|
39
|
+
const dir = mkdtempSync(join(tmpdir(), 'analyze-requirements-'));
|
|
40
|
+
writeFileSync(join(dir, 'index.html'), '<h1>ok</h1>');
|
|
41
|
+
const srv = await createServer({ dir, port: await findFreePort(4400) });
|
|
42
|
+
const base = `http://127.0.0.1:${srv.port}`;
|
|
43
|
+
const res = await fetch(`${base}/%zz`);
|
|
44
|
+
assert.equal(res.status, 400);
|
|
45
|
+
const followUp = await fetch(`${base}/`);
|
|
46
|
+
assert.equal(followUp.status, 200);
|
|
47
|
+
srv.close();
|
|
48
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { validateClusters } from '../lib/validate-clusters.mjs';
|
|
4
|
+
|
|
5
|
+
// Real get_architecture clusters: top_nodes are bare symbol names, packages are
|
|
6
|
+
// the top-level folders that bind the cluster. Key paths are file paths — the
|
|
7
|
+
// match runs paths against packages, never against symbol names.
|
|
8
|
+
const clusters = [
|
|
9
|
+
{ label: 'backend', cohesion: 0.83, top_nodes: ['createBooking', 'save', 'emit'], packages: ['backend'] },
|
|
10
|
+
{ label: 'frontend', cohesion: 0.2, top_nodes: ['HomePage'], packages: ['frontend'] },
|
|
11
|
+
];
|
|
12
|
+
const rows = [{ name: 'API', keyPaths: ['backend/src/services'] }];
|
|
13
|
+
|
|
14
|
+
test('matches file-path key paths against cluster packages', () => {
|
|
15
|
+
assert.deepEqual(validateClusters({ clusters, componentRows: rows }), []);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('fails high-cohesion cluster with no component row', () => {
|
|
19
|
+
const extra = [...clusters, { label: 'worker', cohesion: 0.9, top_nodes: ['processJob'], packages: ['worker'] }];
|
|
20
|
+
const findings = validateClusters({ clusters: extra, componentRows: rows });
|
|
21
|
+
assert.match(findings[0].message, /worker/);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('fails component whose key paths land in no cluster package', () => {
|
|
25
|
+
const rows2 = [...rows, { name: 'Ghost', keyPaths: ['ghost/src'] }];
|
|
26
|
+
const findings = validateClusters({ clusters, componentRows: rows2 });
|
|
27
|
+
assert.match(findings[0].message, /Ghost/);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('ignores low-cohesion clusters', () => {
|
|
31
|
+
const findings = validateClusters({ clusters, componentRows: rows, minCohesion: 0.5 });
|
|
32
|
+
assert.deepEqual(findings.filter((f) => f.message.includes('frontend')), []);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test('a package name alone is a valid key path, and prefixes do not false-match', () => {
|
|
36
|
+
const rows2 = [{ name: 'API', keyPaths: ['backend'] }, { name: 'Web', keyPaths: ['front'] }];
|
|
37
|
+
const findings = validateClusters({ clusters, componentRows: rows2 });
|
|
38
|
+
assert.equal(findings.length, 1);
|
|
39
|
+
assert.match(findings[0].message, /Web/);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('datastore rows named in the Data Stores section are exempt', () => {
|
|
43
|
+
const rows2 = [...rows, { name: 'MongoDB', keyPaths: ['—'] }];
|
|
44
|
+
const findings = validateClusters({ clusters, componentRows: rows2, storeNames: ['mongodb'] });
|
|
45
|
+
assert.deepEqual(findings, []);
|
|
46
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { validateDeployment } from '../lib/validate-deployment.mjs';
|
|
4
|
+
|
|
5
|
+
const model = {
|
|
6
|
+
elements: [
|
|
7
|
+
{ id: 'shop.api', kind: 'container', title: 'API' },
|
|
8
|
+
{ id: 'shop.web', kind: 'container', title: 'Web App' },
|
|
9
|
+
{ id: 'customer', kind: 'person', title: 'Customer' },
|
|
10
|
+
],
|
|
11
|
+
deployed: ['shop.api'],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
test('flags undeployed containers only', () => {
|
|
15
|
+
const findings = validateDeployment({ model });
|
|
16
|
+
assert.equal(findings.length, 1);
|
|
17
|
+
assert.match(findings[0].message, /Web App/);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('passes when every container is deployed', () => {
|
|
21
|
+
const all = { ...model, deployed: ['shop.api', 'shop.web'] };
|
|
22
|
+
assert.deepEqual(validateDeployment({ model: all }), []);
|
|
23
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { validateElections } from '../lib/validate-elections.mjs';
|
|
4
|
+
|
|
5
|
+
const full = [
|
|
6
|
+
{ name: 'threat-model', elected: true },
|
|
7
|
+
{ name: 'interface-contract', elected: true },
|
|
8
|
+
{ name: 'estimation', elected: false, reason: 'user declined estimates' },
|
|
9
|
+
{ name: 'domain-overview', elected: false, reason: 'thin domain: CLI wrapper' },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
test('passes a complete election record', () => {
|
|
13
|
+
assert.deepEqual(validateElections({ frontmatter: { electedDocs: full } }), []);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('fails when a companion has no record', () => {
|
|
17
|
+
const findings = validateElections({ frontmatter: { electedDocs: full.slice(0, 3) } });
|
|
18
|
+
assert.match(findings[0].message, /domain-overview/);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test('fails un-elected entry without reason', () => {
|
|
22
|
+
const docs = [...full.slice(0, 3), { name: 'domain-overview', elected: false }];
|
|
23
|
+
const findings = validateElections({ frontmatter: { electedDocs: docs } });
|
|
24
|
+
assert.match(findings[0].message, /reason/);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('fails when electedDocs missing entirely', () => {
|
|
28
|
+
const findings = validateElections({ frontmatter: {} });
|
|
29
|
+
assert.equal(findings.length, 1);
|
|
30
|
+
});
|
package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-links.test.mjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { validateLinks, slugify } from '../lib/validate-links.mjs';
|
|
4
|
+
|
|
5
|
+
const files = ['ARCHITECTURE.md', 'docs/adr/0007-gate.md'];
|
|
6
|
+
const anchors = { 'ARCHITECTURE.md': ['core-components', 'security'] };
|
|
7
|
+
|
|
8
|
+
test('slugify matches github style', () => {
|
|
9
|
+
assert.equal(slugify('Core Components'), 'core-components');
|
|
10
|
+
assert.equal(slugify('Quality Requirements & SLOs'), 'quality-requirements--slos');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test('passes valid file, anchor, and external links', () => {
|
|
14
|
+
const links = [
|
|
15
|
+
{ fromDoc: 'DOMAIN-OVERVIEW.md', href: 'docs/adr/0007-gate.md' },
|
|
16
|
+
{ fromDoc: 'DOMAIN-OVERVIEW.md', href: 'ARCHITECTURE.md#core-components' },
|
|
17
|
+
{ fromDoc: 'ARCHITECTURE.md', href: '#security' },
|
|
18
|
+
{ fromDoc: 'ARCHITECTURE.md', href: 'https://likec4.dev/' },
|
|
19
|
+
];
|
|
20
|
+
assert.deepEqual(validateLinks({ links, files, anchors }), []);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
test('resolves relative links against the linking doc directory', () => {
|
|
24
|
+
const links = [
|
|
25
|
+
{ fromDoc: 'docs/DOMAIN-OVERVIEW.md', href: 'adr/0007-gate.md' },
|
|
26
|
+
{ fromDoc: 'docs/DOMAIN-OVERVIEW.md', href: '../ARCHITECTURE.md#core-components' },
|
|
27
|
+
];
|
|
28
|
+
assert.deepEqual(validateLinks({ links, files, anchors }), []);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('fails missing file and missing anchor', () => {
|
|
32
|
+
const links = [
|
|
33
|
+
{ fromDoc: 'A.md', href: 'docs/adr/0099-none.md' },
|
|
34
|
+
{ fromDoc: 'A.md', href: 'ARCHITECTURE.md#nope' },
|
|
35
|
+
];
|
|
36
|
+
const findings = validateLinks({ links, files, anchors });
|
|
37
|
+
assert.equal(findings.length, 2);
|
|
38
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { validateModelTables } from '../lib/validate-model-tables.mjs';
|
|
4
|
+
|
|
5
|
+
const model = {
|
|
6
|
+
elements: [
|
|
7
|
+
{ id: 'shop.api', kind: 'container', title: 'API' },
|
|
8
|
+
{ id: 'shop.web', kind: 'container', title: 'Web App' },
|
|
9
|
+
{ id: 'stripe', kind: 'external', title: 'Stripe' },
|
|
10
|
+
],
|
|
11
|
+
deployed: ['shop.api'],
|
|
12
|
+
};
|
|
13
|
+
const components = { section: 'Core Components', headers: ['Component', 'src'],
|
|
14
|
+
rows: [['[API](#x)', 'observed'], ['Web App', 'observed']] };
|
|
15
|
+
const externals = { section: 'External Integrations', headers: ['System', 'src'],
|
|
16
|
+
rows: [['Stripe', 'researched [docs]']] };
|
|
17
|
+
const stores = { section: 'Data Stores', headers: ['Store', 'src'], rows: [['orders', 'observed']] };
|
|
18
|
+
|
|
19
|
+
test('passes when model and tables agree', () => {
|
|
20
|
+
const findings = validateModelTables({
|
|
21
|
+
model, tables: [components, externals, stores], erNames: ['orders'],
|
|
22
|
+
});
|
|
23
|
+
assert.deepEqual(findings, []);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test('fails component in table but not in model', () => {
|
|
27
|
+
const extra = { ...components, rows: [...components.rows, ['Ghost', 'proposed']] };
|
|
28
|
+
const findings = validateModelTables({ model, tables: [extra, externals, stores], erNames: ['orders'] });
|
|
29
|
+
assert.match(findings[0].message, /Ghost.*not in model/i);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test('fails container in model but missing from table', () => {
|
|
33
|
+
const thin = { ...components, rows: [components.rows[0]] };
|
|
34
|
+
const findings = validateModelTables({ model, tables: [thin, externals, stores], erNames: ['orders'] });
|
|
35
|
+
assert.match(findings[0].message, /Web App.*no table row/i);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('fails store without ER entity and vice versa', () => {
|
|
39
|
+
const findings = validateModelTables({
|
|
40
|
+
model, tables: [components, externals, stores], erNames: ['payments'],
|
|
41
|
+
});
|
|
42
|
+
assert.equal(findings.length, 2);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('real fixture: Stripe detected as external end-to-end', async () => {
|
|
46
|
+
const { readFileSync } = await import('node:fs');
|
|
47
|
+
const { extractModel } = await import('../lib/likec4-extract.mjs');
|
|
48
|
+
const raw = JSON.parse(readFileSync(new URL('./fixtures/sample-model.json', import.meta.url), 'utf8'));
|
|
49
|
+
const real = extractModel(raw);
|
|
50
|
+
assert.ok(real.elements.some((e) => e.kind === 'external' && e.title === 'Stripe'));
|
|
51
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { validateProvenance } from '../lib/validate-provenance.mjs';
|
|
4
|
+
|
|
5
|
+
const ok = { section: 'Core Components', headers: ['C', 'src'], rows: [['api', 'observed']] };
|
|
6
|
+
const badValue = { section: 'Data Stores', headers: ['S', 'src'], rows: [['pg', 'guessed']] };
|
|
7
|
+
const noColumn = { section: 'External Integrations', headers: ['System'], rows: [['stripe']] };
|
|
8
|
+
const generated = { section: 'Decisions', headers: ['ADR'], rows: [['0001']] };
|
|
9
|
+
|
|
10
|
+
test('passes valid tables and exempts generated sections', () => {
|
|
11
|
+
assert.deepEqual(validateProvenance({ tables: [ok, generated] }), []);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
test('fails a row with an unknown src value', () => {
|
|
15
|
+
const findings = validateProvenance({ tables: [badValue] });
|
|
16
|
+
assert.equal(findings.length, 1);
|
|
17
|
+
assert.match(findings[0].message, /guessed/);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('fails a table missing the src column', () => {
|
|
21
|
+
const findings = validateProvenance({ tables: [noColumn] });
|
|
22
|
+
assert.match(findings[0].message, /src column/);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('accepts researched with a source suffix', () => {
|
|
26
|
+
const t = { section: 'X', headers: ['A', 'src'], rows: [['a', 'researched [stripe docs]']] };
|
|
27
|
+
assert.deepEqual(validateProvenance({ tables: [t] }), []);
|
|
28
|
+
});
|
package/plugins/solution-architect/skills/analyze-requirements/scripts/test/validate-tree.test.mjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { validateTree } from '../lib/validate-tree.mjs';
|
|
4
|
+
|
|
5
|
+
test('passes when boundary map matches filesystem', () => {
|
|
6
|
+
const findings = validateTree({ boundaryRows: ['src/', 'docs'], fsDirs: ['src', 'docs'] });
|
|
7
|
+
assert.deepEqual(findings, []);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('fails documented dir missing from fs', () => {
|
|
11
|
+
const findings = validateTree({ boundaryRows: ['src', 'src/legacy/'], fsDirs: ['src'] });
|
|
12
|
+
assert.equal(findings.length, 1);
|
|
13
|
+
assert.match(findings[0].message, /src\/legacy.*not found/);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('fails fs dir absent from boundary map', () => {
|
|
17
|
+
const findings = validateTree({ boundaryRows: ['src'], fsDirs: ['src', 'scripts'] });
|
|
18
|
+
assert.equal(findings.length, 1);
|
|
19
|
+
assert.match(findings[0].message, /scripts.*not documented/);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('nested fs dir is covered by a documented ancestor', () => {
|
|
23
|
+
const findings = validateTree({ boundaryRows: ['src'], fsDirs: ['src', 'src/billing'] });
|
|
24
|
+
assert.deepEqual(findings, []);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
test('a documented hidden dir that exists is not reported missing', () => {
|
|
28
|
+
const findings = validateTree({
|
|
29
|
+
boundaryRows: ['.claude-plugin', 'src'],
|
|
30
|
+
fsDirs: ['src'],
|
|
31
|
+
allDirs: ['.claude-plugin', 'src'],
|
|
32
|
+
});
|
|
33
|
+
assert.deepEqual(findings, []);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('a hidden dir still does not have to be documented', () => {
|
|
37
|
+
const findings = validateTree({
|
|
38
|
+
boundaryRows: ['src'],
|
|
39
|
+
fsDirs: ['src'],
|
|
40
|
+
allDirs: ['.git', 'src'],
|
|
41
|
+
});
|
|
42
|
+
assert.deepEqual(findings, []);
|
|
43
|
+
});
|