delimit-cli 3.6.2 → 3.6.4
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/README.md +125 -30
- package/gateway/ai/governance.py +4 -0
- package/package.json +11 -2
- package/.dockerignore +0 -7
- package/.github/workflows/api-governance.yml +0 -43
- package/.github/workflows/ci.yml +0 -22
- package/CODE_OF_CONDUCT.md +0 -48
- package/CONTRIBUTING.md +0 -67
- package/Dockerfile +0 -9
- package/SECURITY.md +0 -42
- package/adapters/codex-forge.js +0 -107
- package/adapters/codex-jamsons.js +0 -142
- package/adapters/codex-security.js +0 -94
- package/adapters/gemini-forge.js +0 -120
- package/adapters/gemini-jamsons.js +0 -152
- package/delimit.yml +0 -19
- package/glama.json +0 -1
- package/hooks/evidence-status.sh +0 -12
- package/hooks/git/commit-msg +0 -4
- package/hooks/git/pre-commit +0 -4
- package/hooks/git/pre-push +0 -4
- package/hooks/install-hooks.sh +0 -583
- package/hooks/message-auth-hook.js +0 -9
- package/hooks/message-governance-hook.js +0 -9
- package/hooks/models/claude-post.js +0 -4
- package/hooks/models/claude-pre.js +0 -4
- package/hooks/models/codex-post.js +0 -4
- package/hooks/models/codex-pre.js +0 -4
- package/hooks/models/cursor-post.js +0 -4
- package/hooks/models/cursor-pre.js +0 -4
- package/hooks/models/gemini-post.js +0 -4
- package/hooks/models/gemini-pre.js +0 -4
- package/hooks/models/openai-post.js +0 -4
- package/hooks/models/openai-pre.js +0 -4
- package/hooks/models/windsurf-post.js +0 -4
- package/hooks/models/windsurf-pre.js +0 -4
- package/hooks/models/xai-post.js +0 -4
- package/hooks/models/xai-pre.js +0 -4
- package/hooks/post-bash-hook.js +0 -13
- package/hooks/post-mcp-hook.js +0 -13
- package/hooks/post-response-hook.js +0 -4
- package/hooks/post-tool-hook.js +0 -126
- package/hooks/post-write-hook.js +0 -13
- package/hooks/pre-bash-hook.js +0 -30
- package/hooks/pre-mcp-hook.js +0 -13
- package/hooks/pre-read-hook.js +0 -13
- package/hooks/pre-search-hook.js +0 -13
- package/hooks/pre-submit-hook.js +0 -4
- package/hooks/pre-task-hook.js +0 -13
- package/hooks/pre-tool-hook.js +0 -121
- package/hooks/pre-web-hook.js +0 -13
- package/hooks/pre-write-hook.js +0 -31
- package/hooks/test-hooks.sh +0 -12
- package/hooks/update-delimit.sh +0 -6
- package/scripts/infect.js +0 -128
- package/tests/setup-onboarding.test.js +0 -147
package/README.md
CHANGED
|
@@ -1,60 +1,155 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Delimit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Catch breaking API changes before they reach production.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/delimit-cli)
|
|
6
|
+
[](https://github.com/marketplace/actions/delimit-api-governance)
|
|
6
7
|
[](https://opensource.org/licenses/MIT)
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Delimit diffs your OpenAPI spec on every pull request. Breaking changes get flagged, semver gets classified, and your team gets a migration guide — automatically.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## GitHub Action
|
|
14
|
+
|
|
15
|
+
Add to any repo with an OpenAPI spec:
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
name: API Contract Check
|
|
19
|
+
on: pull_request
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
delimit:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
permissions:
|
|
25
|
+
pull-requests: write
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 0
|
|
30
|
+
- uses: delimit-ai/delimit-action@v1
|
|
31
|
+
with:
|
|
32
|
+
spec: api/openapi.yaml
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
That's it. Delimit auto-fetches the base branch spec, diffs it, and posts a PR comment with:
|
|
36
|
+
|
|
37
|
+
- Breaking changes with severity badges
|
|
38
|
+
- Semver classification (major/minor/patch)
|
|
39
|
+
- Step-by-step migration guide
|
|
40
|
+
- Policy violations
|
|
41
|
+
|
|
42
|
+
[View on GitHub Marketplace →](https://github.com/marketplace/actions/delimit-api-governance)
|
|
43
|
+
|
|
44
|
+
### Example PR comment
|
|
45
|
+
|
|
46
|
+
> **Breaking Changes Detected**
|
|
47
|
+
>
|
|
48
|
+
> | Change | Path | Severity |
|
|
49
|
+
> |--------|------|----------|
|
|
50
|
+
> | endpoint_removed | `DELETE /pets/{petId}` | error |
|
|
51
|
+
> | type_changed | `/pets:GET:200[].id` (string → integer) | warning |
|
|
52
|
+
> | enum_value_removed | `/pets:GET:200[].status` | warning |
|
|
53
|
+
>
|
|
54
|
+
> **Semver**: MAJOR (1.0.0 → 2.0.0)
|
|
55
|
+
>
|
|
56
|
+
> **Migration Guide**: 3 steps to update your integration
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## CLI + MCP Toolkit
|
|
61
|
+
|
|
62
|
+
Governance tools for AI coding assistants (Claude Code, Codex, Cursor, Gemini CLI):
|
|
11
63
|
|
|
12
64
|
```bash
|
|
13
65
|
npx delimit-cli setup
|
|
14
66
|
```
|
|
15
67
|
|
|
16
|
-
|
|
68
|
+
No API keys. No account. Installs in 10 seconds.
|
|
17
69
|
|
|
18
|
-
|
|
70
|
+
### CLI commands
|
|
19
71
|
|
|
20
|
-
|
|
72
|
+
```bash
|
|
73
|
+
npx delimit-cli lint api/openapi.yaml # Check for breaking changes
|
|
74
|
+
npx delimit-cli diff old.yaml new.yaml # Compare two specs
|
|
75
|
+
npx delimit-cli explain old.yaml new.yaml # Generate migration guide
|
|
76
|
+
npx delimit-cli init --preset strict # Initialize policies
|
|
77
|
+
npx delimit-cli doctor # Check setup health
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### What the MCP toolkit adds
|
|
21
81
|
|
|
82
|
+
When installed into your AI coding assistant, Delimit provides:
|
|
83
|
+
|
|
84
|
+
- **API governance** -- lint, diff, policy enforcement, semver classification
|
|
22
85
|
- **Test verification** -- confirms tests actually ran, measures coverage
|
|
23
|
-
- **Security audit** -- scans dependencies, detects
|
|
24
|
-
- **
|
|
25
|
-
- **
|
|
26
|
-
- **
|
|
27
|
-
|
|
86
|
+
- **Security audit** -- scans dependencies, detects secrets and anti-patterns
|
|
87
|
+
- **Persistent ledger** -- tracks tasks across sessions, auto-creates items from governance
|
|
88
|
+
- **Multi-model consensus** -- Grok, Gemini, and Codex debate until they agree
|
|
89
|
+
- **Zero-spec extraction** -- generate OpenAPI specs from FastAPI, Express, or NestJS source
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## What it catches
|
|
28
94
|
|
|
29
|
-
|
|
95
|
+
10 categories of breaking changes:
|
|
30
96
|
|
|
31
|
-
|
|
97
|
+
| Change | Example |
|
|
98
|
+
|--------|---------|
|
|
99
|
+
| Endpoint removed | `DELETE /users/{id}` disappeared |
|
|
100
|
+
| HTTP method removed | `PATCH /orders` no longer exists |
|
|
101
|
+
| Required parameter added | New required header on `GET /items` |
|
|
102
|
+
| Field removed from response | `email` dropped from user object |
|
|
103
|
+
| Type changed | `id` went from string to integer |
|
|
104
|
+
| Enum value removed | `status: "pending"` no longer valid |
|
|
105
|
+
| Response code removed | `200 OK` response dropped |
|
|
106
|
+
| Parameter removed | `sort` query param removed |
|
|
107
|
+
| Required field added to request | Body now requires `tenant_id` |
|
|
108
|
+
| Format changed | `date-time` changed to `date` |
|
|
32
109
|
|
|
33
|
-
|
|
34
|
-
|---------|--------|
|
|
35
|
-
| "fix the 502 error" | Traced Vercel to Caddy to Docker, found wrong IP, fixed, verified |
|
|
36
|
-
| "run test coverage" | 299 to 1,113 tests, zero written manually |
|
|
37
|
-
| "run consensus on pricing" | 3 AI models debated, reached unanimous agreement |
|
|
110
|
+
Detection is deterministic — rules, not AI inference. Same input always produces the same result.
|
|
38
111
|
|
|
39
|
-
|
|
112
|
+
---
|
|
40
113
|
|
|
41
|
-
|
|
114
|
+
## Policy presets
|
|
42
115
|
|
|
43
|
-
|
|
116
|
+
```bash
|
|
117
|
+
npx delimit-cli init --preset strict # All violations are errors
|
|
118
|
+
npx delimit-cli init --preset default # Balanced (default)
|
|
119
|
+
npx delimit-cli init --preset relaxed # All violations are warnings
|
|
120
|
+
```
|
|
44
121
|
|
|
45
|
-
|
|
122
|
+
Or write custom rules in `.delimit/policies.yml`:
|
|
46
123
|
|
|
47
124
|
```yaml
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
125
|
+
rules:
|
|
126
|
+
- id: freeze_v1
|
|
127
|
+
name: Freeze V1 API
|
|
128
|
+
change_types: [endpoint_removed, method_removed, field_removed]
|
|
129
|
+
severity: error
|
|
130
|
+
action: forbid
|
|
131
|
+
conditions:
|
|
132
|
+
path_pattern: "^/v1/.*"
|
|
133
|
+
message: "V1 API is frozen. Changes must be made in V2."
|
|
51
134
|
```
|
|
52
135
|
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Supported formats
|
|
139
|
+
|
|
140
|
+
- OpenAPI 3.0 and 3.1
|
|
141
|
+
- Swagger 2.0
|
|
142
|
+
- YAML and JSON
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
53
146
|
## Links
|
|
54
147
|
|
|
55
|
-
- [delimit.ai](https://delimit.ai)
|
|
56
|
-
- [
|
|
57
|
-
- [
|
|
58
|
-
- [
|
|
148
|
+
- [delimit.ai](https://delimit.ai) -- homepage
|
|
149
|
+
- [Docs](https://delimit.ai/docs) -- full documentation
|
|
150
|
+
- [GitHub Action](https://github.com/marketplace/actions/delimit-api-governance) -- Marketplace listing
|
|
151
|
+
- [Quickstart](https://github.com/delimit-ai/delimit-quickstart) -- try it in 2 minutes
|
|
152
|
+
- [npm](https://www.npmjs.com/package/delimit-cli) -- CLI package
|
|
153
|
+
- [Pricing](https://delimit.ai/pricing) -- free tier + Pro
|
|
59
154
|
|
|
60
155
|
MIT License
|
package/gateway/ai/governance.py
CHANGED
|
@@ -231,6 +231,10 @@ def govern(tool_name: str, result: Dict[str, Any], project_path: str = ".") -> D
|
|
|
231
231
|
"reason": "Check ledger for what's next",
|
|
232
232
|
"premium": False,
|
|
233
233
|
})
|
|
234
|
+
else:
|
|
235
|
+
# Excluded tools still get the next_steps field (empty) for schema consistency
|
|
236
|
+
if "next_steps" not in governed_result:
|
|
237
|
+
governed_result["next_steps"] = []
|
|
234
238
|
|
|
235
239
|
return governed_result
|
|
236
240
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "delimit-cli",
|
|
3
|
-
"version": "3.6.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.6.4",
|
|
4
|
+
"description": "Catch breaking API changes before they ship. GitHub Action + CLI for OpenAPI specs.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"bin/",
|
|
8
|
+
"lib/",
|
|
9
|
+
"gateway/",
|
|
10
|
+
"server.json",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE",
|
|
13
|
+
"CHANGELOG.md"
|
|
14
|
+
],
|
|
6
15
|
"bin": {
|
|
7
16
|
"delimit": "./bin/delimit-cli.js",
|
|
8
17
|
"delimit-cli": "./bin/delimit-cli.js"
|
package/.dockerignore
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
name: API Governance
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
paths:
|
|
6
|
-
- '**/*.yaml'
|
|
7
|
-
- '**/*.yml'
|
|
8
|
-
- '**/*.json'
|
|
9
|
-
- 'lib/**'
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
api-check:
|
|
13
|
-
name: Delimit API Check
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
permissions:
|
|
16
|
-
pull-requests: write
|
|
17
|
-
steps:
|
|
18
|
-
- uses: actions/checkout@v4
|
|
19
|
-
|
|
20
|
-
- uses: actions/checkout@v4
|
|
21
|
-
with:
|
|
22
|
-
ref: ${{ github.event.pull_request.base.sha }}
|
|
23
|
-
path: base
|
|
24
|
-
|
|
25
|
-
- name: Check for spec changes
|
|
26
|
-
id: spec-check
|
|
27
|
-
run: |
|
|
28
|
-
# Find any OpenAPI/Swagger specs in the repo
|
|
29
|
-
SPECS=$(find . -path ./base -prune -o \( -name "openapi*.yaml" -o -name "openapi*.yml" -o -name "openapi*.json" -o -name "swagger*.yaml" -o -name "swagger*.json" \) -print | head -1)
|
|
30
|
-
if [ -n "$SPECS" ]; then
|
|
31
|
-
echo "spec_found=true" >> $GITHUB_OUTPUT
|
|
32
|
-
echo "spec_path=$SPECS" >> $GITHUB_OUTPUT
|
|
33
|
-
else
|
|
34
|
-
echo "spec_found=false" >> $GITHUB_OUTPUT
|
|
35
|
-
fi
|
|
36
|
-
|
|
37
|
-
- name: Run Delimit
|
|
38
|
-
if: steps.spec-check.outputs.spec_found == 'true'
|
|
39
|
-
uses: delimit-ai/delimit-action@v1
|
|
40
|
-
with:
|
|
41
|
-
old_spec: base/${{ steps.spec-check.outputs.spec_path }}
|
|
42
|
-
new_spec: ${{ steps.spec-check.outputs.spec_path }}
|
|
43
|
-
mode: advisory
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
name: Tests
|
|
2
|
-
|
|
3
|
-
on: [push, pull_request]
|
|
4
|
-
|
|
5
|
-
jobs:
|
|
6
|
-
test:
|
|
7
|
-
runs-on: ubuntu-latest
|
|
8
|
-
strategy:
|
|
9
|
-
matrix:
|
|
10
|
-
node-version: ['18', '20', '22']
|
|
11
|
-
|
|
12
|
-
name: Test Node ${{ matrix.node-version }}
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v4
|
|
15
|
-
|
|
16
|
-
- uses: actions/setup-node@v4
|
|
17
|
-
with:
|
|
18
|
-
node-version: ${{ matrix.node-version }}
|
|
19
|
-
|
|
20
|
-
- run: npm install
|
|
21
|
-
|
|
22
|
-
- run: npm test
|
package/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
# Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
-
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
-
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
|
8
|
-
identity and expression, level of experience, education, socio-economic status,
|
|
9
|
-
nationality, personal appearance, race, caste, color, religion, or sexual
|
|
10
|
-
identity and orientation.
|
|
11
|
-
|
|
12
|
-
## Our Standards
|
|
13
|
-
|
|
14
|
-
Examples of behavior that contributes to a positive environment:
|
|
15
|
-
|
|
16
|
-
* Using welcoming and inclusive language
|
|
17
|
-
* Being respectful of differing viewpoints and experiences
|
|
18
|
-
* Gracefully accepting constructive criticism
|
|
19
|
-
* Focusing on what is best for the community
|
|
20
|
-
* Showing empathy towards other community members
|
|
21
|
-
|
|
22
|
-
Examples of unacceptable behavior:
|
|
23
|
-
|
|
24
|
-
* The use of sexualized language or imagery
|
|
25
|
-
* Trolling, insulting or derogatory comments, and personal attacks
|
|
26
|
-
* Public or private harassment
|
|
27
|
-
* Publishing others' private information without permission
|
|
28
|
-
* Other conduct which could reasonably be considered inappropriate
|
|
29
|
-
|
|
30
|
-
## Enforcement Responsibilities
|
|
31
|
-
|
|
32
|
-
Community leaders are responsible for clarifying and enforcing our standards of
|
|
33
|
-
acceptable behavior and will take appropriate and fair corrective action in
|
|
34
|
-
response to any behavior that they deem inappropriate, threatening, offensive,
|
|
35
|
-
or harmful.
|
|
36
|
-
|
|
37
|
-
## Enforcement
|
|
38
|
-
|
|
39
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
40
|
-
reported to the community leaders responsible for enforcement at
|
|
41
|
-
opensource@delimit.ai.
|
|
42
|
-
|
|
43
|
-
All complaints will be reviewed and investigated promptly and fairly.
|
|
44
|
-
|
|
45
|
-
## Attribution
|
|
46
|
-
|
|
47
|
-
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/),
|
|
48
|
-
version 2.1.
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
# Contributing to Delimit
|
|
2
|
-
|
|
3
|
-
Thank you for your interest in contributing to Delimit. We welcome contributions from the community.
|
|
4
|
-
|
|
5
|
-
## How to Contribute
|
|
6
|
-
|
|
7
|
-
### Reporting Issues
|
|
8
|
-
|
|
9
|
-
1. Check if the issue already exists
|
|
10
|
-
2. Create a new issue with:
|
|
11
|
-
- Clear title and description
|
|
12
|
-
- Steps to reproduce
|
|
13
|
-
- Expected vs actual behavior
|
|
14
|
-
- Environment details (OS, Node version, etc.)
|
|
15
|
-
|
|
16
|
-
### Submitting Pull Requests
|
|
17
|
-
|
|
18
|
-
1. Fork the repository
|
|
19
|
-
2. Create a feature branch: `git checkout -b feature/your-feature`
|
|
20
|
-
3. Make your changes
|
|
21
|
-
4. Run the test suite
|
|
22
|
-
5. Commit with clear messages
|
|
23
|
-
6. Push to your fork
|
|
24
|
-
7. Open a PR with:
|
|
25
|
-
- Description of changes
|
|
26
|
-
- Related issue numbers
|
|
27
|
-
- Test results
|
|
28
|
-
|
|
29
|
-
## Development Setup
|
|
30
|
-
|
|
31
|
-
### CLI (npm)
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm install -g delimit-cli
|
|
35
|
-
delimit doctor
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### GitHub Action
|
|
39
|
-
|
|
40
|
-
See [delimit-action](https://github.com/delimit-ai/delimit-action) for CI integration.
|
|
41
|
-
|
|
42
|
-
## Code Style
|
|
43
|
-
|
|
44
|
-
- Follow existing conventions in the codebase
|
|
45
|
-
- Use type hints where appropriate
|
|
46
|
-
- Document functions and classes
|
|
47
|
-
- Keep functions focused and small
|
|
48
|
-
|
|
49
|
-
## Testing
|
|
50
|
-
|
|
51
|
-
All PRs must:
|
|
52
|
-
- Pass existing tests
|
|
53
|
-
- Include tests for new features
|
|
54
|
-
- Not introduce regressions
|
|
55
|
-
|
|
56
|
-
## Areas for Contribution
|
|
57
|
-
|
|
58
|
-
- Documentation improvements
|
|
59
|
-
- Bug fixes
|
|
60
|
-
- New governance rules and policy presets
|
|
61
|
-
- Performance improvements
|
|
62
|
-
- Framework integrations (Zero-Spec extractors)
|
|
63
|
-
|
|
64
|
-
## Questions?
|
|
65
|
-
|
|
66
|
-
- Open a [Discussion](https://github.com/delimit-ai/delimit/discussions) on GitHub
|
|
67
|
-
- Email opensource@delimit.ai
|
package/Dockerfile
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
FROM node:20-slim
|
|
2
|
-
RUN apt-get update && apt-get install -y --no-install-recommends python3 python3-pip && rm -rf /var/lib/apt/lists/*
|
|
3
|
-
RUN pip3 install --break-system-packages pyyaml pydantic packaging
|
|
4
|
-
WORKDIR /app
|
|
5
|
-
COPY package*.json ./
|
|
6
|
-
RUN npm install --production --ignore-scripts
|
|
7
|
-
COPY . .
|
|
8
|
-
ENV DELIMIT_GATEWAY_ROOT=/app/gateway
|
|
9
|
-
ENTRYPOINT ["node", "bin/delimit-cli.js"]
|
package/SECURITY.md
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
## Supported Versions
|
|
4
|
-
|
|
5
|
-
| Version | Supported |
|
|
6
|
-
| ------- | --------- |
|
|
7
|
-
| 2.x | Yes |
|
|
8
|
-
| 1.x | No |
|
|
9
|
-
|
|
10
|
-
## Reporting a Vulnerability
|
|
11
|
-
|
|
12
|
-
We take security seriously at Delimit. If you discover a security vulnerability, please follow these steps:
|
|
13
|
-
|
|
14
|
-
1. **Do NOT** create a public GitHub issue
|
|
15
|
-
2. Email security@delimit.ai with:
|
|
16
|
-
- Description of the vulnerability
|
|
17
|
-
- Steps to reproduce
|
|
18
|
-
- Potential impact
|
|
19
|
-
- Your suggested fix (if any)
|
|
20
|
-
|
|
21
|
-
## Response Timeline
|
|
22
|
-
|
|
23
|
-
- **Acknowledgment**: Within 24 hours
|
|
24
|
-
- **Initial Assessment**: Within 72 hours
|
|
25
|
-
- **Fix Timeline**: Based on severity
|
|
26
|
-
- Critical: Within 7 days
|
|
27
|
-
- High: Within 14 days
|
|
28
|
-
- Medium: Within 30 days
|
|
29
|
-
- Low: Next release
|
|
30
|
-
|
|
31
|
-
## Security Best Practices
|
|
32
|
-
|
|
33
|
-
When using Delimit:
|
|
34
|
-
|
|
35
|
-
1. **Never commit API keys or tokens** to your repository
|
|
36
|
-
2. **Use environment variables** for sensitive configuration
|
|
37
|
-
3. **Keep Delimit updated** to the latest version
|
|
38
|
-
4. **Review PR annotations** before merging
|
|
39
|
-
|
|
40
|
-
## Data Privacy
|
|
41
|
-
|
|
42
|
-
Delimit processes your API specifications locally. The CLI and GitHub Action do not send your specs to external servers.
|
package/adapters/codex-forge.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Delimit™ Codex Forge Adapter
|
|
4
|
-
* Layer: Forge (execution governance)
|
|
5
|
-
* Surfaces test failures, deploy state, and release gates before accepting code.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
'use strict';
|
|
9
|
-
|
|
10
|
-
const axios = require('axios');
|
|
11
|
-
const AGENT_URL = `http://127.0.0.1:${process.env.DELIMIT_AGENT_PORT || 7823}`;
|
|
12
|
-
|
|
13
|
-
class DelimitCodexForge {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.name = 'delimit-forge';
|
|
16
|
-
this.version = '1.0.0';
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Before accepting code: check test gate and deploy state.
|
|
21
|
-
*/
|
|
22
|
-
async onBeforeSuggestion(context) {
|
|
23
|
-
const [testState, deployState] = await Promise.allSettled([
|
|
24
|
-
this._getTestGate(),
|
|
25
|
-
this._getDeployState(),
|
|
26
|
-
]);
|
|
27
|
-
|
|
28
|
-
const warnings = [];
|
|
29
|
-
|
|
30
|
-
if (testState.status === 'fulfilled' && testState.value.failing > 0) {
|
|
31
|
-
warnings.push(`[FORGE] ${testState.value.failing} test(s) failing — fix before accepting`);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (deployState.status === 'fulfilled' && deployState.value.locked) {
|
|
35
|
-
warnings.push(`[FORGE] Deploy locked: ${deployState.value.reason || 'release in progress'}`);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (warnings.length > 0) {
|
|
39
|
-
return { allow: true, warning: warnings.join(' | ') };
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return { allow: true };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
async onAfterAccept(context) {
|
|
46
|
-
try {
|
|
47
|
-
await axios.post(`${AGENT_URL}/audit`, {
|
|
48
|
-
action: 'forge_accept',
|
|
49
|
-
context,
|
|
50
|
-
timestamp: new Date().toISOString(),
|
|
51
|
-
}, { timeout: 2000 });
|
|
52
|
-
} catch (_) { /* silent */ }
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async _getTestGate() {
|
|
56
|
-
const r = await axios.get(`${AGENT_URL}/test/status`, { timeout: 3000 });
|
|
57
|
-
return r.data;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
async _getDeployState() {
|
|
61
|
-
const r = await axios.get(`${AGENT_URL}/deploy/status`, { timeout: 3000 });
|
|
62
|
-
return r.data;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
async handleCommand(command, _args) {
|
|
66
|
-
const { execSync } = require('child_process');
|
|
67
|
-
const cmds = {
|
|
68
|
-
'forge': 'delimit status --layer=forge',
|
|
69
|
-
'tests': 'delimit test --summary',
|
|
70
|
-
'deploy': 'delimit deploy --status',
|
|
71
|
-
'release': 'delimit release --status',
|
|
72
|
-
};
|
|
73
|
-
if (cmds[command]) {
|
|
74
|
-
try {
|
|
75
|
-
return execSync(cmds[command], { timeout: 10000 }).toString();
|
|
76
|
-
} catch (e) {
|
|
77
|
-
return `[FORGE] Command failed: ${e.message}`;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Returns structured Forge context for consensus use.
|
|
84
|
-
*/
|
|
85
|
-
async getContext() {
|
|
86
|
-
const [tests, deploy, release] = await Promise.allSettled([
|
|
87
|
-
axios.get(`${AGENT_URL}/test/status`, { timeout: 3000 }),
|
|
88
|
-
axios.get(`${AGENT_URL}/deploy/status`, { timeout: 3000 }),
|
|
89
|
-
axios.get(`${AGENT_URL}/release/status`, { timeout: 3000 }),
|
|
90
|
-
]);
|
|
91
|
-
|
|
92
|
-
return {
|
|
93
|
-
layer: 'forge',
|
|
94
|
-
tests: tests.status === 'fulfilled' ? tests.value.data : null,
|
|
95
|
-
deploy: deploy.status === 'fulfilled' ? deploy.value.data : null,
|
|
96
|
-
release: release.status === 'fulfilled' ? release.value.data : null,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (typeof module !== 'undefined' && module.exports) {
|
|
102
|
-
module.exports = new DelimitCodexForge();
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (typeof registerSkill === 'function') {
|
|
106
|
-
registerSkill(new DelimitCodexForge());
|
|
107
|
-
}
|