wick-formatter 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.
- wick_formatter-0.1.0/.github/CODEOWNERS +4 -0
- wick_formatter-0.1.0/.github/dependabot.yml +25 -0
- wick_formatter-0.1.0/.github/workflows/ci.yml +48 -0
- wick_formatter-0.1.0/.github/workflows/release.yml +133 -0
- wick_formatter-0.1.0/.gitignore +51 -0
- wick_formatter-0.1.0/CODE_OF_CONDUCT.md +83 -0
- wick_formatter-0.1.0/Dockerfile +36 -0
- wick_formatter-0.1.0/LICENSE +21 -0
- wick_formatter-0.1.0/Makefile +95 -0
- wick_formatter-0.1.0/NOTICE +22 -0
- wick_formatter-0.1.0/PKG-INFO +191 -0
- wick_formatter-0.1.0/README.md +141 -0
- wick_formatter-0.1.0/SECURITY.md +50 -0
- wick_formatter-0.1.0/dist/.gitignore +1 -0
- wick_formatter-0.1.0/docs/BENCHMARK_RESULTS.md +153 -0
- wick_formatter-0.1.0/docs/CHANGELOG.md +38 -0
- wick_formatter-0.1.0/docs/ROADMAP.md +86 -0
- wick_formatter-0.1.0/docs/SPEC.md +1606 -0
- wick_formatter-0.1.0/docs/superpowers/plans/2026-04-12-ci-cd-docker.md +594 -0
- wick_formatter-0.1.0/docs/superpowers/plans/2026-04-12-v010-release-readiness.md +588 -0
- wick_formatter-0.1.0/docs/superpowers/specs/2026-04-12-ci-cd-docker-design.md +217 -0
- wick_formatter-0.1.0/docs/superpowers/specs/2026-04-12-v010-release-readiness-design.md +131 -0
- wick_formatter-0.1.0/pyproject.toml +58 -0
- wick_formatter-0.1.0/scripts/client-setup.sh +130 -0
- wick_formatter-0.1.0/src/wick_formatter/__init__.py +12 -0
- wick_formatter-0.1.0/src/wick_formatter/__main__.py +6 -0
- wick_formatter-0.1.0/src/wick_formatter/_native/.gitkeep +0 -0
- wick_formatter-0.1.0/src/wick_formatter/_schemas/wf_decode.json +15 -0
- wick_formatter-0.1.0/src/wick_formatter/_schemas/wf_encode.json +14 -0
- wick_formatter-0.1.0/src/wick_formatter/_version.py +8 -0
- wick_formatter-0.1.0/src/wick_formatter/cli.py +100 -0
- wick_formatter-0.1.0/src/wick_formatter/formats/__init__.py +0 -0
- wick_formatter-0.1.0/src/wick_formatter/formats/json/__init__.py +1 -0
- wick_formatter-0.1.0/src/wick_formatter/formats/json/format.py +25 -0
- wick_formatter-0.1.0/src/wick_formatter/formats/lean/__init__.py +2 -0
- wick_formatter-0.1.0/src/wick_formatter/formats/lean/decoder.py +529 -0
- wick_formatter-0.1.0/src/wick_formatter/formats/lean/encoder.py +438 -0
- wick_formatter-0.1.0/src/wick_formatter/formats/lean/errors.py +32 -0
- wick_formatter-0.1.0/src/wick_formatter/formats/lean/format.py +17 -0
- wick_formatter-0.1.0/src/wick_formatter/mcp.py +114 -0
- wick_formatter-0.1.0/src/wick_formatter/registry.py +36 -0
- wick_formatter-0.1.0/tests/__init__.py +0 -0
- wick_formatter-0.1.0/tests/benchmarks/__init__.py +0 -0
- wick_formatter-0.1.0/tests/benchmarks/_templates/prompt.txt +8 -0
- wick_formatter-0.1.0/tests/benchmarks/conftest.py +114 -0
- wick_formatter-0.1.0/tests/benchmarks/custom/case01.jsonl +1 -0
- wick_formatter-0.1.0/tests/benchmarks/custom/case02.jsonl +1 -0
- wick_formatter-0.1.0/tests/benchmarks/ollama_client.py +48 -0
- wick_formatter-0.1.0/tests/benchmarks/scoring.py +18 -0
- wick_formatter-0.1.0/tests/benchmarks/test_accuracy.py +142 -0
- wick_formatter-0.1.0/tests/benchmarks/test_compression.py +85 -0
- wick_formatter-0.1.0/tests/benchmarks/wtq_loader.py +53 -0
- wick_formatter-0.1.0/tests/conftest.py +24 -0
- wick_formatter-0.1.0/tests/integration/__init__.py +0 -0
- wick_formatter-0.1.0/tests/integration/test_cli.py +72 -0
- wick_formatter-0.1.0/tests/integration/test_mcp.py +76 -0
- wick_formatter-0.1.0/tests/round_trip/__init__.py +0 -0
- wick_formatter-0.1.0/tests/round_trip/fixtures/config_flat.json +8 -0
- wick_formatter-0.1.0/tests/round_trip/fixtures/config_flat.lean +6 -0
- wick_formatter-0.1.0/tests/round_trip/fixtures/nested_api.json +11 -0
- wick_formatter-0.1.0/tests/round_trip/fixtures/nested_api.lean +5 -0
- wick_formatter-0.1.0/tests/round_trip/fixtures/semi_tabular.json +6 -0
- wick_formatter-0.1.0/tests/round_trip/fixtures/semi_tabular.lean +5 -0
- wick_formatter-0.1.0/tests/round_trip/fixtures/table_users.json +5 -0
- wick_formatter-0.1.0/tests/round_trip/fixtures/table_users.lean +4 -0
- wick_formatter-0.1.0/tests/round_trip/test_fixtures.py +425 -0
- wick_formatter-0.1.0/tests/round_trip/test_hypothesis.py +102 -0
- wick_formatter-0.1.0/tests/round_trip/test_lean_fixtures.py +53 -0
- wick_formatter-0.1.0/tests/unit/__init__.py +0 -0
- wick_formatter-0.1.0/tests/unit/test_cli_unit.py +40 -0
- wick_formatter-0.1.0/tests/unit/test_hypothesis_regressions.py +152 -0
- wick_formatter-0.1.0/tests/unit/test_json_format.py +28 -0
- wick_formatter-0.1.0/tests/unit/test_lean_decoder_block.py +32 -0
- wick_formatter-0.1.0/tests/unit/test_lean_decoder_dispatch.py +50 -0
- wick_formatter-0.1.0/tests/unit/test_lean_decoder_dot_flatten.py +28 -0
- wick_formatter-0.1.0/tests/unit/test_lean_decoder_scalars.py +61 -0
- wick_formatter-0.1.0/tests/unit/test_lean_decoder_tabular.py +66 -0
- wick_formatter-0.1.0/tests/unit/test_lean_encoder_block.py +42 -0
- wick_formatter-0.1.0/tests/unit/test_lean_encoder_dot_flatten.py +39 -0
- wick_formatter-0.1.0/tests/unit/test_lean_encoder_picker.py +60 -0
- wick_formatter-0.1.0/tests/unit/test_lean_encoder_scalars.py +91 -0
- wick_formatter-0.1.0/tests/unit/test_lean_encoder_semi_tabular.py +60 -0
- wick_formatter-0.1.0/tests/unit/test_lean_encoder_tabular.py +54 -0
- wick_formatter-0.1.0/tests/unit/test_lean_errors.py +32 -0
- wick_formatter-0.1.0/tests/unit/test_mcp_import.py +22 -0
- wick_formatter-0.1.0/tests/unit/test_registry.py +57 -0
- wick_formatter-0.1.0/tests/unit/test_scoring.py +29 -0
- wick_formatter-0.1.0/uv.lock +2221 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "pip"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "weekly"
|
|
7
|
+
day: "monday"
|
|
8
|
+
groups:
|
|
9
|
+
dev-dependencies:
|
|
10
|
+
patterns:
|
|
11
|
+
- "pytest*"
|
|
12
|
+
- "hypothesis"
|
|
13
|
+
- "coverage"
|
|
14
|
+
|
|
15
|
+
- package-ecosystem: "github-actions"
|
|
16
|
+
directory: "/"
|
|
17
|
+
schedule:
|
|
18
|
+
interval: "weekly"
|
|
19
|
+
day: "monday"
|
|
20
|
+
|
|
21
|
+
- package-ecosystem: "docker"
|
|
22
|
+
directory: "/"
|
|
23
|
+
schedule:
|
|
24
|
+
interval: "weekly"
|
|
25
|
+
day: "monday"
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
permissions: read-all
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Checkout
|
|
21
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
22
|
+
|
|
23
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
24
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python-version }}
|
|
27
|
+
|
|
28
|
+
- name: Install uv
|
|
29
|
+
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
|
30
|
+
|
|
31
|
+
- name: Install dependencies
|
|
32
|
+
run: uv sync --frozen --all-extras
|
|
33
|
+
|
|
34
|
+
- name: Run tests
|
|
35
|
+
run: |
|
|
36
|
+
uv run pytest tests/ -q --tb=short \
|
|
37
|
+
--cov=wick_formatter \
|
|
38
|
+
--cov-report=xml \
|
|
39
|
+
--cov-report=term-missing \
|
|
40
|
+
--ignore=tests/benchmarks/test_accuracy.py
|
|
41
|
+
|
|
42
|
+
- name: Upload coverage to Codecov
|
|
43
|
+
if: matrix.python-version == '3.12'
|
|
44
|
+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
|
|
45
|
+
with:
|
|
46
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
47
|
+
files: ./coverage.xml
|
|
48
|
+
fail_ci_if_error: true
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
packages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
attestations: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
test:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
strategy:
|
|
18
|
+
fail-fast: false
|
|
19
|
+
matrix:
|
|
20
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
21
|
+
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout
|
|
24
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
25
|
+
|
|
26
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
27
|
+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
28
|
+
with:
|
|
29
|
+
python-version: ${{ matrix.python-version }}
|
|
30
|
+
|
|
31
|
+
- name: Install uv
|
|
32
|
+
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
|
33
|
+
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
run: uv sync --frozen --all-extras
|
|
36
|
+
|
|
37
|
+
- name: Run tests
|
|
38
|
+
run: |
|
|
39
|
+
uv run pytest tests/ -q --tb=short \
|
|
40
|
+
--cov=wick_formatter \
|
|
41
|
+
--cov-report=term-missing \
|
|
42
|
+
--ignore=tests/benchmarks/test_accuracy.py
|
|
43
|
+
|
|
44
|
+
publish-pypi:
|
|
45
|
+
needs: test
|
|
46
|
+
runs-on: ubuntu-latest
|
|
47
|
+
environment:
|
|
48
|
+
name: pypi
|
|
49
|
+
url: https://pypi.org/project/wick-formatter/
|
|
50
|
+
|
|
51
|
+
steps:
|
|
52
|
+
- name: Checkout
|
|
53
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
54
|
+
|
|
55
|
+
- name: Install uv
|
|
56
|
+
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
|
57
|
+
|
|
58
|
+
- name: Build distributions
|
|
59
|
+
run: uv build
|
|
60
|
+
|
|
61
|
+
- name: Attest build provenance
|
|
62
|
+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
|
|
63
|
+
with:
|
|
64
|
+
subject-path: dist/*
|
|
65
|
+
|
|
66
|
+
- name: Publish to PyPI
|
|
67
|
+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
|
|
68
|
+
|
|
69
|
+
publish-docker:
|
|
70
|
+
needs: test
|
|
71
|
+
runs-on: ubuntu-latest
|
|
72
|
+
|
|
73
|
+
steps:
|
|
74
|
+
- name: Checkout
|
|
75
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
76
|
+
|
|
77
|
+
- name: Set up QEMU
|
|
78
|
+
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
|
|
79
|
+
|
|
80
|
+
- name: Set up Docker Buildx
|
|
81
|
+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
|
|
82
|
+
|
|
83
|
+
- name: Log in to GHCR
|
|
84
|
+
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
|
|
85
|
+
with:
|
|
86
|
+
registry: ghcr.io
|
|
87
|
+
username: ${{ github.actor }}
|
|
88
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
89
|
+
|
|
90
|
+
- name: Extract metadata
|
|
91
|
+
id: meta
|
|
92
|
+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
|
|
93
|
+
with:
|
|
94
|
+
images: ghcr.io/${{ github.repository }}
|
|
95
|
+
tags: |
|
|
96
|
+
type=semver,pattern={{version}}
|
|
97
|
+
type=semver,pattern={{major}}.{{minor}}
|
|
98
|
+
type=raw,value=latest
|
|
99
|
+
|
|
100
|
+
- name: Build amd64 image for scanning
|
|
101
|
+
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
|
102
|
+
with:
|
|
103
|
+
context: .
|
|
104
|
+
platforms: linux/amd64
|
|
105
|
+
load: true
|
|
106
|
+
tags: wick-formatter:scan
|
|
107
|
+
|
|
108
|
+
- name: Scan image with Trivy
|
|
109
|
+
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1 # 0.35.0
|
|
110
|
+
with:
|
|
111
|
+
image-ref: wick-formatter:scan
|
|
112
|
+
format: table
|
|
113
|
+
exit-code: 1
|
|
114
|
+
severity: CRITICAL,HIGH
|
|
115
|
+
|
|
116
|
+
- name: Build and push multi-arch image
|
|
117
|
+
id: build
|
|
118
|
+
uses: docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7.1.0
|
|
119
|
+
with:
|
|
120
|
+
context: .
|
|
121
|
+
platforms: linux/amd64,linux/arm64
|
|
122
|
+
push: true
|
|
123
|
+
tags: ${{ steps.meta.outputs.tags }}
|
|
124
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
125
|
+
sbom: true
|
|
126
|
+
provenance: true
|
|
127
|
+
|
|
128
|
+
- name: Attest build provenance
|
|
129
|
+
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
|
|
130
|
+
with:
|
|
131
|
+
subject-name: ghcr.io/${{ github.repository }}
|
|
132
|
+
subject-digest: ${{ steps.build.outputs.digest }}
|
|
133
|
+
push-to-registry: true
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Base: aggressive dotfile ignore + whitelist
|
|
2
|
+
# (pattern inherited from kalamajakapital/financial-models)
|
|
3
|
+
venv
|
|
4
|
+
__pycache__/
|
|
5
|
+
*.egg-info/
|
|
6
|
+
.*
|
|
7
|
+
!.env-example
|
|
8
|
+
!.githooks
|
|
9
|
+
!.gitignore
|
|
10
|
+
!.gitattributes
|
|
11
|
+
!.github
|
|
12
|
+
!.editorconfig
|
|
13
|
+
!.gitkeep
|
|
14
|
+
|
|
15
|
+
# Python build artifacts
|
|
16
|
+
dist/
|
|
17
|
+
build/
|
|
18
|
+
*.egg
|
|
19
|
+
*.whl
|
|
20
|
+
wheels/
|
|
21
|
+
|
|
22
|
+
# Design-history artifacts (brainstorming outputs, scratch docs)
|
|
23
|
+
# Not committed to the repo — local-only record
|
|
24
|
+
playground/
|
|
25
|
+
|
|
26
|
+
# Compiled extensions (Python + Rust via maturin, when added)
|
|
27
|
+
*.pyc
|
|
28
|
+
*.pyo
|
|
29
|
+
*.pyd
|
|
30
|
+
*.so
|
|
31
|
+
*.dylib
|
|
32
|
+
*.dll
|
|
33
|
+
|
|
34
|
+
# Rust / maturin (for future PyO3-built extensions)
|
|
35
|
+
# Note: Cargo.lock IS committed for wick (library + binary hybrid)
|
|
36
|
+
target/
|
|
37
|
+
|
|
38
|
+
# Test / coverage output
|
|
39
|
+
htmlcov/
|
|
40
|
+
coverage.xml
|
|
41
|
+
|
|
42
|
+
# Benchmark artifacts (cached datasets, result files)
|
|
43
|
+
# Reproducible by running the harness, not worth committing
|
|
44
|
+
tests/benchmarks/data/
|
|
45
|
+
tests/benchmarks/results/
|
|
46
|
+
tests/benchmarks/cache/
|
|
47
|
+
|
|
48
|
+
# OS noise
|
|
49
|
+
Thumbs.db
|
|
50
|
+
ehthumbs.db
|
|
51
|
+
Desktop.ini
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
+
|
|
9
|
+
## Our Standards
|
|
10
|
+
|
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
+
|
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
18
|
+
|
|
19
|
+
Examples of unacceptable behavior include:
|
|
20
|
+
|
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
22
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
23
|
+
* Public or private harassment
|
|
24
|
+
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
|
25
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
26
|
+
|
|
27
|
+
## Enforcement Responsibilities
|
|
28
|
+
|
|
29
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
+
|
|
31
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
32
|
+
|
|
33
|
+
## Scope
|
|
34
|
+
|
|
35
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
36
|
+
|
|
37
|
+
## Enforcement
|
|
38
|
+
|
|
39
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [to be configured — see SECURITY.md]. All complaints will be reviewed and investigated promptly and fairly.
|
|
40
|
+
|
|
41
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
42
|
+
|
|
43
|
+
## Enforcement Guidelines
|
|
44
|
+
|
|
45
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
46
|
+
|
|
47
|
+
### 1. Correction
|
|
48
|
+
|
|
49
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
50
|
+
|
|
51
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
52
|
+
|
|
53
|
+
### 2. Warning
|
|
54
|
+
|
|
55
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
56
|
+
|
|
57
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
58
|
+
|
|
59
|
+
### 3. Temporary Ban
|
|
60
|
+
|
|
61
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
62
|
+
|
|
63
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
64
|
+
|
|
65
|
+
### 4. Permanent Ban
|
|
66
|
+
|
|
67
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
68
|
+
|
|
69
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
70
|
+
|
|
71
|
+
## Attribution
|
|
72
|
+
|
|
73
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
74
|
+
|
|
75
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
76
|
+
|
|
77
|
+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
|
78
|
+
|
|
79
|
+
[homepage]: https://www.contributor-covenant.org
|
|
80
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
81
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
82
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
83
|
+
[translations]: https://www.contributor-covenant.org/translations
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1
|
|
2
|
+
|
|
3
|
+
# Stage 1: Builder
|
|
4
|
+
FROM python:3.12-slim@sha256:804ddf3251a60bbf9c92e73b7566c40428d54d0e79d3428194edf40da6521286 AS builder
|
|
5
|
+
|
|
6
|
+
# Install uv from official image
|
|
7
|
+
COPY --from=ghcr.io/astral-sh/uv@sha256:b1e699368d24c57cda93c338a57a8c5a119009ba809305cc8e86986d4a006754 /uv /usr/local/bin/uv
|
|
8
|
+
|
|
9
|
+
ENV UV_SYSTEM_PYTHON=1
|
|
10
|
+
|
|
11
|
+
WORKDIR /app
|
|
12
|
+
|
|
13
|
+
# Copy dependency files first for layer caching
|
|
14
|
+
COPY pyproject.toml uv.lock README.md LICENSE ./
|
|
15
|
+
COPY src/ src/
|
|
16
|
+
|
|
17
|
+
# Export frozen requirements and install to isolated prefix
|
|
18
|
+
RUN uv export --frozen --no-dev > requirements.txt && \
|
|
19
|
+
uv pip install --prefix=/install -r requirements.txt && \
|
|
20
|
+
uv pip install --prefix=/install --no-deps .
|
|
21
|
+
|
|
22
|
+
# Stage 2: Runtime
|
|
23
|
+
FROM python:3.12-slim@sha256:804ddf3251a60bbf9c92e73b7566c40428d54d0e79d3428194edf40da6521286
|
|
24
|
+
|
|
25
|
+
# Create non-root user
|
|
26
|
+
RUN groupadd --gid 10001 wickformatter && \
|
|
27
|
+
useradd --uid 10001 --gid wickformatter --shell /bin/false --no-create-home wickformatter
|
|
28
|
+
|
|
29
|
+
# Copy installed packages from builder
|
|
30
|
+
COPY --from=builder /install /usr/local
|
|
31
|
+
|
|
32
|
+
# Switch to non-root user
|
|
33
|
+
USER wickformatter
|
|
34
|
+
|
|
35
|
+
# MCP server entrypoint
|
|
36
|
+
ENTRYPOINT ["wick-formatter-mcp"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 wick-formatter contributors
|
|
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.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.DEFAULT_GOAL := all
|
|
2
|
+
|
|
3
|
+
.PHONY: .uv ## Check that uv is installed
|
|
4
|
+
.uv:
|
|
5
|
+
@uv -V || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/'
|
|
6
|
+
|
|
7
|
+
.PHONY: install ## Install the package and dependencies for local development
|
|
8
|
+
install: .uv
|
|
9
|
+
uv sync --frozen --all-extras
|
|
10
|
+
|
|
11
|
+
.PHONY: sync ## Sync venv with all dependencies (updates lockfile if needed)
|
|
12
|
+
sync: .uv
|
|
13
|
+
uv sync --all-extras
|
|
14
|
+
|
|
15
|
+
.PHONY: rebuild-lockfile ## Rebuild lockfile from scratch, updating all dependencies
|
|
16
|
+
rebuild-lockfile: .uv
|
|
17
|
+
uv lock --upgrade
|
|
18
|
+
|
|
19
|
+
.PHONY: test ## Run all tests (unit + round-trip + integration + compression benchmarks)
|
|
20
|
+
test: .uv
|
|
21
|
+
uv run pytest tests/ -q --tb=short --cov=wick_formatter --cov-report=term-missing --ignore=tests/benchmarks/test_accuracy.py
|
|
22
|
+
|
|
23
|
+
.PHONY: test-unit ## Run unit tests only
|
|
24
|
+
test-unit: .uv
|
|
25
|
+
uv run pytest tests/unit/ -q --tb=short --cov=wick_formatter --cov-report=term-missing
|
|
26
|
+
|
|
27
|
+
.PHONY: test-round-trip ## Run round-trip fixture and hypothesis tests
|
|
28
|
+
test-round-trip: .uv
|
|
29
|
+
uv run pytest tests/round_trip/ -q --tb=short --cov=wick_formatter --cov-report=term-missing
|
|
30
|
+
|
|
31
|
+
.PHONY: test-integration ## Run CLI and MCP integration tests
|
|
32
|
+
test-integration: .uv
|
|
33
|
+
uv run pytest tests/integration/ -q --tb=short --cov=wick_formatter --cov-report=term-missing
|
|
34
|
+
|
|
35
|
+
.PHONY: benchmark ## Run full benchmark suite including accuracy gate (requires Ollama)
|
|
36
|
+
benchmark: .uv
|
|
37
|
+
uv run pytest tests/benchmarks/ --run-benchmarks -q --tb=short -s
|
|
38
|
+
|
|
39
|
+
.PHONY: benchmark-quick ## Run benchmark suite in quick mode (5 WTQ + 5 custom, ~2 min)
|
|
40
|
+
benchmark-quick: .uv
|
|
41
|
+
uv run pytest tests/benchmarks/ --run-benchmarks --quick -q --tb=short -s
|
|
42
|
+
|
|
43
|
+
.PHONY: benchmark-compression ## Run compression gate only (no Ollama needed)
|
|
44
|
+
benchmark-compression: .uv
|
|
45
|
+
uv run pytest tests/benchmarks/test_compression.py -q --tb=short
|
|
46
|
+
|
|
47
|
+
.PHONY: clean ## Clear local caches and build artifacts
|
|
48
|
+
clean:
|
|
49
|
+
rm -rf `find . -name __pycache__`
|
|
50
|
+
rm -f `find . -type f -name '*.py[co]'`
|
|
51
|
+
rm -f `find . -type f -name '*~'`
|
|
52
|
+
rm -rf .cache
|
|
53
|
+
rm -rf .pytest_cache
|
|
54
|
+
rm -rf htmlcov
|
|
55
|
+
rm -rf *.egg-info
|
|
56
|
+
rm -f .coverage
|
|
57
|
+
rm -f .coverage.*
|
|
58
|
+
rm -rf build
|
|
59
|
+
rm -rf dist
|
|
60
|
+
rm -rf target
|
|
61
|
+
rm -rf .venv
|
|
62
|
+
|
|
63
|
+
.PHONY: all ## Run the standard pre-commit checks (test + compression benchmark)
|
|
64
|
+
all: test benchmark-compression
|
|
65
|
+
|
|
66
|
+
.PHONY: client-claude ## Install wick-formatter MCP server for Claude Code
|
|
67
|
+
client-claude:
|
|
68
|
+
@./scripts/client-setup.sh install claude
|
|
69
|
+
|
|
70
|
+
.PHONY: client-codex ## Install wick-formatter MCP server for Codex
|
|
71
|
+
client-codex:
|
|
72
|
+
@./scripts/client-setup.sh install codex
|
|
73
|
+
|
|
74
|
+
.PHONY: client-status ## Show MCP client configuration status
|
|
75
|
+
client-status:
|
|
76
|
+
@./scripts/client-setup.sh status
|
|
77
|
+
|
|
78
|
+
.PHONY: client-clean ## Remove wick-formatter from all MCP clients
|
|
79
|
+
client-clean:
|
|
80
|
+
@./scripts/client-setup.sh uninstall
|
|
81
|
+
|
|
82
|
+
.PHONY: help ## Display this message
|
|
83
|
+
help:
|
|
84
|
+
@grep -E \
|
|
85
|
+
'^.PHONY: .*?## .*$$' $(MAKEFILE_LIST) | \
|
|
86
|
+
sort | \
|
|
87
|
+
awk 'BEGIN {FS = ".PHONY: |## "}; {printf "\033[36m%-22s\033[0m %s\n", $$2, $$3}'
|
|
88
|
+
|
|
89
|
+
.PHONY: docker-build ## Build Docker image locally
|
|
90
|
+
docker-build:
|
|
91
|
+
docker build -t wick-formatter:local .
|
|
92
|
+
|
|
93
|
+
.PHONY: docker-run ## Run MCP server in Docker (stdio)
|
|
94
|
+
docker-run: docker-build
|
|
95
|
+
docker run -i --rm wick-formatter:local
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
wick-formatter
|
|
2
|
+
Copyright (c) 2026 wick-formatter contributors
|
|
3
|
+
|
|
4
|
+
This product is an independent Python implementation of the LEAN format
|
|
5
|
+
(LLM-Efficient Adaptive Notation), which was originally designed and
|
|
6
|
+
implemented by Denys Fiialko at:
|
|
7
|
+
|
|
8
|
+
https://github.com/fiialkod/lean-format
|
|
9
|
+
|
|
10
|
+
The original LEAN implementation is published without an explicit license
|
|
11
|
+
at the time of writing. wick-formatter does not copy source code or test
|
|
12
|
+
cases from the original implementation. The format itself is implemented
|
|
13
|
+
independently from publicly available descriptions and analysis.
|
|
14
|
+
|
|
15
|
+
We gratefully acknowledge Denys's original work on the LEAN format and the
|
|
16
|
+
related toon-mcp-server repository, where the semi-tabular encoding path
|
|
17
|
+
(`~`-marker rows for non-uniform object arrays) was first implemented.
|
|
18
|
+
Any design errors or deviations in wick-formatter's specification or
|
|
19
|
+
implementation are our own.
|
|
20
|
+
|
|
21
|
+
wick-formatter itself is licensed under the MIT License. See LICENSE for
|
|
22
|
+
the full text.
|