Metadata-Version: 2.4
Name: codecraftai-configuration
Version: 1.3.1
Summary: Code Craft AI - Configuration
License-Expression: LicenseRef-CodeCraftAI-Source-Available
License-File: LICENSE.md
Keywords: python
Author: Myron Walker
Author-email: myron.walker@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: POSIX
Provides-Extra: couchdb
Provides-Extra: pymongo
Requires-Dist: codecraftai-credentials (>=1.0.0,<2.0.0)
Requires-Dist: codecraftai-foundations (>=1.0.0,<2.0.0)
Requires-Dist: codecraftai-this-app (>=1.0.0,<2.0.0)
Requires-Dist: codecraftai-xmodules (>=1.0.0,<2.0.0)
Requires-Dist: couchdb (>=1.2,<2.0.0) ; extra == "couchdb"
Requires-Dist: cryptography (>=45.0.5,<51.0.0)
Requires-Dist: pymongo (>=4.13.2,<5.0.0) ; extra == "pymongo"
Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
Requires-Dist: requests (>=2.32.4,<3.0.0)
Project-URL: Issues, https://github.com/code-craft-ai-company/codecraftai-configuration/issues
Project-URL: Repository, https://github.com/code-craft-ai-company/codecraftai-configuration
Description-Content-Type: text/x-rst

==============================
Code Craft AI Configuration
==============================

The ``codecraftai-configuration`` package is the configuration-loading and synchronisation layer for the ccai suite. It lets applications and tests pull configuration from a mix of local and remote sources, merge it through well-defined overrides, and (optionally) keep local copies in sync with a remote authority. It depends on ``codecraftai-foundations`` and ``codecraftai-credentials``, and is consumed widely across the suite.

Highlights
==========

- ``ConfigurationLoader`` top-level entry point that reads from a list of source URIs and produces a merged, normalised configuration.
- Pluggable ``ConfigurationSourceBase`` with concrete sources: ``DirectorySource``, ``HttpSource``, ``CouchDBSource``, and ``MongoDBSource``.
- ``ConfigSynchronizerBase`` family with ``DirectoryConfigSynchronizer``, ``CouchDbConfigSynchronizer``, ``MongoDbConfigSynchronizer``, and ``GithubConfigSynchronizer``.
- Supporting modules for formats, Fernet-based cryptography, option overrides, default values, and normalisation.

Repository Structure
====================

- ``development/`` - Runtime environment scripts.
- ``repository-setup/`` - Repository homing and setup scripts.
- ``source/packages/`` - Package source code.
- ``source/tests/`` - ``unittest``-based tests.
- ``specs/`` - Requirements, design, and task documentation.
- ``userguide/`` - Standards, conventions, and documentation.

Environment Setup
=================

When working in a Codex container:

.. code-block:: bash

   ./development/setup-agent-container

For local development:

.. code-block:: bash

   ./repository-setup/rehome-repository
   ./development/setup-envrionment

Running Tests
=============

Activate the virtual environment:

.. code-block:: bash

   source .venv/bin/activate

Run ``unittest`` tests:

.. code-block:: bash

   python -m unittest discover -s source/tests -p "test_*.py"

Standards and Conventions
=========================

- Naming conventions: ``userguide/10-02-naming-conventions.rst``
- Code organization: ``userguide/10-01-code-organization.rst``
- Coding standards: ``userguide/10-00-coding-standards.rst``

Additional Resources
====================

- User guide entry point: ``userguide/userguide.rst``
- Design documentation: ``specs/design.md``
- Requirements: ``specs/requirements.md``

