codeccat-train 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.
@@ -0,0 +1,24 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .pytest_cache/
4
+ .venv/
5
+ .alpha-env/
6
+ dist/
7
+ build/
8
+ *.egg-info/
9
+ research-results/
10
+ .env
11
+ .env.*
12
+ # Generated model weights must never be committed as source files
13
+ src/codeccat/models/
14
+
15
+ # Native build/test products (generated only in GitHub Actions)
16
+ native-prototype/python/codeccat/models/
17
+ native-prototype/model/
18
+ native-prototype/dist/
19
+ native-prototype/target/
20
+ ci-fixtures/
21
+ .root-clean/
22
+ .native-clean/
23
+ .clean/
24
+ .legacy/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Johnny Kao
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,128 @@
1
+ Metadata-Version: 2.5
2
+ Name: codeccat-train
3
+ Version: 0.1.0
4
+ Summary: Offline trainer and evaluator for CodecCat native encoding models
5
+ Project-URL: Repository, https://github.com/Johnny-Kao/CodecCat
6
+ Project-URL: Issues, https://github.com/Johnny-Kao/CodecCat/issues
7
+ Project-URL: Documentation, https://github.com/Johnny-Kao/CodecCat/blob/main/native-prototype/training/docs/GETTING_STARTED.md
8
+ Author: Johnny Kao
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Text Processing :: General
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: numpy>=2.0
23
+ Requires-Dist: scikit-learn<2,>=1.4
24
+ Description-Content-Type: text/markdown
25
+
26
+ # codeccat-train — independent offline training toolkit
27
+
28
+ Independent Python distribution for training and exporting CodecCat native
29
+ `.ccm` models. **Not a runtime dependency** of `codeccat`. The train
30
+ environment requires NumPy and scikit-learn; production inference does not.
31
+
32
+ **Release candidate: `codeccat-train 0.1.0` (independent package).** The core offline Trainer and end-to-end published-Runtime model-loading workflow are implemented and verified. This repository branch contains a stable release candidate; **PyPI availability is not implied until a separate verified publishing run succeeds**. Historical official L2/L3 reproduction establishes *reproducibility*, not a better model or permission to publish third-party training texts.
33
+
34
+ The same Trainer is used for both workflows: private community-supplied datasets
35
+ remain the user's responsibility; the project-maintained dataset is governed by
36
+ a separate rights and default-model acceptance decision. No user dataset or
37
+ generated model is automatically submitted to the CodecCat project.
38
+
39
+ From a checkout (works before and after the first PyPI publication):
40
+
41
+ ```bash
42
+ python -m pip install ./native-prototype/training
43
+ python -m codeccat_train fit --manifest dataset/manifest.jsonl --output custom.ccm --report training-report.json
44
+ ```
45
+
46
+ Dataset manifest format (one JSON object per line, paths relative to the
47
+ manifest file):
48
+
49
+ ```json
50
+ {"path":"samples/a.bin","encoding":"utf-8","split":"train","group":"document-a"}
51
+ {"path":"samples/b.bin","encoding":"shift_jis","split":"validation","group":"document-b"}
52
+ ```
53
+
54
+ The trainer checks strict decodability, rejects path traversal, conflicting
55
+ duplicate contents and train/validation source-group overlap. Supply varied,
56
+ lawfully obtained text samples with independently known encoding labels.
57
+ The training report stores both `manifest_sha256` (the manifest file bytes) and
58
+ `dataset_content_fingerprint_sha256` (a deterministic digest of accepted
59
+ input-file hashes, codec labels, group IDs and split assignments). Unlike a
60
+ manifest hash alone, the second value changes when an input file's content
61
+ changes at the same path. This does **not** prove dataset licensing or
62
+ independent holdout status, and does not expose raw training text.
63
+
64
+ The generated report describes model provenance and validation; it is **not**
65
+ a guarantee of accuracy on arbitrary real-world text.
66
+
67
+ See the [CodecCat repository](https://github.com/Johnny-Kao/CodecCat)
68
+ for the native runtime and [rights and provenance policy](https://github.com/Johnny-Kao/CodecCat/blob/main/RIGHTS_AND_PROVENANCE.md).
69
+
70
+ ## Verification and release boundary
71
+
72
+ - **Implemented and CI-verified:** grouped source-manifest ingestion and isolation,
73
+ deterministic same-environment CCM1/CCM2 training, native Runtime loading,
74
+ source-content fingerprints, candidate-vs-Stable Unicode comparison,
75
+ optional L3 training, exact pinned official historical L2/L3 replay.
76
+ - **Platform evidence:** training and Runtime interoperability checked on Linux
77
+ x64/ARM64 and macOS ARM64; custom-model Runtime portability checked on
78
+ macOS Intel and Windows x64.
79
+ - **Stable-candidate release boundary:** the independent `0.1.0` source/Wheel and release CI must pass before tagging. It is not available via PyPI until its own Trusted Publisher is configured and a separate upload succeeds. Historical training provenance is documented with residual risk, not universally cleared.
80
+ - **Not an automatic Runtime update:** installing or training with this tool
81
+ does not alter `codeccat` or the bundled Stable model. A candidate default
82
+ requires a separately approved evaluation and release.
83
+
84
+ CI evidence: [Trainer E2E](https://github.com/Johnny-Kao/CodecCat/actions/runs/42240463787),
85
+ [macOS ARM64 native trainer](https://github.com/Johnny-Kao/CodecCat/actions/runs/42237800042),
86
+ and [model submission standards](../../docs/MODEL_SUBMISSIONS.md).
87
+
88
+ ## Evaluate a trained model
89
+
90
+ Install the public `codeccat==0.1.0` Runtime only in the evaluation environment, then compare against the official bundled model:
91
+
92
+ ```bash
93
+ python -m codeccat_train evaluate --model custom.ccm \
94
+ --manifest dataset/test-manifest.jsonl --split test --report comparison.json
95
+ ```
96
+
97
+ This compares decoded Unicode text (primary) and exact codec labels (secondary), with per-codec results and paired improves/regressions. `--split validation` can be used for development, but **do not call it an independent holdout**. The command does not replace or update the official model.
98
+
99
+ ## Optional L3 and historical reproducibility
100
+
101
+ For the optional L3 Unicode-trigram artifact, the **same offline Trainer**
102
+ supports a train-only manifest. Unlike the L2 `--residual-focus` replay,
103
+ L3 uses every eligible unfiltered input record:
104
+
105
+ ```bash
106
+ codeccat-train fit-l3 --manifest dataset/train-only.jsonl \
107
+ --output language-l3.json --report l3-report.json
108
+ ```
109
+
110
+ L3 stays disabled by default. The pinned historical L2 CCM2 and L3 JSON
111
+ have both been reproduced byte-for-byte in GitHub Actions; see
112
+ [official source and reproducibility status](../../datasets/official/README.md).
113
+ The manual strict replay gate fails when required hashes, source
114
+ fingerprints or numeric identity evidence differ. This is **not** rights
115
+ clearance or authorization to replace a production model.
116
+
117
+ See [quick start](docs/GETTING_STARTED.md). The legacy `python -m codeccat_train --manifest ...` training command remains supported.
118
+
119
+ ## Compact CCM2 export
120
+
121
+ The same trainer can export `CCM2` float32 weights instead of the default `CCM1` float64 weights:
122
+
123
+ ```bash
124
+ codeccat-train fit --manifest dataset/manifest.jsonl --output custom-f32.ccm \
125
+ --report train-f32.json --precision f32
126
+ ```
127
+
128
+ `--precision f64` remains the default for compatibility. CCM2 stores IDF and bias as float64 while compressing the weight matrix to float32. A smaller model does not imply better accuracy; compare both models on independently held-out bytes before choosing one. This is a format option for custom models, **not** reproduction of the published official CCM2 model.
@@ -0,0 +1,103 @@
1
+ # codeccat-train — independent offline training toolkit
2
+
3
+ Independent Python distribution for training and exporting CodecCat native
4
+ `.ccm` models. **Not a runtime dependency** of `codeccat`. The train
5
+ environment requires NumPy and scikit-learn; production inference does not.
6
+
7
+ **Release candidate: `codeccat-train 0.1.0` (independent package).** The core offline Trainer and end-to-end published-Runtime model-loading workflow are implemented and verified. This repository branch contains a stable release candidate; **PyPI availability is not implied until a separate verified publishing run succeeds**. Historical official L2/L3 reproduction establishes *reproducibility*, not a better model or permission to publish third-party training texts.
8
+
9
+ The same Trainer is used for both workflows: private community-supplied datasets
10
+ remain the user's responsibility; the project-maintained dataset is governed by
11
+ a separate rights and default-model acceptance decision. No user dataset or
12
+ generated model is automatically submitted to the CodecCat project.
13
+
14
+ From a checkout (works before and after the first PyPI publication):
15
+
16
+ ```bash
17
+ python -m pip install ./native-prototype/training
18
+ python -m codeccat_train fit --manifest dataset/manifest.jsonl --output custom.ccm --report training-report.json
19
+ ```
20
+
21
+ Dataset manifest format (one JSON object per line, paths relative to the
22
+ manifest file):
23
+
24
+ ```json
25
+ {"path":"samples/a.bin","encoding":"utf-8","split":"train","group":"document-a"}
26
+ {"path":"samples/b.bin","encoding":"shift_jis","split":"validation","group":"document-b"}
27
+ ```
28
+
29
+ The trainer checks strict decodability, rejects path traversal, conflicting
30
+ duplicate contents and train/validation source-group overlap. Supply varied,
31
+ lawfully obtained text samples with independently known encoding labels.
32
+ The training report stores both `manifest_sha256` (the manifest file bytes) and
33
+ `dataset_content_fingerprint_sha256` (a deterministic digest of accepted
34
+ input-file hashes, codec labels, group IDs and split assignments). Unlike a
35
+ manifest hash alone, the second value changes when an input file's content
36
+ changes at the same path. This does **not** prove dataset licensing or
37
+ independent holdout status, and does not expose raw training text.
38
+
39
+ The generated report describes model provenance and validation; it is **not**
40
+ a guarantee of accuracy on arbitrary real-world text.
41
+
42
+ See the [CodecCat repository](https://github.com/Johnny-Kao/CodecCat)
43
+ for the native runtime and [rights and provenance policy](https://github.com/Johnny-Kao/CodecCat/blob/main/RIGHTS_AND_PROVENANCE.md).
44
+
45
+ ## Verification and release boundary
46
+
47
+ - **Implemented and CI-verified:** grouped source-manifest ingestion and isolation,
48
+ deterministic same-environment CCM1/CCM2 training, native Runtime loading,
49
+ source-content fingerprints, candidate-vs-Stable Unicode comparison,
50
+ optional L3 training, exact pinned official historical L2/L3 replay.
51
+ - **Platform evidence:** training and Runtime interoperability checked on Linux
52
+ x64/ARM64 and macOS ARM64; custom-model Runtime portability checked on
53
+ macOS Intel and Windows x64.
54
+ - **Stable-candidate release boundary:** the independent `0.1.0` source/Wheel and release CI must pass before tagging. It is not available via PyPI until its own Trusted Publisher is configured and a separate upload succeeds. Historical training provenance is documented with residual risk, not universally cleared.
55
+ - **Not an automatic Runtime update:** installing or training with this tool
56
+ does not alter `codeccat` or the bundled Stable model. A candidate default
57
+ requires a separately approved evaluation and release.
58
+
59
+ CI evidence: [Trainer E2E](https://github.com/Johnny-Kao/CodecCat/actions/runs/42240463787),
60
+ [macOS ARM64 native trainer](https://github.com/Johnny-Kao/CodecCat/actions/runs/42237800042),
61
+ and [model submission standards](../../docs/MODEL_SUBMISSIONS.md).
62
+
63
+ ## Evaluate a trained model
64
+
65
+ Install the public `codeccat==0.1.0` Runtime only in the evaluation environment, then compare against the official bundled model:
66
+
67
+ ```bash
68
+ python -m codeccat_train evaluate --model custom.ccm \
69
+ --manifest dataset/test-manifest.jsonl --split test --report comparison.json
70
+ ```
71
+
72
+ This compares decoded Unicode text (primary) and exact codec labels (secondary), with per-codec results and paired improves/regressions. `--split validation` can be used for development, but **do not call it an independent holdout**. The command does not replace or update the official model.
73
+
74
+ ## Optional L3 and historical reproducibility
75
+
76
+ For the optional L3 Unicode-trigram artifact, the **same offline Trainer**
77
+ supports a train-only manifest. Unlike the L2 `--residual-focus` replay,
78
+ L3 uses every eligible unfiltered input record:
79
+
80
+ ```bash
81
+ codeccat-train fit-l3 --manifest dataset/train-only.jsonl \
82
+ --output language-l3.json --report l3-report.json
83
+ ```
84
+
85
+ L3 stays disabled by default. The pinned historical L2 CCM2 and L3 JSON
86
+ have both been reproduced byte-for-byte in GitHub Actions; see
87
+ [official source and reproducibility status](../../datasets/official/README.md).
88
+ The manual strict replay gate fails when required hashes, source
89
+ fingerprints or numeric identity evidence differ. This is **not** rights
90
+ clearance or authorization to replace a production model.
91
+
92
+ See [quick start](docs/GETTING_STARTED.md). The legacy `python -m codeccat_train --manifest ...` training command remains supported.
93
+
94
+ ## Compact CCM2 export
95
+
96
+ The same trainer can export `CCM2` float32 weights instead of the default `CCM1` float64 weights:
97
+
98
+ ```bash
99
+ codeccat-train fit --manifest dataset/manifest.jsonl --output custom-f32.ccm \
100
+ --report train-f32.json --precision f32
101
+ ```
102
+
103
+ `--precision f64` remains the default for compatibility. CCM2 stores IDF and bias as float64 while compressing the weight matrix to float32. A smaller model does not imply better accuracy; compare both models on independently held-out bytes before choosing one. This is a format option for custom models, **not** reproduction of the published official CCM2 model.
@@ -0,0 +1,121 @@
1
+ # Offline model training with codeccat-train
2
+
3
+ CodecCat offers **one** offline training tool for anyone's dataset. The CLI and model format are shared; official and user-owned datasets differ in provenance and what is allowed to ship as an official release.
4
+
5
+ **Release candidate (2026-11-07):** Offline training and candidate evaluation are E2E-verified against the published Runtime. The source tree is preparing independent `codeccat-train==0.1.0` Stable distribution, which must pass release CI and PyPI Trusted Publishing before it becomes publicly installable from PyPI. Exact historical official L2 CCM2 and optional L3 replay have passed under pinned sources and dependencies; this is not data-rights clearance, stronger real-world accuracy, or authorization to promote a new default model. The separately published Runtime remains `codeccat==0.1.0`.
6
+
7
+ ## Quick local example
8
+
9
+ Use Python 3.12 and keep the trainer out of production environments:
10
+
11
+ ```bash
12
+ python -m venv .trainer-env
13
+ .trainer-env/bin/python -m pip install ./native-prototype/training
14
+ .trainer-env/bin/python native-prototype/training/make_smoke_data.py
15
+ .trainer-env/bin/python -m codeccat_train \
16
+ --manifest native-prototype/training/smoke-data/manifest.jsonl \
17
+ --output custom.ccm \
18
+ --report training-report.json
19
+ ```
20
+
21
+ The synthetic smoke dataset consists of UTF-8 and Windows-1252 bytes. Its purpose is checking the **pipeline**, not measuring real-world encoding accuracy. Do not use its reported validation score to claim production quality.
22
+
23
+ A separate environment can install and use the released Runtime:
24
+
25
+ ```bash
26
+ python -m venv .runtime-env
27
+ .runtime-env/bin/python -m pip install --only-binary=:all: codeccat==0.1.0
28
+ .runtime-env/bin/python - <<'PY'
29
+ from codeccat import CodecCat
30
+ model = CodecCat.from_files("custom.ccm")
31
+ result = model.detect("日本語".encode("utf-8"))
32
+ print(result.encoding, result.text, result.ambiguous)
33
+ PY
34
+ ```
35
+
36
+ The default custom-model output is `CCM1`; use `--precision f32` for official-compatible `CCM2`. The pinned historical recipe has matched the official CCM2 bytes, but arbitrary custom datasets or versions do not guarantee that result.
37
+
38
+ ## Manifest format
39
+
40
+ Each line of `manifest.jsonl` is a JSON object:
41
+
42
+ ```jsonl
43
+ {"path":"samples/document-001.bin","encoding":"utf-8","split":"train","group":"document-001"}
44
+ {"path":"samples/document-002.bin","encoding":"cp1252","split":"validation","group":"document-002"}
45
+ ```
46
+
47
+ Paths are relative to the manifest directory. `group` identifies a document/source that must not cross the training/validation boundary. The loader rejects escaping paths, duplicate bytes with conflicting labels/splits, unknown codecs and non-decodable labeled bytes. **This is only a first barrier:** near-duplicates, source overlap and corpus licenses remain the user's responsibility.
48
+
49
+ Use bytes with independently known encodings and valid redistribution/training rights. Don't upload raw confidential files or training data to GitHub Actions.
50
+
51
+ ## Acceptance and next steps
52
+
53
+ - **P0:** [Trainer E2E CI](../../../.github/workflows/trainer-e2e.yml) installs Trainer separately, trains twice and checks same-env reproducibility, then loads the resulting model with an independent **PyPI `codeccat==0.1.0`** Runtime environment; it also tests some unsafe manifest cases. No model is promoted by this check.
54
+ - **P1:** Pinned historical input manifest, exact L2 residual training, and optional unfiltered L3 replay are implemented and have matched frozen reference artifacts. Third-party corpus rights review and independent source-overlap assurance are not complete.
55
+ - **P2:** Candidate-vs-Stable comparison and model submission checks exist; exact historical reproduction is guarded separately from any future model-quality or release approval. No independent candidate release is implied.
56
+
57
+ See [RIGHTS_AND_PROVENANCE.md](../../../RIGHTS_AND_PROVENANCE.md), [ROADMAP.md](../../../ROADMAP.md), and [CONTRIBUTING.md](../../../CONTRIBUTING.md).
58
+
59
+ ## Compare your model against official Stable
60
+
61
+ Install the public Runtime in the **evaluation environment** (not required for the training-only environment), then run:
62
+
63
+ ```bash
64
+ codeccat-train evaluate \
65
+ --model custom.ccm \
66
+ --manifest my-data/test-manifest.jsonl \
67
+ --split test \
68
+ --report comparison.json
69
+ ```
70
+
71
+ The `evaluation` command compares candidate and bundled Stable on identical bytes, reporting **correct decoded Unicode text**, correct codec labels, per-codec accuracy, and how many examples improve or regress. No sample text or raw bytes appear in the output. Optionally use `--baseline-model /path/to/another.ccm`.
72
+
73
+ The evaluator scans all manifest splits, rejecting identical bytes and source groups reused across train, validation and test. This prevents exact within-manifest leakage, but it cannot identify near-duplicates or overlap with a separate training manifest. See the [official dataset provenance status](../../../datasets/official/README.md) before claiming official-model reproducibility.
74
+
75
+ The evaluation manifest uses the same JSONL keys with `"split":"test"` (or explicitly `--split validation` for development tests). Never present validation or previously used training sources as blind independent test data. Results are descriptive, not an automatic official-model upgrade.
76
+
77
+ ## Compact numeric model output
78
+
79
+ By default, `codeccat-train fit` writes `CCM1` (float64 weights). Supply `--precision f32` to write a `CCM2` model with float32 weights, compatible with the published Runtime:
80
+
81
+ ```bash
82
+ codeccat-train fit --manifest my-data/manifest.jsonl --output custom-f32.ccm \
83
+ --report training-f32.json --precision f32
84
+ ```
85
+
86
+ This changes only stored weight precision and may introduce minor numerical differences. Reproducing the official model additionally requires the pinned dataset manifest, `--train-only`, `--residual-focus` and verified environment, as shown by the historical research workflow.
87
+
88
+ ## Replaying historical residual-focused training (research only)
89
+
90
+ For investigations that need to match the old Stable23 data-selection
91
+ method, `--residual-focus` applies the historical sample filter before the
92
+ **same** L2 fitting core. `--train-only` accepts a manifest with only
93
+ `"split":"train"` records, which matches the old release-building choice
94
+ to fit on every eligible example:
95
+
96
+ ```bash
97
+ codeccat-train fit --manifest local/training.jsonl --train-only \
98
+ --residual-focus --precision f32 --output candidate.ccm \
99
+ --report candidate-report.json
100
+ ```
101
+
102
+ In train-only mode, `validation_codec_label_accuracy` is `null` and no
103
+ independent accuracy claim is made. The report records original training
104
+ size, selected training size, removed counts per codec and dataset
105
+ fingerprints before and after filtering. The default community path still
106
+ **requires** validation records and does not filter samples.
107
+
108
+ The full pinned-source replay has reproduced the existing L2 model exactly. The separate `fit-l3` command handles the optional, unfiltered L3 model and also matched the frozen reference. See [official reconstruction status](../../../datasets/official/README.md).
109
+
110
+
111
+ ## Training optional L3 (off by default)
112
+
113
+ `fit-l3` uses the full, unfiltered training rows (not the residual L2 subset), preserving the historical Unicode-trigram statistics:
114
+
115
+ ```bash
116
+ codeccat-train fit-l3 --manifest /path/to/train-only.jsonl \
117
+ --output /path/to/language-l3.json \
118
+ --report /path/to/l3-report.json
119
+ ```
120
+
121
+ The [manual L2 + L3 reproduction gate](../../../.github/workflows/official-stable23-replay.yml) compares both generated artifacts against pinned released reference SHA256 values and fails if a required identity check differs. L3 stays disabled by default. Reproduction does **not** establish rights clearance or production accuracy improvements.
@@ -0,0 +1,27 @@
1
+ """Generate grouped, manifest-driven training smoke fixtures, with no downloads.
2
+
3
+ Training data here checks pipeline roundtrip only; NOT accuracy or generalization.
4
+ """
5
+ from pathlib import Path
6
+ import json
7
+
8
+ def main():
9
+ root=Path("native-prototype/training/smoke-data")
10
+ root.mkdir(parents=True,exist_ok=True)
11
+ records=[]
12
+ for split,indices in (("train",range(24)),("validation",range(24,30))):
13
+ for i in indices:
14
+ for codec,text in (
15
+ ("utf-8",f"日本語の文字列とUTF8データ {i}. 日本語の文字列とUTF8データ。"),
16
+ ("cp1252",f"café crème façade déjà vu numéro {i}. café crème."),
17
+ ):
18
+ filename=f"{split}-{codec}-{i}.dat"
19
+ (root/filename).write_bytes(text.encode(codec))
20
+ records.append({"path":filename,"encoding":codec,
21
+ "group":f"{split}-{codec}-{i}","split":split})
22
+ (root/"manifest.jsonl").write_text(
23
+ "".join(json.dumps(r,ensure_ascii=False)+"\n" for r in records),
24
+ encoding="utf-8")
25
+ print("TRAINER_SMOKE_FIXTURES_READY",len(records),flush=True)
26
+
27
+ if __name__=="__main__":main()
@@ -0,0 +1,37 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.27"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "codeccat-train"
7
+ version = "0.1.0"
8
+ description = "Offline trainer and evaluator for CodecCat native encoding models"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Johnny Kao" }]
14
+ classifiers = [
15
+ "Development Status :: 5 - Production/Stable",
16
+ "Programming Language :: Python :: 3",
17
+ "Operating System :: OS Independent",
18
+ "Intended Audience :: Developers",
19
+ "Topic :: Text Processing :: General",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Programming Language :: Python :: 3.14",
25
+ ]
26
+ dependencies = ["numpy>=2.0", "scikit-learn>=1.4,<2"]
27
+
28
+ [project.urls]
29
+ Repository = "https://github.com/Johnny-Kao/CodecCat"
30
+ Issues = "https://github.com/Johnny-Kao/CodecCat/issues"
31
+ Documentation = "https://github.com/Johnny-Kao/CodecCat/blob/main/native-prototype/training/docs/GETTING_STARTED.md"
32
+
33
+ [project.scripts]
34
+ codeccat-train = "codeccat_train.__main__:main"
35
+
36
+ [tool.hatch.build.targets.wheel]
37
+ packages = ["src/codeccat_train"]
@@ -0,0 +1 @@
1
+ """Offline training and native-model export; never imported by CodecCat inference."""