codex-core 0.1.1__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- codex_core-0.2.1/.github/workflows/ci.yml +58 -0
- codex_core-0.2.1/.github/workflows/docs.yml +71 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/.github/workflows/publish.yml +6 -9
- {codex_core-0.1.1 → codex_core-0.2.1}/.gitignore +1 -0
- codex_core-0.2.1/.python-version +1 -0
- codex_core-0.2.1/CHANGELOG.md +101 -0
- codex_core-0.2.1/PKG-INFO +124 -0
- codex_core-0.2.1/README.md +83 -0
- {codex_core-0.1.1/docs/en_EN → codex_core-0.2.1/docs/en}/README.md +3 -3
- {codex_core-0.1.1/docs → codex_core-0.2.1/docs/en}/api/common.md +1 -1
- {codex_core-0.1.1/docs → codex_core-0.2.1/docs/en}/api/core.md +1 -1
- codex_core-0.2.1/docs/en/api/dev/check_runner.md +10 -0
- codex_core-0.2.1/docs/en/api/dev/index.md +12 -0
- codex_core-0.2.1/docs/en/api/dev/project_tree.md +10 -0
- codex_core-0.2.1/docs/en/api/dev/static_compiler.md +18 -0
- {codex_core-0.1.1/docs → codex_core-0.2.1/docs/en}/api/index.md +2 -1
- {codex_core-0.1.1/docs → codex_core-0.2.1/docs/en}/api/settings.md +1 -1
- {codex_core-0.1.1/docs/en_EN → codex_core-0.2.1/docs/en}/architecture/README.md +4 -1
- {codex_core-0.1.1/docs/en_EN → codex_core-0.2.1/docs/en}/architecture/platform/common.md +1 -1
- {codex_core-0.1.1/docs/en_EN → codex_core-0.2.1/docs/en}/architecture/platform/core.md +1 -1
- codex_core-0.2.1/docs/en/architecture/platform/dev.md +244 -0
- {codex_core-0.1.1/docs/en_EN → codex_core-0.2.1/docs/en}/architecture/platform/settings.md +1 -1
- {codex_core-0.1.1/docs/en_EN/guide → codex_core-0.2.1/docs/en/tasks}/getting_started.md +3 -2
- {codex_core-0.1.1 → codex_core-0.2.1}/docs/evolution/roadmap.md +1 -1
- {codex_core-0.1.1 → codex_core-0.2.1}/docs/index.md +4 -4
- codex_core-0.2.1/docs/planning/python_version_policy.md +35 -0
- {codex_core-0.1.1/docs/ru_RU → codex_core-0.2.1/docs/ru}/README.md +3 -3
- {codex_core-0.1.1/docs/ru_RU → codex_core-0.2.1/docs/ru}/architecture/README.md +4 -1
- {codex_core-0.1.1/docs/ru_RU → codex_core-0.2.1/docs/ru}/architecture/platform/common.md +1 -1
- {codex_core-0.1.1/docs/ru_RU → codex_core-0.2.1/docs/ru}/architecture/platform/core.md +1 -1
- codex_core-0.2.1/docs/ru/architecture/platform/dev.md +244 -0
- {codex_core-0.1.1/docs/ru_RU → codex_core-0.2.1/docs/ru}/architecture/platform/settings.md +1 -1
- {codex_core-0.1.1/docs/ru_RU/guide → codex_core-0.2.1/docs/ru/tasks}/getting_started.md +3 -2
- codex_core-0.2.1/docs/stylesheets/extra.css +18 -0
- codex_core-0.2.1/mkdocs.yml +92 -0
- codex_core-0.2.1/project_structure.txt +97 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/pyproject.toml +25 -5
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/common/loguru_setup.py +12 -14
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/core/base_dto.py +1 -2
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/core/pii.py +8 -6
- codex_core-0.2.1/src/codex_core/dev/check_runner.py +276 -0
- codex_core-0.2.1/src/codex_core/dev/project_tree.py +128 -0
- codex_core-0.2.1/src/codex_core/dev/static_compiler/__init__.py +18 -0
- codex_core-0.2.1/src/codex_core/dev/static_compiler/compiler.py +166 -0
- codex_core-0.2.1/src/codex_core/dev/static_compiler/css.py +70 -0
- codex_core-0.2.1/src/codex_core/dev/static_compiler/js.py +56 -0
- codex_core-0.2.1/tests/conftest.py +21 -0
- codex_core-0.2.1/tests/integration/conftest.py +7 -0
- codex_core-0.2.1/tests/unit/common/test_log_context.py +53 -0
- codex_core-0.2.1/tests/unit/common/test_loguru_setup.py +140 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/tests/unit/common/test_text.py +5 -0
- codex_core-0.2.1/tests/unit/conftest.py +7 -0
- codex_core-0.2.1/tests/unit/core/test_exceptions.py +16 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/tests/unit/core/test_pii.py +32 -1
- codex_core-0.2.1/tools/__init__.py +0 -0
- codex_core-0.2.1/tools/dev/README.md +41 -0
- codex_core-0.2.1/tools/dev/__init__.py +0 -0
- codex_core-0.2.1/tools/dev/check.py +22 -0
- codex_core-0.2.1/tools/dev/generate_project_tree.py +8 -0
- codex_core-0.2.1/uv.lock +1518 -0
- codex_core-0.1.1/.github/workflows/ci.yml +0 -56
- codex_core-0.1.1/.github/workflows/docs.yml +0 -46
- codex_core-0.1.1/CHANGELOG.md +0 -51
- codex_core-0.1.1/PKG-INFO +0 -79
- codex_core-0.1.1/README.md +0 -38
- codex_core-0.1.1/mkdocs.yml +0 -73
- codex_core-0.1.1/tests/conftest.py +0 -1
- codex_core-0.1.1/tools/dev/README.md +0 -23
- codex_core-0.1.1/tools/dev/check.py +0 -197
- codex_core-0.1.1/tools/dev/generate_project_tree.py +0 -119
- {codex_core-0.1.1 → codex_core-0.2.1}/.pre-commit-config.yaml +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/docs/changelog.md +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/__init__.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/common/__init__.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/common/log_context.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/common/phone.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/common/text.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/core/__init__.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/core/exceptions.py +0 -0
- {codex_core-0.1.1/tests/unit → codex_core-0.2.1/src/codex_core/dev}/__init__.py +0 -0
- /codex_core-0.1.1/tools/__init__.py → /codex_core-0.2.1/src/codex_core/py.typed +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/settings/__init__.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/src/codex_core/settings/base.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/tests/integration/__init__.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/tests/integration/test_settings_integration.py +0 -0
- {codex_core-0.1.1/tools/dev → codex_core-0.2.1/tests/unit}/__init__.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/tests/unit/common/__init__.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/tests/unit/common/test_phone.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/tests/unit/core/__init__.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/tests/unit/settings/__init__.py +0 -0
- {codex_core-0.1.1 → codex_core-0.2.1}/tests/unit/settings/test_settings.py +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
name: CI Pipeline
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
paths-ignore: ["**.md", "docs/**", ".gitignore"]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [main]
|
|
9
|
+
|
|
10
|
+
env:
|
|
11
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
quality-gate:
|
|
15
|
+
name: Quality Gate
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
- uses: astral-sh/setup-uv@v7
|
|
23
|
+
with:
|
|
24
|
+
version: "0.10.7"
|
|
25
|
+
|
|
26
|
+
- name: Sync dev environment
|
|
27
|
+
run: uv sync --locked --extra dev
|
|
28
|
+
|
|
29
|
+
- name: Run pre-commit
|
|
30
|
+
run: uv run pre-commit run --all-files
|
|
31
|
+
|
|
32
|
+
- name: Run pip-audit
|
|
33
|
+
run: uv run pip-audit
|
|
34
|
+
|
|
35
|
+
- name: Run mypy
|
|
36
|
+
run: uv run mypy src/codex_core/
|
|
37
|
+
|
|
38
|
+
unit-tests:
|
|
39
|
+
name: Unit Tests (Python ${{ matrix.python-version }})
|
|
40
|
+
needs: quality-gate
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
strategy:
|
|
43
|
+
matrix:
|
|
44
|
+
python-version: ["3.12", "3.13"]
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@v4
|
|
47
|
+
- uses: actions/setup-python@v5
|
|
48
|
+
with:
|
|
49
|
+
python-version: ${{ matrix.python-version }}
|
|
50
|
+
- uses: astral-sh/setup-uv@v7
|
|
51
|
+
with:
|
|
52
|
+
version: "0.10.7"
|
|
53
|
+
|
|
54
|
+
- name: Sync dev environment
|
|
55
|
+
run: uv sync --locked --extra dev
|
|
56
|
+
|
|
57
|
+
- name: Run unit tests
|
|
58
|
+
run: uv run pytest tests/ -m "unit" -v --tb=short
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: Deploy Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
inputs:
|
|
9
|
+
version:
|
|
10
|
+
description: "Version alias to deploy (e.g. 0.x, 1.x)"
|
|
11
|
+
required: true
|
|
12
|
+
alias:
|
|
13
|
+
description: "Alias (latest, stable, or leave empty)"
|
|
14
|
+
required: false
|
|
15
|
+
default: "latest"
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
19
|
+
|
|
20
|
+
permissions:
|
|
21
|
+
contents: write
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
deploy:
|
|
25
|
+
name: Build & Deploy Docs
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout code
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 0
|
|
32
|
+
|
|
33
|
+
- name: Configure Git Credentials
|
|
34
|
+
run: |
|
|
35
|
+
git config user.name github-actions[bot]
|
|
36
|
+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
37
|
+
|
|
38
|
+
- name: Set up Python 3.12
|
|
39
|
+
uses: actions/setup-python@v5
|
|
40
|
+
with:
|
|
41
|
+
python-version: "3.12"
|
|
42
|
+
- uses: astral-sh/setup-uv@v7
|
|
43
|
+
with:
|
|
44
|
+
version: "0.10.7"
|
|
45
|
+
|
|
46
|
+
- name: Sync docs environment
|
|
47
|
+
run: uv sync --locked --extra docs
|
|
48
|
+
|
|
49
|
+
- name: Resolve version alias (tag push)
|
|
50
|
+
if: github.event_name == 'push'
|
|
51
|
+
id: version
|
|
52
|
+
run: |
|
|
53
|
+
TAG="${GITHUB_REF_NAME}"
|
|
54
|
+
MAJOR=$(echo "$TAG" | sed 's/^v//' | cut -d. -f1)
|
|
55
|
+
echo "alias=${MAJOR}.x" >> "$GITHUB_OUTPUT"
|
|
56
|
+
|
|
57
|
+
- name: Deploy versioned docs (tag push)
|
|
58
|
+
if: github.event_name == 'push'
|
|
59
|
+
run: |
|
|
60
|
+
uv run mike deploy --push --update-aliases "${{ steps.version.outputs.alias }}" latest
|
|
61
|
+
uv run mike set-default --push latest
|
|
62
|
+
|
|
63
|
+
- name: Deploy versioned docs (manual)
|
|
64
|
+
if: github.event_name == 'workflow_dispatch'
|
|
65
|
+
run: |
|
|
66
|
+
if [ -n "${{ inputs.alias }}" ]; then
|
|
67
|
+
uv run mike deploy --push --update-aliases "${{ inputs.version }}" "${{ inputs.alias }}"
|
|
68
|
+
else
|
|
69
|
+
uv run mike deploy --push "${{ inputs.version }}"
|
|
70
|
+
fi
|
|
71
|
+
uv run mike set-default --push latest
|
|
@@ -3,7 +3,7 @@ name: Publish to PyPI
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
tags:
|
|
6
|
-
-
|
|
6
|
+
- "v*"
|
|
7
7
|
|
|
8
8
|
env:
|
|
9
9
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
@@ -29,18 +29,15 @@ jobs:
|
|
|
29
29
|
uses: actions/setup-python@v5
|
|
30
30
|
with:
|
|
31
31
|
python-version: "3.12"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
run: |
|
|
36
|
-
python -m pip install --upgrade pip
|
|
37
|
-
python -m pip install build twine hatchling
|
|
32
|
+
- uses: astral-sh/setup-uv@v7
|
|
33
|
+
with:
|
|
34
|
+
version: "0.10.7"
|
|
38
35
|
|
|
39
36
|
- name: Build sdist and wheel
|
|
40
|
-
run:
|
|
37
|
+
run: uv build --no-sources
|
|
41
38
|
|
|
42
39
|
- name: Check artifacts
|
|
43
|
-
run: twine check dist/*
|
|
40
|
+
run: uvx twine check dist/*
|
|
44
41
|
|
|
45
42
|
- name: Publish to PyPI
|
|
46
43
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.1] - 2026-03-29
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Locked UV Workflow**: Added `.python-version` and committed `uv.lock` so local development, CI, docs, and publish flows use a consistent locked dependency set.
|
|
12
|
+
- **Configurable Check Runner Stages**: Added `RUN_LINT`, `RUN_TYPES`, `RUN_SECURITY`, `RUN_EXTRA_CHECKS`, `RUN_UNIT_TESTS`, and `RUN_INTEGRATION_TESTS` flags to `BaseCheckRunner` so each codex-* project can declare its quality-gate policy without replacing orchestration logic.
|
|
13
|
+
- **Expanded Dev API Docs**: Split the Dev Tools API reference into separate pages for the check runner, project tree generator, and static compiler.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- **Python Support Policy**: Raised the declared minimum Python version to 3.12 and aligned Ruff, Mypy, packaging metadata, and CI matrices with the supported runtime versions.
|
|
17
|
+
- **UV-Based Automation**: Updated CI, docs deployment, and publish workflows to use `uv sync`, `uv run`, and `uv build` instead of ad-hoc pip installs.
|
|
18
|
+
- **Documentation Structure**:
|
|
19
|
+
- Synchronized `tools/dev/README.md` and architecture guides with the real `BaseCheckRunner` CLI and extension model.
|
|
20
|
+
- Reorganized the Dev Tools API navigation into a nested expandable section under `API Reference`.
|
|
21
|
+
- Moved the Python-version planning note into `docs/planning/` as an internal draft instead of a public docs root page.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- **Optional Loguru Typing**: Fixed `mypy` failure in `src/codex_core/common/loguru_setup.py` by making the optional `loguru` import type-safe.
|
|
25
|
+
- **Checker UX Consistency**: Added explicit skip messages when disabled check stages are not executed, improving both local and CI output clarity.
|
|
26
|
+
|
|
27
|
+
## [0.2.0] - 2025-02-13
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- **Python 3.13 Support**: Added official support for Python 3.13 in `pyproject.toml` classifiers.
|
|
31
|
+
- **Comprehensive Unit Tests**:
|
|
32
|
+
- New tests for `core/exceptions.py` covering base exception functionality.
|
|
33
|
+
- New tests for `common/log_context.py` covering `TaskLogContext` logging methods.
|
|
34
|
+
- New tests for `common/loguru_setup.py` covering `InterceptHandler`, `setup_universal_logging`, and `setup_logging` with and without `loguru` installed.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
- **Documentation Structure**:
|
|
38
|
+
- Renamed top-level language directories from `en_EN/` to `en/` and `ru_RU/` to `ru/`.
|
|
39
|
+
- Moved `api/` documentation into `en/api/` for better language-specific grouping.
|
|
40
|
+
- Renamed `guide/` directories to `tasks/` in both `en/` and `ru/` to align with `DocArchitect:StructurePolicy` for user-oriented guides.
|
|
41
|
+
- Updated `mkdocs.yml` navigation and all internal Markdown links to reflect the new documentation structure.
|
|
42
|
+
- Updated root `README.md` to strictly follow `DocArchitect:StructurePolicy` (Layer 5 - Root Landing), including a detailed `Modules` table (with `dev` module) and a comprehensive `Part of the Codex ecosystem` section.
|
|
43
|
+
- **Test Coverage Configuration**:
|
|
44
|
+
- Configured `pytest-cov` in `pyproject.toml` to include `addopts`, `[tool.coverage.run]`, and `[tool.coverage.report]` sections.
|
|
45
|
+
- Excluded `src/codex_core/dev/*` from coverage reports as these are internal development tools.
|
|
46
|
+
- Added `exclude_lines` for `TYPE_CHECKING` and `ImportError` to achieve accurate coverage metrics.
|
|
47
|
+
- **Test Isolation**: Implemented `autouse` fixture `reset_pii_registry` in `tests/conftest.py` to ensure `PIIRegistry` global state is reset between tests, guaranteeing test isolation.
|
|
48
|
+
- **Test Markers**: Created `tests/unit/conftest.py` and `tests/integration/conftest.py` to automatically apply `pytest.mark.unit` and `pytest.mark.integration` markers to tests within their respective directories.
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
- **Mypy Errors**: Resolved missing type parameters for generic types in `src/codex_core/dev/static_compiler/compiler.py` and `src/codex_core/dev/static_compiler/css.py`.
|
|
52
|
+
- **Ruff Errors**: Resolved `SIM118` (Use `key in dict` instead of `key in dict.keys()`) in `src/codex_core/core/pii.py`.
|
|
53
|
+
- **Ruff Errors**: Resolved `SIM117` (Use a single `with` statement with multiple contexts) in `tests/unit/common/test_loguru_setup.py`.
|
|
54
|
+
- **Test Coverage Gaps**:
|
|
55
|
+
- Covered `PIIRegistry` initialization logic and recursive list masking in `tests/unit/core/test_pii.py`.
|
|
56
|
+
- Covered falsy input handling in `transliterate` and `sanitize_for_sms` functions in `tests/unit/common/test_text.py`.
|
|
57
|
+
|
|
58
|
+
## [0.1.1] - 2025-02-12
|
|
59
|
+
|
|
60
|
+
### Added
|
|
61
|
+
- **Declarative PII Registry**: Introduced `PIIRegistry` class in `pii.py` for explicit sensitive field name tracking, complementing the heuristic keyword-based matching.
|
|
62
|
+
- **Enhanced Documentation**:
|
|
63
|
+
- Comprehensive Google-style docstrings added to all core modules: `log_context`, `loguru_setup`, `phone`, `text`, `base_dto`, `exceptions`, and `settings/base`.
|
|
64
|
+
- Added localized (EN/RU) documentation links and PyPI/License badges to `README.md`.
|
|
65
|
+
- **Dependency Management**: Added `loguru` as an explicit optional dependency in `pyproject.toml`.
|
|
66
|
+
|
|
67
|
+
### Changed
|
|
68
|
+
- **PII Masking Logic**: Refined `is_pii_field` and `mask_value` to prioritize explicit registry matches over heuristic keyword search.
|
|
69
|
+
- **Project Configuration**: Updated `.gitignore` to include `.claude/` for modern AI tool support.
|
|
70
|
+
|
|
71
|
+
## [0.1.0] - 2024-05-24
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
- **Project Structure**: Initial setup of the core library as a standalone project.
|
|
75
|
+
- **Advanced PII Protection**:
|
|
76
|
+
- Implementation of `BaseDTO` with automated, recursive PII masking in `repr` and `str`.
|
|
77
|
+
- Keyword-based sensitive data detection (phone, email, name, address, notes).
|
|
78
|
+
- **International Utilities**:
|
|
79
|
+
- `normalize_phone`: Robust normalization supporting `+`, `00`, and local German `0` formats.
|
|
80
|
+
- `normalize_name`: Smart capitalization preserving hyphens and spaces.
|
|
81
|
+
- `TaskLogContext`: Structured logging adapter for background tasks and operations.
|
|
82
|
+
- **Base Settings**: `BaseCommonSettings` with standardized Redis URL generation and environment-aware flags.
|
|
83
|
+
- **Documentation**:
|
|
84
|
+
- New Domain-Driven documentation standard (Architecture + API Reference).
|
|
85
|
+
- Bilingual support (EN/RU) with structural mirroring.
|
|
86
|
+
- **Testing**:
|
|
87
|
+
- Comprehensive unit test suite (27 scenarios) covering Core, Common, and Settings.
|
|
88
|
+
- Integration test for environment variable loading.
|
|
89
|
+
|
|
90
|
+
### Changed
|
|
91
|
+
- **Package Rename**: Renamed package from `codex_tools` to `codex_core` for better clarity.
|
|
92
|
+
- **Dependency Optimization**:
|
|
93
|
+
- `loguru` removed from mandatory dependencies.
|
|
94
|
+
- `loguru_setup` updated with safe imports and clear installation instructions.
|
|
95
|
+
- **CI/CD**:
|
|
96
|
+
- Switched GitHub Actions to use Node.js 24 (via `FORCE_JAVASCRIPT_ACTIONS_TO_NODE24`).
|
|
97
|
+
- Updated Mypy paths to reflect the new package structure.
|
|
98
|
+
|
|
99
|
+
### Security
|
|
100
|
+
- Integrated `bandit`, `pip-audit`, and `detect-secrets` into the development lifecycle.
|
|
101
|
+
- Standardized `quote_plus` usage for all infrastructure connection strings.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codex-core
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Core utilities, schemas and settings for Codex WaaS toolkit
|
|
5
|
+
Project-URL: Homepage, https://github.com/codexdlc/codex-core
|
|
6
|
+
Project-URL: Documentation, https://codexdlc.github.io/codex-core/
|
|
7
|
+
Project-URL: Repository, https://github.com/codexdlc/codex-core
|
|
8
|
+
Project-URL: Changelog, https://github.com/codexdlc/codex-core/blob/main/CHANGELOG.md
|
|
9
|
+
Project-URL: Issues, https://github.com/codexdlc/codex-core/issues
|
|
10
|
+
Author: CodexDLC
|
|
11
|
+
License: Apache-2.0
|
|
12
|
+
Keywords: core,pydantic,toolkit,waas
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
19
|
+
Requires-Python: >=3.12
|
|
20
|
+
Requires-Dist: pydantic-settings>=2.0
|
|
21
|
+
Requires-Dist: pydantic<3.0,>=2.0
|
|
22
|
+
Provides-Extra: dev
|
|
23
|
+
Requires-Dist: bandit>=1.7; extra == 'dev'
|
|
24
|
+
Requires-Dist: detect-secrets>=1.5; extra == 'dev'
|
|
25
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
26
|
+
Requires-Dist: pip-audit>=2.7; extra == 'dev'
|
|
27
|
+
Requires-Dist: pre-commit>=3.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
29
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
32
|
+
Provides-Extra: docs
|
|
33
|
+
Requires-Dist: mike>=2.0; extra == 'docs'
|
|
34
|
+
Requires-Dist: mkdocs-include-markdown-plugin; extra == 'docs'
|
|
35
|
+
Requires-Dist: mkdocs-material>=9.0; extra == 'docs'
|
|
36
|
+
Requires-Dist: mkdocs>=1.5; extra == 'docs'
|
|
37
|
+
Requires-Dist: mkdocstrings[python]>=0.24; extra == 'docs'
|
|
38
|
+
Provides-Extra: loguru
|
|
39
|
+
Requires-Dist: loguru>=0.7.0; extra == 'loguru'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
<!-- Type: LANDING -->
|
|
43
|
+
# codex-core
|
|
44
|
+
|
|
45
|
+
[](https://pypi.org/project/codex-core/)
|
|
46
|
+
[](https://pypi.org/project/codex-core/)
|
|
47
|
+
[](https://github.com/codexdlc/codex-core/blob/main/LICENSE)
|
|
48
|
+
[](https://codexdlc.github.io/codex-core/)
|
|
49
|
+
|
|
50
|
+
Core utilities, immutable DTOs, and environment-driven settings for the Codex WaaS toolkit.
|
|
51
|
+
Provides the foundational building blocks and PII masking used by all other Codex components.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Install
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Core only
|
|
59
|
+
pip install codex-core
|
|
60
|
+
|
|
61
|
+
# With Loguru support for advanced structured logging
|
|
62
|
+
pip install "codex-core[loguru]"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Requires Python 3.12 or newer.
|
|
66
|
+
|
|
67
|
+
## Development
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
uv sync --extra dev
|
|
71
|
+
uv run pytest
|
|
72
|
+
uv run mypy src/codex_core/
|
|
73
|
+
uv run pre-commit run --all-files
|
|
74
|
+
uv build --no-sources
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Requires Python 3.12 or newer.
|
|
78
|
+
|
|
79
|
+
## Quick Start
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from codex_core.core.base_dto import BaseDTO
|
|
83
|
+
|
|
84
|
+
# 1. Define an immutable, PII-aware data transfer object
|
|
85
|
+
class UserDTO(BaseDTO):
|
|
86
|
+
id: int
|
|
87
|
+
email: str # Automatically masked in logs
|
|
88
|
+
phone_number: str # Automatically masked in logs
|
|
89
|
+
|
|
90
|
+
user = UserDTO(id=42, email="user@example.com", phone_number="+491511234567")
|
|
91
|
+
|
|
92
|
+
# 2. Safely log the DTO without leaking personal data
|
|
93
|
+
print(user)
|
|
94
|
+
# Output: UserDTO(id=42, email='***', phone_number='***')
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Modules
|
|
98
|
+
|
|
99
|
+
| Module | Extra | Description |
|
|
100
|
+
| :--- | :--- | :--- |
|
|
101
|
+
| `codex_core.core` | - | Immutable `BaseDTO` and automated `PIIRegistry` for GDPR-safe logging. |
|
|
102
|
+
| `codex_core.common` | `[loguru]` | Phone/name normalization and structured logging adapters (`TaskLogContext`). |
|
|
103
|
+
| `codex_core.settings` | - | Environment-driven configuration via `BaseCommonSettings` (Pydantic Settings). |
|
|
104
|
+
| `codex_core.dev` | `[dev]` | Internal developer tools (`BaseCheckRunner`, `StaticCompiler`, `ProjectTreeGenerator`). |
|
|
105
|
+
|
|
106
|
+
## Documentation
|
|
107
|
+
|
|
108
|
+
Full docs with architecture, API reference, and data flow diagrams:
|
|
109
|
+
|
|
110
|
+
**[https://codexdlc.github.io/codex-core/](https://codexdlc.github.io/codex-core/)**
|
|
111
|
+
|
|
112
|
+
## Part of the Codex ecosystem
|
|
113
|
+
|
|
114
|
+
| Package | Role |
|
|
115
|
+
| :--- | :--- |
|
|
116
|
+
| **codex-core** | Foundation — immutable DTOs, PII masking, env settings |
|
|
117
|
+
| [codex-platform](https://github.com/codexdlc/codex-platform) | Infrastructure — Redis, Streams, ARQ workers, Notifications |
|
|
118
|
+
| [codex-ai](https://github.com/codexdlc/codex-ai) | LLM layer — unified async interface for OpenAI, Gemini, Anthropic |
|
|
119
|
+
| [codex-services](https://github.com/codexdlc/codex-services) | Business logic — Booking engine, CRM, Calendar |
|
|
120
|
+
|
|
121
|
+
Each library is **fully standalone** — install only what your project needs.
|
|
122
|
+
Together they form the backbone of **[codex-bot](https://github.com/codexdlc/codex-bot)**
|
|
123
|
+
(Telegram AI-agent infrastructure built on aiogram) and
|
|
124
|
+
**[codex-django](https://github.com/codexdlc/codex-django)** (Django integration layer).
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<!-- Type: LANDING -->
|
|
2
|
+
# codex-core
|
|
3
|
+
|
|
4
|
+
[](https://pypi.org/project/codex-core/)
|
|
5
|
+
[](https://pypi.org/project/codex-core/)
|
|
6
|
+
[](https://github.com/codexdlc/codex-core/blob/main/LICENSE)
|
|
7
|
+
[](https://codexdlc.github.io/codex-core/)
|
|
8
|
+
|
|
9
|
+
Core utilities, immutable DTOs, and environment-driven settings for the Codex WaaS toolkit.
|
|
10
|
+
Provides the foundational building blocks and PII masking used by all other Codex components.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Core only
|
|
18
|
+
pip install codex-core
|
|
19
|
+
|
|
20
|
+
# With Loguru support for advanced structured logging
|
|
21
|
+
pip install "codex-core[loguru]"
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Requires Python 3.12 or newer.
|
|
25
|
+
|
|
26
|
+
## Development
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv sync --extra dev
|
|
30
|
+
uv run pytest
|
|
31
|
+
uv run mypy src/codex_core/
|
|
32
|
+
uv run pre-commit run --all-files
|
|
33
|
+
uv build --no-sources
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Requires Python 3.12 or newer.
|
|
37
|
+
|
|
38
|
+
## Quick Start
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from codex_core.core.base_dto import BaseDTO
|
|
42
|
+
|
|
43
|
+
# 1. Define an immutable, PII-aware data transfer object
|
|
44
|
+
class UserDTO(BaseDTO):
|
|
45
|
+
id: int
|
|
46
|
+
email: str # Automatically masked in logs
|
|
47
|
+
phone_number: str # Automatically masked in logs
|
|
48
|
+
|
|
49
|
+
user = UserDTO(id=42, email="user@example.com", phone_number="+491511234567")
|
|
50
|
+
|
|
51
|
+
# 2. Safely log the DTO without leaking personal data
|
|
52
|
+
print(user)
|
|
53
|
+
# Output: UserDTO(id=42, email='***', phone_number='***')
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Modules
|
|
57
|
+
|
|
58
|
+
| Module | Extra | Description |
|
|
59
|
+
| :--- | :--- | :--- |
|
|
60
|
+
| `codex_core.core` | - | Immutable `BaseDTO` and automated `PIIRegistry` for GDPR-safe logging. |
|
|
61
|
+
| `codex_core.common` | `[loguru]` | Phone/name normalization and structured logging adapters (`TaskLogContext`). |
|
|
62
|
+
| `codex_core.settings` | - | Environment-driven configuration via `BaseCommonSettings` (Pydantic Settings). |
|
|
63
|
+
| `codex_core.dev` | `[dev]` | Internal developer tools (`BaseCheckRunner`, `StaticCompiler`, `ProjectTreeGenerator`). |
|
|
64
|
+
|
|
65
|
+
## Documentation
|
|
66
|
+
|
|
67
|
+
Full docs with architecture, API reference, and data flow diagrams:
|
|
68
|
+
|
|
69
|
+
**[https://codexdlc.github.io/codex-core/](https://codexdlc.github.io/codex-core/)**
|
|
70
|
+
|
|
71
|
+
## Part of the Codex ecosystem
|
|
72
|
+
|
|
73
|
+
| Package | Role |
|
|
74
|
+
| :--- | :--- |
|
|
75
|
+
| **codex-core** | Foundation — immutable DTOs, PII masking, env settings |
|
|
76
|
+
| [codex-platform](https://github.com/codexdlc/codex-platform) | Infrastructure — Redis, Streams, ARQ workers, Notifications |
|
|
77
|
+
| [codex-ai](https://github.com/codexdlc/codex-ai) | LLM layer — unified async interface for OpenAI, Gemini, Anthropic |
|
|
78
|
+
| [codex-services](https://github.com/codexdlc/codex-services) | Business logic — Booking engine, CRM, Calendar |
|
|
79
|
+
|
|
80
|
+
Each library is **fully standalone** — install only what your project needs.
|
|
81
|
+
Together they form the backbone of **[codex-bot](https://github.com/codexdlc/codex-bot)**
|
|
82
|
+
(Telegram AI-agent infrastructure built on aiogram) and
|
|
83
|
+
**[codex-django](https://github.com/codexdlc/codex-django)** (Django integration layer).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[🏠 Home](../index.md) | [🧭 Guide (EN)](README.md) | [⚙️ API Reference](
|
|
1
|
+
[🏠 Home](../index.md) | [🧭 Guide (EN)](README.md) | [⚙️ API Reference](api/index.md)
|
|
2
2
|
|
|
3
3
|
# Guide: Overview (EN)
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ Welcome to the **codex-core** guide! This library serves as the shared foundatio
|
|
|
6
6
|
|
|
7
7
|
## Documentation Sections
|
|
8
8
|
|
|
9
|
-
### 1. [Getting Started](
|
|
9
|
+
### 1. [Getting Started](tasks/getting_started.md)
|
|
10
10
|
How to install and integrate `codex-core` into your project.
|
|
11
11
|
|
|
12
12
|
### 2. [🛡️ Architecture & Platform](architecture/README.md)
|
|
@@ -19,5 +19,5 @@ Detailed breakdown of the core platform components:
|
|
|
19
19
|
### 3. [🗺 Evolution](../evolution/roadmap.md)
|
|
20
20
|
Our core purpose and development philosophy.
|
|
21
21
|
|
|
22
|
-
### 4. [⚙️ API Reference](
|
|
22
|
+
### 4. [⚙️ API Reference](api/index.md)
|
|
23
23
|
Technical details for developers.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!-- Type: REFERENCE -->
|
|
2
|
+
[🏠 Home](../../../index.md) | [⚙️ API Reference](../index.md) | [🛠️ Check Runner](check_runner.md)
|
|
3
|
+
|
|
4
|
+
# Check Runner API
|
|
5
|
+
|
|
6
|
+
Reference for the shared quality-gate runner used by project-level `tools/dev/check.py` scripts.
|
|
7
|
+
|
|
8
|
+
## BaseCheckRunner
|
|
9
|
+
|
|
10
|
+
::: codex_core.dev.check_runner.BaseCheckRunner
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!-- Type: REFERENCE -->
|
|
2
|
+
[🏠 Home](../../../index.md) | [⚙️ API Reference](../index.md) | [🛠️ Dev Tools](index.md)
|
|
3
|
+
|
|
4
|
+
# Dev Tools API
|
|
5
|
+
|
|
6
|
+
This section documents the internal development utilities shipped with `codex-core`.
|
|
7
|
+
|
|
8
|
+
## Modules
|
|
9
|
+
|
|
10
|
+
- [Check Runner](check_runner.md): shared quality-gate orchestration for codex-* projects
|
|
11
|
+
- [Project Tree](project_tree.md): project structure export for documentation and onboarding
|
|
12
|
+
- [Static Compiler](static_compiler.md): pure-Python CSS and JS bundling helpers
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<!-- Type: REFERENCE -->
|
|
2
|
+
[🏠 Home](../../../index.md) | [⚙️ API Reference](../index.md) | [🌳 Project Tree](project_tree.md)
|
|
3
|
+
|
|
4
|
+
# Project Tree API
|
|
5
|
+
|
|
6
|
+
Reference for the utility that exports a readable project tree for docs and onboarding flows.
|
|
7
|
+
|
|
8
|
+
## ProjectTreeGenerator
|
|
9
|
+
|
|
10
|
+
::: codex_core.dev.project_tree.ProjectTreeGenerator
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- Type: REFERENCE -->
|
|
2
|
+
[🏠 Home](../../../index.md) | [⚙️ API Reference](../index.md) | [🧱 Static Compiler](static_compiler.md)
|
|
3
|
+
|
|
4
|
+
# Static Compiler API
|
|
5
|
+
|
|
6
|
+
Reference for the pure-Python asset compilation helpers in `codex_core.dev.static_compiler`.
|
|
7
|
+
|
|
8
|
+
## StaticCompiler
|
|
9
|
+
|
|
10
|
+
::: codex_core.dev.static_compiler.compiler.StaticCompiler
|
|
11
|
+
|
|
12
|
+
## CSSCompiler
|
|
13
|
+
|
|
14
|
+
::: codex_core.dev.static_compiler.css.CSSCompiler
|
|
15
|
+
|
|
16
|
+
## JSCompiler
|
|
17
|
+
|
|
18
|
+
::: codex_core.dev.static_compiler.js.JSCompiler
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[🏠 Home](
|
|
1
|
+
[🏠 Home](../../index.md) | [🧭 Guide (EN)](../README.md) | [⚙️ API Reference](index.md)
|
|
2
2
|
|
|
3
3
|
# API Reference Overview
|
|
4
4
|
|
|
@@ -9,6 +9,7 @@ Welcome to the **codex-core** API Reference! This section provides detailed info
|
|
|
9
9
|
- **[🛡️ Core (DTO & PII)](core.md)**: Base data models and PII protection utilities.
|
|
10
10
|
- **[🛠️ Common (Utilities)](common.md)**: Phone, text, and logging helpers.
|
|
11
11
|
- **[⚙️ Settings (Config)](settings.md)**: Base configuration patterns.
|
|
12
|
+
- **[🛠️ Dev Tools](dev/index.md)**: Internal developer tools split by subsystem.
|
|
12
13
|
|
|
13
14
|
## Technical Details
|
|
14
15
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- Type: CONCEPT -->
|
|
2
|
+
[🏠 Home](../../index.md) | [🧭 Guide (EN)](../README.md) | [🛡️ Architecture](README.md)
|
|
2
3
|
|
|
3
4
|
# 🛡️ Architecture & Platform Overview (EN)
|
|
4
5
|
|
|
@@ -12,6 +13,7 @@ We divide the platform into three main domains, each serving a specific purpose:
|
|
|
12
13
|
| **[🛡️ Core](platform/core.md)** | Essential data models and security. | `BaseDTO`, PII Masking, `mask_value`. |
|
|
13
14
|
| **[🛠️ Common](platform/common.md)** | Standardized utility functions. | `normalize_phone`, `normalize_name`, `TaskLogContext`. |
|
|
14
15
|
| **[⚙️ Settings](platform/settings.md)** | Infrastructure configuration. | `BaseCommonSettings`, `redis_url`. |
|
|
16
|
+
| **[🛠️ Dev Tools](platform/dev.md)** | Shared developer tooling. | `BaseCheckRunner`, `ProjectTreeGenerator`, `StaticCompiler`. |
|
|
15
17
|
|
|
16
18
|
## Core Principles
|
|
17
19
|
1. **Security First**: PII protection is integrated at the base DTO level.
|
|
@@ -23,3 +25,4 @@ We divide the platform into three main domains, each serving a specific purpose:
|
|
|
23
25
|
- Read about [🛡️ Core: PII & DTO](platform/core.md).
|
|
24
26
|
- Explore [🛠️ Common Utilities](platform/common.md).
|
|
25
27
|
- Understand [⚙️ Settings Architecture](platform/settings.md).
|
|
28
|
+
- Review [🛠️ Dev Tools](platform/dev.md).
|