Skip to content

chore: release v0.4.0#151

Merged
mergify[bot] merged 1 commit into
mainfrom
release-plz-2026-03-06T06-46-33Z
Mar 6, 2026
Merged

chore: release v0.4.0#151
mergify[bot] merged 1 commit into
mainfrom
release-plz-2026-03-06T06-46-33Z

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Mar 6, 2026

🤖 New release

  • libmagic-rs: 0.3.2 -> 0.4.0 (⚠ API breaking changes)

libmagic-rs breaking changes

--- failure enum_variant_added: enum variant added on exhaustive enum ---

Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/enum_variant_added.ron

Failed in:
  variant Operator:BitwiseXor in /tmp/.tmp8YIKcr/libmagic-rs/src/parser/ast.rs:252
  variant Operator:BitwiseNot in /tmp/.tmp8YIKcr/libmagic-rs/src/parser/ast.rs:263
  variant Operator:AnyValue in /tmp/.tmp8YIKcr/libmagic-rs/src/parser/ast.rs:274
  variant Operator:BitwiseXor in /tmp/.tmp8YIKcr/libmagic-rs/src/parser/ast.rs:252
  variant Operator:BitwiseNot in /tmp/.tmp8YIKcr/libmagic-rs/src/parser/ast.rs:263
  variant Operator:AnyValue in /tmp/.tmp8YIKcr/libmagic-rs/src/parser/ast.rs:274
  variant Operator:BitwiseXor in /tmp/.tmp8YIKcr/libmagic-rs/src/parser/ast.rs:252
  variant Operator:BitwiseNot in /tmp/.tmp8YIKcr/libmagic-rs/src/parser/ast.rs:263
  variant Operator:AnyValue in /tmp/.tmp8YIKcr/libmagic-rs/src/parser/ast.rs:274
Changelog

[0.4.0] - 2026-03-06

Features

  • parser: Implement bitwise xor not and any value x operators (#145)

Documentation

  • Add comprehensive contributing guide (#149)


This PR was generated with release-plz.

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 6, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Mar 6, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Do not merge outdated PRs

Wonderful, this rule succeeded.

Make sure PRs are within 10 commits of the base branch before merging

  • #commits-behind <= 3

@dosubot dosubot Bot added documentation Improvements or additions to documentation parser Magic file parsing components and grammar labels Mar 6, 2026
@mergify mergify Bot merged commit d009861 into main Mar 6, 2026
6 checks passed
@mergify mergify Bot deleted the release-plz-2026-03-06T06-46-33Z branch March 6, 2026 06:47
@dosubot
Copy link
Copy Markdown
Contributor

dosubot Bot commented Mar 6, 2026

Related Documentation

6 document(s) may need updating based on files changed in this PR:

libMagic-rs

GETTING_STARTED /libmagic-rs/blob/main/docs/GETTING_STARTED.md
View Suggested Changes
@@ -21,10 +21,12 @@
 
 ```toml
 [dependencies]
-libmagic-rs = "0.3.2"
-```
-
-**Note:** Version 0.3.0 introduces breaking changes. If upgrading from 0.2.x, note that a new `TypeKind::Quad` enum variant was added for 64-bit quad integer types with endian variants, `TypeKind::String` variant discriminant changed from 3 to 4, and `evaluator::MatchResult` was renamed to `evaluator::RuleMatch` to resolve a naming collision with `output::MatchResult`. The public re-export is `RuleMatch`. Exhaustive pattern matching on `TypeKind` requires updates.
+libmagic-rs = "0.4.0"
+```
+
+**Note:** Version 0.4.0 introduces breaking changes. If upgrading from 0.3.x, note that the `Operator` enum gained three new variants (`BitwiseXor`, `BitwiseNot`, `AnyValue`) for extended bitwise operations. Exhaustive pattern matching on `Operator` requires updates.
+
+Version 0.3.0 introduced breaking changes from 0.2.x: a new `TypeKind::Quad` enum variant was added for 64-bit quad integer types with endian variants, `TypeKind::String` variant discriminant changed from 3 to 4, and `evaluator::MatchResult` was renamed to `evaluator::RuleMatch` to resolve a naming collision with `output::MatchResult`. The public re-export is `RuleMatch`. Exhaustive pattern matching on `TypeKind` requires updates.
 
 Version 0.2.0 introduced breaking changes from 0.1.x: `TypeKind::Byte` changed from a unit variant to a tuple variant, and the `Operator` enum gained new variants (`LessThan`, `GreaterThan`, `LessEqual`, `GreaterEqual`) for comparison operations.
 
@@ -65,7 +67,7 @@
 
 ```toml
 [dependencies]
-libmagic-rs = "0.3.2"
+libmagic-rs = "0.4.0"
 ```
 
 #### Step 3: Write Code

[Accept] [Decline]

Magic File Compatibility Status
View Suggested Changes
@@ -1,16 +1,16 @@
 # Magic File Compatibility Status
 
-[libmagic-rs](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/README.md#L12-L15) is a pure-Rust clean-room implementation of libmagic, the C library that powers the Unix `file` command for identifying file types. As of version 0.2.0 (released March 2026), the project is in early development with fundamental file identification capabilities operational. The implementation [currently achieves 0% compatibility (0/81 tests passing)](https://github.com/EvilBit-Labs/libmagic-rs/issues/57) against the third-party GNU file test corpus, but follows a [structured milestone-based roadmap](https://github.com/EvilBit-Labs/libmagic-rs/issues/52) targeting [95%+ compatibility with GNU file by version 1.0.0](https://github.com/EvilBit-Labs/libmagic-rs/issues/57).
+[libmagic-rs](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/README.md#L12-L15) is a pure-Rust clean-room implementation of libmagic, the C library that powers the Unix `file` command for identifying file types. As of version 0.4.0 (released March 2026), the project is in early development with fundamental file identification capabilities operational. The implementation [currently achieves 0% compatibility (0/81 tests passing)](https://github.com/EvilBit-Labs/libmagic-rs/issues/57) against the third-party GNU file test corpus, but follows a [structured milestone-based roadmap](https://github.com/EvilBit-Labs/libmagic-rs/issues/52) targeting [95%+ compatibility with GNU file by version 1.0.0](https://github.com/EvilBit-Labs/libmagic-rs/issues/57).
 
 The implementation emphasizes [memory safety with zero unsafe code](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/README.md#L153), thread-safe design, and modern Rust error handling patterns. Development is organized through [five strategic epics](https://github.com/EvilBit-Labs/libmagic-rs/issues/53) that address operator completeness, type system expansion, offset resolution mechanisms, specification compliance, and final compatibility validation. The project uses a multi-stage parser architecture built on nom combinators and implements hierarchical rule evaluation with graceful error handling.
 
 This article provides comprehensive tracking of implemented versus unsupported features, magic file directive support status, version milestones spanning v0.1.0 through v1.0.0, and the detailed enhancement roadmap specific to the libmagic-rs implementation.
 
-## Current Implementation Status (v0.2.x)
+## Current Implementation Status (v0.4.x)
 
 ### Implemented Features
 
-The v0.2.x releases provide foundational file identification capabilities across data types, operators, offsets, nested rules, and string matching. While limited in scope compared to GNU file, these features establish the architectural patterns for future expansion.
+The v0.4.x releases provide foundational file identification capabilities across data types, operators, offsets, nested rules, and string matching. While limited in scope compared to GNU file, these features establish the architectural patterns for future expansion.
 
 #### Data Types
 The evaluator currently supports [five basic data types with endianness variants](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/types.rs):
@@ -22,7 +22,7 @@
 - **[String](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/types.rs#L275-L308)**: Null-terminated or length-limited strings with UTF-8 conversion using [SIMD-accelerated null scanning](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/types.rs#L291-L298)
 
 #### Operators
-Fifteen operators are [fully implemented in evaluation](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/operators.rs):
+Eighteen operators are [fully implemented in evaluation](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/operators.rs):
 
 - **[Equal (=, ==)](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/operators.rs#L48-L69)**: Equality comparison with cross-type integer coercion
 - **[NotEqual (!=, <>)](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/operators.rs#L108-L110)**: Inequality comparison
@@ -36,7 +36,7 @@
 - **BitwiseNot (~)**: Applies bitwise complement to value before equality comparison
 - **AnyValue (x)**: Unconditional match that always returns true
 
-[15 of 17 operators are implemented (88%)](https://github.com/EvilBit-Labs/libmagic-rs/issues/53), with comparison operators providing version checks and range matching capabilities.
+The comparison operators provide version checks and range matching capabilities. The bitwise operators (XOR, NOT, AnyValue) enable advanced binary pattern matching and unconditional match patterns.
 
 #### Offsets
 Two offset types are [fully operational](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/offset.rs):
@@ -97,12 +97,12 @@
 
 Development is organized into five epics that systematically address compatibility gaps. Each epic targets specific version milestones and has defined success criteria.
 
-### Epic #53: Operator Completeness (v0.2.0)
-[Status: Nearly complete](https://github.com/EvilBit-Labs/libmagic-rs/issues/53). Currently 15 of 17 required operators are implemented (88%).
+### Epic #53: Operator Completeness (v0.2.0 + v0.4.0)
+[Status: Complete](https://github.com/EvilBit-Labs/libmagic-rs/issues/53). All 18 required operators are implemented.
 
 **Implemented operators:**
 - [Comparison operators (<, >, <=, >=) implemented in PR #104](https://github.com/EvilBit-Labs/libmagic-rs/pull/104) - These operators enable version checks and range matching, unlocking compatibility with magic rules that test numeric ranges. Released in v0.2.0.
-- [Bitwise XOR (^), NOT (~), and any-value (x) operators implemented in PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145) - Resolves Issue #35. Required for advanced binary pattern matching and unconditional match patterns.
+- [Bitwise XOR (^), NOT (~), and any-value (x) operators implemented in PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145) - Resolves Issue #35. Required for advanced binary pattern matching and unconditional match patterns. Released in v0.4.0.
 
 ### Epic #54: Type System Expansion (v0.2.0 + v0.3.0)
 [Status: 5 of 33+ types implemented](https://github.com/EvilBit-Labs/libmagic-rs/issues/54). The type system expansion is split across two releases to manage code complexity.
@@ -125,7 +125,7 @@
 
 [Submodule files will be pre-created as placeholders](https://github.com/EvilBit-Labs/libmagic-rs/issues/62) (`offset_indirect.rs`, `offset_relative.rs`) to prevent the evaluator module from becoming oversized.
 
-### Epic #56: Core Flow Spec Compliance (v0.4.0)
+### Epic #56: Core Flow Spec Compliance (v0.5.0)
 [Status: 7 of 12 flows complete](https://github.com/EvilBit-Labs/libmagic-rs/issues/56). This epic ensures the library and CLI behave exactly as documented in the Core Flows specification.
 
 **Completed flows:**
@@ -179,7 +179,6 @@
 **Implemented features:**
 - [Comparison operators (<, >, <=, >=) via PR #104](https://github.com/EvilBit-Labs/libmagic-rs/pull/104) - Enables version checks and range matching for numeric values, unlocking magic rules that test numeric ranges
 - [Quad (64-bit integer) type via PR #133](https://github.com/EvilBit-Labs/libmagic-rs/pull/133) - Provides signed and unsigned 64-bit integer support with endianness variants for modern binary formats
-- [Bitwise XOR (^), NOT (~), and any-value (x) operators via PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145) - Enables advanced binary pattern matching and unconditional match patterns
 
 ### v0.3.0 - Planned
 [Focus: Offset resolution and type system expansion](https://github.com/EvilBit-Labs/libmagic-rs/issues/52). This release adds support for indirect/relative offsets, text file detection, and advanced numeric types.
@@ -198,7 +197,18 @@
 - [Extract CLI tests to integration tests via Issue #61](https://github.com/EvilBit-Labs/libmagic-rs/issues/61) to reduce `main.rs` from 1,647 lines to under 600 lines
 - [Convert evaluator/types.rs to directory module via Issue #63](https://github.com/EvilBit-Labs/libmagic-rs/issues/63) to prevent the file from exceeding the 3,500-4,000 line complexity threshold before adding new types
 
-### v0.4.0 - Planned
+### v0.4.0 - Released March 6, 2026
+[Focus: Bitwise operator completion](https://github.com/EvilBit-Labs/libmagic-rs/issues/52). This release completes the operator implementation roadmap with advanced bitwise operations.
+
+**Implemented features:**
+- [Bitwise XOR (^), NOT (~), and any-value (x) operators via PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145) - Enables advanced binary pattern matching and unconditional match patterns
+
+**Compatibility impact:**
+- Increased operator coverage to 100% (18 of 18 operators implemented)
+- Enhanced support for magic files using bitwise operations
+- Breaking change: Added new Operator enum variants (requires handling in exhaustive matches)
+
+### v0.5.0 - Planned
 [Focus: Core flow specification compliance](https://github.com/EvilBit-Labs/libmagic-rs/issues/52). This release ensures all documented behaviors work exactly as specified.
 
 **Implementation goals:**
@@ -231,9 +241,10 @@
 
 1. **v0.1.0**: Baseline release with core functionality - Completed February 2026
 2. **v0.2.0**: Comparison operators - Completed March 2026
-3. **v0.3.0**: Refactoring tasks (#61, #62, #63) must complete before implementing offset resolution (#37, #38) and additional type features
-4. **v0.4.0**: All prior feature phases must complete before beginning specification compliance validation
-5. **v1.0.0**: All epics (#53-#56) must complete before final compatibility validation and production release
+3. **v0.4.0**: Bitwise operators - Completed March 2026
+4. **v0.3.0**: Refactoring tasks (#61, #62, #63) must complete before implementing offset resolution (#37, #38) and additional type features
+5. **v0.5.0**: All prior feature phases must complete before beginning specification compliance validation
+6. **v1.0.0**: All epics (#53-#56) must complete before final compatibility validation and production release
 
 ### Critical Path Features
 These features have the highest impact on overall compatibility and unblock the most test cases:

[Accept] [Decline]

Magic File Compatibility Status — ✅ Accepted
migration /libmagic-rs/blob/main/docs/src/migration.md
View Suggested Changes
@@ -380,6 +380,62 @@
 
 Update all references from `MatchResult` to `RuleMatch` in type annotations, function signatures, and construction sites.
 
+## Migrating from v0.3.x to v0.4.0
+
+Version 0.4.0 adds three new operator variants to the `Operator` enum for extended bitwise operations and pattern matching capabilities.
+
+### New Operator Enum Variants
+
+Three variants were added to the `Operator` enum:
+
+- `BitwiseXor` (magic file symbol: `^`)
+- `BitwiseNot` (magic file symbol: `~`)
+- `AnyValue` (magic file symbol: `x`)
+
+**Impact:** Since the `Operator` enum is exhaustive (not marked with `#[non_exhaustive]`), any code with exhaustive pattern matching on `Operator` must be updated to handle these variants.
+
+**Before (v0.3.x):**
+
+```rust,ignore
+use libmagic_rs::parser::ast::Operator;
+
+match operator {
+    Operator::Equal => { /* ... */ }
+    Operator::NotEqual => { /* ... */ }
+    Operator::BitwiseAnd => { /* ... */ }
+    Operator::BitwiseOr => { /* ... */ }
+    // ... other existing variants
+}
+```
+
+**After (v0.4.0):**
+
+```rust,ignore
+use libmagic_rs::parser::ast::Operator;
+
+match operator {
+    Operator::Equal => { /* ... */ }
+    Operator::NotEqual => { /* ... */ }
+    Operator::BitwiseAnd => { /* ... */ }
+    Operator::BitwiseOr => { /* ... */ }
+    Operator::BitwiseXor => { /* handle XOR */ }
+    Operator::BitwiseNot => { /* handle NOT */ }
+    Operator::AnyValue => { /* handle any value x */ }
+    // ... other existing variants
+}
+```
+
+**Alternative:** If your code does not need to handle all operators specifically, use a wildcard pattern:
+
+```rust,ignore
+match operator {
+    Operator::Equal => { /* specific handling */ }
+    _ => { /* generic handling for all other operators */ }
+}
+```
+
+These operators enable fuller support for libmagic file format specifications and extend bitwise operation capabilities.
+
 ## Getting Help
 
 If you encounter migration issues:

[Accept] [Decline]

troubleshooting /libmagic-rs/blob/main/docs/src/troubleshooting.md
View Suggested Changes
@@ -9,7 +9,7 @@
 **Problem**: Build fails with older Rust versions
 
 ```text
-error: package `libmagic-rs v0.3.2` cannot be built because it requires rustc 1.89 or newer
+error: package `libmagic-rs v0.4.0` cannot be built because it requires rustc 1.89 or newer
 ```
 
 **Solution**: Update Rust to version 1.89 or newer

[Accept] [Decline]

Type System And Operator Coverage
View Suggested Changes
@@ -4,7 +4,7 @@
 
 The **Type System And Operator Coverage** in libmagic-rs represents the inventory of data types and comparison operators implemented for detecting file formats through magic rule evaluation. As a pure-Rust replacement for the C libmagic library, libmagic-rs [follows a phased implementation strategy](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md) toward achieving [95%+ compatibility with GNU file](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L49) by version 1.0.0.
 
-The v0.1.x release provided [four basic data types](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/parser/ast.rs#L80-L104) (Byte, Short, Long, and String) with comprehensive endianness and signedness support, alongside [four operators](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/parser/ast.rs#L106-L117) including equality, inequality, and bitwise operations. The [v0.2.0 release](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L16) added [four comparison operators](https://github.com/EvilBit-Labs/libmagic-rs/pull/104) (<, >, <=, >=) and changed Byte from a unit variant to a signed/unsigned variant. Version 0.3.0 added [64-bit integer support](https://github.com/EvilBit-Labs/libmagic-rs/pull/133) with the Quad type supporting all endianness and signedness variants. While these primitives enable detection of common file formats including executables, archives, and images, [future versions](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L18-L53) will expand support to include floating-point types, date/time handling, and regex matching.
+The v0.1.x release provided [four basic data types](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/parser/ast.rs#L80-L104) (Byte, Short, Long, and String) with comprehensive endianness and signedness support, alongside [four operators](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/parser/ast.rs#L106-L117) including equality, inequality, and bitwise operations. The [v0.2.0 release](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L16) added [four comparison operators](https://github.com/EvilBit-Labs/libmagic-rs/pull/104) (<, >, <=, >=) and changed Byte from a unit variant to a signed/unsigned variant. Version 0.3.0 added [64-bit integer support](https://github.com/EvilBit-Labs/libmagic-rs/pull/133) with the Quad type supporting all endianness and signedness variants. Version 0.4.0 extended bitwise operator support with [three additional operators](https://github.com/EvilBit-Labs/libmagic-rs/pull/145) (^, ~, x) via PR #145. While these primitives enable detection of common file formats including executables, archives, and images, [future versions](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L18-L53) will expand support to include floating-point types, date/time handling, and regex matching.
 
 This article provides a comprehensive technical reference for the type system and operator implementation, tracking both current capabilities and planned enhancements across the version roadmap to full libmagic compatibility.
 
@@ -66,7 +66,7 @@
 
 ### Operator Architecture
 
-The operator system consists of eleven distinct operators defined in the AST, with runtime evaluation provided by dedicated functions in `src/evaluator/operators.rs`.
+The operator system consists of eleven distinct operators defined in the AST (as of v0.4.0), with runtime evaluation provided by dedicated functions in `src/evaluator/operators.rs`.
 
 ### Implemented Operators
 
@@ -132,7 +132,7 @@
 - **Signed Handling**: Signed integers cast to `u64` for bitwise operations
 - **Implementation**: apply_bitwise_xor function in `src/evaluator/operators/bitwise.rs`
 - **Strength Score**: +4 points
-- **Version**: v0.2.x
+- **Version**: v0.4.0
 
 #### BitwiseNot Operator (~)
 - **Semantics**: Computes bitwise complement of left operand, then checks equality with right value
@@ -140,7 +140,7 @@
 - **Integer Support**: Works with `Uint` and `Int` types only
 - **Implementation**: apply_bitwise_not function in `src/evaluator/operators/bitwise.rs`
 - **Strength Score**: +4 points
-- **Version**: v0.2.x
+- **Version**: v0.4.0
 
 #### AnyValue Operator (x)
 - **Semantics**: Unconditional match; always returns true regardless of operand values
@@ -148,7 +148,7 @@
 - **Type Compatibility**: Accepts any value types
 - **Implementation**: apply_any_value function in `src/evaluator/operators/mod.rs`
 - **Strength Score**: +1 point (least specific)
-- **Version**: v0.2.x
+- **Version**: v0.4.0
 
 ### Operator Type Compatibility Matrix
 
@@ -245,13 +245,12 @@
 - ✅ GreaterThan (>)
 - ✅ LessEqual (<=)
 - ✅ GreaterEqual (>=)
-- ✅ BitwiseXor (^) - [PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145)
-- ✅ BitwiseNot (~) - [PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145)
-- ✅ AnyValue (x) - [PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145)
-
-**Operator Coverage**: 11 of ~13 operators (85%)
-
-### v0.3.0 (Core Primitives - Planned)
+
+**Operator Coverage**: 8 of ~13 operators (62%)
+
+### v0.3.0 (Core Primitives)
+
+**Status**: Released
 
 **Focus**: [Offset resolution enhancements](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L18-L28)
 
@@ -259,12 +258,28 @@
 - [Indirect offset evaluation](https://github.com/EvilBit-Labs/libmagic-rs/issues/37) (pointer dereferencing)
 - [Relative offset evaluation](https://github.com/EvilBit-Labs/libmagic-rs/issues/38) (position tracking)
 
-**Expected Coverage**:
+**Coverage**:
+- Types: 5 of ~33 (15%)
+- Operators: 8 of ~13 (62%)
+- Offsets: 5 of 5 (100%)
+
+### v0.4.0 (Extended Bitwise Operators)
+
+**Status**: Released (March 6, 2026)
+
+**Focus**: Extended bitwise operator support via [PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145)
+
+**New Operators**:
+- ✅ BitwiseXor (^) - XOR operation for bitwise comparisons
+- ✅ BitwiseNot (~) - NOT operation for bitwise negation
+- ✅ AnyValue (x) - Wildcard operator accepting any value
+
+**Coverage**:
 - Types: 5 of ~33 (15%)
 - Operators: 11 of ~13 (85%)
 - Offsets: 5 of 5 (100%)
 
-### v0.4.0 (Advanced Features - Planned)
+### v0.5.0 (Advanced Features - Planned)
 
 **Focus**: [Advanced type support](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L30-L37)
 
@@ -279,7 +294,7 @@
 - Types: ~25 of ~33 (76%)
 - Operators: 11 of ~13 (85%)
 
-### v0.5.0 (API and UX Polish - Planned)
+### v0.6.0 (API and UX Polish - Planned)
 
 **Focus**: [API improvements and developer experience](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L39-L45)
 
@@ -315,7 +330,7 @@
 - **Validation**: Compares output against `.result` files from GNU file
 - **Metrics**: PASS/FAIL/ERROR status with detailed failure information
 
-### Current Compatibility Status (v0.2.0)
+### Current Compatibility Status (v0.4.0)
 
 **By Category** (from [Issue #57](https://github.com/EvilBit-Labs/libmagic-rs/issues/57)):
 - Binary formats: 0 of ~45 tests (requires system magic files)
@@ -334,10 +349,11 @@
 | Version | Compatibility Target | Key Enablers |
 |---------|---------------------|--------------|
 | v0.1.x | 0% (baseline) | Built-in rules only, 4 basic operators |
-| v0.2.0 | 0% (baseline) | Added comparison operators, bitwise XOR/NOT/any-value, quad type |
+| v0.2.0 | 0% (baseline) | Added comparison operators, quad type |
 | v0.3.0 | ~30% | Indirect/relative offsets |
-| v0.4.0 | ~60% | Regex, floating-point, date/time types |
-| v0.5.0 | ~80% | Meta-types, remaining edge cases |
+| v0.4.0 | ~30% | Extended bitwise operators (XOR, NOT, any-value) |
+| v0.5.0 | ~60% | Regex, floating-point, date/time types |
+| v0.6.0 | ~80% | Meta-types, remaining edge cases |
 | v1.0.0 | 95%+ | Full feature parity |
 
 ## libmagic Type Coverage Reference
@@ -389,8 +405,8 @@
 | | `indirect` | N/A | N/A | 📋 Planned | v0.4.0 |
 
 **Current Coverage**: 5 of 33 types (15%)
-**v0.3.0 Target**: 5 of 33 types (15%)
-**v0.4.0 Target**: ~25 of 33 types (76%)
+**v0.4.0 Target**: 5 of 33 types (15%)
+**v0.5.0 Target**: ~25 of 33 types (76%)
 **v1.0.0 Target**: ~31 of 33 types (94%)
 
 ### Complete Operator Inventory
@@ -405,13 +421,13 @@
 | | `<=` | Less or equal | ✅ Implemented | v0.2.0 |
 | **Bitwise** | `&` | Bitwise AND (test) | ✅ Implemented | v0.1.x |
 | | `&mask=value` | Bitwise AND with mask | ✅ Implemented | v0.1.x |
-| | `^` | Bitwise XOR | ✅ Implemented | v0.2.x |
-| | `~` | Bitwise NOT | ✅ Implemented | v0.2.x |
-| **Special** | `x` | Any value (always match) | ✅ Implemented | v0.2.x |
-| | `!` | Negation prefix | 📋 Planned | v0.3.0 |
+| | `^` | Bitwise XOR | ✅ Implemented | v0.4.0 |
+| | `~` | Bitwise NOT | ✅ Implemented | v0.4.0 |
+| **Special** | `x` | Any value (always match) | ✅ Implemented | v0.4.0 |
+| | `!` | Negation prefix | 📋 Planned | v0.5.0 |
 
 **Current Coverage**: 11 of 13 operators (85%)
-**v0.3.0 Target**: 12 of 13 operators (92%)
+**v0.5.0 Target**: 12 of 13 operators (92%)
 **v1.0.0 Target**: 13 of 13 operators (100%)
 
 ## Security and Safety Features
@@ -452,4 +468,4 @@
 
 ---
 
-*This article reflects the state of libmagic-rs as of version 0.2.0. For the latest implementation status, refer to the [project roadmap](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md) and [GitHub issues](https://github.com/EvilBit-Labs/libmagic-rs/issues).*
+*This article reflects the state of libmagic-rs as of version 0.4.0. For the latest implementation status, refer to the [project roadmap](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md) and [GitHub issues](https://github.com/EvilBit-Labs/libmagic-rs/issues).*

[Accept] [Decline]

Note: You must be authenticated to accept/decline updates.

How did I do? Any feedback?  Join Discord

@dosubot
Copy link
Copy Markdown
Contributor

dosubot Bot commented Mar 6, 2026

Documentation Updates

5 document(s) were updated by changes in this PR:

GETTING_STARTED
View Changes
@@ -21,10 +21,12 @@
 
 ```toml
 [dependencies]
-libmagic-rs = "0.3.2"
-```
-
-**Note:** Version 0.3.0 introduces breaking changes. If upgrading from 0.2.x, note that a new `TypeKind::Quad` enum variant was added for 64-bit quad integer types with endian variants, `TypeKind::String` variant discriminant changed from 3 to 4, and `evaluator::MatchResult` was renamed to `evaluator::RuleMatch` to resolve a naming collision with `output::MatchResult`. The public re-export is `RuleMatch`. Exhaustive pattern matching on `TypeKind` requires updates.
+libmagic-rs = "0.4.0"
+```
+
+**Note:** Version 0.4.0 introduces breaking changes. If upgrading from 0.3.x, the `Operator` enum gained three new variants (`BitwiseXor`, `BitwiseNot`, `AnyValue`) for bitwise and any-value operations. Exhaustive pattern matching on `Operator` requires updates.
+
+Version 0.3.0 introduced breaking changes from 0.2.x: a new `TypeKind::Quad` enum variant was added for 64-bit quad integer types with endian variants, `TypeKind::String` variant discriminant changed from 3 to 4, and `evaluator::MatchResult` was renamed to `evaluator::RuleMatch` to resolve a naming collision with `output::MatchResult`. The public re-export is `RuleMatch`. Exhaustive pattern matching on `TypeKind` requires updates.
 
 Version 0.2.0 introduced breaking changes from 0.1.x: `TypeKind::Byte` changed from a unit variant to a tuple variant, and the `Operator` enum gained new variants (`LessThan`, `GreaterThan`, `LessEqual`, `GreaterEqual`) for comparison operations.
 
@@ -65,7 +67,7 @@
 
 ```toml
 [dependencies]
-libmagic-rs = "0.3.2"
+libmagic-rs = "0.4.0"
 ```
 
 #### Step 3: Write Code
Magic File Compatibility Status
View Changes
@@ -1,16 +1,16 @@
 # Magic File Compatibility Status
 
-[libmagic-rs](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/README.md#L12-L15) is a pure-Rust clean-room implementation of libmagic, the C library that powers the Unix `file` command for identifying file types. As of version 0.2.0 (released March 2026), the project is in early development with fundamental file identification capabilities operational. The implementation [currently achieves 0% compatibility (0/81 tests passing)](https://github.com/EvilBit-Labs/libmagic-rs/issues/57) against the third-party GNU file test corpus, but follows a [structured milestone-based roadmap](https://github.com/EvilBit-Labs/libmagic-rs/issues/52) targeting [95%+ compatibility with GNU file by version 1.0.0](https://github.com/EvilBit-Labs/libmagic-rs/issues/57).
+[libmagic-rs](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/README.md#L12-L15) is a pure-Rust clean-room implementation of libmagic, the C library that powers the Unix `file` command for identifying file types. As of version 0.4.0 (released March 2026), the project is in early development with fundamental file identification capabilities operational. The implementation [currently achieves 0% compatibility (0/81 tests passing)](https://github.com/EvilBit-Labs/libmagic-rs/issues/57) against the third-party GNU file test corpus, but follows a [structured milestone-based roadmap](https://github.com/EvilBit-Labs/libmagic-rs/issues/52) targeting [95%+ compatibility with GNU file by version 1.0.0](https://github.com/EvilBit-Labs/libmagic-rs/issues/57).
 
 The implementation emphasizes [memory safety with zero unsafe code](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/README.md#L153), thread-safe design, and modern Rust error handling patterns. Development is organized through [five strategic epics](https://github.com/EvilBit-Labs/libmagic-rs/issues/53) that address operator completeness, type system expansion, offset resolution mechanisms, specification compliance, and final compatibility validation. The project uses a multi-stage parser architecture built on nom combinators and implements hierarchical rule evaluation with graceful error handling.
 
 This article provides comprehensive tracking of implemented versus unsupported features, magic file directive support status, version milestones spanning v0.1.0 through v1.0.0, and the detailed enhancement roadmap specific to the libmagic-rs implementation.
 
-## Current Implementation Status (v0.2.x)
+## Current Implementation Status (v0.4.x)
 
 ### Implemented Features
 
-The v0.2.x releases provide foundational file identification capabilities across data types, operators, offsets, nested rules, and string matching. While limited in scope compared to GNU file, these features establish the architectural patterns for future expansion.
+The v0.4.x releases provide foundational file identification capabilities across data types, operators, offsets, nested rules, and string matching. While limited in scope compared to GNU file, these features establish the architectural patterns for future expansion.
 
 #### Data Types
 The evaluator currently supports [five basic data types with endianness variants](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/types.rs):
@@ -22,7 +22,7 @@
 - **[String](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/types.rs#L275-L308)**: Null-terminated or length-limited strings with UTF-8 conversion using [SIMD-accelerated null scanning](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/types.rs#L291-L298)
 
 #### Operators
-Fifteen operators are [fully implemented in evaluation](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/operators.rs):
+Eighteen operators are [fully implemented in evaluation](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/operators.rs):
 
 - **[Equal (=, ==)](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/operators.rs#L48-L69)**: Equality comparison with cross-type integer coercion
 - **[NotEqual (!=, <>)](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/operators.rs#L108-L110)**: Inequality comparison
@@ -32,11 +32,11 @@
 - **[GreaterEqual (>=)](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/operators.rs#L273-L280)**: Greater-than-or-equal comparison with cross-type integer coercion
 - **[BitwiseAnd (&)](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/operators.rs#L148-L166)**: Bitwise AND pattern matching (returns true if result is non-zero)
 - **[BitwiseAndMask (&0xMASK)](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/operators.rs#L224-L237)**: Applies mask to value before equality comparison
-- **BitwiseXor (^)**: Bitwise XOR pattern matching (returns true if result is non-zero)
-- **BitwiseNot (~)**: Applies bitwise complement to value before equality comparison
-- **AnyValue (x)**: Unconditional match that always returns true
-
-[15 of 17 operators are implemented (88%)](https://github.com/EvilBit-Labs/libmagic-rs/issues/53), with comparison operators providing version checks and range matching capabilities.
+- **[BitwiseXor (^)](https://github.com/EvilBit-Labs/libmagic-rs/pull/145)**: Bitwise XOR pattern matching (returns true if result is non-zero)
+- **[BitwiseNot (~)](https://github.com/EvilBit-Labs/libmagic-rs/pull/145)**: Applies bitwise complement to value before equality comparison
+- **[AnyValue (x)](https://github.com/EvilBit-Labs/libmagic-rs/pull/145)**: Unconditional match that always returns true
+
+All 17 core operators are implemented (100%).
 
 #### Offsets
 Two offset types are [fully operational](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/evaluator/offset.rs):
@@ -97,12 +97,12 @@
 
 Development is organized into five epics that systematically address compatibility gaps. Each epic targets specific version milestones and has defined success criteria.
 
-### Epic #53: Operator Completeness (v0.2.0)
-[Status: Nearly complete](https://github.com/EvilBit-Labs/libmagic-rs/issues/53). Currently 15 of 17 required operators are implemented (88%).
+### Epic #53: Operator Completeness (v0.2.0 - v0.4.0)
+[Status: Complete](https://github.com/EvilBit-Labs/libmagic-rs/issues/53). All 17 required operators are implemented (100%).
 
 **Implemented operators:**
 - [Comparison operators (<, >, <=, >=) implemented in PR #104](https://github.com/EvilBit-Labs/libmagic-rs/pull/104) - These operators enable version checks and range matching, unlocking compatibility with magic rules that test numeric ranges. Released in v0.2.0.
-- [Bitwise XOR (^), NOT (~), and any-value (x) operators implemented in PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145) - Resolves Issue #35. Required for advanced binary pattern matching and unconditional match patterns.
+- [Bitwise XOR (^), NOT (~), and any-value (x) operators implemented in PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145) - Resolves Issue #35. Required for advanced binary pattern matching and unconditional match patterns. Released in v0.4.0.
 
 ### Epic #54: Type System Expansion (v0.2.0 + v0.3.0)
 [Status: 5 of 33+ types implemented](https://github.com/EvilBit-Labs/libmagic-rs/issues/54). The type system expansion is split across two releases to manage code complexity.
@@ -125,7 +125,7 @@
 
 [Submodule files will be pre-created as placeholders](https://github.com/EvilBit-Labs/libmagic-rs/issues/62) (`offset_indirect.rs`, `offset_relative.rs`) to prevent the evaluator module from becoming oversized.
 
-### Epic #56: Core Flow Spec Compliance (v0.4.0)
+### Epic #56: Core Flow Spec Compliance (v0.5.0)
 [Status: 7 of 12 flows complete](https://github.com/EvilBit-Labs/libmagic-rs/issues/56). This epic ensures the library and CLI behave exactly as documented in the Core Flows specification.
 
 **Completed flows:**
@@ -179,7 +179,6 @@
 **Implemented features:**
 - [Comparison operators (<, >, <=, >=) via PR #104](https://github.com/EvilBit-Labs/libmagic-rs/pull/104) - Enables version checks and range matching for numeric values, unlocking magic rules that test numeric ranges
 - [Quad (64-bit integer) type via PR #133](https://github.com/EvilBit-Labs/libmagic-rs/pull/133) - Provides signed and unsigned 64-bit integer support with endianness variants for modern binary formats
-- [Bitwise XOR (^), NOT (~), and any-value (x) operators via PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145) - Enables advanced binary pattern matching and unconditional match patterns
 
 ### v0.3.0 - Planned
 [Focus: Offset resolution and type system expansion](https://github.com/EvilBit-Labs/libmagic-rs/issues/52). This release adds support for indirect/relative offsets, text file detection, and advanced numeric types.
@@ -198,7 +197,13 @@
 - [Extract CLI tests to integration tests via Issue #61](https://github.com/EvilBit-Labs/libmagic-rs/issues/61) to reduce `main.rs` from 1,647 lines to under 600 lines
 - [Convert evaluator/types.rs to directory module via Issue #63](https://github.com/EvilBit-Labs/libmagic-rs/issues/63) to prevent the file from exceeding the 3,500-4,000 line complexity threshold before adding new types
 
-### v0.4.0 - Planned
+### v0.4.0 - Released March 6, 2026
+[Focus: Bitwise operator completion](https://github.com/EvilBit-Labs/libmagic-rs/issues/52). This release completes the operator implementation roadmap, achieving 100% coverage of core operators needed for magic file compatibility.
+
+**Implemented features:**
+- [Bitwise XOR (^), NOT (~), and any-value (x) operators via PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145) - Enables advanced binary pattern matching and unconditional match patterns, completing Epic #53 (Operator Completeness)
+
+### v0.5.0 - Planned
 [Focus: Core flow specification compliance](https://github.com/EvilBit-Labs/libmagic-rs/issues/52). This release ensures all documented behaviors work exactly as specified.
 
 **Implementation goals:**
@@ -231,9 +236,10 @@
 
 1. **v0.1.0**: Baseline release with core functionality - Completed February 2026
 2. **v0.2.0**: Comparison operators - Completed March 2026
-3. **v0.3.0**: Refactoring tasks (#61, #62, #63) must complete before implementing offset resolution (#37, #38) and additional type features
-4. **v0.4.0**: All prior feature phases must complete before beginning specification compliance validation
-5. **v1.0.0**: All epics (#53-#56) must complete before final compatibility validation and production release
+3. **v0.4.0**: Bitwise operators completing Epic #53 - Completed March 2026
+4. **v0.3.0**: Refactoring tasks (#61, #62, #63) must complete before implementing offset resolution (#37, #38) and additional type features
+5. **v0.5.0**: All prior feature phases must complete before beginning specification compliance validation
+6. **v1.0.0**: All epics (#53-#56) must complete before final compatibility validation and production release
 
 ### Critical Path Features
 These features have the highest impact on overall compatibility and unblock the most test cases:
migration
View Changes
@@ -380,6 +380,55 @@
 
 Update all references from `MatchResult` to `RuleMatch` in type annotations, function signatures, and construction sites.
 
+## Migrating from v0.3.x to v0.4.0
+
+Version 0.4.0 adds support for bitwise XOR, bitwise NOT, and any-value matching operators. Update your code as follows:
+
+### New Operator Variants
+
+The `Operator` enum added three operator variants: `BitwiseXor`, `BitwiseNot`, and `AnyValue`. Exhaustive matches on `Operator` must handle these variants.
+
+**Before (v0.3.x):**
+
+```rust,ignore
+use libmagic_rs::parser::ast::Operator;
+
+match operator {
+    Operator::Equal => { /* ... */ }
+    Operator::NotEqual => { /* ... */ }
+    Operator::LessThan => { /* ... */ }
+    Operator::GreaterThan => { /* ... */ }
+    Operator::LessEqual => { /* ... */ }
+    Operator::GreaterEqual => { /* ... */ }
+    // Other existing variants
+}
+```
+
+**After (v0.4.0):**
+
+```rust,ignore
+use libmagic_rs::parser::ast::Operator;
+
+match operator {
+    Operator::Equal => { /* ... */ }
+    Operator::NotEqual => { /* ... */ }
+    Operator::LessThan => { /* ... */ }
+    Operator::GreaterThan => { /* ... */ }
+    Operator::LessEqual => { /* ... */ }
+    Operator::GreaterEqual => { /* ... */ }
+    Operator::BitwiseXor => {
+        // Handle bitwise XOR operator (^)
+    }
+    Operator::BitwiseNot => {
+        // Handle bitwise NOT operator (~)
+    }
+    Operator::AnyValue => {
+        // Handle any-value operator (x)
+    }
+    // Other existing variants
+}
+```
+
 ## Getting Help
 
 If you encounter migration issues:
troubleshooting
View Changes
@@ -9,7 +9,7 @@
 **Problem**: Build fails with older Rust versions
 
 ```text
-error: package `libmagic-rs v0.3.2` cannot be built because it requires rustc 1.89 or newer
+error: package `libmagic-rs v0.4.0` cannot be built because it requires rustc 1.89 or newer
 ```
 
 **Solution**: Update Rust to version 1.89 or newer
Type System And Operator Coverage
View Changes
@@ -4,7 +4,7 @@
 
 The **Type System And Operator Coverage** in libmagic-rs represents the inventory of data types and comparison operators implemented for detecting file formats through magic rule evaluation. As a pure-Rust replacement for the C libmagic library, libmagic-rs [follows a phased implementation strategy](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md) toward achieving [95%+ compatibility with GNU file](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L49) by version 1.0.0.
 
-The v0.1.x release provided [four basic data types](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/parser/ast.rs#L80-L104) (Byte, Short, Long, and String) with comprehensive endianness and signedness support, alongside [four operators](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/parser/ast.rs#L106-L117) including equality, inequality, and bitwise operations. The [v0.2.0 release](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L16) added [four comparison operators](https://github.com/EvilBit-Labs/libmagic-rs/pull/104) (<, >, <=, >=) and changed Byte from a unit variant to a signed/unsigned variant. Version 0.3.0 added [64-bit integer support](https://github.com/EvilBit-Labs/libmagic-rs/pull/133) with the Quad type supporting all endianness and signedness variants. While these primitives enable detection of common file formats including executables, archives, and images, [future versions](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L18-L53) will expand support to include floating-point types, date/time handling, and regex matching.
+The v0.1.x release provided [four basic data types](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/parser/ast.rs#L80-L104) (Byte, Short, Long, and String) with comprehensive endianness and signedness support, alongside [four operators](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/src/parser/ast.rs#L106-L117) including equality, inequality, and bitwise operations. The [v0.2.0 release](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L16) added [four comparison operators](https://github.com/EvilBit-Labs/libmagic-rs/pull/104) (<, >, <=, >=) and changed Byte from a unit variant to a signed/unsigned variant. Version 0.3.0 added [64-bit integer support](https://github.com/EvilBit-Labs/libmagic-rs/pull/133) with the Quad type supporting all endianness and signedness variants. Version 0.4.0 added [three additional operators](https://github.com/EvilBit-Labs/libmagic-rs/pull/145) (BitwiseXor, BitwiseNot, and AnyValue) bringing the total to 11 implemented operators. While these primitives enable detection of common file formats including executables, archives, and images, [future versions](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L18-L53) will expand support to include floating-point types, date/time handling, and regex matching.
 
 This article provides a comprehensive technical reference for the type system and operator implementation, tracking both current capabilities and planned enhancements across the version roadmap to full libmagic compatibility.
 
@@ -132,7 +132,7 @@
 - **Signed Handling**: Signed integers cast to `u64` for bitwise operations
 - **Implementation**: apply_bitwise_xor function in `src/evaluator/operators/bitwise.rs`
 - **Strength Score**: +4 points
-- **Version**: v0.2.x
+- **Version**: v0.4.0
 
 #### BitwiseNot Operator (~)
 - **Semantics**: Computes bitwise complement of left operand, then checks equality with right value
@@ -140,7 +140,7 @@
 - **Integer Support**: Works with `Uint` and `Int` types only
 - **Implementation**: apply_bitwise_not function in `src/evaluator/operators/bitwise.rs`
 - **Strength Score**: +4 points
-- **Version**: v0.2.x
+- **Version**: v0.4.0
 
 #### AnyValue Operator (x)
 - **Semantics**: Unconditional match; always returns true regardless of operand values
@@ -148,7 +148,7 @@
 - **Type Compatibility**: Accepts any value types
 - **Implementation**: apply_any_value function in `src/evaluator/operators/mod.rs`
 - **Strength Score**: +1 point (least specific)
-- **Version**: v0.2.x
+- **Version**: v0.4.0
 
 ### Operator Type Compatibility Matrix
 
@@ -245,39 +245,46 @@
 - ✅ GreaterThan (>)
 - ✅ LessEqual (<=)
 - ✅ GreaterEqual (>=)
+
+**Operator Coverage**: 8 of ~13 operators (62%)
+
+### v0.3.0 (Core Primitives)
+
+**Status**: Released
+
+**Focus**: [Offset resolution enhancements](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L18-L28)
+
+**Offset Enhancements**:
+- [Indirect offset evaluation](https://github.com/EvilBit-Labs/libmagic-rs/issues/37) (pointer dereferencing)
+- [Relative offset evaluation](https://github.com/EvilBit-Labs/libmagic-rs/issues/38) (position tracking)
+
+**Coverage**:
+- Types: 5 of ~33 (15%)
+- Operators: 8 of ~13 (62%)
+- Offsets: 5 of 5 (100%)
+
+### v0.4.0 (Bitwise Operators and Advanced Features)
+
+**Status**: Released and [published on crates.io](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/README.md#L24)
+
+**Focus**: [Bitwise operators](https://github.com/EvilBit-Labs/libmagic-rs/pull/145) and [advanced type support](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L30-L37)
+
+**New Operators**:
 - ✅ BitwiseXor (^) - [PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145)
 - ✅ BitwiseNot (~) - [PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145)
 - ✅ AnyValue (x) - [PR #145](https://github.com/EvilBit-Labs/libmagic-rs/pull/145)
 
-**Operator Coverage**: 11 of ~13 operators (85%)
-
-### v0.3.0 (Core Primitives - Planned)
-
-**Focus**: [Offset resolution enhancements](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L18-L28)
-
-**Offset Enhancements**:
-- [Indirect offset evaluation](https://github.com/EvilBit-Labs/libmagic-rs/issues/37) (pointer dereferencing)
-- [Relative offset evaluation](https://github.com/EvilBit-Labs/libmagic-rs/issues/38) (position tracking)
-
-**Expected Coverage**:
-- Types: 5 of ~33 (15%)
-- Operators: 11 of ~13 (85%)
-- Offsets: 5 of 5 (100%)
-
-### v0.4.0 (Advanced Features - Planned)
-
-**Focus**: [Advanced type support](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md#L30-L37)
-
-**New Types**:
+**Planned New Types**:
 - **Regex and Search**: Pattern matching for text detection ([Issue #39](https://github.com/EvilBit-Labs/libmagic-rs/issues/39))
 - **Floating-Point**: `float`, `double`, `befloat`, `bedouble`, `lefloat`, `ledouble` ([Issue #40](https://github.com/EvilBit-Labs/libmagic-rs/issues/40))
 - **Date/Time**: 32-bit (`date`, `ldate`, variants) and 64-bit (`qdate`, `qldate`, variants) with UTC/local time distinction ([Issue #41](https://github.com/EvilBit-Labs/libmagic-rs/issues/41))
 - **Pascal String**: Length-prefixed string type ([Issue #43](https://github.com/EvilBit-Labs/libmagic-rs/issues/43))
 - **Meta-Types**: `default`, `clear`, `name`, `use`, `indirect` ([Issue #42](https://github.com/EvilBit-Labs/libmagic-rs/issues/42))
 
-**Expected Coverage**:
-- Types: ~25 of ~33 (76%)
+**Coverage**:
+- Types: 5 of ~33 (15%)
 - Operators: 11 of ~13 (85%)
+- Offsets: 5 of 5 (100%)
 
 ### v0.5.0 (API and UX Polish - Planned)
 
@@ -315,7 +322,7 @@
 - **Validation**: Compares output against `.result` files from GNU file
 - **Metrics**: PASS/FAIL/ERROR status with detailed failure information
 
-### Current Compatibility Status (v0.2.0)
+### Current Compatibility Status (v0.4.0)
 
 **By Category** (from [Issue #57](https://github.com/EvilBit-Labs/libmagic-rs/issues/57)):
 - Binary formats: 0 of ~45 tests (requires system magic files)
@@ -334,10 +341,11 @@
 | Version | Compatibility Target | Key Enablers |
 |---------|---------------------|--------------|
 | v0.1.x | 0% (baseline) | Built-in rules only, 4 basic operators |
-| v0.2.0 | 0% (baseline) | Added comparison operators, bitwise XOR/NOT/any-value, quad type |
+| v0.2.0 | 0% (baseline) | Added comparison operators, quad type |
 | v0.3.0 | ~30% | Indirect/relative offsets |
-| v0.4.0 | ~60% | Regex, floating-point, date/time types |
-| v0.5.0 | ~80% | Meta-types, remaining edge cases |
+| v0.4.0 | ~40% | Bitwise XOR/NOT/any-value operators |
+| v0.5.0 | ~60% | Regex, floating-point, date/time types |
+| v0.6.0 | ~80% | Meta-types, remaining edge cases |
 | v1.0.0 | 95%+ | Full feature parity |
 
 ## libmagic Type Coverage Reference
@@ -389,8 +397,9 @@
 | | `indirect` | N/A | N/A | 📋 Planned | v0.4.0 |
 
 **Current Coverage**: 5 of 33 types (15%)
-**v0.3.0 Target**: 5 of 33 types (15%)
-**v0.4.0 Target**: ~25 of 33 types (76%)
+**v0.3.0 Status**: 5 of 33 types (15%)
+**v0.4.0 Status**: 5 of 33 types (15%)
+**v0.5.0 Target**: ~25 of 33 types (76%)
 **v1.0.0 Target**: ~31 of 33 types (94%)
 
 ### Complete Operator Inventory
@@ -405,13 +414,14 @@
 | | `<=` | Less or equal | ✅ Implemented | v0.2.0 |
 | **Bitwise** | `&` | Bitwise AND (test) | ✅ Implemented | v0.1.x |
 | | `&mask=value` | Bitwise AND with mask | ✅ Implemented | v0.1.x |
-| | `^` | Bitwise XOR | ✅ Implemented | v0.2.x |
-| | `~` | Bitwise NOT | ✅ Implemented | v0.2.x |
-| **Special** | `x` | Any value (always match) | ✅ Implemented | v0.2.x |
-| | `!` | Negation prefix | 📋 Planned | v0.3.0 |
+| | `^` | Bitwise XOR | ✅ Implemented | v0.4.0 |
+| | `~` | Bitwise NOT | ✅ Implemented | v0.4.0 |
+| **Special** | `x` | Any value (always match) | ✅ Implemented | v0.4.0 |
+| | `!` | Negation prefix | 📋 Planned | v0.5.0 |
 
 **Current Coverage**: 11 of 13 operators (85%)
-**v0.3.0 Target**: 12 of 13 operators (92%)
+**v0.4.0 Status**: 11 of 13 operators (85%)
+**v0.5.0 Target**: 12 of 13 operators (92%)
 **v1.0.0 Target**: 13 of 13 operators (100%)
 
 ## Security and Safety Features
@@ -452,4 +462,4 @@
 
 ---
 
-*This article reflects the state of libmagic-rs as of version 0.2.0. For the latest implementation status, refer to the [project roadmap](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md) and [GitHub issues](https://github.com/EvilBit-Labs/libmagic-rs/issues).*
+*This article reflects the state of libmagic-rs as of version 0.4.0. For the latest implementation status, refer to the [project roadmap](https://github.com/EvilBit-Labs/libmagic-rs/blob/e925ef6b3f2208fc8805a728ba3de55956f4447a/ROADMAP.md) and [GitHub issues](https://github.com/EvilBit-Labs/libmagic-rs/issues).*

How did I do? Any feedback?  Join Discord

mergify Bot pushed a commit that referenced this pull request Mar 6, 2026
Update documentation for
#151

Updated documentation to clarify that v0.4.0's three new Operator enum
variants (`BitwiseXor`, `BitwiseNot`, `AnyValue`) are for "bitwise and
any-value operations" rather than just "extended bitwise operations."
Additionally, expanded the v0.4.0 migration section in the migration
guide with more detailed examples and impact explanation. These changes
improve clarity for users upgrading from v0.3.x and ensure consistency
across getting started and migration guides.

_Generated by [Dosu](https://dosu.dev)_

Co-authored-by: dosubot[bot] <131922026+dosubot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation parser Magic file parsing components and grammar size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants