diff --git a/CHANGELOG.md b/CHANGELOG.md index c2eb9eb..b6eae21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,29 @@ 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.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v0.4.1 (2026-06-21) + +### Fixed + +- **C1**: Corrected moduledoc and `rule/2` docstring to state that **uppercase** identifiers are logic variables (was incorrectly documented as lowercase). Updated moduledoc examples, `rule/2` docstring, README, and article 01 to use uppercase variables consistently. +- **C2**: Aggregate syntax (`agg(...)`) now raises `ExDatalog.DSL.CompileError` with a clear message in both head and body positions, instead of crashing with `CompileError` or `FunctionClauseError`. Updated CHANGELOG, article 05, and moduledoc to reflect reality. +- **H1**: Replaced meaningless aggregate struct-literal tests with real end-to-end compile-time tests that exercise `agg(...)` DSL syntax in both head and body positions. +- **H2**: Query without a `where` clause now raises `ExDatalog.DSL.CompileError` with a readable message instead of an opaque `Protocol.UndefinedError`. +- **M1**: Query `find` variables that are not present in the `where` pattern now raise `ExDatalog.DSL.CompileError` at compile time instead of silently returning wrong results. +- **M2**: Unrecognized expressions inside `relation` and `facts` blocks now raise `ExDatalog.DSL.CompileError` instead of being silently dropped. +- **L1**: All DSL authoring errors now raise `ExDatalog.DSL.CompileError` (was a mix of `CompileError` and `ArgumentError`). +- **L2**: README test count updated to 792 (was stale at 751, then 786). +- **L3**: Dropped unused `_program` parameter from `validate_rules!/1`. +- **L4**: Removed duplicate `eq` constraint test from `SchemaCoverageTest`. +- **L5**: Fixed moduledoc reference from `materialize/0` to `materialize/0,1`. +- **L6**: Deleted `livebooks/examples.md` (521-line unreferenced LLM-generated artifact). + +### Changed + +- Version bumped from 0.4.0 to 0.4.1 +- All DSL error messages now go through `ExDatalog.DSL.CompileError` for uniform catch/rescue +- `ExDatalog.UnsupportedFeature` struct retained for future use but no longer produced at runtime + ## v0.4.0 (2026-06-20) ### Added diff --git a/README.md b/README.md index 610505c..d1ff650 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ It continues to influence modern databases, compilers, static analysis tools, kn - **Provenance / derivation explain** (`explain: true`) - **Telemetry** integration (`:telemetry` events for query lifecycle) - **Deterministic**: same program + same facts = same result regardless of backend -- 786 tests, 0 failures, credo clean +- 792 tests, 0 failures, credo clean ## Installation @@ -52,7 +52,7 @@ Add `ex_datalog` to your dependencies in `mix.exs`: ```elixir def deps do [ - {:ex_datalog, "~> 0.4.0"} + {:ex_datalog, "~> 0.4.1"} ] end ``` @@ -421,7 +421,8 @@ The following references are highly recommended for understanding both the theor | Version | Description | |---|---| | v0.3.0 | Tuple shorthand for rules (`add_rule/3`, `add_rule/4`), `Term.from/1`, `ExDatalog.Atom.from_tuple/1`, `Constraint.from_tuple/1`; renamed `Result` → `Knowledge`, `query` → `materialize` | -| v0.4.0 | Schema DSL (`use ExDatalog.Schema`), `relation`, `fact`, `rule`, `query` macros, `not_` negation, constraint DSL, post-materialization queries, aggregate syntax preview | +| v0.4.0 | Schema DSL (`use ExDatalog.Schema`), `relation`, `fact`, `rule`, `query` macros, `not_` negation, constraint DSL, post-materialization queries | +| v0.4.1 | DSL review fixes: correct uppercase-variable docs, clean aggregate error, query/find validation, unified `DSL.CompileError`, 792 tests | | v0.5.0 | Magic sets / demand-driven evaluation, general predicates as BEAM callbacks | | v1.0.0 | Stable public API, hardened production semantics | diff --git a/mix.exs b/mix.exs index a6e7f09..3d9ae92 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule ExDatalog.MixProject do use Mix.Project - @version "0.4.0" + @version "0.4.1" @source_url "https://github.com/thanos/ex_datalog" def project do