---
tags: deppy
---
# Kuberdep - Joe's Deppy thought expermient
https://github.com/joelanford/kuberdep
## APIs
### Entity
The definition of an installable artifact. It has a unique ID, properties, and constraints. This is akin to an item from the GRPC `ListBundles` response.
### ConstraintDefinition
The definition of the implementation of a constraint. For example, "kuberdep.io/v1/Mandatory" ensures that any entity that includes a constraint with this ID is present in a `Resolution` result.
The implementation is provided via inlined javascript code.
This API externalizes constraint definitions from the engine such that constraint types can be added/removed/modified out-of-band from the engine. It gives users a means of adding their own constraints.
### Problem
This is the interface into the SAT solver. You feed it a low-ish level representation of your problem and it produces a solution (or a "not satisfiable" error message)
### Resolution
An API to request a resolution over a set of `Entity` objects (selected by an optional label selector)
The controllers reads the selected entity set and all of the constraint definitions, builds a Javascript runtime VM, and for each constraint of each entity, it:
1. Looks up the constraint function to call by constraint.Type.
1. Builds a plugin input, consisting of the current entity (the subject), the config of the constraint (constraint.Value), and all of the other entities in the selected set.
2. Executes the function via the Javascript VM, passing in the plugin input.
3. Receives a list of low-level SAT constraints and appends them to the set of constraints for the current subject.
4. Builds a `Problem` by adding each of the entities' low-level constraints
5. Creates (or updates) the `Problem`
6. Bubbles up the `Problem` status to the `Resolution` status.
The end result is a `Resolution` object that has a list of entity IDs that make up the solution.