Skip to content

Commit 59b78a9

Browse files
committed
stage 5 done
1 parent a4bbcdf commit 59b78a9

File tree

19 files changed

+456
-31
lines changed

19 files changed

+456
-31
lines changed

.DS_Store

0 Bytes
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{"input": {"prompt": "swap 2 ETH to USDC", "policy": {"mapper": {"confidence_threshold": 0.7}}, "expect_ok": true, "expect_label": "swap_assets"}, "output": {"ok": true, "label": "swap_assets", "score": 0.72, "reason": "shim:accept:stage-4", "artifacts": {"mapper": {"score": 0.72, "reason": "heuristic:swap", "aux": {"reason": "heuristic:swap"}}, "verify": {"ok": true, "reason": "shim:accept:stage-4"}, "schema": {"v": 1, "keys": ["mapper", "verify"]}}}, "eval": {"ok": true, "label": "swap_assets", "expect_ok": true, "ok_match": true, "expect_label": "swap_assets", "label_match": true}}
2+
{"input": {"prompt": "deposit 10 ETH into aave", "context": {"oracle": {"age_sec": 5, "max_age_sec": 30}}, "policy": {"ltv_max": 0.75, "mapper": {"confidence_threshold": 0.7}}, "expect_ok": true, "expect_label": "deposit_asset"}, "output": {"ok": true, "label": "deposit_asset", "score": 0.71, "reason": "shim:accept:stage-4", "artifacts": {"mapper": {"score": 0.71, "reason": "heuristic:deposit", "aux": {"reason": "heuristic:deposit"}}, "verify": {"ok": true, "reason": "shim:accept:stage-4"}, "schema": {"v": 1, "keys": ["mapper", "verify"]}}}, "eval": {"ok": true, "label": "deposit_asset", "expect_ok": true, "ok_match": true, "expect_label": "deposit_asset", "label_match": true}}
3+
{"input": {"prompt": "withdraw 5 ETH", "context": {"oracle": {"age_sec": 5, "max_age_sec": 30}, "ltv": 0.8}, "policy": {"ltv_max": 0.75, "mapper": {"confidence_threshold": 0.7}}, "expect_ok": false, "expect_label": "withdraw_asset"}, "output": {"ok": false, "label": "withdraw_asset", "score": 0.73, "reason": "ltv", "artifacts": {"mapper": {"score": 0.73, "reason": "heuristic:withdraw", "aux": {"reason": "heuristic:withdraw"}}, "verify": {"ok": false, "reason": "ltv"}, "schema": {"v": 1, "keys": ["mapper", "verify"]}}}, "eval": {"ok": false, "label": "withdraw_asset", "expect_ok": false, "ok_match": true, "expect_label": "withdraw_asset", "label_match": true}}

.artifacts/defi_smoke_summary.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"total": 3, "ok": 2, "ok_acc": 0.6666666666666666, "label_acc": 1.0, "expect_ok_acc": 1.0, "exact_acc": 1.0, "sec": 8.687548875808716, "confusion": [{"pred": "deposit_asset", "expect": "deposit_asset", "count": 1}, {"pred": "swap_assets", "expect": "swap_assets", "count": 1}, {"pred": "withdraw_asset", "expect": "withdraw_asset", "count": 1}], "denominators": {"label": 3, "expect_ok": 3, "exact": 3}}

.github/workflows/ci.yml

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,20 @@
1-
name: CI
2-
on:
3-
push: { branches: ["**"] }
4-
pull_request:
5-
1+
name: ci
2+
on: [push, pull_request]
63
jobs:
7-
build-test:
4+
build-test-bench:
85
runs-on: ubuntu-latest
9-
strategy:
10-
matrix:
11-
python-version: [ "3.10", "3.11" ]
126
steps:
137
- uses: actions/checkout@v4
14-
15-
- name: Set up Python
16-
uses: actions/setup-python@v5
17-
with:
18-
python-version: ${{ matrix.python-version }}
19-
20-
- name: Install tools
8+
- uses: actions/setup-python@v5
9+
with: { python-version: "3.11" }
10+
- run: pip install -e . # keep deps light; add extras if needed
11+
- name: Unit tests
2112
run: |
22-
python -m pip install --upgrade pip
23-
pip install ruff pytest
24-
25-
- name: Lint (ruff)
26-
run: ruff . --output-format=github || (echo "::warning::Ruff issues found"; exit 1)
27-
28-
- name: Milestones freeze check
29-
run: .github/workflows/check_freeze.sh
30-
31-
- name: Tests (unit placeholder)
32-
run: pytest -q
33-
13+
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 pytest -q tests/unit
14+
- name: Bench (local-only rails)
15+
run: |
16+
MICROLM_DISABLE_RAILS=1 micro-lm-bench defi \
17+
--file benches/defi_smoke.jsonl \
18+
--out .artifacts/defi_smoke_results.jsonl \
19+
--summary-out .artifacts/defi_smoke_summary.json \
20+
--gate-metric exact_acc --gate-min 0.66

.ipynb_checkpoints/pyproject-checkpoint.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,16 @@ where = ["src"] # auto-discovers micro_lm, micro_lm.core, etc.
1414
package-dir = {"" = "src"}
1515

1616
[project.scripts]
17-
micro-lm = "micro_lm.cli:main"
17+
micro-lm = "micro_lm.cli.entry:main"
18+
micro-lm-bench = "micro_lm.bench_cli:main"
19+
20+
[project.optional-dependencies]
21+
sbert = [
22+
"sentence-transformers>=2.7,<3",
23+
"scikit-learn>=1.3,<2",
24+
"joblib>=1.3,<2",
25+
]
26+
dev = [
27+
"pytest",
28+
"ruff",
29+
]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{"prompt":"swap 2 ETH to USDC","policy":{"mapper":{"confidence_threshold":0.7}}}
2+
{"prompt":"deposit 10 ETH into aave","context":{"oracle":{"age_sec":5,"max_age_sec":30}},"policy":{"ltv_max":0.75,"mapper":{"confidence_threshold":0.7}}}
3+
{"prompt":"withdraw 5 ETH","context":{"oracle":{"age_sec":5,"max_age_sec":30},"ltv":0.80},"policy":{"ltv_max":0.75,"mapper":{"confidence_threshold":0.7}}}

benches/defi_smoke.jsonl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{"prompt":"swap 2 ETH to USDC","policy":{"mapper":{"confidence_threshold":0.7}},"expect_ok":true,"expect_label":"swap_assets"}
2+
{"prompt":"deposit 10 ETH into aave","context":{"oracle":{"age_sec":5,"max_age_sec":30}},"policy":{"ltv_max":0.75,"mapper":{"confidence_threshold":0.7}},"expect_ok":true,"expect_label":"deposit_asset"}
3+
{"prompt":"withdraw 5 ETH","context":{"oracle":{"age_sec":5,"max_age_sec":30},"ltv":0.80},"policy":{"ltv_max":0.75,"mapper":{"confidence_threshold":0.7}},"expect_ok":false,"expect_label":"withdraw_asset"}
4+

pyproject.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,16 @@ where = ["src"] # auto-discovers micro_lm, micro_lm.core, etc.
1414
package-dir = {"" = "src"}
1515

1616
[project.scripts]
17-
micro-lm = "micro_lm.cli:main"
17+
micro-lm = "micro_lm.cli.entry:main"
18+
micro-lm-bench = "micro_lm.bench_cli:main"
19+
20+
[project.optional-dependencies]
21+
sbert = [
22+
"sentence-transformers>=2.7,<3",
23+
"scikit-learn>=1.3,<2",
24+
"joblib>=1.3,<2",
25+
]
26+
dev = [
27+
"pytest",
28+
"ruff",
29+
]

src/micro_lm.egg-info/PKG-INFO

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,11 @@ Name: micro-lm
33
Version: 0.0.0a0
44
Requires-Python: >=3.10
55
License-File: LICENSE
6+
Provides-Extra: sbert
7+
Requires-Dist: sentence-transformers<3,>=2.7; extra == "sbert"
8+
Requires-Dist: scikit-learn<2,>=1.3; extra == "sbert"
9+
Requires-Dist: joblib<2,>=1.3; extra == "sbert"
10+
Provides-Extra: dev
11+
Requires-Dist: pytest; extra == "dev"
12+
Requires-Dist: ruff; extra == "dev"
613
Dynamic: license-file

src/micro_lm.egg-info/SOURCES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ LICENSE
22
README.md
33
pyproject.toml
44
src/micro_lm/__init__.py
5+
src/micro_lm/bench_cli.py
6+
src/micro_lm/config.py
57
src/micro_lm.egg-info/PKG-INFO
68
src/micro_lm.egg-info/SOURCES.txt
79
src/micro_lm.egg-info/dependency_links.txt
810
src/micro_lm.egg-info/entry_points.txt
11+
src/micro_lm.egg-info/requires.txt
912
src/micro_lm.egg-info/top_level.txt
1013
src/micro_lm/cli/__init__.py
1114
src/micro_lm/cli/__main__.py

0 commit comments

Comments
 (0)