Hysen Labs
Library / SDK
microsoft/OAT avatar
microsoft

OAT

Object Analysis Toolkit is a C# library for analyzing objects using Rules.

100 stars19 forksC#MIT
01
DEEP OPEN-SOURCE ANALYSIS

OAT, a rules engine for inspecting C objects

Object Analysis Toolkit is a C# metaprogramming library where rules with targets, severities, and expressions drive analysis of arbitrary C objects, plus an experimental Blazor sandbox to author and test them.

02
DEEP OPEN-SOURCE ANALYSIS

Rules in four parts

Object Analysis Toolkit, OAT for short, describes itself as a rules driven metaprogramming engine for arbitrary C objects. A rule bundles an object target, an int severity, a string boolean expression, and a list of clauses that get applied to the targeted object. Each clause runs a specified operation on a specified field, and a field can be any property, subproperty, or field of the object, something like SomeFieldOfTarget.SomeObject.SomeProperty. Clauses can capture the result of their operation so it comes back with the applied rule.

03
DEEP OPEN-SOURCE ANALYSIS

An experimental browser sandbox

OAT Blazor is a separate, experimental piece: a WebAssembly app that runs in the browser and lets you author rules and test them in a sandbox using objects instantiated from an assembly you provide. It is a way to poke at the rule engine without standing up a full build environment. The README introduces it under the getting started section rather than treating it as the main product.

04
DEEP OPEN-SOURCE ANALYSIS

Extending and contributing

Both the operation set and the object types supported by existing operations can be expanded with delegates, which is how the engine stays open to new kinds of checks. A full walkthrough on the wiki covers creating a custom operation, validating your custom operation rules, and capturing clause values. Contributions run through the usual Microsoft flow: a Contributor License Agreement, a bot that figures out whether one is needed when you open a pull request, and the Microsoft Open Source Code of Conduct.

06
DEEP OPEN-SOURCE ANALYSIS

Official sources

07
Community notes

Community notes