Metadata-Version: 2.5
Name: lightfall-settings
Version: 0.1.2
Summary: Scoped settings model for Lightfall: scopes, scope roles, setting specs, resolution and write rules
Project-URL: Homepage, https://github.com/als-controls/lightfall-settings
Project-URL: Source, https://github.com/als-controls/lightfall-settings
Author: ALS Controls Team
License-Expression: BSD-3-Clause
License-File: LEGAL.md
License-File: LICENSE.md
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: pydantic>=2.0
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: docs
Requires-Dist: myst-parser; extra == 'docs'
Requires-Dist: sphinx; extra == 'docs'
Description-Content-Type: text/markdown

# lightfall-settings

Pure-Python model for Lightfall's scoped settings, shared by the Lightfall client and the
logbook server so both compute identical answers.

- **Scopes**: `facility` → `beamline:<bl>` → `branch:<branch>` → `user:<sub>`, ordered broad to
  specific in a `ScopeChain`.
- **Scope roles** from Keycloak group paths (`/beamlines/<bl>/<role>`,
  `/beamlines/<bl>/branch/<branch>/<role>`, `/beamlines/_all/<role>`, `/BCG_staff`).
- **`SettingSpec`**: which scopes a key may be set at, `override` or `union` policy, write role,
  lockability. Specs serialize to JSON for server-side key proposals and approvals.
- **Resolver**: effective value of a key across a chain of scope snapshots, honouring locks.
- **Write rules**: the server-side checks for set / delete / lock / unlock / publish.

No Qt, no HTTP. Depends only on pydantic.

## Install

    pip install lightfall-settings

## Development

    ../lightfall/.venv/Scripts/python -m pytest
    ../lightfall/.venv/Scripts/python -m ruff check .

## License

BSD-3-Clause; see [LICENSE.md](LICENSE.md) and [LEGAL.md](LEGAL.md).
