Skip to content

Commit fc6ad34

Browse files
Merge pull request #22 from Helixar-AI/feat/llamaindex-integration
feat: add llama-index-callbacks-hdp and hdp-llamaindex packages
2 parents 74cbb5d + 8721224 commit fc6ad34

22 files changed

Lines changed: 2274 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ jobs:
139139
strategy:
140140
matrix:
141141
python-version: ["3.10", "3.11", "3.12"]
142-
143142
steps:
144143
- uses: actions/checkout@v5
145144

@@ -156,6 +155,54 @@ jobs:
156155
working-directory: packages/hdp-langchain
157156
run: pytest tests/ -v
158157

158+
test-llama-index-callbacks-hdp:
159+
name: Test llama-index-callbacks-hdp (Python ${{ matrix.python-version }})
160+
runs-on: ubuntu-latest
161+
strategy:
162+
matrix:
163+
python-version: ["3.10", "3.11", "3.12"]
164+
steps:
165+
- uses: actions/checkout@v5
166+
167+
- name: Set up Python ${{ matrix.python-version }}
168+
uses: actions/setup-python@v5
169+
with:
170+
python-version: ${{ matrix.python-version }}
171+
172+
- name: Install dependencies
173+
working-directory: packages/llama-index-callbacks-hdp
174+
run: pip install -e ".[dev]"
175+
176+
- name: Run tests
177+
working-directory: packages/llama-index-callbacks-hdp
178+
run: pytest tests/ -v
179+
180+
test-hdp-llamaindex:
181+
name: Test hdp-llamaindex (Python ${{ matrix.python-version }})
182+
runs-on: ubuntu-latest
183+
needs: test-llama-index-callbacks-hdp
184+
strategy:
185+
matrix:
186+
python-version: ["3.10", "3.11", "3.12"]
187+
steps:
188+
- uses: actions/checkout@v5
189+
190+
- name: Set up Python ${{ matrix.python-version }}
191+
uses: actions/setup-python@v5
192+
with:
193+
python-version: ${{ matrix.python-version }}
194+
195+
- name: Install primary package
196+
working-directory: packages/llama-index-callbacks-hdp
197+
run: pip install -e ".[dev]"
198+
199+
- name: Install metapackage
200+
working-directory: packages/hdp-llamaindex
201+
run: pip install -e .
202+
203+
- name: Verify metapackage imports
204+
run: python -c "from hdp_llamaindex import HdpCallbackHandler, HdpInstrumentationHandler, HdpNodePostprocessor, verify_chain; print('hdp-llamaindex imports OK')"
205+
159206
test-hdp-physical-py:
160207
name: Test hdp-physical-py (Python ${{ matrix.python-version }})
161208
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
- 'python/hdp-langchain/v*'
1010
- 'python/hdp-autogen/v*'
1111
- 'python/hdp-physical/v*'
12+
- 'python/llama-index-callbacks-hdp/v*'
13+
- 'python/hdp-llamaindex/v*'
1214
- 'node/hdp-autogen/v*'
1315
- 'node/hdp-physical/v*'
1416

@@ -707,6 +709,169 @@ jobs:
707709
packages-dir: dist/
708710
skip-existing: true
709711

712+
# ── llama-index-callbacks-hdp ─────────────────────────────────────────────
713+
714+
test-llama-index-callbacks-hdp:
715+
name: Test llama-index-callbacks-hdp
716+
if: startsWith(github.ref, 'refs/tags/python/llama-index-callbacks-hdp/v')
717+
runs-on: ubuntu-latest
718+
steps:
719+
- uses: actions/checkout@v5
720+
721+
- name: Set up Python
722+
uses: actions/setup-python@v5
723+
with:
724+
python-version: '3.12'
725+
726+
- name: Install dependencies
727+
working-directory: packages/llama-index-callbacks-hdp
728+
run: pip install -e ".[dev]"
729+
730+
- name: Run tests
731+
working-directory: packages/llama-index-callbacks-hdp
732+
run: pytest tests/ -v
733+
734+
vet-llama-index-callbacks-hdp:
735+
name: Build & Vet llama-index-callbacks-hdp (ReleaseGuard)
736+
needs: test-llama-index-callbacks-hdp
737+
runs-on: ubuntu-latest
738+
steps:
739+
- uses: actions/checkout@v5
740+
741+
- name: Set up Python
742+
uses: actions/setup-python@v5
743+
with:
744+
python-version: '3.12'
745+
746+
- name: Install build tools
747+
run: pip install build
748+
749+
- name: Build distribution
750+
working-directory: packages/llama-index-callbacks-hdp
751+
run: python -m build
752+
753+
- name: Vet artifacts with ReleaseGuard
754+
uses: Helixar-AI/ReleaseGuard@94c067008f3ad516d4b61a6e7163d9d5518a4548
755+
with:
756+
path: packages/llama-index-callbacks-hdp/dist
757+
config: packages/llama-index-callbacks-hdp/.releaseguard.yml
758+
sbom: 'true'
759+
fix: 'true'
760+
format: sarif
761+
artifact-name: releaseguard-evidence-llama-index-callbacks-hdp
762+
763+
- name: Upload vetted distribution
764+
uses: actions/upload-artifact@v4
765+
with:
766+
name: llama-index-callbacks-hdp-dist
767+
path: packages/llama-index-callbacks-hdp/dist/
768+
retention-days: 1
769+
770+
publish-llama-index-callbacks-hdp:
771+
name: Publish llama-index-callbacks-hdp to PyPI
772+
needs: vet-llama-index-callbacks-hdp
773+
runs-on: ubuntu-latest
774+
permissions:
775+
contents: read
776+
id-token: write
777+
environment:
778+
name: pypi-llama-index-callbacks-hdp
779+
url: https://pypi.org/project/llama-index-callbacks-hdp/
780+
steps:
781+
- name: Download vetted distribution
782+
uses: actions/download-artifact@v4
783+
with:
784+
name: llama-index-callbacks-hdp-dist
785+
path: dist/
786+
787+
- name: Publish to PyPI
788+
uses: pypa/gh-action-pypi-publish@release/v1
789+
with:
790+
packages-dir: dist/
791+
792+
# ── hdp-llamaindex (metapackage) ───────────────────────────────────────────
793+
794+
test-hdp-llamaindex:
795+
name: Test hdp-llamaindex
796+
if: startsWith(github.ref, 'refs/tags/python/hdp-llamaindex/v')
797+
runs-on: ubuntu-latest
798+
steps:
799+
- uses: actions/checkout@v5
800+
801+
- name: Set up Python
802+
uses: actions/setup-python@v5
803+
with:
804+
python-version: '3.12'
805+
806+
- name: Install primary package
807+
working-directory: packages/llama-index-callbacks-hdp
808+
run: pip install -e ".[dev]"
809+
810+
- name: Install metapackage
811+
working-directory: packages/hdp-llamaindex
812+
run: pip install -e .
813+
814+
- name: Verify metapackage imports
815+
run: python -c "from hdp_llamaindex import HdpCallbackHandler, HdpInstrumentationHandler, HdpNodePostprocessor, verify_chain; print('OK')"
816+
817+
vet-hdp-llamaindex:
818+
name: Build & Vet hdp-llamaindex (ReleaseGuard)
819+
needs: test-hdp-llamaindex
820+
runs-on: ubuntu-latest
821+
steps:
822+
- uses: actions/checkout@v5
823+
824+
- name: Set up Python
825+
uses: actions/setup-python@v5
826+
with:
827+
python-version: '3.12'
828+
829+
- name: Install build tools
830+
run: pip install build
831+
832+
- name: Build distribution
833+
working-directory: packages/hdp-llamaindex
834+
run: python -m build
835+
836+
- name: Vet artifacts with ReleaseGuard
837+
uses: Helixar-AI/ReleaseGuard@94c067008f3ad516d4b61a6e7163d9d5518a4548
838+
with:
839+
path: packages/hdp-llamaindex/dist
840+
config: packages/hdp-llamaindex/.releaseguard.yml
841+
sbom: 'true'
842+
fix: 'true'
843+
format: sarif
844+
artifact-name: releaseguard-evidence-hdp-llamaindex
845+
846+
- name: Upload vetted distribution
847+
uses: actions/upload-artifact@v4
848+
with:
849+
name: hdp-llamaindex-dist
850+
path: packages/hdp-llamaindex/dist/
851+
retention-days: 1
852+
853+
publish-hdp-llamaindex:
854+
name: Publish hdp-llamaindex to PyPI
855+
needs: vet-hdp-llamaindex
856+
runs-on: ubuntu-latest
857+
permissions:
858+
contents: read
859+
id-token: write
860+
environment:
861+
name: pypi-hdp-llamaindex
862+
url: https://pypi.org/project/hdp-llamaindex/
863+
steps:
864+
- name: Download vetted distribution
865+
uses: actions/download-artifact@v4
866+
with:
867+
name: hdp-llamaindex-dist
868+
path: dist/
869+
870+
- name: Publish to PyPI
871+
uses: pypa/gh-action-pypi-publish@release/v1
872+
with:
873+
packages-dir: dist/
874+
710875
# ── hdp-physical (TypeScript) ─────────────────────────────────────────────
711876

712877
test-hdp-physical:
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# ReleaseGuard policy for hdp-llamaindex Python artifacts
2+
# https://github.com/Helixar-AI/ReleaseGuard
3+
#
4+
# Scans the built wheel and sdist before they are published to PyPI.
5+
# Run locally: releaseguard check ./dist
6+
version: 2
7+
8+
project:
9+
name: hdp-llamaindex
10+
mode: release
11+
12+
inputs:
13+
- path: ./dist
14+
type: directory
15+
16+
sbom:
17+
enabled: true
18+
ecosystems: [python]
19+
formats: [cyclonedx]
20+
enrich_cve: false
21+
22+
scanning:
23+
secrets:
24+
enabled: true
25+
metadata:
26+
enabled: true
27+
fail_on_source_maps: false
28+
fail_on_internal_urls: false
29+
fail_on_build_paths: false
30+
unexpected_files:
31+
enabled: true
32+
deny:
33+
- ".env"
34+
- "*.bak"
35+
- "*.tmp"
36+
- "*.key"
37+
- "*.pem"
38+
licenses:
39+
enabled: true
40+
require:
41+
- LICENSE
42+
43+
transforms:
44+
add_checksums: false
45+
add_manifest: false
46+
47+
policy:
48+
fail_on:
49+
- severity: critical
50+
- category: secret
51+
warn_on:
52+
- severity: high
53+
54+
output:
55+
reports:
56+
- cli
57+
- sarif
58+
directory: ./.releaseguard

packages/hdp-llamaindex/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# hdp-llamaindex
2+
3+
Metapackage for users who discover HDP first.
4+
5+
```bash
6+
pip install hdp-llamaindex
7+
```
8+
9+
This installs `llama-index-callbacks-hdp` and re-exports all classes from the `hdp_llamaindex` namespace.
10+
11+
For full documentation see [llama-index-callbacks-hdp](../llama-index-callbacks-hdp/README.md).
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "hdp-llamaindex"
7+
version = "0.1.0"
8+
description = "HDP (Human Delegation Provenance) integration for LlamaIndex — metapackage"
9+
readme = "README.md"
10+
license = { text = "CC-BY-4.0" }
11+
requires-python = ">=3.10"
12+
dependencies = [
13+
"llama-index-callbacks-hdp>=0.1.0",
14+
]
15+
16+
[project.urls]
17+
Homepage = "https://github.com/Helixar-AI/HDP"
18+
Repository = "https://github.com/Helixar-AI/HDP"
19+
20+
[tool.hatch.build.targets.wheel]
21+
packages = ["src/hdp_llamaindex"]
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"""hdp-llamaindex — convenience re-export of the HDP LlamaIndex integration.
2+
3+
Install via `pip install hdp-llamaindex` if you discover HDP first.
4+
All classes are importable from here or from `llama_index.callbacks.hdp`.
5+
"""
6+
7+
from llama_index.callbacks.hdp import (
8+
DataClassification,
9+
HdpCallbackHandler,
10+
HdpInstrumentationHandler,
11+
HdpNodePostprocessor,
12+
HdpPrincipal,
13+
HdpScope,
14+
HdpToken,
15+
HDPScopeViolationError,
16+
HopRecord,
17+
HopVerification,
18+
ScopePolicy,
19+
VerificationResult,
20+
clear_token,
21+
get_token,
22+
set_token,
23+
verify_chain,
24+
)
25+
26+
__all__ = [
27+
"DataClassification",
28+
"HdpCallbackHandler",
29+
"HdpInstrumentationHandler",
30+
"HdpNodePostprocessor",
31+
"HdpPrincipal",
32+
"HdpScope",
33+
"HdpToken",
34+
"HDPScopeViolationError",
35+
"HopRecord",
36+
"HopVerification",
37+
"ScopePolicy",
38+
"VerificationResult",
39+
"clear_token",
40+
"get_token",
41+
"set_token",
42+
"verify_chain",
43+
]

0 commit comments

Comments
 (0)