Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
171d404
feat: prepare interpreter and AST for constant folding
anakrish Oct 28, 2025
b24088b
feat: add rule path helpers
anakrish Oct 28, 2025
09bfc72
feat: add core type analysis model
anakrish Oct 28, 2025
3cb79f4
feat: add constant fact store
anakrish Oct 28, 2025
7296537
feat: add value-to-type bridge
anakrish Oct 28, 2025
728eb2d
feat: add type analysis contexts
anakrish Oct 28, 2025
0230ce8
Introduce type analysis result model
anakrish Oct 28, 2025
5cd4f60
Add type analysis options
anakrish Oct 28, 2025
6ad207a
Add propagation analysis state
anakrish Oct 28, 2025
b31f8e8
Add type analyzer scaffold
anakrish Oct 28, 2025
2d87024
Add rule analysis traversal
anakrish Oct 28, 2025
c03bfaf
Extend parser metadata for type analysis
anakrish Oct 28, 2025
1eff55d
Add type analysis diagnostics
anakrish Oct 28, 2025
c563873
Add type analysis fact helpers
anakrish Oct 28, 2025
a353719
Add loop binding helpers for propagation
anakrish Oct 28, 2025
db076cd
Infer unary negation types
anakrish Oct 28, 2025
7538f08
Infer set operations
anakrish Oct 28, 2025
7207049
Infer boolean comparisons
anakrish Oct 28, 2025
caacffc
Infer arithmetic operations
anakrish Oct 28, 2025
c987e47
Infer assignment expressions
anakrish Oct 28, 2025
19bfe7a
Infer literal expressions
anakrish Oct 28, 2025
27242b9
type-analysis: add structural utility helpers
anakrish Oct 28, 2025
25ffeb8
type-analysis: add property access inference
anakrish Oct 28, 2025
099a93d
type-analysis: infer structural literals
anakrish Oct 28, 2025
14f3ac1
type-analysis: add expression module shims
anakrish Oct 28, 2025
20d5257
type-analysis: add expression helper utilities
anakrish Oct 28, 2025
f9614bf
type-analysis: add expression dispatcher
anakrish Oct 28, 2025
f4e42f5
type-analysis: add comprehension inference
anakrish Oct 28, 2025
72eeb0d
type-analysis: add statement inference
anakrish Oct 28, 2025
077961e
type-analysis: add rule expression module
anakrish Oct 28, 2025
2df1694
type-analysis: add rule lookup helpers
anakrish Oct 28, 2025
0f4e8cc
type-analysis: add rule call handling
anakrish Oct 28, 2025
8fa9e31
type-analysis: add builtin catalog and lookup
anakrish Oct 28, 2025
eac2c1d
type-analysis: expose public entrypoints
anakrish Oct 28, 2025
0646834
type-analysis: integrate checker into engine
anakrish Oct 28, 2025
0472582
tests(type-analysis): add YAML harness and suites
anakrish Oct 28, 2025
22d2217
examples: add type analysis helpers
anakrish Oct 28, 2025
977b6ef
docs: document type analysis workflow
anakrish Oct 28, 2025
4c71846
Fix build without default-features
anakrish Oct 28, 2025
4912692
fix: clippy warnings
anakrish Oct 28, 2025
48b51ed
fix test execution in no-std
anakrish Oct 28, 2025
c2a342b
fix schema doc tests
anakrish Oct 28, 2025
6b6ba2b
fix: Do not use the or keyword
anakrish Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,29 @@ See [Engine::get_coverage_report](https://docs.rs/regorus/latest/regorus/struct.
Policy coverage information is useful for debugging your policy as well as to write tests for your policy so that all
lines of the policy are exercised by the tests.

## Type analysis

Regorus contains an experimental structural type analysis engine that can be used to reason about rule outputs,
expression constants, schema-backed types, and diagnostics before executing a policy. Applications can opt in by
calling `Engine::enable_type_checking`, optionally providing input and data schemas or limiting the analysis to
specific entrypoints via the `TypeChecker` API.

The `regorus` example binary exposes this functionality through the new `analyze` subcommand:

```bash
$ regorus analyze -d examples/server/allowed_server.rego \
--input-schema examples/server/input.schema.json \
-e data.example
```

This produces a structured report that lists inferred rule facts, expression-level facts, provenance, and any
diagnostics that were discovered. Pass `--verbose` to include dependency graphs and specialization summaries, or use
`-b`/`--bundles` to analyze entire policy directories.

End-to-end regression tests for the analyzer live under `src/tests/type_analysis` with YAML fixtures located in
`tests/type_analysis`. Each case describes modules, optional schemas, and the expected facts or diagnostics; running
`cargo test type_analysis::run` executes the full suite.

## ACI Policies

Regorus successfully passes the ACI policy test-suite. It is fast and can run each of the tests in a few milliseconds.
Expand Down
1 change: 1 addition & 0 deletions examples/helpers/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod type_analysis;
Loading
Loading