specrig 0.1.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.
- specrig-0.1.0/.github/workflows/release.yml +44 -0
- specrig-0.1.0/.gitignore +8 -0
- specrig-0.1.0/LICENSE +21 -0
- specrig-0.1.0/Makefile +34 -0
- specrig-0.1.0/PKG-INFO +603 -0
- specrig-0.1.0/README.md +576 -0
- specrig-0.1.0/docs/design.md +163 -0
- specrig-0.1.0/pyproject.toml +68 -0
- specrig-0.1.0/samples/docs/billing.yaml +89 -0
- specrig-0.1.0/samples/reminders/AGENTS.md +10 -0
- specrig-0.1.0/samples/reminders/CLAUDE.md +1 -0
- specrig-0.1.0/samples/reminders/config/__init__.py +0 -0
- specrig-0.1.0/samples/reminders/config/settings.py +33 -0
- specrig-0.1.0/samples/reminders/config/urls.py +7 -0
- specrig-0.1.0/samples/reminders/config/wsgi.py +7 -0
- specrig-0.1.0/samples/reminders/manage.py +9 -0
- specrig-0.1.0/samples/reminders/pyproject.toml +13 -0
- specrig-0.1.0/samples/reminders/reminders/__init__.py +0 -0
- specrig-0.1.0/samples/reminders/reminders/billing.py +17 -0
- specrig-0.1.0/samples/reminders/reminders/jobs.py +25 -0
- specrig-0.1.0/samples/reminders/reminders/management/__init__.py +0 -0
- specrig-0.1.0/samples/reminders/reminders/management/commands/__init__.py +0 -0
- specrig-0.1.0/samples/reminders/reminders/management/commands/remind.py +10 -0
- specrig-0.1.0/samples/reminders/reminders/migrations/0001_initial.py +17 -0
- specrig-0.1.0/samples/reminders/reminders/migrations/__init__.py +0 -0
- specrig-0.1.0/samples/reminders/reminders/models.py +7 -0
- specrig-0.1.0/samples/reminders/reminders/views.py +20 -0
- specrig-0.1.0/samples/reminders/specrig.md +504 -0
- specrig-0.1.0/samples/reminders/specrig.yaml +4 -0
- specrig-0.1.0/samples/reminders/tests/checks.yaml +12 -0
- specrig-0.1.0/samples/reminders/tests/features/history.feature +17 -0
- specrig-0.1.0/samples/reminders/tests/features/reminders.feature +27 -0
- specrig-0.1.0/samples/reminders/tests/flows.yaml +48 -0
- specrig-0.1.0/samples/reminders/tests/internal/boot.feature +4 -0
- specrig-0.1.0/samples/reminders/tests/internal/harness.py +15 -0
- specrig-0.1.0/samples/reminders/tests/internal/test_cases.py +3 -0
- specrig-0.1.0/samples/reminders/tests/steps/history.py +44 -0
- specrig-0.1.0/samples/reminders/tests/steps/reminders.py +54 -0
- specrig-0.1.0/samples/reminders/tests/surface.yaml +12 -0
- specrig-0.1.0/samples/shop/AGENTS.md +10 -0
- specrig-0.1.0/samples/shop/CLAUDE.md +1 -0
- specrig-0.1.0/samples/shop/alembic.ini +24 -0
- specrig-0.1.0/samples/shop/migrations/env.py +15 -0
- specrig-0.1.0/samples/shop/migrations/versions/0001_orders.py +18 -0
- specrig-0.1.0/samples/shop/pyproject.toml +18 -0
- specrig-0.1.0/samples/shop/shop/__init__.py +0 -0
- specrig-0.1.0/samples/shop/shop/billing.py +20 -0
- specrig-0.1.0/samples/shop/shop/cli.py +21 -0
- specrig-0.1.0/samples/shop/shop/db.py +19 -0
- specrig-0.1.0/samples/shop/shop/jobs.py +15 -0
- specrig-0.1.0/samples/shop/shop/main.py +61 -0
- specrig-0.1.0/samples/shop/shop/settings.py +10 -0
- specrig-0.1.0/samples/shop/specrig.md +504 -0
- specrig-0.1.0/samples/shop/specrig.yaml +5 -0
- specrig-0.1.0/samples/shop/tests/checks.yaml +8 -0
- specrig-0.1.0/samples/shop/tests/features/orders.feature +23 -0
- specrig-0.1.0/samples/shop/tests/features/placing.feature +24 -0
- specrig-0.1.0/samples/shop/tests/flows.yaml +59 -0
- specrig-0.1.0/samples/shop/tests/internal/boot.feature +4 -0
- specrig-0.1.0/samples/shop/tests/internal/harness.py +12 -0
- specrig-0.1.0/samples/shop/tests/internal/test_cases.py +3 -0
- specrig-0.1.0/samples/shop/tests/steps/orders.py +51 -0
- specrig-0.1.0/samples/shop/tests/steps/placing.py +64 -0
- specrig-0.1.0/samples/shop/tests/surface.yaml +16 -0
- specrig-0.1.0/src/specrig/__init__.py +7 -0
- specrig-0.1.0/src/specrig/__main__.py +5 -0
- specrig-0.1.0/src/specrig/_yaml.py +117 -0
- specrig-0.1.0/src/specrig/asgi.py +120 -0
- specrig-0.1.0/src/specrig/backend.py +153 -0
- specrig-0.1.0/src/specrig/clock.py +41 -0
- specrig-0.1.0/src/specrig/code/__init__.py +31 -0
- specrig-0.1.0/src/specrig/code/calls.py +61 -0
- specrig-0.1.0/src/specrig/code/django.py +118 -0
- specrig-0.1.0/src/specrig/code/fastapi.py +129 -0
- specrig-0.1.0/src/specrig/code/index.py +477 -0
- specrig-0.1.0/src/specrig/code/settings.py +132 -0
- specrig-0.1.0/src/specrig/contract.py +106 -0
- specrig-0.1.0/src/specrig/django/__init__.py +188 -0
- specrig-0.1.0/src/specrig/docker.py +133 -0
- specrig-0.1.0/src/specrig/fastapi/__init__.py +244 -0
- specrig-0.1.0/src/specrig/flows.py +285 -0
- specrig-0.1.0/src/specrig/gate.py +95 -0
- specrig-0.1.0/src/specrig/http.py +168 -0
- specrig-0.1.0/src/specrig/postgres.py +278 -0
- specrig-0.1.0/src/specrig/protocol/agents/contributing.md +6 -0
- specrig-0.1.0/src/specrig/protocol/agents/header.md +5 -0
- specrig-0.1.0/src/specrig/protocol/agents/reference.md +1 -0
- specrig-0.1.0/src/specrig/protocol/agents/rule11.md +423 -0
- specrig-0.1.0/src/specrig/protocol/agents/short.md +19 -0
- specrig-0.1.0/src/specrig/protocol/modes.yaml +55 -0
- specrig-0.1.0/src/specrig/proxy.py +73 -0
- specrig-0.1.0/src/specrig/py.typed +0 -0
- specrig-0.1.0/src/specrig/records.py +48 -0
- specrig-0.1.0/src/specrig/redis.py +154 -0
- specrig-0.1.0/src/specrig/resource.py +49 -0
- specrig-0.1.0/src/specrig/rig.py +370 -0
- specrig-0.1.0/src/specrig/run.py +22 -0
- specrig-0.1.0/src/specrig/standins.py +112 -0
- specrig-0.1.0/src/specrig/suite.py +239 -0
- specrig-0.1.0/src/specrig/surface.py +87 -0
- specrig-0.1.0/src/specrig/tool/__init__.py +0 -0
- specrig-0.1.0/src/specrig/tool/agents.py +150 -0
- specrig-0.1.0/src/specrig/tool/cli.py +137 -0
- specrig-0.1.0/src/specrig/tool/init.py +244 -0
- specrig-0.1.0/src/specrig/tool/modes.py +54 -0
- specrig-0.1.0/src/specrig/tool/service.py +209 -0
- specrig-0.1.0/src/specrig/tool/templates.py +196 -0
- specrig-0.1.0/tests/fixtures/django/manage.py +8 -0
- specrig-0.1.0/tests/fixtures/django/pyproject.toml +4 -0
- specrig-0.1.0/tests/fixtures/django/stock/__init__.py +0 -0
- specrig-0.1.0/tests/fixtures/django/stock/api.py +9 -0
- specrig-0.1.0/tests/fixtures/django/stock/settings.py +14 -0
- specrig-0.1.0/tests/fixtures/django/stock/urls.py +8 -0
- specrig-0.1.0/tests/fixtures/django/stock/views.py +28 -0
- specrig-0.1.0/tests/fixtures/django/stock/warehouse.py +11 -0
- specrig-0.1.0/tests/fixtures/fastapi/.env.example +2 -0
- specrig-0.1.0/tests/fixtures/fastapi/gateway/__init__.py +0 -0
- specrig-0.1.0/tests/fixtures/fastapi/gateway/config.py +17 -0
- specrig-0.1.0/tests/fixtures/fastapi/gateway/crm.py +17 -0
- specrig-0.1.0/tests/fixtures/fastapi/gateway/main.py +18 -0
- specrig-0.1.0/tests/fixtures/fastapi/gateway/routes/__init__.py +0 -0
- specrig-0.1.0/tests/fixtures/fastapi/gateway/routes/orders.py +13 -0
- specrig-0.1.0/tests/fixtures/fastapi/gateway/sessions.py +14 -0
- specrig-0.1.0/tests/fixtures/fastapi/pyproject.toml +4 -0
- specrig-0.1.0/tests/fixtures/protocol/agents/verdicts.yaml +122 -0
- specrig-0.1.0/tests/fixtures/protocol/markers/areas.yaml +119 -0
- specrig-0.1.0/tests/fixtures/protocol/records/reminders.flows.yaml +40 -0
- specrig-0.1.0/tests/fixtures/protocol/records/reminders.trace.json +34 -0
- specrig-0.1.0/tests/fixtures/protocol/records/shop.flows.yaml +53 -0
- specrig-0.1.0/tests/fixtures/protocol/records/shop.trace.json +37 -0
- specrig-0.1.0/tests/test_agents.py +96 -0
- specrig-0.1.0/tests/test_backend.py +109 -0
- specrig-0.1.0/tests/test_flows.py +78 -0
- specrig-0.1.0/tests/test_format.py +28 -0
- specrig-0.1.0/tests/test_gate.py +17 -0
- specrig-0.1.0/tests/test_harness.py +466 -0
- specrig-0.1.0/tests/test_init.py +200 -0
- specrig-0.1.0/tests/test_rules.py +106 -0
- specrig-0.1.0/tests/test_surface.py +100 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags: ["v*"]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
timeout-minutes: 15
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v5
|
|
17
|
+
- uses: actions/setup-python@v6
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.13"
|
|
20
|
+
- run: make generate
|
|
21
|
+
- run: make lint
|
|
22
|
+
- run: make test
|
|
23
|
+
- name: the records are the code's
|
|
24
|
+
run: git diff --exit-code
|
|
25
|
+
|
|
26
|
+
publish:
|
|
27
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
28
|
+
needs: test
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
environment: pypi
|
|
31
|
+
permissions:
|
|
32
|
+
id-token: write
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v5
|
|
35
|
+
- uses: actions/setup-python@v6
|
|
36
|
+
with:
|
|
37
|
+
python-version: "3.13"
|
|
38
|
+
- name: the tag names the version
|
|
39
|
+
run: |
|
|
40
|
+
version=$(python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
|
|
41
|
+
test "v$version" = "$GITHUB_REF_NAME"
|
|
42
|
+
- run: python -m pip install build
|
|
43
|
+
- run: python -m build
|
|
44
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
specrig-0.1.0/.gitignore
ADDED
specrig-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Denis Daschenko
|
|
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.
|
specrig-0.1.0/Makefile
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
PROTOCOL ?= $(abspath $(CURDIR)/../protocol)
|
|
2
|
+
PYTHON ?= python3
|
|
3
|
+
VENV := $(CURDIR)/.venv
|
|
4
|
+
|
|
5
|
+
$(VENV):
|
|
6
|
+
$(PYTHON) -m venv $(VENV)
|
|
7
|
+
$(VENV)/bin/pip install -q --upgrade pip
|
|
8
|
+
|
|
9
|
+
install: $(VENV)
|
|
10
|
+
$(VENV)/bin/pip install -q -e ".[fastapi,django,postgres]" --group dev
|
|
11
|
+
|
|
12
|
+
generate: install
|
|
13
|
+
cd samples/shop && $(VENV)/bin/specrig surface && $(VENV)/bin/specrig agents
|
|
14
|
+
cd samples/reminders && $(VENV)/bin/specrig surface && $(VENV)/bin/specrig agents
|
|
15
|
+
|
|
16
|
+
test: install
|
|
17
|
+
$(VENV)/bin/pytest -q
|
|
18
|
+
cd samples/shop && $(VENV)/bin/pytest -q tests/internal
|
|
19
|
+
cd samples/reminders && $(VENV)/bin/pytest -q tests/internal
|
|
20
|
+
|
|
21
|
+
lint: install
|
|
22
|
+
$(VENV)/bin/ruff check src tests samples
|
|
23
|
+
$(VENV)/bin/ruff format --check src tests samples
|
|
24
|
+
|
|
25
|
+
protocol:
|
|
26
|
+
rm -rf src/specrig/protocol tests/fixtures/protocol
|
|
27
|
+
mkdir -p src/specrig/protocol/agents tests/fixtures/protocol/records tests/fixtures/protocol/agents tests/fixtures/protocol/markers
|
|
28
|
+
cp $(PROTOCOL)/modes.yaml src/specrig/protocol/
|
|
29
|
+
cp $(PROTOCOL)/agents/*.md src/specrig/protocol/agents/
|
|
30
|
+
cp $(PROTOCOL)/fixtures/records/* tests/fixtures/protocol/records/
|
|
31
|
+
cp $(PROTOCOL)/fixtures/agents/*.yaml tests/fixtures/protocol/agents/
|
|
32
|
+
cp $(PROTOCOL)/fixtures/markers/*.yaml tests/fixtures/protocol/markers/
|
|
33
|
+
|
|
34
|
+
.PHONY: install generate test lint protocol
|