@yawlabs/ctxlint 0.13.2 → 0.14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/ctxlint",
3
- "version": "0.13.2",
3
+ "version": "0.14.0",
4
4
  "mcpName": "io.github.YawLabs/ctxlint",
5
5
  "description": "Lint your AI agent context files, MCP server configs, and session data against your actual codebase",
6
6
  "bin": {
@@ -61,7 +61,6 @@
61
61
  "AGENT_SKILL_LINT_SPEC.md",
62
62
  "context-lint-rules.json",
63
63
  "mcp-config-lint-rules.json",
64
- "mcph-config-lint-rules.json",
65
64
  "agent-session-lint-rules.json",
66
65
  "agent-skill-lint-rules.json",
67
66
  "schemas/ctxlint-catalog.schema.json",
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://raw.githubusercontent.com/YawLabs/ctxlint/main/schemas/ctxlint-catalog.schema.json",
4
4
  "title": "ctxlint rule catalog",
5
- "description": "Governing schema for the machine-readable rule catalogs that back the ctxlint specifications (context-, mcp-config-, mcph-config-, agent-session-lint-rules.json). Defines the shared metadata block + the rule/category shape every catalog must satisfy. Per-catalog extras (formats, clients, agents, dataSources, target, mcphSchemaReference) are permitted via additionalProperties.",
5
+ "description": "Governing schema for the machine-readable rule catalogs that back the ctxlint specifications (context-, mcp-config-, agent-session-lint-rules.json). Defines the shared metadata block + the rule/category shape every catalog must satisfy. Per-catalog extras (formats, clients, agents, dataSources, target) are permitted via additionalProperties.",
6
6
  "type": "object",
7
7
  "required": ["$schema", "specVersion", "specDate", "repository", "categories", "rules"],
8
8
  "additionalProperties": true,
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "mcpSpecCompatibility": {
33
33
  "type": "string",
34
- "description": "Shared optional field: the Model Context Protocol wire-spec version this catalog tracks (date-stamped, e.g. \"2025-11-25\"). Present only on catalogs whose rules are bound to the MCP protocol version (mcp-config). Absent (meaningfully) on catalogs that are protocol-agnostic (context, agent-session, mcph-config).",
34
+ "description": "Shared optional field: the Model Context Protocol wire-spec version this catalog tracks (date-stamped, e.g. \"2025-11-25\"). Present only on catalogs whose rules are bound to the MCP protocol version (mcp-config). Absent (meaningfully) on catalogs that are protocol-agnostic (context, agent-session).",
35
35
  "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
36
36
  },
37
37
  "repository": {
@@ -1,151 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/YawLabs/ctxlint/main/schemas/ctxlint-catalog.schema.json",
3
- "specVersion": "1.0.0-draft",
4
- "specDate": "2026-04-16",
5
- "mcphSchemaReference": "https://raw.githubusercontent.com/YawLabs/mcph/main/schemas/mcph.config.v1.json",
6
- "repository": "https://github.com/YawLabs/ctxlint",
7
- "target": ".mcph.json",
8
- "description": "Rules for linting .mcph.json — the config file read by the @yawlabs/mcph CLI (which orchestrates MCP servers via the mcp.hosting registry). Distinct from .mcp.json (client-side server list) — different threat model, different schema. Applies across the user-global (~/.mcph.json), per-project (.mcph.json), and machine-local (.mcph.local.json) scope cascade.",
9
- "categories": [
10
- {
11
- "id": "mcph-token-security",
12
- "name": "Token Security",
13
- "description": "Detects PAT (mcp_pat_*) leaks, format errors, and promotes env-var-only posture."
14
- },
15
- {
16
- "id": "mcph-apibase",
17
- "name": "API Endpoint Validation",
18
- "description": "Validates the apiBase URL, flags plaintext HTTP to public hosts."
19
- },
20
- {
21
- "id": "mcph-schema-conformance",
22
- "name": "Schema Conformance",
23
- "description": "Catches unknown/typo'd fields and stale schema versions."
24
- },
25
- {
26
- "id": "mcph-lists",
27
- "name": "Allow/Deny List Semantics",
28
- "description": "Flags conflicts and duplicates in the servers/blocked arrays."
29
- },
30
- {
31
- "id": "mcph-gitignore",
32
- "name": "Gitignore Hygiene",
33
- "description": "Ensures machine-local override files never get committed."
34
- }
35
- ],
36
- "rules": [
37
- {
38
- "id": "mcph-config/token-in-project-scope",
39
- "category": "mcph-token-security",
40
- "severity": "error",
41
- "description": "A project-scope .mcph.json that is git-tracked contains a \"token\" field. The PAT will leak via git history.",
42
- "trigger": "scope === 'project' && isGitTracked && token field present",
43
- "message": "\"token\" in a git-tracked project-scope .mcph.json — PAT will leak via git history",
44
- "fixable": false,
45
- "remediation": "Move the token to ~/.mcph.json, .mcph.local.json (gitignored), or export MCPH_TOKEN as an environment variable. Rotate the token immediately if already committed.",
46
- "stability": "stable"
47
- },
48
- {
49
- "id": "mcph-config/local-file-not-gitignored",
50
- "category": "mcph-gitignore",
51
- "severity": "error",
52
- "description": "A .mcph.local.json file exists but is not covered by .gitignore. The file exists precisely so machine-local overrides stay machine-local.",
53
- "trigger": "scope === 'project-local' && !isGitignored",
54
- "message": "{file} is not covered by .gitignore — machine-local overrides can leak via git",
55
- "fixable": true,
56
- "fixDescription": "Append \".mcph.local.json\" to .gitignore in the project root.",
57
- "stability": "stable"
58
- },
59
- {
60
- "id": "mcph-config/invalid-token-format",
61
- "category": "mcph-token-security",
62
- "severity": "error",
63
- "description": "The \"token\" value doesn't match the mcp.hosting PAT format (^mcp_pat_[A-Za-z0-9_-]+$).",
64
- "trigger": "token present and regex match fails",
65
- "message": "\"token\" does not match expected format ^mcp_pat_[A-Za-z0-9_-]+$",
66
- "fixable": false,
67
- "remediation": "Re-issue the token from https://mcp.hosting/settings/tokens.",
68
- "stability": "stable"
69
- },
70
- {
71
- "id": "mcph-config/insecure-apibase",
72
- "category": "mcph-apibase",
73
- "severity": "warning",
74
- "description": "The \"apiBase\" URL uses plaintext HTTP to a public (non-localhost, non-private) host. The MCPH_TOKEN would travel in the clear.",
75
- "trigger": "apiBase protocol === 'http:' && !isPrivateHost(hostname)",
76
- "message": "\"apiBase\" uses plaintext HTTP to a public host ({hostname})",
77
- "fixable": false,
78
- "remediation": "Use https:// instead. Private hosts (localhost, 10.*, 192.168.*, 172.16–31.*, *.local, *.internal) are allowed without TLS.",
79
- "stability": "stable"
80
- },
81
- {
82
- "id": "mcph-config/invalid-apibase",
83
- "category": "mcph-apibase",
84
- "severity": "error",
85
- "description": "The \"apiBase\" field is not a valid absolute URL.",
86
- "trigger": "new URL(apiBase) throws",
87
- "message": "\"apiBase\" is not a valid URL: {value}",
88
- "fixable": false,
89
- "remediation": "Use an absolute http(s) URL, e.g. \"https://mcp.hosting\".",
90
- "stability": "stable"
91
- },
92
- {
93
- "id": "mcph-config/unknown-field",
94
- "category": "mcph-schema-conformance",
95
- "severity": "warning",
96
- "description": "A top-level field appears that is not in the mcph config schema. Usually a typo (tokens vs token, blockList vs blocked).",
97
- "trigger": "top-level key not in { $schema, version, token, apiBase, servers, blocked }",
98
- "message": "unknown field \"{name}\" — not in the mcph config schema",
99
- "fixable": false,
100
- "remediation": "Check for typos; compare against https://raw.githubusercontent.com/YawLabs/mcph/main/schemas/mcph.config.v1.json.",
101
- "stability": "stable"
102
- },
103
- {
104
- "id": "mcph-config/stale-version",
105
- "category": "mcph-schema-conformance",
106
- "severity": "info",
107
- "description": "The \"version\" field is older than the current schema version.",
108
- "trigger": "version < CURRENT_SCHEMA_VERSION (=1)",
109
- "message": "\"version\": {value} is older than the current schema version ({current})",
110
- "fixable": false,
111
- "remediation": "Bump to the current version. Older values continue to load but may miss newer fields.",
112
- "stability": "stable"
113
- },
114
- {
115
- "id": "mcph-config/allowlist-denylist-conflict",
116
- "category": "mcph-lists",
117
- "severity": "warning",
118
- "description": "A server namespace appears in both the allow-list (\"servers\") and deny-list (\"blocked\"). Deny wins in practice, so the allow-list entry is dead weight.",
119
- "trigger": "name ∈ servers && name ∈ blocked",
120
- "message": "server \"{name}\" is in both \"servers\" (allow-list) and \"blocked\" (deny-list)",
121
- "fixable": false,
122
- "remediation": "Remove the namespace from one of the two lists.",
123
- "stability": "stable"
124
- },
125
- {
126
- "id": "mcph-config/duplicate-entries",
127
- "category": "mcph-lists",
128
- "severity": "info",
129
- "description": "The same value appears more than once in a servers or blocked array.",
130
- "trigger": "duplicate string in servers[] or blocked[]",
131
- "message": "\"{value}\" appears multiple times in \"{listName}\" (first at line {firstLine})",
132
- "fixable": false,
133
- "remediation": "Remove the duplicate entry.",
134
- "stability": "stable"
135
- },
136
- {
137
- "id": "mcph-config/prefer-env-token",
138
- "category": "mcph-token-security",
139
- "severity": "warning",
140
- "configurable": true,
141
- "configKey": "mcphStrictEnvToken",
142
- "configurableSeverity": "error",
143
- "description": "The \"token\" field is present in any .mcph.json scope. An environment variable (MCPH_TOKEN) is safer — files survive backups, screen shares, cloud sync, and editor indexing.",
144
- "trigger": "token field present in any scope (and token-in-project-scope did not already fire)",
145
- "message": "prefer MCPH_TOKEN env var over a file-stored token in {file}",
146
- "fixable": false,
147
- "remediation": "Delete the \"token\" field and export MCPH_TOKEN in your shell/env manager (bash/zsh, fish, PowerShell, direnv).",
148
- "stability": "stable"
149
- }
150
- ]
151
- }