agent-reliability 1.0.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.
- agent_reliability-1.0.0/.github/ISSUE_TEMPLATE/bug_report.yml +34 -0
- agent_reliability-1.0.0/.github/ISSUE_TEMPLATE/feature_request.yml +24 -0
- agent_reliability-1.0.0/.github/pull_request_template.md +36 -0
- agent_reliability-1.0.0/.github/workflows/ci.yml +84 -0
- agent_reliability-1.0.0/.github/workflows/release.yml +100 -0
- agent_reliability-1.0.0/.gitignore +24 -0
- agent_reliability-1.0.0/CHANGELOG.md +185 -0
- agent_reliability-1.0.0/CODE_OF_CONDUCT.md +38 -0
- agent_reliability-1.0.0/CONTRIBUTING.md +62 -0
- agent_reliability-1.0.0/LICENSE +201 -0
- agent_reliability-1.0.0/PKG-INFO +210 -0
- agent_reliability-1.0.0/README.md +176 -0
- agent_reliability-1.0.0/SECURITY.md +41 -0
- agent_reliability-1.0.0/benchmarks/bench_evaluation.py +83 -0
- agent_reliability-1.0.0/benchmarks/bench_otel.py +104 -0
- agent_reliability-1.0.0/benchmarks/bench_reliability.py +97 -0
- agent_reliability-1.0.0/benchmarks/bench_sdk.py +123 -0
- agent_reliability-1.0.0/docs/ARCHITECTURE.md +189 -0
- agent_reliability-1.0.0/docs/COMPATIBILITY.md +30 -0
- agent_reliability-1.0.0/docs/CONCEPTS.md +69 -0
- agent_reliability-1.0.0/docs/DOMAIN_MODEL.md +287 -0
- agent_reliability-1.0.0/docs/DX_REVIEW.md +146 -0
- agent_reliability-1.0.0/docs/ENGINEERING_PRINCIPLES.md +117 -0
- agent_reliability-1.0.0/docs/EVALUATION_PROVENANCE.md +90 -0
- agent_reliability-1.0.0/docs/EVALUATOR_FRAMEWORK.md +128 -0
- agent_reliability-1.0.0/docs/GA_CONTRACT.md +241 -0
- agent_reliability-1.0.0/docs/GA_READINESS.md +106 -0
- agent_reliability-1.0.0/docs/INTEGRATIONS.md +61 -0
- agent_reliability-1.0.0/docs/LOCAL_RELIABILITY_ENGINE.md +172 -0
- agent_reliability-1.0.0/docs/OTEL_MAPPING.md +168 -0
- agent_reliability-1.0.0/docs/PUBLIC_API_REVIEW.md +52 -0
- agent_reliability-1.0.0/docs/QUICKSTART.md +79 -0
- agent_reliability-1.0.0/docs/README.md +44 -0
- agent_reliability-1.0.0/docs/RELEASING.md +64 -0
- agent_reliability-1.0.0/docs/ROADMAP.md +111 -0
- agent_reliability-1.0.0/docs/SDK_DESIGN.md +475 -0
- agent_reliability-1.0.0/docs/SECURITY_MODEL.md +179 -0
- agent_reliability-1.0.0/docs/SLO_SEMANTICS.md +242 -0
- agent_reliability-1.0.0/docs/TELEMETRY_SPEC.md +99 -0
- agent_reliability-1.0.0/docs/TESTING_STRATEGY.md +204 -0
- agent_reliability-1.0.0/docs/VERSIONING.md +71 -0
- agent_reliability-1.0.0/docs/VISION.md +73 -0
- agent_reliability-1.0.0/docs/adr/0001-architecture-boundaries.md +118 -0
- agent_reliability-1.0.0/docs/adr/0002-reliability-mathematics-and-undefined-data-semantics.md +295 -0
- agent_reliability-1.0.0/docs/adr/0003-python-sdk-runtime-and-context-architecture.md +132 -0
- agent_reliability-1.0.0/docs/adr/0004-instrumentation-failure-isolation.md +197 -0
- agent_reliability-1.0.0/docs/adr/0005-instrumentation-initialization-degraded-mode.md +193 -0
- agent_reliability-1.0.0/docs/adr/0006-opentelemetry-interoperability-and-context-ownership.md +127 -0
- agent_reliability-1.0.0/docs/adr/0007-evaluator-architecture-and-provenance-semantics.md +112 -0
- agent_reliability-1.0.0/docs/adr/0008-reliability-aggregation-and-provenance-compatibility.md +116 -0
- agent_reliability-1.0.0/docs/adr/README.md +59 -0
- agent_reliability-1.0.0/examples/.gitkeep +0 -0
- agent_reliability-1.0.0/examples/async_agent.py +69 -0
- agent_reliability-1.0.0/examples/basic_reliability.py +81 -0
- agent_reliability-1.0.0/examples/opentelemetry_example.py +25 -0
- agent_reliability-1.0.0/examples/provenance_conflict.py +49 -0
- agent_reliability-1.0.0/pyproject.toml +109 -0
- agent_reliability-1.0.0/scripts/verify_release_artifacts.py +212 -0
- agent_reliability-1.0.0/src/agent_reliability/__init__.py +14 -0
- agent_reliability-1.0.0/src/agent_reliability/adapters/__init__.py +31 -0
- agent_reliability-1.0.0/src/agent_reliability/adapters/event_sinks.py +82 -0
- agent_reliability-1.0.0/src/agent_reliability/adapters/otel/__init__.py +13 -0
- agent_reliability-1.0.0/src/agent_reliability/adapters/otel/run_context.py +109 -0
- agent_reliability-1.0.0/src/agent_reliability/adapters/system_clock.py +14 -0
- agent_reliability-1.0.0/src/agent_reliability/adapters/uuid_run_id_generator.py +15 -0
- agent_reliability-1.0.0/src/agent_reliability/application/__init__.py +3 -0
- agent_reliability-1.0.0/src/agent_reliability/domain/__init__.py +66 -0
- agent_reliability-1.0.0/src/agent_reliability/domain/error_budget.py +153 -0
- agent_reliability-1.0.0/src/agent_reliability/domain/evaluation.py +36 -0
- agent_reliability-1.0.0/src/agent_reliability/domain/identity.py +43 -0
- agent_reliability-1.0.0/src/agent_reliability/domain/runs.py +111 -0
- agent_reliability-1.0.0/src/agent_reliability/domain/sli.py +221 -0
- agent_reliability-1.0.0/src/agent_reliability/domain/slo.py +152 -0
- agent_reliability-1.0.0/src/agent_reliability/evaluation/__init__.py +35 -0
- agent_reliability-1.0.0/src/agent_reliability/evaluation/_validation.py +48 -0
- agent_reliability-1.0.0/src/agent_reliability/evaluation/builtins.py +68 -0
- agent_reliability-1.0.0/src/agent_reliability/evaluation/identity.py +32 -0
- agent_reliability-1.0.0/src/agent_reliability/evaluation/protocols.py +46 -0
- agent_reliability-1.0.0/src/agent_reliability/evaluation/result.py +110 -0
- agent_reliability-1.0.0/src/agent_reliability/experimental/__init__.py +9 -0
- agent_reliability-1.0.0/src/agent_reliability/ports/__init__.py +43 -0
- agent_reliability-1.0.0/src/agent_reliability/ports/clock.py +26 -0
- agent_reliability-1.0.0/src/agent_reliability/ports/event_sink.py +36 -0
- agent_reliability-1.0.0/src/agent_reliability/ports/events.py +101 -0
- agent_reliability-1.0.0/src/agent_reliability/ports/id_generator.py +24 -0
- agent_reliability-1.0.0/src/agent_reliability/ports/run_context.py +28 -0
- agent_reliability-1.0.0/src/agent_reliability/py.typed +1 -0
- agent_reliability-1.0.0/src/agent_reliability/reliability/__init__.py +21 -0
- agent_reliability-1.0.0/src/agent_reliability/reliability/engine.py +156 -0
- agent_reliability-1.0.0/src/agent_reliability/reliability/model.py +191 -0
- agent_reliability-1.0.0/src/agent_reliability/sdk/__init__.py +57 -0
- agent_reliability-1.0.0/src/agent_reliability/sdk/client.py +476 -0
- agent_reliability-1.0.0/src/agent_reliability/sdk/context.py +151 -0
- agent_reliability-1.0.0/src/agent_reliability/sdk/diagnostics.py +85 -0
- agent_reliability-1.0.0/src/agent_reliability/sdk/evaluator_runner.py +165 -0
- agent_reliability-1.0.0/tests/compat/test_public_api_1_0.py +175 -0
- agent_reliability-1.0.0/tests/compat/test_semantic_1_0.py +154 -0
- agent_reliability-1.0.0/tests/contract/.gitkeep +0 -0
- agent_reliability-1.0.0/tests/contract/test_examples.py +73 -0
- agent_reliability-1.0.0/tests/contract/test_reliability_m1_contract.py +56 -0
- agent_reliability-1.0.0/tests/contract/test_run_context_bridge.py +218 -0
- agent_reliability-1.0.0/tests/fakes/__init__.py +4 -0
- agent_reliability-1.0.0/tests/fakes/clock.py +27 -0
- agent_reliability-1.0.0/tests/fakes/diagnostics.py +23 -0
- agent_reliability-1.0.0/tests/fakes/id_generator.py +23 -0
- agent_reliability-1.0.0/tests/fakes/sinks.py +38 -0
- agent_reliability-1.0.0/tests/integration/.gitkeep +0 -0
- agent_reliability-1.0.0/tests/integration/test_otel_trace_context.py +535 -0
- agent_reliability-1.0.0/tests/property/test_error_budget_properties.py +148 -0
- agent_reliability-1.0.0/tests/property/test_evaluator_properties.py +24 -0
- agent_reliability-1.0.0/tests/property/test_reliability_properties.py +139 -0
- agent_reliability-1.0.0/tests/property/test_sdk_properties.py +80 -0
- agent_reliability-1.0.0/tests/property/test_sli_properties.py +155 -0
- agent_reliability-1.0.0/tests/security/test_privacy_contract.py +37 -0
- agent_reliability-1.0.0/tests/typing/installed_consumer.py +41 -0
- agent_reliability-1.0.0/tests/typing/mypy.ini +5 -0
- agent_reliability-1.0.0/tests/unit/adapters/test_adapters.py +203 -0
- agent_reliability-1.0.0/tests/unit/domain/test_error_budget.py +151 -0
- agent_reliability-1.0.0/tests/unit/domain/test_evaluation.py +18 -0
- agent_reliability-1.0.0/tests/unit/domain/test_identity.py +43 -0
- agent_reliability-1.0.0/tests/unit/domain/test_runs.py +125 -0
- agent_reliability-1.0.0/tests/unit/domain/test_sli.py +227 -0
- agent_reliability-1.0.0/tests/unit/domain/test_slo.py +136 -0
- agent_reliability-1.0.0/tests/unit/evaluation/__init__.py +1 -0
- agent_reliability-1.0.0/tests/unit/evaluation/test_builtins_and_protocols.py +92 -0
- agent_reliability-1.0.0/tests/unit/evaluation/test_identity_and_result.py +156 -0
- agent_reliability-1.0.0/tests/unit/evaluation/test_runner.py +258 -0
- agent_reliability-1.0.0/tests/unit/ports/test_events.py +59 -0
- agent_reliability-1.0.0/tests/unit/reliability/test_engine.py +349 -0
- agent_reliability-1.0.0/tests/unit/reliability/test_model.py +300 -0
- agent_reliability-1.0.0/tests/unit/sdk/test_evaluation_integration.py +204 -0
- agent_reliability-1.0.0/tests/unit/sdk/test_failure_isolation.py +650 -0
- agent_reliability-1.0.0/tests/unit/sdk/test_lifecycle_async.py +141 -0
- agent_reliability-1.0.0/tests/unit/sdk/test_lifecycle_sync.py +156 -0
- agent_reliability-1.0.0/tests/unit/sdk/test_memory.py +49 -0
- agent_reliability-1.0.0/tests/unit/sdk/test_nesting.py +59 -0
- agent_reliability-1.0.0/tests/unit/sdk/test_threading.py +143 -0
- agent_reliability-1.0.0/tests/unit/test_package.py +45 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Report reproducible incorrect behavior
|
|
3
|
+
title: "[Bug]: "
|
|
4
|
+
labels: [bug]
|
|
5
|
+
body:
|
|
6
|
+
- type: markdown
|
|
7
|
+
attributes:
|
|
8
|
+
value: Security vulnerabilities must not be reported here; follow SECURITY.md.
|
|
9
|
+
- type: textarea
|
|
10
|
+
id: behavior
|
|
11
|
+
attributes:
|
|
12
|
+
label: Observed behavior
|
|
13
|
+
description: What happened, and what did you expect instead?
|
|
14
|
+
validations:
|
|
15
|
+
required: true
|
|
16
|
+
- type: textarea
|
|
17
|
+
id: reproduce
|
|
18
|
+
attributes:
|
|
19
|
+
label: Minimal reproduction
|
|
20
|
+
description: Include the smallest safe code sample and traceback with secrets removed.
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
- type: input
|
|
24
|
+
id: version
|
|
25
|
+
attributes:
|
|
26
|
+
label: Agent Reliability version
|
|
27
|
+
validations:
|
|
28
|
+
required: true
|
|
29
|
+
- type: input
|
|
30
|
+
id: python
|
|
31
|
+
attributes:
|
|
32
|
+
label: Python version and operating system
|
|
33
|
+
validations:
|
|
34
|
+
required: true
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: Propose an OSS reliability use case or improvement
|
|
3
|
+
title: "[Feature]: "
|
|
4
|
+
labels: [enhancement]
|
|
5
|
+
body:
|
|
6
|
+
- type: textarea
|
|
7
|
+
id: problem
|
|
8
|
+
attributes:
|
|
9
|
+
label: Problem
|
|
10
|
+
description: What developer or reliability problem cannot be solved today?
|
|
11
|
+
validations:
|
|
12
|
+
required: true
|
|
13
|
+
- type: textarea
|
|
14
|
+
id: proposal
|
|
15
|
+
attributes:
|
|
16
|
+
label: Proposed outcome
|
|
17
|
+
description: Describe the desired behavior, not only an API shape.
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: alternatives
|
|
22
|
+
attributes:
|
|
23
|
+
label: Alternatives and semantic impact
|
|
24
|
+
description: What workarounds exist, and could this affect SLO, UNKNOWN, or provenance semantics?
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
## What changed?
|
|
2
|
+
|
|
3
|
+
## Why?
|
|
4
|
+
|
|
5
|
+
## Alternatives considered
|
|
6
|
+
|
|
7
|
+
## Compatibility implications
|
|
8
|
+
|
|
9
|
+
<!-- See docs/COMPATIBILITY.md. Does this change any public API,
|
|
10
|
+
telemetry contract, or documented semantics? -->
|
|
11
|
+
|
|
12
|
+
## Security implications
|
|
13
|
+
|
|
14
|
+
<!-- See docs/SECURITY_MODEL.md if this touches input handling,
|
|
15
|
+
serialization, metadata, or external I/O. -->
|
|
16
|
+
|
|
17
|
+
## Performance implications
|
|
18
|
+
|
|
19
|
+
<!-- See docs/ENGINEERING_PRINCIPLES.md #6 if this touches a hot path. -->
|
|
20
|
+
|
|
21
|
+
## How was this verified?
|
|
22
|
+
|
|
23
|
+
- [ ] `ruff check .`
|
|
24
|
+
- [ ] `ruff format --check .`
|
|
25
|
+
- [ ] `mypy src`
|
|
26
|
+
- [ ] `pytest`
|
|
27
|
+
- [ ] `python -m build`
|
|
28
|
+
- [ ] `python scripts/verify_release_artifacts.py` (release-affecting changes)
|
|
29
|
+
|
|
30
|
+
## Checklist
|
|
31
|
+
|
|
32
|
+
- [ ] Tests added/updated in the correct category (see [docs/TESTING_STRATEGY.md](../docs/TESTING_STRATEGY.md))
|
|
33
|
+
- [ ] Docs updated if semantics changed
|
|
34
|
+
- [ ] Stable API/semantic changes include compatibility-test updates
|
|
35
|
+
- [ ] Privacy and failure-isolation tests updated when a trust boundary changed
|
|
36
|
+
- [ ] ADR added if this is a hard-to-reverse architectural decision (see [docs/adr/README.md](../docs/adr/README.md))
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
quality:
|
|
18
|
+
name: Lint, format, and type-check
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- name: Checkout
|
|
22
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
23
|
+
|
|
24
|
+
- name: Set up Python 3.11
|
|
25
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.11"
|
|
28
|
+
cache: "pip"
|
|
29
|
+
|
|
30
|
+
- name: Install package with dev dependencies
|
|
31
|
+
run: python -m pip install -e ".[dev]"
|
|
32
|
+
|
|
33
|
+
- name: Lint (ruff check)
|
|
34
|
+
run: ruff check .
|
|
35
|
+
|
|
36
|
+
- name: Format check (ruff format)
|
|
37
|
+
run: ruff format --check .
|
|
38
|
+
|
|
39
|
+
- name: Type check (mypy)
|
|
40
|
+
run: mypy src
|
|
41
|
+
|
|
42
|
+
test:
|
|
43
|
+
name: Test stable contracts (py${{ matrix.python-version }})
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
strategy:
|
|
46
|
+
fail-fast: false
|
|
47
|
+
matrix:
|
|
48
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
49
|
+
steps:
|
|
50
|
+
- name: Checkout
|
|
51
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
52
|
+
|
|
53
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
54
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
55
|
+
with:
|
|
56
|
+
python-version: ${{ matrix.python-version }}
|
|
57
|
+
cache: "pip"
|
|
58
|
+
|
|
59
|
+
- name: Install package with test dependencies
|
|
60
|
+
run: python -m pip install -e ".[dev,otel-test]"
|
|
61
|
+
|
|
62
|
+
- name: Test with branch coverage
|
|
63
|
+
run: python -m pytest --cov --cov-report=term-missing
|
|
64
|
+
|
|
65
|
+
artifacts:
|
|
66
|
+
name: Release artifacts, extras, examples, and typing
|
|
67
|
+
runs-on: ubuntu-latest
|
|
68
|
+
steps:
|
|
69
|
+
- name: Checkout
|
|
70
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
71
|
+
|
|
72
|
+
- name: Set up Python 3.11
|
|
73
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
74
|
+
with:
|
|
75
|
+
python-version: "3.11"
|
|
76
|
+
cache: "pip"
|
|
77
|
+
|
|
78
|
+
- name: Build wheel and sdist
|
|
79
|
+
run: |
|
|
80
|
+
python -m pip install build
|
|
81
|
+
python -m build
|
|
82
|
+
|
|
83
|
+
- name: Verify distributed artifacts
|
|
84
|
+
run: python scripts/verify_release_artifacts.py
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*.*.*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: release-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: false
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
build:
|
|
16
|
+
name: Build and verify release artifacts
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout
|
|
20
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
21
|
+
|
|
22
|
+
- name: Set up Python 3.11
|
|
23
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.11"
|
|
26
|
+
cache: "pip"
|
|
27
|
+
|
|
28
|
+
- name: Confirm tag matches package version
|
|
29
|
+
run: |
|
|
30
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
31
|
+
version="$(python -c 'import re,pathlib; print(re.search(r"__version__ = \"([^\"]+)\"", pathlib.Path("src/agent_reliability/__init__.py").read_text()).group(1))')"
|
|
32
|
+
if [ "$tag" != "$version" ]; then
|
|
33
|
+
echo "Tag v$tag does not match agent_reliability.__version__ ($version)" >&2
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
- name: Install package and build tooling
|
|
38
|
+
run: python -m pip install -e ".[dev,otel-test]" build
|
|
39
|
+
|
|
40
|
+
- name: Full quality gates
|
|
41
|
+
run: |
|
|
42
|
+
ruff check .
|
|
43
|
+
ruff format --check .
|
|
44
|
+
mypy src
|
|
45
|
+
python -m pytest --cov --cov-report=term-missing
|
|
46
|
+
|
|
47
|
+
- name: Build sdist and wheel
|
|
48
|
+
run: python -m build
|
|
49
|
+
|
|
50
|
+
- name: Verify distributed artifacts
|
|
51
|
+
run: python scripts/verify_release_artifacts.py
|
|
52
|
+
|
|
53
|
+
- name: Upload build artifacts
|
|
54
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
55
|
+
with:
|
|
56
|
+
name: dist
|
|
57
|
+
path: dist/
|
|
58
|
+
if-no-files-found: error
|
|
59
|
+
|
|
60
|
+
publish:
|
|
61
|
+
name: Publish to PyPI
|
|
62
|
+
needs: build
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
environment:
|
|
65
|
+
name: pypi
|
|
66
|
+
url: https://pypi.org/project/agent-reliability/
|
|
67
|
+
permissions:
|
|
68
|
+
id-token: write
|
|
69
|
+
steps:
|
|
70
|
+
- name: Download build artifacts
|
|
71
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
72
|
+
with:
|
|
73
|
+
name: dist
|
|
74
|
+
path: dist/
|
|
75
|
+
|
|
76
|
+
- name: Publish to PyPI via Trusted Publishing
|
|
77
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
78
|
+
|
|
79
|
+
github-release:
|
|
80
|
+
name: Create GitHub release
|
|
81
|
+
needs: publish
|
|
82
|
+
runs-on: ubuntu-latest
|
|
83
|
+
permissions:
|
|
84
|
+
contents: write
|
|
85
|
+
steps:
|
|
86
|
+
- name: Download build artifacts
|
|
87
|
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
88
|
+
with:
|
|
89
|
+
name: dist
|
|
90
|
+
path: dist/
|
|
91
|
+
|
|
92
|
+
- name: Create GitHub release
|
|
93
|
+
env:
|
|
94
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
95
|
+
run: |
|
|
96
|
+
gh release create "${GITHUB_REF_NAME}" dist/* \
|
|
97
|
+
--repo "${GITHUB_REPOSITORY}" \
|
|
98
|
+
--title "${GITHUB_REF_NAME}" \
|
|
99
|
+
--prerelease \
|
|
100
|
+
--generate-notes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
.venv/
|
|
9
|
+
venv/
|
|
10
|
+
|
|
11
|
+
# Test / coverage / type-check caches
|
|
12
|
+
.pytest_cache/
|
|
13
|
+
.mypy_cache/
|
|
14
|
+
.ruff_cache/
|
|
15
|
+
.hypothesis/
|
|
16
|
+
.coverage
|
|
17
|
+
.coverage.*
|
|
18
|
+
htmlcov/
|
|
19
|
+
|
|
20
|
+
# Editors / OS
|
|
21
|
+
.vscode/
|
|
22
|
+
.idea/
|
|
23
|
+
.DS_Store
|
|
24
|
+
Thumbs.db
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. Format loosely
|
|
4
|
+
follows [Keep a Changelog](https://keepachangelog.com/); versioning
|
|
5
|
+
follows [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [1.0.0]
|
|
10
|
+
|
|
11
|
+
First General Availability release. The public contract frozen for `1.0.0rc1`
|
|
12
|
+
is unchanged; this release differs from `1.0.0rc1` only in version, release
|
|
13
|
+
metadata, and documentation status — no production code, public API, or
|
|
14
|
+
documented semantic changed. See [GA_CONTRACT.md](docs/GA_CONTRACT.md) for
|
|
15
|
+
the full normative 1.0 contract and [VERSIONING.md](docs/VERSIONING.md) for
|
|
16
|
+
the compatibility and deprecation policy this version now follows.
|
|
17
|
+
|
|
18
|
+
Stable, user-facing capabilities as of `1.0.0`:
|
|
19
|
+
|
|
20
|
+
- Safe synchronous and asynchronous agent instrumentation: instrumentation
|
|
21
|
+
dependency failures are isolated from application code, and initialization
|
|
22
|
+
failure degrades to a no-telemetry handle instead of raising.
|
|
23
|
+
- Optional OpenTelemetry trace interoperability, with the host owning the
|
|
24
|
+
provider, sampling, propagation, processing, and export.
|
|
25
|
+
- Explicit `PASS`/`FAIL`/`UNKNOWN` evaluation outcomes, with evaluator
|
|
26
|
+
execution failure kept categorically distinct from all three.
|
|
27
|
+
- A deterministic evaluator framework (`agent_reliability.evaluation`) with
|
|
28
|
+
immutable evaluator identity, decisions, results, and provenance.
|
|
29
|
+
- Exact `fractions.Fraction` SLO, error-budget, and burn-rate mathematics,
|
|
30
|
+
including explicit `UnknownPolicy` handling and defined no-data/
|
|
31
|
+
zero-tolerance states.
|
|
32
|
+
- Provenance-safe local reliability aggregation
|
|
33
|
+
(`agent_reliability.reliability`): incompatible measurement methodologies
|
|
34
|
+
return a typed conflict rather than a misleading combined number.
|
|
35
|
+
- A typed public API (`py.typed` shipped, strict-mypy verified against the
|
|
36
|
+
installed package) with zero base runtime dependencies and fully offline,
|
|
37
|
+
local operation — no network service, database, or hosted platform is
|
|
38
|
+
required.
|
|
39
|
+
- Privacy-first defaults throughout: no automatic capture of prompts,
|
|
40
|
+
responses, tool arguments/results, exception messages, tracebacks, or
|
|
41
|
+
arbitrary payloads.
|
|
42
|
+
|
|
43
|
+
This is an open-source SDK release. It does not include any hosted,
|
|
44
|
+
multi-tenant, or commercial control-plane functionality.
|
|
45
|
+
|
|
46
|
+
## [1.0.0rc1]
|
|
47
|
+
|
|
48
|
+
This first public release candidate establishes the frozen 1.0 contracts for
|
|
49
|
+
privacy-first agent instrumentation, synchronous and asynchronous run
|
|
50
|
+
lifecycles, instrumentation failure isolation, optional OpenTelemetry
|
|
51
|
+
interoperability, deterministic evaluation with provenance, exact SLO/error
|
|
52
|
+
budget/burn-rate mathematics, provenance-safe local reliability aggregation,
|
|
53
|
+
and a typed zero-base-dependency API.
|
|
54
|
+
|
|
55
|
+
### Changed
|
|
56
|
+
|
|
57
|
+
- M7 freezes the 1.0 public and semantic contracts, defines SemVer and
|
|
58
|
+
deprecation policy, makes runtime `__version__` the package-metadata source,
|
|
59
|
+
and excludes retained exceptions from `SdkDiagnostic` representations.
|
|
60
|
+
|
|
61
|
+
- M6 reframes the developer path around an executable quickstart, core
|
|
62
|
+
concepts, framework-neutral integration guidance, and a product-first
|
|
63
|
+
README. Public API review found no rename or semantic change necessary.
|
|
64
|
+
|
|
65
|
+
- M5 makes evaluator provenance operational: local aggregation fails closed
|
|
66
|
+
with a typed, number-free conflict when indicator or methodology cohorts do
|
|
67
|
+
not match. M1 remains the sole source of reliability mathematics.
|
|
68
|
+
|
|
69
|
+
- M4 extends `EvaluationRecorded` additively with optional immutable evaluator
|
|
70
|
+
provenance and a bounded reason code. Existing `RunHandle.record(...)`
|
|
71
|
+
remains a manual assertion and emits `provenance=None`.
|
|
72
|
+
- Evaluator execution failure is now explicitly distinct from
|
|
73
|
+
`EvaluationOutcome.UNKNOWN`; safe execution never converts evaluator failure
|
|
74
|
+
into agent `FAIL` or `UNKNOWN`.
|
|
75
|
+
|
|
76
|
+
- M3 OpenTelemetry interoperability adds an optional API-only trace-context
|
|
77
|
+
bridge while preserving the M2.1 default path and failure isolation. The
|
|
78
|
+
host owns provider, sampling, propagation, processing, and export.
|
|
79
|
+
- Agent run spans use a privacy allowlist, the constant `invoke_agent` name,
|
|
80
|
+
and versioned Experimental `agent_reliability.*` attributes. Evaluations
|
|
81
|
+
remain vendor-neutral events while OTel's log-based Events APIs mature.
|
|
82
|
+
|
|
83
|
+
- M2.1 runtime hardening: clock, run-ID, and internal run-start failures
|
|
84
|
+
now enter a no-telemetry degraded mode so sync/async application bodies
|
|
85
|
+
still execute. Degraded handles expose no fabricated IDs, valid
|
|
86
|
+
`record()` calls are no-ops, and no lifecycle/evaluation events are emitted.
|
|
87
|
+
This supersedes ADR-0004's original "clock/id-generator failure at
|
|
88
|
+
`__enter__`/`__aenter__` may raise" sub-rule (that behavior turned out
|
|
89
|
+
to prevent the application body from running at all, contradicting the
|
|
90
|
+
ADR's own safety requirement) — see the new ADR-0005, which is now the
|
|
91
|
+
authority on this boundary; ADR-0004's Status was changed to
|
|
92
|
+
"Superseded by ADR-0005" and its original text left otherwise unedited,
|
|
93
|
+
per the project's own ADR process.
|
|
94
|
+
- The default diagnostic logger now emits only sanitized structural
|
|
95
|
+
metadata and the exception class name; it never renders exception
|
|
96
|
+
messages, arguments, representations, or tracebacks (also ADR-0005).
|
|
97
|
+
- `AgentReliability(...)` now validates at construction that any
|
|
98
|
+
supplied `sink`/`clock`/`run_id_generator`/`diagnostic_handler`
|
|
99
|
+
structurally implements its port, raising `TypeError` immediately for
|
|
100
|
+
a wrong object type, rather than failing later and less clearly.
|
|
101
|
+
- Clarified `EventSink` ordering, concurrency, exception, and lifecycle
|
|
102
|
+
contracts; confirmed `CompositeEventSink` attempts all children and
|
|
103
|
+
raises the first child `Exception` after fan-out.
|
|
104
|
+
- Explicitly classified `InMemoryEventSink` as an unbounded-retention
|
|
105
|
+
test/local-inspection utility unsuitable for production.
|
|
106
|
+
|
|
107
|
+
### Added
|
|
108
|
+
|
|
109
|
+
- M7 adds public API/enum/signature compatibility tests, GA semantic and
|
|
110
|
+
privacy golden tests, wheel-and-sdist release verification, supported-Python
|
|
111
|
+
CI gates, and maintainer release/readiness documentation.
|
|
112
|
+
|
|
113
|
+
- M6 adds four contract-tested examples, clean installed-wheel/base/OTel-extra
|
|
114
|
+
verification in CI, lightweight public issue templates, and the PEP 561
|
|
115
|
+
`py.typed` marker. Base runtime dependencies remain empty.
|
|
116
|
+
|
|
117
|
+
- M5 local reliability engine:
|
|
118
|
+
- immutable observation, cohort, conflict, and report values in
|
|
119
|
+
`agent_reliability.reliability`;
|
|
120
|
+
- pure `evaluate_reliability(...)` with explicit UNKNOWN policy and optional
|
|
121
|
+
explicit burn-rate lookback;
|
|
122
|
+
- exact M1-composed ratio, SLO, error-budget, and burn-rate results;
|
|
123
|
+
- ADR-0008, `docs/LOCAL_RELIABILITY_ENGINE.md`, property/contract tests, and
|
|
124
|
+
aggregation benchmarks;
|
|
125
|
+
- no runtime dependency, I/O, persistence, logging, clock, registry,
|
|
126
|
+
framework coupling, or commercial-platform coupling.
|
|
127
|
+
|
|
128
|
+
- M4 evaluator framework:
|
|
129
|
+
- public `agent_reliability.evaluation` identity, decision, provenance,
|
|
130
|
+
result, execution-failure, sync/async protocol, equality, and predicate
|
|
131
|
+
types;
|
|
132
|
+
- SDK `EvaluatorRunner` with explicit sync/async methods, injected clock, and
|
|
133
|
+
existing sanitized diagnostics;
|
|
134
|
+
- `RunHandle.record_evaluation(...)` for associating completed attributable
|
|
135
|
+
results with a run;
|
|
136
|
+
- `docs/EVALUATOR_FRAMEWORK.md`, `docs/EVALUATION_PROVENANCE.md`, and
|
|
137
|
+
ADR-0007;
|
|
138
|
+
- no new runtime dependency, provider/framework coupling, input capture,
|
|
139
|
+
registry, timeout system, or OTel evaluation mapping.
|
|
140
|
+
|
|
141
|
+
- M3 `RunContextBridge`/`RunContextScope`, optional
|
|
142
|
+
`OpenTelemetryRunContextBridge`, ADR-0006, `docs/OTEL_MAPPING.md`, real OTel
|
|
143
|
+
context/parentage/failure tests, and comparison benchmarks.
|
|
144
|
+
|
|
145
|
+
- Milestone M2: the Python instrumentation SDK, under
|
|
146
|
+
`agent_reliability.sdk` (not the package root), plus new
|
|
147
|
+
`agent_reliability.ports`/`agent_reliability.adapters` runtime types:
|
|
148
|
+
- `sdk`: `AgentReliability`, `RunHandle`, `current_run()`,
|
|
149
|
+
`DiagnosticHandler`/`LoggingDiagnosticHandler`/`SdkDiagnostic`
|
|
150
|
+
- `ports`: `Clock`, `RunIdGenerator`, `EventSink`,
|
|
151
|
+
`RunStarted`/`RunCompleted`/`RunFailed`/`EvaluationRecorded`/`InstrumentationEvent`
|
|
152
|
+
- `adapters`: `SystemClock`, `UuidRunIdGenerator`, `NoOpEventSink`,
|
|
153
|
+
`InMemoryEventSink`, `CompositeEventSink`
|
|
154
|
+
- ADR-0003 (SDK runtime/context architecture) and ADR-0004
|
|
155
|
+
(instrumentation failure isolation) — the latter defines the exact
|
|
156
|
+
rule for what raises and what is suppressed, applied consistently
|
|
157
|
+
across the SDK.
|
|
158
|
+
- `benchmarks/bench_sdk.py`: the first milestone with a real runtime
|
|
159
|
+
path to measure (engineering baselines only, not marketing claims).
|
|
160
|
+
- No M1 (`agent_reliability.domain`) code was modified. No new
|
|
161
|
+
runtime dependencies (standard library only).
|
|
162
|
+
|
|
163
|
+
- Milestone M1: the reliability domain kernel, under
|
|
164
|
+
`agent_reliability.domain` (not the package root). Pure, typed,
|
|
165
|
+
deterministic, zero I/O:
|
|
166
|
+
- `EvaluationOutcome` (`PASS`/`FAIL`/`UNKNOWN`)
|
|
167
|
+
- `AgentIdentity`
|
|
168
|
+
- `AgentRun`, `RunStatus` (minimal four-state lifecycle)
|
|
169
|
+
- `UnknownPolicy`, `ObservationCounts`, `RatioResult`, `compute_ratio`
|
|
170
|
+
- `ObjectiveDirection`, `Slo`, `SloStatus`, `SloEvaluation`, `evaluate_slo`
|
|
171
|
+
- `BudgetStatus`, `ErrorBudget`, `BurnRate`, `compute_error_budget`,
|
|
172
|
+
`compute_burn_rate`
|
|
173
|
+
- ADR-0002 resolves the ratio-math and undefined-data semantics this
|
|
174
|
+
kernel implements, correcting an ambiguity found in the M0
|
|
175
|
+
`SLO_SEMANTICS.md` draft. All public symbols remain pre-alpha with
|
|
176
|
+
no compatibility guarantee (see `docs/COMPATIBILITY.md`).
|
|
177
|
+
|
|
178
|
+
- Repository foundation (milestone M0): engineering principles,
|
|
179
|
+
architecture and domain-model specifications, telemetry contract
|
|
180
|
+
approach, SLO/error-budget/burn-rate mathematics specification,
|
|
181
|
+
security threat model, testing strategy, ADR process
|
|
182
|
+
(ADR-0001: architecture and dependency boundaries), and CI.
|
|
183
|
+
- `agent_reliability` package skeleton: layered `domain` / `application`
|
|
184
|
+
/ `ports` / `adapters` / `experimental` structure, all currently
|
|
185
|
+
empty placeholders. Public API is limited to `__version__`.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our pledge
|
|
4
|
+
|
|
5
|
+
We want participation in this project to be a harassment-free experience
|
|
6
|
+
for everyone, regardless of age, body size, disability, ethnicity,
|
|
7
|
+
gender identity and expression, level of experience, nationality,
|
|
8
|
+
personal appearance, race, religion, or sexual identity and orientation.
|
|
9
|
+
|
|
10
|
+
## Our standards
|
|
11
|
+
|
|
12
|
+
Examples of behavior that contributes to a positive environment:
|
|
13
|
+
|
|
14
|
+
- Being respectful of differing viewpoints and experiences
|
|
15
|
+
- Giving and gracefully accepting constructive feedback
|
|
16
|
+
- Focusing on what is best for the project and its users
|
|
17
|
+
|
|
18
|
+
Examples of unacceptable behavior:
|
|
19
|
+
|
|
20
|
+
- Harassment, insults, or derogatory comments, public or private
|
|
21
|
+
- Publishing others' private information without explicit permission
|
|
22
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
23
|
+
professional setting
|
|
24
|
+
|
|
25
|
+
## Enforcement
|
|
26
|
+
|
|
27
|
+
Instances of unacceptable behavior may be reported to the project
|
|
28
|
+
maintainers through the reporting channel described in
|
|
29
|
+
[SECURITY.md](SECURITY.md) (for reports where privacy matters) or via a
|
|
30
|
+
public issue for less sensitive concerns. Maintainers are responsible
|
|
31
|
+
for clarifying standards and are expected to take appropriate, fair
|
|
32
|
+
corrective action in response to any behavior they deem inappropriate.
|
|
33
|
+
|
|
34
|
+
## Scope
|
|
35
|
+
|
|
36
|
+
This Code of Conduct applies within all project spaces (issues, pull
|
|
37
|
+
requests, discussions) and when an individual is representing the
|
|
38
|
+
project in public spaces.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thank you for your interest. Agent Reliability `1.0.0` is released; public
|
|
4
|
+
APIs documented as stable in [docs/GA_CONTRACT.md](docs/GA_CONTRACT.md)
|
|
5
|
+
follow Semantic Versioning. Questions and precise critique remain welcome.
|
|
6
|
+
|
|
7
|
+
## Development setup
|
|
8
|
+
|
|
9
|
+
Requires Python 3.11–3.13.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
python -m venv .venv
|
|
13
|
+
# POSIX: source .venv/bin/activate
|
|
14
|
+
# Windows PowerShell: .venv\Scripts\Activate.ps1
|
|
15
|
+
python -m pip install -e ".[dev]"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Branches use `<type>/<short-description>`, for example
|
|
19
|
+
`fix/burn-rate-division-by-zero`. Keep commits reviewable and do not mix
|
|
20
|
+
unrelated semantic and formatting changes.
|
|
21
|
+
|
|
22
|
+
## Before opening a PR
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
ruff check .
|
|
26
|
+
ruff format --check .
|
|
27
|
+
mypy src
|
|
28
|
+
pytest --cov --cov-report=term-missing
|
|
29
|
+
python -m build
|
|
30
|
+
python scripts/verify_release_artifacts.py
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
CI repeats these checks. New behavior needs the appropriate unit, property,
|
|
34
|
+
contract, or integration tests; see [testing strategy](docs/TESTING_STRATEGY.md).
|
|
35
|
+
Reliability mathematics changes require invariant/property coverage.
|
|
36
|
+
|
|
37
|
+
## Architecture and documentation
|
|
38
|
+
|
|
39
|
+
Preserve the dependency direction and anti-goals in
|
|
40
|
+
[architecture](docs/ARCHITECTURE.md) and
|
|
41
|
+
[engineering principles](docs/ENGINEERING_PRINCIPLES.md). Do not add provider,
|
|
42
|
+
agent-framework, storage, or transport dependencies to the domain.
|
|
43
|
+
|
|
44
|
+
Hard-to-reverse decisions require an ADR alongside the implementation; see the
|
|
45
|
+
[ADR guide](docs/adr/README.md). Update documentation in the same PR whenever
|
|
46
|
+
public behavior or semantics change.
|
|
47
|
+
|
|
48
|
+
## Compatibility
|
|
49
|
+
|
|
50
|
+
Before 1.0, public APIs may receive limited breaking refinement. See
|
|
51
|
+
[compatibility](docs/COMPATIBILITY.md). Do not introduce convenience APIs that
|
|
52
|
+
hide evaluator methodology, UNKNOWN policy, provenance, or SLO choices.
|
|
53
|
+
|
|
54
|
+
## PR description checklist
|
|
55
|
+
|
|
56
|
+
- What changed and why?
|
|
57
|
+
- What alternatives were considered?
|
|
58
|
+
- What are the compatibility, security, and performance implications?
|
|
59
|
+
- How was it verified?
|
|
60
|
+
|
|
61
|
+
Security vulnerabilities must use the private process in [SECURITY.md](SECURITY.md),
|
|
62
|
+
not a public issue.
|