Skip to content

Commit 83fb669

Browse files
committed
feat(ci): add Markdown and Mermaid linting
Introduce `markdown:lint` which chains structural markdown checks (markdownlint-cli2) and Mermaid diagram validation. Both run as part of `mise run lint` and as a dedicated GitHub Actions job. Mermaid diagrams are validated by calling `mermaid.parse()` via a small Node script with a jsdom shim — no Chromium/Puppeteer required. This catches real parse errors (e.g. the `exec()s` sequence-diagram bug in `architecture/sandbox-connect.md`) that browser-free alternatives like `maid` silently miss. Tooling: - `.markdownlint-cli2.jsonc` with `gitignore: true`, sensible rule overrides (MD033 allowlist for GitHub-rendered HTML, MD060 padded table style, MD013/MD034 off to match project style). - `docs/.markdownlint-cli2.jsonc` overrides for MDX (no top-level H1, JSX components may look like HTML). - `scripts/lint-mermaid/` hosts the validator with a committed `package-lock.json` for reproducible CI installs (`npm ci`). - `markdownlint-cli2` pinned via mise `npm:` backend. Existing doc fixes applied to satisfy the new checks: adds `text` language to bare code fences (via one-shot codemod), corrects list indentation at the single-digit → double-digit boundary in `architecture/sandbox.md`, plus minor blank-line and trailing-newline fixes.
1 parent 4483c86 commit 83fb669

47 files changed

Lines changed: 2398 additions & 77 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/branch-checks.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,20 @@ jobs:
100100

101101
- name: Test
102102
run: mise run test:python
103+
104+
markdown:
105+
name: Markdown
106+
runs-on: build-amd64
107+
container:
108+
image: ghcr.io/nvidia/openshell/ci:latest
109+
credentials:
110+
username: ${{ github.actor }}
111+
password: ${{ secrets.GITHUB_TOKEN }}
112+
steps:
113+
- uses: actions/checkout@v4
114+
115+
- name: Install tools
116+
run: mise install
117+
118+
- name: Lint
119+
run: mise run markdown:lint

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,6 @@ architecture/plans
202202
rfc.md
203203
.worktrees
204204
.z3-trace
205+
206+
# Markdown/mermaid lint tooling deps
207+
scripts/lint-mermaid/node_modules/

.markdownlint-cli2.jsonc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"globs": [
3+
"**/*.md",
4+
"**/*.mdx"
5+
],
6+
"gitignore": true,
7+
"ignores": [
8+
".agents/**",
9+
".claude/**",
10+
".opencode/**",
11+
".github/**",
12+
"THIRD-PARTY-NOTICES/**",
13+
"CLAUDE.md"
14+
],
15+
"config": {
16+
"default": true,
17+
// Allow long lines — prose paragraphs are single-line per project style.
18+
"MD013": false,
19+
// Allow GitHub-rendered HTML commonly used in READMEs (centered logos,
20+
// collapsible sections, keyboard hints). Regular prose HTML still flagged.
21+
"MD033": { "allowed_elements": ["p", "img", "br", "a", "div", "details", "summary", "kbd", "sub", "sup"] },
22+
// Allow duplicate headings in different sections.
23+
"MD024": { "siblings_only": true },
24+
// Bare URLs are fine in changelogs and tables.
25+
"MD034": false,
26+
// First line does not need to be a heading.
27+
"MD002": false,
28+
// Repo uses padded table pipes (`| foo | bar |`); rule default is "compact".
29+
"MD060": { "style": "padded" }
30+
}
31+
}

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@AGENTS.md
1+
@AGENTS.md

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ See [docs/CONTRIBUTING.mdx](docs/CONTRIBUTING.mdx) for the current docs authorin
258258

259259
This project uses [Conventional Commits](https://www.conventionalcommits.org/). All commit messages must follow the format:
260260

261-
```
261+
```text
262262
<type>(<scope>): <description>
263263
264264
[optional body]
@@ -279,7 +279,7 @@ This project uses [Conventional Commits](https://www.conventionalcommits.org/).
279279

280280
**Examples:**
281281

282-
```
282+
```text
283283
feat(cli): add --verbose flag to openshell run
284284
fix(sandbox): handle timeout errors gracefully
285285
docs: update installation instructions

SECURITY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Security
1+
# Security
22

33
NVIDIA is dedicated to the security and trust of our software products and services, including all source code repositories managed through our organization.
44

TESTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mise run ci # Everything: lint, compile checks, and tests
1010

1111
## Test Layout
1212

13-
```
13+
```text
1414
crates/*/src/ # Inline #[cfg(test)] modules
1515
crates/*/tests/ # Rust integration tests
1616
python/openshell/ # Python unit tests (*_test.py suffix)

architecture/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ The connection flow works as follows:
142142
5. The CLI and sandbox exchange SSH traffic bidirectionally through the tunnel.
143143

144144
This design provides several benefits:
145+
145146
- Sandbox pods are never directly accessible from outside the cluster.
146147
- All access is authenticated and auditable through the gateway.
147148
- Session tokens can be revoked to immediately cut off access.
@@ -198,7 +199,6 @@ The inference routing system transparently intercepts AI inference API calls fro
198199
| Gateway inference service | `crates/openshell-server/src/inference.rs` | Stores cluster inference config, resolves bundles with credentials from provider records |
199200
| Proto definitions | `proto/inference.proto` | `ClusterInferenceConfig`, `ResolvedRoute`, bundle RPCs |
200201

201-
202202
### Container and Build System
203203

204204
The platform produces three container images:

architecture/custom-vm-runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ never binds a host-side TCP listener.
6161
`openshell-driver-vm` embeds the VM runtime libraries and the sandbox rootfs as
6262
zstd-compressed byte arrays, extracting on demand:
6363

64-
```
64+
```text
6565
~/.local/share/openshell/vm-runtime/<version>/ # libkrun / libkrunfw / gvproxy
6666
├── libkrun.{dylib,so}
6767
├── libkrunfw.{5.dylib,so.5}

architecture/gateway-deploy-connect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ This stores `auth_mode = "plaintext"`, skips mTLS certificate extraction, and by
9999

100100
All connection artifacts are stored under `$XDG_CONFIG_HOME/openshell/` (default `~/.config/openshell/`):
101101

102-
```
102+
```text
103103
openshell/
104104
active_gateway # plain text: active gateway name
105105
gateways/

0 commit comments

Comments
 (0)