loci-mem 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.
- loci_mem-0.1.0/.github/workflows/ci.yml +140 -0
- loci_mem-0.1.0/.gitignore +18 -0
- loci_mem-0.1.0/LICENSE +21 -0
- loci_mem-0.1.0/PKG-INFO +905 -0
- loci_mem-0.1.0/README.md +863 -0
- loci_mem-0.1.0/evals/RESULTS.md +1810 -0
- loci_mem-0.1.0/evals/corpus.py +247 -0
- loci_mem-0.1.0/evals/fit.py +166 -0
- loci_mem-0.1.0/evals/questions.json +341 -0
- loci_mem-0.1.0/evals/real_corpus.py +222 -0
- loci_mem-0.1.0/evals/retrieval.py +257 -0
- loci_mem-0.1.0/evals/run_eval.py +213 -0
- loci_mem-0.1.0/evals/scale.py +157 -0
- loci_mem-0.1.0/evals/sweep.py +163 -0
- loci_mem-0.1.0/evals/taxonomy.py +46 -0
- loci_mem-0.1.0/pyproject.toml +68 -0
- loci_mem-0.1.0/src/loci/__init__.py +39 -0
- loci_mem-0.1.0/src/loci/agent_skill.py +53 -0
- loci_mem-0.1.0/src/loci/ask.py +282 -0
- loci_mem-0.1.0/src/loci/backends/__init__.py +33 -0
- loci_mem-0.1.0/src/loci/backends/base.py +70 -0
- loci_mem-0.1.0/src/loci/backends/docstrings.py +227 -0
- loci_mem-0.1.0/src/loci/backends/episodes.py +590 -0
- loci_mem-0.1.0/src/loci/backends/graphify.py +206 -0
- loci_mem-0.1.0/src/loci/calibrate.py +290 -0
- loci_mem-0.1.0/src/loci/cli.py +874 -0
- loci_mem-0.1.0/src/loci/defaults.py +31 -0
- loci_mem-0.1.0/src/loci/doctor.py +208 -0
- loci_mem-0.1.0/src/loci/eval.py +339 -0
- loci_mem-0.1.0/src/loci/groups.py +160 -0
- loci_mem-0.1.0/src/loci/index.py +363 -0
- loci_mem-0.1.0/src/loci/mcp_server.py +167 -0
- loci_mem-0.1.0/src/loci/paths.py +227 -0
- loci_mem-0.1.0/src/loci/provenance.py +175 -0
- loci_mem-0.1.0/src/loci/redact.py +89 -0
- loci_mem-0.1.0/src/loci/router.py +495 -0
- loci_mem-0.1.0/src/loci/scopes.py +487 -0
- loci_mem-0.1.0/src/loci/setup.py +348 -0
- loci_mem-0.1.0/src/loci/skill/SKILL.md +169 -0
- loci_mem-0.1.0/src/loci/text.py +102 -0
- loci_mem-0.1.0/src/loci/types.py +137 -0
- loci_mem-0.1.0/src/loci/update.py +232 -0
- loci_mem-0.1.0/src/loci/walk.py +119 -0
- loci_mem-0.1.0/tests/test_core.py +4175 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
# This matrix exists because reading the code does not find every platform
|
|
12
|
+
# bug. Reading found two -- os.kill(pid, 0) terminating rather than probing
|
|
13
|
+
# on Windows, and backslash paths defeating glob matching. Running it found
|
|
14
|
+
# a third that reading had walked straight past: os.replace refusing a
|
|
15
|
+
# destination Windows has open, which failed every durable write on that
|
|
16
|
+
# platform alone.
|
|
17
|
+
name: ${{ matrix.os }} · py${{ matrix.python }}
|
|
18
|
+
runs-on: ${{ matrix.os }}
|
|
19
|
+
strategy:
|
|
20
|
+
fail-fast: false
|
|
21
|
+
matrix:
|
|
22
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
23
|
+
python: ["3.10", "3.11", "3.12", "3.13"]
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
- uses: actions/setup-python@v5
|
|
27
|
+
with:
|
|
28
|
+
python-version: ${{ matrix.python }}
|
|
29
|
+
- name: Install from a built wheel, not the source tree
|
|
30
|
+
shell: bash
|
|
31
|
+
run: |
|
|
32
|
+
python -m pip install --upgrade pip build
|
|
33
|
+
python -m build --wheel
|
|
34
|
+
python -m pip install dist/*.whl pytest
|
|
35
|
+
- name: Test
|
|
36
|
+
run: python -m pytest tests -q
|
|
37
|
+
- name: Smoke the CLI end to end
|
|
38
|
+
shell: bash
|
|
39
|
+
run: |
|
|
40
|
+
set -e
|
|
41
|
+
# Two scopes with genuinely different vocabulary. A smoke test whose
|
|
42
|
+
# fixtures are near-identical passes without proving anything: an
|
|
43
|
+
# earlier version used alpha/beta clones and `loci ask` returned "no
|
|
44
|
+
# evidence" while still exiting 0.
|
|
45
|
+
mkdir -p /tmp/smoke/ledger/src /tmp/smoke/imaging/src
|
|
46
|
+
cat > /tmp/smoke/ledger/README.md <<'EOF'
|
|
47
|
+
# ledger
|
|
48
|
+
|
|
49
|
+
## Settlement
|
|
50
|
+
|
|
51
|
+
Reconciles invoices against bank statements nightly and files any
|
|
52
|
+
discrepancy as a dunning notice for manual review.
|
|
53
|
+
EOF
|
|
54
|
+
cat > /tmp/smoke/ledger/src/core.py <<'EOF'
|
|
55
|
+
"""Settlement engine for the ledger service.
|
|
56
|
+
|
|
57
|
+
Reconciles each invoice against the matching bank statement and raises
|
|
58
|
+
a dunning notice when the two disagree beyond the rounding tolerance.
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def reconcile_invoice(statement):
|
|
63
|
+
"""Match one invoice to a statement and return the residual."""
|
|
64
|
+
return statement
|
|
65
|
+
EOF
|
|
66
|
+
cat > /tmp/smoke/imaging/README.md <<'EOF'
|
|
67
|
+
# imaging
|
|
68
|
+
|
|
69
|
+
## Windowing
|
|
70
|
+
|
|
71
|
+
Applies radiograph windowing to DICOM voxel data before handing it to
|
|
72
|
+
the viewer, so contrast is stable across studies.
|
|
73
|
+
EOF
|
|
74
|
+
cat > /tmp/smoke/imaging/src/core.py <<'EOF'
|
|
75
|
+
"""Voxel windowing for the imaging service.
|
|
76
|
+
|
|
77
|
+
Applies a radiograph window to DICOM pixel data so that contrast stays
|
|
78
|
+
stable between studies acquired on different scanners.
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def apply_window(voxels):
|
|
83
|
+
"""Window one DICOM volume and return the display buffer."""
|
|
84
|
+
return voxels
|
|
85
|
+
EOF
|
|
86
|
+
for n in ledger imaging; do
|
|
87
|
+
git -C /tmp/smoke/$n init -q
|
|
88
|
+
git -C /tmp/smoke/$n add -A
|
|
89
|
+
git -C /tmp/smoke/$n -c user.email=t@t -c user.name=t \
|
|
90
|
+
commit -q -m "initial $n service"
|
|
91
|
+
done
|
|
92
|
+
export LOCI_HOME=/tmp/smoke/home
|
|
93
|
+
loci scan /tmp/smoke
|
|
94
|
+
loci index
|
|
95
|
+
loci doctor || true
|
|
96
|
+
loci eval
|
|
97
|
+
|
|
98
|
+
# Assert, do not merely run. Each check below has failed at some point
|
|
99
|
+
# during development.
|
|
100
|
+
loci route "how are dunning notices raised for an invoice?" --no-cwd \
|
|
101
|
+
| tee /tmp/r1 && grep -q ledger /tmp/r1
|
|
102
|
+
loci route "how is DICOM voxel windowing applied?" --no-cwd \
|
|
103
|
+
| tee /tmp/r2 && grep -q imaging /tmp/r2
|
|
104
|
+
loci route "what is the best recipe for sourdough starter?" --no-cwd \
|
|
105
|
+
| tee /tmp/r3 && grep -q ABSTAIN /tmp/r3
|
|
106
|
+
# Assert on RETRIEVED CONTENT, not on the scope banner. Grepping for
|
|
107
|
+
# "ledger" passed while the body read "no evidence in this scope",
|
|
108
|
+
# because the scope name appears in the header either way.
|
|
109
|
+
cd /tmp/smoke/ledger
|
|
110
|
+
loci ask "how is a dunning notice raised?" --fast --no-structure \
|
|
111
|
+
| tee /tmp/r4
|
|
112
|
+
grep -q "Reconciles invoices" /tmp/r4
|
|
113
|
+
! grep -q "no evidence" /tmp/r4
|
|
114
|
+
|
|
115
|
+
build:
|
|
116
|
+
name: wheel metadata
|
|
117
|
+
runs-on: ubuntu-latest
|
|
118
|
+
steps:
|
|
119
|
+
- uses: actions/checkout@v4
|
|
120
|
+
- uses: actions/setup-python@v5
|
|
121
|
+
with:
|
|
122
|
+
python-version: "3.12"
|
|
123
|
+
- run: python -m pip install --upgrade pip build twine
|
|
124
|
+
- run: python -m build
|
|
125
|
+
- name: The distribution is loci-mem; the import is loci
|
|
126
|
+
run: |
|
|
127
|
+
python -m twine check dist/*
|
|
128
|
+
python - <<'PY'
|
|
129
|
+
import zipfile, glob, re
|
|
130
|
+
whl = sorted(glob.glob("dist/*.whl"))[-1]
|
|
131
|
+
names = zipfile.ZipFile(whl).namelist()
|
|
132
|
+
meta = zipfile.ZipFile(whl).read(
|
|
133
|
+
[n for n in names if n.endswith("METADATA")][0]).decode()
|
|
134
|
+
assert re.search(r"^Name: loci-mem$", meta, re.M), "distribution name drifted"
|
|
135
|
+
assert any(n.startswith("loci/") for n in names), "import package missing"
|
|
136
|
+
eps = zipfile.ZipFile(whl).read(
|
|
137
|
+
[n for n in names if n.endswith("entry_points.txt")][0]).decode()
|
|
138
|
+
assert "loci = loci.cli:main" in eps, "console script drifted"
|
|
139
|
+
print("ok:", whl.split("/")[-1])
|
|
140
|
+
PY
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
*.egg-info/
|
|
2
|
+
*.py[cod]
|
|
3
|
+
.loci/
|
|
4
|
+
.pytest_cache/
|
|
5
|
+
.venv/
|
|
6
|
+
__pycache__/
|
|
7
|
+
build/
|
|
8
|
+
dist/
|
|
9
|
+
graphify-out/
|
|
10
|
+
venv/
|
|
11
|
+
|
|
12
|
+
# Internal planning docs and agent scaffolding -- kept locally, not published.
|
|
13
|
+
# Untracked is not enough: hatchling filters the sdist by .gitignore, so an
|
|
14
|
+
# unignored working directory ships to PyPI. .superpowers put 500KB of review
|
|
15
|
+
# diffs in the 0.1.0 sdist before this line existed.
|
|
16
|
+
ROADMAP.md
|
|
17
|
+
docs/
|
|
18
|
+
.superpowers/
|
loci_mem-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yigit Yildiz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|