specops-ai 0.2.0__tar.gz
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.
- specops_ai-0.2.0/.github/workflows/ci.yml +43 -0
- specops_ai-0.2.0/.github/workflows/release.yml +21 -0
- specops_ai-0.2.0/.gitignore +19 -0
- specops_ai-0.2.0/.specops/replays/async-demo.json +21 -0
- specops_ai-0.2.0/.specops/replays/demo-session.json +25 -0
- specops_ai-0.2.0/CONTRIBUTING.md +173 -0
- specops_ai-0.2.0/DEVELOPMENT.md +77 -0
- specops_ai-0.2.0/LICENSE +21 -0
- specops_ai-0.2.0/PKG-INFO +306 -0
- specops_ai-0.2.0/README.md +272 -0
- specops_ai-0.2.0/ROADMAP.md +110 -0
- specops_ai-0.2.0/docs/announcements/v0.2.0.md +68 -0
- specops_ai-0.2.0/docs/specs/design.md +472 -0
- specops_ai-0.2.0/docs/specs/requirements.md +71 -0
- specops_ai-0.2.0/docs/specs/tasks.md +123 -0
- specops_ai-0.2.0/examples/README.md +37 -0
- specops_ai-0.2.0/examples/async_pipeline.py +72 -0
- specops_ai-0.2.0/examples/crewai_agent.py +104 -0
- specops_ai-0.2.0/examples/eval_golden_set.py +60 -0
- specops_ai-0.2.0/examples/langgraph_agent.py +98 -0
- specops_ai-0.2.0/examples/multi_agent_coordination.py +108 -0
- specops_ai-0.2.0/examples/plain_agent.py +44 -0
- specops_ai-0.2.0/examples/rca_analysis.py +81 -0
- specops_ai-0.2.0/examples/replay_async_eval.py +74 -0
- specops_ai-0.2.0/examples/replay_basic.py +59 -0
- specops_ai-0.2.0/examples/self_healing_advanced.py +72 -0
- specops_ai-0.2.0/examples/self_healing_basic.py +58 -0
- specops_ai-0.2.0/examples/simulation_cascade.py +66 -0
- specops_ai-0.2.0/examples/simulation_loops.py +65 -0
- specops_ai-0.2.0/pyproject.toml +74 -0
- specops_ai-0.2.0/src/specops_ai/__init__.py +124 -0
- specops_ai-0.2.0/src/specops_ai/_constants.py +33 -0
- specops_ai-0.2.0/src/specops_ai/_context.py +21 -0
- specops_ai-0.2.0/src/specops_ai/adapters/__init__.py +102 -0
- specops_ai-0.2.0/src/specops_ai/adapters/autogen.py +57 -0
- specops_ai-0.2.0/src/specops_ai/adapters/crewai.py +80 -0
- specops_ai-0.2.0/src/specops_ai/adapters/langgraph.py +88 -0
- specops_ai-0.2.0/src/specops_ai/config.py +76 -0
- specops_ai-0.2.0/src/specops_ai/coordinate.py +239 -0
- specops_ai-0.2.0/src/specops_ai/eval.py +237 -0
- specops_ai-0.2.0/src/specops_ai/heal.py +447 -0
- specops_ai-0.2.0/src/specops_ai/rca.py +202 -0
- specops_ai-0.2.0/src/specops_ai/replay.py +286 -0
- specops_ai-0.2.0/src/specops_ai/simulate.py +369 -0
- specops_ai-0.2.0/src/specops_ai/trace.py +219 -0
- specops_ai-0.2.0/src/specops_ai/viz.py +70 -0
- specops_ai-0.2.0/tests/test_adapters.py +221 -0
- specops_ai-0.2.0/tests/test_examples.py +62 -0
- specops_ai-0.2.0/tests/test_heal_rca.py +341 -0
- specops_ai-0.2.0/tests/test_replay_eval.py +330 -0
- specops_ai-0.2.0/tests/test_simulate_coordinate.py +290 -0
- specops_ai-0.2.0/tests/test_trace.py +270 -0
- specops_ai-0.2.0/uv.lock +5022 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: astral-sh/setup-uv@v4
|
|
15
|
+
- run: uv sync
|
|
16
|
+
- run: uv run ruff check src/ tests/ examples/
|
|
17
|
+
- run: uv run ruff format --check src/ tests/ examples/
|
|
18
|
+
|
|
19
|
+
typecheck:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
- uses: astral-sh/setup-uv@v4
|
|
24
|
+
- run: uv sync
|
|
25
|
+
- run: uv run mypy src/
|
|
26
|
+
|
|
27
|
+
test:
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
strategy:
|
|
30
|
+
matrix:
|
|
31
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
- uses: astral-sh/setup-uv@v4
|
|
35
|
+
- run: uv python install ${{ matrix.python-version }}
|
|
36
|
+
- run: uv sync --python ${{ matrix.python-version }}
|
|
37
|
+
- run: uv run pytest --cov=src/specops_ai --cov-report=term-missing --cov-report=xml
|
|
38
|
+
- name: Upload coverage
|
|
39
|
+
if: matrix.python-version == '3.12'
|
|
40
|
+
uses: actions/upload-artifact@v4
|
|
41
|
+
with:
|
|
42
|
+
name: coverage-report
|
|
43
|
+
path: coverage.xml
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
id-token: write # For trusted publishing to PyPI
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
- uses: astral-sh/setup-uv@v4
|
|
15
|
+
- run: uv sync
|
|
16
|
+
- run: uv run pytest
|
|
17
|
+
- run: uv build
|
|
18
|
+
- name: Publish to PyPI
|
|
19
|
+
run: uv publish
|
|
20
|
+
env:
|
|
21
|
+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"session_id": "async-demo",
|
|
3
|
+
"seed": 123,
|
|
4
|
+
"recorded_at": "2026-05-08T10:00:12.936257+00:00",
|
|
5
|
+
"calls": [
|
|
6
|
+
{
|
|
7
|
+
"func_name": "async_llm_call",
|
|
8
|
+
"args_hash": "d48b44f006b90439",
|
|
9
|
+
"result": "The result is 1",
|
|
10
|
+
"timestamp": "2026-05-08T10:00:12.948413+00:00",
|
|
11
|
+
"call_index": 0
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"func_name": "async_llm_call",
|
|
15
|
+
"args_hash": "e4a14bfacad6c780",
|
|
16
|
+
"result": "The result is 3",
|
|
17
|
+
"timestamp": "2026-05-08T10:00:12.959633+00:00",
|
|
18
|
+
"call_index": 1
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"session_id": "demo-session",
|
|
3
|
+
"seed": 42,
|
|
4
|
+
"recorded_at": "2026-05-08T10:00:11.587987+00:00",
|
|
5
|
+
"calls": [
|
|
6
|
+
{
|
|
7
|
+
"func_name": "search",
|
|
8
|
+
"args_hash": "62d3caec26bba24c",
|
|
9
|
+
"result": [
|
|
10
|
+
"result_95",
|
|
11
|
+
"result_14",
|
|
12
|
+
"result_87"
|
|
13
|
+
],
|
|
14
|
+
"timestamp": "2026-05-08T10:00:11.589353+00:00",
|
|
15
|
+
"call_index": 0
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"func_name": "call_llm",
|
|
19
|
+
"args_hash": "4e06c0d3d19cecb7",
|
|
20
|
+
"result": "France's capital city is Paris.",
|
|
21
|
+
"timestamp": "2026-05-08T10:00:11.589450+00:00",
|
|
22
|
+
"call_index": 1
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Contributing to SpecOps
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in SpecOps! We use **spec-driven development** — every feature begins as a written specification before any code is written.
|
|
4
|
+
|
|
5
|
+
## Development Workflow
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
1. Idea / Issue
|
|
9
|
+
2. Write Spec (requirements → design → tasks)
|
|
10
|
+
3. Review Spec (PR against docs/specs/)
|
|
11
|
+
4. Implement (code follows the approved spec)
|
|
12
|
+
5. Review Code (PR against src/)
|
|
13
|
+
6. Ship
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Why Spec-First?
|
|
17
|
+
|
|
18
|
+
- Forces clear thinking before coding
|
|
19
|
+
- Creates shared understanding across contributors
|
|
20
|
+
- Produces documentation as a side effect
|
|
21
|
+
- Makes code review faster (reviewers already know the intent)
|
|
22
|
+
- Enables AI agents to assist with implementation
|
|
23
|
+
|
|
24
|
+
## How to Contribute
|
|
25
|
+
|
|
26
|
+
### 1. Pick or Propose Work
|
|
27
|
+
|
|
28
|
+
- Check [open issues](https://github.com/kripikroli/specops-ai/issues) for `good-first-issue` or `help-wanted`
|
|
29
|
+
- Or open a new issue describing what you'd like to build
|
|
30
|
+
|
|
31
|
+
### 2. Write a Spec
|
|
32
|
+
|
|
33
|
+
Create a branch and add your spec to `docs/specs/`:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
docs/specs/
|
|
37
|
+
├── requirements.md # What the system must do
|
|
38
|
+
├── design.md # How it will work (architecture)
|
|
39
|
+
└── tasks.md # Ordered implementation steps
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Spec templates:**
|
|
43
|
+
|
|
44
|
+
<details>
|
|
45
|
+
<summary>Requirements Template</summary>
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
## Feature: [Name]
|
|
49
|
+
|
|
50
|
+
### Problem
|
|
51
|
+
What problem does this solve?
|
|
52
|
+
|
|
53
|
+
### Requirements
|
|
54
|
+
- FR-1: The system shall...
|
|
55
|
+
- FR-2: The system shall...
|
|
56
|
+
|
|
57
|
+
### Non-Requirements
|
|
58
|
+
- What is explicitly out of scope
|
|
59
|
+
|
|
60
|
+
### Success Criteria
|
|
61
|
+
- How do we know this is done?
|
|
62
|
+
```
|
|
63
|
+
</details>
|
|
64
|
+
|
|
65
|
+
<details>
|
|
66
|
+
<summary>Design Template</summary>
|
|
67
|
+
|
|
68
|
+
```markdown
|
|
69
|
+
## Design: [Feature Name]
|
|
70
|
+
|
|
71
|
+
### Approach
|
|
72
|
+
High-level description of the solution.
|
|
73
|
+
|
|
74
|
+
### API
|
|
75
|
+
Public interface (functions, classes, decorators).
|
|
76
|
+
|
|
77
|
+
### Internal Architecture
|
|
78
|
+
How components interact.
|
|
79
|
+
|
|
80
|
+
### Trade-offs
|
|
81
|
+
What alternatives were considered and why this approach was chosen.
|
|
82
|
+
```
|
|
83
|
+
</details>
|
|
84
|
+
|
|
85
|
+
<details>
|
|
86
|
+
<summary>Tasks Template</summary>
|
|
87
|
+
|
|
88
|
+
```markdown
|
|
89
|
+
## Tasks: [Feature Name]
|
|
90
|
+
|
|
91
|
+
### Prerequisites
|
|
92
|
+
- What must exist before starting
|
|
93
|
+
|
|
94
|
+
### Implementation Steps
|
|
95
|
+
1. [ ] Step one — description
|
|
96
|
+
2. [ ] Step two — description
|
|
97
|
+
|
|
98
|
+
### Verification
|
|
99
|
+
- How to confirm each step works
|
|
100
|
+
```
|
|
101
|
+
</details>
|
|
102
|
+
|
|
103
|
+
### 3. Submit Spec PR
|
|
104
|
+
|
|
105
|
+
Open a PR with your spec files. Label it `spec`. The team reviews the spec before implementation begins.
|
|
106
|
+
|
|
107
|
+
### 4. Implement
|
|
108
|
+
|
|
109
|
+
Once the spec is approved:
|
|
110
|
+
|
|
111
|
+
1. Create a feature branch from `main`
|
|
112
|
+
2. Follow the tasks in your spec
|
|
113
|
+
3. Write tests alongside implementation
|
|
114
|
+
4. Open a PR referencing the spec
|
|
115
|
+
|
|
116
|
+
## Development Setup
|
|
117
|
+
|
|
118
|
+
We use [**uv**](https://docs.astral.sh/uv/) as our package manager. See [DEVELOPMENT.md](DEVELOPMENT.md) for full details.
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# Clone
|
|
122
|
+
git clone https://github.com/kripikroli/specops-ai.git
|
|
123
|
+
cd specops-ai
|
|
124
|
+
|
|
125
|
+
# Install uv (if not already installed)
|
|
126
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
127
|
+
|
|
128
|
+
# Install all dependencies (creates .venv automatically)
|
|
129
|
+
uv sync
|
|
130
|
+
|
|
131
|
+
# Run tests
|
|
132
|
+
uv run pytest
|
|
133
|
+
|
|
134
|
+
# Lint
|
|
135
|
+
uv run ruff check src/ tests/
|
|
136
|
+
|
|
137
|
+
# Type check
|
|
138
|
+
uv run mypy src/
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Code Standards
|
|
142
|
+
|
|
143
|
+
- **Python 3.10+** minimum
|
|
144
|
+
- **Ruff** for linting and formatting
|
|
145
|
+
- **mypy** strict mode for type checking
|
|
146
|
+
- **pytest** for all tests
|
|
147
|
+
- Docstrings on all public APIs (Google style)
|
|
148
|
+
- 80%+ test coverage for new code
|
|
149
|
+
|
|
150
|
+
## CI Pipeline
|
|
151
|
+
|
|
152
|
+
All PRs run through GitHub Actions:
|
|
153
|
+
|
|
154
|
+
1. **Lint** — `ruff check` + `ruff format --check`
|
|
155
|
+
2. **Type check** — `mypy src/`
|
|
156
|
+
3. **Test** — `pytest` on Python 3.10, 3.11, 3.12 with coverage
|
|
157
|
+
|
|
158
|
+
PRs must pass all checks before merge. See `.github/workflows/ci.yml`.
|
|
159
|
+
|
|
160
|
+
## Commit Messages
|
|
161
|
+
|
|
162
|
+
Use conventional commits:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
feat: add @trace_agent decorator
|
|
166
|
+
fix: handle async context propagation
|
|
167
|
+
docs: update Phase 1 spec with token tracking
|
|
168
|
+
test: add integration tests for OTel export
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Code of Conduct
|
|
172
|
+
|
|
173
|
+
Be respectful, constructive, and collaborative. We're building tools to make agents reliable — let's be reliable to each other too.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Development Guide
|
|
2
|
+
|
|
3
|
+
SpecOps uses [**uv**](https://docs.astral.sh/uv/) as its package manager.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install uv
|
|
9
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Getting Started
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
git clone https://github.com/kripikroli/specops-ai.git
|
|
16
|
+
cd specops-ai
|
|
17
|
+
uv sync # Creates .venv, installs all deps + dev group
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Common Commands
|
|
21
|
+
|
|
22
|
+
| Task | Command |
|
|
23
|
+
|------|---------|
|
|
24
|
+
| Install all deps | `uv sync` |
|
|
25
|
+
| Add a runtime dependency | `uv add <package>` |
|
|
26
|
+
| Add a dev dependency | `uv add --dev <package>` |
|
|
27
|
+
| Remove a dependency | `uv remove <package>` |
|
|
28
|
+
| Run tests | `uv run pytest` |
|
|
29
|
+
| Run tests with coverage | `uv run pytest --cov=src/specops_ai` |
|
|
30
|
+
| Lint | `uv run ruff check src/ tests/` |
|
|
31
|
+
| Format | `uv run ruff format src/ tests/` |
|
|
32
|
+
| Type check | `uv run mypy src/` |
|
|
33
|
+
| Run any command in venv | `uv run <cmd>` |
|
|
34
|
+
| Run a CLI tool without installing | `uvx <tool>` |
|
|
35
|
+
| Build package | `uv build` |
|
|
36
|
+
| Publish to PyPI | `uv publish` |
|
|
37
|
+
| Update lockfile | `uv lock` |
|
|
38
|
+
| Upgrade a dependency | `uv lock --upgrade-package <pkg>` |
|
|
39
|
+
|
|
40
|
+
## Lockfile
|
|
41
|
+
|
|
42
|
+
`uv.lock` is committed to the repository. This ensures all contributors and CI get identical dependency versions.
|
|
43
|
+
|
|
44
|
+
After adding or removing dependencies, `uv.lock` updates automatically. Commit the updated lockfile with your change.
|
|
45
|
+
|
|
46
|
+
## Python Version
|
|
47
|
+
|
|
48
|
+
uv manages the Python version. The project requires Python 3.10+. To pin a specific version locally:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
uv python pin 3.12
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The `.python-version` file is gitignored — each developer can use their preferred minor version.
|
|
55
|
+
|
|
56
|
+
## CI
|
|
57
|
+
|
|
58
|
+
GitHub Actions runs on every push to `main` and on PRs:
|
|
59
|
+
|
|
60
|
+
| Job | What it does | Command |
|
|
61
|
+
|-----|-------------|---------|
|
|
62
|
+
| **lint** | Ruff check + format | `uv run ruff check src/ tests/ examples/` |
|
|
63
|
+
| **typecheck** | mypy strict | `uv run mypy src/` |
|
|
64
|
+
| **test** | pytest on 3.10/3.11/3.12 | `uv run pytest --cov=src/specops_ai` |
|
|
65
|
+
|
|
66
|
+
See `.github/workflows/ci.yml` for the full config.
|
|
67
|
+
|
|
68
|
+
### Release
|
|
69
|
+
|
|
70
|
+
Releases are triggered by pushing a version tag:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git tag v0.1.0
|
|
74
|
+
git push --tags
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
This runs tests, builds the wheel, and publishes to PyPI via `.github/workflows/release.yml`.
|
specops_ai-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 A-aron Paul Luminding
|
|
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.
|