fabricium 0.1.1__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.
- fabricium-0.1.1/.env.example +19 -0
- fabricium-0.1.1/.github/workflows/ci.yml +38 -0
- fabricium-0.1.1/.github/workflows/release.yml +80 -0
- fabricium-0.1.1/.gitignore +10 -0
- fabricium-0.1.1/CHANGELOG.md +43 -0
- fabricium-0.1.1/CONTRIBUTING.md +132 -0
- fabricium-0.1.1/LICENSE +21 -0
- fabricium-0.1.1/PKG-INFO +8 -0
- fabricium-0.1.1/README.md +402 -0
- fabricium-0.1.1/docs/fabricium-proposal.md +275 -0
- fabricium-0.1.1/pyproject.toml +39 -0
- fabricium-0.1.1/src/fabricium/__init__.py +589 -0
- fabricium-0.1.1/src/fabricium/evals/__init__.py +71 -0
- fabricium-0.1.1/src/fabricium/evals/config.py +230 -0
- fabricium-0.1.1/src/fabricium/evals/example_rubrics.py +236 -0
- fabricium-0.1.1/src/fabricium/evals/example_tasks.py +290 -0
- fabricium-0.1.1/src/fabricium/evals/harness.py +784 -0
- fabricium-0.1.1/src/fabricium/evals/judge.py +499 -0
- fabricium-0.1.1/src/fabricium/evals/proxy.py +195 -0
- fabricium-0.1.1/src/fabricium/evals/rubrics.py +95 -0
- fabricium-0.1.1/src/fabricium/evals/runner.py +92 -0
- fabricium-0.1.1/src/fabricium/evals/tasks.py +50 -0
- fabricium-0.1.1/src/fabricium/git_utils.py +252 -0
- fabricium-0.1.1/src/fabricium/prompts.py +21 -0
- fabricium-0.1.1/src/fabricium/py.typed +0 -0
- fabricium-0.1.1/src/fabricium/skills.py +105 -0
- fabricium-0.1.1/src/fabricium/state.py +73 -0
- fabricium-0.1.1/src/fabricium/testing/__init__.py +21 -0
- fabricium-0.1.1/src/fabricium/testing/assertions.py +337 -0
- fabricium-0.1.1/src/fabricium/testing/fixtures.py +131 -0
- fabricium-0.1.1/src/fabricium/testing/harness.py +415 -0
- fabricium-0.1.1/tests/__init__.py +0 -0
- fabricium-0.1.1/tests/conftest.py +134 -0
- fabricium-0.1.1/tests/integration/conftest.py +19 -0
- fabricium-0.1.1/tests/integration/test_cli.py +64 -0
- fabricium-0.1.1/tests/integration/test_plugin/__init__.py +18 -0
- fabricium-0.1.1/tests/integration/test_plugin/plugin.yaml +3 -0
- fabricium-0.1.1/tests/test_assertions.py +279 -0
- fabricium-0.1.1/tests/test_git_utils.py +175 -0
- fabricium-0.1.1/tests/test_plugin.py +140 -0
- fabricium-0.1.1/tests/test_skills.py +76 -0
- fabricium-0.1.1/tests/test_state.py +116 -0
- fabricium-0.1.1/uv.lock +397 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Fabricium Integration Test Configuration
|
|
2
|
+
# =========================================
|
|
3
|
+
# Copy this file to .env and fill in your credentials.
|
|
4
|
+
#
|
|
5
|
+
# Required: provider + API key
|
|
6
|
+
# Optional: model override (defaults to provider's cheapest model)
|
|
7
|
+
|
|
8
|
+
# Provider name (deepseek, openrouter, anthropic, openai, google, ...)
|
|
9
|
+
FABRICIUM_TEST_PROVIDER=deepseek
|
|
10
|
+
|
|
11
|
+
# Model identifier (e.g. deepseek/deepseek-chat, openrouter/anthropic/claude-sonnet-4)
|
|
12
|
+
FABRICIUM_TEST_MODEL=deepseek/deepseek-chat
|
|
13
|
+
|
|
14
|
+
# API key for the provider above
|
|
15
|
+
FABRICIUM_TEST_API_KEY=sk-your-key-here
|
|
16
|
+
|
|
17
|
+
# ── Debug ───────────────────────────────────────────────────────────
|
|
18
|
+
# Set to 1 to keep the Docker container after test failure (for inspection)
|
|
19
|
+
# FABRICIUM_TEST_KEEP=1
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
check:
|
|
11
|
+
name: Lint, type-check, and test
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Set up Python
|
|
18
|
+
uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: '3.11'
|
|
21
|
+
|
|
22
|
+
- name: Install uv
|
|
23
|
+
uses: astral-sh/setup-uv@v5
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: uv sync --dev
|
|
27
|
+
|
|
28
|
+
- name: Lint (ruff)
|
|
29
|
+
run: uv run ruff check .
|
|
30
|
+
|
|
31
|
+
- name: Format check (ruff)
|
|
32
|
+
run: uv run ruff format --check .
|
|
33
|
+
|
|
34
|
+
- name: Type check (mypy)
|
|
35
|
+
run: uv run mypy
|
|
36
|
+
|
|
37
|
+
- name: Run tests
|
|
38
|
+
run: uv run pytest -v --ignore=tests/integration/
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build-and-publish:
|
|
14
|
+
name: Build, check, and publish to PyPI
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: '3.11'
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@v5
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: uv sync --dev
|
|
30
|
+
|
|
31
|
+
- name: Lint (ruff)
|
|
32
|
+
run: uv run ruff check .
|
|
33
|
+
|
|
34
|
+
- name: Type check (mypy)
|
|
35
|
+
run: uv run mypy
|
|
36
|
+
|
|
37
|
+
- name: Run tests
|
|
38
|
+
run: uv run pytest --ignore=tests/integration/
|
|
39
|
+
|
|
40
|
+
- name: Extract version from tag
|
|
41
|
+
id: version
|
|
42
|
+
run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
|
43
|
+
|
|
44
|
+
- name: Verify pyproject version matches tag
|
|
45
|
+
run: |
|
|
46
|
+
PYPROJECT_VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
|
47
|
+
TAG_VERSION="${{ steps.version.outputs.version }}"
|
|
48
|
+
if [ "$PYPROJECT_VERSION" != "$TAG_VERSION" ]; then
|
|
49
|
+
echo "❌ pyproject.toml version ($PYPROJECT_VERSION) != tag version ($TAG_VERSION)"
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
echo "✅ Version $PYPROJECT_VERSION matches tag v$TAG_VERSION"
|
|
53
|
+
|
|
54
|
+
- name: Build package
|
|
55
|
+
run: uv build
|
|
56
|
+
|
|
57
|
+
- name: Publish to PyPI
|
|
58
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
59
|
+
with:
|
|
60
|
+
packages-dir: dist/
|
|
61
|
+
|
|
62
|
+
- name: Generate changelog for release
|
|
63
|
+
id: changelog
|
|
64
|
+
run: |
|
|
65
|
+
VERSION="${{ steps.version.outputs.version }}"
|
|
66
|
+
# Extract the section for this version from CHANGELOG.md
|
|
67
|
+
CHANGELOG=$(awk "/^## \[${VERSION}\]/{found=1; next} /^## \[/{if(found) exit} found" CHANGELOG.md)
|
|
68
|
+
# Write to file for multiline support
|
|
69
|
+
echo "$CHANGELOG" > /tmp/changelog.md
|
|
70
|
+
echo "changelog_file=/tmp/changelog.md" >> "$GITHUB_OUTPUT"
|
|
71
|
+
|
|
72
|
+
- name: Create GitHub Release
|
|
73
|
+
uses: softprops/action-gh-release@v2
|
|
74
|
+
with:
|
|
75
|
+
name: "v${{ steps.version.outputs.version }}"
|
|
76
|
+
body_path: "${{ steps.changelog.outputs.changelog_file }}"
|
|
77
|
+
files: dist/*
|
|
78
|
+
draft: false
|
|
79
|
+
prerelease: false
|
|
80
|
+
generate_release_notes: false
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Fabricium will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.1] — 2026-07-12
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **PyPI publishing via OIDC Trusted Publishing** — no API token required; release workflow binds to the GitHub repo via PyPI's pending publisher
|
|
13
|
+
|
|
14
|
+
## [0.1.0] — 2026-07-12
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **`HermesPlugin` class** — one-line plugin lifecycle registration: `setup`, `status`, `update`, `update --check`
|
|
19
|
+
- **Single-profile and multi-profile modes** — `default_profile="my-profile"` or `default_profile=None`
|
|
20
|
+
- **`fabricium.git_utils`** — Git subprocess wrappers: `fetch_remote`, `pull_branch`, `get_ahead_behind`, `get_diff`, `get_diff_stat`, `is_ancestor`, `stage_all`, `commit`, and more
|
|
21
|
+
- **`fabricium.state`** — JSON state persistence: `load_state`, `save_state`, `set_profile_state`
|
|
22
|
+
- **`fabricium.skills`** — Bundled skill lifecycle: `install_bundled_skills`, `remove_stale_skills`, `get_bundled_skill_names`
|
|
23
|
+
- **`fabricium.prompts`** — TTY-aware prompt utilities: `prompt_yes_no`
|
|
24
|
+
- **`fabricium.evals`** — Complete skill evaluation framework:
|
|
25
|
+
- `SkillEvalHarness` — Docker-based evaluation orchestrator
|
|
26
|
+
- `JudgeClient` — LLM-as-Judge with cross-provider support (Anthropic, OpenAI-compatible)
|
|
27
|
+
- `EvalConfig` — Environment-variable-driven configuration
|
|
28
|
+
- `EvalTask` / `RubricSpec` / `RubricDimension` / `ScoringBand` — task and rubric building blocks
|
|
29
|
+
- `calibrate()` — Judge-human agreement metrics (Cohen's κ, Spearman ρ)
|
|
30
|
+
- `JudgePrompt` — Customizable judge prompt templates
|
|
31
|
+
- Built-in example tasks and rubrics for Jovaltus evaluation
|
|
32
|
+
- Reasoning-model SSE proxy for DeepSeek V4 compatibility
|
|
33
|
+
- **`fabricium.testing`** — Docker-based integration test environment:
|
|
34
|
+
- `HermesDockerTestEnv` — Disposable Hermes container for CLI testing
|
|
35
|
+
- `CliAssert` — Composable CLI output assertions
|
|
36
|
+
- `HermesConfig` — Provider/model configuration for test environments
|
|
37
|
+
|
|
38
|
+
### Internals
|
|
39
|
+
|
|
40
|
+
- 104 tests covering plugin lifecycle, git utilities, state persistence, skill management, and CLI assertions
|
|
41
|
+
- ruff (E, F, I, N, W) + mypy `--strict` + pytest quality gates
|
|
42
|
+
- MIT license
|
|
43
|
+
- Conventional Commits history from initial extraction through eval pipeline refinements
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Contributing to Fabricium
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing! Fabricium is the shared infrastructure for Hermes plugins — improvements here benefit every plugin in the ecosystem.
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Clone and enter the repo
|
|
9
|
+
git clone https://github.com/LaiTszKin/fabricium.git
|
|
10
|
+
cd fabricium
|
|
11
|
+
|
|
12
|
+
# Install dev dependencies (pytest, ruff, mypy)
|
|
13
|
+
uv sync --dev
|
|
14
|
+
|
|
15
|
+
# Run the test suite (104 tests)
|
|
16
|
+
uv run pytest
|
|
17
|
+
|
|
18
|
+
# Lint and type-check
|
|
19
|
+
uv run ruff check .
|
|
20
|
+
uv run mypy
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Project Structure
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
fabricium/
|
|
27
|
+
├── src/fabricium/
|
|
28
|
+
│ ├── __init__.py # HermesPlugin class
|
|
29
|
+
│ ├── git_utils.py # Git subprocess wrappers
|
|
30
|
+
│ ├── state.py # JSON state persistence
|
|
31
|
+
│ ├── skills.py # Bundled skill lifecycle
|
|
32
|
+
│ ├── prompts.py # TTY-aware prompts
|
|
33
|
+
│ ├── evals/ # Skill evaluation framework
|
|
34
|
+
│ │ ├── __init__.py
|
|
35
|
+
│ │ ├── config.py # EvalConfig (env-var driven)
|
|
36
|
+
│ │ ├── harness.py # SkillEvalHarness (Docker orchestrator)
|
|
37
|
+
│ │ ├── judge.py # JudgeClient (LLM-as-Judge)
|
|
38
|
+
│ │ ├── tasks.py # EvalTask dataclass
|
|
39
|
+
│ │ ├── rubrics.py # RubricSpec, RubricDimension, ScoringBand
|
|
40
|
+
│ │ ├── runner.py # CLI entry point
|
|
41
|
+
│ │ ├── proxy.py # Reasoning-model SSE proxy
|
|
42
|
+
│ │ ├── example_tasks.py # Reference tasks for Jovaltus
|
|
43
|
+
│ │ └── example_rubrics.py
|
|
44
|
+
│ └── testing/ # Integration test environment
|
|
45
|
+
│ ├── __init__.py
|
|
46
|
+
│ ├── harness.py # HermesDockerTestEnv
|
|
47
|
+
│ ├── fixtures.py # Pytest fixtures
|
|
48
|
+
│ └── assertions.py # CliAssert
|
|
49
|
+
├── tests/
|
|
50
|
+
│ ├── conftest.py
|
|
51
|
+
│ ├── test_plugin.py
|
|
52
|
+
│ ├── test_git_utils.py
|
|
53
|
+
│ ├── test_state.py
|
|
54
|
+
│ ├── test_skills.py
|
|
55
|
+
│ ├── test_assertions.py
|
|
56
|
+
│ └── integration/
|
|
57
|
+
│ ├── conftest.py
|
|
58
|
+
│ └── test_cli.py
|
|
59
|
+
└── pyproject.toml
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Coding Standards
|
|
63
|
+
|
|
64
|
+
### Python
|
|
65
|
+
|
|
66
|
+
- **Style:** [ruff](https://docs.astral.sh/ruff/) with rules `E`, `F`, `I`, `N`, `W` (line length 100)
|
|
67
|
+
- **Types:** [mypy](https://mypy-lang.org/) with `--strict`
|
|
68
|
+
- **Tests:** [pytest](https://docs.pytest.org/) — aim for coverage on new code
|
|
69
|
+
- **Formatting:** ruff handles import sorting and formatting
|
|
70
|
+
|
|
71
|
+
Before committing:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
uv run ruff check . # Must pass
|
|
75
|
+
uv run ruff format --check . # Must be clean
|
|
76
|
+
uv run mypy # Must pass with --strict
|
|
77
|
+
uv run pytest # All 104 tests must pass
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Commit Messages
|
|
81
|
+
|
|
82
|
+
Follow [Conventional Commits](https://www.conventionalcommits.org/):
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
type(scope): description
|
|
86
|
+
|
|
87
|
+
- feat(evals): add parallel task execution
|
|
88
|
+
- fix(state): handle empty profiles in load_state
|
|
89
|
+
- refactor(plugin): extract profile helpers
|
|
90
|
+
- docs(readme): add eval quick start
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`, `ci`.
|
|
94
|
+
|
|
95
|
+
## Pull Request Process
|
|
96
|
+
|
|
97
|
+
1. **Open an issue first** for significant changes — discuss the design before writing code
|
|
98
|
+
2. **Branch from `main`** — use a descriptive branch name (`feat/eval-parallel`, `fix/state-empty-profiles`)
|
|
99
|
+
3. **Keep PRs focused** — one logical change per PR. If you find a pre-existing issue, open a separate PR
|
|
100
|
+
4. **Include tests** — new features need tests; bug fixes should include a regression test
|
|
101
|
+
5. **Update docs** — if you add/change public API, update README.md
|
|
102
|
+
6. **All checks must pass** — ruff, mypy, and pytest are required
|
|
103
|
+
|
|
104
|
+
## Design Principles
|
|
105
|
+
|
|
106
|
+
When contributing, keep these in mind:
|
|
107
|
+
|
|
108
|
+
1. **Extract only what's actually shared.** Code goes into Fabricium only when at least two plugins need it.
|
|
109
|
+
2. **Convention over configuration.** Sensible defaults. 99% of plugins shouldn't need options.
|
|
110
|
+
3. **Library, not framework.** Plugins import Fabricium — Fabricium doesn't control them.
|
|
111
|
+
4. **Zero runtime dependencies.** Fabricium uses only the Python standard library at runtime.
|
|
112
|
+
5. **Backward compatibility.** Existing plugins must not break on upgrade.
|
|
113
|
+
6. **TTY-safe by default.** Interactive prompts fall back to safe defaults when stdin is not a TTY.
|
|
114
|
+
|
|
115
|
+
## Running Integration Tests
|
|
116
|
+
|
|
117
|
+
Integration tests require Docker and a Hermes agent image:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Pull the Hermes image (one-time)
|
|
121
|
+
docker pull nousresearch/hermes-agent:latest
|
|
122
|
+
|
|
123
|
+
# Run integration tests
|
|
124
|
+
uv run pytest tests/integration/ -v
|
|
125
|
+
|
|
126
|
+
# Skip integration tests in CI where Docker isn't available
|
|
127
|
+
uv run pytest tests/ --ignore=tests/integration/
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Questions?
|
|
131
|
+
|
|
132
|
+
Open a [GitHub Discussion](https://github.com/LaiTszKin/fabricium/discussions) or file an issue. We're happy to help!
|
fabricium-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lai Tsz Kin
|
|
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.
|
fabricium-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fabricium
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Fabricium — Shared Hermes plugin infrastructure (CLI lifecycle, bundled skills, Git self-update, state persistence)
|
|
5
|
+
Author-email: LaiTszKin <laitszkin1206@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.10
|