code-auditor-mcp 5.0.1 → 5.0.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.
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +43 -0
- package/dist/analyzers/handleIdentification.d.ts.map +1 -1
- package/dist/analyzers/handleIdentification.js +4 -1
- package/dist/analyzers/handleIdentification.js.map +1 -1
- package/dist/analyzers/receiverRoot.d.ts +20 -0
- package/dist/analyzers/receiverRoot.d.ts.map +1 -1
- package/dist/analyzers/receiverRoot.js +42 -0
- package/dist/analyzers/receiverRoot.js.map +1 -1
- package/dist/analyzers/tsEcosystem.d.ts.map +1 -1
- package/dist/analyzers/tsEcosystem.js +10 -0
- package/dist/analyzers/tsEcosystem.js.map +1 -1
- package/dist/auditRunner.d.ts +2 -0
- package/dist/auditRunner.d.ts.map +1 -1
- package/dist/auditRunner.js +23 -18
- package/dist/auditRunner.js.map +1 -1
- package/dist/cli.js +17 -3
- package/dist/cli.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/daemon/main.d.ts.map +1 -1
- package/dist/daemon/main.js +20 -4
- package/dist/daemon/main.js.map +1 -1
- package/dist/graph/resolutionEnvironment.d.ts +61 -0
- package/dist/graph/resolutionEnvironment.d.ts.map +1 -0
- package/dist/graph/resolutionEnvironment.js +57 -0
- package/dist/graph/resolutionEnvironment.js.map +1 -0
- package/dist/phase/phaseModel.d.ts.map +1 -1
- package/dist/phase/phaseModel.js +61 -38
- package/dist/phase/phaseModel.js.map +1 -1
- package/dist/phase/producers.d.ts.map +1 -1
- package/dist/phase/producers.js +3 -0
- package/dist/phase/producers.js.map +1 -1
- package/dist/phase/receiverConsumers.d.ts +8 -1
- package/dist/phase/receiverConsumers.d.ts.map +1 -1
- package/dist/phase/receiverConsumers.js +59 -21
- package/dist/phase/receiverConsumers.js.map +1 -1
- package/dist/phase/receiverProvenance.d.ts +23 -0
- package/dist/phase/receiverProvenance.d.ts.map +1 -1
- package/dist/phase/receiverProvenance.js +40 -0
- package/dist/phase/receiverProvenance.js.map +1 -1
- package/dist/phase/types.d.ts +8 -0
- package/dist/phase/types.d.ts.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/package.json +8 -5
- package/plugin/.claude-plugin/manifest.json +9 -9
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/hooks/hooks.json +4 -4
- package/plugin/scripts/hook-audit.sh +5 -2
- package/plugin/scripts/hook-common.sh +33 -9
- package/plugin/scripts/hook-drift-check.sh +9 -5
- package/plugin/scripts/hook-self-audit.sh +5 -2
- package/plugin/scripts/hook-warm.sh +5 -6
- package/plugin/skills/code-auditor/SKILL.md +1 -1
- package/server.json +10 -4
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "5.0.
|
|
2
|
+
"version": "5.0.2",
|
|
3
3
|
"files": {
|
|
4
|
-
".claude-plugin/plugin.json": "
|
|
4
|
+
".claude-plugin/plugin.json": "1b950b987f07b25990f29959dc696fd1323dc4dfdda367e2c21fb32638e083be",
|
|
5
5
|
"README.md": "6e51516ead6c7d0b4e77629e071e139b899d30a47838e8721c0d534eb733ad45",
|
|
6
|
-
"hooks/hooks.json": "
|
|
7
|
-
"scripts/hook-audit.sh": "
|
|
8
|
-
"scripts/hook-common.sh": "
|
|
9
|
-
"scripts/hook-drift-check.sh": "
|
|
10
|
-
"scripts/hook-self-audit.sh": "
|
|
11
|
-
"scripts/hook-warm.sh": "
|
|
6
|
+
"hooks/hooks.json": "28c4d7e87f1bb0daae8d9c714a196c39809039509568cf89a67c0377090f7211",
|
|
7
|
+
"scripts/hook-audit.sh": "25353d88a020d71586bb52ec6800438ab1f500e987c639837be52529fe2dc5fe",
|
|
8
|
+
"scripts/hook-common.sh": "85fd91c7a3817c01557383aadeff578696a9400698806d2d310ffd1caa954e06",
|
|
9
|
+
"scripts/hook-drift-check.sh": "fdf1f8098d9dda8911daedfd4b038c310c8383da57938a6737131cd33cb9492e",
|
|
10
|
+
"scripts/hook-self-audit.sh": "1a19f4ddec4cf66d9feb97999e70eb664817b0d6dd811f498d3cdef2f26d63b2",
|
|
11
|
+
"scripts/hook-warm.sh": "3d0fa8d811a26eda29c1a4dcbd88e6861eef93425355c87d6fe72356b3e7b5b3",
|
|
12
12
|
"skills/code-auditor/SKILL-RULE-KINDS.md": "be1bbe1b56b19dc112c2657c1f5984f6f704b2ac9c1c0f78a561a58b110d508a",
|
|
13
13
|
"skills/code-auditor/SKILL-SEARCH.md": "95d2df4474995bc5b18e14cc55ac55fb828024541463f109239567e2aa5ab7b0",
|
|
14
|
-
"skills/code-auditor/SKILL.md": "
|
|
14
|
+
"skills/code-auditor/SKILL.md": "a66b4849ffa98adac0817e6ef0712e6b5e1fa292ceaa094717795aeb7299b9a6"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "code-auditor",
|
|
3
3
|
"description": "Diff-scoped code quality auditing on every edit. Indexes your codebase, enforces invariants, and feeds violations back to the agent so fixes happen inline.",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ben Hammond",
|
|
7
7
|
"email": "ben@benhammond.tech"
|
package/plugin/hooks/hooks.json
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
|
-
"command": "
|
|
9
|
+
"command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/hook-warm.sh"
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"type": "command",
|
|
13
|
-
"command": "
|
|
13
|
+
"command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/hook-drift-check.sh"
|
|
14
14
|
}
|
|
15
15
|
]
|
|
16
16
|
}
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"hooks": [
|
|
22
22
|
{
|
|
23
23
|
"type": "command",
|
|
24
|
-
"command": "
|
|
24
|
+
"command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/hook-audit.sh"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"type": "command",
|
|
28
|
-
"command": "
|
|
28
|
+
"command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/hook-self-audit.sh"
|
|
29
29
|
}
|
|
30
30
|
]
|
|
31
31
|
}
|
|
@@ -16,8 +16,11 @@
|
|
|
16
16
|
# failure surfaces on the next explicit audit, never on the edit.
|
|
17
17
|
set -euo pipefail
|
|
18
18
|
|
|
19
|
-
# Shared resolver + compatibility pinning (see hook-common.sh).
|
|
20
|
-
|
|
19
|
+
# Shared resolver + compatibility pinning (see hook-common.sh). Source it from
|
|
20
|
+
# this script's own directory — the plugin's scripts/ — never from a host
|
|
21
|
+
# environment variable.
|
|
22
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
|
23
|
+
. "${SCRIPT_DIR}/hook-common.sh"
|
|
21
24
|
|
|
22
25
|
# Read event JSON from stdin
|
|
23
26
|
event="$(cat)"
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Shared helpers for the code-auditor PostToolUse hooks.
|
|
3
3
|
#
|
|
4
|
-
# Sourced by hook-audit.sh
|
|
5
|
-
#
|
|
6
|
-
# is
|
|
4
|
+
# Sourced by hook-audit.sh, hook-self-audit.sh, hook-warm.sh, and
|
|
5
|
+
# hook-drift-check.sh. The plugin root is derived from where THIS file lives —
|
|
6
|
+
# `<plugin>/scripts/hook-common.sh`, so the root is its grand-parent — never
|
|
7
|
+
# from a host environment variable. `CLAUDE_PLUGIN_ROOT` is honored only as a
|
|
8
|
+
# validated override (see plugin_root below), so an unset or wrong value can
|
|
9
|
+
# never decide whether the tool runs.
|
|
7
10
|
#
|
|
8
11
|
# Two rules enforced here are the fix for "the hook died quietly" (three times:
|
|
9
12
|
# unset CLAUDE_PLUGIN_ROOT, a stale global binary, a removed CLI flag):
|
|
@@ -30,6 +33,26 @@
|
|
|
30
33
|
#
|
|
31
34
|
# The sourcing hook runs with `set -euo pipefail`.
|
|
32
35
|
|
|
36
|
+
# plugin_root — the plugin's install root.
|
|
37
|
+
#
|
|
38
|
+
# This file ships at `<plugin>/scripts/hook-common.sh`, so the plugin root is the
|
|
39
|
+
# grand-parent of its own location. That fixed, known-at-build-time offset is the
|
|
40
|
+
# single source of truth: every path a hook needs (the manifest, the bundled CLI
|
|
41
|
+
# sibling) is derived from here, not read from a host variable that may be unset.
|
|
42
|
+
# `CLAUDE_PLUGIN_ROOT` is honored only when it actually points at a plugin — it
|
|
43
|
+
# must contain this same `scripts/hook-common.sh` — so a stale or wrong value
|
|
44
|
+
# never shadows the real location, and an absent one is a non-event.
|
|
45
|
+
plugin_root() {
|
|
46
|
+
local here root
|
|
47
|
+
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
|
48
|
+
root="$(dirname "${here}")"
|
|
49
|
+
if [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -f "${CLAUDE_PLUGIN_ROOT}/scripts/hook-common.sh" ]; then
|
|
50
|
+
printf '%s' "${CLAUDE_PLUGIN_ROOT}"
|
|
51
|
+
return
|
|
52
|
+
fi
|
|
53
|
+
printf '%s' "${root}"
|
|
54
|
+
}
|
|
55
|
+
|
|
33
56
|
# hook_log_dir / hook_log_file / hook_log — the hook's diagnostic log.
|
|
34
57
|
#
|
|
35
58
|
# The PostToolUse hook must never write stderr: the host may block on stderr
|
|
@@ -55,7 +78,7 @@ hook_log() {
|
|
|
55
78
|
# manifest version. A stale candidate is warned about and skipped, so a mismatched
|
|
56
79
|
# binary no longer turns the hook into a hard failure.
|
|
57
80
|
#
|
|
58
|
-
# 1. The plugin's bundled CLI (`$
|
|
81
|
+
# 1. The plugin's bundled CLI (`$(plugin_root)/../dist/cli.js` ships in the
|
|
59
82
|
# same npm package, so it usually matches) — but a marketplace checkout has no
|
|
60
83
|
# npm-paired dist/, and a locally built one can be stale, so it is
|
|
61
84
|
# version-checked like everything else.
|
|
@@ -66,9 +89,10 @@ hook_log() {
|
|
|
66
89
|
# 3. Project-local install (consumer project's own node_modules) — if compatible.
|
|
67
90
|
# 4. Global install / PATH — if compatible.
|
|
68
91
|
resolve_code_audit() {
|
|
69
|
-
local candidate
|
|
70
|
-
|
|
71
|
-
|
|
92
|
+
local candidate root
|
|
93
|
+
root="$(plugin_root)"
|
|
94
|
+
if [ -f "${root}/../dist/cli.js" ]; then
|
|
95
|
+
candidate="${root}/../dist/cli.js"
|
|
72
96
|
if cli_is_compatible "${candidate}"; then
|
|
73
97
|
echo "${candidate}"
|
|
74
98
|
return
|
|
@@ -165,7 +189,7 @@ plugin_version() {
|
|
|
165
189
|
return
|
|
166
190
|
fi
|
|
167
191
|
__CODE_AUDITOR_PLUGIN_VERSION="$(
|
|
168
|
-
node -e
|
|
192
|
+
node -e 'const fs=require("fs");const p=process.argv[1];for(const f of [p+"/.claude-plugin/plugin.json", p+"/plugin.json"]){try{const v=JSON.parse(fs.readFileSync(f,"utf8")).version;if(v){process.stdout.write(v);break}}catch(e){}}' "$(plugin_root)" 2>/dev/null
|
|
169
193
|
)"
|
|
170
194
|
__CODE_AUDITOR_PLUGIN_VERSION_RESOLVED=1
|
|
171
195
|
printf '%s' "${__CODE_AUDITOR_PLUGIN_VERSION}"
|
|
@@ -220,7 +244,7 @@ assert_compatible() {
|
|
|
220
244
|
# bundled sibling, a project-local install, a global on PATH) are NOT
|
|
221
245
|
# path-guaranteed — the resolver's `cli_is_compatible` already version-checked
|
|
222
246
|
# them, and the full check below remains the loud backstop for any of them.
|
|
223
|
-
if [
|
|
247
|
+
if [ "${bin}" = "$(pin_dir)/node_modules/.bin/code-audit" ]; then
|
|
224
248
|
return 0
|
|
225
249
|
fi
|
|
226
250
|
pv="$(plugin_version)"
|
|
@@ -18,20 +18,24 @@
|
|
|
18
18
|
# single source of truth; the fix is to reinstall (or restore the file).
|
|
19
19
|
set -uo pipefail
|
|
20
20
|
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
|
|
21
|
+
# Source the shared resolver from this script's own directory — the plugin's
|
|
22
|
+
# scripts/ — never from a host environment variable. plugin_root() self-locates
|
|
23
|
+
# the plugin root, so an unset or wrong CLAUDE_PLUGIN_ROOT is a non-event.
|
|
24
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
|
25
|
+
. "${SCRIPT_DIR}/hook-common.sh"
|
|
26
|
+
|
|
27
|
+
ROOT="$(plugin_root)"
|
|
24
28
|
|
|
25
29
|
# The manifest ships at .claude-plugin/manifest.json; a few installs flatten the
|
|
26
30
|
# plugin.json to the plugin root, so check both locations (mirrors
|
|
27
31
|
# hook-common.sh's plugin_version).
|
|
28
32
|
manifest=""
|
|
29
|
-
for f in "${
|
|
33
|
+
for f in "${ROOT}/.claude-plugin/manifest.json" "${ROOT}/manifest.json"; do
|
|
30
34
|
if [ -f "$f" ]; then manifest="$f"; break; fi
|
|
31
35
|
done
|
|
32
36
|
[ -n "${manifest}" ] || exit 0
|
|
33
37
|
|
|
34
|
-
MANIFEST_PATH="${manifest}" PLUGIN_ROOT="${
|
|
38
|
+
MANIFEST_PATH="${manifest}" PLUGIN_ROOT="${ROOT}" node <<'NODE'
|
|
35
39
|
const fs = require('fs');
|
|
36
40
|
const crypto = require('crypto');
|
|
37
41
|
const path = require('path');
|
|
@@ -20,8 +20,11 @@
|
|
|
20
20
|
# the log file, not stderr, and still exits 0 (Spec 68 §hook-contract).
|
|
21
21
|
set -euo pipefail
|
|
22
22
|
|
|
23
|
-
# Shared resolver + compatibility pinning (see hook-common.sh).
|
|
24
|
-
|
|
23
|
+
# Shared resolver + compatibility pinning (see hook-common.sh). Source it from
|
|
24
|
+
# this script's own directory — the plugin's scripts/ — never from a host
|
|
25
|
+
# environment variable.
|
|
26
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
|
27
|
+
. "${SCRIPT_DIR}/hook-common.sh"
|
|
25
28
|
|
|
26
29
|
# Read event JSON from stdin
|
|
27
30
|
event="$(cat)"
|
|
@@ -17,12 +17,11 @@
|
|
|
17
17
|
# at all — a warm session must not re-check on every launch.
|
|
18
18
|
set -uo pipefail
|
|
19
19
|
|
|
20
|
-
#
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
. "${CLAUDE_PLUGIN_ROOT}/scripts/hook-common.sh"
|
|
20
|
+
# Source the shared resolver from this script's own directory — the plugin's
|
|
21
|
+
# scripts/ — never from a host environment variable. plugin_root() self-locates
|
|
22
|
+
# the plugin root, so an unset or wrong CLAUDE_PLUGIN_ROOT is a non-event.
|
|
23
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
|
|
24
|
+
. "${SCRIPT_DIR}/hook-common.sh"
|
|
26
25
|
|
|
27
26
|
# Nothing safe to warm if the manifest version can't be read: warming @latest
|
|
28
27
|
# could pin a different version than resolve_code_audit's fallback would fetch.
|
|
@@ -5,7 +5,7 @@ description: Audit code quality, search the codebase semantically, enforce invar
|
|
|
5
5
|
|
|
6
6
|
# Code Auditor Skill
|
|
7
7
|
|
|
8
|
-
> **Version 5.0.
|
|
8
|
+
> **Version 5.0.2** • Run `code-audit --version` to check your installed version.
|
|
9
9
|
> If versions differ, the CLI is authoritative — use `code-audit <command> --help` to see what your install actually supports.
|
|
10
10
|
|
|
11
11
|
You have the `code-audit` CLI available. It indexes every function, component, and struct in the codebase for semantic search and invariant enforcement. Use these commands instead of raw grep/find whenever possible.
|
package/server.json
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "io.github.BenAHammond/code-auditor-mcp",
|
|
4
|
-
"description": "
|
|
4
|
+
"description": "Enforces architectural invariants and code quality rules inside your AI agent's edit loop.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/BenAHammond/code-auditor-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "5.0.
|
|
9
|
+
"version": "5.0.2",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
14
14
|
"identifier": "code-auditor-mcp",
|
|
15
|
-
"version": "5.0.
|
|
15
|
+
"version": "5.0.2",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
],
|
|
21
|
+
"remotes": [
|
|
22
|
+
{
|
|
23
|
+
"type": "streamable-http",
|
|
24
|
+
"url": "https://www.codeauditormcp.com/api/mcp"
|
|
25
|
+
}
|
|
20
26
|
]
|
|
21
27
|
}
|