@hivehub/rulebook 3.4.2 → 4.0.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/.claude/commands/continue.md +33 -0
- package/.claude-plugin/marketplace.json +28 -29
- package/.claude-plugin/plugin.json +8 -8
- package/README.md +32 -144
- package/dist/agents/ralph-parser.d.ts +41 -1
- package/dist/agents/ralph-parser.d.ts.map +1 -1
- package/dist/agents/ralph-parser.js +202 -14
- package/dist/agents/ralph-parser.js.map +1 -1
- package/dist/cli/commands.d.ts +65 -0
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +837 -61
- package/dist/cli/commands.js.map +1 -1
- package/dist/core/agent-manager.d.ts +7 -0
- package/dist/core/agent-manager.d.ts.map +1 -1
- package/dist/core/agent-manager.js +150 -3
- package/dist/core/agent-manager.js.map +1 -1
- package/dist/core/claude-mcp.d.ts +17 -0
- package/dist/core/claude-mcp.d.ts.map +1 -1
- package/dist/core/claude-mcp.js +90 -6
- package/dist/core/claude-mcp.js.map +1 -1
- package/dist/core/config-manager.d.ts.map +1 -1
- package/dist/core/config-manager.js +40 -0
- package/dist/core/config-manager.js.map +1 -1
- package/dist/core/cursor-mdc-generator.d.ts +30 -0
- package/dist/core/cursor-mdc-generator.d.ts.map +1 -0
- package/dist/core/cursor-mdc-generator.js +98 -0
- package/dist/core/cursor-mdc-generator.js.map +1 -0
- package/dist/core/detector.d.ts +25 -1
- package/dist/core/detector.d.ts.map +1 -1
- package/dist/core/detector.js +321 -1
- package/dist/core/detector.js.map +1 -1
- package/dist/core/generator.d.ts +10 -0
- package/dist/core/generator.d.ts.map +1 -1
- package/dist/core/generator.js +177 -3
- package/dist/core/generator.js.map +1 -1
- package/dist/core/github-issues-importer.d.ts +82 -0
- package/dist/core/github-issues-importer.d.ts.map +1 -0
- package/dist/core/github-issues-importer.js +161 -0
- package/dist/core/github-issues-importer.js.map +1 -0
- package/dist/core/health-scorer.d.ts +39 -0
- package/dist/core/health-scorer.d.ts.map +1 -1
- package/dist/core/health-scorer.js +256 -13
- package/dist/core/health-scorer.js.map +1 -1
- package/dist/core/iteration-tracker.d.ts +28 -0
- package/dist/core/iteration-tracker.d.ts.map +1 -1
- package/dist/core/iteration-tracker.js +86 -0
- package/dist/core/iteration-tracker.js.map +1 -1
- package/dist/core/multi-tool-generator.d.ts +59 -0
- package/dist/core/multi-tool-generator.d.ts.map +1 -0
- package/dist/core/multi-tool-generator.js +157 -0
- package/dist/core/multi-tool-generator.js.map +1 -0
- package/dist/core/override-manager.d.ts +23 -0
- package/dist/core/override-manager.d.ts.map +1 -0
- package/dist/core/override-manager.js +82 -0
- package/dist/core/override-manager.js.map +1 -0
- package/dist/core/plans-manager.d.ts +46 -0
- package/dist/core/plans-manager.d.ts.map +1 -0
- package/dist/core/plans-manager.js +158 -0
- package/dist/core/plans-manager.js.map +1 -0
- package/dist/core/prd-generator.d.ts +12 -0
- package/dist/core/prd-generator.d.ts.map +1 -1
- package/dist/core/prd-generator.js +91 -2
- package/dist/core/prd-generator.js.map +1 -1
- package/dist/core/ralph-manager.d.ts +47 -1
- package/dist/core/ralph-manager.d.ts.map +1 -1
- package/dist/core/ralph-manager.js +107 -0
- package/dist/core/ralph-manager.js.map +1 -1
- package/dist/core/ralph-parallel.d.ts +55 -0
- package/dist/core/ralph-parallel.d.ts.map +1 -0
- package/dist/core/ralph-parallel.js +201 -0
- package/dist/core/ralph-parallel.js.map +1 -0
- package/dist/core/ralph-plan-checkpoint.d.ts +58 -0
- package/dist/core/ralph-plan-checkpoint.d.ts.map +1 -0
- package/dist/core/ralph-plan-checkpoint.js +154 -0
- package/dist/core/ralph-plan-checkpoint.js.map +1 -0
- package/dist/core/ralph-scripts.d.ts +12 -0
- package/dist/core/ralph-scripts.d.ts.map +1 -0
- package/dist/core/ralph-scripts.js +49 -0
- package/dist/core/ralph-scripts.js.map +1 -0
- package/dist/core/review-manager.d.ts +74 -0
- package/dist/core/review-manager.d.ts.map +1 -0
- package/dist/core/review-manager.js +371 -0
- package/dist/core/review-manager.js.map +1 -0
- package/dist/index.js +94 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp/rulebook-server.d.ts.map +1 -1
- package/dist/mcp/rulebook-server.js +9 -2
- package/dist/mcp/rulebook-server.js.map +1 -1
- package/dist/memory/memory-store.d.ts.map +1 -1
- package/dist/memory/memory-store.js +4 -0
- package/dist/memory/memory-store.js.map +1 -1
- package/dist/types.d.ts +55 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/agents/implementer.md +35 -0
- package/templates/agents/researcher.md +34 -0
- package/templates/agents/team-lead.md +34 -0
- package/templates/agents/tester.md +42 -0
- package/templates/ci/rulebook-review.yml +26 -0
- package/templates/core/AGENTS_LEAN.md +25 -0
- package/templates/core/AGENTS_OVERRIDE.md +16 -0
- package/templates/core/MULTI_AGENT.md +74 -0
- package/templates/core/PLANS.md +28 -0
- package/templates/core/RALPH.md +45 -4
- package/templates/ides/CONTINUE_RULES.md +16 -0
- package/templates/ides/COPILOT_INSTRUCTIONS.md +23 -0
- package/templates/ides/GEMINI_RULES.md +17 -0
- package/templates/ides/WINDSURF_RULES.md +14 -0
- package/templates/ides/cursor-mdc/go.mdc +24 -0
- package/templates/ides/cursor-mdc/python.mdc +24 -0
- package/templates/ides/cursor-mdc/quality.mdc +25 -0
- package/templates/ides/cursor-mdc/ralph.mdc +39 -0
- package/templates/ides/cursor-mdc/rulebook.mdc +38 -0
- package/templates/ides/cursor-mdc/rust.mdc +24 -0
- package/templates/ides/cursor-mdc/typescript.mdc +25 -0
- package/templates/modules/sequential-thinking.md +42 -0
- package/templates/ralph/ralph-history.bat +4 -0
- package/templates/ralph/ralph-history.sh +5 -0
- package/templates/ralph/ralph-init.bat +5 -0
- package/templates/ralph/ralph-init.sh +5 -0
- package/templates/ralph/ralph-pause.bat +5 -0
- package/templates/ralph/ralph-pause.sh +5 -0
- package/templates/ralph/ralph-run.bat +5 -0
- package/templates/ralph/ralph-run.sh +5 -0
- package/templates/ralph/ralph-status.bat +4 -0
- package/templates/ralph/ralph-status.sh +5 -0
- package/templates/services/DATADOG.md +26 -0
- package/templates/services/DOCKER.md +124 -0
- package/templates/services/DOCKER_COMPOSE.md +168 -0
- package/templates/services/HELM.md +194 -0
- package/templates/services/KUBERNETES.md +208 -0
- package/templates/services/OPENTELEMETRY.md +25 -0
- package/templates/services/PINO.md +24 -0
- package/templates/services/PROMETHEUS.md +33 -0
- package/templates/services/SENTRY.md +23 -0
- package/templates/services/WINSTON.md +30 -0
- package/dist/core/openspec-manager.d.ts +0 -133
- package/dist/core/openspec-manager.d.ts.map +0 -1
- package/dist/core/openspec-manager.js +0 -596
- package/dist/core/openspec-manager.js.map +0 -1
- package/dist/core/openspec-migrator.d.ts +0 -27
- package/dist/core/openspec-migrator.d.ts.map +0 -1
- package/dist/core/openspec-migrator.js +0 -262
- package/dist/core/openspec-migrator.js.map +0 -1
- package/dist/core/test-task-manager.d.ts +0 -49
- package/dist/core/test-task-manager.d.ts.map +0 -1
- package/dist/core/test-task-manager.js +0 -121
- package/dist/core/test-task-manager.js.map +0 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: /continue
|
|
3
|
+
id: continue
|
|
4
|
+
category: Rulebook
|
|
5
|
+
description: Update tasks.md, archive completed tasks, and continue implementation.
|
|
6
|
+
---
|
|
7
|
+
<!-- RULEBOOK:START -->
|
|
8
|
+
**Steps**
|
|
9
|
+
|
|
10
|
+
1. **Update tasks.md for all active tasks**:
|
|
11
|
+
- Mark completed items as `[x]` in every active `tasks.md`
|
|
12
|
+
- Remove or update items that are no longer relevant
|
|
13
|
+
|
|
14
|
+
2. **Archive fully completed tasks**:
|
|
15
|
+
For each task where ALL items are `[x]`:
|
|
16
|
+
```bash
|
|
17
|
+
rulebook task archive <task-id>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
3. **Get current session context**:
|
|
21
|
+
```bash
|
|
22
|
+
rulebook continue
|
|
23
|
+
```
|
|
24
|
+
Use this output to understand what's pending and what was done.
|
|
25
|
+
|
|
26
|
+
4. **Continue implementation**:
|
|
27
|
+
- Pick the next pending task from the context above
|
|
28
|
+
- Work through its `tasks.md` checklist item by item
|
|
29
|
+
- Follow priority order: tests → coverage → update tasks.md → commit
|
|
30
|
+
|
|
31
|
+
**Reference**
|
|
32
|
+
- See `/.rulebook/specs/RULEBOOK.md` for complete task management guidelines
|
|
33
|
+
<!-- RULEBOOK:END -->
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "hivehub-marketplace",
|
|
3
|
-
"owner": {
|
|
4
|
-
"name": "HiveLLM Team",
|
|
5
|
-
"email": "support@hivellm.com",
|
|
6
|
-
"url": "https://github.com/hivellm"
|
|
7
|
-
},
|
|
8
|
-
"plugins": [
|
|
9
|
-
{
|
|
10
|
-
"name": "rulebook",
|
|
11
|
-
"source": ".",
|
|
12
|
-
"description": "Standardize AI-generated projects with skills, templates, persistent memory, and quality gates. Supports 28 languages, 17 frameworks, 13 MCP modules, and 20 services.",
|
|
13
|
-
"version": "
|
|
14
|
-
"repository": "https://github.com/hivellm/rulebook",
|
|
15
|
-
"homepage": "https://github.com/hivellm/rulebook#readme",
|
|
16
|
-
"keywords": [
|
|
17
|
-
"ai",
|
|
18
|
-
"automation",
|
|
19
|
-
"templates",
|
|
20
|
-
"standards",
|
|
21
|
-
"skills",
|
|
22
|
-
"mcp",
|
|
23
|
-
"task-management",
|
|
24
|
-
"quality-gates"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "hivehub-marketplace",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "HiveLLM Team",
|
|
5
|
+
"email": "support@hivellm.com",
|
|
6
|
+
"url": "https://github.com/hivellm"
|
|
7
|
+
},
|
|
8
|
+
"plugins": [
|
|
9
|
+
{
|
|
10
|
+
"name": "rulebook",
|
|
11
|
+
"source": ".",
|
|
12
|
+
"description": "Standardize AI-generated projects with skills, templates, persistent memory, and quality gates. Supports 28 languages, 17 frameworks, 13 MCP modules, and 20 services.",
|
|
13
|
+
"version": "4.0.0",
|
|
14
|
+
"repository": "https://github.com/hivellm/rulebook",
|
|
15
|
+
"homepage": "https://github.com/hivellm/rulebook#readme",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"ai",
|
|
18
|
+
"automation",
|
|
19
|
+
"templates",
|
|
20
|
+
"standards",
|
|
21
|
+
"skills",
|
|
22
|
+
"mcp",
|
|
23
|
+
"task-management",
|
|
24
|
+
"quality-gates"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rulebook",
|
|
3
|
-
"description": "Standardize AI-generated projects with Ralph autonomous loop, persistent memory, and quality gates. Supports 28 languages, 17 frameworks, 13 MCP modules, and 20 services.",
|
|
4
|
-
"version": "
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "HiveLLM"
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "rulebook",
|
|
3
|
+
"description": "Standardize AI-generated projects with Ralph autonomous loop, persistent memory, and quality gates. Supports 28 languages, 17 frameworks, 13 MCP modules, and 20 services.",
|
|
4
|
+
"version": "4.0.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "HiveLLM"
|
|
7
|
+
}
|
|
8
|
+
}
|
package/README.md
CHANGED
|
@@ -35,14 +35,14 @@ By giving LLMs a clear "rulebook" to follow, you ensure that every piece of gene
|
|
|
35
35
|
## Quick Start
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
# New project (
|
|
38
|
+
# New project — auto-detects languages, frameworks, services (no prompts)
|
|
39
39
|
npx @hivehub/rulebook@latest init
|
|
40
40
|
|
|
41
41
|
# Minimal setup (essentials only)
|
|
42
42
|
npx @hivehub/rulebook@latest init --minimal
|
|
43
43
|
|
|
44
|
-
#
|
|
45
|
-
npx @hivehub/rulebook@latest init --
|
|
44
|
+
# Lean mode — AGENTS.md as <3KB index (fast AI loading)
|
|
45
|
+
npx @hivehub/rulebook@latest init --lean
|
|
46
46
|
|
|
47
47
|
# Update existing project
|
|
48
48
|
npx @hivehub/rulebook@latest update
|
|
@@ -50,148 +50,36 @@ npx @hivehub/rulebook@latest update
|
|
|
50
50
|
|
|
51
51
|
## What's New
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
See the full [CHANGELOG](CHANGELOG.md) for details.
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
- 6 MCP tools + 6 CLI commands for complete memory management
|
|
84
|
-
- 🧩 **119 Skills with YAML Frontmatter**: All 106 legacy templates converted to proper SKILL.md format
|
|
85
|
-
- 28 languages, 17 frameworks, 13 modules, 20 services, 8 IDEs, 15 CLI, 5 core + git/hooks
|
|
86
|
-
- 🔌 **Claude Code Commands**: Memory + task commands auto-installed to `.claude/commands/`
|
|
87
|
-
- 🔧 **Update Preserves Config**: `rulebook update` no longer resets custom `.rulebook` fields (memory, skills, timeouts, etc.)
|
|
88
|
-
- 🛡️ **MCP Config Safety**: `.mcp.json` entry preserved if already configured (no more overwriting)
|
|
89
|
-
|
|
90
|
-
### v2.1.0
|
|
91
|
-
|
|
92
|
-
- 🔒 **Claude Code Critical Directives**: New mandatory rules for Claude Code CLI
|
|
93
|
-
- **Sequential File Editing**: Files must be edited one at a time to prevent failures from parallel edits
|
|
94
|
-
- **Complete Test Implementation**: Strict rules against simplifying tests, placeholder assertions, or skipping test cases
|
|
95
|
-
- Updated `CLAUDE.md` generation with comprehensive guidelines and examples
|
|
96
|
-
- 🪟 **Windows Test Suite Fix**: Tests no longer hang on Windows (705 tests passing, 11x faster)
|
|
97
|
-
|
|
98
|
-
### v2.0.0
|
|
99
|
-
|
|
100
|
-
- 🧩 **Skills System**: New modular skills architecture for AI-assisted development
|
|
101
|
-
- Skills are YAML-frontmatter Markdown files with enable/disable functionality
|
|
102
|
-
- 10 skill categories: languages, frameworks, modules, services, workflows, ides, core, cli, git, hooks
|
|
103
|
-
- Auto-detection of skills based on project configuration
|
|
104
|
-
- CLI commands: `rulebook skill list|add|remove|show|search`
|
|
105
|
-
- MCP functions: `rulebook_skill_list|show|enable|disable|search|validate`
|
|
106
|
-
- 🤖 **AI CLI Configuration Files**: Auto-generated files for AI CLI tools
|
|
107
|
-
- `CLAUDE.md` - Claude Code CLI configuration
|
|
108
|
-
- `CODEX.md` - OpenAI Codex CLI configuration
|
|
109
|
-
- `GEMINI.md` - Google Gemini CLI configuration
|
|
110
|
-
- `gemini-extension.json` - Gemini CLI extension manifest
|
|
111
|
-
- 🔌 **Claude Code Plugin**: `marketplace.json` + `.claude-plugin/` structure for marketplace distribution
|
|
112
|
-
- `marketplace.json` - Marketplace manifest for plugin discovery
|
|
113
|
-
- Plugin manifest, MCP configuration, slash commands, and skills
|
|
114
|
-
|
|
115
|
-
### v1.1.5
|
|
116
|
-
|
|
117
|
-
- 🗄️ **Service Integration Templates**: Added comprehensive service integration templates
|
|
118
|
-
- 20 service templates: PostgreSQL, MySQL, MariaDB, SQL Server, Oracle, SQLite, MongoDB, Cassandra, DynamoDB, Redis, Memcached, Elasticsearch, Neo4j, InfluxDB, RabbitMQ, Kafka, S3, Azure Blob, GCS, MinIO
|
|
119
|
-
- Automatic service detection from `package.json`, `.env`, and `docker-compose.yml`
|
|
120
|
-
- Service-specific integration instructions with connection setup, operations, best practices, and configuration
|
|
121
|
-
- Templates generated in `/rulebook/[SERVICE].md` with references in `AGENTS.md`
|
|
122
|
-
- Interactive CLI prompt to select which services to include templates for
|
|
123
|
-
|
|
124
|
-
### v1.1.4
|
|
125
|
-
|
|
126
|
-
- 🔧 **Cross-platform Git Hooks**: Git hooks now work on both Windows and Linux
|
|
127
|
-
- Hooks are now generated as Node.js scripts with shell wrappers
|
|
128
|
-
- Shell wrapper detects Node.js in common locations (Windows and Linux)
|
|
129
|
-
- Node.js scripts use native `child_process.spawn` for cross-platform command execution
|
|
130
|
-
- Pre-commit and pre-push hooks now function correctly on Windows (Git Bash) and Linux
|
|
131
|
-
- 🔄 **Git Hooks Architecture**: Refactored hook generation system
|
|
132
|
-
- Hooks are now generated as two files: shell wrapper + Node.js script
|
|
133
|
-
- Shell templates (`.sh`) are automatically converted to Node.js scripts
|
|
134
|
-
- Improved command parsing from shell templates to Node.js
|
|
135
|
-
- Better error handling and cross-platform compatibility
|
|
136
|
-
|
|
137
|
-
### v1.1.3
|
|
138
|
-
|
|
139
|
-
- 🗑️ **MCP Tool: `rulebook_task_delete`**: Delete tasks permanently
|
|
140
|
-
- New tool to permanently delete tasks from the filesystem
|
|
141
|
-
- Removes task directory recursively
|
|
142
|
-
- Useful for cleaning up test tasks or removing unwanted tasks
|
|
143
|
-
- Total of 7 MCP functions now available
|
|
144
|
-
|
|
145
|
-
### v1.1.2
|
|
146
|
-
|
|
147
|
-
- 🔧 **ESLint v9 Migration**: Updated to ESLint flat config format
|
|
148
|
-
- Migrated from `.eslintrc.json` to `eslint.config.js`
|
|
149
|
-
- Updated to ESLint 9.37.0 with TypeScript ESLint 8.47.0
|
|
150
|
-
- Added proper Node.js global type definitions
|
|
151
|
-
- Linting now shows only errors (warnings suppressed with `--quiet`)
|
|
152
|
-
|
|
153
|
-
### v1.0.3
|
|
154
|
-
|
|
155
|
-
- 🔧 **Zod v3 Compatibility**: Using Zod v3.25.76 for full MCP SDK compatibility
|
|
156
|
-
- MCP SDK v1.22.0 requires Zod v3 (see [Issue #1429](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1429))
|
|
157
|
-
- Will upgrade to Zod v4 when MCP SDK officially supports it
|
|
158
|
-
- 🔄 **Dependency Updates**: All dependencies updated to latest versions
|
|
159
|
-
- TypeScript tooling (ESLint 8.47.0, Vitest 4.0.13)
|
|
160
|
-
- Node.js types updated to support Node.js 24.x
|
|
161
|
-
- CLI tools and build utilities updated
|
|
162
|
-
- 🐛 **Windows CI Fix**: Fixed PowerShell compatibility in GitHub Actions workflows
|
|
163
|
-
- Removed bash-specific syntax from Windows runners
|
|
164
|
-
- Cross-platform compatibility improved
|
|
165
|
-
|
|
166
|
-
### v1.0.2
|
|
167
|
-
|
|
168
|
-
- 🔌 **MCP Server for Task Management**: New MCP server enables AI models to manage tasks programmatically
|
|
169
|
-
- 7 MCP functions: create, list, show, update, validate, archive, delete tasks
|
|
170
|
-
- Available via `npx @hivellm/rulebook@latest mcp-server` or `npx rulebook-mcp`
|
|
171
|
-
- Better integration with MCP-compatible AI assistants
|
|
172
|
-
- ⚡ **Faster Pre-commit Hooks**: Tests removed from pre-commit for faster backup commits
|
|
173
|
-
- Pre-commit now runs only: format check, lint, type-check
|
|
174
|
-
- Tests moved to pre-push hook for comprehensive validation
|
|
175
|
-
- 🏗️ **Build Verification**: Build check now mandatory before push (runs first)
|
|
176
|
-
- 📦 **pnpm Recommendation**: Added pnpm as preferred package manager with `.npmrc` configuration
|
|
177
|
-
- 🚀 **Rust Build Optimization**: Comprehensive guide for faster Rust builds
|
|
178
|
-
- sccache configuration, incremental compilation, lld linker
|
|
179
|
-
- Anti-pattern documentation for `pub use big_crate::*;`
|
|
180
|
-
- 📋 **Enhanced Task Management**: Strengthened OpenSpec format compliance and archiving rules
|
|
181
|
-
- 📁 **Strict Markdown Organization**: UPPERCASE naming and `/docs` directory requirements
|
|
182
|
-
|
|
183
|
-
### v1.0.0
|
|
184
|
-
|
|
185
|
-
- 🎉 **First Stable Release**: Production-ready with comprehensive features
|
|
186
|
-
- 🔒 **Apache 2.0 License**: Changed from MIT to Apache License 2.0 for better compatibility
|
|
187
|
-
- 🛡️ **Git Hooks Enforcement**: Pre-commit and pre-push hooks now block commits with lint/test errors
|
|
188
|
-
- 📋 **Task File Structure Rules**: Enhanced directives in AGENTS.md about correct task structure
|
|
189
|
-
- 🎯 **Built-in Task Management**: OpenSpec deprecated and integrated into Rulebook's native task system
|
|
190
|
-
- 📋 **RULEBOOK.md Template**: Core template with task management directives and Context7 MCP requirements
|
|
191
|
-
- 🚫 **Automatic .gitignore**: `npx @hivellm/rulebook@latest init` now creates/updates `.gitignore` automatically for 28 languages
|
|
192
|
-
- 🔄 **Migration Support**: Existing OpenSpec tasks automatically migrated to `/.rulebook/tasks/` format
|
|
193
|
-
|
|
194
|
-
> **Breaking Change**: OpenSpec module removed. Use `npx @hivellm/rulebook@latest task` commands instead. See [Migration Guide](docs/guides/OPENSPEC_MIGRATION.md).
|
|
55
|
+
### v4.0.0 — AI-first DX & Ralph maturity
|
|
56
|
+
|
|
57
|
+
- 🚀 **Zero-prompt `init`**: auto-configures from detection, no questionnaires
|
|
58
|
+
- 🛡️ **AGENTS.override.md**: project rules that survive every update
|
|
59
|
+
- 📊 **Health Scorer v2**: 9-category scoring with letter grade A–F
|
|
60
|
+
- 🤖 **Ralph v2**: parallel execution, plan checkpoint, context compression, security gate, GitHub Issues import
|
|
61
|
+
- 🐳 **Container + Observability**: Docker, K8s, Helm, Sentry, OTel, Datadog, Pino, Winston, Prometheus
|
|
62
|
+
- 🛠️ **Multi-tool**: Gemini CLI, Continue.dev, Windsurf, Copilot configs auto-generated
|
|
63
|
+
- 🔍 **AI Code Review**: `rulebook review` + GitHub Actions workflow
|
|
64
|
+
- 👥 **Multi-agent teams**: Claude Code agent definitions + team auto-configuration
|
|
65
|
+
|
|
66
|
+
### v3.0.0 — Persistent Memory & Skills
|
|
67
|
+
|
|
68
|
+
- 🧠 **Persistent Memory**: zero-dependency BM25+HNSW hybrid search, SQLite/WASM, 7 memory types
|
|
69
|
+
- 🧩 **Skills System**: 244 skills across 10 categories with auto-detection and YAML frontmatter
|
|
70
|
+
- 🤖 **Ralph Autonomous Loop**: multi-iteration AI agent with quality gates, PRD, pause/resume
|
|
71
|
+
|
|
72
|
+
### v2.0.0 — Multi-tool & MCP
|
|
73
|
+
|
|
74
|
+
- 🔌 **MCP Server**: 19 functions for task management, skills, and memory
|
|
75
|
+
- 🤖 **AI CLI configs**: CLAUDE.md, CODEX.md, GEMINI.md auto-generated
|
|
76
|
+
- 🧩 **Skills**: modular enable/disable architecture
|
|
77
|
+
|
|
78
|
+
### v1.0.0 — Foundation
|
|
79
|
+
|
|
80
|
+
- 📋 **Task management**: OpenSpec-compatible format with full lifecycle
|
|
81
|
+
- 🛡️ **Git hooks**: pre-commit (format, lint, type-check) + pre-push (build, tests)
|
|
82
|
+
- 🌍 **28 languages, 17 frameworks**, auto-detection with confidence scores
|
|
195
83
|
|
|
196
84
|
---
|
|
197
85
|
|
|
@@ -10,11 +10,28 @@ export declare class RalphParser {
|
|
|
10
10
|
static parseAgentOutput(agentOutput: string, iterationNum: number, taskId: string, taskTitle: string, tool: 'claude' | 'amp' | 'gemini'): IterationResult;
|
|
11
11
|
/**
|
|
12
12
|
* Extract quality check results from agent output.
|
|
13
|
-
* Uses
|
|
13
|
+
* Uses structured count-based detection to avoid false positives.
|
|
14
|
+
* "0 errors" / "no errors" are treated as success, not failure.
|
|
14
15
|
* Note: In MCP ralph_run, real quality gates are determined by actual command exit codes,
|
|
15
16
|
* not this parser. This is a best-effort extraction for standalone parsing.
|
|
16
17
|
*/
|
|
17
18
|
private static extractQualityChecks;
|
|
19
|
+
/**
|
|
20
|
+
* Parse lint error count from ESLint output.
|
|
21
|
+
* Returns 0 if no error count found (treat as passing).
|
|
22
|
+
*/
|
|
23
|
+
private static parseLintErrorCount;
|
|
24
|
+
/**
|
|
25
|
+
* Parse test failure count from vitest/jest output.
|
|
26
|
+
* Returns 0 if no failure count found (treat as passing).
|
|
27
|
+
*/
|
|
28
|
+
private static parseTestFailCount;
|
|
29
|
+
/**
|
|
30
|
+
* Parse real coverage percentage from test runner output.
|
|
31
|
+
* Supports vitest table format and jest/c8 line format.
|
|
32
|
+
* Returns null if coverage cannot be determined.
|
|
33
|
+
*/
|
|
34
|
+
static parseCoveragePercentage(output: string): number | null;
|
|
18
35
|
/**
|
|
19
36
|
* Helper: Check if a single line contains percentage >= threshold
|
|
20
37
|
*/
|
|
@@ -47,5 +64,28 @@ export declare class RalphParser {
|
|
|
47
64
|
* Check if iteration completion is detected
|
|
48
65
|
*/
|
|
49
66
|
private static isCompletionDetected;
|
|
67
|
+
/**
|
|
68
|
+
* Parse `npm audit --json` output.
|
|
69
|
+
* Returns the highest severity found: 'critical' | 'high' | 'moderate' | 'low' | 'none'
|
|
70
|
+
*/
|
|
71
|
+
static parseNpmAuditSeverity(jsonOutput: string): 'critical' | 'high' | 'moderate' | 'low' | 'none';
|
|
72
|
+
/**
|
|
73
|
+
* Parse text-based security tool output (trivy, semgrep, or npm audit without --json).
|
|
74
|
+
* Returns the highest severity found: 'critical' | 'high' | 'moderate' | 'low' | 'none'
|
|
75
|
+
*/
|
|
76
|
+
static parseSecurityOutputText(output: string): 'critical' | 'high' | 'moderate' | 'low' | 'none';
|
|
77
|
+
/**
|
|
78
|
+
* Parse trivy JSON output (`trivy fs --format json`) for the highest severity found.
|
|
79
|
+
*/
|
|
80
|
+
static parseTrivySeverity(jsonOutput: string): 'critical' | 'high' | 'moderate' | 'low' | 'none';
|
|
81
|
+
/**
|
|
82
|
+
* Parse semgrep JSON output (`semgrep --json`) for the highest severity found.
|
|
83
|
+
*/
|
|
84
|
+
static parseSemgrepSeverity(jsonOutput: string): 'critical' | 'high' | 'moderate' | 'low' | 'none';
|
|
85
|
+
/**
|
|
86
|
+
* Determine if a security gate passes given the found severity and the configured failOn threshold.
|
|
87
|
+
* Severity order: none < low < moderate < high < critical
|
|
88
|
+
*/
|
|
89
|
+
static securityGatePasses(foundSeverity: 'critical' | 'high' | 'moderate' | 'low' | 'none', failOn: 'critical' | 'high' | 'moderate' | 'low'): boolean;
|
|
50
90
|
}
|
|
51
91
|
//# sourceMappingURL=ralph-parser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ralph-parser.d.ts","sourceRoot":"","sources":["../../src/agents/ralph-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;GAGG;AACH,qBAAa,WAAW;IACtB;;OAEG;IACH,MAAM,CAAC,gBAAgB,CACrB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAChC,eAAe;IA4ClB
|
|
1
|
+
{"version":3,"file":"ralph-parser.d.ts","sourceRoot":"","sources":["../../src/agents/ralph-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;GAGG;AACH,qBAAa,WAAW;IACtB;;OAEG;IACH,MAAM,CAAC,gBAAgB,CACrB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAChC,eAAe;IA4ClB;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IA2EnC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAgBlC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAgBjC;;;;OAIG;IACH,MAAM,CAAC,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IA4B7D;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAYrC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAwB9B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IA4B/B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IA4B5B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAa/B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAiB9B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAiB/B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAenC;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAC1B,UAAU,EAAE,MAAM,GACjB,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM;IAoBpD;;;OAGG;IACH,MAAM,CAAC,uBAAuB,CAC5B,MAAM,EAAE,MAAM,GACb,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM;IASpD;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM;IAoBhG;;OAEG;IACH,MAAM,CAAC,oBAAoB,CACzB,UAAU,EAAE,MAAM,GACjB,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM;IAyBpD;;;OAGG;IACH,MAAM,CAAC,kBAAkB,CACvB,aAAa,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,GAAG,MAAM,EAChE,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,GAC/C,OAAO;CAMX"}
|
|
@@ -43,29 +43,49 @@ export class RalphParser {
|
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Extract quality check results from agent output.
|
|
46
|
-
* Uses
|
|
46
|
+
* Uses structured count-based detection to avoid false positives.
|
|
47
|
+
* "0 errors" / "no errors" are treated as success, not failure.
|
|
47
48
|
* Note: In MCP ralph_run, real quality gates are determined by actual command exit codes,
|
|
48
49
|
* not this parser. This is a best-effort extraction for standalone parsing.
|
|
49
50
|
*/
|
|
50
51
|
static extractQualityChecks(output) {
|
|
51
52
|
const lines = output.split('\n').map((l) => l.toLowerCase().trim());
|
|
52
|
-
//
|
|
53
|
-
const
|
|
53
|
+
// Type-check: pass if no TypeScript error codes (error TS\d+) found
|
|
54
|
+
const tsErrorCount = (output.match(/error TS\d+/gi) ?? []).length;
|
|
55
|
+
const typeCheckExplicitPass = lines.some((l) => (l.includes('type-check') || l.includes('tsc')) &&
|
|
54
56
|
(l.includes('pass') || l.includes('success') || l.includes('✓')) &&
|
|
55
|
-
!l.includes('fail')
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
!l.includes('fail'));
|
|
58
|
+
const typeCheckPass = typeCheckExplicitPass || tsErrorCount === 0;
|
|
59
|
+
// Lint: parse "X problems (Y errors, Z warnings)" — fail only if errors > 0
|
|
60
|
+
// Also pass on "0 problems", "0 errors", "no problems", explicit pass
|
|
61
|
+
const lintErrorCount = this.parseLintErrorCount(lines);
|
|
62
|
+
const lintExplicitPass = lines.some((l) => (l.includes('eslint') || l.includes('lint')) &&
|
|
58
63
|
(l.includes('pass') ||
|
|
59
64
|
l.includes('success') ||
|
|
60
65
|
l.includes('✓') ||
|
|
61
|
-
l.includes('0 problems')
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const
|
|
66
|
+
l.includes('0 problems') ||
|
|
67
|
+
l.includes('no problems')));
|
|
68
|
+
const lintExplicitFail = lines.some((l) => (l.includes('eslint') || l.includes('lint')) && l.includes('fail'));
|
|
69
|
+
const lintPass = lintExplicitFail ? false : lintExplicitPass || lintErrorCount === 0;
|
|
70
|
+
// Tests: parse "X failed" — fail only if count > 0
|
|
71
|
+
// "0 errors", "passing", "✓ X tests" are all success
|
|
72
|
+
const testFailCount = this.parseTestFailCount(lines);
|
|
73
|
+
const testExplicitPass = lines.some((l) => (l.includes('test') || l.includes('vitest') || l.includes('jest')) &&
|
|
74
|
+
(l.includes('pass') ||
|
|
75
|
+
l.includes('passed') ||
|
|
76
|
+
l.includes('✓') ||
|
|
77
|
+
l.includes('success') ||
|
|
78
|
+
l.includes('0 errors') ||
|
|
79
|
+
l.includes('no errors') ||
|
|
80
|
+
l.includes('0 failed')));
|
|
81
|
+
const testExplicitFail = lines.some((l) => (l.includes('test') || l.includes('vitest') || l.includes('jest')) &&
|
|
82
|
+
l.includes('fail') &&
|
|
83
|
+
!l.includes('0 fail'));
|
|
84
|
+
const testsPass = testExplicitFail ? false : testExplicitPass || testFailCount === 0;
|
|
85
|
+
// Coverage: parse actual percentage or explicit pass/fail
|
|
86
|
+
const covPct = this.parseCoveragePercentage(output);
|
|
87
|
+
const coveragePass = (covPct !== null && covPct >= 95) ||
|
|
88
|
+
lines.some((l) => l.includes('coverage') && this.lineHasPercentageAbove(l, 95)) ||
|
|
69
89
|
lines.some((l) => l.includes('coverage') && (l.includes('pass') || l.includes('met') || l.includes('✓')));
|
|
70
90
|
return {
|
|
71
91
|
type_check: typeCheckPass,
|
|
@@ -74,6 +94,72 @@ export class RalphParser {
|
|
|
74
94
|
coverage_met: coveragePass,
|
|
75
95
|
};
|
|
76
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Parse lint error count from ESLint output.
|
|
99
|
+
* Returns 0 if no error count found (treat as passing).
|
|
100
|
+
*/
|
|
101
|
+
static parseLintErrorCount(lines) {
|
|
102
|
+
for (const line of lines) {
|
|
103
|
+
// "X problems (Y errors, Z warnings)"
|
|
104
|
+
const problemsMatch = line.match(/(\d+)\s+problems?\s+\((\d+)\s+errors?/);
|
|
105
|
+
if (problemsMatch) {
|
|
106
|
+
return parseInt(problemsMatch[2], 10);
|
|
107
|
+
}
|
|
108
|
+
// "X error" standalone
|
|
109
|
+
const errorCountMatch = line.match(/^(\d+)\s+errors?$/);
|
|
110
|
+
if (errorCountMatch) {
|
|
111
|
+
return parseInt(errorCountMatch[1], 10);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return 0;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Parse test failure count from vitest/jest output.
|
|
118
|
+
* Returns 0 if no failure count found (treat as passing).
|
|
119
|
+
*/
|
|
120
|
+
static parseTestFailCount(lines) {
|
|
121
|
+
for (const line of lines) {
|
|
122
|
+
// "X failed" — vitest/jest
|
|
123
|
+
const failMatch = line.match(/(\d+)\s+failed/);
|
|
124
|
+
if (failMatch) {
|
|
125
|
+
return parseInt(failMatch[1], 10);
|
|
126
|
+
}
|
|
127
|
+
// "Tests: X failed" — jest summary
|
|
128
|
+
const jestMatch = line.match(/tests:\s+(\d+)\s+failed/);
|
|
129
|
+
if (jestMatch) {
|
|
130
|
+
return parseInt(jestMatch[1], 10);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return 0;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Parse real coverage percentage from test runner output.
|
|
137
|
+
* Supports vitest table format and jest/c8 line format.
|
|
138
|
+
* Returns null if coverage cannot be determined.
|
|
139
|
+
*/
|
|
140
|
+
static parseCoveragePercentage(output) {
|
|
141
|
+
// vitest/istanbul table: "All files | 87.50 | ..." or "All files | 87.50 |"
|
|
142
|
+
const vitestMatch = output.match(/all files\s*\|\s*(\d+(?:\.\d+)?)\s*\|/i);
|
|
143
|
+
if (vitestMatch) {
|
|
144
|
+
return parseFloat(vitestMatch[1]);
|
|
145
|
+
}
|
|
146
|
+
// jest: "Lines : 87.5%" or "Lines : 87.5 %"
|
|
147
|
+
const jestLinesMatch = output.match(/lines\s*:\s*(\d+(?:\.\d+)?)\s*%/i);
|
|
148
|
+
if (jestLinesMatch) {
|
|
149
|
+
return parseFloat(jestLinesMatch[1]);
|
|
150
|
+
}
|
|
151
|
+
// c8/nyc: "% Lines | 87.5"
|
|
152
|
+
const c8Match = output.match(/%\s*lines\s*\|\s*(\d+(?:\.\d+)?)/i);
|
|
153
|
+
if (c8Match) {
|
|
154
|
+
return parseFloat(c8Match[1]);
|
|
155
|
+
}
|
|
156
|
+
// Generic: "coverage: 87%" or "coverage 87.5%"
|
|
157
|
+
const genericMatch = output.match(/coverage[:\s]+(\d+(?:\.\d+)?)%/i);
|
|
158
|
+
if (genericMatch) {
|
|
159
|
+
return parseFloat(genericMatch[1]);
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
77
163
|
/**
|
|
78
164
|
* Helper: Check if a single line contains percentage >= threshold
|
|
79
165
|
*/
|
|
@@ -223,5 +309,107 @@ export class RalphParser {
|
|
|
223
309
|
const lowerOutput = output.toLowerCase();
|
|
224
310
|
return completionKeywords.some((kw) => lowerOutput.includes(kw));
|
|
225
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Parse `npm audit --json` output.
|
|
314
|
+
* Returns the highest severity found: 'critical' | 'high' | 'moderate' | 'low' | 'none'
|
|
315
|
+
*/
|
|
316
|
+
static parseNpmAuditSeverity(jsonOutput) {
|
|
317
|
+
try {
|
|
318
|
+
const parsed = JSON.parse(jsonOutput);
|
|
319
|
+
const v = parsed?.metadata?.vulnerabilities;
|
|
320
|
+
if (!v)
|
|
321
|
+
return 'none';
|
|
322
|
+
if ((v.critical ?? 0) > 0)
|
|
323
|
+
return 'critical';
|
|
324
|
+
if ((v.high ?? 0) > 0)
|
|
325
|
+
return 'high';
|
|
326
|
+
if ((v.moderate ?? 0) > 0)
|
|
327
|
+
return 'moderate';
|
|
328
|
+
if ((v.low ?? 0) > 0)
|
|
329
|
+
return 'low';
|
|
330
|
+
return 'none';
|
|
331
|
+
}
|
|
332
|
+
catch {
|
|
333
|
+
// Not valid JSON — try text-based fallback
|
|
334
|
+
return this.parseSecurityOutputText(jsonOutput);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Parse text-based security tool output (trivy, semgrep, or npm audit without --json).
|
|
339
|
+
* Returns the highest severity found: 'critical' | 'high' | 'moderate' | 'low' | 'none'
|
|
340
|
+
*/
|
|
341
|
+
static parseSecurityOutputText(output) {
|
|
342
|
+
const lower = output.toLowerCase();
|
|
343
|
+
if (lower.includes('critical'))
|
|
344
|
+
return 'critical';
|
|
345
|
+
if (lower.includes(' high'))
|
|
346
|
+
return 'high';
|
|
347
|
+
if (lower.includes('moderate'))
|
|
348
|
+
return 'moderate';
|
|
349
|
+
if (lower.includes(' low'))
|
|
350
|
+
return 'low';
|
|
351
|
+
return 'none';
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Parse trivy JSON output (`trivy fs --format json`) for the highest severity found.
|
|
355
|
+
*/
|
|
356
|
+
static parseTrivySeverity(jsonOutput) {
|
|
357
|
+
try {
|
|
358
|
+
const parsed = JSON.parse(jsonOutput);
|
|
359
|
+
const severities = (parsed.Results ?? [])
|
|
360
|
+
.flatMap((r) => r.Vulnerabilities ?? [])
|
|
361
|
+
.map((v) => (v.Severity ?? '').toLowerCase());
|
|
362
|
+
if (severities.includes('critical'))
|
|
363
|
+
return 'critical';
|
|
364
|
+
if (severities.includes('high'))
|
|
365
|
+
return 'high';
|
|
366
|
+
if (severities.includes('medium'))
|
|
367
|
+
return 'moderate'; // trivy uses MEDIUM
|
|
368
|
+
if (severities.includes('moderate'))
|
|
369
|
+
return 'moderate';
|
|
370
|
+
if (severities.includes('low'))
|
|
371
|
+
return 'low';
|
|
372
|
+
return 'none';
|
|
373
|
+
}
|
|
374
|
+
catch {
|
|
375
|
+
return this.parseSecurityOutputText(jsonOutput);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Parse semgrep JSON output (`semgrep --json`) for the highest severity found.
|
|
380
|
+
*/
|
|
381
|
+
static parseSemgrepSeverity(jsonOutput) {
|
|
382
|
+
try {
|
|
383
|
+
const parsed = JSON.parse(jsonOutput);
|
|
384
|
+
const severities = (parsed.results ?? []).map((r) => {
|
|
385
|
+
const sev = (r.extra?.severity ?? r.extra?.metadata?.severity ?? '').toLowerCase();
|
|
386
|
+
return sev;
|
|
387
|
+
});
|
|
388
|
+
if (severities.includes('critical') || severities.includes('error'))
|
|
389
|
+
return 'high'; // semgrep ERROR ≈ high
|
|
390
|
+
if (severities.includes('high'))
|
|
391
|
+
return 'high';
|
|
392
|
+
if (severities.includes('warning') ||
|
|
393
|
+
severities.includes('medium') ||
|
|
394
|
+
severities.includes('moderate'))
|
|
395
|
+
return 'moderate';
|
|
396
|
+
if (severities.includes('info') || severities.includes('low'))
|
|
397
|
+
return 'low';
|
|
398
|
+
return severities.length > 0 ? 'low' : 'none';
|
|
399
|
+
}
|
|
400
|
+
catch {
|
|
401
|
+
return this.parseSecurityOutputText(jsonOutput);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Determine if a security gate passes given the found severity and the configured failOn threshold.
|
|
406
|
+
* Severity order: none < low < moderate < high < critical
|
|
407
|
+
*/
|
|
408
|
+
static securityGatePasses(foundSeverity, failOn) {
|
|
409
|
+
const order = ['none', 'low', 'moderate', 'high', 'critical'];
|
|
410
|
+
const foundIdx = order.indexOf(foundSeverity);
|
|
411
|
+
const failIdx = order.indexOf(failOn);
|
|
412
|
+
return foundIdx < failIdx;
|
|
413
|
+
}
|
|
226
414
|
}
|
|
227
415
|
//# sourceMappingURL=ralph-parser.js.map
|