@elizaos/plugin-gitpathologist 2.0.11-beta.7
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/LICENSE +21 -0
- package/README.md +101 -0
- package/package.json +112 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shaw Walters and elizaOS Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# @elizaos/plugin-gitpathologist
|
|
2
|
+
|
|
3
|
+
Forensic git-history analysis for elizaOS agents.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
This plugin gives an Eliza agent the ability to analyze the commit history of a file, directory, or path glob and produce a structured health report. It answers questions such as:
|
|
8
|
+
|
|
9
|
+
- "When did the code quality in `src/payments/` start degrading?"
|
|
10
|
+
- "Where did rot begin in this module?"
|
|
11
|
+
- "What does the quality timeline look like for the last month?"
|
|
12
|
+
|
|
13
|
+
The analysis runs a five-phase pipeline: parse `git log`, classify each commit by type, score commits on a health scale using an exponential moving average, detect quality peaks and drift inflections, then (optionally) call the agent's configured text model to write a narrative post-mortem for each drift event.
|
|
14
|
+
|
|
15
|
+
Reports are cached on disk by `sha256(surface + since)` and validated against the repository HEAD sha, so a repeat query at the same commit returns the cached report instantly, while any new commit invalidates it.
|
|
16
|
+
|
|
17
|
+
## Capabilities
|
|
18
|
+
|
|
19
|
+
### Action: `GIT_PATHOLOGY`
|
|
20
|
+
|
|
21
|
+
The plugin registers a single multiplex action with two operations:
|
|
22
|
+
|
|
23
|
+
**`action=report`** (default) — full pathology analysis for a surface.
|
|
24
|
+
|
|
25
|
+
Parameters:
|
|
26
|
+
| Parameter | Required | Default | Description |
|
|
27
|
+
|---|---|---|---|
|
|
28
|
+
| `surface` | Yes | — | Path or glob relative to repo root (e.g. `src/payments/`, `**/*.test.ts`) |
|
|
29
|
+
| `since` | No | `14d` | Lookback window. ISO date or relative (`14d`, `4w`, `2m`). |
|
|
30
|
+
| `budget` | No | `20` | Max LLM narration calls. `0` = fully deterministic, no model calls. |
|
|
31
|
+
| `cache` | No | `auto` | `auto` (use cache when HEAD matches), `force` (recompute), `read-only` (fail on miss). |
|
|
32
|
+
|
|
33
|
+
Output: a Markdown report with:
|
|
34
|
+
- Commit count, authors, and analysis window
|
|
35
|
+
- **Peaks** — local maxima of health score (best moments in the window)
|
|
36
|
+
- **Drift inflections** — commits where a sustained quality drop begins
|
|
37
|
+
- **Rot post-mortem** — per-drift narrative (LLM-generated if model available, deterministic otherwise)
|
|
38
|
+
|
|
39
|
+
**`action=list`** — list cached reports for the current repo root. No parameters required.
|
|
40
|
+
|
|
41
|
+
### Trigger phrases
|
|
42
|
+
|
|
43
|
+
The agent will activate this action when the user says things like:
|
|
44
|
+
- "analyze git pathology for X"
|
|
45
|
+
- "when did this code get bad"
|
|
46
|
+
- "where did rot start in X"
|
|
47
|
+
- "code health for X"
|
|
48
|
+
- "drift analysis for X"
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
| Environment variable | Default | Description |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| `ELIZA_GITPATHOLOGIST` | auto | Set `true` to force-enable, `false` to force-disable. When unset, the plugin auto-enables in workspaces with a `.git` directory. |
|
|
55
|
+
| `GITPATHOLOGIST_BUDGET` | `20` | Maximum LLM narration calls per analysis. Set to `0` to use deterministic narration only. |
|
|
56
|
+
| `GITPATHOLOGIST_CACHE_DIR` | `<repoRoot>/.eliza/gitpathology` | Override the cache directory for pathology reports. |
|
|
57
|
+
|
|
58
|
+
## Requirements
|
|
59
|
+
|
|
60
|
+
- Node.js runtime (not available on mobile/browser targets).
|
|
61
|
+
- `git` must be present on `PATH`.
|
|
62
|
+
- An Eliza agent runtime with a configured `TEXT_SMALL` model for LLM narration (optional — the plugin degrades gracefully to deterministic narration without one).
|
|
63
|
+
|
|
64
|
+
## Enabling the plugin
|
|
65
|
+
|
|
66
|
+
Add `@elizaos/plugin-gitpathologist` to your agent's plugin list:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import gitpathologistPlugin from "@elizaos/plugin-gitpathologist";
|
|
70
|
+
|
|
71
|
+
const agent = new AgentRuntime({
|
|
72
|
+
plugins: [gitpathologistPlugin],
|
|
73
|
+
// ...
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Example output
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
# Git Pathology — `src/payments/`
|
|
81
|
+
|
|
82
|
+
**Repo:** `/home/user/myproject`
|
|
83
|
+
**Window:** 2025-05-01 → 2025-05-31
|
|
84
|
+
**HEAD:** `a1b2c3d`
|
|
85
|
+
**Commits analyzed:** 47 (alice, bob, carol)
|
|
86
|
+
**LLM calls:** 3
|
|
87
|
+
|
|
88
|
+
## Peaks (local maxima of health)
|
|
89
|
+
|
|
90
|
+
- `f3a1b2c` (2025-05-10, alice): score 0.61 +0.40 — clean refactor, low churn
|
|
91
|
+
|
|
92
|
+
## Drift inflections (sustained downturns)
|
|
93
|
+
|
|
94
|
+
- `9d2c4e1` (2025-05-22, bob): score 0.12 -0.49 — score drops 0.49 over next 5 commits flags=large-churn
|
|
95
|
+
|
|
96
|
+
## Rot post-mortem
|
|
97
|
+
|
|
98
|
+
### churn-spiral — `9d2c4e1`..`7a3f9b0`
|
|
99
|
+
|
|
100
|
+
This commit introduced 1,240 churn lines across 23 files with no test coverage changes, signaling a large undisciplined patch...
|
|
101
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elizaos/plugin-gitpathologist",
|
|
3
|
+
"version": "2.0.11-beta.7",
|
|
4
|
+
"description": "Forensic git-history analysis for elizaOS agents: per-surface health timeline, drift inflection detection, rot post-mortem.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/node/index.js",
|
|
7
|
+
"module": "dist/node/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/elizaOS/eliza.git",
|
|
13
|
+
"directory": "plugins/plugin-gitpathologist"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": "./package.json",
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"eliza-source": {
|
|
20
|
+
"types": "./src/index.ts",
|
|
21
|
+
"import": "./src/index.ts",
|
|
22
|
+
"default": "./src/index.ts"
|
|
23
|
+
},
|
|
24
|
+
"node": {
|
|
25
|
+
"types": "./dist/node/index.d.ts",
|
|
26
|
+
"import": "./dist/node/index.js",
|
|
27
|
+
"require": "./dist/cjs/index.cjs",
|
|
28
|
+
"default": "./dist/node/index.js"
|
|
29
|
+
},
|
|
30
|
+
"import": "./dist/node/index.js",
|
|
31
|
+
"require": "./dist/cjs/index.cjs",
|
|
32
|
+
"default": "./dist/node/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./*": {
|
|
35
|
+
"types": "./dist/*.d.ts",
|
|
36
|
+
"import": "./dist/*.js",
|
|
37
|
+
"default": "./dist/*.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist"
|
|
42
|
+
],
|
|
43
|
+
"keywords": [
|
|
44
|
+
"elizaos",
|
|
45
|
+
"elizaos-plugin",
|
|
46
|
+
"git",
|
|
47
|
+
"history",
|
|
48
|
+
"forensics",
|
|
49
|
+
"code-quality"
|
|
50
|
+
],
|
|
51
|
+
"author": "elizaOS",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "bun run build.ts",
|
|
55
|
+
"build:ts": "bun run build.ts",
|
|
56
|
+
"clean": "rm -rf dist .turbo",
|
|
57
|
+
"test": "vitest run --config vitest.config.ts",
|
|
58
|
+
"typecheck": "tsgo --noEmit",
|
|
59
|
+
"lint": "bunx @biomejs/biome check --write --unsafe .",
|
|
60
|
+
"lint:check": "bunx @biomejs/biome check .",
|
|
61
|
+
"format": "bunx @biomejs/biome format --write .",
|
|
62
|
+
"format:check": "bunx @biomejs/biome format ."
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@elizaos/core": "2.0.11-beta.7"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@biomejs/biome": "^2.4.14",
|
|
69
|
+
"@types/node": "^25.0.3",
|
|
70
|
+
"typescript": "^6.0.3",
|
|
71
|
+
"vitest": "^4.1.8"
|
|
72
|
+
},
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"@elizaos/core": "2.0.11-beta.7"
|
|
75
|
+
},
|
|
76
|
+
"publishConfig": {
|
|
77
|
+
"access": "public"
|
|
78
|
+
},
|
|
79
|
+
"agentConfig": {
|
|
80
|
+
"pluginType": "elizaos:plugin:1.0.0",
|
|
81
|
+
"pluginParameters": {
|
|
82
|
+
"ELIZA_GITPATHOLOGIST": {
|
|
83
|
+
"type": "boolean",
|
|
84
|
+
"description": "Force-enable or force-disable the gitpathologist plugin. When unset, the plugin auto-enables in workspaces with a .git directory.",
|
|
85
|
+
"required": false,
|
|
86
|
+
"sensitive": false
|
|
87
|
+
},
|
|
88
|
+
"GITPATHOLOGIST_BUDGET": {
|
|
89
|
+
"type": "number",
|
|
90
|
+
"description": "Maximum number of LLM narration calls per analysis. Caps token spend. Default 20.",
|
|
91
|
+
"required": false,
|
|
92
|
+
"sensitive": false
|
|
93
|
+
},
|
|
94
|
+
"GITPATHOLOGIST_CACHE_DIR": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "Override directory for cached pathology reports. Default <workspace>/.eliza/gitpathology.",
|
|
97
|
+
"required": false,
|
|
98
|
+
"sensitive": false
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"eliza": {
|
|
103
|
+
"platforms": [
|
|
104
|
+
"node"
|
|
105
|
+
],
|
|
106
|
+
"runtime": "node",
|
|
107
|
+
"platformDetails": {
|
|
108
|
+
"node": "Node.js build available via exports.node"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"gitHead": "cdbc876f793d96073d7eb0d09715a031ce0cd32e"
|
|
112
|
+
}
|