thread-rule-engine 0.1.0

Rule-based scanning and transformation engine for Thread
Documentation
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v0.1.0 (2026-03-02)

<csr-id-d5519df7aac003c85d71d15b561d29b63fe4c00d/>
<csr-id-659510d42574fe2efe5639bb749d9f29445e7d88/>
<csr-id-f9c25705eba3262b41e538a4db64e8d8e1ea4185/>
<csr-id-aac8239716f1a57806c308f0e44e41289e6cc9d0/>
<csr-id-36bde537ea20079f4923856b149efa99b9957063/>

### New Features

<csr-id-bb4a9d0f14c61cb4d99e562408335535859cb3fb/>

 - <csr-id-cadf4b562ccb390180e1bcfa96ed24d68e7d9a75/> improve repo tasks; remove outdated docs
 - <csr-id-eead51dcb62ee0b6fe99856ce40ef929df1c7d41/> Implement main thread crate to unify crate exposure
   * feat(thread): Implement main thread crate to unify crate exposure
* fix(tests): fixed failing tests and clarified language in planning docs
* fix(tests): fixed several test and typing issues
* fix: missing re-export causing failing tests. All tests across codebase now passing
* fix: multiple test and typing fixes. test suite now all green.
* chore(ci): update cargo-deny to ignore trivial dependency lockfile duplications
* chore(lint): formatting and minor fixes
* chore(fmt): formatted codebase
* feat: add support for terraform, nix, and solidity; update language tests
* feat: add support for terraform, nix, and solidity; update language tests
* fix: fixed issue where all-features caused failures in CI due to conflicting feature flags
* fix(ci): correct issue where Rust stable causes lint failures (thread-services uses experimental trait aliases)
* fix(ci): Remove cargo license check from CI; redundant with cargo deny, which is more reliable
* fix(ci): remove Semgrep-SAST check; semgrep-action is deprecated and caused failing CI from deprecation warnings
* ─────┬──────────────────────────────────────────────────────────────────────────
        │ STDIN
   ─────┼──────────────────────────────────────────────────────────────────────────
      1 │ fix(thread): expose flow module under worker feature; fix test type annotation
      2 │
      3 │ - Change `#[cfg(feature = "flow")]` to `#[cfg(any(feature = "flow", feature = "worker"))]`
      4 │   on `pub mod flow` in lib.rs. The `worker` feature implicitly enables `dep:thread-flow`
      5 │   via `thread-flow/worker`, but the flow module was never exposed because the crate's own
      6 │   `flow` feature remained false. Simply adding "flow" to worker was not viable since it
      7 │   would also pull in `thread-flow/parallel` and `thread-flow/postgres-backend`, which are
      8 │   incompatible with WASM/edge deployment.
      9 │ - Remove incorrect `Root<_>` type annotation in integration test; `LanguageExt::ast_grep`
     10 │   returns `AstGrep<...>`, not `Root`. Drop the now-unused `use thread::Root` import.
     11 │
     12 │ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
   ─────┴──────────────────────────────────────────────────────────────────────────
* ─────┬──────────────────────────────────────────────────────────────────────────
        │ STDIN
   ─────┼──────────────────────────────────────────────────────────────────────────
      1 │ fix(ci): resolve three clippy errors causing CI failures
      2 │
      3 │ - comparison_benchmarks.rs: use ThreadSupportLang (already imported) instead
      4 │   of thread_language::TypeScript for from_yaml_string type parameter. TypeScript
      5 │   only implements Deserialize when the `typescript` feature is enabled; SupportLang
      6 │   is the correct type here and is already used consistently everywhere else in the
      7 │   same bench file.
      8 │ - d1.rs: remove redundant closure in filter_map; PathBuf::from can be passed
      9 │   directly as the function item.
     10 │ - performance.rs: replace manual checked-division pattern (if x > 0 { a / x })
     11 │   with checked_div().unwrap_or(0) in fingerprint_stats and query_stats.
     12 │
     13 │ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
   ─────┴──────────────────────────────────────────────────────────────────────────
* ─────┬──────────────────────────────────────────────────────────────────────────
        │ STDIN
   ─────┼──────────────────────────────────────────────────────────────────────────
      1 │ fix(ci): resolve additional clippy lints in flow crate
      2 │
      3 │ - types.rs: fix inconsistent digit grouping in test timestamp literal
      4 │   (1706400000_000_000 → 1_706_400_000_000_000)
      5 │ - graph.rs: replace PathBuf::from("A/B") with Path::new("A/B") in assertion
      6 │   comparison to avoid allocating owned values (cmp_owned lint); clippy
      7 │   suggested bare &str but PathBuf doesn't impl PartialEq<&str>, so use Path
      8 │ - observability_metrics_tests.rs: replace &[x.clone()] with
      9 │   std::slice::from_ref(&x) for four single-element slice args
     10 │   (cloned_ref_to_slice_refs lint)
     11 │
     12 │ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
   ─────┴──────────────────────────────────────────────────────────────────────────
* fix(lint): fix lint warnings
* feat: replace HashMap/Set usage with RapidMap/Set across flow crate; linting
* ─────┬──────────────────────────────────────────────────────────────────────────
        │ STDIN
   ─────┼──────────────────────────────────────────────────────────────────────────
      1 │ feat(alloc): add mimalloc as optional global allocator across all crates
      2 │
      3 │ Add mimalloc as an optional dependency to all crates, gated behind a
      4 │ `mimalloc` feature flag. When enabled (and not in `worker` mode), each
      5 │ crate registers MiMalloc as the global allocator.
      6 │
      7 │ Fix broken cfg attribute syntax that was identical across all six lib.rs
      8 │ files — the closing paren after not(feature = "worker") was terminating
      9 │ all() too early:
     10 │
     11 │   all(not(feature = "worker")), (feature = "mimalloc")  [broken]
     12 │   all(not(feature = "worker"), feature = "mimalloc")    [fixed]
     13 │
     14 │ Also fix thread/src/lib.rs which was missing the feature = "mimalloc"
     15 │ guard entirely (had only not(feature = "worker")), pin mimalloc workspace
     16 │ dep to 0.1.48, make flow's mimalloc dep optional (was incorrectly
     17 │ non-optional), and apply tombi TOML formatting to thread/flow/language
     18 │ Cargo.toml files.
     19 │
     20 │ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
   ─────┴──────────────────────────────────────────────────────────────────────────
* ─────┬──────────────────────────────────────────────────────────────────────────
        │ STDIN
   ─────┼──────────────────────────────────────────────────────────────────────────
      1 │ fix(alloc): remove duplicate #[global_allocator] from all library crates
      2 │
      3 │ Rust allows exactly one #[global_allocator] per linked binary. Defining
      4 │ it in multiple library crates causes link-time conflicts whenever two or
      5 │ more of them are compiled together (which is always the case in this
      6 │ workspace).
      7 │
      8 │ The allocator must only be registered at the root/binary level. Remove
      9 │ the cfg+global_allocator+static GLOBAL block from the six library crates:
     10 │   - thread-ast-engine
     11 │   - thread-flow
     12 │   - thread-language
     13 │   - thread-rule-engine
     14 │   - thread-services
     15 │   - thread-utils
     16 │
     17 │ The block is retained only in the thread facade crate, which is the
     18 │ intended entry point and acts as the effective root for library consumers.
     19 │ The mimalloc optional dep and feature flag remain in each crate in case
     20 │ they are needed independently.
     21 │
     22 │ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
   ─────┴──────────────────────────────────────────────────────────────────────────
* fix: developer error with mimalloc usage :)
* ─────┬──────────────────────────────────────────────────────────────────────────
        │ STDIN
   ─────┼──────────────────────────────────────────────────────────────────────────
      1 │ fix(lint): resolve clippy warnings in thread-utils tests
      2 │
      3 │ - byte_char_slices: &[b'a'] → b"a" in simd.rs
      4 │ - unreadable_literal: add numeric separators in hash_tests.rs
      5 │ - uninlined_format_args: use inline format args throughout
      6 │
      7 │ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
   ─────┴──────────────────────────────────────────────────────────────────────────
* ─────┬──────────────────────────────────────────────────────────────────────────
        │ STDIN
   ─────┼──────────────────────────────────────────────────────────────────────────
      1 │ fix(lint): pass MatchStrictness by value in ast-engine match functions
      2 │
      3 │ MatchStrictness derives Copy; passing by reference adds indirection
      4 │ with no benefit. Pass by value throughout match_node_impl and friends.
      5 │
      6 │ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
   ─────┴──────────────────────────────────────────────────────────────────────────
* ─────┬──────────────────────────────────────────────────────────────────────────
        │ STDIN
   ─────┼──────────────────────────────────────────────────────────────────────────
      1 │ fix(tooling): pin mise rust tool to nightly
      2 │
      3 │ The workspace requires Rust nightly: edition 2024 and experimental
      4 │ trait aliases (thread-services) are nightly-only. Using "latest"
      5 │ resolves to stable at install time and breaks the build.
      6 │
      7 │ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
   ─────┴──────────────────────────────────────────────────────────────────────────
* ─────┬──────────────────────────────────────────────────────────────────────────
        │ STDIN
   ─────┼──────────────────────────────────────────────────────────────────────────
      1 │ fix(ci): scope integration tests to flow crate
      2 │
      3 │ cargo nextest run --all-features without --manifest-path in a workspace
      4 │ compiles all members with all features, including thread-language's
      5 │ napi-* features which disable tree-sitter at runtime. Scope the
      6 │ integration test run to crates/flow/Cargo.toml where these tests live.
      7 │
      8 │ Brings the integration job in line with the test, coverage, clippy,
      9 │ and doc-test jobs which already apply the napi exclusion pattern.
     10 │
     11 │ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
   ─────┴──────────────────────────────────────────────────────────────────────────
* ─────┬──────────────────────────────────────────────────────────────────────────
        │ STDIN
   ─────┼──────────────────────────────────────────────────────────────────────────
      1 │ fix(ci): use single-line run for integration test command
      2 │
      3 │ yq (the yml hook) normalises folded block scalars to single-line
      4 │ strings; using >- caused the pre-push check to fail with a diff.
      5 │ Inline the cargo nextest command to match what yq expects.
      6 │
      7 │ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
   ─────┴──────────────────────────────────────────────────────────────────────────
* ─────┬──────────────────────────────────────────────────────────────────────────
        │ STDIN
   ─────┼──────────────────────────────────────────────────────────────────────────
      1 │ fix(lint): resolve clippy warnings in test, bench, and example files
      2 │
      3 │ Pre-push hook (--all-targets) surfaced pre-existing lint debt across
      4 │ bench, test, and example targets that aren't compiled in normal builds.
      5 │
      6 │ - needless_collect: use .count() directly on iterator (ast-engine bench)
      7 │ - approx_constant: use std::f{32,64}::consts::{PI,E} (d1 tests)
      8 │ - inconsistent_digit_grouping: add separators to large literals (incremental tests)
      9 │ - cloned_ref_to_slice_refs: &[x.clone()] → std::slice::from_ref(&x)
     10 │   (analyzer_tests, integration_e2e_tests, observability_example)
     11 │ - match_single_binding: replace single-arm match with let binding (extractor_tests)
     12 │ - too_many_arguments: #[allow] on test helper with 8 params (d1_local_test)
     13 │ - various auto-fixed lints across bench and test files
     14 │
     15 │ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
   ─────┴──────────────────────────────────────────────────────────────────────────
* fix: corrected version to current 0.2.0

### Bug Fixes

 - <csr-id-9cc123caedfe261bef14b62788bdff85315ee96a/> Corrected categories across crates to be below 5 limit and match crates.io category slugs

### Other

 - <csr-id-d5519df7aac003c85d71d15b561d29b63fe4c00d/> Add thread-flow crate, integrates ReCoco (CocoIndex) capabilities into Thread, providing dataflow driven ETL pipeline management
   * feat: add initial specification and quality checklist for Real-Time Code Graph Intelligence
   
   * Add research findings for Real-Time Code Graph Intelligence
   
   - Documented integration architecture for CocoIndex, including trait abstraction layer and optional runtime integration.
   - Evaluated component selection between ast-grep and CodeWeaver, deciding to use existing ast-grep components for MVP.
   - Established API protocol strategy, opting for a hybrid RPC over HTTP/WebSockets due to Cloudflare Workers constraints.
   - Designed a hybrid relational architecture for graph database layer with in-memory acceleration.
   - Selected WebSocket as primary real-time protocol with Server-Sent Events as fallback.
   - Organized crate structure to extend existing Thread workspace with new graph-focused crates.
   - Implemented multi-tier conflict detection strategy for progressive feedback.
   - Developed storage backend abstraction pattern to support multiple backends with optimizations.
   - Ongoing research on best practices for Rust WebAssembly, content-addressed caching, and real-time collaboration architecture.
   
   * feat: Add spec and planning documents for realtime codegraph feat
   
   * Remove workspace author and edition fields from Cargo.toml files in services, utils, wasm, and xtask crates
   
   * Update rapidhash implementation in thread-utils (#45)
   
   * Update thread-utils to use latest rapidhash API
   
   - Update `hash_help.rs` to use `rapidhash::v3` for stable file/byte hashing.
   - Update `hash_help.rs` to use `rapidhash::fast` for `RapidMap`/`RapidSet` (optimized for speed).
   - Fix build issues in workspace crates (authors, dependency conflicts) to allow tests to run.
   
   * Initial plan
   
   * Add comprehensive tests for hash_help module

### Chore

 - <csr-id-b97b45c95ff854b4bf159bd03ce1e3ff4de74d41/> Release thread-services v0.1.0, thread-flow v0.1.0, thread-rule-engine v0.1.0, thread v0.1.0

### Chore

 - <csr-id-36bde537ea20079f4923856b149efa99b9957063/> Release thread-ast-engine v0.1.0, thread-language v0.1.0, thread-services v0.1.0, thread-flow v0.1.0, thread-rule-engine v0.1.0, thread v0.1.0

### Chore

 - <csr-id-aac8239716f1a57806c308f0e44e41289e6cc9d0/> Release thread-utilities v0.1.3, thread-ast-engine v0.1.0, thread-language v0.1.0, thread-services v0.1.0, thread-flow v0.1.0, thread-rule-engine v0.1.0, thread v0.1.0

### Refactor

 - <csr-id-659510d42574fe2efe5639bb749d9f29445e7d88/> rename thread-utils to thread-utilities across the codebase. Crates.io namespace conflict required the rename.
   - Updated all occurrences of `thread_utils` to `thread_utilities` in source files, tests, and documentation.
   - Adjusted Cargo.toml files to reflect the new crate name.
 - <csr-id-f9c25705eba3262b41e538a4db64e8d8e1ea4185/> Moved crates to individual versioning; updated ignores accordingly

### Commit Statistics

<csr-read-only-do-not-edit/>

 - 22 commits contributed to the release.
 - 10 commits were understood as [conventional]https://www.conventionalcommits.org.
 - 3 unique issues were worked on: [#45]https://github.com/knitli/thread/issues/45, [#48]https://github.com/knitli/thread/issues/48, [#75]https://github.com/knitli/thread/issues/75

### Commit Details

<csr-read-only-do-not-edit/>

<details><summary>view details</summary>

 * **[#45]https://github.com/knitli/thread/issues/45**
    - Update rapidhash implementation in thread-utils ([`b830374`]https://github.com/knitli/thread/commit/b8303748688074a04062d77c48472056a7d68fa8)
 * **[#48]https://github.com/knitli/thread/issues/48**
    - Add thread-flow crate, integrates ReCoco (CocoIndex) capabilities into Thread, providing dataflow driven ETL pipeline management ([`d5519df`]https://github.com/knitli/thread/commit/d5519df7aac003c85d71d15b561d29b63fe4c00d)
 * **[#75]https://github.com/knitli/thread/issues/75**
    - Implement main thread crate to unify crate exposure ([`eead51d`]https://github.com/knitli/thread/commit/eead51dcb62ee0b6fe99856ce40ef929df1c7d41)
 * **Uncategorized**
    - Release thread-services v0.1.0, thread-flow v0.1.0, thread-rule-engine v0.1.0, thread v0.1.0 ([`b97b45c`]https://github.com/knitli/thread/commit/b97b45c95ff854b4bf159bd03ce1e3ff4de74d41)
    - Release thread-ast-engine v0.1.0, thread-language v0.1.0, thread-services v0.1.0, thread-flow v0.1.0, thread-rule-engine v0.1.0, thread v0.1.0 ([`36bde53`]https://github.com/knitli/thread/commit/36bde537ea20079f4923856b149efa99b9957063)
    - Release thread-utilities v0.1.3, thread-ast-engine v0.1.0, thread-language v0.1.0, thread-services v0.1.0, thread-flow v0.1.0, thread-rule-engine v0.1.0, thread v0.1.0 ([`aac8239`]https://github.com/knitli/thread/commit/aac8239716f1a57806c308f0e44e41289e6cc9d0)
    - Rename thread-utils to thread-utilities across the codebase. Crates.io namespace conflict required the rename. ([`659510d`]https://github.com/knitli/thread/commit/659510d42574fe2efe5639bb749d9f29445e7d88)
    - Corrected categories across crates to be below 5 limit and match crates.io category slugs ([`9cc123c`]https://github.com/knitli/thread/commit/9cc123caedfe261bef14b62788bdff85315ee96a)
    - Moved crates to individual versioning; updated ignores accordingly ([`f9c2570`]https://github.com/knitli/thread/commit/f9c25705eba3262b41e538a4db64e8d8e1ea4185)
    - Improve repo tasks; remove outdated docs ([`cadf4b5`]https://github.com/knitli/thread/commit/cadf4b562ccb390180e1bcfa96ed24d68e7d9a75)
    - Docs(templates,claude): align with constitution v2.0.0 - service architecture ([`216c076`]https://github.com/knitli/thread/commit/216c07665b897da2f3742adec3928e4f4f944141)
    - Add comprehensive project documentation and development commands ([`bb4a9d0`]https://github.com/knitli/thread/commit/bb4a9d0f14c61cb4d99e562408335535859cb3fb)
    - Merge pull request #43 from knitli/feat-phase-zero ([`5af12b4`]https://github.com/knitli/thread/commit/5af12b4bd8e08318757fd42676127410d159ee5a)
    - Sped up ext handling in language crate using constants and aho corasick; probably premature optimization, but it is faster ([`413d3bf`]https://github.com/knitli/thread/commit/413d3bf76dce25f59d7c045bd4e4e202e8c12de0)
    - Overhauled documentation in thread-ast-engine ([`a076d02`]https://github.com/knitli/thread/commit/a076d022c69b179ff3f61192f5142c3139d7abbb)
    - Updated reuse compliance ([`7952908`]https://github.com/knitli/thread/commit/795290882740f847de884fd4b7ecfbaf4264dfa3)
    - Linting and formatting ([`34cbd08`]https://github.com/knitli/thread/commit/34cbd0808b70d004f6d6b67896b7e8137fc8e8bd)
    - Added benchmarks to rule_engine, debug/clone consistency ([`6341018`]https://github.com/knitli/thread/commit/6341018feced023641933e291a85da88fb0c6e9d)
    - First analysis of serialization separation; prospect poor. Going to table this for later. ([`6579e15`]https://github.com/knitli/thread/commit/6579e15003065dd2d56344cedc2d05ea0d6151de)
    - About to try separating serialization logic ([`0f758a4`]https://github.com/knitli/thread/commit/0f758a484325e7c9c74ec17efb47a01e0f9ada6f)
    - Removed fastmap implementation in favor of a simpler faster hash pattern ([`bf25a28`]https://github.com/knitli/thread/commit/bf25a2867739a2c056c82d14a20dabe3f9e2a5b7)
    - Third time's the charm on refactoring, it seems ([`0dcb5a3`]https://github.com/knitli/thread/commit/0dcb5a3f1dfadb62787805214a48086697082e60)
</details>