You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1de90e9
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: CHANGELOG.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,23 @@ pattern.
13
13
14
14
## [Unreleased]
15
15
16
+
## [1.0.2] — 2026-06-12
17
+
18
+
### Added
19
+
- Added eval coverage for unsafe output directories, stale generated-output cleanup, unsafe entity IDs, status badge contrast, generated URL path stability, and JSON-RPC notification silence.
20
+
- Documented slug-safe entity IDs, generated-output cleanup behavior, and MCP notification semantics across human docs and agent-facing guides.
21
+
22
+
### Changed
23
+
- Bumped the GuideCheck assistant guide to `1.0.1` with repository-specific generated-output and slug-ID constraints.
24
+
- Regenerated tracked `docs/` and `demo/` outputs after status badge contrast hardening.
25
+
16
26
### Fixed
27
+
- Refused unsafe build output directories before cleanup and removed stale files only under generator-owned output paths.
28
+
- Rejected unsafe filenames, mapping IDs, and mapping references during validation and build.
29
+
- Encoded generated URL path segments after strict ID validation.
30
+
- Computed status badge foreground colors from background luminance instead of hard-coding theme text colors.
31
+
- Stopped returning JSON-RPC errors for notifications that omit `id`.
32
+
- Refreshed content-provenance hashes after intentional README, guide, and tooling updates.
17
33
- Made `scripts/build.js` output reproducible by sourcing generated-output timestamps (`meta.generated`, `agents.json``last_updated`, sitemap `lastmod`, RSS `lastBuildDate`) from the freshest date in the data rather than wall-clock time. The "generated outputs are current" CI gate could never pass before, because each rebuild stamped a new `new Date()` into committed artifacts.
18
34
19
35
## [1.0.1] — 2026-05-30
@@ -136,7 +152,8 @@ canonical pattern definition at <https://knowledge-as-code.com/>.
136
152
site generator, `scripts/validate.js` cross-reference linter, example data for ISO 27001 and
Copy file name to clipboardExpand all lines: README.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ Built examples using this template:
31
31
1.**Use this template** -- on GitHub, click the green "Use this template" button (not "Clone"). This creates a new repo with no git history and no upstream connection. Cloning is fine for local exploration but won't give you a clean starting repo.
32
32
2.**Edit `project.yml`** -- start with the entity names (`entities.primary.name`, `entities.container.name`, etc.) and groups. You can adjust colors and navigation later. Leave `url` until your GitHub repo is configured.
33
33
3.**Replace example data** -- delete the files in `data/examples/requirements/`, `data/examples/frameworks/`, `data/examples/organizations/`, and `data/examples/mapping/index.yml`, then add your own. See [Replacing example data](#replacing-example-data) and [`data/_schema.md`](data/_schema.md) for the format.
34
-
4.**Build** -- `node scripts/build.js`. A successful build prints `Build complete — N HTML pages, N JSON API files`. Check the `docs/` directory for the output, and open any HTML file in a browser to verify it looks right.
34
+
4.**Build** -- `node scripts/build.js`. A successful build prints `Build complete — N HTML pages, N JSON API files`. Check the `docs/` directory for the output, and open any HTML file in a browser to verify it looks right. The build cleans generator-owned paths in the output directory before writing fresh files, so removed or renamed entities do not leave stale generated pages behind.
35
35
5.**Deploy** -- choose your Pages strategy. This repo validates builds in CI, but it does not auto-deploy template forks by default. If you want automated deployment, add a Pages publish step for your repo.
36
36
6.**(Optional) Publish your knowledge base as an MCP server** -- if you want anyone to install your knowledge base as an MCP-aware agent tool via `npx -y your-package`, follow [PUBLISH-MCP.md](PUBLISH-MCP.md). It walks through the package.json prep, npm publish, and Official MCP Registry submission, with the gotchas that bit us when we did this for three sibling projects.
37
37
@@ -42,6 +42,7 @@ This repository intentionally tracks generated output in both `docs/` and `demo/
42
42
-`docs/` is the template-default generated site output.
43
43
-`demo/` is the canonical reference build used for `https://knowledge-as-code.com/demo/`.
44
44
- Neither directory should be edited by hand. Regenerate them with `node scripts/build.js` or the `KAC_OUTPUT_DIR=demo KAC_SITE_URL="https://knowledge-as-code.com/demo/" node scripts/build.js` variant.
45
+
- During each build, the generator removes only paths it owns in the target output directory (`api/`, `assets/`, entity/bridge page directories, and generated root files). It refuses to clean the repository root or a parent directory.
45
46
46
47
Template forks do not need to follow this policy. A fork can either:
47
48
@@ -151,6 +152,8 @@ All domain-specific settings live in `project.yml`:
151
152
152
153
Generated pages normalize external URLs to `https` and bare domains. Avoid `http`, `javascript:`, and `www` in project data; unsafe protocols are dropped from generated links. Configured colors should be hex values such as `#4fc3f7`; invalid color values fall back to safe defaults.
153
154
155
+
Entity filenames and mapping IDs must be lowercase slug IDs: `a-z`, `0-9`, and single hyphens only, such as `access-control` or `iso-27001`. The filename without `.md` is the entity ID. Mapping references must use those same IDs. `node scripts/validate.js` and `node scripts/build.js` both reject unsafe IDs before generated HTML, filesystem paths, JSON discovery files, or MCP responses are produced.
156
+
154
157
## Replacing example data
155
158
156
159
The template ships with example data in `data/examples/` (ISO 27001, NIST CSF). To replace it with your own domain:
@@ -177,7 +180,7 @@ npm run eval
177
180
178
181
That runs the broader smoke/eval suite covering builds, links, API shape, parser fixtures, MCP smoke, and documentation consistency.
179
182
180
-
The build script looks for data in `data/examples/` first, then `data/`. You can rename `data/examples/` to `data/` if you prefer a flatter structure.
183
+
The build script looks for data in `data/examples/` first, then `data/`. You can rename `data/examples/` to `data/` if you prefer a flatter structure. Keep filenames slug-safe because the generated site, JSON API, MCP tools, search index, sitemap, and agents.json all use the filename-derived IDs.
181
184
182
185
**What to keep:** Only `data/` contents and `project.yml` values need replacing. Do not delete `scripts/`, `.github/workflows/`, `mcp-server.js`, `mcp.json`, or `package.json` — these are the template engine and deployment config.
Copy file name to clipboardExpand all lines: data/_schema.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,9 @@ This file documents the file format for each entity type. All data files use YAM
8
8
9
9
**Example:**`requirements/access-control.md`
10
10
11
+
The filename without `.md` is the entity ID. It must be a lowercase slug using
12
+
only `a-z`, `0-9`, and single hyphens, such as `access-control`.
13
+
11
14
```yaml
12
15
---
13
16
id: access-control # Required. Kebab-case identifier, must match filename
@@ -43,6 +46,9 @@ One paragraph describing the requirement.
43
46
44
47
**Example:**`frameworks/iso-27001.md`
45
48
49
+
The filename without `.md` is the container ID. It must be a lowercase slug
50
+
using only `a-z`, `0-9`, and single hyphens, such as `iso-27001`.
51
+
46
52
```yaml
47
53
---
48
54
name: ISO 27001 # Required. Human-readable name
@@ -120,6 +126,9 @@ last_verified: 2026-03-25 # Optional. Date of last verification check
120
126
121
127
**Example:**`organizations/iso.md`
122
128
129
+
The filename without `.md` is the authority ID. It must be a lowercase slug
130
+
using only `a-z`, `0-9`, and single hyphens, such as `iso`.
131
+
123
132
```yaml
124
133
---
125
134
id: iso # Required. Kebab-case identifier
@@ -145,7 +154,7 @@ The heading name should match your container entity's plural name (e.g., "Regula
145
154
146
155
**Path:**`data/examples/mapping/index.yml` (configured in `project.yml` as `mapping.file`)
147
156
148
-
The mapping file connects containers to primaries through secondary (provision) entities:
157
+
The mapping file connects containers to primaries through secondary (provision) entities. Mapping IDs and every entity reference must use the same lowercase slug format as filenames.
149
158
150
159
```yaml
151
160
- id: iso-27001-access-control # Required. Unique provision ID (kebab-case)
@@ -163,9 +172,11 @@ The `regulation` field should use your container entity name from config (the fi
163
172
164
173
## File naming
165
174
166
-
- All files use kebab-case: `access-control.md`, `iso-27001.md`
167
-
- The filename (without `.md`) is used as the entity ID for primaries and authorities
168
-
- Container files use the `name` frontmatter field (lowercased, spaces replaced with hyphens) as their ID
175
+
- All files use lowercase slug filenames: `access-control.md`, `iso-27001.md`
176
+
- Slugs may contain only `a-z`, `0-9`, and single hyphens
177
+
- The filename without `.md` is used as the entity ID for primaries, containers, and authorities
178
+
- Mapping IDs and mapping references must use the same slug format
0 commit comments