tunc-clm (Python)
Parser and v3.0 trim-aware validator for CLM (Continuity Log Memory). Pure Python, no runtime dependencies, type-hinted.
pip install tunc-clm
from clm import Document, validate_v3, validate_v3_with_filesystem
doc = Document.parse(open("MANIFESTO.clm").read())
assert str(doc) == open("MANIFESTO.clm").read() # round-trip byte-identical
report = validate_v3(doc)
print(f"{len(report.errors)} errors, {len(report.warnings)} warnings")
# Filesystem-aware variant cross-checks the sibling archive
report = validate_v3_with_filesystem(doc, base_dir=".")
CLI
clm validate path/to/file.clm
What CLM is for
CLM/3.0 is a write-ahead log for multi-session AI handoff threads. Four axes; this package implements two of them:
- Read retrieval — prose summary wins this axis; don't pick CLM for one-shot Q&A.
- Write cost — CLM wins by 4.2× at 100 sessions, 12.2× at 500. (See
experiments/v3/RESULTS-compounding-cost.md.) - Audit integrity — verbatim preservation, signed deltas. CLM by ritual.
- Tooling — parser round-trip + validator. This package implements axes 3 and 4 in Python; the Rust and TypeScript packages do the same.
See the main README for the full positioning, including links to the four review rounds where each marketing claim was iteratively narrowed by @copyleftdev's empirical work.
What this validator checks
Per SPEC.clm validation.posture.v3.0:
- Header declarations:
trim.mode,trim.config,archive.mode,archive.path - Trim-config grammar: keys / duplicates / missing values / unknown keys
- Lifecycle states A/B/C; declared offload via
(last X of Y archived)form - Sentinel placement (BEFORE entries, not after)
- Per-entry shape (
ROLL.CALLneeds· YYYY-MM-DD ·;DREAM.LOGneeds| YYYY-MM-DD |); malformed quarantined - Cross-doc sentinel symmetry (live ↔ archive)
- Archive structural check (must contain trim ARCHIVE sections, not just any file)
- Filesystem-aware variant (state.B → warning, state.C → error)
- Chained archive validation (warnings propagate from archive into live report)
Mirror of the Rust reference
This package mirrors clm-rs and is paired with clm-js. All three implementations validate the same set of behaviors against the same canonical artifacts (MANIFESTO.clm, SPEC.clm, the experiments/v3/ bench docs). 117 tests across all three.
Known limitations (parity with clm-rs v0.2.0)
Three follow-ups from Codex round-8 review apply equally:
[DECISIONS.ARCHIVE]cross-doc sentinel check is missing (symmetric gap to[ROLL.CALL.ARCHIVE]/[DREAM.LOG.ARCHIVE]).- Malformed lines in
decisions.livearen't quarantined (counted toward overflow). - Generator (
experiments/v3/gen_50_session.py) emits nonsense metadata for depths ≤ 5.
License
MIT.
Audit thread
CLM is itself an append-only audit-thread format. The thread for MANIFESTO.clm and SPEC.clm is at https://github.com/TUNC-AI/tunc-clm — read it like any CLM file: open, sign, append.
Metadata
Release files for tunc-clm 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tunc_clm-0.2.2.tar.gz | 19.5 kB | Without provenance | Details for tunc_clm-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tunc_clm-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for tunc_clm-0.2.2-py3-none-any.whl |
Total release size: 34.8 kB
Release files / tunc_clm-0.2.2.tar.gz
| Download URL | tunc_clm-0.2.2.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c348683092f865a804fc6861a24449547762eededfa9f1d3a01601394fa2cca2
|
|
BLAKE2b-256 checksum How to use checksums |
b9a3f17ae2a39b2ff9d5e01fa57fa9f0814c1cff3ed2048c547d3bf0493043f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / tunc_clm-0.2.2-py3-none-any.whl
| Download URL | tunc_clm-0.2.2-py3-none-any.whl |
|---|---|
| Size | 15.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
444339fbcb35cdc72b14e3fcb91c60baec3d7ac08d5180ae4ee85e4fb2010779
|
|
BLAKE2b-256 checksum How to use checksums |
552b32b87b8bc64b9d3b3ac5fc05825b6256c8eb190a70da9a7a5d58b0dccc03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for tunc-clm 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.