From 0563f0ca9ed22fb284904a86bab8805e3c6e0548 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 7 Dec 2025 01:51:43 +0000 Subject: [PATCH 1/2] Update openspec/project.md with project details Filled out project.md with details about Purpose, Tech Stack, Project Conventions, Domain Context, and External Dependencies. Added references to architectural documentation as requested. --- .../architecture/openspec/project.md | 51 +++++++++++++++---- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/documentation/architecture/openspec/project.md b/documentation/architecture/openspec/project.md index 3da5119..f8d1ef0 100644 --- a/documentation/architecture/openspec/project.md +++ b/documentation/architecture/openspec/project.md @@ -1,31 +1,62 @@ # Project Context ## Purpose -[Describe your project's purpose and goals] +`classcore` provides foundational class factories and decorators for providing classes with attribute immutability, concealment, and other custom behaviors. It aims to make Python programs safer by encouraging immutability and controlled attribute access, while integrating seamlessly with standard Python features like dataclasses and protocols. ## Tech Stack -- [List your primary technologies] -- [e.g., TypeScript, React, Node.js] +- **Languages**: Python 3.10+ +- **Build System**: Hatch +- **Package Management**: uv (recommended installation), pip +- **Testing**: pytest, coverage +- **Linting/Formatting**: ruff, isort, pyright, vulture +- **Documentation**: Sphinx, dynadoc +- **Release**: towncrier ## Project Conventions ### Code Style -[Describe your code style preferences, formatting rules, and naming conventions] +- **Line Length**: 79 characters. +- **Imports**: Sorted by `isort` with specific configuration (see `pyproject.toml`). +- **Linting**: Enforced by `ruff` and `pyright`. +- **Typing**: Strict type checking with `pyright`. +- **Import Hub Pattern**: Centralized import management via `sources/classcore/__/`. ### Architecture Patterns -[Document your architectural decisions and patterns] +- **Metaclass & Decorator Factories**: Use of factory functions to produce metaclass components and decorators. +- **Composable Behaviors**: Behaviors are applied via composable decorators and metaclasses. +- **Verifier Pattern**: Use of verifiers (names, regexes, predicates) for behavior configuration. +- **Core Function Replacement**: Dependency injection for core behaviors. +- **Module Reclassification**: Applying class behaviors to modules. +- See [System Overview](../summary.rst) for a comprehensive architectural summary. + +### Filesystem Organization +- The project follows a strict filesystem organization pattern. +- See [Filesystem Organization](../filesystem.rst) for detailed conventions. +- **Source**: `sources/classcore/` +- **Tests**: `tests/` +- **Docs**: `documentation/` +- **Dev**: `.auxiliary/` ### Testing Strategy -[Explain your testing approach and requirements] +- **Runner**: `pytest` +- **Coverage**: Strict coverage requirements enforced. +- **Structure**: Tests located in `tests/`, files named `test_*.py`. +- **Naming**: Test functions named `test_[0-9][0-9][0-9]_*`. ### Git Workflow -[Describe your branching strategy and commit conventions] +- **Changelog**: Managed by `towncrier` with fragments in `.auxiliary/data/towncrier`. +- **Commit Messages**: Should align with `towncrier` categories (enhance, notify, remove, repair). +- **Versioning**: Managed by Hatch. ## Domain Context -[Add domain-specific knowledge that AI assistants need to understand] +- **Immutability in Python**: Python does not support true immutability. This library provides "advisory" immutability that can be circumvented but prevents accidental modification. +- **Metaprogramming**: Heavy use of metaclasses (`__new__`, `__init__`) and decorators. +- **Mangled Names**: Use of SHA-256 for name mangling to avoid collisions. ## Important Constraints -[List any technical, business, or regulatory constraints] +- **Python Version Compatibility**: Must support Python 3.10 through 3.14 (and PyPy). +- **Performance**: Runtime overhead must be minimized; import costs centralized. ## External Dependencies -[Document key external services, APIs, or systems] +- **Standard Library**: `dataclasses`, `typing`, `functools`, `inspect`, etc. +- **Runtime**: `dynadoc`, `typing-extensions`. From dbcf2511475c0e897a95fbeb49698270c35aaf73 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 03:52:00 +0000 Subject: [PATCH 2/2] Update openspec/project.md based on feedback Replaced specific package name with generic term 'This package' to improve maintainability. --- documentation/architecture/openspec/project.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/architecture/openspec/project.md b/documentation/architecture/openspec/project.md index f8d1ef0..089a9d3 100644 --- a/documentation/architecture/openspec/project.md +++ b/documentation/architecture/openspec/project.md @@ -1,7 +1,7 @@ # Project Context ## Purpose -`classcore` provides foundational class factories and decorators for providing classes with attribute immutability, concealment, and other custom behaviors. It aims to make Python programs safer by encouraging immutability and controlled attribute access, while integrating seamlessly with standard Python features like dataclasses and protocols. +This package provides foundational class factories and decorators for providing classes with attribute immutability, concealment, and other custom behaviors. It aims to make Python programs safer by encouraging immutability and controlled attribute access, while integrating seamlessly with standard Python features like dataclasses and protocols. ## Tech Stack - **Languages**: Python 3.10+