Skip to main content

ciris-lens-core

The science-layer Rust crate for the CIRIS federation. Routes traces to cohorts, scores conformity to the alignment manifold, signs detection events. Folds into the agent post-PoB §3.1.

Status: Proposed. Spec + threat model + lifted patterns from existing cirislens-core are in this repo; v0.1.0 implementation work to come.

Read in this order

  1. MISSION.md — the WHY. M-1 alignment per module; anti-patterns; failure modes; what mission risk looks like for each component.
  2. docs/THREAT_MODEL.md — the security surface. 21 LC-AVs covering score-gaming, manifold-evasion, cohort-routing, detector-attacks, statistical-attacks, federation- level. P0 must-have-at-v0.1.0 bundle: LC-AV-2, LC-AV-11, LC-AV-18.
  3. FSD/CIRIS_LENS_CORE.md — the WHAT. Crate shape, public API, per-trace lifecycle (scrub → route → score → sign), edge + persist integration boundaries.
  4. FSD/OPEN_QUESTIONS.md — the HOW. Decisions deferred to implementation kickoff.
  5. patterns_from_cirislens_core/ — gifts. Working scrubber + extraction code lifted from CIRISLens's existing cirislens-core Rust crate. Proven NER+regex pipeline, per-field walker, ort/distilbert backends, JSONPath extraction. Lift into src/scrub/ + src/extract/ when implementation starts; refactor as needed.

TL;DR

Edge ──(verified bytes)──► CIRISLensCore ──(signed events)──► Persist
                              │
                              ├── scrub        PII pipeline (NER + regex)
                              ├── cohort       declared + inferred routing
                              ├── detector     5 ratchet detectors + manifold
                              ├── scoring      capacity + N_eff + conformity
                              ├── pipeline     orchestrate the per-trace flow
                              └── signing      via persist.steward_sign

One crate, one trace lifecycle. Scrub + score + sign are sequential stages of the same per-trace pipeline; splitting them artificially is the mistake that motivated this repo.

Consumes Edge + Persist day-1. Verify is implicit (Edge guarantees verified bytes before lens-core sees them; lens-core does not re-verify). Storage is implicit (persist owns trace_events, trace_llm_calls, federation_keys; lens-core writes detection events via Engine.steward_sign + Engine.put_*).

Folds into agent. Per PoB §3.1, lens-core is "a function any peer can run on data the peer already has." Library, not service. Every agent runs detection on its own hot path; federation cross-validates.

Sister repos

  • CIRISAgent — agent reasoning loop. Emits signed traces. Wire-format spec at FSD/TRACE_WIRE_FORMAT.md; deployment_profile block (CIRISAgent#718) is the declared-cohort input lens-core's routing layer reads.
  • CIRISPersist — substrate. Owns federation_keys, trace storage, canonicalization, steward signing, federation directory. Lens-core consumes via Engine.
  • CIRISEdge — federation transport. Owns wire-side verify; lens-core never sees unverified bytes.
  • CIRISVerify — cryptographic primitives. Lens-core depends transitively via persist.
  • CIRISLens — the existing deployed-product Python layer. Currently hosts cirislens-core (the trace-ingest pipeline this crate's scrubber descends from). Will consume ciris-lens-core when implementation lands; eventually folds into agent per PoB §3.1.

License

AGPL-3.0, matching the rest of the CIRIS federation stack.

Release files for ciris-lens-core 1.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for ciris-lens-core 1.4.2
File
ciris_lens_core-1.4.2-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
ciris_lens_core-1.4.2-cp310-abi3-manylinux_2_39_x86_64.whl CPython 3.10 abi3 Linux glibc 2.39+ x86-64 Details
ciris_lens_core-1.4.2-cp310-abi3-manylinux_2_39_aarch64.whl CPython 3.10 abi3 Linux glibc 2.39+ ARM64 Details
ciris_lens_core-1.4.2-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 62.5 MB

Release files / ciris_lens_core-1.4.2-cp310-abi3-win_amd64.whl

Download URL ciris_lens_core-1.4.2-cp310-abi3-win_amd64.whl
Size 15.8 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
de77424b35614e798cc6fe0d6ad40dbeb462c52cadefe6f040116a541d135ecb
BLAKE2b-256 checksum
How to use checksums
71fa75d596fb4351deda660e2efcf31c169e6736e2c5dd5f86d6a5d048963729
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

Release files / ciris_lens_core-1.4.2-cp310-abi3-manylinux_2_39_x86_64.whl

Download URL ciris_lens_core-1.4.2-cp310-abi3-manylinux_2_39_x86_64.whl
Size 17.5 MB
Tags CPython 3.10 Linux glibc 2.39+ x86-64 abi3
SHA-256 checksum
How to use checksums
8495fcf9860811eaf75dba1d880cf0193725f8b29336401360dae59222770de4
BLAKE2b-256 checksum
How to use checksums
4ba1d4fad48aed6385d60eb00ef711b1f6af8f1c3afa9cdd683ec9ec5eb37168
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

Release files / ciris_lens_core-1.4.2-cp310-abi3-manylinux_2_39_aarch64.whl

Download URL ciris_lens_core-1.4.2-cp310-abi3-manylinux_2_39_aarch64.whl
Size 16.4 MB
Tags CPython 3.10 Linux glibc 2.39+ ARM64 abi3
SHA-256 checksum
How to use checksums
b8ebe25b30f6ead5f8f153b574842ae4004c05f346c1a04d5f6e3bc4dc72bbd6
BLAKE2b-256 checksum
How to use checksums
d1ff39ce1ba6e123bbac8766038b1fba7731d8987ed1684da528a738bc7ec3ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

Release files / ciris_lens_core-1.4.2-cp310-abi3-macosx_11_0_arm64.whl

Download URL ciris_lens_core-1.4.2-cp310-abi3-macosx_11_0_arm64.whl
Size 12.9 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
becd2d131d8cf72c44c7001918593b856f95c0ea3e2c923234f4483d3f77b667
BLAKE2b-256 checksum
How to use checksums
4467e0377515544c7838c7c13d796f4bd143b61173c31cbfe3ba245948e452b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.4.2 This release

4 release files

1.4.1

4 release files

1.4.0

4 release files

1.3.0

4 release files

1.2.0

4 release files

1.1.0

4 release files

1.0.1

3 release files

1.0.0

3 release files

0.4.9

3 release files

0.4.8

3 release files

0.4.7

3 release files

0.4.6

3 release files

0.4.5

3 release files

0.4.4

3 release files

0.4.3

3 release files

0.4.2

3 release files

0.4.1

3 release files

0.4.0

3 release files

0.3.0

3 release files

0.2.2

3 release files

0.2.1

3 release files

0.2.0

3 release files

0.1.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page