longguard 0.2.1.dev0__tar.gz → 0.2.2__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.
Files changed (128) hide show
  1. {longguard-0.2.1.dev0 → longguard-0.2.2}/.github/workflows/ci.yml +21 -7
  2. {longguard-0.2.1.dev0 → longguard-0.2.2}/.github/workflows/docs.yml +2 -2
  3. {longguard-0.2.1.dev0 → longguard-0.2.2}/.github/workflows/release-on-merge.yml +3 -3
  4. longguard-0.2.2/.github/workflows/release.yml +193 -0
  5. {longguard-0.2.1.dev0 → longguard-0.2.2}/CHANGELOG.md +18 -0
  6. {longguard-0.2.1.dev0 → longguard-0.2.2}/PKG-INFO +34 -18
  7. {longguard-0.2.1.dev0 → longguard-0.2.2}/README.md +32 -17
  8. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/guides/compatibility.md +1 -1
  9. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/index.md +3 -0
  10. {longguard-0.2.1.dev0 → longguard-0.2.2}/pyproject.toml +2 -1
  11. longguard-0.2.2/scripts/check_version.py +203 -0
  12. {longguard-0.2.1.dev0 → longguard-0.2.2}/scripts/verify_release.py +9 -0
  13. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/__init__.py +1 -1
  14. longguard-0.2.2/tests/test_check_version.py +124 -0
  15. {longguard-0.2.1.dev0 → longguard-0.2.2}/uv.lock +226 -2
  16. longguard-0.2.1.dev0/.github/workflows/release.yml +0 -75
  17. {longguard-0.2.1.dev0 → longguard-0.2.2}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  18. {longguard-0.2.1.dev0 → longguard-0.2.2}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  19. {longguard-0.2.1.dev0 → longguard-0.2.2}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  20. {longguard-0.2.1.dev0 → longguard-0.2.2}/.github/PR_v0.2.0_DRAFT.md +0 -0
  21. {longguard-0.2.1.dev0 → longguard-0.2.2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  22. {longguard-0.2.1.dev0 → longguard-0.2.2}/.github/dependabot.yml +0 -0
  23. {longguard-0.2.1.dev0 → longguard-0.2.2}/.github/release.yml +0 -0
  24. {longguard-0.2.1.dev0 → longguard-0.2.2}/.gitignore +0 -0
  25. {longguard-0.2.1.dev0 → longguard-0.2.2}/CODE_OF_CONDUCT.md +0 -0
  26. {longguard-0.2.1.dev0 → longguard-0.2.2}/CONTRIBUTING.md +0 -0
  27. {longguard-0.2.1.dev0 → longguard-0.2.2}/LICENSE +0 -0
  28. {longguard-0.2.1.dev0 → longguard-0.2.2}/SECURITY.md +0 -0
  29. {longguard-0.2.1.dev0 → longguard-0.2.2}/SUPPORT.md +0 -0
  30. {longguard-0.2.1.dev0 → longguard-0.2.2}/assets/LongGuard-Logo.png +0 -0
  31. {longguard-0.2.1.dev0 → longguard-0.2.2}/assets/architecture.svg +0 -0
  32. {longguard-0.2.1.dev0 → longguard-0.2.2}/assets/icon.svg +0 -0
  33. {longguard-0.2.1.dev0 → longguard-0.2.2}/assets/linkedin_card.png +0 -0
  34. {longguard-0.2.1.dev0 → longguard-0.2.2}/assets/linkedin_launch.jpg +0 -0
  35. {longguard-0.2.1.dev0 → longguard-0.2.2}/assets/logo-dark.svg +0 -0
  36. {longguard-0.2.1.dev0 → longguard-0.2.2}/assets/logo-light.svg +0 -0
  37. {longguard-0.2.1.dev0 → longguard-0.2.2}/assets/logo.svg +0 -0
  38. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/assets/LongGuard-Logo.png +0 -0
  39. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/assets/architecture.svg +0 -0
  40. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/assets/icon.svg +0 -0
  41. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/assets/logo-dark.svg +0 -0
  42. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/assets/logo-light.svg +0 -0
  43. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/assets/logo.svg +0 -0
  44. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/changelog.md +0 -0
  45. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/concepts/detectors.md +0 -0
  46. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/concepts/how-it-works.md +0 -0
  47. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/concepts/reflect-and-pivot.md +0 -0
  48. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/contributing.md +0 -0
  49. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/getting-started.md +0 -0
  50. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/guides/benchmarks.md +0 -0
  51. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/guides/configuration.md +0 -0
  52. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/guides/decorator.md +0 -0
  53. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/guides/development-evidence.md +0 -0
  54. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/guides/model-pricing-sources.md +0 -0
  55. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/guides/reporting.md +0 -0
  56. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/integrations/crewai.md +0 -0
  57. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/integrations/langchain.md +0 -0
  58. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/integrations/langgraph.md +0 -0
  59. {longguard-0.2.1.dev0 → longguard-0.2.2}/docs/integrations/raw-client.md +0 -0
  60. {longguard-0.2.1.dev0 → longguard-0.2.2}/examples/crewai_guarded.py +0 -0
  61. {longguard-0.2.1.dev0 → longguard-0.2.2}/examples/custom_detector.py +0 -0
  62. {longguard-0.2.1.dev0 → longguard-0.2.2}/examples/langchain_agent.py +0 -0
  63. {longguard-0.2.1.dev0 → longguard-0.2.2}/examples/langgraph_basic.py +0 -0
  64. {longguard-0.2.1.dev0 → longguard-0.2.2}/examples/langgraph_resume.py +0 -0
  65. {longguard-0.2.1.dev0 → longguard-0.2.2}/examples/openai_raw_guard.py +0 -0
  66. {longguard-0.2.1.dev0 → longguard-0.2.2}/mkdocs.yml +0 -0
  67. {longguard-0.2.1.dev0 → longguard-0.2.2}/scripts/prepare_merge_release.py +0 -0
  68. {longguard-0.2.1.dev0 → longguard-0.2.2}/scripts/release_notes.py +0 -0
  69. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/config.py +0 -0
  70. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/__init__.py +0 -0
  71. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/breaker.py +0 -0
  72. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/decorator.py +0 -0
  73. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/detectors/__init__.py +0 -0
  74. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/detectors/base.py +0 -0
  75. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/detectors/dead_end.py +0 -0
  76. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/detectors/semantic_osc.py +0 -0
  77. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/detectors/token_velocity.py +0 -0
  78. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/detectors/tool_repeat.py +0 -0
  79. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/pivot.py +0 -0
  80. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/reporter.py +0 -0
  81. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/core/step.py +0 -0
  82. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/integrations/__init__.py +0 -0
  83. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/integrations/crewai.py +0 -0
  84. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/integrations/graph_runner.py +0 -0
  85. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/integrations/langchain.py +0 -0
  86. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/integrations/langgraph.py +0 -0
  87. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/integrations/messages.py +0 -0
  88. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/integrations/strands.py +0 -0
  89. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/pricing.py +0 -0
  90. {longguard-0.2.1.dev0 → longguard-0.2.2}/src/longguard/py.typed +0 -0
  91. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/__init__.py +0 -0
  92. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/benchmarks/LABEL_REVIEW.md +0 -0
  93. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/benchmarks/corpus.json +0 -0
  94. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/benchmarks/results/baseline-hash.json +0 -0
  95. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/benchmarks/results/current-hash.json +0 -0
  96. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/benchmarks/run.py +0 -0
  97. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/conftest.py +0 -0
  98. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/fixtures/report_v014.json +0 -0
  99. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_benchmark.py +0 -0
  100. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_breaker.py +0 -0
  101. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_config.py +0 -0
  102. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_crewai_callback_contracts.py +0 -0
  103. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_crewai_execution.py +0 -0
  104. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_crewai_integration.py +0 -0
  105. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_dead_end.py +0 -0
  106. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_decorator.py +0 -0
  107. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_decorator_contracts.py +0 -0
  108. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_langchain_integration.py +0 -0
  109. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_langgraph_integration.py +0 -0
  110. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_langgraph_node_contracts.py +0 -0
  111. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_langgraph_resume.py +0 -0
  112. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_merge_release_workflow.py +0 -0
  113. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_pivot.py +0 -0
  114. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_policy_edge_contracts.py +0 -0
  115. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_prepare_merge_release.py +0 -0
  116. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_pricing.py +0 -0
  117. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_public_exports.py +0 -0
  118. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_release_notes.py +0 -0
  119. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_report_persistence.py +0 -0
  120. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_reporter.py +0 -0
  121. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_semantic_osc.py +0 -0
  122. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_step.py +0 -0
  123. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_step_adapters.py +0 -0
  124. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_strands_integration.py +0 -0
  125. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_terminal_state.py +0 -0
  126. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_token_velocity.py +0 -0
  127. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_tool_cleanup.py +0 -0
  128. {longguard-0.2.1.dev0 → longguard-0.2.2}/tests/test_tool_repeat.py +0 -0
@@ -17,10 +17,10 @@ jobs:
17
17
  python-version: ["3.11", "3.12"]
18
18
 
19
19
  steps:
20
- - uses: actions/checkout@v4
20
+ - uses: actions/checkout@v7
21
21
 
22
22
  - name: Install uv
23
- uses: astral-sh/setup-uv@v3
23
+ uses: astral-sh/setup-uv@v7
24
24
  with:
25
25
  version: "latest"
26
26
 
@@ -33,7 +33,16 @@ jobs:
33
33
 
34
34
  - name: Run Ruff Linter & Formatter
35
35
  run: |
36
- uv run --python ${{ matrix.python-version }} ruff check src/ tests/
36
+ uv run --python ${{ matrix.python-version }} ruff check src/ tests/ scripts/
37
+
38
+ - name: Check Version Consistency
39
+ run: |
40
+ uv run --python ${{ matrix.python-version }} python scripts/check_version.py
41
+
42
+ - name: Strict Documentation Build Check
43
+ if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
44
+ run: |
45
+ uv run --python ${{ matrix.python-version }} mkdocs build --strict
37
46
 
38
47
  - name: Run MyPy Type Checker
39
48
  run: |
@@ -47,6 +56,11 @@ jobs:
47
56
  run: |
48
57
  uv build
49
58
 
59
+ - name: Validate Built Distribution and Metadata
60
+ run: |
61
+ uv run --python ${{ matrix.python-version }} twine check --strict dist/*
62
+ uv run --python ${{ matrix.python-version }} python scripts/check_version.py --check-dist
63
+
50
64
  frameworks:
51
65
  name: Real frameworks (${{ matrix.dependencies }})
52
66
  runs-on: ubuntu-latest
@@ -55,8 +69,8 @@ jobs:
55
69
  matrix:
56
70
  dependencies: [locked, newest]
57
71
  steps:
58
- - uses: actions/checkout@v4
59
- - uses: astral-sh/setup-uv@v3
72
+ - uses: actions/checkout@v7
73
+ - uses: astral-sh/setup-uv@v7
60
74
  - run: uv python install 3.12
61
75
  - name: Install framework contracts
62
76
  run: uv sync --locked --python 3.12 --extra dev --extra langgraph --extra langchain --extra crewai
@@ -68,7 +82,7 @@ jobs:
68
82
  uv run --no-sync python -c "from importlib.metadata import version; print({n: version(n) for n in ('langgraph', 'langchain', 'crewai')})"
69
83
  - name: Execute gates and require real framework tests
70
84
  run: uv run --no-sync python scripts/verify_release.py
71
- - uses: actions/upload-artifact@v4
85
+ - uses: actions/upload-artifact@v7
72
86
  if: always()
73
87
  with:
74
88
  name: checks-${{ matrix.dependencies }}
@@ -77,7 +91,7 @@ jobs:
77
91
  release-coverage.json
78
92
  - name: Reproduce provisional benchmark
79
93
  run: uv run --no-sync python tests/benchmarks/run.py --output /tmp/benchmark.json
80
- - uses: actions/upload-artifact@v4
94
+ - uses: actions/upload-artifact@v7
81
95
  with:
82
96
  name: benchmark-${{ matrix.dependencies }}
83
97
  path: /tmp/benchmark.json
@@ -12,10 +12,10 @@ jobs:
12
12
  deploy:
13
13
  runs-on: ubuntu-latest
14
14
  steps:
15
- - uses: actions/checkout@v4
15
+ - uses: actions/checkout@v7
16
16
 
17
17
  - name: Install uv
18
- uses: astral-sh/setup-uv@v3
18
+ uses: astral-sh/setup-uv@v7
19
19
  with:
20
20
  version: "latest"
21
21
 
@@ -28,7 +28,7 @@ jobs:
28
28
  steps:
29
29
  - name: Find merged PR
30
30
  id: pr
31
- uses: actions/github-script@v8
31
+ uses: actions/github-script@v9
32
32
  with:
33
33
  script: |
34
34
  const { owner, repo } = context.repo;
@@ -72,12 +72,12 @@ jobs:
72
72
  );
73
73
  core.setOutput('sha', pr.merge_commit_sha);
74
74
  # A push to main is trusted repository code, including merges from forks.
75
- - uses: actions/checkout@v6
75
+ - uses: actions/checkout@v7
76
76
  if: steps.pr.outputs.sha != ''
77
77
  with:
78
78
  ref: ${{ steps.pr.outputs.sha }}
79
79
  fetch-depth: 0
80
- - uses: actions/setup-python@v6
80
+ - uses: actions/setup-python@v7
81
81
  if: steps.pr.outputs.sha != ''
82
82
  with:
83
83
  python-version: '3.12'
@@ -0,0 +1,193 @@
1
+ name: Release
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ tag:
7
+ required: true
8
+ type: string
9
+ publish:
10
+ default: false
11
+ type: boolean
12
+ testpypi:
13
+ default: false
14
+ type: boolean
15
+ push:
16
+ tags: ["v*"]
17
+ workflow_dispatch:
18
+ inputs:
19
+ tag:
20
+ description: "Existing version tag to release (for example v0.2.2 or v0.2.2rc1)"
21
+ required: true
22
+ publish:
23
+ description: "Publish to PyPI"
24
+ default: false
25
+ type: boolean
26
+ testpypi:
27
+ description: "Publish dry run to TestPyPI"
28
+ default: false
29
+ type: boolean
30
+
31
+ jobs:
32
+ build-and-release:
33
+ runs-on: ubuntu-latest
34
+ permissions:
35
+ contents: write
36
+ outputs:
37
+ tag: ${{ steps.notes.outputs.tag }}
38
+ version: ${{ steps.meta.outputs.version }}
39
+ prerelease: ${{ steps.notes.outputs.prerelease }}
40
+ publish: ${{ steps.flags.outputs.publish }}
41
+ testpypi: ${{ steps.flags.outputs.testpypi }}
42
+ steps:
43
+ - uses: actions/checkout@v7
44
+ with:
45
+ ref: ${{ inputs.tag || github.ref }}
46
+ fetch-depth: 0
47
+ - uses: astral-sh/setup-uv@v7
48
+ - run: uv python install 3.12
49
+ - run: uv sync --locked --python 3.12 --extra dev --extra langgraph --extra langchain --extra crewai
50
+ - name: Verify tag and source identity
51
+ env:
52
+ RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
53
+ run: |
54
+ git show-ref --verify "refs/tags/$RELEASE_TAG"
55
+ test "$(git rev-list -n 1 "$RELEASE_TAG")" = "$(git rev-parse HEAD)"
56
+ - name: Verify version consistency against tag
57
+ env:
58
+ RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
59
+ run: |
60
+ uv run --no-sync python scripts/check_version.py --tag "$RELEASE_TAG"
61
+ - name: Execute and record release gates
62
+ env:
63
+ UV_CACHE_DIR: /tmp/longguard-uv-cache
64
+ run: uv run --no-sync python scripts/verify_release.py
65
+ - name: Extract metadata
66
+ id: meta
67
+ run: |
68
+ VERSION=$(uv run --no-sync python -c "import tomllib, pathlib; print(tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version'])")
69
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
70
+ - name: Generate literal release notes
71
+ id: notes
72
+ env:
73
+ RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
74
+ run: >-
75
+ uv run --no-sync python scripts/release_notes.py --tag "$RELEASE_TAG"
76
+ --evidence release-evidence.json --output release_body.md
77
+ --github-output "$GITHUB_OUTPUT"
78
+ - name: Determine publish flags
79
+ id: flags
80
+ run: |
81
+ IS_PUSH="${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}"
82
+ PUBLISH="${{ inputs.publish == true }}"
83
+ TESTPYPI="${{ inputs.testpypi == true }}"
84
+ if [ "$IS_PUSH" = "true" ] || [ "$PUBLISH" = "true" ]; then
85
+ echo "publish=true" >> "$GITHUB_OUTPUT"
86
+ else
87
+ echo "publish=false" >> "$GITHUB_OUTPUT"
88
+ fi
89
+ echo "testpypi=$TESTPYPI" >> "$GITHUB_OUTPUT"
90
+ - name: Upload check evidence
91
+ if: always()
92
+ uses: actions/upload-artifact@v7
93
+ with:
94
+ name: release-evidence
95
+ path: |
96
+ release-evidence.json
97
+ release-coverage.json
98
+ - name: Upload distribution packages
99
+ uses: actions/upload-artifact@v7
100
+ with:
101
+ name: dist-packages
102
+ path: dist/*
103
+ - name: Create GitHub release
104
+ uses: softprops/action-gh-release@v3
105
+ with:
106
+ tag_name: ${{ steps.notes.outputs.tag }}
107
+ name: LongGuard ${{ steps.notes.outputs.tag }}
108
+ files: |
109
+ dist/*.whl
110
+ dist/*.tar.gz
111
+ release-evidence.json
112
+ release-coverage.json
113
+ body_path: release_body.md
114
+ draft: ${{ steps.flags.outputs.publish != 'true' }}
115
+ prerelease: ${{ steps.notes.outputs.prerelease == 'true' }}
116
+ make_latest: ${{ steps.notes.outputs.latest }}
117
+
118
+ publish-testpypi:
119
+ needs: build-and-release
120
+ if: needs.build-and-release.outputs.testpypi == 'true'
121
+ runs-on: ubuntu-latest
122
+ environment: testpypi
123
+ permissions:
124
+ id-token: write
125
+ steps:
126
+ - name: Download distribution packages
127
+ uses: actions/download-artifact@v7
128
+ with:
129
+ name: dist-packages
130
+ path: dist
131
+ - name: Publish to TestPyPI via Trusted Publishing
132
+ uses: pypa/gh-action-pypi-publish@release/v1
133
+ with:
134
+ repository-url: https://test.pypi.org/legacy/
135
+ attestations: true
136
+ skip-existing: true
137
+
138
+ publish-pypi:
139
+ needs: build-and-release
140
+ if: needs.build-and-release.outputs.publish == 'true' && needs.build-and-release.outputs.prerelease != 'true'
141
+ runs-on: ubuntu-latest
142
+ environment: pypi
143
+ permissions:
144
+ id-token: write
145
+ steps:
146
+ - name: Download distribution packages
147
+ uses: actions/download-artifact@v7
148
+ with:
149
+ name: dist-packages
150
+ path: dist
151
+ - name: Publish to PyPI via Trusted Publishing
152
+ uses: pypa/gh-action-pypi-publish@release/v1
153
+ with:
154
+ attestations: true
155
+
156
+ smoke-test:
157
+ needs: [build-and-release, publish-pypi]
158
+ if: needs.build-and-release.outputs.publish == 'true' && needs.build-and-release.outputs.prerelease != 'true'
159
+ runs-on: ubuntu-latest
160
+ steps:
161
+ - uses: astral-sh/setup-uv@v7
162
+ - name: Verify package installation and breaker trip from PyPI
163
+ env:
164
+ TARGET_VERSION: ${{ needs.build-and-release.outputs.version }}
165
+ run: |
166
+ mkdir /tmp/smoke-test
167
+ cd /tmp/smoke-test
168
+ uv venv .venv --python 3.12
169
+ echo "Waiting for longguard==$TARGET_VERSION to propagate on PyPI index..."
170
+ INSTALLED=false
171
+ for attempt in $(seq 1 6); do
172
+ echo "Attempt $attempt: pip install longguard==$TARGET_VERSION"
173
+ if uv pip install --python .venv/bin/python --no-cache "longguard==$TARGET_VERSION"; then
174
+ INSTALLED=true
175
+ break
176
+ fi
177
+ sleep 15
178
+ done
179
+ if [ "$INSTALLED" != "true" ]; then
180
+ echo "Failed to install longguard==$TARGET_VERSION from PyPI within timeout"
181
+ exit 1
182
+ fi
183
+ .venv/bin/python -c "
184
+ import longguard
185
+ from longguard import CircuitBreaker, GuardConfig, AgentStep
186
+ assert longguard.__version__ == '$TARGET_VERSION', f'Version mismatch: {longguard.__version__} != $TARGET_VERSION'
187
+ breaker = CircuitBreaker(GuardConfig(tool_repeat_threshold=2, max_reflections=1))
188
+ step = AgentStep(step_number=1, thought='loop', action='search', action_input={'q': 'x'}, observation='none')
189
+ d1 = breaker.check(step)
190
+ d2 = breaker.check(step)
191
+ assert d2.action in ('reflect', 'kill'), f'Expected trip, got {d2.action}'
192
+ print('Post-publish smoke test PASSED for longguard', longguard.__version__)
193
+ "
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.2.2] - 2026-11-10
11
+
12
+ ### Added
13
+
14
+ - Tag-driven GitHub Actions release pipeline with PyPI Trusted Publishing (OIDC), digital build provenance attestations, and post-publish clean virtual environment smoke testing.
15
+ - Distribution and version consistency validation (`scripts/check_version.py` and `tests/test_check_version.py`) verifying parity between `pyproject.toml`, `src/longguard/__init__.py`, `uv.lock`, and release distribution artifacts.
16
+ - Twine metadata verification (`twine check --strict`) and built wheel/sdist contents audit integrated into release verification and CI gates.
17
+
18
+ ### Changed
19
+
20
+ - Documentation limits: Added an explicit "Compatibility & Known Limits" section to README and docs documenting runtime boundaries for guarded graph resume, CrewAI sequential ReAct execution, and detector cost estimation.
21
+ - Clarified "LongGuard vs. LangGraph recursion_limit" comparison table to state synchronous same-process support for graph resume.
22
+ - Strict documentation build (`mkdocs build --strict`) enforced in standard pull request CI.
23
+
24
+ ### Compatibility and limits
25
+
26
+ - No runtime change: detectors, circuit breaker state machine, defaults, budget boundaries, and report schemas are identical to 0.2.0.
27
+
10
28
  ## [0.2.1] - 2026-11-09
11
29
 
12
30
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: longguard
3
- Version: 0.2.1.dev0
3
+ Version: 0.2.2
4
4
  Summary: Circuit breaker middleware for LangGraph/LangChain agents — detect loops, inject Reflect & Pivot, prevent runaway costs
5
5
  Project-URL: Homepage, https://github.com/ENDEVSOLS/LongGuard
6
6
  Project-URL: Repository, https://github.com/ENDEVSOLS/LongGuard
@@ -44,6 +44,7 @@ Requires-Dist: pytest-asyncio>=1.0.0; extra == 'dev'
44
44
  Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
45
45
  Requires-Dist: pytest>=8.0.0; extra == 'dev'
46
46
  Requires-Dist: ruff>=0.5.0; extra == 'dev'
47
+ Requires-Dist: twine>=5.0.0; extra == 'dev'
47
48
  Provides-Extra: docs
48
49
  Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
49
50
  Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
@@ -103,22 +104,6 @@ LangGraph's built-in `recursion_limit` is a **hard crash** (`GraphRecursionError
103
104
 
104
105
  ---
105
106
 
106
- <a id="part-of-the-long-suite"></a>
107
- ## 🌐 Part of the Long Suite
108
-
109
- LongGuard is part of the **[EnDevSols Long Suite](https://endevsols.com/open-source)** of open-source production AI tools:
110
-
111
- - **[LongParser](https://github.com/ENDEVSOLS/LongParser)** — High-speed, privacy-first local document ingestion & chunking (PDF, DOCX, PPTX, XLSX)
112
- - **[LongTrainer](https://github.com/ENDEVSOLS/Long-Trainer)** — Production multi-tenant RAG chatbot and agent framework
113
- - **[LongCache](https://github.com/ENDEVSOLS/LongCache)** — Production semantic similarity caching for LLM and RAG pipelines
114
- - **[LongTracer](https://github.com/ENDEVSOLS/LongTracer)** — Post-generation hallucination detection via hybrid STS + NLI claim verification
115
- - **[LongProbe](https://github.com/ENDEVSOLS/LongProbe)** — Sub-second RAG retrieval regression testing with pytest
116
- - **[LongGuard](https://github.com/ENDEVSOLS/LongGuard)** — **In-flight runtime agent circuit breaker & reasoning loop recovery** ← *You are here*
117
-
118
- Together, the Long Suite covers the full AI lifecycle from data ingestion and retrieval CI regression to runtime agent safety and post-generation verification.
119
-
120
- ---
121
-
122
107
  <a id="why-longguard"></a>
123
108
  ## 💡 Why LongGuard?
124
109
 
@@ -351,13 +336,27 @@ print(breaker.report.summary())
351
336
  | **Detects Semantic Reasoning Loops** | ❌ No | ✅ **Yes** |
352
337
  | **Detects Sudden Cost / Token Spikes** | ❌ No | ✅ **Yes** |
353
338
  | **Auto-Injects Recovery Prompts** | ❌ No | ✅ **Yes** |
354
- | **Safe Graph Resume (no tool replay)** | ❌ No | ✅ **Yes** |
339
+ | **Safe Graph Resume (no tool replay)** | ❌ No | ✅ **Yes** *(sync, same-process)* |
355
340
  | **Exit Behavior** | 💥 Unhandled Exception (`Crash`) | 🛡️ **Graceful State Preservation** |
356
341
  | **Run Reporting & Telemetry** | ❌ No | ✅ **JSON & Summary Reports** |
357
342
  | **Configurable Thresholds** | ❌ Single integer | ✅ **Granular `GuardConfig`** |
358
343
 
359
344
  ---
360
345
 
346
+ <a id="compatibility-and-limits"></a>
347
+ ## ⚠️ Compatibility & Known Limits
348
+
349
+ LongGuard runtime contracts are tested and verified under specific execution boundaries:
350
+
351
+ - **Guarded LangGraph Resume (`compile_guarded_graph` / `GuardedGraph.resume`):** Supports explicit continuation for synchronous two-node graphs (`START -> agent -> tools/END`, `tools -> agent`) within the same controller process using `InMemorySaver`. Async graphs, streaming, subgraphs, parallel tool dispatch, namespaces, and distributed checkpoint continuation are outside current support.
352
+ - **CrewAI Execution (`add_guard_to_crew`):** Explicitly bounded to the tested sequential, synchronous ReAct `CrewAgentExecutor`. Async, hierarchical, batch, planning, memory, or native tool-batch modes fail clearly; callback-only `CrewGuard` remains available.
353
+ - **Detector Evaluation & Cost Tracking:** Held-out detector evaluation metrics are provisional. Dollar cost estimation applies a 50/50 input/output token split when provider-specific token breakdowns are unavailable and is not an invoice billing guarantee.
354
+ - **Non-Invasive Telemetry:** Telemetry reports and checkpoints record execution history; they do not authorize replay or modify external service state.
355
+
356
+ See the full [Tested Compatibility Guide](https://endevsols.github.io/LongGuard/guides/compatibility/) for complete version matrices and verification details.
357
+
358
+ ---
359
+
361
360
  <a id="configuration"></a>
362
361
  ## ⚙️ Configuration at a Glance
363
362
 
@@ -388,6 +387,23 @@ config = GuardConfig(
388
387
 
389
388
  👉 *For detailed documentation on custom detectors, embedding backends, and LangSmith telemetry, see the [Full Documentation](https://endevsols.github.io/LongGuard/).*
390
389
 
390
+ ---
391
+
392
+ ## Part of the Long Suite
393
+
394
+ LongGuard is part of the **Long Suite** — a collection of tools for building, testing, and monitoring production RAG systems.
395
+
396
+ | Project | Description |
397
+ |---|---|
398
+ | **[LongParser](https://github.com/ENDEVSOLS/LongParser)** | Document ingestion and chunking |
399
+ | **[LongTrainer](https://github.com/ENDEVSOLS/Long-Trainer)** | RAG chatbot framework |
400
+ | **[LongGuard](https://github.com/ENDEVSOLS/LongGuard)** | In-flight circuit breaker and reasoning loop recovery for agents *(you are here)* |
401
+ | **[LongCache](https://github.com/ENDEVSOLS/LongCache)** | Semantic similarity cache for LLM and RAG pipelines |
402
+ | **[LongTracer](https://github.com/ENDEVSOLS/LongTracer)** | Hallucination detection and tracing |
403
+ | **[LongProbe](https://github.com/ENDEVSOLS/LongProbe)** | Retrieval regression testing |
404
+
405
+ ---
406
+
391
407
  ## 🤝 Contributing
392
408
 
393
409
  Contributions are welcome! Please see [CONTRIBUTING.md](https://github.com/ENDEVSOLS/LongGuard/blob/main/CONTRIBUTING.md) for guidelines on code formatting, running tests, and opening pull requests.
@@ -43,22 +43,6 @@ LangGraph's built-in `recursion_limit` is a **hard crash** (`GraphRecursionError
43
43
 
44
44
  ---
45
45
 
46
- <a id="part-of-the-long-suite"></a>
47
- ## 🌐 Part of the Long Suite
48
-
49
- LongGuard is part of the **[EnDevSols Long Suite](https://endevsols.com/open-source)** of open-source production AI tools:
50
-
51
- - **[LongParser](https://github.com/ENDEVSOLS/LongParser)** — High-speed, privacy-first local document ingestion & chunking (PDF, DOCX, PPTX, XLSX)
52
- - **[LongTrainer](https://github.com/ENDEVSOLS/Long-Trainer)** — Production multi-tenant RAG chatbot and agent framework
53
- - **[LongCache](https://github.com/ENDEVSOLS/LongCache)** — Production semantic similarity caching for LLM and RAG pipelines
54
- - **[LongTracer](https://github.com/ENDEVSOLS/LongTracer)** — Post-generation hallucination detection via hybrid STS + NLI claim verification
55
- - **[LongProbe](https://github.com/ENDEVSOLS/LongProbe)** — Sub-second RAG retrieval regression testing with pytest
56
- - **[LongGuard](https://github.com/ENDEVSOLS/LongGuard)** — **In-flight runtime agent circuit breaker & reasoning loop recovery** ← *You are here*
57
-
58
- Together, the Long Suite covers the full AI lifecycle from data ingestion and retrieval CI regression to runtime agent safety and post-generation verification.
59
-
60
- ---
61
-
62
46
  <a id="why-longguard"></a>
63
47
  ## 💡 Why LongGuard?
64
48
 
@@ -291,13 +275,27 @@ print(breaker.report.summary())
291
275
  | **Detects Semantic Reasoning Loops** | ❌ No | ✅ **Yes** |
292
276
  | **Detects Sudden Cost / Token Spikes** | ❌ No | ✅ **Yes** |
293
277
  | **Auto-Injects Recovery Prompts** | ❌ No | ✅ **Yes** |
294
- | **Safe Graph Resume (no tool replay)** | ❌ No | ✅ **Yes** |
278
+ | **Safe Graph Resume (no tool replay)** | ❌ No | ✅ **Yes** *(sync, same-process)* |
295
279
  | **Exit Behavior** | 💥 Unhandled Exception (`Crash`) | 🛡️ **Graceful State Preservation** |
296
280
  | **Run Reporting & Telemetry** | ❌ No | ✅ **JSON & Summary Reports** |
297
281
  | **Configurable Thresholds** | ❌ Single integer | ✅ **Granular `GuardConfig`** |
298
282
 
299
283
  ---
300
284
 
285
+ <a id="compatibility-and-limits"></a>
286
+ ## ⚠️ Compatibility & Known Limits
287
+
288
+ LongGuard runtime contracts are tested and verified under specific execution boundaries:
289
+
290
+ - **Guarded LangGraph Resume (`compile_guarded_graph` / `GuardedGraph.resume`):** Supports explicit continuation for synchronous two-node graphs (`START -> agent -> tools/END`, `tools -> agent`) within the same controller process using `InMemorySaver`. Async graphs, streaming, subgraphs, parallel tool dispatch, namespaces, and distributed checkpoint continuation are outside current support.
291
+ - **CrewAI Execution (`add_guard_to_crew`):** Explicitly bounded to the tested sequential, synchronous ReAct `CrewAgentExecutor`. Async, hierarchical, batch, planning, memory, or native tool-batch modes fail clearly; callback-only `CrewGuard` remains available.
292
+ - **Detector Evaluation & Cost Tracking:** Held-out detector evaluation metrics are provisional. Dollar cost estimation applies a 50/50 input/output token split when provider-specific token breakdowns are unavailable and is not an invoice billing guarantee.
293
+ - **Non-Invasive Telemetry:** Telemetry reports and checkpoints record execution history; they do not authorize replay or modify external service state.
294
+
295
+ See the full [Tested Compatibility Guide](https://endevsols.github.io/LongGuard/guides/compatibility/) for complete version matrices and verification details.
296
+
297
+ ---
298
+
301
299
  <a id="configuration"></a>
302
300
  ## ⚙️ Configuration at a Glance
303
301
 
@@ -328,6 +326,23 @@ config = GuardConfig(
328
326
 
329
327
  👉 *For detailed documentation on custom detectors, embedding backends, and LangSmith telemetry, see the [Full Documentation](https://endevsols.github.io/LongGuard/).*
330
328
 
329
+ ---
330
+
331
+ ## Part of the Long Suite
332
+
333
+ LongGuard is part of the **Long Suite** — a collection of tools for building, testing, and monitoring production RAG systems.
334
+
335
+ | Project | Description |
336
+ |---|---|
337
+ | **[LongParser](https://github.com/ENDEVSOLS/LongParser)** | Document ingestion and chunking |
338
+ | **[LongTrainer](https://github.com/ENDEVSOLS/Long-Trainer)** | RAG chatbot framework |
339
+ | **[LongGuard](https://github.com/ENDEVSOLS/LongGuard)** | In-flight circuit breaker and reasoning loop recovery for agents *(you are here)* |
340
+ | **[LongCache](https://github.com/ENDEVSOLS/LongCache)** | Semantic similarity cache for LLM and RAG pipelines |
341
+ | **[LongTracer](https://github.com/ENDEVSOLS/LongTracer)** | Hallucination detection and tracing |
342
+ | **[LongProbe](https://github.com/ENDEVSOLS/LongProbe)** | Retrieval regression testing |
343
+
344
+ ---
345
+
331
346
  ## 🤝 Contributing
332
347
 
333
348
  Contributions are welcome! Please see [CONTRIBUTING.md](https://github.com/ENDEVSOLS/LongGuard/blob/main/CONTRIBUTING.md) for guidelines on code formatting, running tests, and opening pull requests.
@@ -1,6 +1,6 @@
1
1
  # Tested execution and compatibility
2
2
 
3
- The `0.2.0.dev0` preview extends the existing circuit breaker. Package dependency minimums
3
+ LongGuard 0.2.x extends the existing circuit breaker. Package dependency minimums
4
4
  remain unchanged; they do not guarantee that every permitted framework release supports
5
5
  these execution contracts. Bare `import longguard` keeps framework dependencies optional.
6
6
 
@@ -47,6 +47,9 @@ CLOSED ──(loop detected)──▶ REFLECTING ──(persists)──▶ HALF_
47
47
 
48
48
  ---
49
49
 
50
+ !!! warning "Runtime Boundaries & Known Limits"
51
+ LongGuard contracts are tested for synchronous execution boundaries (synchronous same-process LangGraph resume and sequential ReAct CrewAI execution). Review the full [Tested Compatibility & Limits Guide](guides/compatibility.md) for detailed runtime boundaries and usage side effects.
52
+
50
53
  ## 30-Second Example (LangGraph)
51
54
 
52
55
  LongGuard wraps your agent nodes in a single line of code:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "longguard"
7
- version = "0.2.1.dev0"
7
+ version = "0.2.2"
8
8
  description = "Circuit breaker middleware for LangGraph/LangChain agents — detect loops, inject Reflect & Pivot, prevent runaway costs"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -86,6 +86,7 @@ dev = [
86
86
  "mypy>=1.5.0,<2.0.0",
87
87
  "mkdocs>=1.5.0",
88
88
  "mkdocs-material>=9.5.0",
89
+ "twine>=5.0.0",
89
90
  ]
90
91
 
91
92
  [tool.hatch.build.targets.wheel]