libcontext 0.1.0__tar.gz → 0.3.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.
Files changed (52) hide show
  1. {libcontext-0.1.0 → libcontext-0.3.0}/.github/ISSUE_TEMPLATE/bug_report.md +36 -36
  2. {libcontext-0.1.0 → libcontext-0.3.0}/.github/ISSUE_TEMPLATE/feature_request.md +23 -23
  3. {libcontext-0.1.0 → libcontext-0.3.0}/.github/PULL_REQUEST_TEMPLATE.md +21 -21
  4. {libcontext-0.1.0 → libcontext-0.3.0}/.github/workflows/ci.yml +90 -99
  5. libcontext-0.3.0/.github/workflows/release.yml +118 -0
  6. {libcontext-0.1.0 → libcontext-0.3.0}/.gitignore +72 -65
  7. libcontext-0.3.0/CHANGELOG.md +89 -0
  8. {libcontext-0.1.0 → libcontext-0.3.0}/CONTRIBUTING.md +168 -166
  9. {libcontext-0.1.0 → libcontext-0.3.0}/DEPENDENCIES.md +66 -52
  10. {libcontext-0.1.0 → libcontext-0.3.0}/LICENSE +21 -21
  11. libcontext-0.3.0/PKG-INFO +345 -0
  12. libcontext-0.3.0/README.md +316 -0
  13. {libcontext-0.1.0 → libcontext-0.3.0}/SECURITY.md +47 -38
  14. libcontext-0.3.0/docs/adr/001-progressive-disclosure-over-always-on-context.md +53 -0
  15. libcontext-0.3.0/docs/adr/002-skill-plus-cli-as-primary-integration.md +104 -0
  16. libcontext-0.3.0/docs/adr/004-ast-only-inspection.md +56 -0
  17. libcontext-0.3.0/docs/adr/README.md +15 -0
  18. {libcontext-0.1.0 → libcontext-0.3.0}/pyproject.toml +11 -8
  19. {libcontext-0.1.0 → libcontext-0.3.0}/src/libcontext/__init__.py +97 -57
  20. libcontext-0.3.0/src/libcontext/_security.py +184 -0
  21. libcontext-0.3.0/src/libcontext/cache.py +265 -0
  22. libcontext-0.3.0/src/libcontext/cli.py +805 -0
  23. libcontext-0.3.0/src/libcontext/collector.py +727 -0
  24. {libcontext-0.1.0 → libcontext-0.3.0}/src/libcontext/config.py +157 -151
  25. libcontext-0.3.0/src/libcontext/diff.py +294 -0
  26. libcontext-0.3.0/src/libcontext/exceptions.py +67 -0
  27. {libcontext-0.1.0 → libcontext-0.3.0}/src/libcontext/inspector.py +478 -399
  28. libcontext-0.3.0/src/libcontext/mcp_server.py +270 -0
  29. libcontext-0.3.0/src/libcontext/models.py +378 -0
  30. libcontext-0.3.0/src/libcontext/renderer.py +1206 -0
  31. libcontext-0.3.0/tests/test_cache.py +384 -0
  32. libcontext-0.3.0/tests/test_cli.py +1081 -0
  33. libcontext-0.3.0/tests/test_cli_mcp_parity.py +185 -0
  34. {libcontext-0.1.0 → libcontext-0.3.0}/tests/test_collector.py +1085 -584
  35. {libcontext-0.1.0 → libcontext-0.3.0}/tests/test_config.py +338 -326
  36. libcontext-0.3.0/tests/test_diff.py +546 -0
  37. {libcontext-0.1.0 → libcontext-0.3.0}/tests/test_inspector.py +581 -395
  38. libcontext-0.3.0/tests/test_mcp_server.py +405 -0
  39. libcontext-0.3.0/tests/test_models.py +336 -0
  40. libcontext-0.3.0/tests/test_renderer.py +1432 -0
  41. libcontext-0.3.0/tests/test_security.py +215 -0
  42. libcontext-0.1.0/CHANGELOG.md +0 -35
  43. libcontext-0.1.0/PKG-INFO +0 -282
  44. libcontext-0.1.0/README.md +0 -250
  45. libcontext-0.1.0/src/libcontext/cli.py +0 -218
  46. libcontext-0.1.0/src/libcontext/collector.py +0 -290
  47. libcontext-0.1.0/src/libcontext/models.py +0 -92
  48. libcontext-0.1.0/src/libcontext/renderer.py +0 -366
  49. libcontext-0.1.0/tests/test_cli.py +0 -400
  50. libcontext-0.1.0/tests/test_renderer.py +0 -312
  51. {libcontext-0.1.0 → libcontext-0.3.0}/src/libcontext/py.typed +0 -0
  52. {libcontext-0.1.0 → libcontext-0.3.0}/tests/__init__.py +0 -0
@@ -1,36 +1,36 @@
1
- ---
2
- name: Bug Report
3
- about: Report a bug to help us improve
4
- title: "[BUG] "
5
- labels: bug
6
- assignees: ""
7
- ---
8
-
9
- ## Description
10
-
11
- A clear and concise description of the bug.
12
-
13
- ## Steps to Reproduce
14
-
15
- 1. Install `...`
16
- 2. Run `libctx ...`
17
- 3. See error
18
-
19
- ## Expected Behaviour
20
-
21
- What you expected to happen.
22
-
23
- ## Actual Behaviour
24
-
25
- What actually happened. Include the full error traceback if applicable.
26
-
27
- ## Environment
28
-
29
- - **OS:** (e.g., Windows 11, Ubuntu 22.04, macOS 14)
30
- - **Python version:** (e.g., 3.11.4)
31
- - **libcontext version:** (e.g., 0.1.0)
32
- - **Package being inspected:** (e.g., requests 2.31.0)
33
-
34
- ## Additional Context
35
-
36
- Any other context about the problem (screenshots, logs, etc.).
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug to help us improve
4
+ title: "[BUG] "
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Description
10
+
11
+ A clear and concise description of the bug.
12
+
13
+ ## Steps to Reproduce
14
+
15
+ 1. Install `...`
16
+ 2. Run `libctx ...`
17
+ 3. See error
18
+
19
+ ## Expected Behaviour
20
+
21
+ What you expected to happen.
22
+
23
+ ## Actual Behaviour
24
+
25
+ What actually happened. Include the full error traceback if applicable.
26
+
27
+ ## Environment
28
+
29
+ - **OS:** (e.g., Windows 11, Ubuntu 22.04, macOS 14)
30
+ - **Python version:** (e.g., 3.11.4)
31
+ - **libcontext version:** (e.g., 0.1.0)
32
+ - **Package being inspected:** (e.g., requests 2.31.0)
33
+
34
+ ## Additional Context
35
+
36
+ Any other context about the problem (screenshots, logs, etc.).
@@ -1,23 +1,23 @@
1
- ---
2
- name: Feature Request
3
- about: Suggest a new feature or enhancement
4
- title: "[FEATURE] "
5
- labels: enhancement
6
- assignees: ""
7
- ---
8
-
9
- ## Problem Statement
10
-
11
- A clear and concise description of the problem this feature would solve.
12
-
13
- ## Proposed Solution
14
-
15
- Describe your proposed solution or feature.
16
-
17
- ## Alternatives Considered
18
-
19
- Any alternative solutions or features you've considered.
20
-
21
- ## Additional Context
22
-
23
- Any other context, mockups, or examples.
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a new feature or enhancement
4
+ title: "[FEATURE] "
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Problem Statement
10
+
11
+ A clear and concise description of the problem this feature would solve.
12
+
13
+ ## Proposed Solution
14
+
15
+ Describe your proposed solution or feature.
16
+
17
+ ## Alternatives Considered
18
+
19
+ Any alternative solutions or features you've considered.
20
+
21
+ ## Additional Context
22
+
23
+ Any other context, mockups, or examples.
@@ -1,21 +1,21 @@
1
- ## Description
2
-
3
- Brief description of the changes in this PR.
4
-
5
- ## Motivation
6
-
7
- Why is this change needed? Link to related issue(s) if applicable.
8
-
9
- Closes #
10
-
11
- ## Changes
12
-
13
- - Change 1
14
- - Change 2
15
-
16
- ## Checklist
17
-
18
- - [ ] Tests added/updated
19
- - [ ] All tests pass (`pytest`)
20
- - [ ] Docstrings added/updated for public API changes
21
- - [ ] CHANGELOG.md updated (for user-facing changes)
1
+ ## Description
2
+
3
+ Brief description of the changes in this PR.
4
+
5
+ ## Motivation
6
+
7
+ Why is this change needed? Link to related issue(s) if applicable.
8
+
9
+ Closes #
10
+
11
+ ## Changes
12
+
13
+ - Change 1
14
+ - Change 2
15
+
16
+ ## Checklist
17
+
18
+ - [ ] Tests added/updated
19
+ - [ ] All tests pass (`pytest`)
20
+ - [ ] Docstrings added/updated for public API changes
21
+ - [ ] CHANGELOG.md updated (for user-facing changes)
@@ -1,99 +1,90 @@
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
- jobs:
13
- test:
14
- name: Test (Python ${{ matrix.python-version }}, ${{ matrix.os }})
15
- runs-on: ${{ matrix.os }}
16
-
17
- strategy:
18
- fail-fast: false
19
- matrix:
20
- os: [ubuntu-latest, windows-latest, macos-latest]
21
- python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
22
-
23
- steps:
24
- - uses: actions/checkout@v4
25
-
26
- - name: Set up Python ${{ matrix.python-version }}
27
- uses: actions/setup-python@v5
28
- with:
29
- python-version: ${{ matrix.python-version }}
30
-
31
- - name: Install dependencies
32
- run: |
33
- python -m pip install --upgrade pip
34
- pip install -e ".[dev]"
35
-
36
- - name: Run tests
37
- run: pytest -v --cov=libcontext --cov-report=xml
38
-
39
- - name: Upload coverage
40
- if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
41
- uses: codecov/codecov-action@v4
42
- with:
43
- file: coverage.xml
44
- fail_ci_if_error: false
45
-
46
- lint:
47
- name: Lint
48
- runs-on: ubuntu-latest
49
-
50
- steps:
51
- - uses: actions/checkout@v4
52
-
53
- - name: Set up Python
54
- uses: actions/setup-python@v5
55
- with:
56
- python-version: "3.12"
57
-
58
- - name: Install dependencies
59
- run: |
60
- python -m pip install --upgrade pip
61
- pip install -e ".[dev]"
62
-
63
- - name: Ruff lint
64
- run: ruff check src/ tests/
65
-
66
- - name: Ruff format check
67
- run: ruff format --check src/ tests/
68
-
69
- - name: Type checking (mypy)
70
- run: mypy src/libcontext
71
-
72
- build:
73
- name: Build package
74
- runs-on: ubuntu-latest
75
-
76
- steps:
77
- - uses: actions/checkout@v4
78
-
79
- - name: Set up Python
80
- uses: actions/setup-python@v5
81
- with:
82
- python-version: "3.12"
83
-
84
- - name: Install build tools
85
- run: |
86
- python -m pip install --upgrade pip
87
- pip install build twine
88
-
89
- - name: Build
90
- run: python -m build
91
-
92
- - name: Check package
93
- run: twine check dist/*
94
-
95
- - name: Upload artifacts
96
- uses: actions/upload-artifact@v4
97
- with:
98
- name: dist
99
- path: dist/
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
+ jobs:
13
+ test:
14
+ name: Test (Python ${{ matrix.python-version }}, ${{ matrix.os }})
15
+ runs-on: ${{ matrix.os }}
16
+
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ os: [ubuntu-latest, windows-latest, macos-latest]
21
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v5
28
+
29
+ - name: Set up Python ${{ matrix.python-version }}
30
+ run: uv python install ${{ matrix.python-version }}
31
+
32
+ - name: Install dependencies
33
+ run: uv sync --group dev
34
+
35
+ - name: Run tests
36
+ run: uv run pytest -v --cov=libcontext --cov-report=xml
37
+
38
+ - name: Upload coverage
39
+ if: matrix.python-version == '3.12' && matrix.os == 'ubuntu-latest'
40
+ uses: codecov/codecov-action@v4
41
+ with:
42
+ file: coverage.xml
43
+ fail_ci_if_error: false
44
+
45
+ lint:
46
+ name: Lint
47
+ runs-on: ubuntu-latest
48
+
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+
52
+ - name: Install uv
53
+ uses: astral-sh/setup-uv@v5
54
+
55
+ - name: Set up Python
56
+ run: uv python install 3.12
57
+
58
+ - name: Install dependencies
59
+ run: uv sync --group dev
60
+
61
+ - name: Ruff lint
62
+ run: uv run ruff check src/ tests/
63
+
64
+ - name: Ruff format check
65
+ run: uv run ruff format --check src/ tests/
66
+
67
+ - name: Type checking (mypy)
68
+ run: uv run mypy src/libcontext
69
+
70
+ build:
71
+ name: Build package
72
+ runs-on: ubuntu-latest
73
+
74
+ steps:
75
+ - uses: actions/checkout@v4
76
+
77
+ - name: Install uv
78
+ uses: astral-sh/setup-uv@v5
79
+
80
+ - name: Build
81
+ run: uv build
82
+
83
+ - name: Check package
84
+ run: uvx twine check dist/*
85
+
86
+ - name: Upload artifacts
87
+ uses: actions/upload-artifact@v4
88
+ with:
89
+ name: dist
90
+ path: dist/
@@ -0,0 +1,118 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: write # needed for GitHub Release creation
10
+ id-token: write # needed for PyPI Trusted Publishing (OIDC)
11
+
12
+ jobs:
13
+ # ── 1. Quality gate ─────────────────────────────────────────────────
14
+ quality:
15
+ name: Quality gate
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v5
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.12"
28
+
29
+ - name: Install dependencies
30
+ run: uv sync --all-extras
31
+
32
+ - name: Ruff lint
33
+ run: uv run ruff check src/ tests/
34
+
35
+ - name: Ruff format check
36
+ run: uv run ruff format --check src/ tests/
37
+
38
+ - name: Type checking (mypy)
39
+ run: uv run mypy src/libcontext
40
+
41
+ - name: Run tests
42
+ run: uv run pytest -v --cov=libcontext
43
+
44
+ # ── 2. Build ────────────────────────────────────────────────────────
45
+ build:
46
+ name: Build package
47
+ needs: quality
48
+ runs-on: ubuntu-latest
49
+
50
+ steps:
51
+ - uses: actions/checkout@v4
52
+
53
+ - name: Install uv
54
+ uses: astral-sh/setup-uv@v5
55
+
56
+ - name: Build sdist & wheel
57
+ run: uv build
58
+
59
+ - name: Upload dist artifacts
60
+ uses: actions/upload-artifact@v4
61
+ with:
62
+ name: dist
63
+ path: dist/
64
+
65
+ # ── 3. Publish to PyPI (Trusted Publisher / OIDC) ───────────────────
66
+ publish-pypi:
67
+ name: Publish to PyPI
68
+ needs: build
69
+ runs-on: ubuntu-latest
70
+ environment: pypi
71
+
72
+ steps:
73
+ - name: Download dist artifacts
74
+ uses: actions/download-artifact@v4
75
+ with:
76
+ name: dist
77
+ path: dist/
78
+
79
+ - name: Publish to PyPI
80
+ uses: pypa/gh-action-pypi-publish@release/v1
81
+
82
+ # ── 4. GitHub Release ──────────────────────────────────────────────
83
+ github-release:
84
+ name: GitHub Release
85
+ needs: build
86
+ runs-on: ubuntu-latest
87
+
88
+ steps:
89
+ - uses: actions/checkout@v4
90
+
91
+ - name: Download dist artifacts
92
+ uses: actions/download-artifact@v4
93
+ with:
94
+ name: dist
95
+ path: dist/
96
+
97
+ - name: Extract changelog for this version
98
+ id: changelog
99
+ run: |
100
+ TAG="${GITHUB_REF#refs/tags/v}"
101
+ # Extract the section for this version from CHANGELOG.md
102
+ BODY=$(awk -v ver="$TAG" '
103
+ /^## \[/ {
104
+ if (found) exit
105
+ if (index($0, "[" ver "]")) found=1
106
+ next
107
+ }
108
+ found { print }
109
+ ' CHANGELOG.md)
110
+ # Write to file for the release body
111
+ echo "$BODY" > release_body.md
112
+
113
+ - name: Create GitHub Release
114
+ uses: softprops/action-gh-release@v2
115
+ with:
116
+ body_path: release_body.md
117
+ files: dist/*
118
+ generate_release_notes: false
@@ -1,65 +1,72 @@
1
- # Byte-compiled / cached
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
- *.egg
25
-
26
- # Virtual environments
27
- .venv/
28
- venv/
29
- ENV/
30
- env/
31
-
32
- # uv
33
- uv.lock
34
-
35
- # IDE
36
- .vscode/
37
- .idea/
38
- *.swp
39
- *.swo
40
- *~
41
-
42
- # Testing / coverage
43
- htmlcov/
44
- .tox/
45
- .nox/
46
- .coverage
47
- .coverage.*
48
- .cache
49
- nosetests.xml
50
- coverage.xml
51
- *.cover
52
- *.py,cover
53
- .hypothesis/
54
- .pytest_cache/
55
-
56
- # mypy
57
- .mypy_cache/
58
- dmypy.json
59
-
60
- # ruff
61
- .ruff_cache/
62
-
63
- # OS files
64
- .DS_Store
65
- Thumbs.db
1
+ # Byte-compiled / cached
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
+ *.egg
25
+
26
+ # Virtual environments
27
+ .venv/
28
+ venv/
29
+ ENV/
30
+ env/
31
+
32
+ # uv
33
+ uv.lock
34
+
35
+ # IDE
36
+ .vscode/
37
+ .idea/
38
+ .claude/
39
+ CLAUDE.md
40
+ *.swp
41
+ *.swo
42
+ *~
43
+
44
+ # Testing / coverage
45
+ htmlcov/
46
+ .tox/
47
+ .nox/
48
+ .coverage
49
+ .coverage.*
50
+ .cache
51
+ nosetests.xml
52
+ coverage.xml
53
+ *.cover
54
+ *.py,cover
55
+ .hypothesis/
56
+ .pytest_cache/
57
+
58
+ # mypy
59
+ .mypy_cache/
60
+ dmypy.json
61
+
62
+ # ruff
63
+ .ruff_cache/
64
+
65
+ # Specs / internal docs
66
+ specs/
67
+ CHECKLIST_SPEC.md
68
+ ROADMAP.md
69
+
70
+ # OS files
71
+ .DS_Store
72
+ Thumbs.db