loomgraph 0.11.1__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.
- loomgraph-0.11.1/.claude/skills/loomgraph.md +126 -0
- loomgraph-0.11.1/.codeindex.yaml +35 -0
- loomgraph-0.11.1/.github/workflows/incremental-update.yml +71 -0
- loomgraph-0.11.1/.github/workflows/release.yml +128 -0
- loomgraph-0.11.1/.github/workflows/test.yml +40 -0
- loomgraph-0.11.1/.gitignore +132 -0
- loomgraph-0.11.1/.loomgraph.example.yaml +27 -0
- loomgraph-0.11.1/CHANGELOG.md +439 -0
- loomgraph-0.11.1/CLAUDE.md +676 -0
- loomgraph-0.11.1/CODEINDEX.md +91 -0
- loomgraph-0.11.1/LICENSE +21 -0
- loomgraph-0.11.1/Makefile +282 -0
- loomgraph-0.11.1/PKG-INFO +226 -0
- loomgraph-0.11.1/README.md +178 -0
- loomgraph-0.11.1/docker-compose.yml +23 -0
- loomgraph-0.11.1/docs/AGILE_GUIDE.md +271 -0
- loomgraph-0.11.1/docs/DOGFOODING_EPIC010.md +266 -0
- loomgraph-0.11.1/docs/PACKAGING.md +392 -0
- loomgraph-0.11.1/docs/ROADMAP.md +419 -0
- loomgraph-0.11.1/docs/adr/ADR-001-postgresql-unified-storage.md +86 -0
- loomgraph-0.11.1/docs/adr/ADR-002-lightrag-framework.md +112 -0
- loomgraph-0.11.1/docs/adr/ADR-003-code-parser-strategy.md +95 -0
- loomgraph-0.11.1/docs/adr/ADR-004-lightrag-fork-strategy.md +223 -0
- loomgraph-0.11.1/docs/adr/ADR-005-extraction-strategy.md +167 -0
- loomgraph-0.11.1/docs/adr/ADR-006-mvp-simplification.md +119 -0
- loomgraph-0.11.1/docs/adr/ADR-007-code-content-extraction.md +247 -0
- loomgraph-0.11.1/docs/adr/ADR-008-bidirectional-orchestrator.md +113 -0
- loomgraph-0.11.1/docs/adr/ADR-009-workspace-as-knowledge-snapshot.md +191 -0
- loomgraph-0.11.1/docs/adr/ADR-010-search-architecture-redesign.md +156 -0
- loomgraph-0.11.1/docs/adr/ADR-011-ai-iteration-strategy.md +465 -0
- loomgraph-0.11.1/docs/adr/ADR-012-technical-debt-analysis-format.md +641 -0
- loomgraph-0.11.1/docs/adr/ADR-013-git-knowledge-graph-integration.md +391 -0
- loomgraph-0.11.1/docs/adr/ADR-013-sqlite-vec-replace-lightrag.md +179 -0
- loomgraph-0.11.1/docs/api/CLI_DESIGN.md +600 -0
- loomgraph-0.11.1/docs/api/DATA_CONTRACT.md +400 -0
- loomgraph-0.11.1/docs/api/LIGHTRAG_INTEGRATION.md +163 -0
- loomgraph-0.11.1/docs/architecture/FEATURE_BOUNDARY.md +280 -0
- loomgraph-0.11.1/docs/architecture/SYSTEM_DESIGN.md +416 -0
- loomgraph-0.11.1/docs/architecture/UPDATE_STRATEGY.md +270 -0
- loomgraph-0.11.1/docs/debt-analysis-2026-03-06.md +250 -0
- loomgraph-0.11.1/docs/guides/CUSTOMER_PACKAGING.md +296 -0
- loomgraph-0.11.1/docs/guides/CUSTOMER_QUICKSTART.md +477 -0
- loomgraph-0.11.1/docs/guides/DEBT_REPORT_FORMAT.md +524 -0
- loomgraph-0.11.1/docs/guides/TOKEN_MANAGEMENT.md +440 -0
- loomgraph-0.11.1/docs/guides/TOKEN_QUICKSTART.md +210 -0
- loomgraph-0.11.1/docs/guides/github-action-integration.md +201 -0
- loomgraph-0.11.1/docs/guides/migration-v0.10.md +196 -0
- loomgraph-0.11.1/docs/images/Screenshot 2026-02-06 at 08.45.11.png +0 -0
- loomgraph-0.11.1/docs/images/Screenshot 2026-02-06 at 08.45.18.png +0 -0
- loomgraph-0.11.1/docs/images/Screenshot 2026-02-06 at 09.59.15.png +0 -0
- loomgraph-0.11.1/docs/schemas/debt-report-v1.schema.json +415 -0
- loomgraph-0.11.1/docs/templates/debt-report.md.template +275 -0
- loomgraph-0.11.1/feedback-v0.2.0.md +379 -0
- loomgraph-0.11.1/pyproject.toml +176 -0
- loomgraph-0.11.1/scripts/bench_backends.py +227 -0
- loomgraph-0.11.1/scripts/bump_version.py +204 -0
- loomgraph-0.11.1/scripts/check_version.py +68 -0
- loomgraph-0.11.1/scripts/diff_backends.py +257 -0
- loomgraph-0.11.1/scripts/generate_delivery_summary.py +307 -0
- loomgraph-0.11.1/scripts/hooks/post-commit +87 -0
- loomgraph-0.11.1/scripts/manage_tokens.py +326 -0
- loomgraph-0.11.1/scripts/quickstart.sh +158 -0
- loomgraph-0.11.1/scripts/upgrade.sh +140 -0
- loomgraph-0.11.1/scripts/verify_insert_custom_kg.py +182 -0
- loomgraph-0.11.1/skills/loomgraph-debt-radar/SKILL.md +506 -0
- loomgraph-0.11.1/skills/loomgraph-evolution/SKILL.md +216 -0
- loomgraph-0.11.1/skills/loomgraph-init/SKILL.md +57 -0
- loomgraph-0.11.1/skills/loomgraph-setup/SKILL.md +233 -0
- loomgraph-0.11.1/skills/loomgraph-sync-advisor/SKILL.md +531 -0
- loomgraph-0.11.1/src/loomgraph/__init__.py +40 -0
- loomgraph-0.11.1/src/loomgraph/chunking/__init__.py +1 -0
- loomgraph-0.11.1/src/loomgraph/cli/__init__.py +5 -0
- loomgraph-0.11.1/src/loomgraph/cli/_analysis.py +488 -0
- loomgraph-0.11.1/src/loomgraph/cli/_common.py +278 -0
- loomgraph-0.11.1/src/loomgraph/cli/_debt.py +281 -0
- loomgraph-0.11.1/src/loomgraph/cli/_deps_check.py +76 -0
- loomgraph-0.11.1/src/loomgraph/cli/_hooks.py +221 -0
- loomgraph-0.11.1/src/loomgraph/cli/_indexing.py +835 -0
- loomgraph-0.11.1/src/loomgraph/cli/_search.py +304 -0
- loomgraph-0.11.1/src/loomgraph/cli/_setup.py +195 -0
- loomgraph-0.11.1/src/loomgraph/cli/_workspace.py +197 -0
- loomgraph-0.11.1/src/loomgraph/cli/main.py +54 -0
- loomgraph-0.11.1/src/loomgraph/core/__init__.py +65 -0
- loomgraph-0.11.1/src/loomgraph/core/adapter.py +78 -0
- loomgraph-0.11.1/src/loomgraph/core/compare.py +168 -0
- loomgraph-0.11.1/src/loomgraph/core/config.py +255 -0
- loomgraph-0.11.1/src/loomgraph/core/debt_analyzer.py +855 -0
- loomgraph-0.11.1/src/loomgraph/core/deps.py +159 -0
- loomgraph-0.11.1/src/loomgraph/core/git.py +229 -0
- loomgraph-0.11.1/src/loomgraph/core/git_metrics.py +228 -0
- loomgraph-0.11.1/src/loomgraph/core/git_parser.py +253 -0
- loomgraph-0.11.1/src/loomgraph/core/impact/__init__.py +33 -0
- loomgraph-0.11.1/src/loomgraph/core/impact/analyzer.py +354 -0
- loomgraph-0.11.1/src/loomgraph/core/impact/extractor.py +244 -0
- loomgraph-0.11.1/src/loomgraph/core/impact/git_parser.py +175 -0
- loomgraph-0.11.1/src/loomgraph/core/impact/models.py +120 -0
- loomgraph-0.11.1/src/loomgraph/core/impact/risk.py +238 -0
- loomgraph-0.11.1/src/loomgraph/core/indexer.py +277 -0
- loomgraph-0.11.1/src/loomgraph/core/injector.py +335 -0
- loomgraph-0.11.1/src/loomgraph/core/mapper.py +257 -0
- loomgraph-0.11.1/src/loomgraph/core/models.py +311 -0
- loomgraph-0.11.1/src/loomgraph/core/overview.py +149 -0
- loomgraph-0.11.1/src/loomgraph/core/similar.py +121 -0
- loomgraph-0.11.1/src/loomgraph/core/topology.py +695 -0
- loomgraph-0.11.1/src/loomgraph/core/trends.py +438 -0
- loomgraph-0.11.1/src/loomgraph/embedding/__init__.py +18 -0
- loomgraph-0.11.1/src/loomgraph/embedding/base.py +59 -0
- loomgraph-0.11.1/src/loomgraph/embedding/direct.py +127 -0
- loomgraph-0.11.1/src/loomgraph/graph/__init__.py +1 -0
- loomgraph-0.11.1/src/loomgraph/llm/__init__.py +17 -0
- loomgraph-0.11.1/src/loomgraph/llm/base.py +18 -0
- loomgraph-0.11.1/src/loomgraph/llm/direct.py +78 -0
- loomgraph-0.11.1/src/loomgraph/mcp/__init__.py +1 -0
- loomgraph-0.11.1/src/loomgraph/storage/__init__.py +18 -0
- loomgraph-0.11.1/src/loomgraph/storage/base.py +148 -0
- loomgraph-0.11.1/src/loomgraph/storage/factory.py +87 -0
- loomgraph-0.11.1/src/loomgraph/storage/sqlite_store.py +720 -0
- loomgraph-0.11.1/tests/__init__.py +1 -0
- loomgraph-0.11.1/tests/bdd/features/impact.feature +60 -0
- loomgraph-0.11.1/tests/conftest.py +57 -0
- loomgraph-0.11.1/tests/fixtures/codeindex-minimal.json +100 -0
- loomgraph-0.11.1/tests/fixtures/codeindex-output-v0.22.0.json +1441 -0
- loomgraph-0.11.1/tests/fixtures/codeindex-v0.22.0-output.json +61 -0
- loomgraph-0.11.1/tests/unit/__init__.py +1 -0
- loomgraph-0.11.1/tests/unit/test_cli.py +1588 -0
- loomgraph-0.11.1/tests/unit/test_compare.py +283 -0
- loomgraph-0.11.1/tests/unit/test_config.py +189 -0
- loomgraph-0.11.1/tests/unit/test_debt_analyzer.py +565 -0
- loomgraph-0.11.1/tests/unit/test_debt_analyzer_topology.py +407 -0
- loomgraph-0.11.1/tests/unit/test_debt_git_integration.py +336 -0
- loomgraph-0.11.1/tests/unit/test_deps.py +188 -0
- loomgraph-0.11.1/tests/unit/test_direct_embedding.py +157 -0
- loomgraph-0.11.1/tests/unit/test_direct_llm.py +117 -0
- loomgraph-0.11.1/tests/unit/test_git.py +215 -0
- loomgraph-0.11.1/tests/unit/test_git_metrics.py +317 -0
- loomgraph-0.11.1/tests/unit/test_git_parser.py +143 -0
- loomgraph-0.11.1/tests/unit/test_graph_store_contract.py +408 -0
- loomgraph-0.11.1/tests/unit/test_impact.py +432 -0
- loomgraph-0.11.1/tests/unit/test_indexer.py +257 -0
- loomgraph-0.11.1/tests/unit/test_injector.py +438 -0
- loomgraph-0.11.1/tests/unit/test_mapper.py +225 -0
- loomgraph-0.11.1/tests/unit/test_maybe_embed.py +117 -0
- loomgraph-0.11.1/tests/unit/test_overview.py +220 -0
- loomgraph-0.11.1/tests/unit/test_similar.py +232 -0
- loomgraph-0.11.1/tests/unit/test_sqlite_vec.py +294 -0
- loomgraph-0.11.1/tests/unit/test_storage_factory.py +108 -0
- loomgraph-0.11.1/tests/unit/test_topology.py +805 -0
- loomgraph-0.11.1/tests/unit/test_trends.py +350 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# LoomGraph Skill
|
|
2
|
+
|
|
3
|
+
Use this skill when users ask about code search, code understanding, finding function callers/callees, or indexing a codebase for semantic search.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
LoomGraph is a code intelligence engine that provides:
|
|
8
|
+
- **Code Indexing**: Parse code → Generate embeddings → Build knowledge graph
|
|
9
|
+
- **Semantic Search**: Find code by natural language queries
|
|
10
|
+
- **Graph Queries**: Find callers, callees, inheritance relationships
|
|
11
|
+
|
|
12
|
+
## Prerequisites
|
|
13
|
+
|
|
14
|
+
Before using LoomGraph commands, ensure dependencies are installed:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Check status
|
|
18
|
+
loomgraph status
|
|
19
|
+
|
|
20
|
+
# If codeindex is missing
|
|
21
|
+
pip install matrix-codeindex
|
|
22
|
+
|
|
23
|
+
# If database is not running
|
|
24
|
+
docker compose up -d postgres
|
|
25
|
+
|
|
26
|
+
# If embedding service is not running
|
|
27
|
+
docker compose up -d embedding
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Commands
|
|
31
|
+
|
|
32
|
+
### Index a Repository
|
|
33
|
+
|
|
34
|
+
**One-step (recommended for most cases)**:
|
|
35
|
+
```bash
|
|
36
|
+
loomgraph index /path/to/repo
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Step-by-step (for debugging or custom workflows)**:
|
|
40
|
+
```bash
|
|
41
|
+
# Step 1: Parse code with codeindex
|
|
42
|
+
codeindex scan /path/to/repo --output json > parse_results.json
|
|
43
|
+
|
|
44
|
+
# Step 2: Generate embeddings
|
|
45
|
+
loomgraph embed parse_results.json --output embeddings.json
|
|
46
|
+
|
|
47
|
+
# Step 3: Inject into graph database
|
|
48
|
+
loomgraph inject parse_results.json embeddings.json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Search Code
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Semantic search
|
|
55
|
+
loomgraph search "user authentication logic"
|
|
56
|
+
|
|
57
|
+
# With specific mode
|
|
58
|
+
loomgraph search "login function" --mode semantic --limit 5
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Query Call Graph
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Find who calls a function
|
|
65
|
+
loomgraph graph "UserService.login" --direction callers
|
|
66
|
+
|
|
67
|
+
# Find what a function calls
|
|
68
|
+
loomgraph graph "UserService.login" --direction callees
|
|
69
|
+
|
|
70
|
+
# Find inheritance
|
|
71
|
+
loomgraph graph "UserService" --relation-type INHERITS
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Output Format
|
|
75
|
+
|
|
76
|
+
All commands output JSON for easy parsing:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"success": true,
|
|
81
|
+
"data": { ... }
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Or on error:
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"success": false,
|
|
89
|
+
"error": {
|
|
90
|
+
"code": "ERROR_CODE",
|
|
91
|
+
"message": "Human readable message",
|
|
92
|
+
"suggestion": "How to fix it"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Error Recovery
|
|
98
|
+
|
|
99
|
+
When a command fails, read the error message and follow the suggestion:
|
|
100
|
+
|
|
101
|
+
| Error Code | Action |
|
|
102
|
+
|------------|--------|
|
|
103
|
+
| `CODEINDEX_NOT_FOUND` | `pip install matrix-codeindex` |
|
|
104
|
+
| `DATABASE_CONNECTION_FAILED` | `docker compose up -d postgres` |
|
|
105
|
+
| `EMBEDDING_SERVICE_UNAVAILABLE` | `docker compose up -d embedding` |
|
|
106
|
+
|
|
107
|
+
## Example Workflow
|
|
108
|
+
|
|
109
|
+
User asks: "Find all functions that call the login method"
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# 1. First, ensure the codebase is indexed
|
|
113
|
+
loomgraph status
|
|
114
|
+
|
|
115
|
+
# 2. If not indexed, index it
|
|
116
|
+
loomgraph index /path/to/repo
|
|
117
|
+
|
|
118
|
+
# 3. Query the call graph
|
|
119
|
+
loomgraph graph "login" --direction callers
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Documentation
|
|
123
|
+
|
|
124
|
+
- CLI Reference: `docs/api/CLI_DESIGN.md`
|
|
125
|
+
- System Design: `docs/architecture/SYSTEM_DESIGN.md`
|
|
126
|
+
- Data Contract: `docs/api/DATA_CONTRACT.md`
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# codeindex configuration
|
|
2
|
+
# Generated by Interactive Setup Wizard
|
|
3
|
+
|
|
4
|
+
version: 1
|
|
5
|
+
|
|
6
|
+
languages:
|
|
7
|
+
- python
|
|
8
|
+
|
|
9
|
+
include:
|
|
10
|
+
- src/
|
|
11
|
+
|
|
12
|
+
exclude:
|
|
13
|
+
- "**/*.pyc"
|
|
14
|
+
- "**/.eggs/**"
|
|
15
|
+
- "**/.git/**"
|
|
16
|
+
- "**/.pytest_cache/**"
|
|
17
|
+
- "**/.tox/**"
|
|
18
|
+
- "**/.venv/**"
|
|
19
|
+
- "**/__pycache__/**"
|
|
20
|
+
- "**/build/**"
|
|
21
|
+
- "**/dist/**"
|
|
22
|
+
- "**/node_modules/**"
|
|
23
|
+
- "**/tests/**"
|
|
24
|
+
- "**/venv/**"
|
|
25
|
+
|
|
26
|
+
# Performance settings
|
|
27
|
+
parallel_workers: 8
|
|
28
|
+
batch_size: 50
|
|
29
|
+
|
|
30
|
+
# Git Hooks configuration
|
|
31
|
+
hooks:
|
|
32
|
+
post_commit:
|
|
33
|
+
enabled: false
|
|
34
|
+
|
|
35
|
+
output_file: README_AI.md
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: Incremental Update (Reusable)
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
inputs:
|
|
6
|
+
lightrag_endpoint:
|
|
7
|
+
required: true
|
|
8
|
+
type: string
|
|
9
|
+
description: "LightRAG API endpoint URL"
|
|
10
|
+
embedding_endpoint:
|
|
11
|
+
required: true
|
|
12
|
+
type: string
|
|
13
|
+
description: "Embedding API endpoint URL"
|
|
14
|
+
working_directory:
|
|
15
|
+
required: false
|
|
16
|
+
type: string
|
|
17
|
+
default: '.'
|
|
18
|
+
description: "Working directory for the repository"
|
|
19
|
+
since:
|
|
20
|
+
required: false
|
|
21
|
+
type: string
|
|
22
|
+
default: 'HEAD~1'
|
|
23
|
+
description: "Git reference to compare from (default: HEAD~1)"
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
update:
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
steps:
|
|
29
|
+
- name: Checkout repository
|
|
30
|
+
uses: actions/checkout@v4
|
|
31
|
+
with:
|
|
32
|
+
fetch-depth: 2 # Need HEAD~1 to detect changes
|
|
33
|
+
|
|
34
|
+
- name: Set up Python
|
|
35
|
+
uses: actions/setup-python@v5
|
|
36
|
+
with:
|
|
37
|
+
python-version: '3.11'
|
|
38
|
+
|
|
39
|
+
- name: Install dependencies
|
|
40
|
+
run: |
|
|
41
|
+
python -m pip install --upgrade pip
|
|
42
|
+
pip install ai-codeindex loomgraph
|
|
43
|
+
|
|
44
|
+
- name: Detect changed files
|
|
45
|
+
id: changes
|
|
46
|
+
run: |
|
|
47
|
+
cd ${{ inputs.working_directory }}
|
|
48
|
+
codeindex affected --json --since ${{ inputs.since }} > changed.json
|
|
49
|
+
|
|
50
|
+
# Check if any files changed
|
|
51
|
+
CHANGED_COUNT=$(cat changed.json | jq -r '.affected_files | length')
|
|
52
|
+
echo "changed_count=$CHANGED_COUNT" >> $GITHUB_OUTPUT
|
|
53
|
+
|
|
54
|
+
if [ "$CHANGED_COUNT" -gt 0 ]; then
|
|
55
|
+
FILES=$(cat changed.json | jq -r '.affected_files[]' | tr '\n' ',' | sed 's/,$//')
|
|
56
|
+
echo "files=$FILES" >> $GITHUB_OUTPUT
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
- name: Incremental update
|
|
60
|
+
if: steps.changes.outputs.changed_count > 0
|
|
61
|
+
run: |
|
|
62
|
+
cd ${{ inputs.working_directory }}
|
|
63
|
+
loomgraph update \
|
|
64
|
+
--files "${{ steps.changes.outputs.files }}" \
|
|
65
|
+
--lightrag-url "${{ inputs.lightrag_endpoint }}" \
|
|
66
|
+
--embedding-url "${{ inputs.embedding_endpoint }}"
|
|
67
|
+
|
|
68
|
+
- name: No changes
|
|
69
|
+
if: steps.changes.outputs.changed_count == 0
|
|
70
|
+
run: |
|
|
71
|
+
echo "No code files changed. Skipping update."
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write # GitHub Release upload
|
|
10
|
+
id-token: write # PyPI Trusted Publisher (OIDC)
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
python-version: ["3.11", "3.12"]
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python-version }}
|
|
25
|
+
|
|
26
|
+
- name: Install uv
|
|
27
|
+
uses: astral-sh/setup-uv@v4
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
uv venv
|
|
32
|
+
uv pip install -e ".[dev]"
|
|
33
|
+
|
|
34
|
+
- name: Lint
|
|
35
|
+
run: |
|
|
36
|
+
source .venv/bin/activate
|
|
37
|
+
ruff check src/ tests/
|
|
38
|
+
|
|
39
|
+
- name: Unit tests
|
|
40
|
+
run: |
|
|
41
|
+
source .venv/bin/activate
|
|
42
|
+
pytest tests/unit/ -v --tb=short
|
|
43
|
+
|
|
44
|
+
build:
|
|
45
|
+
needs: test
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
outputs:
|
|
48
|
+
version: ${{ steps.version.outputs.VERSION }}
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@v4
|
|
51
|
+
|
|
52
|
+
- name: Set up Python
|
|
53
|
+
uses: actions/setup-python@v5
|
|
54
|
+
with:
|
|
55
|
+
python-version: "3.12"
|
|
56
|
+
|
|
57
|
+
- name: Install build + twine
|
|
58
|
+
run: |
|
|
59
|
+
python -m pip install --upgrade pip
|
|
60
|
+
pip install build twine
|
|
61
|
+
|
|
62
|
+
- name: Build wheel + sdist
|
|
63
|
+
run: python -m build
|
|
64
|
+
|
|
65
|
+
- name: Inspect distribution metadata
|
|
66
|
+
run: twine check dist/*
|
|
67
|
+
|
|
68
|
+
- name: Extract version from tag
|
|
69
|
+
id: version
|
|
70
|
+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
|
71
|
+
|
|
72
|
+
- name: Upload artifacts
|
|
73
|
+
uses: actions/upload-artifact@v4
|
|
74
|
+
with:
|
|
75
|
+
name: dist
|
|
76
|
+
path: dist/*
|
|
77
|
+
|
|
78
|
+
publish-pypi:
|
|
79
|
+
needs: build
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
environment:
|
|
82
|
+
name: pypi
|
|
83
|
+
url: https://pypi.org/project/loomgraph/${{ needs.build.outputs.version }}/
|
|
84
|
+
permissions:
|
|
85
|
+
id-token: write # Trusted Publisher OIDC
|
|
86
|
+
steps:
|
|
87
|
+
- uses: actions/download-artifact@v4
|
|
88
|
+
with:
|
|
89
|
+
name: dist
|
|
90
|
+
path: dist
|
|
91
|
+
|
|
92
|
+
- name: Publish to PyPI
|
|
93
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
94
|
+
# OIDC — no API token; project must be configured as a Trusted Publisher
|
|
95
|
+
# at https://pypi.org/manage/project/loomgraph/settings/publishing/
|
|
96
|
+
|
|
97
|
+
github-release:
|
|
98
|
+
needs: [build, publish-pypi]
|
|
99
|
+
runs-on: ubuntu-latest
|
|
100
|
+
permissions:
|
|
101
|
+
contents: write
|
|
102
|
+
steps:
|
|
103
|
+
- uses: actions/checkout@v4
|
|
104
|
+
|
|
105
|
+
- uses: actions/download-artifact@v4
|
|
106
|
+
with:
|
|
107
|
+
name: dist
|
|
108
|
+
path: dist
|
|
109
|
+
|
|
110
|
+
- name: Extract changelog for this version
|
|
111
|
+
id: changelog
|
|
112
|
+
run: |
|
|
113
|
+
VERSION=${{ needs.build.outputs.version }}
|
|
114
|
+
CHANGELOG=$(sed -n "/^## \[${VERSION}\]/,/^## \[/p" CHANGELOG.md | head -n -1)
|
|
115
|
+
if [ -z "$CHANGELOG" ]; then
|
|
116
|
+
CHANGELOG="Release v${VERSION}"
|
|
117
|
+
fi
|
|
118
|
+
echo "BODY<<EOF" >> $GITHUB_OUTPUT
|
|
119
|
+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
|
120
|
+
echo "EOF" >> $GITHUB_OUTPUT
|
|
121
|
+
|
|
122
|
+
- name: Create GitHub Release
|
|
123
|
+
uses: softprops/action-gh-release@v2
|
|
124
|
+
with:
|
|
125
|
+
body: ${{ steps.changelog.outputs.BODY }}
|
|
126
|
+
files: |
|
|
127
|
+
dist/*.whl
|
|
128
|
+
dist/*.tar.gz
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [develop, main]
|
|
6
|
+
push:
|
|
7
|
+
branches: [develop]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.11", "3.12"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v4
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: |
|
|
29
|
+
uv venv
|
|
30
|
+
uv pip install -e ".[dev]"
|
|
31
|
+
|
|
32
|
+
- name: Lint
|
|
33
|
+
run: |
|
|
34
|
+
source .venv/bin/activate
|
|
35
|
+
ruff check src/ tests/
|
|
36
|
+
|
|
37
|
+
- name: Unit tests
|
|
38
|
+
run: |
|
|
39
|
+
source .venv/bin/activate
|
|
40
|
+
pytest tests/unit/ -v --tb=short
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
|
|
27
|
+
# PyInstaller
|
|
28
|
+
*.manifest
|
|
29
|
+
*.spec
|
|
30
|
+
|
|
31
|
+
# Installer logs
|
|
32
|
+
pip-log.txt
|
|
33
|
+
pip-delete-this-directory.txt
|
|
34
|
+
|
|
35
|
+
# Unit test / coverage reports
|
|
36
|
+
htmlcov/
|
|
37
|
+
.tox/
|
|
38
|
+
.nox/
|
|
39
|
+
.coverage
|
|
40
|
+
.coverage.*
|
|
41
|
+
.cache
|
|
42
|
+
nosetests.xml
|
|
43
|
+
coverage.xml
|
|
44
|
+
*.cover
|
|
45
|
+
*.py,cover
|
|
46
|
+
.hypothesis/
|
|
47
|
+
.pytest_cache/
|
|
48
|
+
|
|
49
|
+
# Translations
|
|
50
|
+
*.mo
|
|
51
|
+
*.pot
|
|
52
|
+
|
|
53
|
+
# Environments
|
|
54
|
+
.env
|
|
55
|
+
.env.local
|
|
56
|
+
.env.*.local
|
|
57
|
+
.venv
|
|
58
|
+
env/
|
|
59
|
+
venv/
|
|
60
|
+
ENV/
|
|
61
|
+
env.bak/
|
|
62
|
+
venv.bak/
|
|
63
|
+
|
|
64
|
+
# IDEs
|
|
65
|
+
.idea/
|
|
66
|
+
.vscode/
|
|
67
|
+
*.swp
|
|
68
|
+
*.swo
|
|
69
|
+
*~
|
|
70
|
+
.project
|
|
71
|
+
.pydevproject
|
|
72
|
+
.settings/
|
|
73
|
+
*.sublime-project
|
|
74
|
+
*.sublime-workspace
|
|
75
|
+
.spyderproject
|
|
76
|
+
.spyproject
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# mypy
|
|
86
|
+
.mypy_cache/
|
|
87
|
+
.dmypy.json
|
|
88
|
+
dmypy.json
|
|
89
|
+
|
|
90
|
+
# ruff
|
|
91
|
+
.ruff_cache/
|
|
92
|
+
|
|
93
|
+
# Pyre type checker
|
|
94
|
+
.pyre/
|
|
95
|
+
|
|
96
|
+
# pytype static type analyzer
|
|
97
|
+
.pytype/
|
|
98
|
+
|
|
99
|
+
# Cython debug symbols
|
|
100
|
+
cython_debug/
|
|
101
|
+
|
|
102
|
+
# macOS
|
|
103
|
+
.DS_Store
|
|
104
|
+
.AppleDouble
|
|
105
|
+
.LSOverride
|
|
106
|
+
|
|
107
|
+
# LoomGraph specific
|
|
108
|
+
*.db
|
|
109
|
+
*.sqlite
|
|
110
|
+
*.log
|
|
111
|
+
loomgraph_index/
|
|
112
|
+
.loomgraph/
|
|
113
|
+
.loomgraph.yaml
|
|
114
|
+
.loomgraph.yml
|
|
115
|
+
|
|
116
|
+
# Customer configs (contain internal URLs)
|
|
117
|
+
customers/customers.yaml
|
|
118
|
+
customers/*/config.yaml
|
|
119
|
+
customers/*/
|
|
120
|
+
|
|
121
|
+
# Secrets
|
|
122
|
+
*.pem
|
|
123
|
+
*.key
|
|
124
|
+
secrets.yaml
|
|
125
|
+
secrets.yml
|
|
126
|
+
|
|
127
|
+
# UV
|
|
128
|
+
uv.lock
|
|
129
|
+
|
|
130
|
+
# Test artifacts
|
|
131
|
+
test_output/
|
|
132
|
+
test_index/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# LoomGraph Configuration
|
|
2
|
+
# Copy to .loomgraph.yaml and customize
|
|
3
|
+
|
|
4
|
+
# LightRAG API connection
|
|
5
|
+
lightrag:
|
|
6
|
+
# H200 server
|
|
7
|
+
api_url: "http://117.131.45.179:3001"
|
|
8
|
+
api_timeout: 30.0
|
|
9
|
+
default_query_mode: "hybrid" # local, global, hybrid, naive
|
|
10
|
+
|
|
11
|
+
# Embedding service (optional, managed by LightRAG)
|
|
12
|
+
embedding:
|
|
13
|
+
provider: "jina"
|
|
14
|
+
model: "jinaai/jina-embeddings-v2-base-code"
|
|
15
|
+
base_url: "http://117.131.45.179:3002"
|
|
16
|
+
batch_size: 32
|
|
17
|
+
dimension: 768
|
|
18
|
+
|
|
19
|
+
# Retrieval settings
|
|
20
|
+
retrieval:
|
|
21
|
+
default_mode: "hybrid" # keyword, semantic, graph, hybrid
|
|
22
|
+
top_k: 10
|
|
23
|
+
similarity_threshold: 0.7
|
|
24
|
+
|
|
25
|
+
# Application settings
|
|
26
|
+
debug: false
|
|
27
|
+
log_level: "INFO"
|