Skip to content

Commit ff7bb35

Browse files
Hert4claude
andcommitted
chore: Phase 7 slice 3 — PyPI publish prep, version 0.1.0
Version was stuck at 0.0.1 and dev-status "Pre-Alpha" while we now have 3 harness adapters, 2 evidence adapters, 5 provider families, 319 tests, and a working docs site. Bumped the numbers to match reality and polished the metadata so `pip install trace2skill` (when we upload) lands on a properly-described package. - Version 0.0.1 → 0.1.0. - Dev-status classifier Pre-Alpha → Alpha. - Added classifiers: Intended Audience :: Science/Research, OS Independent, Python 3 / 3.13, Libraries :: Python Modules, Typing :: Typed. - Keywords: +claude-code, langchain, react, prompt-engineering, agentic. - [project.urls] 2 → 6 entries (Homepage, Documentation → gh-pages, Repository, Issues, Changelog, Paper). - `trace2skill/py.typed` marker so downstream consumers pick up type info without pyright whining about missing stubs. - [tool.hatch.build] explicit include/exclude so tests/, benchmarks/, _external/, examples/, docs/, site/ stay OUT of the wheel. Prompts + py.typed + LICENSE + CHANGELOG ship. - CHANGELOG.md (Keep-a-Changelog format) documents 0.1.0's feature surface + known gaps + security notes. `python -m build` produces: - trace2skill-0.1.0-py3-none-any.whl (101KB) - trace2skill-0.1.0.tar.gz (75KB) Wheel METADATA inspected — classifiers, URLs, keywords, required deps, optional extras all propagate correctly. Not uploaded to PyPI yet (needs account + `twine upload`). 319 tests still pass. plan.md §0.5 + Phase 7 row updated. Phase 7 now 🟢 for slices 1-3. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent daba526 commit ff7bb35

4 files changed

Lines changed: 95 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented here. This project loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and [Semantic Versioning](https://semver.org/).
4+
5+
## [Unreleased]
6+
7+
## [0.1.0] — 2026-04-24
8+
9+
First pre-release with a functional end-to-end pipeline and two real harness adapters. Not on PyPI yet; install from source.
10+
11+
### Added
12+
13+
- **Core pipeline**: 3-stage rollout → analyze → consolidate, async with `asyncio.Semaphore` gating. Defaults: `rollout_workers=32`, `analyst_workers=32`, merge batch size 32, max depth 6.
14+
- **Agentic Error Analyst** (the paper's main USP) with 6 tools: `inspect_skill_file`, `read_ground_truth`, `try_patch`, `diff_vs_gt`, `finish_with_patch`, `drop`. Quality-gate drops trajectories where the cause can't be verified.
15+
- **Prevalence-weighted hierarchical merge**: paper §2.4 inductive reasoning that keeps only edits appearing ≥2 times across the patch pool.
16+
- **3 deterministic guardrails** (file-exists, line-range conflict, trial-apply) that run before any LLM merger call.
17+
- **Signal layer**: `LLMJudge` + YAML rubrics with ensemble sampling (majority vote). Zero regex, zero hardcoded sentiment lists.
18+
- **Harness adapters**: `ClaudeCodeHarnessAdapter` (subprocess wrap of the real `claude` CLI), `LangChainHarnessAdapter` (wraps `AgentExecutor`), `SimpleReActHarness` (in-process reference).
19+
- **Evidence adapters**: `ClaudeCodeEvidenceAdapter` (parses `~/.claude/projects/*.jsonl`), `LangChainEvidenceAdapter` (walks LangSmith runs + feedback API).
20+
- **LLM providers**: `AnthropicLLMProvider` (prompt caching + SSE proxy fallback + Haiku double-encoded-JSON recovery), `OpenAICompatibleProvider` (one class covers OpenAI, Gemini, OpenRouter, DeepSeek, Groq, Together, xAI, Mistral via custom `base_url`).
21+
- **Skill format**: `AnthropicSkillFormat` (SKILL.md + resources/ with backup-dir filtering).
22+
- **CLI**: `trace2skill evolve`, `trace2skill evolve-online`, `trace2skill rollback`.
23+
- **Cost tracking**: `CostAccountant` tallies every LLM call, raises `BudgetExceeded` on `max_usd` cap.
24+
- **Semi-online closed loop**: SQLite `SessionStore`, `evolve_from_trajectories()` that skips Stage 1, atomic skill deploy with timestamped backup + reversible rollback.
25+
- **Examples**: `02_claude_code_basic` (20 tasks, real claude CLI, byte-for-byte evaluator), `03_claude_code_semi_online` (SessionEnd hook + SQLite ledger).
26+
- **Paper replication scaffolding**: SpreadsheetBench-Verified loader (400 tasks from HF), `SpreadsheetEvaluator` with range + quoted-sheet support, `AnalystDispatcher.analyst_modes` kwarg reproducing paper's +Error / +Success / +Combined conditions, `benchmarks/paper_replication/run_subset.py` orchestrator.
27+
- **Docs site** (mkdocs-material): index, getting-started, architecture, harnesses/{claude-code,langchain,custom}, providers, evidence, rubrics, roadmap, contributing.
28+
- **Tests**: 319 unit + e2e + 7 live integration passing. `ruff` clean, `pyright --strict` 0 errors on source.
29+
30+
### Known gaps
31+
32+
- Paper-level delta on SpreadsheetBench not produced (infra ready, needs `n_evolve ≥ 15-20` + ~$0.30-0.40 Gemini)
33+
- `LangChainEvidenceAdapter.next_user_turns` returns `[]` — LangSmith thread-id convention pending
34+
- Cline / OpenCode harness adapters pending
35+
- Rubric library: only `generic.yaml` shipped; 4 domain rubrics (code-editing, QA, search, spreadsheet) pending
36+
- Windows + non-ASCII repo path requires `PYTHONPATH="$(pwd)"` + `PYTHONIOENCODING=utf-8` workaround
37+
38+
### Security notes
39+
40+
- `.claude/settings.local.json` is gitignored — it can accumulate commands containing API keys in its allowlist.
41+
- `.env` is gitignored. See `.env.example` for the template.

plan.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
- **2026-04-23 (session 12)** — 2 parts. **(a) Competitive scan: SkillClaw (AMAP-ML, arXiv 2604.08377)** reviewed. Cloned at `_external/SkillClaw/` (gitignored). Complementary, not a scoop. Borrow-list parked in memory `skillclaw_competitor.md` + §0.6. **(b) Phase 4 paper-replication REAL RUN executed multiple times (~$0.30 total, Gemini 2.5 Pro).** Discovered + fixed 4 critical infra gaps the scaffolding had silently left: (1) `SpreadsheetEvaluator` couldn't handle range (`J2:J4`) or quoted-sheet (`'COLLECTION'!A1`) answer_positions — fixed with range tuple compare + quote stripping; (2) `AnalystDispatcher` was wired to simple `ErrorAnalyst` not the agentic one — flipped to `AgenticErrorAnalyst` (the USP); (3) `_ground_truth_text` couldn't read xlsx (tried UTF-8 decode on binary) — added `_dump_xlsx_as_text` helper so `read_ground_truth` tool actually works for spreadsheet domain; (4) pydantic's `TypeAdapter.json_schema()` emits `$defs` + `$ref` which Gemini OpenAI-compat rejects when embedded inside tool params — added `_inline_refs` resolver. **291 unit tests passing** (+6: 5 evaluator range/quoted-sheet, 2 agentic xlsx GT). Proof-of-life confirmed: pipeline runs end-to-end agentic with real xlsx GT visible; quality gate (`drop`) fires correctly; merger produces 0-1 ops at n_evolve=5 (prevalence threshold ≥2 too tight for subset this small — paper-level delta needs n_evolve ≥ 15-20, deferred). Committed `bb66c7d`.
1717
- **2026-04-24 (session 13)** — **Phase 5: LangChain harness + evidence adapters.** Two pieces shipped. **(a)** `LangChainHarnessAdapter` at `trace2skill/harnesses/langchain.py` (~200 LOC) — wraps LangChain's `AgentExecutor`, per-task executor build with skill-in-system-prompt + `create_tool_calling_agent`, converts `intermediate_steps` → `ReActStep`. Lazy langchain import. 13 unit tests via mock executor. **(b)** `LangChainEvidenceAdapter` at `trace2skill/evidence_adapters/langchain.py` (~280 LOC) — backed by LangSmith API. `collect(run_id)` fetches the root run + child runs, walks all descendants of `run_type == "tool"` (including nested sub-chains), orders by start_time, extracts feedback via `client.list_feedback`. `behavioral` has duration + token counts + project; `execution` has tool call/error counts with capped error snippets; feedback API errors swallowed gracefully (returns None) so evidence collection never fails on a flaky side-channel. 21 unit tests with `_FakeRun`/`_FakeFeedback` duck types + `patch("langsmith.Client")` for lazy-ctor verification. Added `[langchain]` pyproject extra (covers both adapters; langsmith comes transitively with langchain). Both modules pass `ruff` clean + `pyright --strict` 0 errors. **319 unit tests passing** (+21 from 298). Committed `2c23518` + `41a4e69`. Remaining Phase 5: Cline / OpenCode harness adapters, Gemini native SDK (thinking-mode), `examples/04_langchain_rag_agent/` demo, LangSmith thread-id convention for `next_user_turns`.
1818
- **2026-04-24 (session 14 slice 1)****Phase 7 kickoff: project polish.** README rewrite (was stale "Phase 0 scaffolding" — totally misleading while framework is at Phase 5/6 with 319 tests, 3 harness adapters, 5 provider families, 2 evidence sources). New README has real quickstart (example 02), minimal Python API example, architecture diagram, adapter matrix, honest status ("pre-alpha, actively developed"), citation. CONTRIBUTING.md added (closes Phase 0 deferred item): dev setup, 3-check gate (pytest + ruff + pyright strict), conventions, "add a new adapter" walkthrough with file pointers. `.github/ISSUE_TEMPLATE/` bug + feature templates, plus `pull_request_template.md` with plan.md phase + checklist. Committed `1e6d99b`.
19-
- **2026-04-24 (session 14 slice 2)****Phase 7 docs site.** mkdocs-material configured at `mkdocs.yml` with indigo palette + instant navigation + code-copy + pymdownx extensions. 10 doc pages under `docs/`: `index` (landing + ASCII pipeline diagram), `getting-started` (install + Windows-path caveat + Example 02 walkthrough), `architecture` (4 axes + 3 stages + data model + async choices), `harnesses/{index,claude-code,langchain,custom}` (custom.md has a ~30-line skeleton new adapter can start from), `providers`, `evidence`, `rubrics` (no-regex rule + bilingual pattern), `roadmap` (summary pointing at plan.md), `contributing` (summary pointing at CONTRIBUTING.md). Added `[docs]` pyproject extra + `.github/workflows/docs.yml` that builds on push/PR and deploys to GitHub Pages on main. `mkdocs build --strict` passes. `/site/` gitignored. Remaining slice 3: PyPI publish prep.
19+
- **2026-04-24 (session 14 slice 2)****Phase 7 docs site.** mkdocs-material configured at `mkdocs.yml` with indigo palette + instant navigation + code-copy + pymdownx extensions. 10 doc pages under `docs/`: `index` (landing + ASCII pipeline diagram), `getting-started` (install + Windows-path caveat + Example 02 walkthrough), `architecture` (4 axes + 3 stages + data model + async choices), `harnesses/{index,claude-code,langchain,custom}` (custom.md has a ~30-line skeleton new adapter can start from), `providers`, `evidence`, `rubrics` (no-regex rule + bilingual pattern), `roadmap` (summary pointing at plan.md), `contributing` (summary pointing at CONTRIBUTING.md). Added `[docs]` pyproject extra + `.github/workflows/docs.yml` that builds on push/PR and deploys to GitHub Pages on main. `mkdocs build --strict` passes. `/site/` gitignored. Committed `daba526`.
20+
- **2026-04-24 (session 14 slice 3)** — **Phase 7 PyPI publish prep.** Version bumped `0.0.1` → `0.1.0` (reflects the real functional surface: 3 harness adapters + 2 evidence adapters + 5 provider families + 319 tests, not "pre-alpha scaffolding"). Dev Status classifier upgraded Pre-Alpha → Alpha. Classifiers expanded: `Intended Audience :: Science/Research`, `Operating System :: OS Independent`, `Python :: 3` / `3.13`, `Topic :: Software Development :: Libraries :: Python Modules`, `Typing :: Typed`. Keywords broadened (`claude-code`, `langchain`, `react`, `prompt-engineering`, `agentic`). `[project.urls]` expanded from 2 → 6 (Homepage, Documentation→gh-pages, Repository, Issues, Changelog, Paper). `trace2skill/py.typed` marker added so downstream users get type info without `reportMissingTypeStubs` noise. `[tool.hatch.build]` explicit include/exclude lists to keep `tests/`, `benchmarks/`, `_external/`, `examples/`, `docs/`, `site/` OUT of the wheel. `CHANGELOG.md` written in Keep-a-Changelog format. `python -m build` produces clean `trace2skill-0.1.0-py3-none-any.whl` (101KB) + sdist (75KB) with prompts + py.typed + LICENSE + entry_points.txt shipped. Wheel METADATA inspected — all classifiers + URLs + keywords propagate correctly. **Not uploaded to PyPI yet** (needs user's PyPI account + `twine upload`). 319 tests still pass.
2021

2122
---
2223

@@ -44,9 +45,10 @@ Không đụng vào weights của model (không phải finetuning). Không onlin
4445

4546
## 0.5. Progress Snapshot
4647

47-
> **Last updated:** 2026-04-24 (session 14 slices 1+2 — Phase 7 project polish + mkdocs site)
48-
> **Sessions invested:** 14 (Phase 0 → 3.5 → 6 → 5 subset → 4 scaffolding → SkillClaw + Phase 4 infra → Phase 5 LangChain x2 → Phase 7 project polish + docs)
49-
> **Test status:** 319 unit + e2e + 7 live integration passing (unchanged — session 14 is docs-only). `ruff` clean, `pyright --strict` 0 errors trên source em viết. Pre-existing 1 Windows path test failure (`test_slug_matches_observed_claude_cli_rule` — hardcoded Unix path).
48+
> **Last updated:** 2026-04-24 (session 14 slices 1+2+3 — Phase 7 polish + docs + PyPI prep)
49+
> **Sessions invested:** 14 (Phase 0 → 3.5 → 6 → 5 subset → 4 scaffolding → SkillClaw + Phase 4 infra → Phase 5 LangChain x2 → Phase 7 polish + docs + PyPI prep)
50+
> **Test status:** 319 unit + e2e + 7 live integration passing (unchanged — session 14 is docs + packaging, no code). `ruff` clean, `pyright --strict` 0 errors trên source em viết. Pre-existing 1 Windows path test failure.
51+
> **Version:** 0.1.0 (bumped session 14 slice 3). Wheel + sdist build clean with `python -m build`. PyPI upload pending user's account.
5052
> **Framework state:** **plug-and-forget với real Claude Code + multi-provider + paper-replication infra complete (session 12).** Agentic error analyst with xlsx-aware GT now actually active in pipeline (was silently wired to simple analyst before). Paper-replication runs end-to-end on real SpreadsheetBench data with Gemini Pro 2.5; signal-level delta paper-faithful run (n_evolve ≥ 15-20) deferred for cost/time.
5153
> **Competitive landscape:** SkillClaw (arXiv 2604.08377) reviewed session 12. Complementary product. See §0.6 Competitive landscape + memory `skillclaw_competitor.md`.
5254
@@ -62,7 +64,7 @@ Không đụng vào weights của model (không phải finetuning). Không onlin
6264
| 4. Paper Replication | 🟢 Infra complete (session 12) | Subset scaffolding (session 11) + 4 infra fixes (session 12): SpreadsheetEvaluator range + quoted-sheet; AnalystDispatcher wired to AgenticErrorAnalyst (not simple); `_ground_truth_text` xlsx-aware dump; `_inline_refs` schema resolver for Gemini tool-calling. Real runs executed with Gemini 2.5 Pro (~$0.30 total session 12). End-to-end functional including agentic analyst quality gate firing. Paper-level delta (n_evolve ≥ 15-20, ~$0.30-0.40, ~20 min wall clock) deferred. Full paper scale (6 conditions × 2 models × 200/200) deferred. |
6365
| 5. Multi-harness Expansion | 🟡 Providers + LangChain pair done (session 10 + 13) |`OpenAICompatibleProvider` generic (session 10). ✅ `LangChainHarnessAdapter` + ✅ `LangChainEvidenceAdapter` via LangSmith (session 13) — 34 unit tests. Remaining: Cline/OpenCode harness, Gemini native SDK (if thinking-mode needed), LangChain example demo. |
6466
| 6. Semi-online Closed Loop | ✅ Done (MVP) | SessionStore (SQLite), `evolve_from_trajectories()` skip-Stage-1, skill deploy + atomic backup + rollback, `trace2skill evolve-online` + `trace2skill rollback` CLI, example 03 với SessionEnd hook. Skip y=0 trajectories (agentic ErrorAnalyst cần GT — paper §2.3, heuristic error mode defer). |
65-
| 7. Release & Ecosystem | 🟡 Slices 1+2 done (session 14) | ✅ Slice 1: README rewrite + CONTRIBUTING.md + `.github/ISSUE_TEMPLATE/` + PR template. ✅ Slice 2: mkdocs-material docs site (8 pages: index / getting-started / architecture / harnesses x3 / providers / evidence / rubrics / roadmap / contributing) + `mkdocs.yml` + `[docs]` pyproject extra + `.github/workflows/docs.yml` for gh-pages deploy on main. `mkdocs build --strict` passes. Remaining slice 3: PyPI publish prep (metadata + version bump + wheel test), launch materials. |
67+
| 7. Release & Ecosystem | 🟢 Slices 1+2+3 done (session 14) | ✅ Slice 1 project polish. ✅ Slice 2 mkdocs docs site. ✅ Slice 3 PyPI publish prep: version `0.0.1``0.1.0`, classifiers expanded (Alpha + Science/Research + Python 3.11/3.12/3.13 + Typing::Typed), keywords broadened, `[project.urls]` expanded to 6 links (Docs + Repo + Issues + Changelog + Paper), `trace2skill/py.typed` marker added, `hatch.build` include/exclude explicit, `CHANGELOG.md` written. `python -m build` produces clean `trace2skill-0.1.0-py3-none-any.whl` (101KB) + `.tar.gz` (75KB) with prompts + py.typed + LICENSE + entry_points shipped. Not pushed to PyPI — needs account + `twine upload`. Remaining: PyPI upload itself (manual), launch materials (HN/Twitter/Discord). |
6668

6769
### Files shipped (mapping tới plan §4 repo structure)
6870

pyproject.toml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,37 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "trace2skill"
7-
version = "0.0.1"
7+
version = "0.1.0"
88
description = "Harness-agnostic framework for evolving agent skills from trajectories (Trace2Skill, arXiv:2603.25158)"
99
readme = "README.md"
1010
license = { text = "MIT" }
1111
requires-python = ">=3.11"
1212
authors = [{ name = "Trace2Skill Contributors" }]
13-
keywords = ["agents", "llm", "skill-evolution", "trace2skill", "trajectory"]
13+
keywords = [
14+
"agents",
15+
"llm",
16+
"skill-evolution",
17+
"trace2skill",
18+
"trajectory",
19+
"claude-code",
20+
"langchain",
21+
"react",
22+
"prompt-engineering",
23+
"agentic",
24+
]
1425
classifiers = [
15-
"Development Status :: 2 - Pre-Alpha",
26+
"Development Status :: 3 - Alpha",
1627
"Intended Audience :: Developers",
28+
"Intended Audience :: Science/Research",
1729
"License :: OSI Approved :: MIT License",
30+
"Operating System :: OS Independent",
31+
"Programming Language :: Python :: 3",
1832
"Programming Language :: Python :: 3.11",
1933
"Programming Language :: Python :: 3.12",
34+
"Programming Language :: Python :: 3.13",
2035
"Topic :: Scientific/Engineering :: Artificial Intelligence",
36+
"Topic :: Software Development :: Libraries :: Python Modules",
37+
"Typing :: Typed",
2138
]
2239
dependencies = [
2340
"pydantic>=2.6",
@@ -50,15 +67,40 @@ docs = [
5067

5168
[project.urls]
5269
Homepage = "https://github.com/Hert4/trace2skill"
70+
Documentation = "https://hert4.github.io/trace2skill/"
71+
Repository = "https://github.com/Hert4/trace2skill"
72+
Issues = "https://github.com/Hert4/trace2skill/issues"
73+
Changelog = "https://github.com/Hert4/trace2skill/blob/main/CHANGELOG.md"
5374
Paper = "https://arxiv.org/abs/2603.25158"
5475

5576
[project.scripts]
5677
trace2skill = "trace2skill.cli.main:run"
5778

5879
[tool.hatch.build.targets.wheel]
5980
packages = ["trace2skill"]
60-
# Ensure non-.py assets (prompt templates) ship in the wheel.
61-
include = ["trace2skill/**/*.md"]
81+
82+
[tool.hatch.build.targets.wheel.force-include]
83+
# Non-.py assets that ship with the wheel.
84+
"trace2skill/py.typed" = "trace2skill/py.typed"
85+
86+
[tool.hatch.build]
87+
# Prompts are packaged; rubrics ship separately in the sdist for reference.
88+
include = [
89+
"trace2skill/**/*.py",
90+
"trace2skill/**/*.md",
91+
"trace2skill/py.typed",
92+
"README.md",
93+
"LICENSE",
94+
"CHANGELOG.md",
95+
]
96+
exclude = [
97+
"tests/",
98+
"benchmarks/",
99+
"_external/",
100+
"examples/",
101+
"docs/",
102+
"site/",
103+
]
62104

63105
[tool.ruff]
64106
line-length = 100

trace2skill/py.typed

Whitespace-only changes.

0 commit comments

Comments
 (0)