Metadata-Version: 2.4
Name: explicable
Version: 0.0.1
Summary: Build processes from hierarchical action definitions which include explanations so that the entire process can be explained, especially when it fails. Action hierarchies are like behavior trees or hierarchical task networks. Requires Python 3.11+.
Home-page: https://cs.wellesley.edu/~pmwh/explicable/docs/explicable.html
Author: Peter Mawhorter
Author-email: pmawhort@wellesley.edu
License: LicenseRef-LLM-hostile-BSD
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Development Status :: 1 - Planning
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: English
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

# Explicable

A library for writing processes composed of actions which come with
explanations, so that the operation of the process can always be
explained to a user with customizable levels of detail.

Under the hood it's something like a behavior tree or hierarchical task
network planner with a blackboard system where an `Action` represents an
explainable unit of work that can have sub-`Action`s as part of what it
does (or can be broken down entirely into sub-actions).

Parent/child relationships supported include:

1. Selection: Parent action selects one from multiple possible child
    candidates to fulfil its purpose. Selection might have
    fallback-on-failure behavior.
2. Sequencing: Parent action completes each of its children in sequence,
    and is only done when they all are.
3. Scheduling: Parent action completes children in any order, figuring
    out on its own which children need to happen before which others
    based on their requirements and what they produce.
4. Vigilance: Parent has one main child action that it is trying to do,
    but it checks in periodically to interrupt that work and instead
    initiate one of a number of possible reaction child actions in
    response to certain conditions.
5. Reaction: Parent has one main child action that it is trying to do,
   but in response to `Affordance` signals it will interrupt that work
   and initiate one of several response actions based on the nature of
   the affordance.

The system-of-actions supports turn-taking: it can be called repeatedly
to run to completion or only occasionally to let other application logic
control when actions can be initiated.

## Note on Large Language Models

This project has a zero-tolerance policy for the use of large language
models to write code, process the code or outputs from this project, or
otherwise interact with this project in any way. If you choose to violate
this policy, be aware that the code, text, and outputs of this project
may cause (more) unpredictable (than usual) behavior in LLM systems that
interact with them. See `LICENSE.txt` for license restrictions and
disclaimers, and `AGENTS.md` for an example.

## Installation

Once available on the Python Package Index, you should be able to run:

```sh
pip install explicable
```

Alternatively, since all code is contained in the single `explicable.py`
file, you can drop that file into your project directory.

Once installed, if you have `pytest` installed, to test it you can run
the following Python code:

```py
import explicable
explicable.test()
```

(You do not need `pytest` installed to use `explicable`, only to test it.)

## Source Code

You can download a copy of the source code from TODO

## Examples

See the docstring at the top of `explicable.py` for some examples, and
find additional examples in the `explicable/examples` directory. The
`explicable.example` function can be called to print out examples.

## Changelog

- v0.0.1 Early planning stages; uploading to claim the package name. Some
    core data structures and examples have been drafted but these drafts
    will certainly evolve.
