delimit-cli 2.3.2 → 3.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/.dockerignore +7 -0
- package/.github/workflows/ci.yml +22 -0
- package/CHANGELOG.md +33 -0
- package/CODE_OF_CONDUCT.md +48 -0
- package/CONTRIBUTING.md +67 -0
- package/Dockerfile +9 -0
- package/LICENSE +21 -0
- package/README.md +51 -130
- package/SECURITY.md +42 -0
- package/adapters/codex-forge.js +107 -0
- package/adapters/codex-jamsons.js +142 -0
- package/adapters/codex-security.js +94 -0
- package/adapters/gemini-forge.js +120 -0
- package/adapters/gemini-jamsons.js +152 -0
- package/bin/delimit-cli.js +52 -2
- package/bin/delimit-setup.js +258 -0
- package/gateway/ai/backends/__init__.py +0 -0
- package/gateway/ai/backends/async_utils.py +21 -0
- package/gateway/ai/backends/deploy_bridge.py +150 -0
- package/gateway/ai/backends/gateway_core.py +261 -0
- package/gateway/ai/backends/generate_bridge.py +38 -0
- package/gateway/ai/backends/governance_bridge.py +196 -0
- package/gateway/ai/backends/intel_bridge.py +59 -0
- package/gateway/ai/backends/memory_bridge.py +93 -0
- package/gateway/ai/backends/ops_bridge.py +137 -0
- package/gateway/ai/backends/os_bridge.py +82 -0
- package/gateway/ai/backends/repo_bridge.py +117 -0
- package/gateway/ai/backends/ui_bridge.py +118 -0
- package/gateway/ai/backends/vault_bridge.py +129 -0
- package/gateway/ai/server.py +1182 -0
- package/gateway/core/__init__.py +3 -0
- package/gateway/core/__pycache__/__init__.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/auto_baseline.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/ci_formatter.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/contract_ledger.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/dependency_graph.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/dependency_manifest.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/diff_engine_v2.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/event_backbone.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/event_schema.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/explainer.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/gateway.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/gateway_v2.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/gateway_v3.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/impact_analyzer.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/policy_engine.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/registry.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/registry_v2.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/registry_v3.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/semver_classifier.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/spec_detector.cpython-310.pyc +0 -0
- package/gateway/core/__pycache__/surface_bridge.cpython-310.pyc +0 -0
- package/gateway/core/auto_baseline.py +304 -0
- package/gateway/core/ci_formatter.py +283 -0
- package/gateway/core/complexity_analyzer.py +386 -0
- package/gateway/core/contract_ledger.py +345 -0
- package/gateway/core/dependency_graph.py +218 -0
- package/gateway/core/dependency_manifest.py +223 -0
- package/gateway/core/diff_engine_v2.py +477 -0
- package/gateway/core/diff_engine_v2.py.bak +426 -0
- package/gateway/core/event_backbone.py +268 -0
- package/gateway/core/event_schema.py +258 -0
- package/gateway/core/explainer.py +438 -0
- package/gateway/core/gateway.py +128 -0
- package/gateway/core/gateway_v2.py +154 -0
- package/gateway/core/gateway_v3.py +224 -0
- package/gateway/core/impact_analyzer.py +163 -0
- package/gateway/core/policies/default.yml +13 -0
- package/gateway/core/policies/relaxed.yml +48 -0
- package/gateway/core/policies/strict.yml +55 -0
- package/gateway/core/policy_engine.py +464 -0
- package/gateway/core/registry.py +52 -0
- package/gateway/core/registry_v2.py +132 -0
- package/gateway/core/registry_v3.py +134 -0
- package/gateway/core/semver_classifier.py +152 -0
- package/gateway/core/spec_detector.py +130 -0
- package/gateway/core/surface_bridge.py +307 -0
- package/gateway/core/zero_spec/__init__.py +4 -0
- package/gateway/core/zero_spec/__pycache__/__init__.cpython-310.pyc +0 -0
- package/gateway/core/zero_spec/__pycache__/detector.cpython-310.pyc +0 -0
- package/gateway/core/zero_spec/__pycache__/express_extractor.cpython-310.pyc +0 -0
- package/gateway/core/zero_spec/__pycache__/fastapi_extractor.cpython-310.pyc +0 -0
- package/gateway/core/zero_spec/__pycache__/nestjs_extractor.cpython-310.pyc +0 -0
- package/gateway/core/zero_spec/detector.py +353 -0
- package/gateway/core/zero_spec/express_extractor.py +483 -0
- package/gateway/core/zero_spec/fastapi_extractor.py +254 -0
- package/gateway/core/zero_spec/nestjs_extractor.py +369 -0
- package/gateway/tasks/__init__.py +1 -0
- package/gateway/tasks/__pycache__/__init__.cpython-310.pyc +0 -0
- package/gateway/tasks/__pycache__/check_policy.cpython-310.pyc +0 -0
- package/gateway/tasks/__pycache__/check_policy_v2.cpython-310.pyc +0 -0
- package/gateway/tasks/__pycache__/check_policy_v3.cpython-310.pyc +0 -0
- package/gateway/tasks/__pycache__/explain_diff.cpython-310.pyc +0 -0
- package/gateway/tasks/__pycache__/explain_diff_v2.cpython-310.pyc +0 -0
- package/gateway/tasks/__pycache__/validate_api.cpython-310.pyc +0 -0
- package/gateway/tasks/__pycache__/validate_api_v2.cpython-310.pyc +0 -0
- package/gateway/tasks/__pycache__/validate_api_v3.cpython-310.pyc +0 -0
- package/gateway/tasks/check_policy.py +177 -0
- package/gateway/tasks/check_policy_v2.py +255 -0
- package/gateway/tasks/check_policy_v3.py +255 -0
- package/gateway/tasks/explain_diff.py +305 -0
- package/gateway/tasks/explain_diff_v2.py +267 -0
- package/gateway/tasks/validate_api.py +131 -0
- package/gateway/tasks/validate_api_v2.py +208 -0
- package/gateway/tasks/validate_api_v3.py +163 -0
- package/package.json +3 -3
- package/adapters/codex-skill.js +0 -87
- package/adapters/cursor-extension.js +0 -190
- package/adapters/gemini-action.js +0 -93
- package/adapters/openai-function.js +0 -112
- package/adapters/xai-plugin.js +0 -151
- package/test-decision-engine.js +0 -181
- package/test-hook.js +0 -27
package/.dockerignore
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
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/CHANGELOG.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [2.4.0] - 2026-03-15
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- 29 real CLI tests covering init, lint, diff, explain, doctor, presets, and error handling
|
|
7
|
+
- Auto-write GitHub Actions workflow file on `delimit init`
|
|
8
|
+
|
|
9
|
+
### Improved
|
|
10
|
+
- Version now read from package.json instead of hardcoded
|
|
11
|
+
- Error handling across all commands
|
|
12
|
+
|
|
13
|
+
## [2.3.2] - 2026-03-09
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- Clean --help output (legacy commands hidden)
|
|
17
|
+
- File existence checks before lint/diff operations
|
|
18
|
+
- --policy flag accepts preset names (strict, default, relaxed)
|
|
19
|
+
|
|
20
|
+
## [2.3.0] - 2026-03-07
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- Policy presets: strict (all errors), default (balanced), relaxed (warnings only)
|
|
24
|
+
- `delimit doctor` command for environment diagnostics
|
|
25
|
+
- `delimit explain` command with 7 output templates
|
|
26
|
+
|
|
27
|
+
## [2.0.0] - 2026-02-28
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- Deterministic diff engine (23 change types, 10 breaking)
|
|
31
|
+
- Policy enforcement with exit code 1 on violations
|
|
32
|
+
- Semver classification (MAJOR/MINOR/PATCH/NONE)
|
|
33
|
+
- Zero-Spec extraction for FastAPI, NestJS, Express
|
|
@@ -0,0 +1,48 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Delimit AI
|
|
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
CHANGED
|
@@ -1,167 +1,88 @@
|
|
|
1
|
-
# delimit
|
|
1
|
+
# delimit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Deterministic diff engine + policy enforcement + semver classification for OpenAPI specs. The independent successor to Optic.
|
|
3
|
+
Catch breaking API changes before they ship.
|
|
6
4
|
|
|
7
5
|
[](https://www.npmjs.com/package/delimit-cli)
|
|
6
|
+
[](https://github.com/marketplace/actions/delimit-api-governance)
|
|
8
7
|
[](https://opensource.org/licenses/MIT)
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
Deterministic diff engine for OpenAPI specs. Detects breaking changes, classifies semver, enforces policy, and posts PR comments with migration guides. No API keys, no external services.
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
npm install -g delimit-cli
|
|
14
|
-
```
|
|
11
|
+
---
|
|
15
12
|
|
|
16
|
-
##
|
|
13
|
+
## GitHub Action (recommended)
|
|
17
14
|
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# 2. Detect breaking changes
|
|
23
|
-
delimit lint api/openapi-old.yaml api/openapi-new.yaml
|
|
15
|
+
```yaml
|
|
16
|
+
name: API Contract Check
|
|
17
|
+
on: pull_request
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
jobs:
|
|
20
|
+
delimit:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
permissions:
|
|
23
|
+
pull-requests: write
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
- uses: delimit-ai/delimit-action@v1
|
|
27
|
+
with:
|
|
28
|
+
spec: api/openapi.yaml
|
|
27
29
|
```
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Delimit deterministically detects 23 types of API changes, including 10 breaking patterns:
|
|
32
|
-
|
|
33
|
-
- Endpoint or method removal
|
|
34
|
-
- Required parameter addition
|
|
35
|
-
- Response field removal
|
|
36
|
-
- Type changes
|
|
37
|
-
- Enum value removal
|
|
38
|
-
- And more
|
|
39
|
-
|
|
40
|
-
Every change is classified as `MAJOR`, `MINOR`, `PATCH`, or `NONE` per semver.
|
|
41
|
-
|
|
42
|
-
## Commands
|
|
43
|
-
|
|
44
|
-
| Command | Description |
|
|
45
|
-
|---------|-------------|
|
|
46
|
-
| `delimit init` | Create `.delimit/policies.yml` with a policy preset |
|
|
47
|
-
| `delimit lint <old> <new>` | Diff + policy check — returns exit code 1 on violations |
|
|
48
|
-
| `delimit diff <old> <new>` | Raw diff with `[BREAKING]`/`[safe]` tags |
|
|
49
|
-
| `delimit explain <old> <new>` | Human-readable change explanation |
|
|
50
|
-
|
|
51
|
-
## Policy Presets
|
|
52
|
-
|
|
53
|
-
Choose a preset that fits your team:
|
|
31
|
+
One input. Delimit fetches the base branch version automatically. Runs in **advisory mode** by default -- posts a PR comment but does not fail your build. Set `mode: enforce` to block merges on breaking changes.
|
|
54
32
|
|
|
55
|
-
|
|
56
|
-
delimit init --preset strict # Public APIs, payments — zero tolerance
|
|
57
|
-
delimit init --preset default # Most teams — balanced rules
|
|
58
|
-
delimit init --preset relaxed # Internal APIs, startups — warnings only
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
| Preset | Breaking changes | Type changes | Field removal |
|
|
62
|
-
|--------|-----------------|--------------|---------------|
|
|
63
|
-
| `strict` | Error (blocks) | Error (blocks) | Error (blocks) |
|
|
64
|
-
| `default` | Error (blocks) | Warning | Error (blocks) |
|
|
65
|
-
| `relaxed` | Warning | Warning | Info |
|
|
33
|
+
---
|
|
66
34
|
|
|
67
|
-
|
|
35
|
+
## CLI
|
|
68
36
|
|
|
69
37
|
```bash
|
|
70
|
-
delimit lint
|
|
38
|
+
npx delimit-cli lint api/openapi.yaml
|
|
39
|
+
npx delimit-cli diff old.yaml new.yaml
|
|
40
|
+
npx delimit-cli explain old.yaml new.yaml --template migration
|
|
71
41
|
```
|
|
72
42
|
|
|
73
|
-
|
|
43
|
+
Or install globally:
|
|
74
44
|
|
|
75
45
|
```bash
|
|
76
|
-
|
|
77
|
-
delimit
|
|
78
|
-
|
|
79
|
-
# Explainer templates
|
|
80
|
-
delimit explain old.yaml new.yaml -t migration
|
|
81
|
-
delimit explain old.yaml new.yaml -t pr_comment
|
|
82
|
-
delimit explain old.yaml new.yaml -t changelog
|
|
83
|
-
|
|
84
|
-
# JSON output for scripting
|
|
85
|
-
delimit lint old.yaml new.yaml --json
|
|
46
|
+
npm install -g delimit-cli
|
|
47
|
+
delimit init --preset default
|
|
48
|
+
delimit lint api/openapi.yaml
|
|
86
49
|
```
|
|
87
50
|
|
|
88
|
-
###
|
|
89
|
-
|
|
90
|
-
| Template | Audience |
|
|
91
|
-
|----------|----------|
|
|
92
|
-
| `developer` | Technical details for engineers |
|
|
93
|
-
| `team_lead` | Summary for engineering managers |
|
|
94
|
-
| `product` | Non-technical overview for PMs |
|
|
95
|
-
| `migration` | Step-by-step migration guide |
|
|
96
|
-
| `changelog` | Ready-to-paste changelog entry |
|
|
97
|
-
| `pr_comment` | GitHub PR comment format |
|
|
98
|
-
| `slack` | Slack message format |
|
|
51
|
+
### Commands
|
|
99
52
|
|
|
100
|
-
|
|
53
|
+
| Command | What it does |
|
|
54
|
+
|---------|-------------|
|
|
55
|
+
| `delimit init [--preset]` | Create `.delimit/policies.yml` with a policy preset |
|
|
56
|
+
| `delimit lint <spec>` | Diff + policy check. Exit 1 on violations. |
|
|
57
|
+
| `delimit diff <old> <new>` | Raw diff with `[BREAKING]` / `[safe]` tags |
|
|
58
|
+
| `delimit explain <old> <new>` | Human-readable summary (7 templates) |
|
|
101
59
|
|
|
102
|
-
|
|
60
|
+
### Policy presets
|
|
103
61
|
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
paths:
|
|
109
|
-
- 'path/to/openapi.yaml' # adjust to your spec path
|
|
110
|
-
permissions:
|
|
111
|
-
contents: read
|
|
112
|
-
pull-requests: write
|
|
113
|
-
jobs:
|
|
114
|
-
api-governance:
|
|
115
|
-
runs-on: ubuntu-latest
|
|
116
|
-
steps:
|
|
117
|
-
- uses: actions/checkout@v4
|
|
118
|
-
- uses: actions/checkout@v4
|
|
119
|
-
with:
|
|
120
|
-
ref: ${{ github.event.pull_request.base.sha }}
|
|
121
|
-
path: _base
|
|
122
|
-
- uses: delimit-ai/delimit@v1
|
|
123
|
-
with:
|
|
124
|
-
old_spec: _base/path/to/openapi.yaml
|
|
125
|
-
new_spec: path/to/openapi.yaml
|
|
126
|
-
mode: advisory # or 'enforce' to block PRs
|
|
62
|
+
```bash
|
|
63
|
+
delimit init --preset strict # All breaking changes are errors
|
|
64
|
+
delimit init --preset default # Breaking = error, type changes = warn
|
|
65
|
+
delimit init --preset relaxed # Everything is a warning
|
|
127
66
|
```
|
|
128
67
|
|
|
129
|
-
|
|
130
|
-
- Semver badge (`MAJOR` / `MINOR` / `PATCH`)
|
|
131
|
-
- Violation table with severity
|
|
132
|
-
- Expandable migration guide for breaking changes
|
|
133
|
-
|
|
134
|
-
See [Delimit API Governance](https://github.com/marketplace/actions/delimit-api-governance) on the GitHub Marketplace.
|
|
68
|
+
Or inline: `delimit lint --policy strict api/openapi.yaml`
|
|
135
69
|
|
|
136
|
-
|
|
70
|
+
---
|
|
137
71
|
|
|
138
|
-
|
|
72
|
+
## What it catches
|
|
139
73
|
|
|
140
|
-
|
|
141
|
-
override_defaults: false
|
|
142
|
-
|
|
143
|
-
rules:
|
|
144
|
-
- id: protect_v1
|
|
145
|
-
name: Protect V1 API
|
|
146
|
-
change_types: [endpoint_removed, method_removed, field_removed]
|
|
147
|
-
severity: error
|
|
148
|
-
action: forbid
|
|
149
|
-
conditions:
|
|
150
|
-
path_pattern: "^/v1/.*"
|
|
151
|
-
message: "V1 API is frozen. Make changes in V2."
|
|
152
|
-
```
|
|
74
|
+
10 breaking change types (endpoint removed, method removed, required param added, param removed, response removed, required field added, response field removed, type changed, format changed, enum value removed) plus 7 non-breaking types for full visibility. Every change classified as `MAJOR`, `MINOR`, `PATCH`, or `NONE`.
|
|
153
75
|
|
|
154
|
-
|
|
76
|
+
Supports OpenAPI 3.0, 3.1, and Swagger 2.0 in YAML or JSON.
|
|
155
77
|
|
|
156
|
-
|
|
157
|
-
- Swagger 2.0
|
|
158
|
-
- YAML and JSON formats
|
|
78
|
+
---
|
|
159
79
|
|
|
160
80
|
## Links
|
|
161
81
|
|
|
162
|
-
- [
|
|
163
|
-
- [GitHub](https://github.com/delimit-
|
|
164
|
-
- [
|
|
82
|
+
- [delimit.ai](https://delimit.ai)
|
|
83
|
+
- [GitHub Action](https://github.com/marketplace/actions/delimit-api-governance)
|
|
84
|
+
- [delimit-cli on npm](https://www.npmjs.com/package/delimit-cli)
|
|
85
|
+
- [Quickstart repo](https://github.com/delimit-ai/delimit-quickstart)
|
|
165
86
|
|
|
166
87
|
## License
|
|
167
88
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
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.
|
|
@@ -0,0 +1,107 @@
|
|
|
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
|
+
}
|