jeles 0.1.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.
- jeles-0.1.0/.github/dependabot.yml +11 -0
- jeles-0.1.0/.github/pull_request_template.md +24 -0
- jeles-0.1.0/.github/workflows/dependabot-automerge.yml +55 -0
- jeles-0.1.0/.github/workflows/release.yml +88 -0
- jeles-0.1.0/.github/workflows/tests.yml +107 -0
- jeles-0.1.0/.gitignore +13 -0
- jeles-0.1.0/LICENSE +202 -0
- jeles-0.1.0/NOTICE +2 -0
- jeles-0.1.0/PKG-INFO +158 -0
- jeles-0.1.0/README.md +126 -0
- jeles-0.1.0/docs/plans/2026-08-02-pypi-packaging-and-wiring.md +202 -0
- jeles-0.1.0/jeles/__init__.py +77 -0
- jeles-0.1.0/jeles/corpus.py +359 -0
- jeles-0.1.0/jeles/corpus_server.py +123 -0
- jeles-0.1.0/jeles/persona/__init__.py +6 -0
- jeles-0.1.0/jeles/persona/compiler.py +164 -0
- jeles-0.1.0/jeles/persona/jeles_persona.json +132 -0
- jeles-0.1.0/jeles/reactions/__init__.py +20 -0
- jeles-0.1.0/jeles/reactions/conflict_scan.py +261 -0
- jeles-0.1.0/jeles/reactions/search_adapter.py +160 -0
- jeles-0.1.0/jeles/willow_mcp_client.py +216 -0
- jeles-0.1.0/pyproject.toml +72 -0
- jeles-0.1.0/tests/test_conflict_scan.py +113 -0
- jeles-0.1.0/tests/test_corpus.py +142 -0
- jeles-0.1.0/tests/test_hardening.py +109 -0
- jeles-0.1.0/tests/test_import_purity.py +80 -0
- jeles-0.1.0/tests/test_persona.py +65 -0
- jeles-0.1.0/tests/test_search_adapter.py +111 -0
- jeles-0.1.0/tests/test_willow_mcp_client.py +107 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
## Bite
|
|
2
|
+
|
|
3
|
+
<!-- One sentence — the single outcome this PR delivers.
|
|
4
|
+
Follow-up to a merged PR? Say so: "Follow-up to #NN (merged)". -->
|
|
5
|
+
|
|
6
|
+
## What was done
|
|
7
|
+
|
|
8
|
+
<!-- Bullets, boldest fact first. If two unrelated changes rode this
|
|
9
|
+
branch, flag them separately so they can be reviewed (or split) cleanly. -->
|
|
10
|
+
|
|
11
|
+
## Evidence
|
|
12
|
+
|
|
13
|
+
<!-- Receipts, not claims. Check only what you actually ran, and state the result. -->
|
|
14
|
+
- [ ] Tests: `<command>` → N passed
|
|
15
|
+
- [ ] Gates: `<gate command>` → clean
|
|
16
|
+
- [ ] Driven for real: <!-- what you exercised end-to-end, and what you saw -->
|
|
17
|
+
|
|
18
|
+
## Out of scope
|
|
19
|
+
|
|
20
|
+
<!-- What this deliberately does not do, and where that work lives. -->
|
|
21
|
+
|
|
22
|
+
## Next bite
|
|
23
|
+
|
|
24
|
+
<!-- The single next bite this opens, if any. -->
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
name: Dependabot auto-merge
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, reopened, ready_for_review]
|
|
6
|
+
push:
|
|
7
|
+
branches: [master, main]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
pull-requests: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
dependabot-pr:
|
|
15
|
+
if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]'
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- name: Fetch Dependabot metadata
|
|
19
|
+
id: metadata
|
|
20
|
+
uses: dependabot/fetch-metadata@v3
|
|
21
|
+
with:
|
|
22
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
23
|
+
|
|
24
|
+
- name: Update branch with base
|
|
25
|
+
env:
|
|
26
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
27
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
28
|
+
run: gh pr update-branch "$PR_NUMBER" --repo "${{ github.repository }}"
|
|
29
|
+
|
|
30
|
+
- name: Enable auto-merge
|
|
31
|
+
if: |
|
|
32
|
+
steps.metadata.outputs.update-type == 'version-update:semver-patch' ||
|
|
33
|
+
steps.metadata.outputs.update-type == 'version-update:semver-minor' ||
|
|
34
|
+
steps.metadata.outputs.update-type == 'version-update:semver-major' ||
|
|
35
|
+
steps.metadata.outputs.update-type == 'github_actions'
|
|
36
|
+
env:
|
|
37
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
38
|
+
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
39
|
+
run: gh pr merge --auto --merge "$PR_URL"
|
|
40
|
+
|
|
41
|
+
refresh-stale-dependabot-prs:
|
|
42
|
+
if: github.event_name == 'push'
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
steps:
|
|
45
|
+
- name: Refresh open Dependabot PRs after master moves
|
|
46
|
+
env:
|
|
47
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
48
|
+
run: |
|
|
49
|
+
set -euo pipefail
|
|
50
|
+
mapfile -t prs < <(gh pr list --repo "${{ github.repository }}" --state open --author app/dependabot --json number --jq '.[].number')
|
|
51
|
+
for pr in "${prs[@]}"; do
|
|
52
|
+
echo "Updating Dependabot PR #${pr}"
|
|
53
|
+
gh pr update-branch "$pr" --repo "${{ github.repository }}" || true
|
|
54
|
+
gh pr merge --auto --merge "$pr" --repo "${{ github.repository }}" || true
|
|
55
|
+
done
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Publishes to PyPI when a version tag is pushed (e.g. `git tag v0.1.0 && git push --tags`).
|
|
4
|
+
#
|
|
5
|
+
# The version is NOT stored in pyproject.toml — hatch-vcs derives it from the
|
|
6
|
+
# tag (see [tool.hatch.version]). The tag is therefore the only place a release
|
|
7
|
+
# number is decided, which is what makes the assertion below meaningful rather
|
|
8
|
+
# than circular: it re-derives from the built artifact and compares.
|
|
9
|
+
#
|
|
10
|
+
# Uses PyPI Trusted Publishing (OIDC) — no API token is stored in the repo,
|
|
11
|
+
# matching willow-mcp. One-time setup before the first release:
|
|
12
|
+
# 1. On PyPI: add a *pending publisher* for project `jeles`, this repo,
|
|
13
|
+
# workflow `release.yml`, environment `pypi`. (Pending, because the project
|
|
14
|
+
# does not exist on PyPI until the first upload.)
|
|
15
|
+
# 2. Create a GitHub environment named `pypi` (Settings -> Environments).
|
|
16
|
+
# Until that is configured, this workflow is inert — nothing publishes without a tag.
|
|
17
|
+
#
|
|
18
|
+
# NOTE: `jeles` has never been published, so the FIRST tag pushed sets the first
|
|
19
|
+
# released version, and PyPI never allows a version to be reused. Choose it
|
|
20
|
+
# deliberately.
|
|
21
|
+
|
|
22
|
+
on:
|
|
23
|
+
push:
|
|
24
|
+
tags:
|
|
25
|
+
- "v*"
|
|
26
|
+
|
|
27
|
+
permissions:
|
|
28
|
+
contents: read
|
|
29
|
+
|
|
30
|
+
jobs:
|
|
31
|
+
build:
|
|
32
|
+
runs-on: ubuntu-latest
|
|
33
|
+
timeout-minutes: 10
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v7
|
|
36
|
+
with:
|
|
37
|
+
# hatch-vcs derives the version from the git tag, so the tags must be
|
|
38
|
+
# present. The default shallow checkout fetches none of them.
|
|
39
|
+
fetch-depth: 0
|
|
40
|
+
|
|
41
|
+
- uses: actions/setup-python@v7
|
|
42
|
+
with:
|
|
43
|
+
python-version: "3.12"
|
|
44
|
+
|
|
45
|
+
- name: Build sdist and wheel
|
|
46
|
+
run: |
|
|
47
|
+
python -m pip install --upgrade build
|
|
48
|
+
python -m build
|
|
49
|
+
|
|
50
|
+
- name: Assert the tag matches the built version
|
|
51
|
+
# kartikeya shipped a v0.0.8 tag whose build produced 0.0.7, and the only
|
|
52
|
+
# thing that caught it was PyPI refusing the duplicate upload. Fail here
|
|
53
|
+
# instead, where the error says what is actually wrong.
|
|
54
|
+
run: |
|
|
55
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
56
|
+
built="$(ls dist/*.tar.gz | sed -E 's|.*/jeles-(.+)\.tar\.gz|\1|')"
|
|
57
|
+
echo "tag=${tag} built=${built}"
|
|
58
|
+
if [ "$tag" != "$built" ]; then
|
|
59
|
+
echo "::error::tag v${tag} builds version ${built} — refusing to publish"
|
|
60
|
+
exit 1
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
- name: Check metadata
|
|
64
|
+
run: |
|
|
65
|
+
python -m pip install --upgrade twine
|
|
66
|
+
twine check dist/*
|
|
67
|
+
|
|
68
|
+
- uses: actions/upload-artifact@v7
|
|
69
|
+
with:
|
|
70
|
+
name: dist
|
|
71
|
+
path: dist/
|
|
72
|
+
|
|
73
|
+
publish:
|
|
74
|
+
needs: build
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
environment: pypi
|
|
77
|
+
permissions:
|
|
78
|
+
id-token: write # required for Trusted Publishing (OIDC)
|
|
79
|
+
steps:
|
|
80
|
+
- uses: actions/download-artifact@v8
|
|
81
|
+
with:
|
|
82
|
+
name: dist
|
|
83
|
+
path: dist/
|
|
84
|
+
|
|
85
|
+
- name: Publish to PyPI
|
|
86
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
87
|
+
with:
|
|
88
|
+
skip-existing: true
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
schedule:
|
|
8
|
+
# Daily drift catcher, off the :00/:30 peak-load minutes — fleet pattern.
|
|
9
|
+
- cron: "7 6 * * *"
|
|
10
|
+
workflow_dispatch: {}
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
lint:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
timeout-minutes: 10
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v7
|
|
21
|
+
|
|
22
|
+
- uses: actions/setup-python@v7
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.12"
|
|
25
|
+
|
|
26
|
+
- name: Install lint tools
|
|
27
|
+
run: pip install ruff==0.15.0 bandit
|
|
28
|
+
|
|
29
|
+
- name: Ruff (enforced)
|
|
30
|
+
run: ruff check jeles tests
|
|
31
|
+
|
|
32
|
+
- name: Bandit (enforced — tree is clean, keep it that way)
|
|
33
|
+
run: bandit -r jeles -ll -q
|
|
34
|
+
|
|
35
|
+
test-matrix:
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
timeout-minutes: 10
|
|
38
|
+
strategy:
|
|
39
|
+
fail-fast: false
|
|
40
|
+
matrix:
|
|
41
|
+
# Floor and current for requires-python >= 3.10.
|
|
42
|
+
python-version: ["3.10", "3.12"]
|
|
43
|
+
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v7
|
|
46
|
+
with:
|
|
47
|
+
# hatch-vcs derives the version from git; the default shallow checkout
|
|
48
|
+
# carries no tags and the derived version would be wrong.
|
|
49
|
+
fetch-depth: 0
|
|
50
|
+
|
|
51
|
+
- uses: actions/setup-python@v7
|
|
52
|
+
with:
|
|
53
|
+
python-version: ${{ matrix.python-version }}
|
|
54
|
+
cache: pip
|
|
55
|
+
cache-dependency-path: pyproject.toml
|
|
56
|
+
|
|
57
|
+
- name: Install package
|
|
58
|
+
run: pip install -e ".[dev]"
|
|
59
|
+
|
|
60
|
+
- name: Run tests
|
|
61
|
+
run: python -m pytest tests/ -q
|
|
62
|
+
|
|
63
|
+
# Base `jeles` must install and pass with NO extras — that is the promise that
|
|
64
|
+
# lets willow-mcp depend on this package without inheriting a version
|
|
65
|
+
# constraint. Pinning mcp as a hard dependency once made the two unresolvable
|
|
66
|
+
# together, and no test noticed. This leg notices.
|
|
67
|
+
no-extras:
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
timeout-minutes: 10
|
|
70
|
+
steps:
|
|
71
|
+
- uses: actions/checkout@v7
|
|
72
|
+
with:
|
|
73
|
+
fetch-depth: 0
|
|
74
|
+
|
|
75
|
+
- uses: actions/setup-python@v7
|
|
76
|
+
with:
|
|
77
|
+
python-version: "3.12"
|
|
78
|
+
|
|
79
|
+
- name: Install with no extras
|
|
80
|
+
run: pip install -e . pytest
|
|
81
|
+
|
|
82
|
+
- name: Assert the base install is dependency-free
|
|
83
|
+
run: |
|
|
84
|
+
python - <<'PY'
|
|
85
|
+
import importlib.util
|
|
86
|
+
from importlib.metadata import requires
|
|
87
|
+
|
|
88
|
+
declared = [r for r in (requires("jeles") or []) if "extra ==" not in r]
|
|
89
|
+
assert not declared, f"base jeles declared runtime deps: {declared}"
|
|
90
|
+
|
|
91
|
+
assert importlib.util.find_spec("mcp") is None, (
|
|
92
|
+
"the MCP SDK is installed in the no-extras job, so this leg is not "
|
|
93
|
+
"actually testing the dependency-free install shape"
|
|
94
|
+
)
|
|
95
|
+
print("base install is dependency-free and the MCP SDK is absent")
|
|
96
|
+
PY
|
|
97
|
+
|
|
98
|
+
- name: Run tests without the MCP SDK
|
|
99
|
+
run: python -m pytest tests/ -q
|
|
100
|
+
|
|
101
|
+
# Aggregate gate: branch protection requires a single check named "test"
|
|
102
|
+
# across the whole fleet. Green only when lint and every matrix leg are.
|
|
103
|
+
test:
|
|
104
|
+
needs: [test-matrix, lint, no-extras]
|
|
105
|
+
runs-on: ubuntu-latest
|
|
106
|
+
steps:
|
|
107
|
+
- run: echo "lint, all matrix legs, and the no-extras install are green"
|
jeles-0.1.0/.gitignore
ADDED
jeles-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
jeles-0.1.0/NOTICE
ADDED
jeles-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jeles
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Jeles' verified-nugget corpus organ: pure SOIL-backed storage/ranking, a standalone MCP server, best-effort fleet gap-forwarding, and the canonical Jeles persona.
|
|
5
|
+
Project-URL: Homepage, https://github.com/rudi193-cmd/Jeles
|
|
6
|
+
Project-URL: Repository, https://github.com/rudi193-cmd/Jeles
|
|
7
|
+
Project-URL: Issues, https://github.com/rudi193-cmd/Jeles/issues
|
|
8
|
+
Author: Sean Campbell
|
|
9
|
+
License: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: NOTICE
|
|
12
|
+
Keywords: citations,corpus,jeles,librarian,mcp,retrieval,verified-answers,willow
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Database
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Topic :: Text Processing :: Indexing
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: mcp<2.0.0,>=1.6.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
29
|
+
Provides-Extra: mcp
|
|
30
|
+
Requires-Dist: mcp<2.0.0,>=1.6.0; extra == 'mcp'
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# jeles
|
|
34
|
+
|
|
35
|
+
The **verified-corpus organ**, extracted from the [Ask Jeles](https://github.com/rudi193-cmd) app into its own installable package — plus the canonical **Jeles persona**.
|
|
36
|
+
|
|
37
|
+
A *nugget* is a human-verified question/answer pair with citations:
|
|
38
|
+
`{question, answer, sources, verified_by, verified_at, tags}`. This package
|
|
39
|
+
is the settled layer of answers that sits *in front of* a host's live
|
|
40
|
+
search — a confident nugget match answers instantly; everything else falls
|
|
41
|
+
through to the host's own search path unchanged. Misses are logged as
|
|
42
|
+
*gaps* ("I don't know yet") so the corpus knows what it's been asked and
|
|
43
|
+
couldn't answer.
|
|
44
|
+
|
|
45
|
+
## What's in the organ
|
|
46
|
+
|
|
47
|
+
| Module | Role |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| `jeles.corpus` | Pure storage + ranked lookup of verified nuggets and gap logging. **Stdlib-only, no MCP, no network at import.** Reuses willow-mcp's SOIL `Store` SQLite schema at `$WILLOW_STORE_ROOT/<collection>/store.db`. |
|
|
50
|
+
| `jeles.corpus_server` | Standalone FastMCP server over the corpus (`python -m jeles.corpus_server`). Mirrors willow-mcp's shape (`app_id` on every tool) **without depending on willow-mcp**. |
|
|
51
|
+
| `jeles.willow_mcp_client` | Best-effort, fire-and-forget forwarding of gaps into willow-mcp's fleet-wide backlog. Never blocks, never raises; 30s retry cooldown so a single failed connect doesn't permanently disable forwarding. |
|
|
52
|
+
| `jeles.load_persona()` | Loads the canonical Jeles persona JSON (this package is its canonical home). |
|
|
53
|
+
|
|
54
|
+
## Design principles
|
|
55
|
+
|
|
56
|
+
1. **The corpus sits in front of live search, it doesn't replace it.** A confident nugget match answers instantly — no search, no LLM call.
|
|
57
|
+
2. **`corpus.py` stays pure.** Storage and ranking have no MCP, no network, no side effects beyond SQLite. Everything MCP-shaped wraps it; it never depends on anything MCP-shaped itself. This is what keeps its tests fast and network-free.
|
|
58
|
+
3. **The corpus is its own standalone MCP server, on purpose.** `corpus_server.py` is a small FastMCP server any stdio client can run directly, mirroring willow-mcp's shape without depending on it.
|
|
59
|
+
4. **Two kinds of "ask," two gap-logging rules.** `search_nuggets()` (passive/background) checks the corpus but never logs a gap on a miss. `ask_corpus()` (deliberate) treats a miss — or a match below `MIN_ASK_SCORE` — as a real gap worth tracking, and logs it.
|
|
60
|
+
5. **Local is the source of truth; the fleet backlog is additive.** `corpus.log_gap()` (synchronous, local SQLite) always runs first and makes the host fully functional offline. `willow_mcp_client.forward_gap()` is a *best-effort* copy into willow-mcp's shared backlog.
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
**Base `jeles` has zero runtime dependencies.** The corpus, the persona, and the
|
|
65
|
+
reactions are stdlib-only, so a host can depend on this package without
|
|
66
|
+
inheriting a single version constraint from it. Only the standalone MCP server
|
|
67
|
+
needs the SDK, and it lives behind an extra.
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install jeles # corpus + persona + reactions. No dependencies.
|
|
71
|
+
pip install "jeles[mcp]" # adds the MCP SDK, for the standalone server
|
|
72
|
+
pip install -e ".[dev]" # editable, with pytest and the SDK
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Or as a host dependency, straight from git:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
jeles @ git+https://github.com/rudi193-cmd/Jeles@main
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
> **`jeles[mcp]` is pinned to MCP SDK 1.x.** `mcp.server.fastmcp` was removed in
|
|
82
|
+
> SDK 2.0 and `corpus_server.py` has not been ported to
|
|
83
|
+
> `mcp.server.mcpserver.MCPServer` yet, so the extra cannot currently be
|
|
84
|
+
> installed alongside willow-mcp (which requires `mcp>=2`). Base `jeles` can be —
|
|
85
|
+
> that is the whole point of it being dependency-free.
|
|
86
|
+
|
|
87
|
+
### Versioning
|
|
88
|
+
|
|
89
|
+
The version comes from the git tag (`hatch-vcs`), not from a literal in
|
|
90
|
+
`pyproject.toml`, and `jeles.__version__` reads it back out of installed package
|
|
91
|
+
metadata. There is exactly one place a release number is decided, so a tag
|
|
92
|
+
cannot disagree with the artifact it builds.
|
|
93
|
+
|
|
94
|
+
## Usage
|
|
95
|
+
|
|
96
|
+
### As a library
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from jeles import corpus
|
|
100
|
+
|
|
101
|
+
corpus.put_nugget(
|
|
102
|
+
question="What is the primary color in Grove?",
|
|
103
|
+
answer="The primary color in Grove is #ffffff (white).",
|
|
104
|
+
sources=["safe-library/themes/grove.json"],
|
|
105
|
+
verified_by="designer",
|
|
106
|
+
tags=["color", "grove", "primary"],
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
hit = corpus.ask_corpus("What is the primary color in Grove?")
|
|
110
|
+
# -> {"found": True, "exact": True, "nugget": {...}, "candidates": [...]}
|
|
111
|
+
|
|
112
|
+
miss = corpus.ask_corpus("What is the accent color in Tokyo Night?")
|
|
113
|
+
# -> {"found": False, ...} and the question is logged as a gap
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### As a standalone MCP server
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
python -m jeles.corpus_server # stdio; or use the `jeles-corpus-mcp` console script
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Tools: `corpus_ask`, `corpus_search`, `corpus_get`, `corpus_list`, `corpus_put`, `corpus_gaps` — each takes an `app_id` for naming-convention parity with willow-mcp.
|
|
123
|
+
|
|
124
|
+
### The persona
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
import jeles
|
|
128
|
+
persona = jeles.load_persona() # dict; canonical Jeles persona
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Configuration
|
|
132
|
+
|
|
133
|
+
| Env var | Default | Effect |
|
|
134
|
+
| --- | --- | --- |
|
|
135
|
+
| `WILLOW_STORE_ROOT` | `~/.willow/store` | Root under which `<collection>/store.db` lives. |
|
|
136
|
+
| `JELES_CORPUS_COLLECTION` | `ask_jeles_corpus` | Nugget collection name (back-compat with Ask Jeles). |
|
|
137
|
+
| `JELES_CORPUS_GAPS_COLLECTION` | `ask_jeles_corpus_gaps` | Local gap-log collection name. |
|
|
138
|
+
| `JELES_CORPUS_APP_ID` | `ask-jeles` | `app_id` used when forwarding gaps to willow-mcp. |
|
|
139
|
+
| `JELES_CORPUS_TOPIC` | `ask-jeles-corpus` | Backlog topic gaps are forwarded under. |
|
|
140
|
+
| `WILLOW_MCP_CMD` | — | Explicit command to launch willow-mcp (else `willow-mcp` on PATH, else `python -m willow_mcp`). |
|
|
141
|
+
| `ASK_JELES_USE_WILLOW_MCP` | `1` | Set to `0`/`false`/`no` to disable fleet gap-forwarding entirely. |
|
|
142
|
+
|
|
143
|
+
The Ask Jeles-flavored defaults are preserved so an existing store and its
|
|
144
|
+
already-forwarded fleet backlog keep resolving after the extraction.
|
|
145
|
+
|
|
146
|
+
## Tests
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
pytest -q
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
`corpus.py`'s tests are fast and network-free by construction; the
|
|
153
|
+
willow-mcp client tests never spin up a real subprocess. An import-purity
|
|
154
|
+
test asserts that importing `jeles.corpus` loads no MCP or network modules.
|
|
155
|
+
|
|
156
|
+
## License
|
|
157
|
+
|
|
158
|
+
Apache-2.0 — see [LICENSE](LICENSE).
|