aiogram-nav 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.
- aiogram_nav-0.1.0/.gitattributes +9 -0
- aiogram_nav-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +20 -0
- aiogram_nav-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +15 -0
- aiogram_nav-0.1.0/.github/pull_request_template.md +14 -0
- aiogram_nav-0.1.0/.github/workflows/ci.yml +149 -0
- aiogram_nav-0.1.0/.github/workflows/publish.yml +91 -0
- aiogram_nav-0.1.0/.gitignore +24 -0
- aiogram_nav-0.1.0/CHANGELOG.md +55 -0
- aiogram_nav-0.1.0/CHANGES/README.rst +11 -0
- aiogram_nav-0.1.0/CODE_OF_CONDUCT.md +138 -0
- aiogram_nav-0.1.0/CONTRIBUTING.md +59 -0
- aiogram_nav-0.1.0/LICENSE +22 -0
- aiogram_nav-0.1.0/PKG-INFO +123 -0
- aiogram_nav-0.1.0/README.md +97 -0
- aiogram_nav-0.1.0/SECURITY.md +25 -0
- aiogram_nav-0.1.0/docs/concepts.md +58 -0
- aiogram_nav-0.1.0/docs/idle-integration.md +55 -0
- aiogram_nav-0.1.0/docs/index.md +14 -0
- aiogram_nav-0.1.0/docs/memory-audit.md +68 -0
- aiogram_nav-0.1.0/docs/migration.md +46 -0
- aiogram_nav-0.1.0/docs/public-api.md +74 -0
- aiogram_nav-0.1.0/docs/quickstart.md +60 -0
- aiogram_nav-0.1.0/docs/redis-audit.md +50 -0
- aiogram_nav-0.1.0/docs/redis.md +100 -0
- aiogram_nav-0.1.0/docs/releasing.md +73 -0
- aiogram_nav-0.1.0/docs/security.md +42 -0
- aiogram_nav-0.1.0/docs/storage.md +51 -0
- aiogram_nav-0.1.0/docs/verification.md +154 -0
- aiogram_nav-0.1.0/examples/__init__.py +1 -0
- aiogram_nav-0.1.0/examples/commands_only/__init__.py +0 -0
- aiogram_nav-0.1.0/examples/commands_only/main.py +6 -0
- aiogram_nav-0.1.0/examples/demo.py +293 -0
- aiogram_nav-0.1.0/examples/hybrid/__init__.py +0 -0
- aiogram_nav-0.1.0/examples/hybrid/main.py +6 -0
- aiogram_nav-0.1.0/examples/inline_only/__init__.py +0 -0
- aiogram_nav-0.1.0/examples/inline_only/main.py +6 -0
- aiogram_nav-0.1.0/examples/redis_demo.py +79 -0
- aiogram_nav-0.1.0/examples/reply_only/__init__.py +0 -0
- aiogram_nav-0.1.0/examples/reply_only/main.py +6 -0
- aiogram_nav-0.1.0/mkdocs.yml +16 -0
- aiogram_nav-0.1.0/pyproject.toml +106 -0
- aiogram_nav-0.1.0/reports/README.md +50 -0
- aiogram_nav-0.1.0/reports/standardization.md +64 -0
- aiogram_nav-0.1.0/src/aiogram_nav/__init__.py +128 -0
- aiogram_nav-0.1.0/src/aiogram_nav/actions.py +374 -0
- aiogram_nav-0.1.0/src/aiogram_nav/clock.py +58 -0
- aiogram_nav-0.1.0/src/aiogram_nav/codec.py +217 -0
- aiogram_nav-0.1.0/src/aiogram_nav/config.py +50 -0
- aiogram_nav-0.1.0/src/aiogram_nav/context.py +147 -0
- aiogram_nav-0.1.0/src/aiogram_nav/effects.py +195 -0
- aiogram_nav-0.1.0/src/aiogram_nav/errors.py +80 -0
- aiogram_nav-0.1.0/src/aiogram_nav/events.py +17 -0
- aiogram_nav-0.1.0/src/aiogram_nav/identity.py +36 -0
- aiogram_nav-0.1.0/src/aiogram_nav/inputs/__init__.py +14 -0
- aiogram_nav-0.1.0/src/aiogram_nav/inputs/bindings.py +246 -0
- aiogram_nav-0.1.0/src/aiogram_nav/inputs/callbacks.py +19 -0
- aiogram_nav-0.1.0/src/aiogram_nav/inputs/commands.py +5 -0
- aiogram_nav-0.1.0/src/aiogram_nav/inputs/inline.py +6 -0
- aiogram_nav-0.1.0/src/aiogram_nav/inputs/reply.py +5 -0
- aiogram_nav-0.1.0/src/aiogram_nav/inputs/tokens.py +53 -0
- aiogram_nav-0.1.0/src/aiogram_nav/integration.py +465 -0
- aiogram_nav-0.1.0/src/aiogram_nav/isolation.py +150 -0
- aiogram_nav-0.1.0/src/aiogram_nav/json.py +90 -0
- aiogram_nav-0.1.0/src/aiogram_nav/models.py +386 -0
- aiogram_nav-0.1.0/src/aiogram_nav/navigation.py +326 -0
- aiogram_nav-0.1.0/src/aiogram_nav/protocols.py +24 -0
- aiogram_nav-0.1.0/src/aiogram_nav/py.typed +0 -0
- aiogram_nav-0.1.0/src/aiogram_nav/recovery.py +27 -0
- aiogram_nav-0.1.0/src/aiogram_nav/registry.py +153 -0
- aiogram_nav-0.1.0/src/aiogram_nav/rendering/__init__.py +6 -0
- aiogram_nav-0.1.0/src/aiogram_nav/rendering/base.py +76 -0
- aiogram_nav-0.1.0/src/aiogram_nav/rendering/cleanup.py +39 -0
- aiogram_nav-0.1.0/src/aiogram_nav/rendering/delivery.py +152 -0
- aiogram_nav-0.1.0/src/aiogram_nav/rendering/text.py +125 -0
- aiogram_nav-0.1.0/src/aiogram_nav/storage/__init__.py +6 -0
- aiogram_nav-0.1.0/src/aiogram_nav/storage/base.py +72 -0
- aiogram_nav-0.1.0/src/aiogram_nav/storage/memory.py +485 -0
- aiogram_nav-0.1.0/src/aiogram_nav/storage/redis.py +197 -0
- aiogram_nav-0.1.0/src/aiogram_nav/storage/redis_codec.py +222 -0
- aiogram_nav-0.1.0/src/aiogram_nav/storage/redis_coordinator.py +310 -0
- aiogram_nav-0.1.0/src/aiogram_nav/storage/redis_scripts.py +65 -0
- aiogram_nav-0.1.0/src/aiogram_nav/storage/redis_store.py +247 -0
- aiogram_nav-0.1.0/src/aiogram_nav/storage/redis_transport.py +194 -0
- aiogram_nav-0.1.0/src/aiogram_nav/storage/state.py +86 -0
- aiogram_nav-0.1.0/src/aiogram_nav/storage/tokens.py +176 -0
- aiogram_nav-0.1.0/src/aiogram_nav/version.py +10 -0
- aiogram_nav-0.1.0/tests/__init__.py +0 -0
- aiogram_nav-0.1.0/tests/conftest.py +36 -0
- aiogram_nav-0.1.0/tests/test_binding_dispatcher.py +269 -0
- aiogram_nav-0.1.0/tests/test_bindings.py +284 -0
- aiogram_nav-0.1.0/tests/test_contract_audit.py +67 -0
- aiogram_nav-0.1.0/tests/test_contracts.py +274 -0
- aiogram_nav-0.1.0/tests/test_dispatcher.py +210 -0
- aiogram_nav-0.1.0/tests/test_examples.py +179 -0
- aiogram_nav-0.1.0/tests/test_fsm_builder.py +53 -0
- aiogram_nav-0.1.0/tests/test_nav_recovery.py +259 -0
- aiogram_nav-0.1.0/tests/test_navigation.py +305 -0
- aiogram_nav-0.1.0/tests/test_packaging.py +26 -0
- aiogram_nav-0.1.0/tests/test_presentation.py +418 -0
- aiogram_nav-0.1.0/tests/test_redis_audit.py +124 -0
- aiogram_nav-0.1.0/tests/test_redis_backend.py +195 -0
- aiogram_nav-0.1.0/tests/test_redis_coordinator.py +238 -0
- aiogram_nav-0.1.0/tests/test_redis_dispatcher.py +131 -0
- aiogram_nav-0.1.0/tests/test_redis_fsm.py +145 -0
- aiogram_nav-0.1.0/tests/test_redis_operations.py +107 -0
- aiogram_nav-0.1.0/tests/test_redis_recovery.py +252 -0
- aiogram_nav-0.1.0/tests/test_redis_review_controls.py +255 -0
- aiogram_nav-0.1.0/tests/test_redis_review_fsm.py +191 -0
- aiogram_nav-0.1.0/tests/test_redis_review_storage.py +134 -0
- aiogram_nav-0.1.0/tests/test_redis_review_transport.py +49 -0
- aiogram_nav-0.1.0/tests/test_registry.py +104 -0
- aiogram_nav-0.1.0/tests/test_review_integration.py +217 -0
- aiogram_nav-0.1.0/tests/test_review_presentation.py +113 -0
- aiogram_nav-0.1.0/tests/test_review_recovery.py +236 -0
- aiogram_nav-0.1.0/tests/test_review_storage.py +161 -0
- aiogram_nav-0.1.0/tests/test_storage.py +418 -0
- aiogram_nav-0.1.0/tests/test_storage_audit.py +235 -0
- aiogram_nav-0.1.0/tools/README.md +24 -0
- aiogram_nav-0.1.0/tools/check_install.py +40 -0
- aiogram_nav-0.1.0/tools/check_version.py +33 -0
- aiogram_nav-0.1.0/uv.lock +3446 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report a reproducible navigation or recovery problem.
|
|
3
|
+
body:
|
|
4
|
+
- type: markdown
|
|
5
|
+
attributes:
|
|
6
|
+
value: For sensitive vulnerabilities, follow SECURITY.md. Remove tokens, credentials and private message text.
|
|
7
|
+
- type: textarea
|
|
8
|
+
id: environment
|
|
9
|
+
attributes:
|
|
10
|
+
label: Environment
|
|
11
|
+
description: Python, aiogram-nav, aiogram and optional redis-py versions; memory or Redis backend; FSM isolation configuration.
|
|
12
|
+
validations:
|
|
13
|
+
required: true
|
|
14
|
+
- type: textarea
|
|
15
|
+
id: reproduction
|
|
16
|
+
attributes:
|
|
17
|
+
label: Minimal reproduction
|
|
18
|
+
description: Include expected versus actual behavior and sanitized traceback. For recovery issues, state which effect stages are confirmed or unknown.
|
|
19
|
+
validations:
|
|
20
|
+
required: true
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Describe a navigation use case or API improvement.
|
|
3
|
+
body:
|
|
4
|
+
- type: textarea
|
|
5
|
+
id: use_case
|
|
6
|
+
attributes:
|
|
7
|
+
label: Use case
|
|
8
|
+
description: What behavior does your application need? Include alternatives already considered.
|
|
9
|
+
validations:
|
|
10
|
+
required: true
|
|
11
|
+
- type: textarea
|
|
12
|
+
id: proposal
|
|
13
|
+
attributes:
|
|
14
|
+
label: Proposed behavior
|
|
15
|
+
description: Describe API, backend, recovery and compatibility implications where relevant.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## Change
|
|
2
|
+
|
|
3
|
+
Describe the problem and resulting behavior.
|
|
4
|
+
|
|
5
|
+
## Verification
|
|
6
|
+
|
|
7
|
+
List checks actually run and remaining limitations. Mention real-Redis coverage for
|
|
8
|
+
storage, concurrency or recovery changes.
|
|
9
|
+
|
|
10
|
+
## Compatibility
|
|
11
|
+
|
|
12
|
+
Describe any public API, persisted-schema, callback ownership or FSM impact.
|
|
13
|
+
Include a `CHANGES/` fragment for user-visible changes. Keep aiogram-idle and Redis
|
|
14
|
+
optional, and do not include credentials or generated security reports.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
permissions:
|
|
4
|
+
contents: read
|
|
5
|
+
concurrency:
|
|
6
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
7
|
+
cancel-in-progress: true
|
|
8
|
+
jobs:
|
|
9
|
+
quality:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: astral-sh/setup-uv@v6
|
|
14
|
+
- run: uv sync --frozen --extra redis --python 3.12
|
|
15
|
+
- run: uv run --no-sync ruff check .
|
|
16
|
+
- run: uv run --no-sync ruff format --check .
|
|
17
|
+
- run: uv run --no-sync pyright src examples
|
|
18
|
+
- run: uv run --no-sync python tools/check_version.py
|
|
19
|
+
- run: uv run --no-sync towncrier build --draft
|
|
20
|
+
- run: uv run --no-sync pytest
|
|
21
|
+
- run: uv run --no-sync mkdocs build --strict
|
|
22
|
+
- run: uv build
|
|
23
|
+
- run: uv run --no-sync twine check dist/*
|
|
24
|
+
- name: Independently install wheel and sdist without optional dependencies
|
|
25
|
+
shell: bash
|
|
26
|
+
run: |
|
|
27
|
+
for artifact in dist/*.whl dist/*.tar.gz; do
|
|
28
|
+
target=$(mktemp -d)
|
|
29
|
+
uv venv --python 3.12 "$target/env"
|
|
30
|
+
uv pip install --python "$target/env/bin/python" "$artifact" pytest pytest-asyncio hypothesis
|
|
31
|
+
cp -R tests examples tools "$target/"
|
|
32
|
+
cp pyproject.toml "$target/"
|
|
33
|
+
cd "$target"
|
|
34
|
+
"$target/env/bin/python" tools/check_install.py
|
|
35
|
+
"$target/env/bin/python" tools/check_version.py
|
|
36
|
+
"$target/env/bin/python" -m pytest -q
|
|
37
|
+
cd "$GITHUB_WORKSPACE"
|
|
38
|
+
done
|
|
39
|
+
- uses: actions/upload-artifact@v4
|
|
40
|
+
with:
|
|
41
|
+
name: distributions
|
|
42
|
+
path: dist/*
|
|
43
|
+
if-no-files-found: error
|
|
44
|
+
compatibility:
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
strategy:
|
|
47
|
+
fail-fast: false
|
|
48
|
+
matrix:
|
|
49
|
+
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
|
|
50
|
+
aiogram: [minimum, latest]
|
|
51
|
+
exclude:
|
|
52
|
+
# aiogram 3.22 pins dependencies released before Python 3.14 support.
|
|
53
|
+
- python: '3.14'
|
|
54
|
+
aiogram: minimum
|
|
55
|
+
steps:
|
|
56
|
+
- uses: actions/checkout@v4
|
|
57
|
+
- uses: astral-sh/setup-uv@v6
|
|
58
|
+
- run: uv sync --frozen --python '${{ matrix.python }}'
|
|
59
|
+
- shell: bash
|
|
60
|
+
run: |
|
|
61
|
+
if [ '${{ matrix.aiogram }}' = minimum ]; then
|
|
62
|
+
uv pip install 'aiogram==3.22.0'
|
|
63
|
+
else
|
|
64
|
+
uv pip install --upgrade 'aiogram>=3.22,<4'
|
|
65
|
+
fi
|
|
66
|
+
- run: uv run --no-sync pytest
|
|
67
|
+
- run: uv run --no-sync python examples/demo.py --help
|
|
68
|
+
redis:
|
|
69
|
+
runs-on: ubuntu-latest
|
|
70
|
+
strategy:
|
|
71
|
+
fail-fast: false
|
|
72
|
+
matrix:
|
|
73
|
+
python: ['3.10', '3.12', '3.14']
|
|
74
|
+
redis-client: [minimum, latest]
|
|
75
|
+
services:
|
|
76
|
+
redis:
|
|
77
|
+
image: redis:7-alpine
|
|
78
|
+
ports: ['6379:6379']
|
|
79
|
+
options: --health-cmd "redis-cli ping" --health-interval 5s --health-timeout 3s --health-retries 10
|
|
80
|
+
env:
|
|
81
|
+
AIOGRAM_NAV_REDIS_URL: redis://localhost:6379/0
|
|
82
|
+
AIOGRAM_NAV_REQUIRE_REDIS: '1'
|
|
83
|
+
steps:
|
|
84
|
+
- uses: actions/checkout@v4
|
|
85
|
+
- uses: astral-sh/setup-uv@v6
|
|
86
|
+
- run: uv sync --frozen --extra redis --python '${{ matrix.python }}'
|
|
87
|
+
- if: matrix.redis-client == 'minimum'
|
|
88
|
+
run: uv pip install 'redis==5.0.8'
|
|
89
|
+
- run: uv run --no-sync pytest --cov=aiogram_nav --cov-report=term-missing --cov-report=xml --cov-fail-under=80
|
|
90
|
+
- name: Verify Redis-enabled installed artifacts against the real server
|
|
91
|
+
if: matrix.python == '3.12' && matrix.redis-client == 'latest'
|
|
92
|
+
shell: bash
|
|
93
|
+
run: |
|
|
94
|
+
uv build
|
|
95
|
+
for artifact in dist/*.whl dist/*.tar.gz; do
|
|
96
|
+
target=$(mktemp -d)
|
|
97
|
+
uv venv --python 3.12 "$target/env"
|
|
98
|
+
uv pip install --python "$target/env/bin/python" "${artifact}[redis]" pytest pytest-asyncio hypothesis
|
|
99
|
+
cp -R tests examples tools "$target/"
|
|
100
|
+
cp pyproject.toml "$target/"
|
|
101
|
+
cd "$target"
|
|
102
|
+
"$target/env/bin/python" tools/check_install.py --redis
|
|
103
|
+
"$target/env/bin/python" -m pytest -q
|
|
104
|
+
cd "$GITHUB_WORKSPACE"
|
|
105
|
+
done
|
|
106
|
+
- if: always()
|
|
107
|
+
uses: actions/upload-artifact@v4
|
|
108
|
+
with:
|
|
109
|
+
name: redis-coverage-${{ matrix.python }}-${{ matrix.redis-client }}
|
|
110
|
+
path: coverage.xml
|
|
111
|
+
if-no-files-found: warn
|
|
112
|
+
security:
|
|
113
|
+
runs-on: ubuntu-latest
|
|
114
|
+
steps:
|
|
115
|
+
- uses: actions/checkout@v4
|
|
116
|
+
- uses: astral-sh/setup-uv@v6
|
|
117
|
+
- run: uv sync --frozen --extra redis --python 3.12
|
|
118
|
+
# Keep the full low-severity inventory; the following invocation owns the gate.
|
|
119
|
+
- run: uv run --no-sync bandit -r src -f json -o bandit-report.json --exit-zero
|
|
120
|
+
- run: uv run --no-sync bandit -r src -ll
|
|
121
|
+
- name: Audit the resolved environment
|
|
122
|
+
if: always()
|
|
123
|
+
run: uv run --no-sync pip-audit --format=json --output=pip-audit-report.json
|
|
124
|
+
- if: always()
|
|
125
|
+
uses: actions/upload-artifact@v4
|
|
126
|
+
with:
|
|
127
|
+
name: security-reports
|
|
128
|
+
path: |
|
|
129
|
+
bandit-report.json
|
|
130
|
+
pip-audit-report.json
|
|
131
|
+
if-no-files-found: warn
|
|
132
|
+
checks:
|
|
133
|
+
name: Required checks
|
|
134
|
+
if: always()
|
|
135
|
+
needs: [quality, compatibility, redis, security]
|
|
136
|
+
runs-on: ubuntu-latest
|
|
137
|
+
steps:
|
|
138
|
+
- name: Require successful jobs
|
|
139
|
+
env:
|
|
140
|
+
RESULTS: ${{ toJSON(needs) }}
|
|
141
|
+
run: |
|
|
142
|
+
python - <<'PY'
|
|
143
|
+
import json
|
|
144
|
+
import os
|
|
145
|
+
results = json.loads(os.environ["RESULTS"])
|
|
146
|
+
failed = [name for name, job in results.items() if job["result"] != "success"]
|
|
147
|
+
if failed:
|
|
148
|
+
raise SystemExit("Required jobs did not pass: " + ", ".join(failed))
|
|
149
|
+
PY
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: Publish verified release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
manifest_sha256:
|
|
7
|
+
description: SHA256 of the independently verified GitHub release SHA256SUMS
|
|
8
|
+
required: true
|
|
9
|
+
type: string
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: publish-${{ github.ref }}
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
verify:
|
|
20
|
+
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
timeout-minutes: 10
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v6
|
|
25
|
+
with:
|
|
26
|
+
persist-credentials: false
|
|
27
|
+
- uses: astral-sh/setup-uv@v7
|
|
28
|
+
with:
|
|
29
|
+
python-version: '3.12'
|
|
30
|
+
- name: Download the exact reviewed release artifacts
|
|
31
|
+
env:
|
|
32
|
+
GH_TOKEN: ${{ github.token }}
|
|
33
|
+
run: gh release download "$GITHUB_REF_NAME" --pattern '*.whl' --pattern '*.tar.gz' --pattern SHA256SUMS --dir dist
|
|
34
|
+
- name: Validate tag, distribution names and independently supplied checksums
|
|
35
|
+
env:
|
|
36
|
+
MANIFEST_SHA256: ${{ inputs.manifest_sha256 }}
|
|
37
|
+
run: |
|
|
38
|
+
python - <<'PYVERIFY'
|
|
39
|
+
import hashlib
|
|
40
|
+
import os
|
|
41
|
+
import re
|
|
42
|
+
import tomllib
|
|
43
|
+
from pathlib import Path
|
|
44
|
+
project = tomllib.loads(Path('pyproject.toml').read_text())['project']
|
|
45
|
+
version = project['version']
|
|
46
|
+
if os.environ['GITHUB_REF_NAME'] != 'v' + version:
|
|
47
|
+
raise SystemExit('Tag does not match project version')
|
|
48
|
+
expected_digest = os.environ['MANIFEST_SHA256']
|
|
49
|
+
if not re.fullmatch(r'[a-f0-9]{64}', expected_digest):
|
|
50
|
+
raise SystemExit('Expected an independently verified SHA256 digest')
|
|
51
|
+
manifest = Path('dist/SHA256SUMS')
|
|
52
|
+
if hashlib.sha256(manifest.read_bytes()).hexdigest() != expected_digest:
|
|
53
|
+
raise SystemExit('Release checksum manifest differs from reviewed input')
|
|
54
|
+
name = project['name'].replace('-', '_')
|
|
55
|
+
expected = {f'{name}-{version}-py3-none-any.whl', f'{name}-{version}.tar.gz'}
|
|
56
|
+
if {p.name for p in Path('dist').iterdir()} != expected | {'SHA256SUMS'}:
|
|
57
|
+
raise SystemExit('Unexpected release files')
|
|
58
|
+
checked = set()
|
|
59
|
+
for line in manifest.read_text().splitlines():
|
|
60
|
+
digest, filename = line.split()
|
|
61
|
+
if filename not in expected or filename in checked:
|
|
62
|
+
raise SystemExit('Unexpected or repeated checksum entry')
|
|
63
|
+
if hashlib.sha256((Path('dist') / filename).read_bytes()).hexdigest() != digest:
|
|
64
|
+
raise SystemExit('Distribution checksum mismatch')
|
|
65
|
+
checked.add(filename)
|
|
66
|
+
if checked != expected:
|
|
67
|
+
raise SystemExit('Missing distribution checksum')
|
|
68
|
+
PYVERIFY
|
|
69
|
+
- run: uvx twine check dist/*.whl dist/*.tar.gz
|
|
70
|
+
- uses: actions/upload-artifact@v6
|
|
71
|
+
with:
|
|
72
|
+
name: verified-distributions
|
|
73
|
+
path: |
|
|
74
|
+
dist/*.whl
|
|
75
|
+
dist/*.tar.gz
|
|
76
|
+
if-no-files-found: error
|
|
77
|
+
|
|
78
|
+
publish:
|
|
79
|
+
needs: verify
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
timeout-minutes: 10
|
|
82
|
+
environment: pypi
|
|
83
|
+
permissions:
|
|
84
|
+
id-token: write
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/download-artifact@v7
|
|
87
|
+
with:
|
|
88
|
+
name: verified-distributions
|
|
89
|
+
path: dist
|
|
90
|
+
- name: Publish verified distributions using PyPI Trusted Publishing
|
|
91
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.venv/
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
.pytest_cache/
|
|
5
|
+
.ruff_cache/
|
|
6
|
+
.coverage
|
|
7
|
+
.coverage.*
|
|
8
|
+
coverage.xml
|
|
9
|
+
coverage.json
|
|
10
|
+
htmlcov/
|
|
11
|
+
dist/
|
|
12
|
+
build/
|
|
13
|
+
site/
|
|
14
|
+
.env
|
|
15
|
+
.env.*
|
|
16
|
+
!.env.example
|
|
17
|
+
AGENTS.md
|
|
18
|
+
|
|
19
|
+
.hypothesis/
|
|
20
|
+
bandit-report.json
|
|
21
|
+
pip-audit-report.json
|
|
22
|
+
.mypy_cache/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.DS_Store
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
<!-- towncrier release notes start -->
|
|
4
|
+
|
|
5
|
+
## 0.1.0 (2026-11-10)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- Add independent navigation contracts, immutable registry and versioned JSON codec.
|
|
10
|
+
- Add single-process memory sessions, guarded actions, history and bounded operation/control evidence.
|
|
11
|
+
- Prepare rendering before effects and retain confirmed/unknown stages for explicit recovery.
|
|
12
|
+
- Add text presentation with reply, inline, command-only and hybrid navigation.
|
|
13
|
+
- Add scoped/localized input bindings and actor/session/view-bound opaque callbacks.
|
|
14
|
+
- Coordinate full dispatcher handlers and verified FSM isolation without owning business drafts.
|
|
15
|
+
- Include runnable examples, user guides, contract/failure tests and a compatibility CI matrix.
|
|
16
|
+
- Keep aiogram-idle integration optional and outside this package; the adapter is supplied by aiogram-idle.
|
|
17
|
+
|
|
18
|
+
### Memory recovery fixes
|
|
19
|
+
|
|
20
|
+
- Serialize stages across recorders/runtimes, preserve prior uncertainty and recheck authorization before new effects.
|
|
21
|
+
- Bind completion to confirmed message receipts and strictly validate partial delivery plans/results.
|
|
22
|
+
- Preserve forced fresh-send recovery semantics and actual installed-keyboard locale provenance.
|
|
23
|
+
- Verify unchanged FSM storage, context identity, key mapping, coordinator and router precedence.
|
|
24
|
+
- Handle identity-resolver opt-outs, strict actor identities and valid millisecond expiry timelines.
|
|
25
|
+
- Record the audit and additional regression coverage in docs/memory-audit.md.
|
|
26
|
+
|
|
27
|
+
### Redis backend
|
|
28
|
+
|
|
29
|
+
- Add optional standalone Redis repository, server-time CAS and renewable fenced conversation locks.
|
|
30
|
+
- Persist snapshots, partial-render receipts and atomic actor/session/view control consumption across processes.
|
|
31
|
+
- Enforce immutable storage profiles, history/index witnesses and strict persisted-state invariants.
|
|
32
|
+
- Retain uncertainty after connection loss, process death or Lua errors; suppress unsafe resends.
|
|
33
|
+
- Share full-handler Redis coordination with verified FSM isolation and a shared Redis FSM example.
|
|
34
|
+
- Add real-server parity, concurrency, process-crash, ownership and recovery tests.
|
|
35
|
+
|
|
36
|
+
### Redis recovery fixes
|
|
37
|
+
|
|
38
|
+
- Preserve partial/untracked keyboards when rejecting stale callbacks.
|
|
39
|
+
- Fence every built-in cleanup call and skip cleanup after reentrant navigation supersedes its view.
|
|
40
|
+
- Count revoked handlers until cleanup completes; reject unverified FSM-isolation subclasses.
|
|
41
|
+
- Validate sweep namespace history and serialize scan cursors.
|
|
42
|
+
- Reject contradictory receipts and cross-conversation render checkpoints.
|
|
43
|
+
- Distinguish true NOSCRIPT responses from ambiguous transport failures and use exact server-time conversion.
|
|
44
|
+
|
|
45
|
+
### Documentation
|
|
46
|
+
|
|
47
|
+
- Align contributor guidance, typed package metadata, changelog fragments and
|
|
48
|
+
repository verification tools with the related aiogram libraries.
|
|
49
|
+
|
|
50
|
+
### Miscellaneous
|
|
51
|
+
|
|
52
|
+
- Synchronize the post-commit Redis ownership-loss regression with the
|
|
53
|
+
observation
|
|
54
|
+
hook and protect its whole revocation sequence against cancellation, without
|
|
55
|
+
relying on a 20 ms I/O deadline or incidental lease expiry under CI load.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Changelog fragments
|
|
2
|
+
===================
|
|
3
|
+
|
|
4
|
+
Add a fragment for each user-facing change. Use an issue number or a leading
|
|
5
|
+
``+`` description when no issue exists: ``123.bugfix.rst`` or
|
|
6
|
+
``+repository-convention.doc.rst``. Supported types are ``feature``, ``bugfix``,
|
|
7
|
+
``doc``, ``removal`` and ``misc``. Describe the resulting behavior for users.
|
|
8
|
+
|
|
9
|
+
Preview without changing files with ``uv run --no-sync towncrier build --draft``.
|
|
10
|
+
Release maintainers build the changelog with an explicit version after reviewing
|
|
11
|
+
the draft; this removes consumed fragments. See ``docs/releasing.md``.
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
+
|
|
9
|
+
## Our Standards
|
|
10
|
+
|
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
+
|
|
13
|
+
* Using welcoming and inclusive language
|
|
14
|
+
* Being respectful of differing viewpoints and experiences
|
|
15
|
+
* Gracefully accepting constructive criticism
|
|
16
|
+
* Focusing on what is best for the community
|
|
17
|
+
* Showing empathy towards other community members
|
|
18
|
+
|
|
19
|
+
Examples of unacceptable behavior include:
|
|
20
|
+
|
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
22
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
23
|
+
* Public or private harassment
|
|
24
|
+
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
|
25
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
26
|
+
|
|
27
|
+
## Enforcement Responsibilities
|
|
28
|
+
|
|
29
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
+
|
|
31
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
32
|
+
|
|
33
|
+
## Scope
|
|
34
|
+
|
|
35
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
36
|
+
|
|
37
|
+
## Enforcement
|
|
38
|
+
|
|
39
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [arman.avanesyan@yahoo.com](mailto:arman.avanesyan@yahoo.com). Reports should include enough context for the maintainers to assess the incident.
|
|
40
|
+
|
|
41
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
42
|
+
|
|
43
|
+
## Enforcement Guidelines
|
|
44
|
+
|
|
45
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
46
|
+
|
|
47
|
+
### 1. Correction
|
|
48
|
+
|
|
49
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
50
|
+
|
|
51
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
52
|
+
|
|
53
|
+
### 2. Warning
|
|
54
|
+
|
|
55
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
56
|
+
|
|
57
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
58
|
+
|
|
59
|
+
### 3. Temporary Ban
|
|
60
|
+
|
|
61
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
62
|
+
|
|
63
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
64
|
+
|
|
65
|
+
### 4. Permanent Ban
|
|
66
|
+
|
|
67
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
68
|
+
|
|
69
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
70
|
+
|
|
71
|
+
## Reporting
|
|
72
|
+
|
|
73
|
+
If you experience or witness unacceptable behavior, or have any other concerns, please report it by contacting the project maintainers. All reports will be handled with discretion.
|
|
74
|
+
|
|
75
|
+
**Contact Information**:
|
|
76
|
+
- **Email**: arman.avanesyan@yahoo.com
|
|
77
|
+
|
|
78
|
+
When reporting, please include:
|
|
79
|
+
- Your contact information
|
|
80
|
+
- Names (real, nicknames, or pseudonyms) of any individuals involved
|
|
81
|
+
- Description of the incident
|
|
82
|
+
- Any additional context that may be helpful
|
|
83
|
+
|
|
84
|
+
## Handling reports
|
|
85
|
+
|
|
86
|
+
Maintainers assess reports and may use the enforcement guidelines above. Share
|
|
87
|
+
sensitive incident details by email, not public GitHub issues. This policy does
|
|
88
|
+
not promise a response deadline or a separate appeals team.
|
|
89
|
+
|
|
90
|
+
## Attribution
|
|
91
|
+
|
|
92
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
93
|
+
|
|
94
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
95
|
+
|
|
96
|
+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
|
97
|
+
|
|
98
|
+
[homepage]: https://www.contributor-covenant.org
|
|
99
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
100
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
101
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
102
|
+
[translations]: https://www.contributor-covenant.org/translations
|
|
103
|
+
|
|
104
|
+
## Project-Specific Guidelines
|
|
105
|
+
|
|
106
|
+
### For aiogram-nav
|
|
107
|
+
|
|
108
|
+
In addition to the general Code of Conduct, we have specific guidelines for our project:
|
|
109
|
+
|
|
110
|
+
#### Technical Discussions
|
|
111
|
+
|
|
112
|
+
- **Be constructive**: Focus on improving the code and documentation
|
|
113
|
+
- **Provide context**: Include relevant code examples and error messages
|
|
114
|
+
- **Be patient**: Remember that everyone is learning and contributing
|
|
115
|
+
|
|
116
|
+
#### Issue and Pull Request Guidelines
|
|
117
|
+
|
|
118
|
+
- **Use clear titles**: Make it easy to understand what the issue or PR is about
|
|
119
|
+
- **Provide details**: Include steps to reproduce, expected behavior, and actual behavior
|
|
120
|
+
- **Be responsive**: Respond to feedback and questions promptly
|
|
121
|
+
|
|
122
|
+
#### Code Review
|
|
123
|
+
|
|
124
|
+
- **Be respectful**: Focus on the code, not the person
|
|
125
|
+
- **Be specific**: Point out exact lines and suggest improvements
|
|
126
|
+
- **Be appreciative**: Acknowledge good work and improvements
|
|
127
|
+
|
|
128
|
+
#### Community Support
|
|
129
|
+
|
|
130
|
+
- **Help others**: Share your knowledge and experience
|
|
131
|
+
- **Be inclusive**: Welcome newcomers and help them get started
|
|
132
|
+
- **Be patient**: Everyone has different levels of experience
|
|
133
|
+
|
|
134
|
+
## Contact
|
|
135
|
+
|
|
136
|
+
For questions about this Code of Conduct or to report violations:
|
|
137
|
+
|
|
138
|
+
- **Email**: arman.avanesyan@yahoo.com
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Contributing to aiogram-nav
|
|
2
|
+
|
|
3
|
+
Use Python 3.10 or newer and uv. From a checkout:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
uv sync --frozen --extra redis --python 3.12
|
|
7
|
+
uv run --no-sync ruff check .
|
|
8
|
+
uv run --no-sync ruff format --check .
|
|
9
|
+
uv run --no-sync pyright src examples
|
|
10
|
+
uv run --no-sync pytest
|
|
11
|
+
uv run --no-sync mkdocs build --strict
|
|
12
|
+
uv run --no-sync python tools/check_version.py
|
|
13
|
+
uv build
|
|
14
|
+
uv run --no-sync twine check dist/*
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The ordinary suite works without a Redis server and explicitly skips server-only
|
|
18
|
+
cases. For the required Redis suite, start a disposable Redis 7 server and run:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
AIOGRAM_NAV_REDIS_URL=redis://localhost:6379/0 AIOGRAM_NAV_REQUIRE_REDIS=1 \
|
|
22
|
+
uv run --no-sync pytest --cov=aiogram_nav --cov-report=term-missing
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Tests use isolated prefixes; do not point development checks at production.
|
|
26
|
+
The required suite has an 80% combined line/branch coverage gate. Add regression
|
|
27
|
+
tests for changed behavior, including ownership and ambiguous-delivery cases.
|
|
28
|
+
The library does not configure logging; CLI examples enable safe debug output.
|
|
29
|
+
Never put bot tokens, Redis credentials or message content in reports or fixtures.
|
|
30
|
+
|
|
31
|
+
## Repository convention
|
|
32
|
+
|
|
33
|
+
- `src/aiogram_nav/`: typed runtime code, with `py.typed` shipped in artifacts.
|
|
34
|
+
- `tests/`: contracts, lifecycle, dispatcher, failure and backend tests.
|
|
35
|
+
- `examples/`: reply, inline, command-only, hybrid and Redis demonstrations.
|
|
36
|
+
- `docs/`: user guides, architecture, verification and release guidance.
|
|
37
|
+
- `CHANGES/`: Towncrier reStructuredText fragments; `CHANGELOG.md`: release history.
|
|
38
|
+
- `tools/`: repository automation; `reports/`: maintained verification evidence.
|
|
39
|
+
- `.github/`: CI, issue forms and pull request guidance.
|
|
40
|
+
|
|
41
|
+
Python 3.12 is the recommended development environment; Python 3.10 remains a
|
|
42
|
+
runtime and compatibility-test target. Run dependency security auditing on Python
|
|
43
|
+
3.11 or newer, as described in the report policy.
|
|
44
|
+
|
|
45
|
+
Generated coverage and security JSON belong in local ignored output or CI
|
|
46
|
+
artifacts. Follow [reports/README.md](reports/README.md) for security scans.
|
|
47
|
+
|
|
48
|
+
Add a fragment such as `CHANGES/+short-description.bugfix.rst` or an issue-numbered
|
|
49
|
+
fragment. Supported types are `feature`, `bugfix`, `doc`, `removal` and `misc`.
|
|
50
|
+
Preview with `uv run --no-sync towncrier build --draft`. Preserve standalone usage:
|
|
51
|
+
neither Redis nor aiogram-idle may become a mandatory dependency.
|
|
52
|
+
|
|
53
|
+
Describe the problem, resulting behavior and relevant validation in pull
|
|
54
|
+
requests. Use conventional commit subjects such as `fix(storage): preserve stale
|
|
55
|
+
receipt evidence`. Package publication is a separate maintainer action; see
|
|
56
|
+
[docs/releasing.md](docs/releasing.md).
|
|
57
|
+
|
|
58
|
+
Participation follows [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). Report
|
|
59
|
+
vulnerabilities privately as described in [SECURITY.md](SECURITY.md).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 aiogram-idle contributors
|
|
4
|
+
Copyright (c) 2026 aiogram-nav contributors
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|